dar-2.5.3/0000755000175000017520000000000012642474572007307 500000000000000dar-2.5.3/INSTALL0000644000175000017430000000056312610404647010253 00000000000000 I N S T A L L A T I O N I N S T R U C T I O N S For the impatients using a released or pre-release package: ./configure [--enable-mode=64] make make install-strip for the others and for more detailed information, please read the complete documentation pointing your html browser to: doc/from_sources.html dar-2.5.3/THANKS0000644000175000017430000003637612642474445010160 00000000000000version 2.5.3 -------------- Thanks to Neil Darlow for feedback. Thanks to xloem at sourceforge for bugs report, troubleshooting and fixes, great job! Thanks to xloem again for the proposed patches. Thanks to Matteo Sasso for bug report. Thanks to Gulikoza for improvement proposal and patch. version 2.5.2 -------------- Thanks to Peter Colberg for feedback and bug report version 2.5.0 -------------- Thanks to Gour for help in testing dar_split with multi-volume dar archive on tapes. version 2.4.20 -------------- Thanks to Mike P for bug report version 2.4.19 -------------- Thanks to Ivan Krylov for bug analysis and Gour for feedback. Thanks to Dave Serls for feedback and bug report. version 2.4.18 -------------- Thanks to Scott DeRousse for feedback and patch to have libdar working when libgcrypt is used in FIPS mode. version 2.4.17 -------------- version 2.4.16 -------------- Thanks to Georg Sauthoff for clear bug report and to Oleksandr Chumachenko for patches against bashisms in doc/sample scripts. version 2.4.15 -------------- Thanks to Ryan Schmidt for feedback and typo corrections. Thanks to Jer Fort for bug report and again to Neil Darlow for providing access to a FreeBSD system. version 2.4.14 -------------- Thanks to Neil Darlow again for help with FreeBSD systems. version 2.4.13 -------------- Thanks to Neil Darlow for providing access to his FreeBSD server in order to solve compilation issues using clang and compilation warning generated by libgcrypt included headers. Thanks to lopezibanez, alexander-a (aka pansa) and Mike Lenzen for bugs report. version 2.4.12 -------------- Thanks to Mike Lenzenn for bug report. Thanks to Misty de Meo, Fabian Stanke, Ryan Schmidt and Jan Gossmann for their feedback and patches about compilation and message display problems under Mac OS X. version 2.4.11 -------------- Thanks to Dan on dar-support mailing-list for feedback. Thanks to Aymeric Petit for feedback. Thanks to Alexey Dubinin for bug report. Last, Thanks to Thomas Jarosch for his patches generated using cppcheck tool. version 2.4.10 -------------- Thanks to Philippe Naudin for bug report and help. Thanks to Jim Avera for bug report. version 2.4.9 -------------- Thanks to "JBThiel" for bug report on dar-support mailing-list. Thanks to Kevin Wormington for feedback and tests. Thanks to Neil Darlow for feedbacks and patch about syntax error in configure script. Thanks to Aleksey Naumov for feedback, bug report and help. Thanks to Martin Zuther and Marcin Garski for bug report with provided test scenario to reproduce the bug. Thanks to Brian May at Debian and Graham Cobb for feedback and proposal for a modified behavior of dar_manager. version 2.4.8 -------------- Thanks to Mario for help investigating the reason of strange messages reported by libdar whe virtual memory is exhausted. Thanks to "Fredquerty2003" (aka Richard) and Jeremy Faith for bugs report, and to Mario Metzler for bug report and help resolving the reported bug. Last, thanks again to Philippe Naudin this time for improvement suggestion. version 2.4.7 -------------- Thanks to Vladimir Mosgalin (once again) for bug report and proposed fix. Thanks to Gilles Hamel and David Palmer for bug report. version 2.4.6 -------------- Thanks to Per Grahn for bug report and problem analysis. Thanks to Brian May I forgot so many times to underline his constribution by porting dar/libdar to Debian for that many years. version 2.4.5 -------------- Thanks to Piotr Domanski and Paolo Sala for bug report. Thanks to Andreas Wolff for feedback and bug fix. A Big Thank to Neil Darlow who provided a great support in solving a bug in libdar that only expressed on ArchLinux and dynamic binary and infinint mode when used at the same time. version 2.4.4 -------------- Thanks again to Jurgen Nagler-Ihlein for bug report. version 2.4.3 -------------- Thanks to Jurgen Nagler-Ihlein for bug report. Thanks to Stefan J. Betz, Philippe Naudin, Vladimir Mosgalin and Andrea Vai for help in troubleshooting dar's memory usage. version 2.4.2 -------------- Thanks to Philippe Naudin for feedback and tests. Thanks to Jurgen Nagler-Ihlein for reports and compilation fix. Thanks to Hauke Laging for feedback. version 2.4.1 -------------- Thanks again to Peter Ladgren for Swedish translation. Thanks to Giuseppe Borzi for feedback. Thanks to Jurgen Nagler-Ihlein for feedback and help in troubleshooting. version 2.4.0 -------------- Thanks to Wiebe Cazemier for feedback and patch for documentation. Thanks to Dave Vasilevsky for bug fix and feedback. Thanks to Erik Wasser for patch. Thanks to Sony Electronics Inc. Thanks to T. Leske for his proposal of using libgcrypt and patch against 2.3.x versions. Thanks to Vladimir Mosgalin for feedback and testing on Solaris and several other Unix systems. Thanks again to Peter Landgren for Swedish translation. version 2.3.12 -------------- Thanks to Angela Kahealani for feedback. version 2.3.11 -------------- Thanks to Douglas for bug report and feedback. Thanks to Jean-Christophe Arnu and Jonathan (via Sourceforge) for bug reports. version 2.3.10 -------------- Thanks to Patrick G. for feedback and help solving the bug [SF 2922417], and to Jan-Pascal van Best for his patch. Thanks to TONG for feedback and bug report. version 2.3.9 -------------- Thanks to Jan-Pascal van Best for bug report and patch. version 2.3.8 -------------- Thanks to smartyxt for bug report. A big thank you to Szymon Juraszczyk for double bug report and detailed scenario to reproduce them. version 2.3.7 -------------- Thanks to Don and Andy Shellam for feedback. B0mber for bug report. Thanks to timkoder for bug report about documentation. version 2.3.6 -------------- Thanks to Marco Atzeri for feedback. Thanks to lucatrv for feedback. Thanks once again to Jo (aka Jo - ex-bart) for bug feedback. Thanks to Dorphell for bug report. version 2.3.5 -------------- Thanks to Sonni Norlov for optimization patch. Thanks again to Peter Landgren for Swedish translation and bug report. Thanks also to David Fries for patch. version 2.3.4 -------------- Thanks once again to Jo (aka Jo - ex-bart) for feedback and clean scenario to reproduce an unexpected behavior. Thanks to Norman J Davis for bug and patch feedback. Johnathan Burchill for feedback. Thanks to Dwayne C. Litzenberger for feedback and patch. version 2.3.3 -------------- Thanks to Mike P. for bug feedback. Thanks to "Jo - ex-bart" for feedback and very useful scenario to reproduce the reported bugs. Thanks to "Marius" for feedback. Thanks to Veysel Ozer for feedback and patch. Thanks to tianmiao for feedback and bug report. Thanks to Oliver Winker for feedback and investigations. Thanks to Andrea Palazzi for patch. version 2.3.2 -------------- Thanks to Thomas Jacob for feedback and patch about bug in Native Language Support and also for feedback and investigations about the --recent bug. Thanks to Dave Vasilevsky for bug report and design considerations. Thanks to Richard Fish for feedback, bug report and patch. Thanks to Stephan for feedback about Guus Jansman's Midnight Commander's plugin for Dar. Thanks also to Guus Jansman for his work. Thanks to Piotr Oh for feedback. version 2.3.1 -------------- Thanks to Adam Fuksa for bug feedback. Thanks to Nick Alcock and to Wiebe Cazemier for feedback and patch. Thanks to Nebojsa for feedback. Thanks to Brian May (@Debian) and Alexei Sheplyakov for feedback. Thanks also to Marko Lavikainen for feedback. version 2.3.0 -------------- Thanks to Wesley Leggette again for his feedback and for his many proposed patchs for new features. Thanks to Dave Vasilevsky for his patch opening support for EA and file forks under MacOS X. Thanks to "ex-bart" for feedback and very interesting feature request. Thanks to Uwe Freese for feedback. Thanks to Aaron D. Marasco for feedback. And as always, thanks to Johnathan Burchill (author of kdar) for appreciated feedback remarks and proposals. Thanks to Michael Roitzsch for bug fix. A special Thanks goes to Michael Roitzsch (again him ;-)) Rodd Zurcher, Helmut Jarausch and markus Kamp (again him ;-)) for helping make this release stable thanks to their feedback and participation to the pre-release phase. version 2.2.7 ------------- Thanks to Markus Kamp for German Translation version 2.2.6 ------------- Thanks to Gerald Britton and Halfgaar (Wiebe Cazemier) for reporting bug problem. version 2.2.5 -------------- Thanks to "Steffe" for feedback and suggestion, to Andrey Yasniy and to Nick Alcock for feedback and patches. version 2.2.4 -------------- Thanks to Martin Ehmsen for feedback and investigations. Thanks to Roi Rodriguez Mendez & Mauro Silvosa Rivera for sharing their backup script. version 2.2.3 -------------- Thanks to Andrew(ziem) for feedback. Thanks to Bob Barry for his script giving a raw estimation of the memory requirement for dar. Thanks again to Wesley Leggette for feedback. Thanks to Jakub Holy for feedback and providing some helper scripts for dar. Thanks also to Brian May (Debian maintainer for dar) for transmitting me feedback and patches. Thanks to Martin Jost for patch and feedback about the API tutorial. Thanks to Jeremy C. Reed and to HansS713 for feedback. version 2.2.2 -------------- Thanks to Ryan Vietri for feedback. Thanks to Ralph Slooten for feedback, and tutorial spelling fix. Thanks to Juergen Menden for feedback and patch and to Peter Landgren for feedback and Swedish translation, thanks to Olive for feedback and patience ;-). Last, a Very Big Thank to Wesley Leggette again for his many feedbacks, patches and constructive remarks. version 2.2.1 -------------- Thanks to Steve Evans for feedback and solution about bug #30. A big thank to P-O Yliniemi (alias Peo) for feedback and for providing me the necessary mean to investigate the problem of the "stack overflow" (compiler problem). Thanks to Karl W. Weigel for reporting bug #31 and for his useful feedback. A Big Thanks to Thomas Bettler for feedback about bug #32 which was difficult to reproduce and fix. Thanks to Matthias Keller for reporting bug #33 and to Joe Harvell for reporting bug #34. version 2.2.0 -------------- Thanks to "Gandalf" for his feedback and the "cache" implementation to decrease context switches when dar is run through ssh for differential backup. Thanks to Lars H. Rohwedder for a very interesting discussion feedback and suggestion for the -aSI/-abinary options, thanks also to him for the informations provided and for the implementation suggestions about strong encryption. Thanks to "nedkonz" for his idea of the "on-fly" isolation. Thanks to Holger Hoffstaette for feedback, Thanks to Uwe Freese for feedback about dar_manager, and a big Thanks to Tristan Rhodes who helps me answering support requests. A special thanks to Matthew Caron for his sens of humor and interesting script. Thanks also to Brian Daniels for feedback about a compilation problem under x86_64 and to Todd Vierling for giving feedback and sending patches to make dar possible to compile on Interix system. Thanks to David Gervasoni for having translated to Italian Grzegorz Adam Hankiewicz's mini-howto. Thanks also to Christian Neumann for API design suggestions and once again to Johnathan Burchill (the author of KDAR) for API suggestions, ideas and feedback. version 2.1.5 ------------- Thanks to Peter Landgren and Johnathan Burchill for reporting bug #29. Thanks to Brian May and to Travis (Tilley ?) for feedback. version 2.1.4 ------------- Thanks to Marius Tomaschewski, for reporting investigating and fix proposal for bug #28. version 2.1.3 ------------- Jean-Louis Liagre for feedback and help for porting dar to solaris 9. Thanks to Peter Kupec for feedback and for having found bug #26. Thanks to Wesley Leggette for having found bug #25. version 2.1.2 ------------- Many thanks to Omer Enbar for his patience, perseverance, and the patch he proposed that fixed the bug #24. Thanks again to Arcady Genkin for reporting bug #23 version 2.1.1 ------------- Bill P. for feedback. Thanks to Arcady Genkin for reporting bug #21, #22, #23 version 2.1.0 ------------- Thanks to Shanon Denize for its suggestion about -wa option, to Lars Schmidt-Thieme for his suggestion about -as option. And, thanks to "nedkonz" on the historical forum, for feedback, and Nick Alcock for his "tiny" patch and feedback about GNU Coding Standards. Thanks to Tami King for feedback and help. Thanks to Patrick Drechsler for typo error feedback version 2.0.4 -------------- Thanks to Matthew Valites and "nedkonz" for feedback about large file support. version 2.0.3 -------------- Thanks to "Gandalf" on the historical forum for having reported bug #20 version 2.0.2 -------------- Thanks to Ruslan Hristov for reporting bug #18 (Sourceforge bug 850279), and thanks to Joshua Neal for reporting bug #19 (Sourceforge bug 851320). version 2.0.1 -------------- Thanks to David Baldwin for reporting bug #17 (Sourceforge bug 837735). version 2.0.0 -------------- Thanks to Jules for its suggestion about altern memory allocation when a lot of small blocks are asked and are only released at the end of the program, this is the base of the "special allocation". Thanks to Adam Sherman for presenting me Parchive. Thanks to Johnathan Burchill (author of kdar) for his feedback about the libdar API, and help in fixing bugs in pre-release 1, and in release 1.3.0 bug #15. Thanks to Sergei Suyev for feedback. Thanks to Grzegorz Adam Hankiewicz for its mini-howto. Thanks to Peter Kupec for having found and reported bug #16, and for his attention to documentation coherence, and his intensive testing. version 1.3.0 -------------- Thanks to David Rose for having found, identified an proposed a patch for bug #12. Memory leakages in general are difficult to find, thus congratulations ! Thanks to Oliver Brendel for the great help and patience to my many asked tests to solve the bug #13, bug I could not reproduce. Thanks to John Reynolds for feedback. Thanks also to Rgbtxus for the --flat option need expression. Thanks to Sergio Borghese for reporting bug #11. Nicola Larosa for his suggestions about UPX (which will be considered for dar 2.x.x series), Dietrich Rothe for the --nodump feature request, and many others for feedback and encouragements. version 1.2.1 --------------- Thanks to Axel Kohlmeyer for his patch about RPMS, Dietrich Rothe for its patch on compression level, Brian May for his patches to comply with Debian distro, Ulrich Hagen D.A.M Revok, Jahn Wells, Juhana Sadeharju, for their feedback and John Little for compiling the FAQ and man pages on the web. version 1.2.0 --------------- Thanks to Chris Martin, Jerome Zago, Tim Doerzbacher, Sebastien Robart, Kurt Palmer, Bernd Storsberg, Egor Cheshkov, Richard Bratt for feedback and suggestions. I must add a special Thanks to Chris Martin who realized a simple and efficient tool that generates the usage C++ code from files written in XML syntax, making automatic word wrapping and indentation. This power tool named "dar-help" is licensed as part of DAR, but has been totally designed and written by Chris. version 1.1.0 --------------- Thanks to Moritz Franosch for intensive testing, for finding several bugs and proposing patches, to John Little for testing dar and for providing a forum area, to Ulrich Hagen, Francois Botha, Tobias Jahn for feedback, and to Andreas Gruenbacher for its Extended Attributes software, and its useful answers to my questions. Thanks to the many other people that just encouraged me by their remarks and compliments. dar-2.5.3/depcomp0000755000175000000000000005064311777117217010573 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: dar-2.5.3/Makefile.am0000444000175000017520000000026612642474464011265 00000000000000SUBDIRS = man src doc misc po dist_noinst_DATA = INSTALL README THANKS TODO AUTHORS COPYING ChangeLog NEWS ABOUT-NLS ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = config.rpath m4/ChangeLog dar-2.5.3/AUTHORS0000644000175000017430000000733412642474041010275 00000000000000 D i s k A R c h i v e - D A R --------- ----- _ Original Design & Development: Denis Corbin Several patches are from Wesley Leggette, Dave Vasilevsky, Nick Alcock, Brian May, Martin Jost, Jurgen Menden, Todd Vierling Omer Enbar, David Rose, Alex Kohlmeyer, Dietrich Rothe, Moritz Franosch, John Little, Chris Martin, Michael Roitzsch, Andrea Palazzi, Dwayne C. Litzenberger, Erik Wasser, Sonni Norlov, David Fries, Jan-Pascal van Best. Translations of program messages are from: Peter Landgren for Swedish Markus Kamp for German Denis Corbin for French http://dar.linux.free.fr/ (main site) http://dar.sourceforge.net/ (mirror site) No answer to support requests will be done out of mailing-list or other public area: your questions and their answers may be of interest to others. For all and to all, if you need support thanks to read read the link below: http://dar.linux.free.fr/doc/index.html#ask_for_support Sharing must be both directions. Else for non support requests only, you are welcome to send an email to Denis at dar.linux@free.fr paying attention to add the following string (the quotes are not necessary) "[EARTH IS BEAUTIFUL]" in the subject of your email, to be able to pass anti-spam filter. Here follows an extract of Denis Corbin's resume: 1990-1992 Classes Prepas (math. sup. math. spe. M) 1992-1995 ENSEIRB - Ecole Nationale Superieur d'Electronique Informatique et Radiocommunications de Bordeaux Promo I-1995. 1995 3 months Erasmus project in Bologna (Italy). 1995-1996 Military Service: 28e Regiment Transmission Armee de Terre Formation Equipex-RITA, operator on the RITTER network. Military training PMTE (Preparation Militaire Terre Encadrement). 1997-2000 Software developer, Team leader, Project leader for Netcomsystems (which was renamed Spirent Communications in 1999) Designed software for the Smartbits network tester. Denis worked in cooperation with Californian team based in Calabasas. 2000-2002 Network Design, architecture and network support for DCN of Alcatel Submarine Networks. 2002-2003 DNS maintainer and Firewall admin for the GPRS network for Bouygues Telecom. 2003-2004 Network Design and support for SFR's wap and SMS platform, Managed change of ISP connectivity (activating BGP dual homing) for SFR with no loss of service. Nov. 2003 Cisco Certified CCNA 2004-2005 Validation responsible of the hosting infrastructure that provides data to UMTS mobile phones for SFR. Dec. 2004 Cisco Certified CCNP 2005-2011 Network and security engineer at Telindus France. July 2008 Cisco Certified Internetwork Expert, CCIE #21568 R&S June 2009 Checkpoint Certified Security Expert (CCSE) 2011-2015 Pre-sales engineer at Telindus for WAN optimization (Riverbed Solution), LAN Campus and Datacenter design and architecture (Cisco Nexus and Catalysts solutions). Nov. 2011 Riverbed certified RCSA Apr. 2012 Cisco Certified Sales Expert Since Oct. 2014 Network Solution Architect at HP (today at Hewlett Packard Entreprise) Feb. 2015 HP Certified ASE dar-2.5.3/Makefile.in0000644000175000017520000006065012642474521011275 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_noinst_DATA) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(top_srcdir)/configure ABOUT-NLS \ AUTHORS COPYING ChangeLog INSTALL NEWS THANKS TODO \ config.guess config.rpath config.sub depcomp install-sh \ ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(dist_noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXSTDFLAGS = @CXXSTDFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PROG = @DOXYGEN_PROG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPX_PROG = @UPX_PROG@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen = @doxygen@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ groff = @groff@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmp = @tmp@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ upx = @upx@ SUBDIRS = man src doc misc po dist_noinst_DATA = INSTALL README THANKS TODO AUTHORS COPYING ChangeLog NEWS ABOUT-NLS ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = config.rpath m4/ChangeLog all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/misc/0000755000175000017520000000000012642474572010242 500000000000000dar-2.5.3/misc/Makefile.am0000644000175000017430000000022012641772777012217 00000000000000dist_noinst_DATA = make_cygwin_dist batch_cygwin batch_linux batch_linux_ea README batch_solaris noinst_PROGRAMS=todos todos_SOURCES=todos.c dar-2.5.3/misc/Makefile.in0000644000175000017520000003731012642474520012224 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = todos$(EXEEXT) subdir = misc DIST_COMMON = README $(dist_noinst_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_todos_OBJECTS = todos.$(OBJEXT) todos_OBJECTS = $(am_todos_OBJECTS) todos_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(todos_SOURCES) DIST_SOURCES = $(todos_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(dist_noinst_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXSTDFLAGS = @CXXSTDFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PROG = @DOXYGEN_PROG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPX_PROG = @UPX_PROG@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen = @doxygen@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ groff = @groff@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmp = @tmp@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ upx = @upx@ dist_noinst_DATA = make_cygwin_dist batch_cygwin batch_linux batch_linux_ea README batch_solaris todos_SOURCES = todos.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu misc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu misc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list todos$(EXEEXT): $(todos_OBJECTS) $(todos_DEPENDENCIES) $(EXTRA_todos_DEPENDENCIES) @rm -f todos$(EXEEXT) $(LINK) $(todos_OBJECTS) $(todos_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/todos.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/misc/batch_solaris0000644000175000017430000000203212610404647012706 00000000000000#!/bin/tcsh -f if(! -f configure) then echo "run this script from the root directory of CVS working directory" echo "which is where the 'configure' script resides" exit 1 endif if("$1" == "" || "$2" == "" || "$3" == "") then echo "usage: $0 " echo "example : $0 2.0.0 sun4 Solaris" exit endif set filen="$1-$2-$3" ./configure CXXFLAGS=-O && make && mkdir dar-$filen && make DESTDIR=`pwd`/dar-$filen install-strip && tar -cf dar-$filen.tar dar-$filen && gzip -9 dar-$filen.tar || exit 1 make clean && make distclean || exit 1 # ./configure CXXFLAGS=-O --enable-mode=32 && make && mkdir dar32-$filen && make DESTDIR=`pwd`/dar32-$filen install-strip && tar -cf dar32-$filen.tar dar32-$filen && gzip -9 dar32-$filen.tar || exit 1 # make clean && make distclean || exit 1 ./configure CXXFLAGS=-O --enable-mode=64 && make && mkdir dar64-$filen && make DESTDIR=`pwd`/dar64-$filen install-strip && tar -cf dar64-$filen.tar dar64-$filen && gzip -9 dar64-$filen.tar || exit 1 make clean && make distclean || exit 1 dar-2.5.3/misc/batch_linux_ea0000755000175000017430000000075412610404647013052 00000000000000#!/bin/tcsh -f if(! -f configure) then echo "run this script from the root directory of CVS working directory" echo "which is where the 'configure' script resides" exit 1 endif if ("$1" == "") then echo "usage: $0 " exit endif misc/make_rpm $1 misc/dar_ea.rpm.spec mkdir rpm_dar_ea mv *.rpm rpm_dar_ea # misc/make_rpm $1 misc/dar32_ea.rpm.spec # mkdir rpm_dar32_ea # mv *.rpm rpm_dar32_ea misc/make_rpm $1 misc/dar64_ea.rpm.spec mkdir rpm_dar64_ea mv *.rpm rpm_dar64_ea dar-2.5.3/misc/make_cygwin_dist0000755000175000017430000000264612641772777013447 00000000000000#!/bin/tcsh -f if(! -f configure) then echo "run this script from the root directory of CVS working directory" echo "which is where the 'conigure' script resides" exit 1 endif if( "$1" == "") then echo "usage : $0 " exit endif set dir_name="dar$2-$1-i386-windows" set build_dir=`pwd`/$dir_name echo "install directory is $build_dir" if( -e $build_dir) then echo "cannot create $build_dir file exists" exit 1 endif mkdir $build_dir make clean distclean || echo "ignoring error, tree already clean" # setenv CXXFLAGS -O ./configure --prefix=$build_dir --disable-gpgme-linking $3 $4 $5 $6 $7 $8 $9 make make install-strip mv $build_dir/bin/* $build_dir/lib/*.so.*.*.* $build_dir cp /bin/cygwin1.dll /bin/cygz.dll /bin/cygbz2-1.dll /bin/cygiconv-2.dll /usr/bin/cygintl-8.dll /bin/cyggcc_s-seh-1.dll /bin/cygstdc++-6.dll /bin/cyggpg-error-0.dll /bin/cyglzo2-2.dll /usr/bin/cyggcrypt-20.dll /usr/bin/cyggpgme-11.dll /usr/bin/cyglzma-5.dll $build_dir # /usr/bin/gpg /usr/bin/cygreadline7.dll /usr/bin/cygncursesw-10.dll /usr/bin/cygusb0.dll cp -R doc $build_dir foreach fichier (README TODO INSTALL ChangeLog THANKS COPYING) cp $fichier "$build_dir/`basename $fichier`.txt" misc/todos "$build_dir/`basename $fichier`.txt" end rm -rf $build_dir/man $build_dir/bin $build_dir/lib $build_dir/include rm -rf $build_dir/share zip -9 -r "$dir_name".zip $dir_name rm -rf $build_dir dar-2.5.3/misc/batch_cygwin0000755000175000017430000000057012610404647012542 00000000000000#!/bin/tcsh -f if(! -f configure) then echo "run this script from the root directory of CVS working directory" echo "which is where the 'configure' script resides" exit 1 endif if("$1" == "") then echo "usage: $0 " exit endif # misc/make_cygwin_dist $1 "" # misc/make_cygwin_dist $1 "32" --enable-mode=32 misc/make_cygwin_dist $1 "64" --enable-mode=64 dar-2.5.3/misc/README0000644000175000017430000000075712641772777011062 00000000000000What will you find in this directory? -------------------- | IMPORTANT! | as there is so many distro today (yep, the Slackware hegemony is over...) | I do not produce anymore binary packages. Ask your preferred distro | maintainer team to upgrade their packages or wait for they do so. -------------------- many script that help(ed) build the releases: - batch_cygwin - batch_linux - match_linux_ea - make_cygwin_dist a helper program to translate documentation to DOS format - todos.c dar-2.5.3/misc/todos.c0000644000175000017430000000257012610404647011451 00000000000000#include #include #include #include #include #include #define TMP ".###tmp_file" #define MAX 10240 char c='\n'; int main(int argc,char *argv[]) { char buffer[MAX]; char sortie[2*MAX]; char *file; int p; register int i,lu,d; if(argc < 2) { printf("usage : %s liste de fichiers\n",argv[0]); return 1; } close(0);close(1); for(p=1;p" exit endif misc/make_rpm $1 misc/dar.rpm.spec mkdir rpm_dar mv *.rpm rpm_dar # misc/make_rpm $1 misc/dar32.rpm.spec # mkdir rpm_dar32 # mv *.rpm rpm_dar32 misc/make_rpm $1 misc/dar64.rpm.spec mkdir rpm_dar64 mv *.rpm rpm_dar64 dar-2.5.3/configure.ac0000444000175000017520000015304312642474464011521 00000000000000# Process this file with autoconf to produce a configure script. AC_PREREQ(2.69) AC_INIT([DAR], [2.5.3], [[http://sourceforge.net/tracker/?group_id=65612&atid=511612]]) AC_CONFIG_HEADERS([config.h]) AC_LANG([C++]) AC_CONFIG_SRCDIR([src/libdar/catalogue.cpp]) AC_DEFINE_UNQUOTED(DAR_VERSION, "AC_PACKAGE_VERSION", [dar and dar_suite version, definition in configure.ac]) AM_INIT_AUTOMAKE([subdir-objects]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION XGETTEXT_EXTRA_OPTIONS='--keyword=dar_gettext' AM_ICONV # have a specific variable for pkgconfig, setting the default value: AC_SUBST(pkgconfigdir, [${libdir}/pkgconfig]) AC_ARG_WITH([pkgconfigdir], AC_HELP_STRING(--with-pkgconfigdir=DIR, [defines an alternative directory to install pkconfig files, default is '${libdir}/pkgconfig']), [ if [ ! -z "$withval" ] ; then AC_SUBST(pkgconfigdir, $withval) fi ], [] ) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_LIBTOOL AC_PROG_MAKE_SET AC_PROG_RANLIB AC_MSG_CHECKING([for C++ compiler usability]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ class test { public: int test; }; ])], [AC_MSG_RESULT(ok)], [AC_MSG_ERROR([No C++ compiler found])]) # Defining _XOPEN_SOURCE to get extra field in struct stat AC_DEFINE(_XOPEN_SOURCE, 700, [activates POSIX.1-2008 symbols in order to allow microsecond time setting, as well as ctime_r() call]) ########### ## THE FOLLOWING "DEFINE" USED TO RE-ENABLE FULL LIBC FEATURES ON DIFFERENT OPERATING SYSTEMS ## HAVE BEEN BORROWED FROM PYTHON's configure.in ## ## # The later defininition of _XOPEN_SOURCE disables certain features # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone). AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features]) # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable # them. AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features]) # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable # them. AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features]) # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable # them. AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features]) ## ## ########### # Checks for libraries. AC_CHECK_LIB(socket, [socket], [], []) AC_CHECK_LIB(nsl, [endnetconfig], [], []) AC_CHECK_LIB(cap, [cap_get_proc], [], []) AC_ARG_ENABLE( [libdl-linking], AC_HELP_STRING(--disable-libdl-linking, [ignore any libdl and avoid linking against it]), [], [ AC_CHECK_LIB(dl, [dlsym], [], []) ]) # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h netinet/in.h arpa/inet.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h termios.h unistd.h utime.h sys/types.h signal.h errno.h sys/un.h sys/stat.h time.h fnmatch.h regex.h pwd.h grp.h stdio.h pthread.h ctype.h getopt.h limits.h stddef.h sys/utsname.h libintl.h sys/capability.h linux/capability.h utimes.h sys/time.h wchar.h wctype.h stddef.h]) AC_SYS_LARGEFILE # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_DECL_SYS_SIGLIST AC_CHECK_TYPE(size_t, [AC_CHECK_SIZEOF(size_t)], [AC_MSG_ERROR([Cannot find size_t type])], []) AC_CHECK_TYPE(time_t, [AC_CHECK_SIZEOF(time_t)], [AC_MSG_ERROR([Cannot find time_t type])], []) AC_CHECK_TYPE(off_t, [AC_CHECK_SIZEOF(off_t)], [AC_MSG_ERROR([Cannot find off_t type])], []) # Checks for library functions. AC_FUNC_FNMATCH AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL AC_FUNC_LSTAT AC_HEADER_MAJOR AC_FUNC_MALLOC AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_UTIME_NULL AC_HEADER_TIME AC_CHECK_FUNCS([lchown mkdir regcomp rmdir strerr-or strerror_r utime fdopendir readdir_r ctime_r getgrnam_r getpwnam_r localtime_r]) AC_MSG_CHECKING([for c++11 support]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ thread_local static int test = 0; ]) ], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT([no]) AC_MSG_CHECKING([for c++ support with -std=c++11 option set]) CXXSTDFLAGS="-std=c++11" CXXFLAGS="$CXXFLAGS $CXXSTDFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ thread_local static int test = 0; ]) ], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_ERROR([C++ compiler lack support for c++11 standard]) ] ) ]) AC_MSG_CHECKING([for sed -r/-E option]) if sed -r -e 's/(c|o)+/\1/g' > /dev/null < /dev/null ; then local_sed="gnu" AC_MSG_RESULT([GNU sed, using -r option for regex]) else if sed -E -e 's/(c|o)+/\1/g' > /dev/null < /dev/null ; then local_sed="bsd" AC_MSG_RESULT([BSD sed, using -E option for regex]) else local_sed=unknown AC_MSG_ERROR([unknown switch to use with sed to support regex]) fi fi AC_MSG_CHECKING([for getopt() in ]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_UNISTD_H #include #endif }]], [ getopt(0, 0, 0); ]) ], [ AC_DEFINE(HAVE_GETOPT_IN_UNISTD_H, 1, [a getopt() call is declared in ]) AC_MSG_RESULT(present) ], [AC_MSG_RESULT(absent)]) AC_MSG_CHECKING([for getopt_long() in ]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_UNISTD_H #include #endif }]], [ getopt_long(0, 0, 0, 0, 0); ]) ], [ AC_DEFINE(HAVE_GETOPT_LONG_IN_UNISTD_H, 1, [a getopt_long() call is declared in ]) AC_MSG_RESULT(present) ], [AC_MSG_RESULT(absent)]) AC_MSG_CHECKING([for optreset presence]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_GETOPT_H #include #else #if HAVE_UNISTD_H #include #endif #endif }]], [ int x = optreset; return 0; ]) ], [ AC_DEFINE(HAVE_OPTRESET, 1, [the optreset external variable exists to reset getopt standard call]) AC_MSG_RESULT(available) ], [AC_MSG_RESULT([not available])]) AC_MSG_CHECKING([for Door file support]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif }]], [ struct stat buf; if(S_ISDOOR(buf.st_mode)) return 0; else return 1; ]) ], [ AC_DEFINE(HAVE_DOOR, 1, [whether the system has the necessary routine to handle Door files]) AC_MSG_RESULT(available) ], [AC_MSG_RESULT([not available])]) AC_MSG_CHECKING([for POSIX.1e capabilities support]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_SYS_CAPABILITY_H #include #else #if HAVE_LINUX_CAPABILITY_H #include #endif #endif #if HAVE_SYS_TYPES_H #include #endif }]], [ cap_t capaset = cap_get_proc(); (void)cap_free((void *)capset); ]) ], [ AC_DEFINE(HAVE_CAPABILITIES, 1, [whether the system has support for POSIX.1e capabilities]) AC_MSG_RESULT(available) ], [ AC_MSG_RESULT([not available]) ]) AC_MSG_CHECKING([for fdatasync() availability]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_UNISTD_H #include #endif }]], [ (void)fdatasync(0); ]) ], [ AC_DEFINE(HAVE_FDATASYNC, 1, [whether the system provides fdatasync() system call]) AC_MSG_RESULT(available) ], [ AC_MSG_RESULT([not available]) ]) AC_MSG_CHECKING([for the possibility to set timestamps at a microsecond precision]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_UTIMES_H #include #endif #if HAVE_SYS_TIME_H #include #endif }]], [[ struct timeval tv[2]; tv[0].tv_sec = 1000; tv[1].tv_usec = 2000; (void)utimes("/tmp/testfile.tmp", tv); /* note that this test program is only compiled+linked not run */ return 0; ]]) ], [ AC_DEFINE(LIBDAR_MICROSECOND_WRITE_ACCURACY, 1, [support for timestamps microsecond write accuracy]) local_microsecond_write=yes AC_MSG_RESULT(available) ], [ AC_MSG_RESULT([not available]) ]) AC_MSG_CHECKING([for the possibility to read timestamps at a microsecond precision]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif }]], [[ struct stat st; /* tv_nsec is nanosecond, but for now we do not keep more precised timing than microseconds because we have not portable way to restore nanoseconds but only seconds and microsecond */ if(st.st_atim.tv_nsec != 0) return 0; else return 1; /* whatever, this test program is only compiled no run */ ]]) ], [ AC_DEFINE(LIBDAR_MICROSECOND_READ_ACCURACY, 1, [support for timestamps microsecond read accuracy]) local_microsecond_read=yes AC_MSG_RESULT(available) ], [ AC_MSG_RESULT([not available]) ]) AC_MSG_CHECKING([for lutimes() availability]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_SYS_TIME_H #include #endif } // extern "C" ]], [[ struct timeval tv[2]; int lu = lutimes("/tmp/noway", tv); ]]) ], [ AC_DEFINE(HAVE_LUTIMES, 1, [if lutimes() system call is available]) local_lutimes=yes AC_MSG_RESULT(available) ], [ AC_MSG_RESULT([not available])] ) AC_MSG_CHECKING([for strerror_r flavor]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_STRING_H #include #endif } // externe "C" ]], [[ char *ptr = strerror_r(0, nullptr, 0); ]]) ], [ AC_DEFINE(HAVE_STRERROR_R_CHAR_PTR, 1, [strerror_r() returns a char *]) AC_MSG_RESULT([GNU specific]) ], [ AC_MSG_RESULT([XSI compliant]) ]) # DAR's features AC_ARG_ENABLE( [libz-linking], AC_HELP_STRING(--disable-libz-linking, [disable linking with libz and disable libz compression support]), [ AC_MSG_WARN([libz compression support has been disabled by user]) local_libz="no" ], [ AC_CHECK_LIB(z, [deflate], [], [AC_MSG_WARN([library zlib not found])]) AC_CHECK_HEADER(zlib.h, [local_libz="yes" AC_DEFINE(HAVE_ZLIB_H, 1, [zlib.h header file is available]) ], [AC_MSG_WARN([Cannot find zlib.h header file]) local_libz="no" ]) if test "$local_libz" = "yes" ; then AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_ZLIB_H #include #endif }]], [[ z_stream *ptr = (z_stream *)0; deflate(ptr, 0); ]]) ], [ AC_DEFINE(LIBZ_AVAILABLE, 1, [header and linking is available to have libz functions])], [ local_libz="no" ]) else AC_MSG_WARN([libz compression support not available]) fi ] ) AC_ARG_ENABLE( [libbz2-linking], AC_HELP_STRING(--disable-libbz2-linking, [disable linking with libbz2 and disables libbz2 compression support]), [ AC_MSG_WARN([libbz2 compression support has been disabled by user]) local_libbz2="no" ], [ AC_CHECK_LIB(bz2, [BZ2_bzCompress], [], [AC_MSG_WARN([library libbz2 not found])]) AC_CHECK_HEADER(bzlib.h, [local_libbz2="yes" AC_DEFINE(HAVE_BZLIB_H, 1, [bzlib.h header file is available]) ], [AC_MSG_WARN([Cannot find bzlib.h header file]) local_libbz2="no" ]) if test "$local_libbz2" = "yes" ; then AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_BZLIB_H #include #endif }]], [[ bz_stream *ptr = (bz_stream *)0; BZ2_bzCompress(ptr, 0); ]]) ], [ AC_DEFINE(LIBBZ2_AVAILABLE, 1, [header and linking is available to have libbz2 functions])], [ local_libbz2="no" ]) else AC_MSG_WARN([libbz2 compression support not available]) fi ]) AC_ARG_ENABLE( [liblzo2-linking], AC_HELP_STRING(--disable-liblzo2-linking, [disable linking with liblzo2 and disables lzo compression support]), [ AC_MSG_WARN([lzo compression support has been disabled by user]) local_liblzo2="no" ], [ AC_CHECK_LIB(lzo2, [lzo1x_1_compress], [], [AC_MSG_WARN([library liblzo2 not found])]) AC_CHECK_HEADER(lzo/lzo1x.h, [local_liblzo2="yes" AC_DEFINE(HAVE_LZO_LZO1X_H, 1, [lzo/lzo1x.h header file is available]) ], [AC_MSG_WARN([Cannot find lzo/lzo1x.h header file]) local_liblzo2="no" ]) if test "$local_liblzo2" = "yes" ; then AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_LZO_LZO1X_H #include #endif }]], [[ int x = lzo1x_1_compress(0, 0, 0, 0, 0); ]]) ], [ AC_DEFINE(LIBLZO2_AVAILABLE, 1, [header and linking is available to have lzo functions])], [ local_liblzo2="no" ]) else AC_MSG_WARN([lzo compression support not available]) fi ]) AC_ARG_ENABLE( [libxz-linking], AC_HELP_STRING(--disable-libxz-linking, [disable linking with libxz/liblzma and disable libxz compression support]), [ AC_MSG_WARN([libxz compression support has been disabled by user]) local_libxz="no" ], [ AC_CHECK_LIB(lzma, [lzma_code], [], [AC_MSG_WARN([library liblzma not found])]) AC_CHECK_HEADER(lzma.h, [local_libxz="yes" AC_DEFINE(HAVE_LZMA_H, 1, [lzma.h header file is available]) ], [AC_MSG_WARN([Cannot find lzma.h header file]) local_libxz="no" ]) if test "$local_libxz" = "yes" ; then AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_LZMA_H #include #endif }]], [[ lzma_stream ptr = LZMA_STREAM_INIT; lzma_ret tmp = lzma_easy_encoder(&ptr, 2, LZMA_CHECK_CRC32); ]]) ], [ AC_DEFINE(LIBLZMA_AVAILABLE, 1, [header and linking is available to have liblzma functions])], [ local_libxz="no" ]) else AC_MSG_WARN([libxz compression support not available]) fi ] ) AC_ARG_ENABLE( [libgcrypt-linking], AC_HELP_STRING(--disable-libgcrypt-linking, [disable linking with libgcrypt which disables strong encryption support]), [ AC_MSG_WARN([strong encryption support has been disabled by user]) local_crypto="no" ], [ AC_CHECK_LIB(gpg-error, [gpg_err_init], [], []) AC_CHECK_LIB(gcrypt, [gcry_check_version], [], []) AC_CHECK_HEADER(gcrypt.h, [local_crypto="yes" AC_DEFINE(HAVE_GCRYPT_H, 1, [gcrypt.h header file is available]) ], [AC_MSG_WARN([Cannt find gcrypt.h header file]) local_crypto="no" ]) if test "$local_crypto" = "yes" ; then min_version_gcrypt="1.4.0" AC_DEFINE_UNQUOTED(MIN_VERSION_GCRYPT, "$min_version_gcrypt", [libgcrypt minimum version]) min_version_gcrypt_hash_bug="1.6.0" AC_DEFINE_UNQUOTED(MIN_VERSION_GCRYPT_HASH_BUG, "$min_version_gcrypt_hash_bug", [ligcrypt minimum version without hash bug]) AC_MSG_CHECKING([for libgcrypt usability]) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_GCRYPT_H #include #endif } #include using namespace std; ]], [[ if(!gcry_check_version(MIN_VERSION_GCRYPT)) { cout << "ligcrypt version too low, minimum version is " << MIN_VERSION_GCRYPT << endl; exit(1); } else exit(0); ]]) ], [ AC_DEFINE(CRYPTO_AVAILABLE, 1, [header and linking is available to have strong encryption works]) AC_MSG_RESULT([ok]) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_GCRYPT_H #include #endif } ]], [[ if(!gcry_check_version(MIN_VERSION_GCRYPT_HASH_BUG)) exit(1); else exit(0); ]]) ], [], [ libgcrypt_hash_bug="yes" ]) ], [ if test "$?" = "1" ; then AC_MSG_RESULT([failed: need libgcypt >= $min_version_gcrypt, disabling strong encryption support]) else AC_MSG_RESULT([failed: libgcrypt is unusable, cannot even call gcry_check_version(). Disabling strong encryption support]) fi local_crypto="no" ]) else AC_MSG_WARN([strong encryption support not available]) fi ]) AC_ARG_ENABLE( [ea-support], AC_HELP_STRING(--disable-ea-support,[disable Extended Attributes support]), [ AC_MSG_CHECKING([for Extended Attribute support]) AC_MSG_RESULT([disabled]) ], [ AC_CHECK_HEADERS([attr/xattr.h]) AC_CHECK_LIB(attr, [lgetxattr], [], []) AC_MSG_CHECKING([for Unix Extended Attribute support]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_ATTR_XATTR_H #include #endif }]], [ lgetxattr((char *)0, (char *)0, (void *)0, 0); ]) ], [ AC_DEFINE(EA_SUPPORT, [], [if defined, activates support for Extended Attributes]) local_ea_support="yes" AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) AC_CHECK_HEADERS([sys/xattr.h]) AC_CHECK_LIB(c, [fgetxattr]) AC_MSG_CHECKING([for Mac OS X Extended Attribute support]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_SYS_XATTR_H #include #endif }]], [ getxattr((char *)0, (char *)0, (void *)0, 0, 0, XATTR_NOFOLLOW); ]) ], [ AC_DEFINE(EA_SUPPORT, [], [if defined, activates support for Extended Attributes]) AC_DEFINE(OSX_EA_SUPPORT, [], [if defined, activates support for Mac OS X Extended Attributes]) local_ea_support="yes" AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) ]) ]) ] ) AC_MSG_CHECKING([ext2fs.h availability]) AC_ARG_ENABLE( [nodump-flag], AC_HELP_STRING(--disable-nodump-flag, [disable the ext2/3/4 Filesystem Specific Attribute support, in particular the --nodump feature]), [AC_MSG_RESULT([extX FSA disabled])], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #include #if HAVE_SYS_IOCTL_H #include #endif }]],[[int fd, f; ioctl(fd, EXT2_IOC_GETFLAGS, &f);]] ) ], [ AC_DEFINE(LIBDAR_NODUMP_FEATURE, [NODUMP_EXT2FS], [if defined, activates the ext2/3 nodump flag feature]) local_nodump_feature="yes" AC_MSG_RESULT([found ]) ], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM([[extern "C" { #include #if HAVE_SYS_IOCTL_H #include #endif }]],[[int fd, f; ioctl(fd, EXT2_IOC_GETFLAGS, &f);]]) ], [ AC_DEFINE(LIBDAR_NODUMP_FEATURE, [NODUMP_LINUX], [if defined, activates the ext2/3 nodump flag feature]) local_nodump_feature="yes" AC_MSG_RESULT([found ]) ], [ AC_MSG_RESULT([NOT FOUND]) AC_MSG_WARN([cannot find ext2_fs.h header file, nodump-flag and extX FSA features will not be available]) ]) ]) ]) AC_MSG_CHECKING([birth time availability]) AC_ARG_ENABLE( [birthtime], AC_HELP_STRING(--disable-birthtime, [disable the HFS+ Filesystem Specific Attribute support]), [AC_MSG_RESULT([hfs+ FSA disabled])], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_SYS_TYPE_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif }]], [[ struct stat tmp; int ret = stat("/", &tmp); time_t birth = tmp.st_birthtime; ]]) ], [ AC_DEFINE(LIBDAR_BIRTHTIME, 1, [if defined, activates the support for HFS+ create time FSA]) local_birthtime="yes" AC_MSG_RESULT([found]) ], [ AC_MSG_RESULT([NOT FOUND]) AC_MSG_WARN([Cannot find support for birthtime, HFS+ FSA support will not be available]) ]) ]) AC_ARG_ENABLE( [gnugetopt], AC_HELP_STRING(--disable-gnugetopt, [avoid linking with libgnugetopt]), [], AC_CHECK_LIB(gnugetopt, [getopt_long], [], []) ) AC_ARG_ENABLE( [fadvise], AC_HELP_STRING(--disable-fadvise, [avoid using fadvise(2) system call]), [], [ AC_MSG_CHECKING([for posix_fadvise support]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_FCNTL_H #include #endif }]], [ (void)posix_fadvise(0,0,1,POSIX_FADV_NORMAL); ]) ], [ AC_DEFINE(HAVE_POSIX_FADVISE, 1, [whether the system has support for posix_fadvise()]) local_posix_fadvise="yes" AC_MSG_RESULT(available) ], [ AC_MSG_RESULT([not available]) ] ) ] ) # AC_ARG_ENABLE( [librsync-linking], # AC_HELP_STRING(--disable-librsync-linking, [disable linking with librsync and disable delta compression support]), # [ # AC_MSG_WARN([librsync delta-compression support has been disabled by user]) # local_librsync="no" # ], # [ # AC_CHECK_LIB(rsync, [rs_strerror], [], [AC_MSG_WARN([library librsync not found])]) # AC_CHECK_HEADER(librsync.h, [local_librsync="yes" # AC_DEFINE(HAVE_LIBRSYNC_H, 1, [librsync.h header file is available]) # ], # [AC_MSG_WARN([Cannot find librsync.h header file]) # local_librsync="no" # ]) # if test "$local_librsync" = "yes" ; then # AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { # #if HAVE_LIBRSYNC_H # #include # #include # #endif # }]], # [[ # rs_result err = RS_DONE; # (void) rs_strerror(err); # ]]) # ], # [ AC_DEFINE(LIBRSYNC_AVAILABLE, 1, [header and linking is available to have librsync functions])], # [ local_librsync="no" ]) # else # AC_MSG_WARN([librsync compression support not available]) # fi # ] # ) AC_MSG_CHECKING([for getopt() availability]); AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_GETOPT_H #include #else #if HAVE_UNISTD_H #include #endif #endif }]], [ getopt(0, 0, 0); ]) ], [ AC_MSG_RESULT([ok]) ], [AC_MSG_ERROR([absent but required])]) AC_MSG_CHECKING([for getopt_long() availability]); AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_GETOPT_H #include #else #if HAVE_UNISTD_H #include #endif #endif }]], [ getopt_long(0, 0, 0, 0, 0); ]) ], [ local_have_getopt_long="yes" AC_DEFINE(HAVE_GETOPT_LONG, 1, [whether getopt_long() is available]) AC_MSG_RESULT([available]) ], [AC_MSG_RESULT([NOT AVAILABLE])]) AC_ARG_ENABLE( [examples], AC_HELP_STRING(--enable-examples, [buld example and testing programs]), [examples="yes"], [examples="false"]) AC_ARG_ENABLE( [os-bits], AC_HELP_STRING(--enable-os-bits=arg, [arg is 32 or 64. If for some reason, one wants to overcome detected system value]), [AC_DEFINE_UNQUOTED(OS_BITS, $enableval, [manually set CPU's registers' size])], [ AC_CHECK_HEADER(inttypes.h, [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([extern "C" { #include }], [ uint16_t a = 0; uint32_t b = 0; uint64_t c = 0; int16_t d = 0; int32_t e = 0; int64_t f = 0; return a+b+c+d+e+f; ]) ], [], [AC_MSG_ERROR([Cannot find *int*_t type declarations in headerfile, --enable-os-bits=... option must be used])] ) ], [AC_MSG_ERROR([Cannot find inttypes.h headerfile, --enable-os-bits=... option must be used])] ) ] ) AC_ARG_ENABLE( [mode], AC_HELP_STRING(--enable-mode=arg, [where arg is 32 or 64. Makes dar internally use 32 bits or 64 bits integers in place of infinint (which is the case if this option is not given)]), [build_mode=$enableval], []) AC_ARG_ENABLE( [furtive-read], AC_HELP_STRING(--disable-furtive-read, [Ignore furtive read mode availability on systems that support it]), [ local_furtive_read_mode="no" AC_MSG_WARN([Furtive read mode disabled]) ], [ AC_MSG_CHECKING([furtive read mode availability]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_SYS_TYPE_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_DIRENT_H #include #endif } ]], [[ int x = O_NOATIME; int fd = open("/",O_RDONLY|O_NOATIME); #if HAVE_FDOPENDIR (void)fdopendir(fd); #else syntaxically incorrect statement here to force compilation to fail! #endif ]]) ], [ AC_DEFINE(FURTIVE_READ_MODE_AVAILABLE, 1, [furtive read mode is available]) AC_MSG_RESULT(available) local_furtive_read_mode="yes" ], [ AC_MSG_RESULT(no available) local_furtive_read_mode="no" ]) ] ) AC_ARG_ENABLE( [debug], AC_HELP_STRING(--enable-debug, [build targets with debugging option and no optimization]), [ # yes we modify user variable here to remove any optimization CXXFLAGS="$CXXSTDFLAGS -ggdb -Wall" CFLAGS="-ggdb -Wall" LDFLAGS="-ggdb -Wall" debug_static="yes" AC_DEFINE(LIBDAR_NO_OPTIMIZATION, 1, [if defined, informs the code that no optimization has been used for compilation]) ], [ debug_static="no" ]) AC_ARG_ENABLE( [pedantic], AC_HELP_STRING(--enable-pedantic, [enable pedantic syntaxical check at compilation, use only for debugging purposes !]), [ CXXFLAGS="$CXXFLAGS -pedantic -Wno-long-long" ], []) AC_ARG_ENABLE( [build-html], AC_HELP_STRING(--disable-build-html, [don't build programming documentation (in particular libdar API documentation) and html man page]), [ doxygen="no" groff="no" ], [ AC_CHECK_PROG(doxygen, doxygen, [yes], [no], [$PATH]) AC_MSG_CHECKING([for doxygen version]) if test "$doxygen" = "yes" ; then n1=`doxygen --version | cut -d '.' -f 1` n2=`doxygen --version | cut -d '.' -f 2` if test $n1 -gt 1 -o $n2 -ge 3 ; then AC_MSG_RESULT([ >= 1.3]) else AC_MSG_RESULT([ too old (< 1.3) ignoring doxygen]) doxygen="no" fi fi AC_CHECK_PROG(tmp, man, [yes], [no], [$PATH]) if test "$tmp" = "yes" ; then AC_CHECK_PROG(groff, groff, [yes], [no], [$PATH]) else groff = "no"; fi ] ) AC_ARG_ENABLE( [special-alloc], AC_HELP_STRING(--disable-special-alloc, [special memory allcation scheme makes dar using less memory and run a bit faster, in particular in conjunction with --enable-mode=32 or 64, you can disable it if you like]), [], [AC_DEFINE(LIBDAR_SPECIAL_ALLOC, [], [if set activates specific new and delete operator which do better allocation for a lot of small items]) local_special_alloc="yes" ]) AC_ARG_ENABLE( [upx], AC_HELP_STRING(--disable-upx, [by default configure looks for UPX and if available make executables compressed at installation time, you can disable this feature]), [ AC_MSG_NOTICE([ignoring UPX]) upx="no" ], [ AC_CHECK_PROG(upx, upx, [yes], [no], [$PATH]) ] ) AC_ARG_ENABLE( [fast-dir], AC_HELP_STRING(--disable-fast-dir, [disable optimization for large directories, doing so has a little positive impact on memory requirement but a huge drawback on execution time]), [], [AC_DEFINE(LIBDAR_FAST_DIR, 1, [activation of speed optimization for large directories]) local_fast_dir="yes" ] ) AC_ARG_ENABLE( [thread-safe], AC_HELP_STRING(--disable-thread-safe, [libdar is thread safe if POSIX mutex are available, you can manually disable the use of POSIX mutex, the resulting libdar library will not be thread-safe anymore unless special-alloc is disabled too]), [ AC_MSG_NOTICE([thread-safe support disabled]) ], [ AC_CHECK_LIB(pthread, [pthread_mutex_init], [], []) AC_MSG_CHECKING([for POSIX mutex]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_PTHREAD_H #include #endif }]], [[ pthread_mutex_t mutex; pthread_mutex_init(&mutex, (const pthread_mutexattr_t*)0); pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex);]]) ], [ AC_DEFINE(MUTEX_WORKS, 1, [POSIX mutex (pthread_mutex_t) is available]) local_mutex_works="yes" AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no)]) AC_MSG_CHECKING([for reentrant stdlib calls]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_TIME_H #include #endif #if HAVE_SYS_TYPE_H #include #endif #if HAVE_GRP_H #include #endif #if HAVE_PWD_H #include #endif #if HAVE_DIRENT_H #include #endif }]], [[ #if HAVE_CTIME_R char *val1 = ctime_r(nullptr, nullptr); #else error(); // should not compile as expected #endif #if HAVE_GETGRNAM_R int val2 = getgrnam_r(0, nullptr, nullptr, 0, nullptr); #else error(); // should not compile as expected #endif #if HAVE_GETPWNAM_R int val3 = getpwnam_r(nullptr, nullptr, nullptr, 0, nullptr); #else error(); // should not compile as expected #endif #if HAVE_LOCALTIME_R struct tm *val4 = localtime_r(nullptr, nullptr); #else error(); // should not compile as expected #endif #if HAVE_READDIR_R int val5 = readdir_r(nullptr, nullptr, nullptr); #else error(); // should not compile as expected #endif ]]) ], [AC_MSG_RESULT([all could be found])], [ AC_DEFINE(MISSING_REENTRANT_LIBCALL, 1, [Some *_r() stdlib call are missing to permit complete thread-safe support by libdar]) local_missing_reentrant_libcal="yes" AC_MSG_RESULT([some are missing]) ] ) ] ) AC_ARG_ENABLE( [gpgme-linking], AC_HELP_STRING(--disable-gpgme-linking, [disable linking with gpgme which disables asymetric crypto algorithms]), [ AC_MSG_WARN([asymetrical encryption support has been disabled by user]) local_gpgme="no" ], [ if test $local_crypto != no ; then gpgme_min_version="1.2.0" AC_DEFINE_UNQUOTED(GPGME_MIN_VERSION, "$gpgme_min_version", [minimum version expected of GPGME]) AM_PATH_GPGME($gpgme_min_version, [ CPPFLAGS___cache="$CPPFLAGS" CPPFLAGS="$GPGME_CFLAGS $CPPFLAGS" LDFLAGS___cache="$LDFLAGS" LDFLAGS="$GPGME_LIBS $LFDLAGS" AC_CHECK_HEADERS([gpgme.h]) AC_MSG_CHECKING([for libgpgme usability]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #if HAVE_GPGME_H #include #endif ]], [[ gpgme_ctx_t context; gpgme_error_t err = gpgme_new(&context); gpgme_release(context); return err; ]]) ], [ local_gpgme="yes" AC_DEFINE(GPGME_SUPPORT, 1, [GPGME is available to support public key based ciphering]) AC_MSG_RESULT(ok) ], [ local_gpgme="no" AC_MSG_RESULT([not usable! See config.log for details]) ]) CPPFLAGS="$CPPFLAGS___cache" unset CPPFLAGS___cache LDFLAGS="$LDFLAGS___cache" unset LDFLAGS___cache ], [] ) else AC_MSG_WARN([Public key support (GPGME linking) requires libgcrypt (strong encryption support)]) fi ] ) AC_ARG_ENABLE( [execinfo], AC_HELP_STRING(--disable-execinfo, [disable reporting stack information on self diagnostic bugs even]), [AC_MSG_WARN([ignoring execinfo even if available])], [ AC_CHECK_HEADERS([execinfo.h]) AC_CHECK_LIB(execinfo, [backtrace], [], []) AC_MSG_CHECKING([for backtrace() usability]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" { #if HAVE_EXECINFO_H #include #endif }]], [[ const int buf_size = 20; void *buffer[buf_size]; int x = backtrace(buffer, buf_size); ]]) ], [ AC_DEFINE(BACKTRACE_AVAILABLE, 1, [backtrace() call supported]) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ]) ] ) AC_ARG_ENABLE( [profiling], AC_HELP_STRING(--enable-profiling, [enable executable profiling]), [ profiling="yes" ]) AC_ARG_ENABLE( [debug-memory], AC_HELP_STRING(--enable-debug-memory, [log memory allocations and releases to /tmp/dar_debug_mem_allocation.txt this debugging option lead to a slow executable]), [AC_DEFINE(LIBDAR_DEBUG_MEMORY, 1, [if defined, builds a very slow executable])]) AC_ARG_ENABLE( [dar-static], AC_HELP_STRING(--disable-dar-static, [avoids building dar_static, a dar statically linked version]), [build_static="no"], [build_static="yes"]) AC_ARG_ENABLE( [threadar], AC_HELP_STRING(--enable-threadar, [EXPERIMENTAL! links with libthreadar if available in order to use several threads inside libdar]), [ AC_CHECK_HEADERS(libthreadar/libthreadar.hpp, [], [], []) AC_CHECK_LIB(threadar, [for_autoconf], [], []) AC_MSG_CHECKING([for libthreadar() availability]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[ #if HAVE_LIBTHREADAR_LIBTHREADAR_HPP #include #endif ]], [[ class mythread: public libthreadar::thread { protected: virtual void inherited_run() {}; }; mythread toto; toto.run(); toto.join(); ]]) ], [ AC_DEFINE(LIBTHREADAR_AVAILABLE, 1, [when libthreadar could be found and linked against]) local_threadar=yes AC_MSG_RESULT(ok) ], [ AC_MSG_RESULT(missing) ] ) ], []) MEM_LDFLAGS=$LDFLAGS LDFLAGS="-static" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_EXECINFO_H #include #endif #if HAVE_STDLIB_H #include #endif #if HAVE_PTHREAD_H #include #endif } ]], [[ #if HAVE_EXECINFO_H const int buf_size = 20; void *buffer[buf_size]; int size = backtrace(buffer, buf_size); char **symbols = backtrace_symbols(buffer, size); if(symbols != nullptr) free(symbols); #endif #if MUTEX_WORKS pthread_mutex_t test; pthread_mutex_lock(&test); pthread_mutex_unlock(&test); #endif printf("Hello World!"); ]]) ], [static_pb="no"], [static_pb="yes"]) LDFLAGS=$MEM_LDFLAGS AM_CONDITIONAL([MAKE_ALL_DIR], [test $examples = "yes"]) AM_CONDITIONAL([BUILD_DAR_STATIC], [test $build_static = "yes" -a $static_pb = "no"]) AM_CONDITIONAL([DEBUG_STATIC], [test $debug_static = "yes" -a $static_pb = "no"]) AM_CONDITIONAL([BUILD_MODE32], [test "$build_mode" = "32"]) AM_CONDITIONAL([BUILD_MODE64], [test "$build_mode" = "64"]) AM_CONDITIONAL([USE_UPX], [test "$upx" = "yes"]) AM_CONDITIONAL([USE_DOXYGEN], [test "$doxygen" = "yes"]) AM_CONDITIONAL([USE_GROFF], [test "$groff" = "yes"]) AM_CONDITIONAL([PROFILING], [test "$profiling" = "yes"]) AM_CONDITIONAL([BSD_SED], [test "$local_sed" = "bsd"]) AM_CONDITIONAL([WITH_LIBTHREADAR], [test "$local_threadar" = "yes"]) AC_SUBST([CXXSTDFLAGS], [$CXXSTDFLAGS]) AC_SUBST(UPX_PROG, [upx]) AC_SUBST(DOXYGEN_PROG, [doxygen]) # defaults AC_PREFIX_DEFAULT(/usr/local) # hack from libtool mailing-list to know from source point of view whether we are compiling for dynamic or static way AC_CONFIG_COMMANDS([hack-libtool], [ sed 's,^pic_flag=,pic_flag=" -D__DYNAMIC__ ",' libtool > libtoolT \ && mv -f libtoolT libtool && chmod 755 libtool ]) AC_CONFIG_FILES([Makefile man/Makefile src/Makefile src/libdar/Makefile src/dar_suite/Makefile src/testing/Makefile src/examples/Makefile doc/Makefile doc/samples/Makefile misc/Makefile doc/mini-howto/Makefile src/libdar/libdar.pc.tmpl doc/man/Makefile src/check/Makefile po/Makefile.in]) AC_OUTPUT [echo "" echo "--" echo "dar and libdar have been successfully configured with the following parameters:" echo "" echo " LIBDAR parameters:" printf " Zlib compression (gzip) : " if [ "$local_libz" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Libbz2 compression (bzip2) : " if [ "$local_libbz2" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Liblzo2 compression (lzo) : " if [ "$local_liblzo2" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Liblxz compression (xz) : " if [ "$local_libxz" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Strong encryption support : " if [ "$local_crypto" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Public key cipher support : " if [ "$local_gpgme" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Extended Attributes support: " if [ "$local_ea_support" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Large files support (> 2GB): " if [ ! -z "$ac_cv_sys_file_offset_bits" -o ! -z "$ac_cv_sys_large_files" ] ; then echo "YES" else echo "NO" fi printf " extX FSA / nodump support : " if [ "$local_nodump_feature" = "yes" ] ; then echo "YES" else echo "NO" fi printf " HFS+ FSA support : " if [ "$local_birthtime" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Special allocation scheme : " if [ "$local_special_alloc" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Integer size used : " if [ -z "$build_mode" -o \( ! "$build_mode" = "32" -a ! "$build_mode" = "64" \) ] ; then echo "infinint" else echo "$build_mode" fi printf " Thread safe support : " if [ "$local_mutex_works" = "yes" -a -z "$local_test_memory" -a "$local_missing_reentrant_libcal" != "yes" ] ; then echo "YES" else echo "NO" fi printf " Furtive read mode : " if [ "$local_furtive_read_mode" = "yes" ]; then echo "YES" else echo "NO" fi printf " Large directory optim. : " if [ "$local_fast_dir" = "yes" ] ; then echo "YES" else echo "NO" fi printf " posix fadvise support : " if [ "$local_posix_fadvise" = "yes" ] ; then echo "YES" else echo "NO" fi printf " microsecond read accuracy : " if [ "$local_microsecond_read" = "yes" ] ; then echo "YES" else echo "NO" fi printf " microsecond write accuracy : " if [ "$local_microsecond_write" = "yes" ] ; then echo "YES" else echo "NO" fi printf " can restore symlink dates : " if [ "$local_lutimes" = "yes" ] ; then echo "YES" else echo "NO" fi if [ "$local_threadar" = "yes" ] ; then echo " will uses multiple threads : YES ( /!\ experimental feature /!\ )" fi # printf " Delta-compression support : " # if [ "$local_librsync" = "yes" ] ; then # echo "YES" # else # echo "NO" # fi echo "" echo " DAR SUITE command line programs:" printf " Long options available : " if [ "$local_have_getopt_long" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Building examples : " if [ "$examples" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Building dar_static : " if [ "$build_static" = "yes" ]; then if [ "$static_pb" = "yes" ]; then echo "NO (system does not support static linking, see note below)" else echo "YES" fi else echo "NO" fi printf " using upx at install : " if [ "$upx" = "yes" ] ; then echo "YES" else echo "NO" fi printf " building documentation : " if [ "$doxygen" = "yes" ] ; then echo "YES" else echo "NO" fi if [ "$static_pb" = "yes" -a "$build_static" = "yes" ] ; then echo "" echo " Note:" echo "" echo " If you want to know which libraries are not available as static" echo " libraries check the logs in the config.log generated file. the command" echo "" echo " 'grep -e -static -A 2 config.log'" echo "" echo " should bring you to the essentials." echo "" echo "You also might want to speed up the compilation process running ./configure" echo "with the --disable-static option" echo "" fi if [ -z "$build_mode" ] ; then echo "" echo "--------------------- N O T E -------------------------------------------" echo "Note: You are about to build a libdar/dar binary relying on \"infinint\"" echo "integer type. You shall also consider using 64 bits integers (whatever" echo "your CPU has 32 or 64 bits registers) for better performances and reduced" echo "memory requirements, at the cost of the limitations explained here:" echo " ./doc/Limitations.html (Paragraph about Integers)" echo "Document which is also available online at:" echo " http://dar.linux.free.fr/doc/Limitations.html#Integers" echo "Unless you are impacted by these limitations, you can rerun ./configure" echo "adding the option --enable-mode=64 for dar/libdar better performances" echo "-------------------------------------------------------------------------" fi if [ "$libgcrypt_hash_bug" = "yes" ] ; then echo "" echo "" echo "#################### W A R N I N G ######################################" echo "" echo "libgcrypt version is lower than $min_version_gcrypt_hash_bug and has a bug" echo "concerning hash calculation for large files. Expect sha1 and md5 hash" echo "results for slices larger than 256 Gio (gibioctet) to be incorrect." echo "" echo "#################### W A R N I N G ######################################" fi echo "" ] dar-2.5.3/configure0000755000175000017520000310447012642474517011146 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for DAR 2.5.3. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: [http://sourceforge.net/tracker/?group_id=65612&atid=511612] $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='DAR' PACKAGE_TARNAME='dar' PACKAGE_VERSION='2.5.3' PACKAGE_STRING='DAR 2.5.3' PACKAGE_BUGREPORT='http://sourceforge.net/tracker/?group_id=65612&atid=511612' PACKAGE_URL='' ac_unique_file="src/libdar/catalogue.cpp" gt_needs= # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_default_prefix=/usr/local ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS DOXYGEN_PROG UPX_PROG CXXSTDFLAGS WITH_LIBTHREADAR_FALSE WITH_LIBTHREADAR_TRUE BSD_SED_FALSE BSD_SED_TRUE PROFILING_FALSE PROFILING_TRUE USE_GROFF_FALSE USE_GROFF_TRUE USE_DOXYGEN_FALSE USE_DOXYGEN_TRUE USE_UPX_FALSE USE_UPX_TRUE BUILD_MODE64_FALSE BUILD_MODE64_TRUE BUILD_MODE32_FALSE BUILD_MODE32_TRUE DEBUG_STATIC_FALSE DEBUG_STATIC_TRUE BUILD_DAR_STATIC_FALSE BUILD_DAR_STATIC_TRUE MAKE_ALL_DIR_FALSE MAKE_ALL_DIR_TRUE GPGME_LIBS GPGME_CFLAGS GPGME_CONFIG upx groff tmp doxygen LIBOBJS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP LIBTOOL pkgconfigdir POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS EGREP GREP CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX host_os host_vendor host_cpu host build_os build_vendor build_cpu build am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC XGETTEXT_EXTRA_OPTIONS MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS SED am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_nls enable_dependency_tracking with_gnu_ld enable_rpath with_libiconv_prefix with_libintl_prefix with_pkgconfigdir enable_shared enable_static with_pic enable_fast_install with_sysroot enable_libtool_lock enable_libdl_linking enable_largefile enable_libz_linking enable_libbz2_linking enable_liblzo2_linking enable_libxz_linking enable_libgcrypt_linking enable_ea_support enable_nodump_flag enable_birthtime enable_gnugetopt enable_fadvise enable_examples enable_os_bits enable_mode enable_furtive_read enable_debug enable_pedantic enable_build_html enable_special_alloc enable_upx enable_fast_dir enable_thread_safe enable_gpgme_linking with_gpgme_prefix enable_execinfo enable_profiling enable_debug_memory enable_dar_static enable_threadar ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CXXCPP CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures DAR 2.5.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/dar] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of DAR 2.5.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-nls do not use Native Language Support --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-rpath do not hardcode runtime library paths --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-libdl-linking ignore any libdl and avoid linking against it --disable-largefile omit support for large files --disable-libz-linking disable linking with libz and disable libz compression support --disable-libbz2-linking disable linking with libbz2 and disables libbz2 compression support --disable-liblzo2-linking disable linking with liblzo2 and disables lzo compression support --disable-libxz-linking disable linking with libxz/liblzma and disable libxz compression support --disable-libgcrypt-linking disable linking with libgcrypt which disables strong encryption support --disable-ea-support disable Extended Attributes support --disable-nodump-flag disable the ext2/3/4 Filesystem Specific Attribute support, in particular the --nodump feature --disable-birthtime disable the HFS+ Filesystem Specific Attribute support --disable-gnugetopt avoid linking with libgnugetopt --disable-fadvise avoid using fadvise(2) system call --enable-examples buld example and testing programs --enable-os-bits=arg arg is 32 or 64. If for some reason, one wants to overcome detected system value --enable-mode=arg where arg is 32 or 64. Makes dar internally use 32 bits or 64 bits integers in place of infinint (which is the case if this option is not given) --disable-furtive-read Ignore furtive read mode availability on systems that support it --enable-debug build targets with debugging option and no optimization --enable-pedantic enable pedantic syntaxical check at compilation, use only for debugging purposes ! --disable-build-html don't build programming documentation (in particular libdar API documentation) and html man page --disable-special-alloc special memory allcation scheme makes dar using less memory and run a bit faster, in particular in conjunction with --enable-mode=32 or 64, you can disable it if you like --disable-upx by default configure looks for UPX and if available make executables compressed at installation time, you can disable this feature --disable-fast-dir disable optimization for large directories, doing so has a little positive impact on memory requirement but a huge drawback on execution time --disable-thread-safe libdar is thread safe if POSIX mutex are available, you can manually disable the use of POSIX mutex, the resulting libdar library will not be thread-safe anymore unless special-alloc is disabled too --disable-gpgme-linking disable linking with gpgme which disables asymetric crypto algorithms --disable-execinfo disable reporting stack information on self diagnostic bugs even --enable-profiling enable executable profiling --enable-debug-memory log memory allocations and releases to /tmp/dar_debug_mem_allocation.txt this debugging option lead to a slow executable --disable-dar-static avoids building dar_static, a dar statically linked version --enable-threadar EXPERIMENTAL! links with libthreadar if available in order to use several threads inside libdar Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-pkgconfigdir=DIR defines an alternative directory to install pkconfig files, default is '${libdir}/pkgconfig' --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gpgme-prefix=PFX prefix where GPGME is installed (optional) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF DAR configure 2.5.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------------------------------- ## ## Report this to http://sourceforge.net/tracker/?group_id=65612&atid=511612 ## ## ------------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type # ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES # ------------------------------------------------------ # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_cxx_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_member # ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES # ----------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_cxx_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_decl # ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES # ---------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_cxx_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by DAR $as_me 2.5.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " as_fn_append ac_header_list " utime.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat >>confdefs.h <<_ACEOF #define DAR_VERSION "2.5.3" _ACEOF am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='dar' VERSION='2.5.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.19 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" XGETTEXT_EXTRA_OPTIONS='--keyword=dar_gettext' am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_proto_iconv" >&5 $as_echo " $am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi # have a specific variable for pkgconfig, setting the default value: pkgconfigdir=${libdir}/pkgconfig # Check whether --with-pkgconfigdir was given. if test "${with_pkgconfigdir+set}" = set; then : withval=$with_pkgconfigdir; if ! -z "$withval" ; then pkgconfigdir=$withval fi fi # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler usability" >&5 $as_echo_n "checking for C++ compiler usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { class test { public: int test; }; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "No C++ compiler found" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Defining _XOPEN_SOURCE to get extra field in struct stat $as_echo "#define _XOPEN_SOURCE 700" >>confdefs.h ########### ## THE FOLLOWING "DEFINE" USED TO RE-ENABLE FULL LIBC FEATURES ON DIFFERENT OPERATING SYSTEMS ## HAVE BEEN BORROWED FROM PYTHON's configure.in ## ## # The later defininition of _XOPEN_SOURCE disables certain features # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone). $as_echo "#define _GNU_SOURCE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable # them. $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable # them. $as_echo "#define __BSD_VISIBLE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable # them. $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h ## ## ########### # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for endnetconfig in -lnsl" >&5 $as_echo_n "checking for endnetconfig in -lnsl... " >&6; } if ${ac_cv_lib_nsl_endnetconfig+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char endnetconfig (); int main () { return endnetconfig (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_nsl_endnetconfig=yes else ac_cv_lib_nsl_endnetconfig=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_endnetconfig" >&5 $as_echo "$ac_cv_lib_nsl_endnetconfig" >&6; } if test "x$ac_cv_lib_nsl_endnetconfig" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_get_proc in -lcap" >&5 $as_echo_n "checking for cap_get_proc in -lcap... " >&6; } if ${ac_cv_lib_cap_cap_get_proc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cap_get_proc (); int main () { return cap_get_proc (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_cap_cap_get_proc=yes else ac_cv_lib_cap_cap_get_proc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_get_proc" >&5 $as_echo "$ac_cv_lib_cap_cap_get_proc" >&6; } if test "x$ac_cv_lib_cap_cap_get_proc" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCAP 1 _ACEOF LIBS="-lcap $LIBS" fi # Check whether --enable-libdl-linking was given. if test "${enable_libdl_linking+set}" = set; then : enableval=$enable_libdl_linking; else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlsym in -ldl" >&5 $as_echo_n "checking for dlsym in -ldl... " >&6; } if ${ac_cv_lib_dl_dlsym+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlsym (); int main () { return dlsym (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dl_dlsym=yes else ac_cv_lib_dl_dlsym=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 $as_echo "$ac_cv_lib_dl_dlsym" >&6; } if test "x$ac_cv_lib_dl_dlsym" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi fi # Checks for header files. ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in fcntl.h netinet/in.h arpa/inet.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h termios.h unistd.h utime.h sys/types.h signal.h errno.h sys/un.h sys/stat.h time.h fnmatch.h regex.h pwd.h grp.h stdio.h pthread.h ctype.h getopt.h limits.h stddef.h sys/utsname.h libintl.h sys/capability.h linux/capability.h utimes.h sys/time.h wchar.h wctype.h stddef.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_cxx_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_cxx_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF fi ac_fn_cxx_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include /* NetBSD declares sys_siglist in unistd.h. */ #ifdef HAVE_UNISTD_H # include #endif " if test "x$ac_cv_have_decl_sys_siglist" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SYS_SIGLIST $ac_have_decl _ACEOF ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF else as_fn_error $? "Cannot find size_t type" "$LINENO" 5 fi ac_fn_cxx_check_type "$LINENO" "time_t" "ac_cv_type_time_t" "$ac_includes_default" if test "x$ac_cv_type_time_t" = xyes; then : # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 $as_echo_n "checking size of time_t... " >&6; } if ${ac_cv_sizeof_time_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default"; then : else if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 $as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t _ACEOF else as_fn_error $? "Cannot find time_t type" "$LINENO" 5 fi ac_fn_cxx_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF else as_fn_error $? "Cannot find off_t type" "$LINENO" 5 fi # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working POSIX fnmatch" >&5 $as_echo_n "checking for working POSIX fnmatch... " >&6; } if ${ac_cv_func_fnmatch_works+:} false; then : $as_echo_n "(cached) " >&6 else # Some versions of Solaris, SCO, and the GNU C Library # have a broken or incompatible fnmatch. # So we run a test program. If we are cross-compiling, take no chance. # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. if test "$cross_compiling" = yes; then : ac_cv_func_fnmatch_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) int main () { return (!(y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && 1)); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_fnmatch_works=yes else ac_cv_func_fnmatch_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fnmatch_works" >&5 $as_echo "$ac_cv_func_fnmatch_works" >&6; } if test $ac_cv_func_fnmatch_works = yes; then : $as_echo "#define HAVE_FNMATCH 1" >>confdefs.h fi for ac_header in vfork.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail, as required by POSIX. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat accepts an empty string" >&5 $as_echo_n "checking whether lstat accepts an empty string... " >&6; } if ${ac_cv_func_lstat_empty_string_bug+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_lstat_empty_string_bug=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return lstat ("", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_lstat_empty_string_bug=no else ac_cv_func_lstat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_empty_string_bug" >&5 $as_echo "$ac_cv_func_lstat_empty_string_bug" >&6; } if test $ac_cv_func_lstat_empty_string_bug = yes; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_LSTAT_EMPTY_STRING_BUG 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5 $as_echo_n "checking whether sys/types.h defines makedev... " >&6; } if ${ac_cv_header_sys_types_h_makedev+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return makedev(0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_header_sys_types_h_makedev=yes else ac_cv_header_sys_types_h_makedev=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5 $as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then ac_fn_cxx_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h fi if test $ac_cv_header_sys_mkdev_h = no; then ac_fn_cxx_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h fi fi fi for ac_header in stdlib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if ${ac_cv_func_stat_empty_string_bug+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_stat_empty_string_bug=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_stat_empty_string_bug=no else ac_cv_func_stat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether utime accepts a null argument" >&5 $as_echo_n "checking whether utime accepts a null argument... " >&6; } if ${ac_cv_func_utime_null+:} false; then : $as_echo_n "(cached) " >&6 else rm -f conftest.data; >conftest.data # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. if test "$cross_compiling" = yes; then : ac_cv_func_utime_null='guessing yes' else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_UTIME_H # include #endif int main () { struct stat s, t; return ! (stat ("conftest.data", &s) == 0 && utime ("conftest.data", 0) == 0 && stat ("conftest.data", &t) == 0 && t.st_mtime >= s.st_mtime && t.st_mtime - s.st_mtime < 120); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_utime_null=yes else ac_cv_func_utime_null=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_utime_null" >&5 $as_echo "$ac_cv_func_utime_null" >&6; } if test "x$ac_cv_func_utime_null" != xno; then ac_cv_func_utime_null=yes $as_echo "#define HAVE_UTIME_NULL 1" >>confdefs.h fi rm -f conftest.data { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_func in lchown mkdir regcomp rmdir strerr-or strerror_r utime fdopendir readdir_r ctime_r getgrnam_r getpwnam_r localtime_r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for c++11 support" >&5 $as_echo_n "checking for c++11 support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { thread_local static int test = 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for c++ support with -std=c++11 option set" >&5 $as_echo_n "checking for c++ support with -std=c++11 option set... " >&6; } CXXSTDFLAGS="-std=c++11" CXXFLAGS="$CXXFLAGS $CXXSTDFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { thread_local static int test = 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "C++ compiler lack support for c++11 standard" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sed -r/-E option" >&5 $as_echo_n "checking for sed -r/-E option... " >&6; } if sed -r -e 's/(c|o)+/\1/g' > /dev/null < /dev/null ; then local_sed="gnu" { $as_echo "$as_me:${as_lineno-$LINENO}: result: GNU sed, using -r option for regex" >&5 $as_echo "GNU sed, using -r option for regex" >&6; } else if sed -E -e 's/(c|o)+/\1/g' > /dev/null < /dev/null ; then local_sed="bsd" { $as_echo "$as_me:${as_lineno-$LINENO}: result: BSD sed, using -E option for regex" >&5 $as_echo "BSD sed, using -E option for regex" >&6; } else local_sed=unknown as_fn_error $? "unknown switch to use with sed to support regex" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt() in " >&5 $as_echo_n "checking for getopt() in ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_UNISTD_H #include #endif } int main () { getopt(0, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_GETOPT_IN_UNISTD_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: present" >&5 $as_echo "present" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: absent" >&5 $as_echo "absent" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long() in " >&5 $as_echo_n "checking for getopt_long() in ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_UNISTD_H #include #endif } int main () { getopt_long(0, 0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_GETOPT_LONG_IN_UNISTD_H 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: present" >&5 $as_echo "present" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: absent" >&5 $as_echo "absent" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset presence" >&5 $as_echo_n "checking for optreset presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_GETOPT_H #include #else #if HAVE_UNISTD_H #include #endif #endif } int main () { int x = optreset; return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_OPTRESET 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Door file support" >&5 $as_echo_n "checking for Door file support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif } int main () { struct stat buf; if(S_ISDOOR(buf.st_mode)) return 0; else return 1; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_DOOR 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX.1e capabilities support" >&5 $as_echo_n "checking for POSIX.1e capabilities support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_CAPABILITY_H #include #else #if HAVE_LINUX_CAPABILITY_H #include #endif #endif #if HAVE_SYS_TYPES_H #include #endif } int main () { cap_t capaset = cap_get_proc(); (void)cap_free((void *)capset); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_CAPABILITIES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fdatasync() availability" >&5 $as_echo_n "checking for fdatasync() availability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_UNISTD_H #include #endif } int main () { (void)fdatasync(0); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_FDATASYNC 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the possibility to set timestamps at a microsecond precision" >&5 $as_echo_n "checking for the possibility to set timestamps at a microsecond precision... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_UTIMES_H #include #endif #if HAVE_SYS_TIME_H #include #endif } int main () { struct timeval tv[2]; tv[0].tv_sec = 1000; tv[1].tv_usec = 2000; (void)utimes("/tmp/testfile.tmp", tv); /* note that this test program is only compiled+linked not run */ return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define LIBDAR_MICROSECOND_WRITE_ACCURACY 1" >>confdefs.h local_microsecond_write=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the possibility to read timestamps at a microsecond precision" >&5 $as_echo_n "checking for the possibility to read timestamps at a microsecond precision... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif } int main () { struct stat st; /* tv_nsec is nanosecond, but for now we do not keep more precised timing than microseconds because we have not portable way to restore nanoseconds but only seconds and microsecond */ if(st.st_atim.tv_nsec != 0) return 0; else return 1; /* whatever, this test program is only compiled no run */ ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define LIBDAR_MICROSECOND_READ_ACCURACY 1" >>confdefs.h local_microsecond_read=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lutimes() availability" >&5 $as_echo_n "checking for lutimes() availability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_TIME_H #include #endif } // extern "C" int main () { struct timeval tv[2]; int lu = lutimes("/tmp/noway", tv); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_LUTIMES 1" >>confdefs.h local_lutimes=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r flavor" >&5 $as_echo_n "checking for strerror_r flavor... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_STRING_H #include #endif } // externe "C" int main () { char *ptr = strerror_r(0, nullptr, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_STRERROR_R_CHAR_PTR 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: GNU specific" >&5 $as_echo "GNU specific" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: XSI compliant" >&5 $as_echo "XSI compliant" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # DAR's features # Check whether --enable-libz-linking was given. if test "${enable_libz_linking+set}" = set; then : enableval=$enable_libz_linking; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libz compression support has been disabled by user" >&5 $as_echo "$as_me: WARNING: libz compression support has been disabled by user" >&2;} local_libz="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 $as_echo_n "checking for deflate in -lz... " >&6; } if ${ac_cv_lib_z_deflate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char deflate (); int main () { return deflate (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_z_deflate=yes else ac_cv_lib_z_deflate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 $as_echo "$ac_cv_lib_z_deflate" >&6; } if test "x$ac_cv_lib_z_deflate" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: library zlib not found" >&5 $as_echo "$as_me: WARNING: library zlib not found" >&2;} fi ac_fn_cxx_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : local_libz="yes" $as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find zlib.h header file" >&5 $as_echo "$as_me: WARNING: Cannot find zlib.h header file" >&2;} local_libz="no" fi if test "$local_libz" = "yes" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_ZLIB_H #include #endif } int main () { z_stream *ptr = (z_stream *)0; deflate(ptr, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBZ_AVAILABLE 1" >>confdefs.h else local_libz="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libz compression support not available" >&5 $as_echo "$as_me: WARNING: libz compression support not available" >&2;} fi fi # Check whether --enable-libbz2-linking was given. if test "${enable_libbz2_linking+set}" = set; then : enableval=$enable_libbz2_linking; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libbz2 compression support has been disabled by user" >&5 $as_echo "$as_me: WARNING: libbz2 compression support has been disabled by user" >&2;} local_libbz2="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompress in -lbz2" >&5 $as_echo_n "checking for BZ2_bzCompress in -lbz2... " >&6; } if ${ac_cv_lib_bz2_BZ2_bzCompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char BZ2_bzCompress (); int main () { return BZ2_bzCompress (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_bz2_BZ2_bzCompress=yes else ac_cv_lib_bz2_BZ2_bzCompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzCompress" >&5 $as_echo "$ac_cv_lib_bz2_BZ2_bzCompress" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzCompress" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBBZ2 1 _ACEOF LIBS="-lbz2 $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: library libbz2 not found" >&5 $as_echo "$as_me: WARNING: library libbz2 not found" >&2;} fi ac_fn_cxx_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" if test "x$ac_cv_header_bzlib_h" = xyes; then : local_libbz2="yes" $as_echo "#define HAVE_BZLIB_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find bzlib.h header file" >&5 $as_echo "$as_me: WARNING: Cannot find bzlib.h header file" >&2;} local_libbz2="no" fi if test "$local_libbz2" = "yes" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_BZLIB_H #include #endif } int main () { bz_stream *ptr = (bz_stream *)0; BZ2_bzCompress(ptr, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBBZ2_AVAILABLE 1" >>confdefs.h else local_libbz2="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libbz2 compression support not available" >&5 $as_echo "$as_me: WARNING: libbz2 compression support not available" >&2;} fi fi # Check whether --enable-liblzo2-linking was given. if test "${enable_liblzo2_linking+set}" = set; then : enableval=$enable_liblzo2_linking; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: lzo compression support has been disabled by user" >&5 $as_echo "$as_me: WARNING: lzo compression support has been disabled by user" >&2;} local_liblzo2="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_1_compress in -llzo2" >&5 $as_echo_n "checking for lzo1x_1_compress in -llzo2... " >&6; } if ${ac_cv_lib_lzo2_lzo1x_1_compress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lzo1x_1_compress (); int main () { return lzo1x_1_compress (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_lzo2_lzo1x_1_compress=yes else ac_cv_lib_lzo2_lzo1x_1_compress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_1_compress" >&5 $as_echo "$ac_cv_lib_lzo2_lzo1x_1_compress" >&6; } if test "x$ac_cv_lib_lzo2_lzo1x_1_compress" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLZO2 1 _ACEOF LIBS="-llzo2 $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: library liblzo2 not found" >&5 $as_echo "$as_me: WARNING: library liblzo2 not found" >&2;} fi ac_fn_cxx_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default" if test "x$ac_cv_header_lzo_lzo1x_h" = xyes; then : local_liblzo2="yes" $as_echo "#define HAVE_LZO_LZO1X_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find lzo/lzo1x.h header file" >&5 $as_echo "$as_me: WARNING: Cannot find lzo/lzo1x.h header file" >&2;} local_liblzo2="no" fi if test "$local_liblzo2" = "yes" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_LZO_LZO1X_H #include #endif } int main () { int x = lzo1x_1_compress(0, 0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBLZO2_AVAILABLE 1" >>confdefs.h else local_liblzo2="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: lzo compression support not available" >&5 $as_echo "$as_me: WARNING: lzo compression support not available" >&2;} fi fi # Check whether --enable-libxz-linking was given. if test "${enable_libxz_linking+set}" = set; then : enableval=$enable_libxz_linking; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libxz compression support has been disabled by user" >&5 $as_echo "$as_me: WARNING: libxz compression support has been disabled by user" >&2;} local_libxz="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_code in -llzma" >&5 $as_echo_n "checking for lzma_code in -llzma... " >&6; } if ${ac_cv_lib_lzma_lzma_code+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzma $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lzma_code (); int main () { return lzma_code (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_lzma_lzma_code=yes else ac_cv_lib_lzma_lzma_code=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_code" >&5 $as_echo "$ac_cv_lib_lzma_lzma_code" >&6; } if test "x$ac_cv_lib_lzma_lzma_code" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLZMA 1 _ACEOF LIBS="-llzma $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: library liblzma not found" >&5 $as_echo "$as_me: WARNING: library liblzma not found" >&2;} fi ac_fn_cxx_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" if test "x$ac_cv_header_lzma_h" = xyes; then : local_libxz="yes" $as_echo "#define HAVE_LZMA_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find lzma.h header file" >&5 $as_echo "$as_me: WARNING: Cannot find lzma.h header file" >&2;} local_libxz="no" fi if test "$local_libxz" = "yes" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_LZMA_H #include #endif } int main () { lzma_stream ptr = LZMA_STREAM_INIT; lzma_ret tmp = lzma_easy_encoder(&ptr, 2, LZMA_CHECK_CRC32); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBLZMA_AVAILABLE 1" >>confdefs.h else local_libxz="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libxz compression support not available" >&5 $as_echo "$as_me: WARNING: libxz compression support not available" >&2;} fi fi # Check whether --enable-libgcrypt-linking was given. if test "${enable_libgcrypt_linking+set}" = set; then : enableval=$enable_libgcrypt_linking; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: strong encryption support has been disabled by user" >&5 $as_echo "$as_me: WARNING: strong encryption support has been disabled by user" >&2;} local_crypto="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gpg_err_init in -lgpg-error" >&5 $as_echo_n "checking for gpg_err_init in -lgpg-error... " >&6; } if ${ac_cv_lib_gpg_error_gpg_err_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpg-error $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gpg_err_init (); int main () { return gpg_err_init (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_gpg_error_gpg_err_init=yes else ac_cv_lib_gpg_error_gpg_err_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gpg_error_gpg_err_init" >&5 $as_echo "$ac_cv_lib_gpg_error_gpg_err_init" >&6; } if test "x$ac_cv_lib_gpg_error_gpg_err_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGPG_ERROR 1 _ACEOF LIBS="-lgpg-error $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_check_version in -lgcrypt" >&5 $as_echo_n "checking for gcry_check_version in -lgcrypt... " >&6; } if ${ac_cv_lib_gcrypt_gcry_check_version+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgcrypt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gcry_check_version (); int main () { return gcry_check_version (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_gcrypt_gcry_check_version=yes else ac_cv_lib_gcrypt_gcry_check_version=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_check_version" >&5 $as_echo "$ac_cv_lib_gcrypt_gcry_check_version" >&6; } if test "x$ac_cv_lib_gcrypt_gcry_check_version" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGCRYPT 1 _ACEOF LIBS="-lgcrypt $LIBS" fi ac_fn_cxx_check_header_mongrel "$LINENO" "gcrypt.h" "ac_cv_header_gcrypt_h" "$ac_includes_default" if test "x$ac_cv_header_gcrypt_h" = xyes; then : local_crypto="yes" $as_echo "#define HAVE_GCRYPT_H 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannt find gcrypt.h header file" >&5 $as_echo "$as_me: WARNING: Cannt find gcrypt.h header file" >&2;} local_crypto="no" fi if test "$local_crypto" = "yes" ; then min_version_gcrypt="1.4.0" cat >>confdefs.h <<_ACEOF #define MIN_VERSION_GCRYPT "$min_version_gcrypt" _ACEOF min_version_gcrypt_hash_bug="1.6.0" cat >>confdefs.h <<_ACEOF #define MIN_VERSION_GCRYPT_HASH_BUG "$min_version_gcrypt_hash_bug" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgcrypt usability" >&5 $as_echo_n "checking for libgcrypt usability... " >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_GCRYPT_H #include #endif } #include using namespace std; int main () { if(!gcry_check_version(MIN_VERSION_GCRYPT)) { cout << "ligcrypt version too low, minimum version is " << MIN_VERSION_GCRYPT << endl; exit(1); } else exit(0); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : $as_echo "#define CRYPTO_AVAILABLE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_GCRYPT_H #include #endif } int main () { if(!gcry_check_version(MIN_VERSION_GCRYPT_HASH_BUG)) exit(1); else exit(0); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else libgcrypt_hash_bug="yes" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else if test "$?" = "1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed: need libgcypt >= $min_version_gcrypt, disabling strong encryption support" >&5 $as_echo "failed: need libgcypt >= $min_version_gcrypt, disabling strong encryption support" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed: libgcrypt is unusable, cannot even call gcry_check_version(). Disabling strong encryption support" >&5 $as_echo "failed: libgcrypt is unusable, cannot even call gcry_check_version(). Disabling strong encryption support" >&6; } fi local_crypto="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: strong encryption support not available" >&5 $as_echo "$as_me: WARNING: strong encryption support not available" >&2;} fi fi # Check whether --enable-ea-support was given. if test "${enable_ea_support+set}" = set; then : enableval=$enable_ea_support; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Extended Attribute support" >&5 $as_echo_n "checking for Extended Attribute support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } else for ac_header in attr/xattr.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default" if test "x$ac_cv_header_attr_xattr_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ATTR_XATTR_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lgetxattr in -lattr" >&5 $as_echo_n "checking for lgetxattr in -lattr... " >&6; } if ${ac_cv_lib_attr_lgetxattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lgetxattr (); int main () { return lgetxattr (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_attr_lgetxattr=yes else ac_cv_lib_attr_lgetxattr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_lgetxattr" >&5 $as_echo "$ac_cv_lib_attr_lgetxattr" >&6; } if test "x$ac_cv_lib_attr_lgetxattr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBATTR 1 _ACEOF LIBS="-lattr $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Unix Extended Attribute support" >&5 $as_echo_n "checking for Unix Extended Attribute support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_ATTR_XATTR_H #include #endif } int main () { lgetxattr((char *)0, (char *)0, (void *)0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define EA_SUPPORT /**/" >>confdefs.h local_ea_support="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } for ac_header in sys/xattr.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" if test "x$ac_cv_header_sys_xattr_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_XATTR_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgetxattr in -lc" >&5 $as_echo_n "checking for fgetxattr in -lc... " >&6; } if ${ac_cv_lib_c_fgetxattr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fgetxattr (); int main () { return fgetxattr (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_c_fgetxattr=yes else ac_cv_lib_c_fgetxattr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_fgetxattr" >&5 $as_echo "$ac_cv_lib_c_fgetxattr" >&6; } if test "x$ac_cv_lib_c_fgetxattr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBC 1 _ACEOF LIBS="-lc $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Extended Attribute support" >&5 $as_echo_n "checking for Mac OS X Extended Attribute support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_XATTR_H #include #endif } int main () { getxattr((char *)0, (char *)0, (void *)0, 0, 0, XATTR_NOFOLLOW); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define EA_SUPPORT /**/" >>confdefs.h $as_echo "#define OSX_EA_SUPPORT /**/" >>confdefs.h local_ea_support="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking ext2fs.h availability" >&5 $as_echo_n "checking ext2fs.h availability... " >&6; } # Check whether --enable-nodump-flag was given. if test "${enable_nodump_flag+set}" = set; then : enableval=$enable_nodump_flag; { $as_echo "$as_me:${as_lineno-$LINENO}: result: extX FSA disabled" >&5 $as_echo "extX FSA disabled" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #include #if HAVE_SYS_IOCTL_H #include #endif } int main () { int fd, f; ioctl(fd, EXT2_IOC_GETFLAGS, &f); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBDAR_NODUMP_FEATURE NODUMP_EXT2FS" >>confdefs.h local_nodump_feature="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found " >&5 $as_echo "found " >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #include #if HAVE_SYS_IOCTL_H #include #endif } int main () { int fd, f; ioctl(fd, EXT2_IOC_GETFLAGS, &f); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBDAR_NODUMP_FEATURE NODUMP_LINUX" >>confdefs.h local_nodump_feature="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found " >&5 $as_echo "found " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: NOT FOUND" >&5 $as_echo "NOT FOUND" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find ext2_fs.h header file, nodump-flag and extX FSA features will not be available" >&5 $as_echo "$as_me: WARNING: cannot find ext2_fs.h header file, nodump-flag and extX FSA features will not be available" >&2;} fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking birth time availability" >&5 $as_echo_n "checking birth time availability... " >&6; } # Check whether --enable-birthtime was given. if test "${enable_birthtime+set}" = set; then : enableval=$enable_birthtime; { $as_echo "$as_me:${as_lineno-$LINENO}: result: hfs+ FSA disabled" >&5 $as_echo "hfs+ FSA disabled" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_TYPE_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif } int main () { struct stat tmp; int ret = stat("/", &tmp); time_t birth = tmp.st_birthtime; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBDAR_BIRTHTIME 1" >>confdefs.h local_birthtime="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: NOT FOUND" >&5 $as_echo "NOT FOUND" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find support for birthtime, HFS+ FSA support will not be available" >&5 $as_echo "$as_me: WARNING: Cannot find support for birthtime, HFS+ FSA support will not be available" >&2;} fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # Check whether --enable-gnugetopt was given. if test "${enable_gnugetopt+set}" = set; then : enableval=$enable_gnugetopt; else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long in -lgnugetopt" >&5 $as_echo_n "checking for getopt_long in -lgnugetopt... " >&6; } if ${ac_cv_lib_gnugetopt_getopt_long+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgnugetopt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getopt_long (); int main () { return getopt_long (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_gnugetopt_getopt_long=yes else ac_cv_lib_gnugetopt_getopt_long=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnugetopt_getopt_long" >&5 $as_echo "$ac_cv_lib_gnugetopt_getopt_long" >&6; } if test "x$ac_cv_lib_gnugetopt_getopt_long" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGNUGETOPT 1 _ACEOF LIBS="-lgnugetopt $LIBS" fi fi # Check whether --enable-fadvise was given. if test "${enable_fadvise+set}" = set; then : enableval=$enable_fadvise; else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for posix_fadvise support" >&5 $as_echo_n "checking for posix_fadvise support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_FCNTL_H #include #endif } int main () { (void)posix_fadvise(0,0,1,POSIX_FADV_NORMAL); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_POSIX_FADVISE 1" >>confdefs.h local_posix_fadvise="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not available" >&5 $as_echo "not available" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi # AC_ARG_ENABLE( [librsync-linking], # AC_HELP_STRING(--disable-librsync-linking, [disable linking with librsync and disable delta compression support]), # [ # AC_MSG_WARN([librsync delta-compression support has been disabled by user]) # local_librsync="no" # ], # [ # AC_CHECK_LIB(rsync, [rs_strerror], [], [AC_MSG_WARN([library librsync not found])]) # AC_CHECK_HEADER(librsync.h, [local_librsync="yes" # AC_DEFINE(HAVE_LIBRSYNC_H, 1, [librsync.h header file is available]) # ], # [AC_MSG_WARN([Cannot find librsync.h header file]) # local_librsync="no" # ]) # if test "$local_librsync" = "yes" ; then # AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern "C" { # #if HAVE_LIBRSYNC_H # #include # #include # #endif # }]], # [[ # rs_result err = RS_DONE; # (void) rs_strerror(err); # ]]) # ], # [ AC_DEFINE(LIBRSYNC_AVAILABLE, 1, [header and linking is available to have librsync functions])], # [ local_librsync="no" ]) # else # AC_MSG_WARN([librsync compression support not available]) # fi # ] # ) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt() availability" >&5 $as_echo_n "checking for getopt() availability... " >&6; }; cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_GETOPT_H #include #else #if HAVE_UNISTD_H #include #endif #endif } int main () { getopt(0, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "absent but required" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long() availability" >&5 $as_echo_n "checking for getopt_long() availability... " >&6; }; cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_GETOPT_H #include #else #if HAVE_UNISTD_H #include #endif #endif } int main () { getopt_long(0, 0, 0, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : local_have_getopt_long="yes" $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: NOT AVAILABLE" >&5 $as_echo "NOT AVAILABLE" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # Check whether --enable-examples was given. if test "${enable_examples+set}" = set; then : enableval=$enable_examples; examples="yes" else examples="false" fi # Check whether --enable-os-bits was given. if test "${enable_os_bits+set}" = set; then : enableval=$enable_os_bits; cat >>confdefs.h <<_ACEOF #define OS_BITS $enableval _ACEOF else ac_fn_cxx_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #include } int main () { uint16_t a = 0; uint32_t b = 0; uint64_t c = 0; int16_t d = 0; int32_t e = 0; int64_t f = 0; return a+b+c+d+e+f; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else as_fn_error $? "Cannot find *int*_t type declarations in headerfile, --enable-os-bits=... option must be used" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else as_fn_error $? "Cannot find inttypes.h headerfile, --enable-os-bits=... option must be used" "$LINENO" 5 fi fi # Check whether --enable-mode was given. if test "${enable_mode+set}" = set; then : enableval=$enable_mode; build_mode=$enableval fi # Check whether --enable-furtive-read was given. if test "${enable_furtive_read+set}" = set; then : enableval=$enable_furtive_read; local_furtive_read_mode="no" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Furtive read mode disabled" >&5 $as_echo "$as_me: WARNING: Furtive read mode disabled" >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking furtive read mode availability" >&5 $as_echo_n "checking furtive read mode availability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_SYS_TYPE_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_DIRENT_H #include #endif } int main () { int x = O_NOATIME; int fd = open("/",O_RDONLY|O_NOATIME); #if HAVE_FDOPENDIR (void)fdopendir(fd); #else syntaxically incorrect statement here to force compilation to fail! #endif ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define FURTIVE_READ_MODE_AVAILABLE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: available" >&5 $as_echo "available" >&6; } local_furtive_read_mode="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no available" >&5 $as_echo "no available" >&6; } local_furtive_read_mode="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; # yes we modify user variable here to remove any optimization CXXFLAGS="$CXXSTDFLAGS -ggdb -Wall" CFLAGS="-ggdb -Wall" LDFLAGS="-ggdb -Wall" debug_static="yes" $as_echo "#define LIBDAR_NO_OPTIMIZATION 1" >>confdefs.h else debug_static="no" fi # Check whether --enable-pedantic was given. if test "${enable_pedantic+set}" = set; then : enableval=$enable_pedantic; CXXFLAGS="$CXXFLAGS -pedantic -Wno-long-long" fi # Check whether --enable-build-html was given. if test "${enable_build_html+set}" = set; then : enableval=$enable_build_html; doxygen="no" groff="no" else # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_doxygen+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$doxygen"; then ac_cv_prog_doxygen="$doxygen" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_doxygen="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_doxygen" && ac_cv_prog_doxygen="no" fi fi doxygen=$ac_cv_prog_doxygen if test -n "$doxygen"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doxygen" >&5 $as_echo "$doxygen" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for doxygen version" >&5 $as_echo_n "checking for doxygen version... " >&6; } if test "$doxygen" = "yes" ; then n1=`doxygen --version | cut -d '.' -f 1` n2=`doxygen --version | cut -d '.' -f 2` if test $n1 -gt 1 -o $n2 -ge 3 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: >= 1.3" >&5 $as_echo " >= 1.3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old (< 1.3) ignoring doxygen" >&5 $as_echo " too old (< 1.3) ignoring doxygen" >&6; } doxygen="no" fi fi # Extract the first word of "man", so it can be a program name with args. set dummy man; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_tmp+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$tmp"; then ac_cv_prog_tmp="$tmp" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_tmp="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_tmp" && ac_cv_prog_tmp="no" fi fi tmp=$ac_cv_prog_tmp if test -n "$tmp"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tmp" >&5 $as_echo "$tmp" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$tmp" = "yes" ; then # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_groff+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$groff"; then ac_cv_prog_groff="$groff" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_groff="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_groff" && ac_cv_prog_groff="no" fi fi groff=$ac_cv_prog_groff if test -n "$groff"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $groff" >&5 $as_echo "$groff" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else groff = "no"; fi fi # Check whether --enable-special-alloc was given. if test "${enable_special_alloc+set}" = set; then : enableval=$enable_special_alloc; else $as_echo "#define LIBDAR_SPECIAL_ALLOC /**/" >>confdefs.h local_special_alloc="yes" fi # Check whether --enable-upx was given. if test "${enable_upx+set}" = set; then : enableval=$enable_upx; { $as_echo "$as_me:${as_lineno-$LINENO}: ignoring UPX" >&5 $as_echo "$as_me: ignoring UPX" >&6;} upx="no" else # Extract the first word of "upx", so it can be a program name with args. set dummy upx; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_upx+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$upx"; then ac_cv_prog_upx="$upx" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_upx="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_upx" && ac_cv_prog_upx="no" fi fi upx=$ac_cv_prog_upx if test -n "$upx"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $upx" >&5 $as_echo "$upx" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Check whether --enable-fast-dir was given. if test "${enable_fast_dir+set}" = set; then : enableval=$enable_fast_dir; else $as_echo "#define LIBDAR_FAST_DIR 1" >>confdefs.h local_fast_dir="yes" fi # Check whether --enable-thread-safe was given. if test "${enable_thread_safe+set}" = set; then : enableval=$enable_thread_safe; { $as_echo "$as_me:${as_lineno-$LINENO}: thread-safe support disabled" >&5 $as_echo "$as_me: thread-safe support disabled" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_init=yes else ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX mutex" >&5 $as_echo_n "checking for POSIX mutex... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_PTHREAD_H #include #endif } int main () { pthread_mutex_t mutex; pthread_mutex_init(&mutex, (const pthread_mutexattr_t*)0); pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define MUTEX_WORKS 1" >>confdefs.h local_mutex_works="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking for reentrant stdlib calls" >&5 $as_echo_n "checking for reentrant stdlib calls... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_TIME_H #include #endif #if HAVE_SYS_TYPE_H #include #endif #if HAVE_GRP_H #include #endif #if HAVE_PWD_H #include #endif #if HAVE_DIRENT_H #include #endif } int main () { #if HAVE_CTIME_R char *val1 = ctime_r(nullptr, nullptr); #else error(); // should not compile as expected #endif #if HAVE_GETGRNAM_R int val2 = getgrnam_r(0, nullptr, nullptr, 0, nullptr); #else error(); // should not compile as expected #endif #if HAVE_GETPWNAM_R int val3 = getpwnam_r(nullptr, nullptr, nullptr, 0, nullptr); #else error(); // should not compile as expected #endif #if HAVE_LOCALTIME_R struct tm *val4 = localtime_r(nullptr, nullptr); #else error(); // should not compile as expected #endif #if HAVE_READDIR_R int val5 = readdir_r(nullptr, nullptr, nullptr); #else error(); // should not compile as expected #endif ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: all could be found" >&5 $as_echo "all could be found" >&6; } else $as_echo "#define MISSING_REENTRANT_LIBCALL 1" >>confdefs.h local_missing_reentrant_libcal="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: some are missing" >&5 $as_echo "some are missing" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # Check whether --with-gpgme-prefix was given. if test "${with_gpgme_prefix+set}" = set; then : withval=$with_gpgme_prefix; gpgme_config_prefix="$withval" else gpgme_config_prefix="" fi if test "x$gpgme_config_prefix" != x ; then GPGME_CONFIG="$gpgme_config_prefix/bin/gpgme-config" fi # Extract the first word of "gpgme-config", so it can be a program name with args. set dummy gpgme-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GPGME_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $GPGME_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GPGME_CONFIG="$GPGME_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GPGME_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GPGME_CONFIG" && ac_cv_path_GPGME_CONFIG="no" ;; esac fi GPGME_CONFIG=$ac_cv_path_GPGME_CONFIG if test -n "$GPGME_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGME_CONFIG" >&5 $as_echo "$GPGME_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GPGME_CONFIG" != "no" ; then gpgme_version=`$GPGME_CONFIG --version` fi gpgme_version_major=`echo $gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'` gpgme_version_minor=`echo $gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'` gpgme_version_micro=`echo $gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'` # Check whether --enable-gpgme-linking was given. if test "${enable_gpgme_linking+set}" = set; then : enableval=$enable_gpgme_linking; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: asymetrical encryption support has been disabled by user" >&5 $as_echo "$as_me: WARNING: asymetrical encryption support has been disabled by user" >&2;} local_gpgme="no" else if test $local_crypto != no ; then gpgme_min_version="1.2.0" cat >>confdefs.h <<_ACEOF #define GPGME_MIN_VERSION "$gpgme_min_version" _ACEOF tmp=$gpgme_min_version if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'` else req_gpgme_api=0 min_gpgme_version="$tmp" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME - version >= $min_gpgme_version" >&5 $as_echo_n "checking for GPGME - version >= $min_gpgme_version... " >&6; } ok=no if test "$GPGME_CONFIG" != "no" ; then req_major=`echo $min_gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` req_minor=`echo $min_gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` req_micro=`echo $min_gpgme_version | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` if test "$gpgme_version_major" -gt "$req_major"; then ok=yes else if test "$gpgme_version_major" -eq "$req_major"; then if test "$gpgme_version_minor" -gt "$req_minor"; then ok=yes else if test "$gpgme_version_minor" -eq "$req_minor"; then if test "$gpgme_version_micro" -ge "$req_micro"; then ok=yes fi fi fi fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no fi fi fi fi if test $ok = yes; then GPGME_CFLAGS=`$GPGME_CONFIG --cflags` GPGME_LIBS=`$GPGME_CONFIG --libs` { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CPPFLAGS___cache="$CPPFLAGS" CPPFLAGS="$GPGME_CFLAGS $CPPFLAGS" LDFLAGS___cache="$LDFLAGS" LDFLAGS="$GPGME_LIBS $LFDLAGS" for ac_header in gpgme.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "gpgme.h" "ac_cv_header_gpgme_h" "$ac_includes_default" if test "x$ac_cv_header_gpgme_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GPGME_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgpgme usability" >&5 $as_echo_n "checking for libgpgme usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_GPGME_H #include #endif int main () { gpgme_ctx_t context; gpgme_error_t err = gpgme_new(&context); gpgme_release(context); return err; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : local_gpgme="yes" $as_echo "#define GPGME_SUPPORT 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else local_gpgme="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable! See config.log for details" >&5 $as_echo "not usable! See config.log for details" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS___cache" unset CPPFLAGS___cache LDFLAGS="$LDFLAGS___cache" unset LDFLAGS___cache else GPGME_CFLAGS="" GPGME_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Public key support (GPGME linking) requires libgcrypt (strong encryption support)" >&5 $as_echo "$as_me: WARNING: Public key support (GPGME linking) requires libgcrypt (strong encryption support)" >&2;} fi fi # Check whether --enable-execinfo was given. if test "${enable_execinfo+set}" = set; then : enableval=$enable_execinfo; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ignoring execinfo even if available" >&5 $as_echo "$as_me: WARNING: ignoring execinfo even if available" >&2;} else for ac_header in execinfo.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" if test "x$ac_cv_header_execinfo_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EXECINFO_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lexecinfo" >&5 $as_echo_n "checking for backtrace in -lexecinfo... " >&6; } if ${ac_cv_lib_execinfo_backtrace+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexecinfo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char backtrace (); int main () { return backtrace (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_execinfo_backtrace=yes else ac_cv_lib_execinfo_backtrace=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5 $as_echo "$ac_cv_lib_execinfo_backtrace" >&6; } if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBEXECINFO 1 _ACEOF LIBS="-lexecinfo $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace() usability" >&5 $as_echo_n "checking for backtrace() usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_EXECINFO_H #include #endif } int main () { const int buf_size = 20; void *buffer[buf_size]; int x = backtrace(buffer, buf_size); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define BACKTRACE_AVAILABLE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then : enableval=$enable_profiling; profiling="yes" fi # Check whether --enable-debug-memory was given. if test "${enable_debug_memory+set}" = set; then : enableval=$enable_debug_memory; $as_echo "#define LIBDAR_DEBUG_MEMORY 1" >>confdefs.h fi # Check whether --enable-dar-static was given. if test "${enable_dar_static+set}" = set; then : enableval=$enable_dar_static; build_static="no" else build_static="yes" fi # Check whether --enable-threadar was given. if test "${enable_threadar+set}" = set; then : enableval=$enable_threadar; for ac_header in libthreadar/libthreadar.hpp do : ac_fn_cxx_check_header_mongrel "$LINENO" "libthreadar/libthreadar.hpp" "ac_cv_header_libthreadar_libthreadar_hpp" "$ac_includes_default" if test "x$ac_cv_header_libthreadar_libthreadar_hpp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBTHREADAR_LIBTHREADAR_HPP 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for for_autoconf in -lthreadar" >&5 $as_echo_n "checking for for_autoconf in -lthreadar... " >&6; } if ${ac_cv_lib_threadar_for_autoconf+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthreadar $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char for_autoconf (); int main () { return for_autoconf (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_threadar_for_autoconf=yes else ac_cv_lib_threadar_for_autoconf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_threadar_for_autoconf" >&5 $as_echo "$ac_cv_lib_threadar_for_autoconf" >&6; } if test "x$ac_cv_lib_threadar_for_autoconf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBTHREADAR 1 _ACEOF LIBS="-lthreadar $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libthreadar() availability" >&5 $as_echo_n "checking for libthreadar() availability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_LIBTHREADAR_LIBTHREADAR_HPP #include #endif int main () { class mythread: public libthreadar::thread { protected: virtual void inherited_run() {}; }; mythread toto; toto.run(); toto.join(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define LIBTHREADAR_AVAILABLE 1" >>confdefs.h local_threadar=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: missing" >&5 $as_echo "missing" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi MEM_LDFLAGS=$LDFLAGS LDFLAGS="-static" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_EXECINFO_H #include #endif #if HAVE_STDLIB_H #include #endif #if HAVE_PTHREAD_H #include #endif } int main () { #if HAVE_EXECINFO_H const int buf_size = 20; void *buffer[buf_size]; int size = backtrace(buffer, buf_size); char **symbols = backtrace_symbols(buffer, size); if(symbols != nullptr) free(symbols); #endif #if MUTEX_WORKS pthread_mutex_t test; pthread_mutex_lock(&test); pthread_mutex_unlock(&test); #endif printf("Hello World!"); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : static_pb="no" else static_pb="yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$MEM_LDFLAGS if test $examples = "yes"; then MAKE_ALL_DIR_TRUE= MAKE_ALL_DIR_FALSE='#' else MAKE_ALL_DIR_TRUE='#' MAKE_ALL_DIR_FALSE= fi if test $build_static = "yes" -a $static_pb = "no"; then BUILD_DAR_STATIC_TRUE= BUILD_DAR_STATIC_FALSE='#' else BUILD_DAR_STATIC_TRUE='#' BUILD_DAR_STATIC_FALSE= fi if test $debug_static = "yes" -a $static_pb = "no"; then DEBUG_STATIC_TRUE= DEBUG_STATIC_FALSE='#' else DEBUG_STATIC_TRUE='#' DEBUG_STATIC_FALSE= fi if test "$build_mode" = "32"; then BUILD_MODE32_TRUE= BUILD_MODE32_FALSE='#' else BUILD_MODE32_TRUE='#' BUILD_MODE32_FALSE= fi if test "$build_mode" = "64"; then BUILD_MODE64_TRUE= BUILD_MODE64_FALSE='#' else BUILD_MODE64_TRUE='#' BUILD_MODE64_FALSE= fi if test "$upx" = "yes"; then USE_UPX_TRUE= USE_UPX_FALSE='#' else USE_UPX_TRUE='#' USE_UPX_FALSE= fi if test "$doxygen" = "yes"; then USE_DOXYGEN_TRUE= USE_DOXYGEN_FALSE='#' else USE_DOXYGEN_TRUE='#' USE_DOXYGEN_FALSE= fi if test "$groff" = "yes"; then USE_GROFF_TRUE= USE_GROFF_FALSE='#' else USE_GROFF_TRUE='#' USE_GROFF_FALSE= fi if test "$profiling" = "yes"; then PROFILING_TRUE= PROFILING_FALSE='#' else PROFILING_TRUE='#' PROFILING_FALSE= fi if test "$local_sed" = "bsd"; then BSD_SED_TRUE= BSD_SED_FALSE='#' else BSD_SED_TRUE='#' BSD_SED_FALSE= fi if test "$local_threadar" = "yes"; then WITH_LIBTHREADAR_TRUE= WITH_LIBTHREADAR_FALSE='#' else WITH_LIBTHREADAR_TRUE='#' WITH_LIBTHREADAR_FALSE= fi CXXSTDFLAGS=$CXXSTDFLAGS UPX_PROG=upx DOXYGEN_PROG=doxygen # defaults # hack from libtool mailing-list to know from source point of view whether we are compiling for dynamic or static way ac_config_commands="$ac_config_commands hack-libtool" ac_config_files="$ac_config_files Makefile man/Makefile src/Makefile src/libdar/Makefile src/dar_suite/Makefile src/testing/Makefile src/examples/Makefile doc/Makefile doc/samples/Makefile misc/Makefile doc/mini-howto/Makefile src/libdar/libdar.pc.tmpl doc/man/Makefile src/check/Makefile po/Makefile.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_ALL_DIR_TRUE}" && test -z "${MAKE_ALL_DIR_FALSE}"; then as_fn_error $? "conditional \"MAKE_ALL_DIR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DAR_STATIC_TRUE}" && test -z "${BUILD_DAR_STATIC_FALSE}"; then as_fn_error $? "conditional \"BUILD_DAR_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEBUG_STATIC_TRUE}" && test -z "${DEBUG_STATIC_FALSE}"; then as_fn_error $? "conditional \"DEBUG_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_MODE32_TRUE}" && test -z "${BUILD_MODE32_FALSE}"; then as_fn_error $? "conditional \"BUILD_MODE32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_MODE64_TRUE}" && test -z "${BUILD_MODE64_FALSE}"; then as_fn_error $? "conditional \"BUILD_MODE64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_UPX_TRUE}" && test -z "${USE_UPX_FALSE}"; then as_fn_error $? "conditional \"USE_UPX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_DOXYGEN_TRUE}" && test -z "${USE_DOXYGEN_FALSE}"; then as_fn_error $? "conditional \"USE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GROFF_TRUE}" && test -z "${USE_GROFF_FALSE}"; then as_fn_error $? "conditional \"USE_GROFF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${PROFILING_TRUE}" && test -z "${PROFILING_FALSE}"; then as_fn_error $? "conditional \"PROFILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BSD_SED_TRUE}" && test -z "${BSD_SED_FALSE}"; then as_fn_error $? "conditional \"BSD_SED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_LIBTHREADAR_TRUE}" && test -z "${WITH_LIBTHREADAR_FALSE}"; then as_fn_error $? "conditional \"WITH_LIBTHREADAR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by DAR $as_me 2.5.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ DAR config.status 2.5.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "hack-libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS hack-libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/libdar/Makefile") CONFIG_FILES="$CONFIG_FILES src/libdar/Makefile" ;; "src/dar_suite/Makefile") CONFIG_FILES="$CONFIG_FILES src/dar_suite/Makefile" ;; "src/testing/Makefile") CONFIG_FILES="$CONFIG_FILES src/testing/Makefile" ;; "src/examples/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/samples/Makefile") CONFIG_FILES="$CONFIG_FILES doc/samples/Makefile" ;; "misc/Makefile") CONFIG_FILES="$CONFIG_FILES misc/Makefile" ;; "doc/mini-howto/Makefile") CONFIG_FILES="$CONFIG_FILES doc/mini-howto/Makefile" ;; "src/libdar/libdar.pc.tmpl") CONFIG_FILES="$CONFIG_FILES src/libdar/libdar.pc.tmpl" ;; "doc/man/Makefile") CONFIG_FILES="$CONFIG_FILES doc/man/Makefile" ;; "src/check/Makefile") CONFIG_FILES="$CONFIG_FILES src/check/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "hack-libtool":C) sed 's,^pic_flag=,pic_flag=" -D__DYNAMIC__ ",' libtool > libtoolT \ && mv -f libtoolT libtool && chmod 755 libtool ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "" echo "--" echo "dar and libdar have been successfully configured with the following parameters:" echo "" echo " LIBDAR parameters:" printf " Zlib compression (gzip) : " if [ "$local_libz" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Libbz2 compression (bzip2) : " if [ "$local_libbz2" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Liblzo2 compression (lzo) : " if [ "$local_liblzo2" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Liblxz compression (xz) : " if [ "$local_libxz" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Strong encryption support : " if [ "$local_crypto" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Public key cipher support : " if [ "$local_gpgme" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Extended Attributes support: " if [ "$local_ea_support" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Large files support (> 2GB): " if [ ! -z "$ac_cv_sys_file_offset_bits" -o ! -z "$ac_cv_sys_large_files" ] ; then echo "YES" else echo "NO" fi printf " extX FSA / nodump support : " if [ "$local_nodump_feature" = "yes" ] ; then echo "YES" else echo "NO" fi printf " HFS+ FSA support : " if [ "$local_birthtime" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Special allocation scheme : " if [ "$local_special_alloc" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Integer size used : " if [ -z "$build_mode" -o \( ! "$build_mode" = "32" -a ! "$build_mode" = "64" \) ] ; then echo "infinint" else echo "$build_mode" fi printf " Thread safe support : " if [ "$local_mutex_works" = "yes" -a -z "$local_test_memory" -a "$local_missing_reentrant_libcal" != "yes" ] ; then echo "YES" else echo "NO" fi printf " Furtive read mode : " if [ "$local_furtive_read_mode" = "yes" ]; then echo "YES" else echo "NO" fi printf " Large directory optim. : " if [ "$local_fast_dir" = "yes" ] ; then echo "YES" else echo "NO" fi printf " posix fadvise support : " if [ "$local_posix_fadvise" = "yes" ] ; then echo "YES" else echo "NO" fi printf " microsecond read accuracy : " if [ "$local_microsecond_read" = "yes" ] ; then echo "YES" else echo "NO" fi printf " microsecond write accuracy : " if [ "$local_microsecond_write" = "yes" ] ; then echo "YES" else echo "NO" fi printf " can restore symlink dates : " if [ "$local_lutimes" = "yes" ] ; then echo "YES" else echo "NO" fi if [ "$local_threadar" = "yes" ] ; then echo " will uses multiple threads : YES ( /!\ experimental feature /!\ )" fi # printf " Delta-compression support : " # if [ "$local_librsync" = "yes" ] ; then # echo "YES" # else # echo "NO" # fi echo "" echo " DAR SUITE command line programs:" printf " Long options available : " if [ "$local_have_getopt_long" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Building examples : " if [ "$examples" = "yes" ] ; then echo "YES" else echo "NO" fi printf " Building dar_static : " if [ "$build_static" = "yes" ]; then if [ "$static_pb" = "yes" ]; then echo "NO (system does not support static linking, see note below)" else echo "YES" fi else echo "NO" fi printf " using upx at install : " if [ "$upx" = "yes" ] ; then echo "YES" else echo "NO" fi printf " building documentation : " if [ "$doxygen" = "yes" ] ; then echo "YES" else echo "NO" fi if [ "$static_pb" = "yes" -a "$build_static" = "yes" ] ; then echo "" echo " Note:" echo "" echo " If you want to know which libraries are not available as static" echo " libraries check the logs in the config.log generated file. the command" echo "" echo " 'grep -e -static -A 2 config.log'" echo "" echo " should bring you to the essentials." echo "" echo "You also might want to speed up the compilation process running ./configure" echo "with the --disable-static option" echo "" fi if [ -z "$build_mode" ] ; then echo "" echo "--------------------- N O T E -------------------------------------------" echo "Note: You are about to build a libdar/dar binary relying on \"infinint\"" echo "integer type. You shall also consider using 64 bits integers (whatever" echo "your CPU has 32 or 64 bits registers) for better performances and reduced" echo "memory requirements, at the cost of the limitations explained here:" echo " ./doc/Limitations.html (Paragraph about Integers)" echo "Document which is also available online at:" echo " http://dar.linux.free.fr/doc/Limitations.html#Integers" echo "Unless you are impacted by these limitations, you can rerun ./configure" echo "adding the option --enable-mode=64 for dar/libdar better performances" echo "-------------------------------------------------------------------------" fi if [ "$libgcrypt_hash_bug" = "yes" ] ; then echo "" echo "" echo "#################### W A R N I N G ######################################" echo "" echo "libgcrypt version is lower than $min_version_gcrypt_hash_bug and has a bug" echo "concerning hash calculation for large files. Expect sha1 and md5 hash" echo "results for slices larger than 256 Gio (gibioctet) to be incorrect." echo "" echo "#################### W A R N I N G ######################################" fi echo "" dar-2.5.3/missing0000755000175000000000000002415211777117217010611 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: dar-2.5.3/NEWS0000644000175000017430000000117512610404647007721 00000000000000 For ChangeLog brought by each new version, please read the Changelog file in this directory. If accessing source code from CVS, this file is located at src/build/ChangeLog For events concerning dar, you can check: the dar-news mailing list archives: http://news.gmane.org/gmane.comp.sysutils.backup.dar.announce http://lists.sourceforge.net/lists/listinfo/dar-news Here is the home page of the dar-news mailing list if you wish to subscribe to it: http://lists.sourceforge.net/lists/listinfo/dar-news For general development status, you can check the top of the homepage: http://dar.linux.free.fr/ dar-2.5.3/ChangeLog0000444000175000017520000020416112642474521010775 00000000000000from 2.5.2 to 2.5.3 - Fixing a 2.5.x build issue met when a 2.4.x libdar library is already installed in an FreeBSD system. - Improving message and behavior of libdar in lax mod when a truncated archive is read - Fixing self reported bug at "tronconneuse.cpp line 561" met while reading truncated/corrupted archive - Fixed not closed filedescriptors, met when saving a filesystem that has not ExtX FSA available - Fixing configure script to be more robust in front of system where gpgme.h is installed in a non standard path and user did not provide coherent CPPFLAGS, LDFLAGS before calling ./configure - Displaying CRC values when listing isolated catalog as XML output - Fixing compilation issue when system does not provide strerror_r() call - Avoiding warning about FSA absence when fsa-scope is set to "none" - Adding --disable-fadvise option to configure script for those that want back full pressure from dar on the system cache (same behavior as 2.4.x) - Fixing bug, fadvise() called a wrong time making it having no effect - updating FAQ about comparative performance from 2.4.x to 2.5.x - optimization: reduced the number of call to dup() at libdar startup - improvement: printing file type on verbose output - new feature: added %t macro reflecting the inode type in dar's --backup-hook-execute option from 2.5.1 to 2.5.2 - fixed bug met when permission is denied while reading or writing slices - fixing bug that avoided creating an archive at the root of the filesystem - fixing bug met in rare situation while reading in sequential-read mode an archive encrypted using gnupg encryption. In that situation libdar may fail reading the archive (but succeeds in normal read mode) issuing an obscure message (message has also been fixed). - code simplification, removing field reading_verion from class crypto_sym as its parent class tronconneuse already have such information - removed extra newline displayed by dar at end of execution - fixed bug avoiding dar to properly read an entry (reporting CRC error) when specific sequence of character (start of escape sequence) fall at end of the read buffer of the escape layer. - speed optimization for datetime class - fixed bug that avoided dar reading archives in sequential read mode while reading from a pipe - fixed bug in non regression test routine provided beside dar/libdar - fixing display message showing not always in the correct context - fixing case inversion leading the cache layer not to be used when necessary and used when useless while reading an archive - improved heuristic in dar_manager to determine the date a file has been deleted. from 2.5.0 to 2.5.1 - fixed display bug in dar_manager met when using -o option and adding options for dar that does not exist for dar_manager (like -R option) - reactivating disabled (by mistake) optimization for some read-only dar manager database operations - fixing compilation issue with dar against gcc 4.9.2 - fixing syntax error in dar_manager message - fixed bug that forbade dar_manager to write down modified database when only database header was modified (-o, -b, -p switches). - adding dar_manager database format version information with -l option - fixed libdar inability to read dar_manager's database format version 4 - adapting code to build under cygwin environment, where thread_local seems broken - fixed output to stderr in place of stdout for Licensing information - fixed bug met when permission is denied while reading or writing slices - fixing bug that avoided creating an archive at the root of the filesystem from 2.4.x to 2.5.0 - added support for posix_fadvise() - added entrepot class hierarchy to support in the future other storage types than local filesystem for slices - API: added access to the entrepot through the API - modified class hash_fichier for it becomes entrepot independent - API: extended libdar API with an additional and more simple way to read an archive: archive::get_children_in_table() method, see doc/API_tutorial.html for details - added support for extX (see lsattr(1)) and HFS+ (birthtime date) Filesystem Specific Attributes (FSA). - dar is now able to skip backward when a file is found to be "dirty" at backup time. This avoids wasting space in archive but is only possible if the backward position is located in the current slice and no slice hashing nor strong encryption is used. Of course if the archive is written to a pipe or to stdout, skipping back to retry saving data at the same place is neither possible, --retry-on-change option stays possible in that cases at the cost of data duplication (wasted bytes amount, see --retry-on-change man page). - by default dar now performs up to 3 retries but do not allow for wasting bytes if file has changed at the time it was read for backup, this can be modied using --retry-on-change option. - With the same constraints as for a changing file, if a file is saved compressed but its compressed data uses more space than uncompressed, the file's data is resaved as uncompressed. However, if skipping backward is not possible, data is kept compressed. - if system provides it, dar uses "Linux capabilities" to check for the ability to set file ownership when dar is not run as root. This allows dar to restore ownership when allowed even when it is not run as superuser. - removing dar-help tool used to build dar -h messages. That tool became useless for a long time now. - added several more specific verbosity options: -vm, -vf and -vt - added support for microsecond timestamps (atime, mtime, ctime, birthtime) - Using lutime() to restore atime/mtimes of symlink on systems that support it. - API: removed backward compatible API for old libdar 4.4.x - API: simplified implementation of archive isolation thanks to isolation evolution features brought by release 2.4.0. Memory requirement is now devided by two compared to releases of previous branch (2.4.x). - dar has been updated to use this new API for archive isolation - added exclude-by-ea feature to avoid saving inodes that have a particular user defined EA set. - added comparison of an isolated catalogue with a filesystem, relying on embedded data CRC and inode metadata in absence of the saved data. - The new archive format (version 9) holds the ciphering algorithm used at creation time, only the passphrase is now required at reading time and -K option may be ignored which will lead dar to prompt for passphrase. - Adding support for public key encryption (GnuPG) supporting several encryption keys/recipients for a given archive - Adding support for public key signature when public key encryption is used - While listing archive contents, directories now show the size and average compression ratio of the data they contain - Archive summary (-l with -q options) now reports the global compression ratio - added the -vd switch to only display current directory under process for creation, diff, test, extraction and merging operations - added xz/lzma compression support - added -Tslicing listing option to show slice location of files inside an archive archive. - isolated catalogues now keep a record of the slicing layout of their archive of reference in order to provide -Tslicing feature when used on the isolated catalogue alone. - However if an archive has been resliced (using dar_xform) after its isolated catalogue has been generated, using -Tslicing option with the isolated catalogue would give wrong information. To overcome that, it is possible to specify what is the new slicing of the archive of reference by using the -s and -S options in conjunction with -Tslicing - added dar_split command to provide on-fly multi-volume archive support for tape media - experimental feature to have libdar using several threads (not activated by default due to poor performance gain) - dar now aborts when a given user target cannot be found in included file - added sha512 hashing algorithm beside already available md5 and sha1, the generated hash file can be used with 'sha512sum -c ' command - removed useless --jog option for memory management - removed previously deprecated -y/--bzip2 command, bzip2 compression remains available using -z option (-zbzip2 or --compression=bzip2) - replaced SHA1 by SHA224 to generate IV for encryption blocks, this slightly improves randomness of IV and stay available when libgcrypt is run in FIPS mode from 2.4.19 to 2.4.20 - fixed display bug in dar_manager met when using -o option and adding options for dar that does not exist for dar_manager (like -R option) - reactivating disabled (by mistake) optimization for some read-only dar manager database operations - fixing compilation issue with dar against gcc 4.9.2 - fixing syntax error in dar_manager message - fixing bug that avoided creating an archive at the root of the filesystem from 2.4.18 to 2.4.19 - fixed missing quote in dar_par.dcf which is called by the par2 directive - fixed bug in dar_manager's -u option, not displaying most recent files of an archive when they have been marked as removed in a more recent archive of the same dar_manager database. - fixed bug met while restoring in sequential read mode a file having several copies (was modified at the time it was saved and retry-on-change was set). from 2.4.17 to 2.4.18 - Initial Vector used for strong encryption was set with pseudo-random data generated using SHA1 message digest and blowfish cipher, which are not available when ligcrypt is running in FIPS mode. Since 2.4.18 we now use SHA256 and AES256 for IV assignment in order to have libdar compatible with FIPS mode. For data encryption nothing changes: the cipher specified (-K, -J, -$ options on CLI) are used as before. - fixing bug met when performing archive isolation in sequential-read mode, If an archive corruption or truncated archive leads an inode to not have its CRC readable, dar aborts and issues a BUG report. - updating list of project relying on dar/libdar from 2.4.16 to 2.4.17 - fixing issue when case insensitive comparison was requested and invalid wide char for the current local was met in a filename. In such situation the corresponding file was never saved before (considering a filesystem error for that file), while now the ASCII case insensitivity is used as fallback. from 2.4.15 to 2.4.16 - fixing archive listing displayed information for catalogue size when archive is read in --sequential-read mode - fixing bug that avoided dar releases 2.4.x up to 2.4.15 to read encrypted archive generated by dar release 2.3.x and below - adding informational note at the end of ./configure script execution when --enable-mode has not been used. - adding support for case sensitivity in filename comparison (-an option) for other character sets than POSIX/C locale like Cyrillic for example. - fixing bashisms in doc/samples scripts from 2.4.14 to 2.4.15 - fixing bug met when reading an encrypted archive in sequential mode - fixing bug met when reading an encrypted archive in sequential mode from an anonymous pipe - changed option '-;' to -9 as '-;' does not work on all systems with getopt (only long option equivalent --min-digits worked) for dar, dar_cp, dar_manager, dar_xform and dar_slave commands. - fixing bug met when restoring deleted files in sequential read mode and some directory where they should be "restored" are not readable or could not be restored earlier - adding extra buffer to handle sequential read of encrypted archive when the last crypto block contains some but not all clear data after encrypted one (the archive trailer). - fixing compilation issue using clang - fixing bug that prevents using -~ option with on-fly catalogue isolation in order to execute an user command once on-fly isolation has completed - added some autoconf magic to determine the correct (BSD/GNU) flag to use with sed in order to activate regular expression parsing - new implementation of mask_list class which is compatible with libc++ - fixed bug met on FreeBSD with dar_xform where the system provides a standard input file descriptor in read-write instead of read-only mode. from 2.4.13 to 2.4.14 - limiting memory consumption of the cache layer to stay below 10 MiB, under certain circumstances (very large archive), it could grow up to an insane value like 50% or the available RAM. reducing to 10 MiB does not impact performance in a noticeable manner while it avoids system to swap out due to the libdar cache layer becoming huge. - added --with-pkgconfigdir to define an alternative path for libdar pkgconfig file (to ease portability to FreeBSD) - modified some Makefile.am for better FreeBSD support - fixed display bug in XML listing output concerning hard linked inodes - fixing typo in man page - fixing bug met while isolating a catalogue in --sequential-read mode. Using such isolated catalogue lead dar report an error about inaccessible EA. - displaying compression rate for sparse files even when they are uncompressed, sparse file detection also leads to compress files - fixing bug that lead libdar to fail comparing an inode having EA when comparison is done in --sequential-read mode - fixing display bug in in ligcrypt check of configure script for minimum required version - fixing 'make clean' to remove some forgotten files generated by 'make' from 2.4.12 to 2.4.13 - adding initialization value for two variables to avoid inappropriate warning when compiling with -Wall option - reducing UNIX_PATH_MAX by the system when not defined from 108 to 104 bytes to accommodate BSD systems - fixing assignment operator of class criterium that was not returning any value as it should - removing useless boolean expression that always succeeds in logical AND expression - adding support for back-slash of quoting characters in DCF files - fixed compilation issues with clang / FreeBSD, Thanks to Neil Darlow's server ;-) - fixed compilation warning due to deprecated symbols in libgcrypt header files - replaced gnu make specific rules by legacy ones to avoid automake warning about them - removed old unused stuff from misc sub-directory - adding warning at compilation time if libgcrypt used is older than 1.6.0 - adding warning at execution time if hash computation is requested with slices greater than 256 Gio and ligbcrypt dynamically or statically linked is older than 1.6.0 - adding alternative methods in list_entry API class to return dates as number of seconds - fixed bug in hour-shift (-H option) when comparing dates from an old extracted catalogue (archive format 7 or older). - fixed documentation bug about the meaning of the compression ratio - fixed a display bug about the "compression flag" wrongly displayed for uncompressed files - fixed unhandled exception when giving non number argument to -1 option from 2.4.11 to 2.4.12 - for correctness fixed delete vs delete[] on vector of char (not incidence reported) - fixed out of range access in routine used to read very old archive format - fixed error in logical expression leading a sanity test to be useless - removed duplicated variable assignment - updated FAQ - fixed typo and spelling errors - fixed bug (reported by Torsten Bronger) in the escape layer leading libdar to wrongly reporting a file as corrupted at reading time - fixed bug in the sparse file detection mechanism that lead the minimum size hole detection to become a multiple of the default value or specified one. This implied a less efficient reduction of sparse files because smaller holes in files were ignored - fixed and updated man page about --go-into option - updated full-from-diff target in /etc/darrc default file - added a debug option in hash_file class (option only used from testing tools) to troubleshoot sha1/md5 hash problem on slices larger than (2**38)+63 bytes, bug reported by Mike Lenzen and understood by Yuriy Kaminskiy at libgcrypt. Note: This bug is still open due to an integer overflow in libgcrypt. - backported from current development code an additional and more simple way to read an archive using the libdar API. This API extension is not used by dar command-line tools for now. - Fixing installation of libdar header files on Darwin, where "DARwin" macros were not filtered out from the generated libdar header files. - Fixing self reported bug 'generic_file.cpp line 309' met while comparing an archive with a filesystem - Update code in order to compile with gcc-4.8.2 in g++11 mode (partial implementation and adaptation of Fabian Stanke's patch) - Fixing bug met while performing a verbose archive listing in sequential read mode - Added Ryan Schmidt's Patch to properly display status at end of ./configure script under BSD systems (in particular Mac OS X) - Updating configure.ac script to fix warning reported by autoconf when generating the ./configure script - Addressed portability problem with BSD systems that do not provide a -d option to the 'cp' command, preventing proper installation of the Doxygen documentation. Fix based on patch provided by Jan Gosmann. from 2.4.10 to 2.4.11 - Modified behavior of 'dar -h' and 'dar -V', both now return 0 as exist status instead of 1 (which means syntax error). - Fixed bug: -Q is now available with -V under the collapsed form -QV or -VQ - fixed typo in documentation - fixed memory leakage met when dar fails a merging operation because the resulting archive is specified in an directory that does not exist. - fixed bug met when isolating a differential backup in sequential read mode - fixed bug about slice file permission not taking care about umask variable when the --hash feature is used. - fixed performance issue when reading an archive over a pair of piles using dar_slave (possibly over ssh) when the archive makes use of escape marks and when no encryption is used - added target "full-from-diff" in /etc/darrc default file - fixed bug avoiding reading an truncated archive in direct access mode with the help of an external catalogue. - new and better implementation of archive extraction in sequential read mode - fixing bug (segfault) met when hitting CTRL-C while reading an archive in sequential mode - fixing libdar.pc for pkg-config for the cflags given to external applications - fixed memory allocation/desallocation mismatches (delete vs delete [] ) concerning four vector of chars. - fixed error in logical expression leading a sanity test to be useless from 2.4.9 to to 2.4.10 - fixing libdar about dar_manager database corruption that occurred when deleting the first archive of a base containing a plain file only existing in that first archive. - Added code to cleanup databases instead of aborting and reporting that previously described type of database corruption. - Added feature when comparing archive with filesystem in order to report the offset of the first difference found in a file. This was necessary to help solving the following bug: - fixed bug in sparse file detection mechanism that could lead in some very particular (and rare) situations to the loss of one byte from file being saved. In that case testing the archive reported a CRC error for that file. So if you keep testing achives in your backup process and have not detect any problem, you can then keep relying on your old backups. This bug also expressed when merging archives: dar aborted and reported that a merged file had a different CRC than the one stored in the archive of reference. from 2.4.8 to 2.4.9 - fixed bug: during differential backup dar saved unchanged hard linked inode when a hard link on that inode was out of the -R root directory. This also has the effect to always save files with long names on NTFS filesystems (!) - Adapted patch provided by Kevin Wormington (new messages displayed) - Fixed syntax error in configure script about execinfo detection - Removed unused AM_ICONV macro from configure script - fixed bug met under Cygwin when auxiliary test command failed to link when libgcrypt was not available. - updated mini-howto by Grzegorz Adam Hankiewicz - updating French message translations - restricted security warning for plain files and hard linked plain files - fixed display bug in dar_cp when manipulating files larger than 2 GB - fixed SEGFAULT met when adding to a dar_manager database an archive which base name is an empty string - improved error message, reporting the -B included file in which a syntax error has been met - modified dar_manager database to consider both ctime and mtime as timestamp value for data of saved files. This suppresses the warning about badly ordered archives in database when at some files have been restores from a old backup. from 2.4.7 to 2.4.8 - documentation fixes and updates - improved database listing efficiency - reduced memory usage of the caching layer in libdar - fixed self reported bug caused by memory allocation failure - fixed a SIGSEGV caused by double free in dar_xform when syntax error is met on command-line - dar_xform was not able to properly transform archive generated by dar older than release 2.4.0 - fixed bug that lead dar be unable to remove a directory at restoration time - replaced old remaining "bcopy" occurrence by a call to memcpy - fixed compilation warning under ArchLinux - fixed crash met while creating a backup with on-fly isolation - fixed libdar behavior when reading a strongly corrupted encrypted archive from 2.4.6 to 2.4.7 - fixing memory allocation bug in crc class, that lead glibc aborting dar - reviewed code and replaced some remaining occurences of bzero/bcopy by their recommended replacement version - fixed compilation problem under Solaris - fixed bug that could lead a file to be wrongly reported as different from the one on filesystem, when that file has been changed while it was saved, then saved a second time but has its size modified since the first time it was saved. from 2.4.5 to 2.4.6 - fixed bug met while interrupting compressed archive creation, the resulting archive was only readable in --sequential-read mode - fixed bug met while reading an interrupted archive in sequential reading mode. It lead dar to not release some objects from memory at the end of the operation, which displayed an ugly error message from libdar selfcheck routine. - fixed message reporting unknown system group when converting gid to name (was reporting unknow "user" instead of unknown "group") - removing the $Id:$ macro from file as we moved from CVS to GIT - updating package to distribute Patrick Nagel's scripts and documentation - updated URL pointing to Patrick Nagel's web site - updating documentation describing how to get source code from GIT (no more from CVS) - fixed typo in configure.ac - added info on how to build a brand-new dar tarball from source in GIT - modifies the end of messages shown by -h option to point to man page for more _options_ rather than _details_ - replaced − in the HTML generated documentation by a standard ASCII dash - fixed alignement bug in CRC calculation that lead libdar based application to crash on sparc-based systems. from 2.4.4 to 2.4.5 - updated sample scripts to be compatible with dar's --min-digit option - added missing included file to be able to compile with gcc-4.7.0 - removing an unused variable in filtre.cpp - fixed a display bug when comparing archive with filesystem, leading to a segmentation fault (%S in place of %i in mask) - fixed bug leading dar to not restore some directories from differential backups when they are absent in the filesystem - fixed bug that show a "uncaught exception" message at the end of archive listing for dar shared binaries only, compiled in infinint mode, under ArchLinux - updated the configure script to link with libexecinfo when available - added possibility to disable the use of execinfo in libdar thanks to the new --disable-execinfo option for the ./configure script - added Andreas Wolff patch to fix bug under Cygwin (segfault on program termination). from 2.4.3 to 2.4.4 - fixed man pages in the NAME section: added whatis entry - fixed segfault: in the internal error reporting code (delete[] in place of free()) - fixed bug: dar_manager was not able to read properly the latest generated databases version when having Extended Attributes recorded for some files - avoided reporting unreleased memory block when compilation optimization have been used (dar, dar_manager, dar_cp, dar_slave, dar_xform do all reported unreleased memory when gcc optimization was used in "infinint" mode) from 2.4.2 to 2.4.3 - fixed absurd compilation warning about possibly uninitialized variable - added -ai switch to dar_manager to disable warning about improper file order in database. - fixed bug met while changing order of archives in a dar_manager database - avoiding concurrent use of -p and -Q options, error message shown in that situation. - modified slice overwriting detection code to use a single atomic system call to create a new slice - replaced delete by delete[] for conversion routine of user/group to uid/gid - added the possibility to disable speed optimization for large directories - added memory troubleshooting option --enable-debug-memory - simplified class CRC implementation - fixed failed memory release upon exception thrown in class deci - modified tlv, tlv_list classes and ea_filesystem routines to not require any corresponding temporary objects in libdar (saves a few new/delete calls) - fixed silent bug in tlv class: due to the absence of copy constructor and destructor, some memory was not released and referred after the corresponding object's destruction - modified generic_file class to avoid temporary crc objects - fixed bug in header class that lead unreleased field (this class lacked a destructor), memory impact was however little: 10 bytes per slice - fixing bug in class tlv: unreleased memory - added protection code in class deci to properly release memory against exception thrown from called routines when user interrupts the operation. - replace previous internal stack report code by backtrace()/backtrace_symbols() - complete change of the implementation of the 'special-alloc' feature: the old code eat too much memory not to be adapted to new features added in release 2.4.0. This new implementation also bring some speed improvement from 2.4.1 to 2.4.2 - fixing bug met when reading an archive in sequential-read mode - fixing bug while filtering in sequential-read mode - fixing backward compatibility in dar_manager with old archives (wrong dates for deleted files). - fixing compilation problem on certain systems (missing #include statement) - fixing documentation syntax and spelling from 2.4.0 to 2.4.1 - adding information about "Cache Directory Tagging Standard" in doc/Feature.html - fixing typo in doc/presentation.html - fixing incomplete information in doc/usage_notes.html - rewriting sample scripts from tcsh to bash in doc/usage_notes.html - updating Swedish translation with the last version from Peter Landgren which has been forgotten for 2.4.0, sorry. - fixing installation problem, where src/libdar/nls_swap.hpp was not installed - fixing version returned by libdar_4_4::get_version to let kdar (or other external program relying on the backward compatible API) working as expected - fixed bug in the code determining whether a directory is a subdirectory of another. This bug could lead dar to restore more files that just the one that were specified with -g option. - added -k option to dar_manager for backward compatible behavior of dar_manager - fixed bug in dar_manager, was recording the wrong date of EA removal (when an inode has dropped all its EA since the archive of reference was done). - adapted dar_par_test.duc sample script to dar-2.4.x new behavior - adapted libdar to MacOS X to restore mtime date after EA, as on this system, modifying some system specific EA implies updating the mtime. But dar cannot yet store and restore the "creation date", it needs specific MacOS X code, as this value is not available through Posix EA. - fixed backward compatibility bug where dar 2.4.0 was not able to read archive containing only a catalogue (differential backup when no change occurred, snapshot backup, extracted catalogue) generated by dar 2.3.x or older. - fixed self reported internal error met when dar is merging archives generated by dar 2.3.x versions. from 2.3.x to 2.4.0 - hard links support for pipes, soft links, char and block devices has been added (so far, only hard links on plain files were supported) - added rich overwriting feature for merging archives (-/ option) - changed default behavior of dar: it no more tries to preserve the atime of read files, which had as side effect to modify the ctime. See man page for -aa and -ac options for details - simplified the use of the "sed" command in Makefiles.am files - integrated Wiebe Cazemier's patch for man page - -E option has been extended to work also when generating a single sliced archive (no need to have -s option to be able to use -E option). - slice header has been extended to store additional information (slice layout is now redundant in each each slice and may be used as backup from a slice to another in case of corruption). - dar does no more need to read the first then the last slice of an archive to get its contents, it now instead only needs the last slice. - an isolated catalogue can now be used as backup of the original archive's internal catalogue (-A option in conjunction with -x option for example) - added directory look-up optimization (adaptation of Erik Wasser's patch) - added -e option support (aka dry-run) to archive testing - added the possibility to set permission and ownership of generated slices - re-designed the libdar API to have all optional parameters carried by class object in a single argument, the aim to not break backward compatibility of the API upon each new feature addition. The libdar_4_4 namespace can be used for backward compatibility with older applications (see API documentation) - added retry on change feature (-_ option). - changed storage for UID and GID from U_16 to infinint to support arbitrarily larger UID and GID - added lzo compression support - dar_manager now uses an anonymous pipe to send configuration to dar, this solves the problem due to command-line limitation. - dar now stores a "removal date" when a file disappeared since the archive of reference was done (so far only the information that a file was removed was stored). This is needed for dar_manager (see next new feature) - dar_manager can now better restore the status of a set of files exactly as it was at any given time from a set of full and differential backups. In particular, it does no more restore files that were removed at the requested date. - added check in dar_manager to detect conditions where a file has a modification date that has been set to the past. Two objectives are at the root of this feature: proper restoration of files and detection of possible rootkit - added mode for restoration that avoid restoring directory tree which do not contain any saved files (in particular when restoring a differential backup) see man page for -D option for more details. - reviewed implementation of code managing Extended Attributes (much faster now) - added batch feature (-@ option) to dar_manager - added Furtive Read Mode support (O_NOATIME + fdopendir): when the system supports it, while reading data, dar does not modify any date (ctime or atime) - added the possibility to have sequential reading of archives (ala tar) see option --sequential-read - added the possibility to read from a pipe (single pipe, without dar_slave) (use '-' as filename in conjunction with --sequential-read) - added -P -g -[ and -] options to archive listing (-l option) - added sparse file detection mechanism (can save and restore sparse files) - added dirty flag in archive for file that changed while being saved. By default a warning is issued when the user is about to restore a dirty file, this can be changed thanks to the --dirty-behavior option - -R option can receive an arbitrary string (still is excepted an empty string) In particular dar will no more complain if the given path contains // or \\ however it must in a way or another point to something that exists! - added a short listing feature (listing only the summary), (using both -l and -q options) - extended conditional statements in included files (DCF) with user defined targets (see user target paragraph at the end of dar man page) User targets let the user add a set of options using a single keyword on command-line. - a sample /etc/darrc is now proposed with some user targets for common operation like compression without compressing already compressed files. - dar now releases filedescriptors of archive of reference(s) before proceeding to the operation (differential backup, archive isolation, etc.) - user can add a comment in archive header some macro are provided for common options (see --user-comment in man page). This comment can be seen when listing an archive in verbose mode (-l -v) or when displaying the archive's summary (-l -v -q). - added a "security warning" feature if ctime has changed in filesystem while inode has not changed at all (-asecu disables this feature). This is to target possible rootkit files. Note that this may toggle false positive, if for example you change EA of a file. - added feature: DAR_DUC_PATH environment variable, which let dar look for a DUC file (see -E and -F options) in the given path. - added feature: DAR_DCF_PATH environment variable, same as previously but for DCF files (see -B option). - added two targets for conditional syntax: "reference:" and "auxiliary:" - weak blowfish implementation has been removed (no backward compatibility as it suffered of a weak Initial Vector (IV) initialization), but the normal blowfish encryption stays in place. - Due to openssh licensing, replaced openssh by libgcrypt dependancy (which stays optional). - added new cyphers aes256, twofish256, serpent256 and camellia256 - added the hash feature (--hash option), supporting md5 and sha1 algorithms. The hash is calculated on the fly for each slice, before its data is even written to disk. This let one to check for media corruption even before a multi-sliced archive is finished. However this does not prevent an archive to be corrupted due to a software bug (in dar, libdar or in a external library), so it is always recommended to test the archive using dar's -t option. - -G option (on-fly isolation) has been replaced by -@ when creating an archive, to reduce the number of letter used for options. This also let available the usual switches associated to -@ option to define an encryption algorithm and passphrase for the on-fly isolated catalogue. - slices number may be padded with zeros (--min-digits option) Note that if using this option when creating an archive, this same option is required for any operation on this archive - added -konly feature to only remove files recorded as suppressed at differential backup restoration time. - dar and libdar now store keys in secure memory (with the exception that a DCF is parsed in unlocked memory, having a key in a DCF file is not as secure as having dar asking for password at execution time using the "-K :" syntax) - added hook for backup: a user command or script can be run before saving and after backing up files that match a given mask all along the backup process (see -<, -> and -= options). - added feature: -alist-ea let the user see the Extended Attributes of files while listing an archive contents. - dar_manager can receive negative numbers to point to archive counting by the end of the database. - dar and libdar stay released under GPL 2.1 (not under GPL 3, and not lesser GPL, neither) - setting the "little/big endian" to usual meaning (it was inverted in the code) this does not change the dar's behavior nor its compatibility with different systems or older libdar versions. - added -ai option to avoid warning for unknown inode types - added support for Solaris's Door files - added feature: decremental backup from 2.3.11 to 2.3.12 - avoiding concurrent use of -p and -Q options, error message shown in that situation. version 2.3.10 to 2.3.11 - fixed bug in the detection code of an existing archive of the same name when creating a new archive (improperly considered some files sharing a part of the archive basename as old slices of an archive of the same base name). - fixed a display bug. When using -v to see which arguments get passed to dar by mean of configuration file (DCF file, ~/.darrc or /etc/darrc) the last argument found in file was not displayed. - fixed two bugs (one in decompression routine, the other in decryption routine) that lead dar to segfault or run into an endless loop when reading a very corrupted archive. - added -H option with -d option - fixed bug leading Dar to report some files to be removed at restoration time to be of different type than the expected one when the reference used for that archive (difference backup) was an extracted catalogue. - fixed bug in dar's command_line parsing leading dar to free twice the same block of memory when an argument containing a double slash was given to -G [SF 3162716]. - probable fix (problem difficult to reproduce) for double memory release in the storage class [SF 3163389] version 2.3.9 to 2.3.10 - added patch by Jan-Pascal van Best to have -[ and -] options working with archive merging - fixed bug in displaying dates [SF 2922417] - enhanced pseudo random number generation used in dar - added an error message when an include/exclude file listing does not contains an invalid path (instead of a self reported bug message). - modified message displayed when some slice of an old archive having the same name are present in the destination directory (backup, isolation, merging, dar_xform) from 2.3.8 to 2.3.9 - fixed bashism in doc/examples/pause_every_n_slice.duc sample script [SF 2020090] - added Jason Lewis's script "dar_backups.sh" which is an enhanced version of n the script done by Roi Rodriguez Mendez & Mauro Silvosa Rivera. - added message asking software upgrade to handle case when new archive format (used by dar >= 2.4.0) is provided to dar - very little optimization of the reading process of EA - updated FAQ - replaced "Catalogue" by "Archive Contents" in output message (-l -v). - added Sergey Feo's patch to dar_par.dcf - added check against stddef.h header file presence in configure script - fixed spelling - added Charles's Script in doc/sample - added -q option to dar - added licensing exception to allow distribution of dar beside OpenSSL library - Bug fix: during archive diff (only), dar restore atime of file in the backup instead of file in the system before opening it for reading. - tested dar with valgrind from 2.3.7 to 2.3.8 - fixed bug in libdar met when user supply an empty file as a list of file to include or exclude ( -[ and -] options ) - fixed bug concerning elastic buffers used beside strong encryption. No security issue here, just in some almost rare situations the generated archive was not readable (testing your archive prevents you loosing data in this situation) - added some speed optimizations - avoided warning to appear without -v option set, when an error is met while fetching value of nodump flag (flag not supported on filesystem for example). from 2.3.6 to 2.3.7 - fixed bug in dar_manager about the localization of the archive in which to find the latest EA - fixed bug in configure script to properly report full blowfish encryption support - fixed a bug in the statistics calculus of dar_manager for most recent files per archive - removed inappropriate internal error check - added --disable-libdl-linking option - fixed mistake in API tutorial - updated Swedish translation by Peter Landgren - fixed bug in the file filtering based on listing file ( -[ option ) - fixed typo and spelling errors in documentation - updated code for clean compilation with gcc-4.2.3 - updated code for clean compilation with gcc-4.3 20080208 (experimental gcc) from 2.3.5 to 2.3.6 - fixed Makefile.am in src/dar_suite (removed "/" after $(DESTDIR)) - fixed bug in regex mask building when not using ordered masks - fixing bug that led dar_manager to report no error while some files failed to be restored due to command-line for dar being too large. - fixed bug met when user aborts operation while dar is finalizing archive creation [SF #1800507] - fixed problem with execvp when dar_manager launches dar from 2.3.4 to 2.3.5 - changed displayed message when adding a hard link to an archive while performing a differential backup - added back the possibility to use old blowfish implementation (bfw cipher) - integrated optimization patch from Sonni Norlov - updated Swedish translation by Peter Landgren - updated French translation - fixed broken Native Language Support in 2.3.x (where x<5) from 2.3.3 to 2.3.4 - fixed behavior when differential backup is interrupted (no more store file that would have been read if no interruption had been done as "deleted" since the archive of reference) [SF #1669091]. - added official method to access catalogue's statistics through the API (for kdar next version). - Fixed syntax error in dar_par_create.duc and dar_par_test.duc files (Parchive integration with dar). - minor spelling fix in error message (compressor.cpp) - added Wiebe Cazemier's two patches for dar man page - integrated patch from Dwayne C. Litzenberger to fix weakness in dar's implementation of the blowfish encryption. - improved the returned message when an invalid path is given as argument - updated doc/sample/sample1.txt script file from 2.3.2 to 2.3.3 - avoid using getpwuid() and getgrgid() for static linking. - fixed typo in dar's man page - update FAQ - fixed bug: uncaught exception thrown when CTRC-C was hit while dar waits an answer from the user [SF #1612205] - fixed bug: unusable archive generated when CTRC-C was hit and blowfish encryption used [SF #1632273] - added a check to verify that the libdar used is compatible with the current dar suite programs [SF #1587643] - fixed bug: added workaround for the right arithmetic shift operator (the binary produced by gcc-3.4.2 produces computes "v>>s" equal to "v" when when v is a integer field composed of s exactly bits. It should rather compute it to zero...). this problem leads 32 bits generated archive incompatible with 64 bits generated archive only when blowfish is used. - fixed bug met when the inode space is exhausted, thanks to "Jo - Ex-Bart" for this new feedback. [SF #1632738] - replaced &, <, >, ' and " in XML listing by &...; corresponding sequence. [SF #1597403] - dar_manager can receive arguments after stick to -o options (it is an error in regard to documentation, but no warning was issued in that case, leading to confusion for some users) [SF #1598138] - updated Veysel Ozer's automatic_backup script - fixed hard link detection problem [SF #1667400] - verbose output did not displayed hard links information - merged patch on dar_cp by Andrea Palazzi to have it to return EXIT_DATA_ERROR when some data have been reported [SF #1622913] from 2.3.2 to 2.3.3 - avoid using getpwuid() and getgrgid() for static linking. - fixed typo in dar's man page - update FAQ from 2.3.1 to 2.3.2 - fixed bug in Native Language Support when --enable-locale-dir was not set (Thomas Jacob's patch) - updated Swedish translation by Peter Landgren - --verbose=skipped was not available (only the short -vs form was available) - reviewed regex with ordered mask for the feature to better fits user's need (Dave Vasilevsky's feedback) - fixed bug where compression algorithm was changed to maximum (fixed with Richard Fish's adequate patch) - fixed tutorial with command line evolution (dar's -g option in particular) - latest version of Grzegorz Adam Hankiewicz's mini-howto - fixed bug concerning restoration of only more recent files from 2.3.0 to 2.3.1 - set back Nick Alcock's patch which has been dropped from 2.2.x to 2.3.x (patch name is "Do not moan about every single file on a non-ext2 filesystem") - fixed compilation problem when thread-safe code is disabled - integrated Wiebe Cazemier's patch for dar's man page - fixed bug in listing: -as option also listed files that had EA even when these were not saved in the archive - file permission of installed sample scripts lacked the executable bit - fixed a bug that appeared when a file is removed while at the time it is saved by dar - avoid having an unnecessary warning appearing when restoring a file in a directory that has default EA set - Cygwin has changed and does not support anymore the path in the form "c:/some/where", you have to use "/cygdrive/c/some/where" instead. Documentation has been updated in consequence. from 2.2.x to 2.3.0 - added user_interaction::pause2() method - added the snapshot feature - added the Cache Directory Tagging detection feature - adapted Wesley's patch for a pkgconfig for libdar - added -[ and -] options (file selection from file listing) Important consequence for libdar user programs: the fs_root argument is now expanded to full absolute path inside libdar, thus the mask you will give for path inclusion/exclusion (the "subtree" argument)will be used against full absolute path of files under consideration for the operation. Assuming you have fs_root=tmp/A and the current directory is /tmp, your mask will be used against strings like /var/tmp/A/some/file. (instead of tmp/A/some/file as in the previous API version). Things are equal if the fs_root is given an absolute path. - changed archive format to "05". Due to complete review of EA management. - upon some signal reception, dar aborts the backup nicely, producing a completely formatted archive will all the file saved so far. This archive can be take as reference for a further backup to continue the operation at a later time. - dar_manager aborts properly upon certain signal reception (do not let the database partially updated). - dar_slave and dar_xform now recognize when a slicename is given in place of a basename - reviewed thread_cancellation (API change) for it be possible to cancel several thread at the same time - prevent some dead-lock situation that can occur when a signal is received inside a critical section - dar_cp, dar_xform and dar_slave also abort nicely upon signal reception - dar_manager can now restore files based on a given date (not always the most recent version) - dar_manager now has an interactive mode (-i option) - change in API, the warning() method need not be overwritten, but the new protected method inherited_warning() must be inherited in its place (same function, same prototype as the original warning() method). - dar_manager features are now part of libdar. API has been completed with these new features - added the "last_slice" context (%c with -E option) when creating an archive - dar now check a file has not been modified while it was reading it, if so it reports a warning and returns a specific exit code - remove included gettext from the package (it is more a source of conflict with external gettext and if somebody needs internationalization better is to install libintl/gettext on its own). - added George Foot feedback about the good backup practice sort guide. - added -e option to dar_manager - added the progressive_report feature in the API - dar can now pause every N slice where N >= 1 - integrated Dave Vasilevsky's patch to support Extended Attributes and file forks under MacOS X - added method in API for external program be able to list dar_manager databases, their file contents and the statistics - added the merge/sub-archive feature - remove [list of path] from command line (-g option is now mandatory) - added regex expression in filters (-ar/-ag options) - added -ak option - added the --comparison-field option (extension of the --ignore-owner option aka -O option) - added the -af option (backup files more recent than a given date, others are keept as already saved) - dar now take care that an escape character can be sent when pressing the arrow keys and avoid considering them in this situation - dar will no refuse to abort if user presses escape when dar asks the user to be ready to write to a new slice - adapted Wesley Legette's patch for an xml archive listing - added 'InRef' status for EA (same meaning as the one for file's data) from 2.2.6 to 2.2.7 - updated Swedish translation by Peter Landgren - fixed bug #37 - added old function (modified in 2.2.6) for backward compatibility - added German translation by Markus Kamp from 2.2.5 to 2.2.6 - fixed bug #36 - avoid removing slices when creating archive in dry-run mode (-e option) - fixed display problem in dar_cp that lead uncaught exception just before exiting from 2.2.4 to 2.2.5 - limited size of internal buffers allocated on the stack to not be greater than SSIZE_MAX when this macro is defined. This comes from feedback from "Steffe" at sourceforge after he ported dar to HPnonStop. - integrated Andrey Yasniy's patch: fixed differential backup problem with ru_RU.koi8-r locale. - integrated Nick Alcock's patch: no warning shown when not on EXT2 filesystem and nodump feature has been activated. - avoid having arrow key be interpreted as escape key (while they remains an escape key + one char, as received from the tty). - added part of Kyler Klein's patch for OSX (Tiger) (only concerns included gettext) from 2.2.3 to 2.2.4 - fixed #35 - added in doc/samples the backup Script of Rodriguez Mendez & Mauro Silvosa Rivera - updated Swedish translation by Peter Landgren from 2.2.2 to 2.2.3 - error in TUTORIAL (-P only receives relative paths) - updated FAQ with memory requirement questions/problem - added Bob Barry's script for determining memory requirement - added documentation about NLS in doc/NOTES - fixed bug concerning the << operator of infinint class. This has no impact as this operator is not used in dar/libdar. - added Jakub Holy's script to doc/samples - fixed bug with patch transmitted from Debian (Brian May) about the detection of the ext2_fs.h header. - added warning in libdar when user asks the nodump flags to be checked against while the nodump feature has not been activated at compilation time. - fixed dar man page about --gzip option usage when using an argument - now counting as errors the file with too long filename - now counting the file excluded due to nodump flag as ignored due filter selection from 2.2.1 to 2.2.2 - fixed typo in dar man page (flowfish ;-) ) - -Q option now forces the non terminal mode even when dar is run from a terminal (tty) this makes dar possible to run in background without having the shell stopping it upon text output. - removed unused control code for dar's command line syntax - spelling fix of the tutorial by Ralph Slooten - added the pertinent part of the memory leak patch from Wesley Leggette (there is no bug here as the function where could occur the memory leak is not used in dar (!) ). - updated FAQ - updated man page information about optional argument's syntax to options like -z9 or --zip 9 - avoid calls to textdomain() when --disable-nls is set - updates doc/NOTES - fixed potential memory leakage on some system (to a "new[]" was corresponding a "delete" in place of a "delete[]" (Wesley's patch)) In consequences, for API users, note that the following calls - tools_str2charptr - tools_extract_basename - libdar_str2charptr_noexcept all return a char * pointer which area must be released by the caller using the delete[] operator - partially integrated Wesley's api_tutorial patch (added explanations) - Fixed installation problem of header files, problem reported by Juergen Menden - updated the examples programs for they properly initialize libdar - the gettext.h file was not installed with libdar headers - fixed typo error reported by Peter Landgren - updated api_tutorial with compilation & linking informations - fixed pedantic warning about some classes inherited from "mask" (the parent copy constructor is not called from inherited copy constructor; note that the parent class is a pure virtual class) - added Swedish translation (by Peter Landgren) - fixed typo in French translation - added a const_cast statment to avoid compilation warning under some systems - fixed problem on solaris where the TIME&MIN non canonical parameters for terminal are not set by default to 1 and 0 (but to 4 and 0), leading keyboard interaction to be impossible when dar needs user interaction. - added O_BINARY to open() mode in dar_cp, without this will cause some problem under Cygwin. from 2.2.0 to 2.2.1 - fixed execution problem for testing programs - added control code to avoid the "endless loop" warning when -M is used and root and archive are not located on the same filesystem - replaced an internal bug report by a more appropriate exception (elastic.cpp line 191) - fixed bug #31 - fixed bug #32 - fixed bug #33 - changed exception type when dar_manager's -D option does not receive an integer as argument - fixed bug #34 - added Wesley Leggette's patch to API tutorial - fixed inconsistencies concerning Native Language Support in Dar - added gettext NLS domain switch when incoming and exiting from libdar - fixed bug #30 - changed the way ctermid() system call is used - updated FAQ from 2.1.x to 2.2.0 - caching read/write for catalogue to drop the number of Context Switches. - added -aSI and -abinary options - added -Q option - added -G option - fixed a display bug about archive size, present when listing with -v option - added -aa / -ac options - added -M option - thread safe support for libdar - added -g option - added -am option - added -acase / -an options - user_interaction can now be based on customized C++ class - user_interaction_callback now have a context argument - added feature: dar_manager now restores directory tree recursively - added feature: dar_manager can receive a range of archive number with -D option - added summary at the end of configure script - added -j option (--jog) change behavior when virtual memory is exhausted - added Native Language Support - added feature that proposes removal of slices of an older archive of same basename - libz is now optional - libbz2 is now optional - added openssh's libcrypto dependency - added blowfish strong encryption - changed archive format number (version "04"), difference occures only when encryption is used - moved libdar operations (archive creation, listing, testing ...) as method of the C++ archive class - added thread cancelation routine - added feature : password can be read out of command-line (interactively at execution time). - added programming documentation (thanks to Doxygen) - optimize CRC computation for speed - added warning telling [list of path] is deprecated (better use -g option) - added Todd Vierling's patch for dar to compile under Interix from 2.1.5 to 2.1.6 - fixed compilation problem with gcc-3.x for dar64 - updated libtool to generate the configure script - fixed old info in dar's man page from 2.1.4 to 2.1.5 - added protection code against bad_alloc exception - new configure option to bypass libdl test - removed expected exception list in deci, limitint, real_infinint and storage modules to improve global robustness - remove the #pragma implementation/interface directives which tend today to become obsolete, and seems to be the cause of compilation problem on (recent) Linux kernel 2.6.7 for example. - added protection code to report bug conditions - code simplification for filesystem reading (while performing backup) - fixed bug #29 - fixed code syntax to support gcc-3.4.x from 2.1.3 to 2.1.4 - fixed bug #27 - improved limitint detection overflow - fixed bug #28 from 2.1.2 to 2.1.3 - fixed namespace visibility inconsistency for several call to open() - added "list:" key in conditionnal syntax, to stay coherent with man page - optimized dar_cp algorithm for speed in case I/O error - made dar_cp more talkative about events that succeed while copying data - fixed bug #25 - fixed bug #26 from 2.1.1 to 2.1.2 - fixed bug #24 - added "-w d" option which is equivalent to -w but necessary when dar is not compiled with GNU getopt - updated documentation about GNU getopt() vs non GNU getopt() - update configure script to have libgnugetopt auto-detection from 2.1.0 to 2.1.1 - fixed configure script warning when an include file is "present but cannot be compiled" - fixed bug #21 - fixed bug #22 - dar_xform and dar_slave now send their help usage on stdout (instead of stderr) - fixed typo in error message from 2.0.x to 2.1.0 - fixed bug #17 - API version 2 documentation - API version 2 implementation - -E and -F can now be present several time on command line and/or included files (dar, dar_slave and dar_xform) - context (%c in -E and -F) is now transmitted in the pipes from dar to dar_slave - added -wa option - added -as option - added -e option - updated the API to be able to add new encryption protocol later - root (-R argument) can now be a symbolic link pointing to a directory - fixed bug #17bis - added information returned by the system when error during read() to the message returned to the user - fixed bug #18 - documentation about filter mechanism added - fixed bug #19 - don't fail for a file if permission could not be restored - fixed bug #20 - configure script does not mess with CXXFLAGS or CFLAGS execpt when using debugging options. from 2.0.3 to 2.0.4 - updated autoconf version used to generate configure script (2.57 -> 2.59) The large file support is back with gcc-3 (was only working with gcc-2) from 2.0.2 to 2.0.3 - fixed bug #20 from 2.0.1 to 2.0.2 - fixed bug #18 - fixed bug #17bis - documentation about filter mechanism added - fixed bug #19 from 2.0.0 to 2.0.1 - fixed bug #17 from version 1.3.0 to 2.0.0 - using configure script (built with automake & autoconf) - creation of the libdar library - API for libdar (version 1) - updating TUTORIAL - added chapter in NOTES for ssh / netcat use with dar - added -H option - making documentation for API : DOC_API - speed optimization for dar_manager - enclosed libdar sources in libdar namespace - added libdar dynamic library support (using libtool) - fixed bug in ui_printf. Bug appeared with the shell_interaction split from user_interaction (for libdar) - fixed bug in dar_manager when creating empty database - changed hourshift implementation (no static variable used anymore) - changed code not to have dynamic allocation to take place before main() was called - added compilation time option to replace infinint by 32 bits or 64 bits integers - added special memory allocation (--enable-special-alloc) to better handle many small dynamic objects (in the meaning of OOP). - fix. Dar_manager does no more send all its output to stderr, just interactive messages are sent there. - changed "dar_manager -u" do not display anymore files present in the archive which have not saved data or EA in the asked archive. - removed displaying of command-line used for backup ("dar -v -l ...") as it is no more becoming inaccurate due to include files and as it would consume too much space if it has to be developed. - added sample scripts for using dar with Parchive - now displaying option read from configuration files when using -v option - added %e and %c for user script parameters - using UPX to compress binary if available at compilation time - removed comments put by mistake in 1.3.0 around warning when try to backup the archive itself. This revealed a bug, which made the warning be issued in some wrong cases. - removed this previous warning when creating archive on the stdout - fixed bug #15 - fixed error in libdar sanity checks, where exceptions were not raised (due to the lack of the "throw" keyword) - fixed bug #16 - changed order of argument passed to dar by dar_manager, for the -x be before any other option (in particular -B options). from version 1.2.1 to 1.3.0 - added parenthesis for a warning to be able to show, when opening a scrambled archive - fixed bug #10 - added feature : --flat option - improved slice name detection when given in place of archive basename - added feature : comments in the configuration file given to -B (see man page for more). - added feature : --mincompr option - fixed a display error when listing a hard link (the name of the first hard link seen on an inode was displayed in place of the name of each hard link). This did not concern the tree (-T option) listing. - added standard config files ~/.darrrc and /etc/darrc config files - conditional statements in included files (using make-like targets) - added feature : --noconf option - fixed a bug : warning message issued when th user asks for dar to backup the archive in itself, was not displayed in some cases. - fixed bug #11 - added total files counter in each archive while listing dar_manager database - fixed bug #12 - improved slicename versus basename substitution warning and replacement. - changed internal name generation to avoid using std::sstream class - bzip2 compression implemented (need libbz2 library at compilation time) - added the --nodump feature - fixed bug #13 - configuration file can have DOS or UNIX text formating - now closing files before asking for the last slice, this allow un-mounting filesystem in that case. from version 1.2.0 to version 1.2.1 - minor change to have backward compatibility with old archive (dar < 1.2.0) generated on 64 bits OS (have to use OS_BITS=32 in Makefile on 64 bits OS). - adapted Axel Kohlmeyer's patch for RPMS - adapted Dietrich Rothe's patch for compression level : -z has an optional argument which is compression level to use. - I and -X now available while listing archive contents (-l) - based on Brian May's patch, dar with EA_SUPPORT avoids complaining when reading a filesystem that do not supports EA. - based on Brian May's other patch, dar now uses by default the integers. - dar is now built with dynamic linking, and a special version named dar_static which is statically linked is also available - fixed problem on Windows NT & 2000 (fixed by first change above) from version 1.1.0 to version 1.2.0 - -P option can now accept wild cards - changed dar output format when listing archive contents to have something more similar to the output of tar. -T is provided to get the previous tree listing - fixed bug #6 - user interaction is now possible even if standard input is used (for pipe) - fixed bug #7 - added some missing #include files for compilation under Windows using Cygwin - added feature to display name of user and group (when possible) in place of uid and gid while listing archive contents. - added the possibility to launch command between slices (-E and -F options) for dar, dar_xform and dar_slave. - when saving or comparing a directory tree, DAR goes transparently in subdirectory not modifying the last_access date of each directory. - usage text (displayed by -h option) is now generated from xml file thanks to Chris Martin's little software named dar-help - fixed bug concerning the uninstallation of man pages - changed the place where man pages and documentation go /usr/share/doc usr/share/man in place of /usr/doc and /usr/man for the RPM package (conform to Filesystem Hierarchy Standard) - changed the place where documentation goes for /usr/local/doc to /usr/local/share/doc by default. (Thanks to Jerome Zago) (conform to Filesystem Hierarchy Standard) - added scrambling features (-J and -K options) - added selective compression (-Y and -Z options) - added third state for saved data to keep trace in an extracted catalogue of what is saved in the reference archive (this opens the door to the archive manager) - added the ability to read configuration file (-B option, -B like "batch"). - if a slice name is given in place of a base name, dar proposes to change to the correct base name (strips the extension number and dots). - fixed bug #8 - added dar_manager command-line program - replaced integer types by macro that can be adapted to have correct behavior on 64 bits platform (in particular to read archive from other platforms). from version 1.0.0 to version 1.1.0 - added feature: now ignored directory are not stored at all in the archive unless -D option is used, in which case ignored directory are recorded as empty directory (as it was in 1.0.x) - added support for hard links. Generated archive format version is now 02, but format 01 can still be read, and use as reference. - fixed bug #1 - fixed bug #2 - fixed bug #3 - added feature: restore only more recent file than existing one (-r option) - added feature: support for Extended Attributes (activated at compilation) - added feature: verbose option (-v) with -l (add archive contents) - modified behavior: -l option without -v is no more interactive - added feature: archive integrity test (option -t). CRC have been added in the archive (format 02), thus even without compression Dar is able to detect errors. - added feature: comparison with filesystem (difference) (option -d) - modified behavior: non interactive messages goes to stdout, while those asking user, goes to stderr (all goes to stderr if stdout is used for producing the archive, or for sending orders do dar_slave. - added feature: DAR automatically goes in non interactive mode if no terminal is found on standard input (for example when run from crontab). In that case any question make DAR to abort. - added feature: catalogue extraction to small file: "isolation" (-C option) - added feature: archive produced on stdout when using -c or -C with "-" as filename - added feature: -V option summarizes version of the binary - added feature: additional command "dar_xform" to "re-slice" an archive - added feature: read archive trough a pair of pipes with the help of dar_slave - added feature: long option are now available (see man page) - fixed bug #5 - a lot of speed optimization in algorithm - changed exit codes to positive values in case of error - dar returns an new error code when an operation is partially successful (some filed missed to be saved / restored / tested / compared). - replace the use of vform() method by a customized simple implementation in the ui_printf() routine, this should now allow compilation with gcc-3 - changed long option that used an underscore character (`_') by a dash ('-') - added -O option to have a better behavior when used with non root user - added 'make doc' option in the makefile from version 1.0.2 to version 1.0.3 - bug #5 fixed from version 1.0.1 to version 1.0.2 - bug #2 fixed - bug #3 fixed from version 1.0.0 to version 1.0.1 - correction of few mistakes that lead the compilation to fail with certain C++ compilers - bug #1 fixed. dar-2.5.3/COPYING0000644000175000017430000004330212610404647010253 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. dar-2.5.3/ABOUT-NLS0000644000175000017520000026713312642474463010471 000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. dar-2.5.3/po/0000755000175000017520000000000012642474573007726 500000000000000dar-2.5.3/po/fr.po0000644000175000017520000101163112642474573010620 00000000000000# French translations for DAR package. # Copyright (C) 2011 Free Software Foundation, Inc. # This file is distributed under the same license as the DAR package. # Denis Corbin , 2011. # msgid "" msgstr "" "Project-Id-Version: DAR 2.5.0\n" "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" "group_id=65612MSGID_BUGS_ADDRESS =atid=511612\n" "POT-Creation-Date: 2016-01-04 14:36+0100\n" "PO-Revision-Date: 2016-01-04 14:46+0100\n" "Last-Translator: Denis Corbin \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: src/libdar/archive_options.hpp:424 src/libdar/fichier_local.cpp:410 #: src/libdar/archive_options.cpp:1383 msgid "Furtive read mode" msgstr "Mode de lecture furtif" #: src/libdar/zapette.cpp:102 msgid "Partial request received, aborting\n" msgstr "Requête partielle reçue, opération abandonnée\n" #: src/libdar/zapette.cpp:175 msgid "Corrupted data read on pipe" msgstr "Les données lues depuis un tube sont corrompues" #: src/libdar/zapette.cpp:189 msgid "Input cannot be read" msgstr "l'entrée ne peut être lue" #: src/libdar/zapette.cpp:191 msgid "Cannot write to output" msgstr "Impossible d'écrire sur la sortie" #: src/libdar/zapette.cpp:193 msgid "Data should be read-only" msgstr "Les données devraient être en lecture seule" #: src/libdar/zapette.cpp:269 msgid "Cannot skip at end of file" msgstr "Ne peut pas atteindre la fin du fichier" #: src/libdar/zapette.cpp:294 msgid "Received unknown special order" msgstr "l'ordre ordre spécial reçu est inconnu" #: src/libdar/zapette.cpp:320 msgid "Cannot read on input" msgstr "Lecture impossible en entrée" #: src/libdar/zapette.cpp:322 msgid "Cannot write on output" msgstr "Écriture impossible en sortie" #: src/libdar/zapette.cpp:352 #, c-format msgid "" "Failed driving dar_slave to the end of archive: %S. Trying to open the " "archive from the first bytes" msgstr "" "dar_slave n'est pas arrivé à atteindre la fin de l'archive: %S. Tentantive " "d'ouverture de l'archive depuis les premiers octets" #: src/libdar/zapette.cpp:468 msgid "Uncomplete answer received from peer" msgstr "Réponse incomplète reçue du correspondant" #: src/libdar/zapette.cpp:525 msgid "Communication problem with peer, retry ?" msgstr "Problème de communication, essayer à nouveau ?" #: src/libdar/zapette.cpp:541 src/libdar/zapette.cpp:555 msgid "Incoherent answer from peer" msgstr "Réponse incohérente du correspondant" #: src/libdar/zapette.cpp:550 msgid "Bad answer from peer, while closing connection" msgstr "" "Réponse incohérente du correspondant pendant la terminaison de la connexion" #: src/libdar/zapette.cpp:560 src/libdar/zapette.cpp:565 #: src/libdar/zapette.cpp:570 msgid "" "Unexpected answer from slave, communication problem or bug may hang the " "operation" msgstr "" "Réponse inattendue de l'esclave, problème un de communication ou un bogue " "risque de suspendre l'opération" #: src/libdar/zapette.cpp:573 msgid "Corrupted data read from pipe" msgstr "Données corrompues lues depuis un tube" #: src/libdar/cat_detruit.cpp:46 msgid "missing data to build" msgstr "manque de données pour construire" #: src/libdar/erreurs.hpp:114 msgid "Lack of Memory" msgstr "Manque de mémoire" #: src/libdar/erreurs.hpp:126 msgid "Lack of Secured Memory" msgstr "Manque de mémoire sécurisée" #: src/libdar/erreurs.hpp:169 msgid "" "Cannot handle such a too large integer. Use a full version of libdar " "(compiled to rely on the \"infinint\" integer type) to solve this problem" msgstr "" "Impossible de gérer un entier aussi grand. Utiliser la version complète de " "libdar (compilé pour utiliser le type \"infinint\") pour résoudre ce problème" #: src/libdar/erreurs.hpp:300 msgid "Thread cancellation requested, aborting as soon as possible" msgstr "Demande d'arrêt de file d'exécution reçue, arrêt immédiat" #: src/libdar/erreurs.hpp:300 msgid "Thread cancellation requested, aborting as properly as possible" msgstr "" "Demande d'arrêt de file d'exécution reçue, on termine proprement l'opération " "en cours" #: src/libdar/filtre.cpp:225 src/libdar/filtre.cpp:581 #: src/libdar/filtre.cpp:1103 src/libdar/filtre.cpp:1279 #: src/libdar/filtre.cpp:2407 msgid "Inspecting directory " msgstr "Inspection d'un répertoire " #: src/libdar/filtre.cpp:261 #, c-format msgid "" "File %S has changed during backup and is probably not saved in a valid state " "(\"dirty file\"), do you want to consider it for restoration anyway?" msgstr "" "Le fichier %S a changé lors de sa sauvegarde and n'est probablement pas " "sauvé un état valide (\"fichier sale\"), voulez-vous malgré tout le " "considérer pour la restauration ?" #: src/libdar/filtre.cpp:271 msgid "" "File had changed during backup and had been copied another time, restoring " "the next copy of file: " msgstr "" "Le fichier a changé lors de sauvegarde mais a été sauvé plusieurs fois, " "restauration de la copie suivante : " #: src/libdar/filtre.cpp:342 #, c-format msgid "" "The just restored file %S has been marked as dirty (sequential reading can " "only detect the dirty status after restoration), do we remove this just " "restored dirty file?" msgstr "" "Le fichier juste restauré %S a été marqué comme sale (en lecture " "séquentielle cet état ne peut être détecté qu'après la restauration du " "fichier), voulez-vous supprimer le fichier sale qui vient juste d'être " "restauré ?" #: src/libdar/filtre.cpp:349 #, c-format msgid "" "The just restored file %S has been marked as dirty (sequential reading can " "only detect the dirty status after restoration), removing the just restored " "dirty file as it is asked to ignore this type of file" msgstr "" "Le fichier juste restauré %S a été marqué comme sale (en lecture " "séquentielle cet état ne peut être détecté qu'après la restauration du " "fichier), suppression du fichier sale qui vient juste d'être restauré, " "puisqu'il a été demandé d'ignorer ce type de fichier" #: src/libdar/filtre.cpp:351 #, c-format msgid "Removing the dirty file %S" msgstr "Suppression du fichier sale %S" #: src/libdar/filtre.cpp:424 msgid " not restored (user choice)" msgstr " non restauré (choix de l'utilisateur)" #: src/libdar/filtre.cpp:428 msgid "No file in this directory will be restored." msgstr "Aucun fichier de ce répertoire ne sera restauré." #: src/libdar/filtre.cpp:446 msgid "Error while restoring " msgstr "Erreur lors de la restauration de " #: src/libdar/filtre.cpp:451 msgid "Warning! No file in that directory will be restored: " msgstr "Attention ! Aucun fichier de ce répertoire ne sera restauré : " #: src/libdar/filtre.cpp:620 msgid "Recording hard link into the archive: " msgstr "Enregistrement de lien dur dans l'archive : " #: src/libdar/filtre.cpp:687 #, c-format msgid "" "SECURITY WARNING! SUSPICIOUS FILE %S: ctime changed since archive of " "reference was done, while no other inode information changed" msgstr "" "AVERTISSEMENT DE SECURITÉ ! FICHIER SUSPECT %S : la date ctime a changé " "depuis que l'archive de référence a été faite, alors qu'aucune autre " "propriété de cette inode n'a changé" #: src/libdar/filtre.cpp:955 msgid "Error while saving " msgstr "Erreur lors de la sauvegarde de " #: src/libdar/filtre.cpp:970 msgid "NO FILE IN THAT DIRECTORY CAN BE SAVED." msgstr "AUCUN FICHIER DE CE RÉPERTOIRE NE PEUT ÊTRE SAUVÉ." #: src/libdar/filtre.cpp:975 msgid "Cannot write down the archive: " msgstr "Impossible d'écrire l'archive : " #: src/libdar/filtre.cpp:992 msgid ", compression ratio " msgstr ", taux de compression " #: src/libdar/filtre.cpp:998 #, c-format msgid "Finished Inspecting directory %S , saved %S%S" msgstr "Fin de l'inspection du répertoire %S , sauvé %S%S" #: src/libdar/filtre.cpp:1095 msgid "SKIPPED (hard link in sequential read mode): " msgstr "SAUTÉ (lien dur en mode sequentiel) : " #: src/libdar/filtre.cpp:1131 msgid "OK " msgstr "OK " #: src/libdar/filtre.cpp:1142 src/libdar/filtre.cpp:1174 msgid "DIFF " msgstr "DIFF " #: src/libdar/filtre.cpp:1174 msgid ": file not present in filesystem" msgstr " : fichier absent du système de fichiers" #: src/libdar/filtre.cpp:1226 msgid "ERR " msgstr "ERR " #: src/libdar/filtre.cpp:1301 msgid "Data" msgstr "Données" #: src/libdar/filtre.cpp:1310 msgid "Can't read saved data." msgstr "Impossible de lire les données sauvegardées." #: src/libdar/filtre.cpp:1356 msgid "CRC error: data corruption." msgstr "Erreur de parité : données corrompues." #: src/libdar/filtre.cpp:1429 msgid "OK " msgstr "OK " #: src/libdar/filtre.cpp:1464 msgid "ERR " msgstr "ERR " #: src/libdar/filtre.cpp:1529 msgid "" "Decremental mode is useless when merging is not applied to both an archive " "of reference and an auxiliary archive of reference. Ignore decremental mode " "and continue?" msgstr "" "Le mode décrémental est inutile lorsqu'il n'est pas appliqué à la fois à une " "archive de référence et à une archive auxiliaire de référence. Ignorer le " "mode décrémental et continuer ?" #: src/libdar/filtre.cpp:1633 msgid "first" msgstr "première" #: src/libdar/filtre.cpp:1636 msgid "second" msgstr "deuxième" #: src/libdar/filtre.cpp:1639 msgid "next" msgstr "suivante" #: src/libdar/filtre.cpp:1642 #, c-format msgid "Merging/filtering files from the %s archive..." msgstr "Fusion/Filtrage des fichiers de l'archive %s ..." #: src/libdar/filtre.cpp:1724 msgid "overwritten" msgstr "écrasé" #: src/libdar/filtre.cpp:1728 src/libdar/filtre.cpp:1772 msgid "dropped from the archive and marked as already saved" msgstr "retiré de l'archive et marqué comme déjà sauvé" #: src/libdar/filtre.cpp:1731 msgid "removed" msgstr "supprimé" #: src/libdar/filtre.cpp:1736 #, c-format msgid "Data of file %S is about to be %S, proceed?" msgstr "Le fichier %S est sur le point d'être %S, OK?" #: src/libdar/filtre.cpp:1765 msgid "replaced" msgstr "remplacé" #: src/libdar/filtre.cpp:1768 msgid "removed from the archive" msgstr "supprimé de l'archive" #: src/libdar/filtre.cpp:1775 msgid "merged with possible overwriting" msgstr "fusionné avec écrasement possible" #: src/libdar/filtre.cpp:1780 #, c-format msgid "EA and FSA of file %S are about to be %S, proceed?" msgstr "Les EA et FSA du le fichier %S sont sur le point d'être %S, d'accord ?" #: src/libdar/filtre.cpp:1844 #, c-format msgid "" "EA and FSA of file %S from first archive have been updated with those of " "same named file of the auxiliary archive" msgstr "" "Les EA et FSA du fichier %S de la première archive ont été mis à jour avec " "ceux du fichier de même nom provenant de l'archive auxiliaire" #: src/libdar/filtre.cpp:1854 #, c-format msgid "" "EA of file %S from first archive have been dropped and marked as already " "saved" msgstr "" "Les Attributs Étendus du fichier %S de la première archive ont été retirés " "et marqués comme déjà sauvés" #: src/libdar/filtre.cpp:1860 #, c-format msgid "" "FSA of file %S from first archive have been dropped and marked as already " "saved" msgstr "" "Les FSA du fichier %S de la première archive ont été retirés et marqués " "comme déjà sauvés" #: src/libdar/filtre.cpp:1870 src/libdar/filtre.cpp:2007 #, c-format msgid "EA of file %S from first archive have been removed" msgstr "" "Les attributs étendus du fichier %S de la première archive ont été retirés" #: src/libdar/filtre.cpp:1878 #, c-format msgid "FSA of file %S from first archive have been removed" msgstr "Les FSA du fichier %S de la première archive ont été retirés" #: src/libdar/filtre.cpp:1892 #, c-format msgid "Data of file %S from first archive has been preserved from overwriting" msgstr "" "Les données du fichier %S de la première archive ont été préservés de " "l'écrasement" #: src/libdar/filtre.cpp:1943 #, c-format msgid "" "Data of file %S taken from the first archive of reference has been removed" msgstr "" "Les données du fichier %S pris de la première archive de référence ont été " "retirés" #: src/libdar/filtre.cpp:1946 #, c-format msgid "" "Data of file %S taken from the first archive of reference has been " "overwritten" msgstr "" "Les données du fichier %S pris de la première archive de référence ont été " "écrasées" #: src/libdar/filtre.cpp:1980 #, c-format msgid "EA of file %S has been overwritten" msgstr "Les Attributs Étendus du fichier %S ont été écrasés" #: src/libdar/filtre.cpp:1984 src/libdar/filtre.cpp:2000 #, c-format msgid "EA of file %S has been overwritten and marked as already saved" msgstr "" "Les Attributs Étendus du fichier %S ont été écrasés et marqués comme déjà " "sauvés" #: src/libdar/filtre.cpp:1990 src/libdar/filtre.cpp:1995 #, c-format msgid "" "EA of file %S from first archive have been updated with those of the same " "named file of the auxiliary archive" msgstr "" "Les Attributs Étendus du fichier %S de la première archive ont été mis à " "jour avec ceux du fichier de même nom pris de l'archive auxiliaire" #: src/libdar/filtre.cpp:2279 msgid " not merged (user choice)" msgstr " non fusionné (choix de l'utilisateur)" #: src/libdar/filtre.cpp:2283 msgid "No file in this directory will be considered for merging." msgstr "Aucun fichier de ce répertoire ne sera pris en compte pour la fusion." #: src/libdar/filtre.cpp:2303 msgid "Error while considering file " msgstr "Erreur lors de la prise en compte du fichier : " #: src/libdar/filtre.cpp:2307 msgid "Warning! No file in this directory will be considered for merging: " msgstr "" "Attention ! Aucun fichier de ce répertoire ne sera pris en compte pour la " "fusion : " #: src/libdar/filtre.cpp:2343 msgid "" "File selection has been aborted. Now building the resulting archive with the " "already selected files" msgstr "" "La sélection des fichiers a été interrompue. Construction de l'archive " "résultante avec les fichiers déjà sélectionnés" #: src/libdar/filtre.cpp:2509 msgid "Adding Hard link to archive: " msgstr "Ajout de lien dur à l'archive : " #: src/libdar/filtre.cpp:2580 msgid "failed reading CRC from file: " msgstr "Echec de lecture du CRC depuis le fichier : " #: src/libdar/filtre.cpp:2608 msgid "Failed reading CRC for EA: " msgstr "Echec de lecture du CRC pour les Attributs Etendus : " #: src/libdar/filtre.cpp:2619 msgid "Error met while reading next entry: " msgstr "Erreur lors de la lecture de l'entrée suivante : " #: src/libdar/filtre.cpp:2685 msgid "Resaving file without compression: " msgstr "Sauve à nouveau mais sans compression: " #: src/libdar/filtre.cpp:2689 #, c-format msgid "Adding %S to archive: %S" msgstr "Ajout du %S à l'archive : %S" #: src/libdar/filtre.cpp:2809 msgid "Copied data does not match CRC" msgstr "Les données copiées ne correspondent pas au CRC" #: src/libdar/filtre.cpp:2926 msgid " : Failed resaving uncompressed the inode data" msgstr " : Echec de la sauvegarde sans compression des données de l'inode" #: src/libdar/filtre.cpp:2936 msgid "" " : Resaving uncompressed the inode data to gain space is not possible, " "keeping data compressed" msgstr "" "Resauver sans compression les données de l'inode pour gagner de la place " "n'est pas possible, on conserve les données compressées" #: src/libdar/filtre.cpp:2956 #, c-format msgid "" "File has disappeared while we were reading it, cannot check whether it has " "changed during its backup: %S" msgstr "" "Le fichier a disparu alors que nous étions en train de le lire, impossible " "de vérifier s'il a changé lors de sa sauvegarde : %S" #: src/libdar/filtre.cpp:2991 #, c-format msgid "" "WARNING! File modified while reading it for backup. Performing retry %i of %i" msgstr "ATTENTION ! Fichier modifié pendant sa sauvegarde. Tentative %i sur %i" #: src/libdar/filtre.cpp:3004 msgid "" "WARNING! File modified while reading it for backup. No more retry for that " "file to not exceed the wasted byte limit. File is " msgstr "" "ATTENTION ! Fichier modifié lors de la lecture pour sa sauvegarde. Pas de " "nouvelle tentative pour ce fichier afin de de pas dépasser la taille " "maximale de gaspillage autorisée. Le fichier est " #: src/libdar/filtre.cpp:3011 msgid "" "WARNING! File modified while reading it for backup, but no more retry " "allowed: " msgstr "" "ATTENTION ! Fichier modifié pendant sa sauvegarde, plus de nouvelle tentative" #: src/libdar/filtre.cpp:3071 msgid "Saving Extended Attributes for " msgstr "Sauvegarde des Attributs Étendus de " #: src/libdar/filtre.cpp:3138 msgid "Error saving Extended Attributes for " msgstr "Erreur lors de la sauvegarde des Attributs Étendus de " #: src/libdar/filtre.cpp:3170 msgid "Saving Filesystem Specific Attributes for " msgstr "" "Sauvegarde des attributs spécifiques au système de fichier Étendus pour " #: src/libdar/filtre.cpp:3228 msgid "Error saving Filesystem Specific Attributes for " msgstr "Erreur lors de la sauvegarde des FSA de " #: src/libdar/archive.cpp:105 #, c-format msgid "Opening archive %s ..." msgstr "Ouverture de l'archive %s ..." #: src/libdar/archive.cpp:141 #, c-format msgid "" "Opening the archive of reference %s to retreive the isolated catalog ... " msgstr "" "Ouverture de l'archive de référence %s pour récupérer le catalogue isolé ..." #: src/libdar/archive.cpp:152 msgid "" "Reading the archive of reference from pipe or standard input is not possible" msgstr "" "La lecture de l'archive de référence à partir d'une tube ou de l'entrée " "standard n'est pas possible" #: src/libdar/archive.cpp:154 msgid "" "The basename '+' is reserved for special a purpose that has no meaning in " "this context" msgstr "" "Le nom de base '+' est réservé pour un usage particulier qui n'a aucun sens " "dans ce contexte" #: src/libdar/archive.cpp:196 msgid "Error while opening the archive of reference: " msgstr "Erreur lors de l'ouverture de l'archive de référence : " #: src/libdar/archive.cpp:213 msgid "Loading isolated catalogue in memory..." msgstr "Chargement en mémoire du catalogue isolé..." #: src/libdar/archive.cpp:226 msgid "" "Archive of reference is not signed properly (no the same signatories for the " "archive and the internal catalogue), do we continue?" msgstr "" "L'archive de référence n'est pas signée correctement (difference de " "signataire entre le catalogue interne et l'archive elle-même), est-ce qu'on " "continue ?" #: src/libdar/archive.cpp:233 msgid "" "The archive and the isolated catalogue do not correspond to the same data, " "they are thus incompatible between them" msgstr "" "L'archive et le catalogue isolé ne correspondent pas aux mêmes données, ils " "sont donc incompatibles entre eux" #: src/libdar/archive.cpp:242 msgid "Loading catalogue into memory..." msgstr "Chargement en mémoire du catalogue..." #: src/libdar/archive.cpp:254 src/libdar/archive.cpp:289 #: src/libdar/escape_catalogue.cpp:575 msgid "" "Archive internal catalogue is not identically signed as the archive itself, " "this might be the sign the archive has been compromised" msgstr "" "Le catalogue interne de l'archive n'a pas été signé de la même façon que " "l'archive elle-même, c'est probablement le signe d'une compromission de " "l'archive" #: src/libdar/archive.cpp:268 msgid "" "No data found in that archive, sequentially reading the catalogue found at " "the end of the archive..." msgstr "" "Aucune donnée trouvée dans cette archive, lecture séquentielle du catalogue " "situé à la fin de l 'archive..." #: src/libdar/archive.cpp:299 msgid "" "The catalogue will be filled while sequentially reading the archive, " "preparing the data structure..." msgstr "" "Le catalogue sera construit au fil de la lecture séquentielle de l'archive. " "Préparation de la structure de données ..." #: src/libdar/archive.cpp:339 #, c-format msgid "" "LAX MODE: The end of the archive is corrupted, cannot get the archive " "contents (the \"catalogue\")" msgstr "" "MODE RELAX : La fin de l'archive est corrompue, impossible d'obtenir le " "contenu de l'archive (le \"catalogue\")" #: src/libdar/archive.cpp:340 msgid "" "LAX MODE: Do you want to bypass some sanity checks and try again reading the " "archive contents (this may take some time, this may also fail)?" msgstr "" "MODE RELAX : Voulez-vous ignorer les tests de cohérence et tenter à nouveau " "la lecture du contenu de l'archive (ce qui peut prendre du temps et peut " "aussi échouer) ?" #: src/libdar/archive.cpp:356 #, c-format msgid "" "LAX MODE: Could not find a whole catalogue in the archive. If you have an " "isolated catalogue, stop here and use it as backup of the internal " "catalogue, else continue but be advised that all data will not be able to be " "retrieved..." msgstr "" "MODE RELAX : Impossible de trouver un catalogue entier dans l'archive. Si " "vous possédez un catalogue isolé, arrêter à ce stade et utilisez-le en " "secours du catalogue interne. Sinon continuez mais soyez prévenus que toutes " "les données ne pourront pas être récupérées" #: src/libdar/archive.cpp:357 msgid "" "LAX MODE: Do you want to try finding portions of the original catalogue if " "some remain (this may take even more time and in any case, it will only " "permit to recover some files, at most)?" msgstr "" "MODE RELAX : Voulez-vous rechercher des morceaux du catalogue d'origine s'il " "en reste (ce qui peut prendre encore plus de temps et en tout état de cause, " "ne permettra au plus de récupérer que quelques fichiers) ?" #: src/libdar/archive.cpp:584 src/libdar/archive.cpp:1726 msgid "Compression_level must be between 1 and 9 included" msgstr "\"Compression_level\" doit être compris entre 1 et 9 inclus" #: src/libdar/archive.cpp:586 src/libdar/archive.cpp:1728 msgid "" "\"first_file_size\" cannot be different from zero if \"file_size\" is equal " "to zero" msgstr "" "\"first_file_size\" ne peut être différent de zéro si \"file_size est égal à " "zéro" #: src/libdar/archive.cpp:588 src/libdar/archive.cpp:1730 msgid "Crypto block size must be greater than 10 bytes" msgstr "La taille d'un bloc de chiffrement doit être supérieure à 10 octets" #: src/libdar/archive.cpp:616 msgid "Both reference archive are nullptr, cannot merge archive from nothing" msgstr "" "Les deux archives de référence sont nullptr, impossible de fusionner à " "partir de rien" #: src/libdar/archive.cpp:645 msgid "" "the \"Keep file compressed\" feature is not possible when merging two " "archives using different compression algorithms (This is for a future " "version of dar). You can still merge these two archives but without keeping " "file compressed (thus you will probably like to use compression (-z or -y " "options) for the resulting archive" msgstr "" "La fonctionnalité de fusion sans décompression/recompression n'est pas " "disponible avec des archives utilisant différents algorithmes de compression " "(Ce sera pour une prochaine version de dar). Vous pouvez cependant fusionner " "ces deux archives avec décompression/recompression et aurez probablement " "intérêt à compresser (option -z ou -y) l'archive résultante" #: src/libdar/archive.cpp:772 src/libdar/archive.cpp:1064 msgid "This archive is not exploitable, check documentation for more" msgstr "" "Cette archive n'est pas exploitable, vérifier la documentation pour plus " "d'informations" #: src/libdar/archive.cpp:828 msgid "Error while restoring data: " msgstr "Erreur lors de la restauration de : \"" #: src/libdar/archive.cpp:859 src/libdar/archive.cpp:1150 msgid "" "This archive is not exploitable, check the archive class usage in the API " "documentation" msgstr "" "Cette archive n'est pas exploitable, vérifier la documentation de l'API pour " "plus d'informations" #: src/libdar/archive.cpp:867 src/libdar/archive.cpp:869 #: src/libdar/criterium.cpp:662 src/libdar/criterium.cpp:734 #: src/libdar/criterium.cpp:814 msgid "yes" msgstr "oui" #: src/libdar/archive.cpp:867 src/libdar/archive.cpp:869 msgid "no" msgstr "non" #: src/libdar/archive.cpp:868 src/libdar/header_version.cpp:118 #: src/libdar/crypto.cpp:42 msgid "none" msgstr "aucun" #: src/libdar/archive.cpp:873 #, c-format msgid "Archive version format : %s\n" msgstr "Version du format de l'archive : %s\n" #: src/libdar/archive.cpp:874 #, c-format msgid "Compression algorithm used : %S\n" msgstr "Algorithme de compression utilisé : %S\n" #: src/libdar/archive.cpp:875 #, c-format msgid "Symmetric key encryption used : %S\n" msgstr "Clef de chiffrement symmétrique : %S\n" #: src/libdar/archive.cpp:876 #, c-format msgid "Asymmetric key encryption used : %S\n" msgstr "Clef de chiffrement asymmétrique : %S\n" #: src/libdar/archive.cpp:877 #, c-format msgid "Archive is signed : %S\n" msgstr "Signature de l'archive : %S\n" #: src/libdar/archive.cpp:878 #, c-format msgid "Sequential reading marks : %s\n" msgstr "Marques pour lecture séquentielle : %s\n" #: src/libdar/archive.cpp:878 msgid "present" msgstr "présent" #: src/libdar/archive.cpp:878 msgid "absent" msgstr "absent" #: src/libdar/archive.cpp:880 #, c-format msgid "Catalogue size in archive : %i bytes\n" msgstr "Taille du catalogue dans l'archive : %i octets\n" #: src/libdar/archive.cpp:882 #, c-format msgid "Catalogue size in archive : N/A\n" msgstr "Taille du catalogue dans l'archive : NC\n" #: src/libdar/archive.cpp:883 #, c-format msgid "" "User comment : %S\n" "\n" msgstr "" "Commentaires de l'utilisateur : %S\n" "\n" #: src/libdar/archive.cpp:889 #, c-format msgid "Archive is composed of %i file(s)\n" msgstr "Archive composée de %i fichier(s)\n" #: src/libdar/archive.cpp:891 #, c-format msgid "File size: %i bytes\n" msgstr "Taille du fichier : %i octets\n" #: src/libdar/archive.cpp:895 #, c-format msgid "First file size : %i bytes\n" msgstr "Fichier initial : %i octets\n" #: src/libdar/archive.cpp:896 #, c-format msgid "File size : %i bytes\n" msgstr "Taille des fichiers : %i octets\n" #: src/libdar/archive.cpp:897 #, c-format msgid "Last file size : %i bytes\n" msgstr "Fichier final : %i octets\n" #: src/libdar/archive.cpp:902 #, c-format msgid "Archive total size is : %i bytes\n" msgstr "Taille totale : %i octets\n" #: src/libdar/archive.cpp:910 #, c-format msgid "Archive size is: %i bytes\n" msgstr "Taille de l'archive : %i octets\n" #: src/libdar/archive.cpp:911 #, c-format msgid "Previous archive size does not include headers present in each slice\n" msgstr "" "La taille de l'archive ne tient pas compte des en-têtes de chaque tranche\n" #: src/libdar/archive.cpp:914 #, c-format msgid "Archive size is unknown (reading from a pipe)" msgstr "Taille d'archive inconnue (lecture depuis un tube)" #: src/libdar/archive.cpp:934 #, c-format msgid "" "The overall archive size includes %i byte(s) wasted due to bad compression " "ratio" msgstr "" "La taille totale de l'archive inclut %i octet(s) gaspillé(s) à cause d'un " "mauvais taux de compression" #: src/libdar/archive.cpp:937 msgid "The global data compression ratio is: " msgstr "La taux de compression global est : " #: src/libdar/archive.cpp:943 #, c-format msgid "" "\n" "WARNING! This archive only contains the contents of another archive, it can " "only be used as reference for differential backup or as rescue in case of " "corruption of the original archive's content. You cannot restore any data " "from this archive alone\n" msgstr "" "\n" "ATTENTION ! Cette archive ne contient que la liste du contenu d'une autre " "archive et ne peut être utilisé qu'en tant que référence pour une sauvegarde " "différentielle ou comme secours en cas de corruption de l'archive d'origine. " "Il est impossible de restaurer des données à partir de cette archive seule\n" #: src/libdar/archive.cpp:999 #, c-format msgid "" "Using user provided modified slicing (first slice = %i bytes, other slices = " "%i bytes)" msgstr "" "Utilisation du découpage fourni par l'utilisateur (première tranche = %i " "octets, autres tranches = %i octets)" #: src/libdar/archive.cpp:1002 msgid "" "Using the slice layout of the archive of reference recorded at the time this " "isolated catalogue was done\n" " Note: if this reference has been resliced this isolated catalogue has been " "created, the resulting slicing information given here will be wrong and will " "probably lead to an error. Check documentation to know hos to manually " "specify the slicing to use" msgstr "" "Utilisation des tailles de découpage de l'archive de référence enregistrées " "lors de l'isolation du catalogue\n" "Note : Si l'archive de référence à été réagencée en tranche après " "l'isolation, les informations de découpage utilisée ici sont incorrectes et " "conduiront probablement à une erreur. Regardez la documentation pour savoir " "comment définir manuellement le découpage en tranches" #: src/libdar/archive.cpp:1012 msgid "" "Warning: No slice layout of the archive of reference has been recorded in " "this isolated catalogue. The additional slicing information you provided may " "still lead the operation to fail because the archive has an _unsupported_ " "(too old) format for this feature" msgstr "" "Attention: Aucune information de découpage en tranche pour l'archive de " "référence n'a été enregistré avec ce catalogue isolé. Les informations que " "vous avez fournies manuellement peuvent conduire l'opération à échouer car " "cette archive a un format _non supporté_ (trop vieux) pour cette " "fonctionnalité" #: src/libdar/archive.cpp:1014 msgid "" "No slice layout of the archive of reference for the current isolated " "catalogue is available, cannot provide slicing information, aborting" msgstr "" "Aucune information de découpage en tranche n'est disponible à propos de " "l'archive dont a été isolé le présent catalogue. Impossible de localiser les " "fichiers au sein de l'archive, arrêt des opérations." #: src/libdar/archive.cpp:1030 msgid "Error while listing archive contents: " msgstr "Erreur lors de l'affichage du contenu de l'archive : " #: src/libdar/archive.cpp:1113 msgid "Error while comparing archive with filesystem: " msgstr "" "Erreur pendant la comparaison de l'archive avec le système de fichiers : " #: src/libdar/archive.cpp:1162 msgid "" "WARNING! This is an isolated catalogue, no data or EA is present in this " "archive, only the catalogue structure can be checked" msgstr "" "ATTENTION ! Ceci est un catalogue isolé, aucune donnée ou AE n'est présent " "dans cette archive, seule la structure du catalogue peut être validée" #: src/libdar/archive.cpp:1197 msgid "A problem occurred while reading this archive contents: " msgstr "Une erreur est survenue lors de la lecture du contenu de l'archive : " #: src/libdar/archive.cpp:1212 msgid "Error while testing archive: " msgstr "Erreur lors du test de l'archive : " #: src/libdar/archive.cpp:1733 msgid "" "nodump flag feature has not been activated at compilation time, it is thus " "not available" msgstr "" "La fonctionnalité --nodump n'a pas été activée lors de la compilation, cette " "option n'est donc pas disponible" #: src/libdar/archive.cpp:1792 #, c-format msgid "" "WARNING! The archive is located in the directory to backup, this may create " "an endless loop when the archive will try to save itself. You can either add " "-X \"%S.*.%S\" on the command line, or change the location of the archive " "(see -h for help). Do you really want to continue?" msgstr "" "ATTENTION ! L'archive se trouve dans un des répertoires à sauvegarder, cela " "peut créer une boucle sans fin lorsque l'archive essaiera de se sauvegarder " "elle-même. Il est soit possible d'ajouter -X \"%S.*.%S\" sur la ligne de " "commande ou bien il faut changer l'archive de place (voir l'option -h pour " "l'aide). Voulez-vous vraiment continuer ?" #: src/libdar/archive.cpp:1959 msgid "Ready to start writing down the archive?" msgstr "Prêt à commencer l'écriture de l'archive ?" #: src/libdar/archive.cpp:1999 msgid "Building the catalog object..." msgstr "Construction de l'objet catalogue ..." #: src/libdar/archive.cpp:2014 #, c-format msgid "Error while fetching information for %S: " msgstr "Erreur lors de la recherche d'informations pour %S : " #: src/libdar/archive.cpp:2058 msgid "Processing files for backup..." msgstr "Traitement des fichiers pour la sauvegarde ..." #: src/libdar/archive.cpp:2113 msgid "Processing files for merging..." msgstr "Traitement des fichier pour la fusion ..." #: src/libdar/archive.cpp:2170 msgid "" "Adding reference to files that have been destroyed since reference backup..." msgstr "" "Ajout des fichiers qui ont été détruits depuis la sauvegarde de référence ..." #: src/libdar/archive.cpp:2217 msgid "Error while saving data: " msgstr "Erreur lors de la sauvegarde des données : " #: src/libdar/archive.cpp:2279 msgid "WARNING! Incorrect signature found for archive, continue anyway?" msgstr "" "ATTENTION ! Signature incorrecte trouvée pour l'archive, on continue malgré " "tout ?" #: src/libdar/archive.cpp:2309 msgid "" "Cannot get data name of the archive, this archive is not completely " "initialized" msgstr "" "Impossible d'obtenir le nom de données de cette archive ; cette archive " "n'est pas complètement initialisée" #: src/libdar/archive.cpp:2334 msgid "" "This archive contains an isolated catalogue, it cannot be used for this " "operation. It can only be used as reference for a incremental/differential " "backup or as backup of the original archive's catalogue" msgstr "" "Cette archive ne contient qu'un catalogue isolé et ne peut pas être utilisée " "pour cette opération. Elle ne peut servir que de référence pour une " "sauvegarde incrémentale/décrémentale ou comme secours du catalogue de " "l'archive d'origine" #: src/libdar/archive.cpp:2341 msgid "" "LAX MODE: Archive seems to be only an isolated catalogue (no data in it), " "Can I assume data corruption occurred and consider the archive as being a " "real archive?" msgstr "" "MODE RELAX : L'archive semble n'être qu'un catalogue isolé (aucune donnée " "présente), Doit-on considérer qu'il s'agit plutôt d'une corruption et peut-" "on considérer que l'archive est une vraie archive ?" #: src/libdar/archive.cpp:2346 msgid "Error while fetching archive properties: " msgstr "Erreur lors de la recherche des propriétés de l'archive : " #: src/libdar/archive.cpp:2371 msgid "Sorry, file size is unknown at this step of the program.\n" msgstr "Désolé, la taille du fichier est inconnue à cette étape du programme\n" #: src/libdar/archive.cpp:2449 #, c-format msgid "" "libgcrypt version < %s. Ligcrypt used has a bug that leads md5 and sha1 hash " "results to be erroneous for files larger than 256 Gio (gibioctet), do you " "really want to spend CPU cycles calculating a useless hash?" msgstr "" "version de libgcrypt < %s. Cette version de ligcrypt a un bug qui conduit " "les calculs de hash md5 et sha1 à être faux pour des fichiers plus grands " "que 256 Gio (gibioctet), voulez-vous vraiment perdre du temps à calculer ces " "hash inutiles ?" #: src/libdar/cat_inode.cpp:158 msgid "badly structured inode: unknown inode flag" msgstr "inode mal-formée : drapeau d'inode inconnu" #: src/libdar/cat_inode.cpp:169 src/libdar/cat_inode.cpp:172 #: src/libdar/cat_inode.cpp:182 msgid "missing data to build an inode" msgstr "données absentes pour construire une inode" #: src/libdar/cat_inode.cpp:280 msgid "badly structured inode: unknown inode flag for FSA" msgstr "inode mal-formée : drapeau de FSA inconnu" #: src/libdar/cat_inode.cpp:394 msgid "different file type" msgstr "types de fichier différents" #: src/libdar/cat_inode.cpp:399 #, c-format msgid "different owner (uid): %i <--> %i" msgstr "groupes propriétaires différents (uid) : %i <--> %i" #: src/libdar/cat_inode.cpp:405 #, c-format msgid "different owner group (gid): %i <--> %i" msgstr "groupes propriétaires différents (gid) : %i <--> %i" #: src/libdar/cat_inode.cpp:411 #, c-format msgid "different permission: %S <--> %S" msgstr "droits d'accès différents: %S <--> %S" #: src/libdar/cat_inode.cpp:419 #, c-format msgid "difference of last modification date: %S <--> %S" msgstr "différence de date de dernière modification : %S <--> %S" #: src/libdar/cat_inode.cpp:434 msgid "different Extended Attributes" msgstr "Attributs Étendus différents" #: src/libdar/cat_inode.cpp:440 msgid "no Extended Attribute to compare with" msgstr "aucun Attribut Étendu avec lequel comparer" #: src/libdar/cat_inode.cpp:442 src/libdar/cat_inode.cpp:463 msgid "" "Cannot compare EA: EA support has not been activated at compilation time" msgstr "" "Comparaison d'AE impossible : le support pour les Attributs Étendus n'a pas " "été activé lors de la compilation" #: src/libdar/cat_inode.cpp:456 msgid "inode last change date (ctime) greater, EA might be different" msgstr "" "date de dernier changement de l'inode (ctime) plus récent, les Attributs " "Étendus peuvent être différents" #: src/libdar/cat_inode.cpp:461 msgid "no Extended Attributes to compare with" msgstr "aucun Attribut Étendu avec lequel comparer" #: src/libdar/cat_inode.cpp:490 msgid "different Filesystem Specific Attributes" msgstr "attributs spécifiques au système de fichier différents" #: src/libdar/cat_inode.cpp:496 msgid "No Filesystem Specific Attribute to compare with" msgstr "Aucun attribut spécifique au système de fichier avec lequel comparer" #: src/libdar/cat_inode.cpp:504 msgid "inode last change date (ctime) greater, FSA might be different" msgstr "" "date de dernier changement de l'inode (ctime) plus récent, les FSA peuvent " "être différents" #: src/libdar/cat_inode.cpp:507 msgid "Filesystem Specific Attribute are missing" msgstr "Les attributs spécifiques au système de fichier (FSA) font défaut" #: src/libdar/cat_inode.cpp:793 msgid "CRC error detected while reading EA" msgstr "Erreur de CRC détectée lors de la lecture des AE" #: src/libdar/cat_inode.cpp:937 msgid "" "Error while reading CRC for EA from the archive: No escape mark found for " "that file" msgstr "" "Erreur lors de la lecture du CRC pour des AE à partir de l'archive : Aucune " "séquence d'échappement trouvé pour ce fichier" #: src/libdar/cat_inode.cpp:1166 msgid "CRC error detected while reading FSA" msgstr "Erreur de CRC détectée lors de la lecture des FSA" #: src/libdar/cat_inode.cpp:1290 msgid "" "Error while reading CRC for FSA from the archive: No escape mark found for " "that file" msgstr "" "Erreur lors de la lecture du CRC pour des FSA à partir de l'archive : Aucune " "séquence d'échappement trouvé pour ce fichier" #: src/libdar/scrambler.cpp:34 msgid "Key cannot be an empty string" msgstr "Une clef ne peut être une chaîne vide" #: src/libdar/tools.cpp:158 src/libdar/criterium.cpp:880 #: src/dar_suite/dar_suite.cpp:287 msgid "YES" msgstr "OUI" #: src/libdar/tools.cpp:158 src/libdar/criterium.cpp:881 #: src/dar_suite/dar_suite.cpp:289 msgid "NO" msgstr "NON" #: src/libdar/tools.cpp:239 msgid "Not a zero terminated string in file" msgstr "" "La chaîne lue depuis un fichier n'est pas terminée par le caractère zéro" #: src/libdar/tools.cpp:277 #, c-format msgid "Cannot get file size: %s" msgstr "Imposible de connaître la taille du fichier : %s" #: src/libdar/tools.cpp:329 #, c-format msgid "Unknown suffix [%c] in string %S" msgstr "Suffixe inconnu [%c] dans la chaîne %S" #: src/libdar/tools.cpp:503 msgid "Cannot read \"fcntl\" file's flags : " msgstr "Impossible de lire les drapeaux \"fcntl\" du fichier : " #: src/libdar/tools.cpp:509 msgid "Cannot set \"fcntl\" file's flags : " msgstr "Impossible de modifier les drapeaux \"fcntl\" du fichier : " #: src/libdar/tools.cpp:589 src/libdar/tools.cpp:594 src/libdar/tools.cpp:606 #: src/libdar/tools.cpp:611 msgid "Invalid number: " msgstr "Numéro invalide : " #: src/libdar/tools.cpp:710 msgid "date before 1970 is not allowed" msgstr "les dates antérieurs à l'an 1970 ne sont pas permises" #: src/libdar/tools.cpp:715 msgid "Incorrect month" msgstr "Mois incorrect" #: src/libdar/tools.cpp:720 msgid "Incorrect day of month" msgstr "Quantième inconnu" #: src/libdar/tools.cpp:725 msgid "Incorrect hour" msgstr "Heure incorrecte" #: src/libdar/tools.cpp:730 msgid "Incorrect minute" msgstr "Minute incorrecte" #: src/libdar/tools.cpp:735 msgid "Incorrect second" msgstr "Seconde incorrecte" #: src/libdar/tools.cpp:739 msgid "Bad formatted date expression" msgstr "Mauvais format de date" #: src/libdar/tools.cpp:854 msgid "Given date must be in the past" msgstr "la date fournie doit être dans le passée" #: src/libdar/tools.cpp:889 src/libdar/tools.cpp:978 msgid "Error while calling fork() to launch dar: " msgstr "Erreur lors de l'appel à fork() pour lancer dar : " #: src/libdar/tools.cpp:903 src/libdar/tools.cpp:1008 msgid "Unexpected error while waiting for dar to terminate: " msgstr "" "Erreur inattendue reçue lors de l'attente de la fin d'execution de dar : " #: src/libdar/tools.cpp:909 src/libdar/tools.cpp:1014 msgid "DAR terminated upon signal reception: " msgstr "Arrêt de DAR suite à la reception du signal : " #: src/libdar/tools.cpp:915 src/libdar/tools.cpp:1020 msgid " . Retry to launch dar as previously ?" msgstr " . Doit-on relancer dar comme précédemment ?" #: src/libdar/tools.cpp:920 src/libdar/tools.cpp:927 src/libdar/tools.cpp:1025 #: src/libdar/tools.cpp:1032 msgid " Continue anyway ?" msgstr " Doit-on continuer malgré tout ?" #: src/libdar/tools.cpp:925 src/libdar/tools.cpp:1030 msgid "DAR sub-process has terminated with exit code " msgstr "Le sous-processus DAR a terminé avec le code de sortie " #: src/libdar/tools.cpp:1129 #, c-format msgid " Libz compression (gzip) : %s\n" msgstr " Compression libz (gzip) : %s\n" #: src/libdar/tools.cpp:1130 #, c-format msgid " Libbz2 compression (bzip2) : %s\n" msgstr " Compression libbz2 (bzip2) : %s\n" #: src/libdar/tools.cpp:1131 #, c-format msgid " Liblzo2 compression (lzo) : %s\n" msgstr " Compression liblzo2 (lzo) : %s\n" #: src/libdar/tools.cpp:1132 #, c-format msgid " Liblzma compression (xz) : %s\n" msgstr " Compression liblzma (xz) : %s\n" #: src/libdar/tools.cpp:1133 #, c-format msgid " Strong encryption (libgcrypt): %s\n" msgstr " Chiffrement fort (libgcrypt) : %s\n" #: src/libdar/tools.cpp:1134 #, c-format msgid " Public key ciphers (gpgme) : %s\n" msgstr " Chiffrement clef pub.(gpgme) : %s\n" #: src/libdar/tools.cpp:1135 #, c-format msgid " Extended Attributes support : %s\n" msgstr " Support Attributs Étendus : %s\n" #: src/libdar/tools.cpp:1136 #, c-format msgid " Large files support (> 2GB) : %s\n" msgstr " Support fichiers géants : %s\n" #: src/libdar/tools.cpp:1137 #, c-format msgid " ext2fs NODUMP flag support : %s\n" msgstr " Support drapeau NODUMP : %s\n" #: src/libdar/tools.cpp:1138 #, c-format msgid " Special allocation scheme : %s\n" msgstr " Allocation mémoire optimisée : %s\n" #: src/libdar/tools.cpp:1140 #, c-format msgid " Integer size used : unlimited\n" msgstr " Entiers utilisés : sans limites\n" #: src/libdar/tools.cpp:1142 #, c-format msgid " Integer size used : %d bits\n" msgstr " Entiers utilisés : %d bits\n" #: src/libdar/tools.cpp:1143 #, c-format msgid " Thread safe support : %s\n" msgstr " Compat. environ. multi-tâches: %s\n" #: src/libdar/tools.cpp:1144 #, c-format msgid " Furtive read mode support : %s\n" msgstr " Lecture furtive supportée : %s\n" #: src/libdar/tools.cpp:1145 #, c-format msgid " Linux ext2/3/4 FSA support : %s\n" msgstr " Support FSA ext2/3/4 : %s\n" #: src/libdar/tools.cpp:1146 #, c-format msgid " Mac OS X HFS+ FSA support : %s\n" msgstr " Support FSA HFS+ de Mac OS X : %s\n" #: src/libdar/tools.cpp:1151 msgid "big" msgstr "gros" #: src/libdar/tools.cpp:1154 msgid "little" msgstr "petit" #: src/libdar/tools.cpp:1157 msgid "error!" msgstr "Erreur !" #: src/libdar/tools.cpp:1162 #, c-format msgid " Detected system/CPU endian : %s" msgstr " Boutisme du système/CPU : %s" #: src/libdar/tools.cpp:1163 #, c-format msgid " Posix fadvise support : %s" msgstr " Support de Posix fadvise : %s" #: src/libdar/tools.cpp:1164 #, c-format msgid " Large dir. speed optimi. : %s" msgstr " Optim. grands répertoires : %s" #: src/libdar/tools.cpp:1169 #, c-format msgid " Timestamp read accuracy : %S\n" msgstr " Temps, précision en lecture : %S\n" #: src/libdar/tools.cpp:1174 #, c-format msgid " Timestamp write accuracy : %S\n" msgstr " Temps, précision en écriture : %S\n" #: src/libdar/tools.cpp:1175 #, c-format msgid " Restores dates of symlinks : %s\n" msgstr " Symlinks, dates restorées : %s\n" #: src/libdar/tools.cpp:1177 #, c-format msgid " Can uses multiple threads : %s\n" msgstr " Recours à plusieurs threads : %s\n" #: src/libdar/tools.cpp:1234 #, c-format msgid "" "Warning, %S seems more to be a slice name than a base name. Do you want to " "replace it by %S ?" msgstr "" "Attention, %S semble être un nom de fichier plutôt qu'un nom de base. " "Souhaitez-vous le remplacer par %S ?" #: src/libdar/tools.cpp:1239 #, c-format msgid "OK, keeping %S as basename" msgstr "OK, on garde %S comme nom de base" #: src/libdar/tools.cpp:1274 msgid "Cannot get full path of current working directory: " msgstr "Impossible d'obtenir le chemin complet du répertoire courant : " #: src/libdar/tools.cpp:1301 msgid "nullptr argument given to tools_readlink()" msgstr "Valeur nullptr donnée à tools_readlink()" #: src/libdar/tools.cpp:1303 msgid "Empty string given as argument to tools_readlink()" msgstr "Valeur NULL donnée à en argument de tools_readlink()" #: src/libdar/tools.cpp:1330 #, c-format msgid "Cannot read file information for %s : %s" msgstr "Impossible d'obtenir d'information sur %s : %s" #: src/libdar/tools.cpp:1428 msgid "Cannot set birth time: " msgstr "Impossible de définir la date de naissance: " #: src/libdar/tools.cpp:1458 msgid "Cannot set last access and last modification time: " msgstr "" "Impossible de positionner les dates de dernier accès et de dernière " "modification : " #: src/libdar/tools.cpp:1542 msgid "Aborting program: child process died unexpectedly" msgstr "Arrêt du programme : le processus fils est mort de façon inattendue" #: src/libdar/tools.cpp:1550 #, c-format msgid "Error trying to run %s: %s" msgstr "Erreur lors de l'execution de %s : %s" #: src/libdar/tools.cpp:1553 msgid "execvp() failed but did not returned error code" msgstr "execvp() a échoué mais n'a pas retourné de code d'erreur" #: src/libdar/tools.cpp:1625 src/libdar/tools.cpp:1633 #, c-format msgid "Error met while retrieving current time: %S" msgstr "Erreur lors de la récupération de l'heure courante : %S" #: src/libdar/tools.cpp:1777 #, c-format msgid "Removing file %s" msgstr "Suppression du fichier %s" #: src/libdar/tools.cpp:1781 #, c-format msgid "Error removing file %s: %s" msgstr "Erreur lors de la suppression du fichier %s : %s" #: src/libdar/tools.cpp:1807 #, c-format msgid "" "Overwriting not allowed while a slice of a previous archive with the same " "basename has been found in the %s directory, Operation aborted" msgstr "" "Écrasement interdit alors qu'une tranche de même nom de base a été trouvée " "dans le répertoire %s. Opération avortée" #: src/libdar/tools.cpp:1813 #, c-format msgid "" "At least one slice of an old archive with the same name remains in the " "directory %s. It is advised to remove all the old archive's slices before " "creating an archive of same name. Can I remove these old slices?" msgstr "" "Au moins une tranche d'une ancienne archive ayant le même nom reste présente " "dans le répertoire %s. Il est conseillé de supprimer toutes les anciennes " "tranches avant de créer une archive de même nom. Peut-on supprimer les " "anciennes tranches ?" #: src/libdar/tools.cpp:1864 src/libdar/tools.cpp:1871 #, c-format msgid "Cannot get inode information for %s: %s" msgstr "Impossible d'obtenir des informations sur l'inode %s : %s" #: src/libdar/tools.cpp:1881 msgid "Current Working Directory cannot be a relative path" msgstr "Le répetoire courant ne peut pas être un chemin relatif" #: src/libdar/tools.cpp:1898 msgid "Cannot block signals: " msgstr "Impossible de bloquer les signaux : " #: src/libdar/tools.cpp:1908 msgid "Cannot unblock signals: " msgstr "Impossible de débloquer les signaux : " #: src/libdar/tools.cpp:1928 src/libdar/tools.cpp:1949 #, c-format msgid "Cannot get last modification date: %s" msgstr "Impossible d'obtenir la date de dernière modification : %s" #: src/libdar/tools.cpp:1953 #, c-format msgid "Cannot get size of %S: not a plain file" msgstr "Impossible de connaître la taill de %S: ce n'est pas un fichier plein" #: src/libdar/tools.cpp:1966 #, c-format msgid "Cannot get mtime: %s" msgstr "Impossible d'obtenir la date de dernière modification : %s" #: src/libdar/tools.cpp:2072 #, c-format msgid "Parse error: Unmatched `%c'" msgstr "Erreur de syntaxe : `%c' sans correspondance" #: src/libdar/tools.cpp:2125 msgid "Unknown substitution string: %" msgstr "Chaîne de substitution inconnue : %" #: src/libdar/tools.cpp:2132 msgid "" "last char of user command-line to execute is '%', (use '%%' instead to avoid " "this message)" msgstr "" "Le dernier caractère de la ligne de commande utilisateur à exécuter est '%', " "(utiliser '%%' à la place pour éviter ce message)" #: src/libdar/tools.cpp:2186 msgid "execve() failed. (process table is full ?)" msgstr "execve() a échoué. (table de processus pleine ?)" #: src/libdar/tools.cpp:2188 msgid "system() call failed: " msgstr "system() a échoué : " #: src/libdar/tools.cpp:2190 #, c-format msgid "execution of [ %S ] returned error code: %d" msgstr "l'exécution de [ %S ] a retourné un code d'erreur : %d" #: src/libdar/tools.cpp:2197 msgid "Error during user command line execution: " msgstr "Erreur pendant l'exécution de la ligne de commande utilisateur : " #: src/libdar/tools.cpp:2197 msgid " . Retry command-line ?" msgstr " . Essayer à nouveau la ligne de commande ?" #: src/libdar/tools.cpp:2202 msgid "Ignore previous error on user command line and continue ?" msgstr "" "Ignorer l'erreur précédente concernant la ligne de commande utilisateur et " "continuer ?" #: src/libdar/tools.cpp:2242 msgid "Fatal error on user command line: " msgstr "Erreur fatale sur la ligne de commande utilisateur : " #: src/libdar/tools.cpp:2368 src/libdar/tools.cpp:2374 msgid "Badly formated octal number" msgstr "Nombre octal malformée" #: src/libdar/tools.cpp:2471 msgid "Cannot get effective permission given a file descriptor: " msgstr "" "Impossible d'obtenir les droits d'accès à partir d'un description de " "fichier : " #: src/libdar/tools.cpp:2487 #, c-format msgid "Error while setting file permission: %s" msgstr "Erreur lors de la configuration des droits d'accès : %s" #: src/libdar/tools.cpp:2508 msgid "An empty string is not a valid user name" msgstr "Une chaîne vide n'est pas un nom d'utilisateur valide" #: src/libdar/tools.cpp:2546 src/libdar/tools.cpp:2568 msgid "Unknown user" msgstr "Utilisateur inconnu" #: src/libdar/tools.cpp:2548 src/libdar/tools.cpp:2570 #, c-format msgid "Error found while looking for UID of user %s: %S" msgstr "" "Erreur rencontrée lors de la recherche de l'UID pour l'utilisateur %s: %S" #: src/libdar/tools.cpp:2578 src/libdar/tools.cpp:2672 msgid "" "Cannot convert username to uid in statically linked binary, either directly " "provide the UID or run libdar from a dynamically linked executable" msgstr "" "Impossible de convertir un nom d'utilisateur en numéro (UID) dans un " "executable lié statiquement. Fournir soit directement l'UID soit utiliser un " "exécutable lié dynamiquement" #: src/libdar/tools.cpp:2603 msgid "An empty string is not a valid group name" msgstr "Une chaîne vide n'est pas un nom de groupe valide" #: src/libdar/tools.cpp:2639 src/libdar/tools.cpp:2662 msgid "Unknown group" msgstr "Groupe inconnu" #: src/libdar/tools.cpp:2641 #, c-format msgid "Error found while looking fo GID of group %s: %S" msgstr "Erreur recontrée lors de la recherche de GID pour le groupe %s : %S" #: src/libdar/tools.cpp:2664 #, c-format msgid "Error found while looking for GID of group %s: %S" msgstr "Erreur recontrée lors de la recherche de GID pour le groupe %s : %S" #: src/libdar/tools.cpp:2701 #, c-format msgid "Error while setting file user ownership: %s" msgstr "Erreur lors de la changement de propriétaire : %s" #: src/libdar/tools.cpp:2838 msgid "Error while fetching hostname: " msgstr "Erreur lors de recherche du nom d'hôte (hostname) : " #: src/libdar/tools.cpp:2868 msgid "Worse" msgstr "Pire " #: src/libdar/tools.cpp:2888 #, c-format msgid "Error code %d to message conversion failed" msgstr "Erreur lors de la conversion du code %d en message" #: src/libdar/tools.cpp:2943 msgid "Invalid wide-char found in string: " msgstr "Caractère large invalide dans la chaîne : " #: src/libdar/deci.cpp:46 msgid "invalid decimal digit" msgstr "chiffre décimal non valide" #: src/libdar/deci.cpp:132 msgid "an empty string is an invalid argument" msgstr "une chaîne vide n'est pas un argument valide" #: src/libdar/elastic.cpp:73 msgid "Zero is not a valid size for an elastic buffer" msgstr "Zéro n'est pas une taille valide de tampon élastique" #: src/libdar/elastic.cpp:75 msgid "Size too large for an elastic buffer" msgstr "taille trop grande pour un tampon élastique" #: src/libdar/elastic.cpp:92 src/libdar/elastic.cpp:98 #: src/libdar/elastic.cpp:128 src/libdar/elastic.cpp:134 #: src/libdar/elastic.cpp:150 src/libdar/elastic.cpp:158 #: src/libdar/elastic.cpp:187 src/libdar/elastic.cpp:195 #: src/libdar/elastic.cpp:205 msgid "elastic buffer incoherent structure" msgstr "Structure incohérent du tampon élastique" #: src/libdar/elastic.cpp:124 src/libdar/elastic.cpp:183 msgid "too large elastic buffer or elastic buffer incoherent structure" msgstr "Tampon élastique trop grand ou de structure incohérente" #: src/libdar/elastic.cpp:212 msgid "not enough space provided to dump the elastic buffer" msgstr "Pas assez de mémoire pour écrire le tampon élastique" #: src/libdar/cat_mirage.cpp:141 msgid "Incoherent catalogue structure: hard linked inode's data not found" msgstr "" "structure incohérente du catalogue : données non trouvée pour une inode " "ayant un lien dur" #: src/libdar/cat_mirage.cpp:178 msgid "Incoherent catalogue structure: hard linked data is not an inode" msgstr "" "structure incohérente du catalogue : les données liées en dur ne sont pas " "celles d'une inode" #: src/libdar/cat_mirage.cpp:215 msgid "Incoherent catalogue structure: duplicated hard linked inode's data" msgstr "" "Incohérence dans le catalogue : duplication des données associées à une " "inode liée en dur" #: src/libdar/cat_mirage.cpp:229 msgid "" "Incoherent catalogue structure: unknown status flag for hard linked inode" msgstr "" "Incohérence dans le catalogue : drapeau d'état inconnu pour une inode liée " "en dur" #: src/libdar/secu_string.cpp:102 src/libdar/secu_string.cpp:141 msgid "Error while reading data for a secure memory:" msgstr "" "Erreur lors de la lecture de donnée destinée à une mémoire sécurisée : " #: src/libdar/secu_string.cpp:119 msgid "appending data over secure_memory its end" msgstr "ajout de données après la fin d'un secure_memory" #: src/libdar/secu_string.cpp:133 msgid "appending data after the end of a secure_memory" msgstr "ajout de données après la fin d'un secure_memory" #: src/libdar/secu_string.cpp:136 msgid "Cannot receive that much data in regard to the allocated memory" msgstr "" "Ne peut recevoir autant de donnée en regard de la place mémoire allouée" #: src/libdar/secu_string.cpp:154 msgid "Cannot reduce the string to a size that is larger than its current size" msgstr "" "Impossible de réduire la taille du chaîne à une valeur qui est plus grande " "que sa taille actuelle" #: src/libdar/secu_string.cpp:164 msgid "secu_string randomization requested exceeds storage capacity" msgstr "" "La requète de génération d'une chaîne sécurisée aléatoire dépasse sa " "capacité de stockage" #: src/libdar/secu_string.cpp:177 msgid "Out of range index requested for a secu_string" msgstr "Index hors limite demandé pour un secu_string" #: src/libdar/fichier_local.cpp:151 msgid "Error getting size of file: " msgstr "Erreur pendant l'obtention de la taille du fichier : " #: src/libdar/fichier_local.cpp:261 msgid "Error getting file reading position: " msgstr "Erreur lors de l'obtention de la position du fichier à lire : " #: src/libdar/fichier_local.cpp:293 src/libdar/fichier_local.cpp:295 msgid "Error while reading from file: " msgstr "Erreur lors de la lecture du fichier : " #: src/libdar/fichier_local.cpp:344 src/libdar/fichier_local.cpp:350 msgid "Error while writing to file: " msgstr "Erreur lors de l'enregistrement du fichier : " #: src/libdar/fichier_local.cpp:428 msgid "" "No space left for inode, you have the opportunity to make some room now. " "When done : can we continue ?" msgstr "" "Plus d'espace disponibles pour les inodes, vous avez la possibilité d'en " "faire maintenant. Quand ce sera fait, pouvons-nous continuer ?" #: src/libdar/fichier_local.cpp:437 msgid "Cannot open file : " msgstr "Impossible d'ouvrir le fichier : " #: src/libdar/fichier_local.cpp:460 #, c-format msgid "Cannot dup() filedescriptor while copying \"fichier_local\" object: %s" msgstr "" "Impossible de dup()liquer un descripteur pendant la copie d'un " "\"fichier_local\" : %s" #: src/libdar/generic_file.cpp:120 msgid "Reading ahead a write only generic_file" msgstr "Lecture par anticipation sur un \"generic_file\" en écriture seule" #: src/libdar/generic_file.cpp:135 msgid "Reading a write only generic_file" msgstr "Lecture sur un \"generic_file\" ouvert en écriture seule" #: src/libdar/generic_file.cpp:145 msgid "Writing to a read only generic_file" msgstr "\"Écriture sur un \"generic_file\" ouvert en lecture seule" #: src/libdar/generic_file.cpp:315 msgid "Cannot compare files in write only mode" msgstr "Impossible de comparer des fichiers ouverts en écriture seule" #: src/libdar/generic_file.cpp:402 msgid "Cannot sync write on a read-only generic_file" msgstr "" "Ne peut pas synchroniser l'écriture sur un generic_file en lecture seule" #: src/libdar/generic_file.cpp:413 msgid "Cannot flush read a write-only generic_file" msgstr "Ne peut pas purger la lecture d'un generic_file en écriture seule" #: src/libdar/generic_file.cpp:489 msgid "read only" msgstr "lecture seule" #: src/libdar/generic_file.cpp:492 msgid "write only" msgstr "écriture seule" #: src/libdar/generic_file.cpp:495 msgid "read and write" msgstr "lecture et écriture" #: src/libdar/header_version.cpp:74 msgid "LAX MODE: Failed to read the archive header's format version." msgstr "" "MODE RELAX : Échec de lecture de la version du format de l'en-tête de " "l'archive" #: src/libdar/header_version.cpp:77 #, c-format msgid "" "LAX MODE: Please provide the archive format: You can use the table at %s to " "find the archive format depending on the release version, (for example if " "this archive has been created using dar release 2.3.4 to 2.3.7 answer \"6\" " "without the quotes here): " msgstr "" "MODE RELAX : Merci d'indiquer le format de l'archive : Vous pouvez utiliser " "la table à l'URL %s pour trouver la version de format en fonction de la " "release de dar/libdar (par exemple si l'archive a été crée en utilisant une " "version de dar de 2.3.4 à 2.3.7 indiquer \"6\" sans les guillemets) : " #: src/libdar/header_version.cpp:82 #, c-format msgid "LAX MODE: \"%S\" is not a valid archive format" msgstr "MODE RELAX : \"%S\" n'est pas un format d'archive valide" #: src/libdar/header_version.cpp:88 #, c-format msgid "LAX MODE: Using archive format \"%d\"?" msgstr "MODE RELAX : Suivre le format d'archive \"%d\" ?" #: src/libdar/header_version.cpp:117 msgid "" "LAX MODE: Unknown compression algorithm used, assuming data corruption " "occurred. Please help me, answering with one of the following words \"none" "\", \"gzip\", \"bzip2\" or \"lzo\" at the next prompt:" msgstr "" "MODE RELAX : Un algorithme de compression inconnu a été utilisé, on suppose " "qu'une corruption des données a eu lieu. Merci de m'aider à déterminer le " "mode de compression qui a été utilisé en saisissant l'un des mots suivants " "\"aucun\", \"gzip\", \"bzip2\" ou \"lzo\" : " #: src/libdar/header_version.cpp:120 msgid "gzip" msgstr "gzip" #: src/libdar/header_version.cpp:122 msgid "bzip2" msgstr "bzip2" #: src/libdar/header_version.cpp:124 msgid "lzo" msgstr "lzo" #: src/libdar/header_version.cpp:131 src/libdar/header_version.cpp:139 #: src/libdar/header_version.cpp:150 src/libdar/header_version.cpp:168 msgid "Reached End of File while reading archive header_version data structure" msgstr "" "Fin de fichier atteinte pendant la lecture de la structure de données " "header_version" #: src/libdar/header_version.cpp:201 msgid "Corruption met while reading header_version data structure" msgstr "" "Corruption rencontrée lors de la lecture de la structure de donnée " "header_version" #: src/libdar/header_version.cpp:218 msgid "Missing data for encrypted symmetrical key" msgstr "Données absentes pour le chiffrement asymétrique des données" #: src/libdar/header_version.cpp:235 msgid "" "Error met while reading archive of reference slicing layout, ignoring this " "field and continuing" msgstr "" "Erreur lors de la lecture des informations de découpage de l'archive de " "référence. Erreur ignorée, on continue sans cette information" #: src/libdar/header_version.cpp:256 src/libdar/header_version.cpp:258 #: src/libdar/header_version.cpp:280 src/libdar/header_version.cpp:282 msgid "Consistency check failed for archive header" msgstr "Échec de la vérification de cohérence pour l'en-tête de l'archive" #: src/libdar/tronconneuse.cpp:61 #, c-format msgid "%d is not a valid block size" msgstr "%d n'est pas une taille valide" #: src/libdar/tronconneuse.cpp:439 src/libdar/crypto_sym.cpp:301 msgid "Data corruption may have occurred, cannot decrypt data" msgstr "" "Une corruption de données semble avoir eu lieu, impossible de déchiffrer les " "données" #: src/libdar/crypto.cpp:44 msgid "scrambling (weak encryption)" msgstr "scrambling (chiffrement faible)" #: src/libdar/crypto.cpp:102 msgid "Unknown crypto algorithm" msgstr "Algorithme de chiffrement inconnu" #: src/libdar/erreurs.cpp:131 #, c-format msgid "File %S line %d" msgstr "Fichier %S ligne %d" #: src/libdar/erreurs.cpp:131 msgid "it seems to be a bug here" msgstr "Il semble qu'il y ait un bogue ici" #: src/libdar/erreurs.cpp:160 #, c-format msgid "in file %S line %S" msgstr "dans le fichier %S ligne %S" #: src/libdar/erreurs.cpp:179 msgid "# UNEXPECTED EXCEPTION, #" msgstr "# EXCEPTION NON ATTENDUE, #" #: src/libdar/erreurs.cpp:180 src/libdar/erreurs.cpp:193 msgid "# E X I T I N G ! #" msgstr "# A B A N D O N ! #" #: src/libdar/erreurs.cpp:183 src/libdar/erreurs.cpp:196 msgid "" " THANKS TO REPORT THE PREVIOUS OUTPUT TO MAINTAINER\n" " GIVING A DESCRIPTION OF THE CIRCUMSTANCES." msgstr "" " MERCI DE REPORTER L'AFFICHAGE PRÉCÉDENT AU MAINTENEUR\n" " EN DONNANT UNE DESCRIPTION DES CIRCONSTANCES." #: src/libdar/erreurs.cpp:184 msgid "" " IF POSSIBLE TRY TO REPRODUCE THIS ERROR, A\n" " SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n" " IN SOLVING THIS PROBLEM. THANKS" msgstr "" " SI POSSIBLE ESSAYEZ DE REPRODUIRE L'ERREUR, UN\n" " SCÉNARIO QUI PERMET DE LA REPRODUIRE SERAIT UTILE\n" " POUR CORRIGER CE PROBLÈME. MERCI" #: src/libdar/erreurs.cpp:192 msgid "# NOT CAUGHT EXCEPTION, #" msgstr "# EXCEPTION NON ATTRAPÉE, #" #: src/libdar/erreurs.cpp:197 msgid "" " IF POSSIBLE TRY TO PRODUCE THIS ERROR, A\n" " SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n" " IN SOLVING THIS PROBLEM. THANKS" msgstr "" " SI POSSIBLE ESSAYEZ DE REPRODUIRE L'ERREUR, UN\n" " SCÉNARIO QUI PERMET DE LA REPRODUIRE SERAIT UTILE\n" " POUR CORRIGER CE PROBLÈME. MERCI" #: src/libdar/cat_entree.cpp:126 #, c-format msgid "" "\n" "CATALOGUE CONTENTS :\n" "\n" msgstr "" "\n" "CONTENU DU CATALOGUE :\n" "\n" #: src/libdar/cat_entree.cpp:127 #, c-format msgid "total number of inode : %i\n" msgstr "nombre total d'inode : %i\n" #: src/libdar/cat_entree.cpp:128 #, c-format msgid "saved inode : %i\n" msgstr "inode sauvegardée : %i\n" #: src/libdar/cat_entree.cpp:129 #, c-format msgid "distribution of inode(s)\n" msgstr "répartition des inodes\n" #: src/libdar/cat_entree.cpp:130 #, c-format msgid " - directories : %i\n" msgstr " - répertoires : %i\n" #: src/libdar/cat_entree.cpp:131 #, c-format msgid " - plain files : %i\n" msgstr " - fichiers normaux : %i\n" #: src/libdar/cat_entree.cpp:132 #, c-format msgid " - symbolic links : %i\n" msgstr " - liens symboliques : %i\n" #: src/libdar/cat_entree.cpp:133 #, c-format msgid " - named pipes : %i\n" msgstr " - tubes nommés : %i\n" #: src/libdar/cat_entree.cpp:134 #, c-format msgid " - unix sockets : %i\n" msgstr " - prises unix : %i\n" #: src/libdar/cat_entree.cpp:135 #, c-format msgid " - character devices : %i\n" msgstr " - fichiers spéciaux char : %i\n" #: src/libdar/cat_entree.cpp:136 #, c-format msgid " - block devices : %i\n" msgstr " - fichiers spéciaux bloc : %i\n" #: src/libdar/cat_entree.cpp:137 #, c-format msgid " - Door entries : %i\n" msgstr " - entrées Door : %i\n" #: src/libdar/cat_entree.cpp:138 #, c-format msgid "hard links information\n" msgstr "information sur les liens durs\n" #: src/libdar/cat_entree.cpp:139 #, c-format msgid " - number of inode with hard link : %i\n" msgstr " - nombre d'inode ayant des liens durs : %i\n" #: src/libdar/cat_entree.cpp:140 #, c-format msgid " - number of reference to hard linked inodes: %i\n" msgstr " - nombre de référence à des inodes ayant des liens durs : %i\n" #: src/libdar/cat_entree.cpp:141 #, c-format msgid "destroyed entries information\n" msgstr "information sur les entrées supprimées\n" #: src/libdar/cat_entree.cpp:142 #, c-format msgid "" " %i file(s) have been record as destroyed since backup of reference\n" "\n" msgstr "" " %i fichier(s) ont été enregistré(s) comme détruit(s) depuis la sauvegarde " "de référence\n" "\n" #: src/libdar/cat_entree.cpp:189 src/libdar/cat_entree.cpp:232 #: src/libdar/cat_entree.cpp:242 msgid "corrupted file" msgstr "fichier corrompu" #: src/libdar/cat_entree.cpp:234 msgid "" "LAX MODE: Unexpected saved status for end of directory entry, assuming data " "corruption occurred, ignoring and continuing" msgstr "" "MODE RELAX : état de sauvegarde inattendu pour une fin de répertoire, " "corruption des données probable et ignorée. On continue" #: src/libdar/cat_entree.cpp:244 msgid "" "LAX MODE: Unexpected saved status for class \"cat_detruit\" object, assuming " "data corruption occurred, ignoring and continuing" msgstr "" "MODE RELAX : état de sauvegarde inattendu pour un objet de la classe " "\"cat_detruit\", corruption de données probable et ignorée. On continue" #: src/libdar/cat_entree.cpp:253 msgid "unknown type of data in catalogue" msgstr "type de donnée inconnu dans le catalogue" #: src/libdar/cat_entree.cpp:256 msgid "" "LAX MODE: found unknown catalogue entry, assuming data corruption occurred, " "cannot read further the catalogue as I do not know the length of this type " "of entry" msgstr "" "MODE RELAX : Entrée inconnue dans le catalogue, corruption de données " "probable qui interdit de lire plus avant le contenu de l'archive car aucune " "la longueur de cet enregistrement n'est pas connue" #: src/libdar/cat_entree.cpp:307 msgid "unknown entry" msgstr "entrée inconnue" #: src/libdar/cat_entree.cpp:308 #, c-format msgid "Entry information CRC failure for %S. Ignore the failure?" msgstr "Erreur de CRC sur l'entrée %S. Ignorer l'erreur ?" #: src/libdar/cat_entree.cpp:314 #, c-format msgid "Entry information CRC failure for %S" msgstr "Erreur de CRC sur l'entrée %S" #: src/libdar/cat_entree.cpp:316 msgid "Entry information CRC failure" msgstr "Erreur de CRC sur l'information d'une entrée dans la table de contenu" #: src/libdar/etage.cpp:112 msgid "Error opening directory in furtive read mode: " msgstr "Erreur lors de l'ouverture d'un répertoire en mode furtif : " #: src/libdar/etage.cpp:116 #, c-format msgid "" "Could not open directory %s in furtive read mode (%s), using normal mode" msgstr "" "Échec lors de l'ouverture du répertoire %s en mode furtif (%s), ouverture en " "mode normal" #: src/libdar/etage.cpp:141 msgid "Error opening directory: " msgstr "Erreur lors de l'ouverture du répertoire : " #: src/libdar/etage.cpp:181 #, c-format msgid "" "Detected Cache Directory Tagging Standard for %s, the contents of that " "directory will not be saved" msgstr "" "Détection d'une marque de répertoire cache pour %s, le contenu de ce " "répertoire ne sera pas sauvegardé" #: src/libdar/entrepot_local.cpp:161 #, c-format msgid "Cannot remove file %s: " msgstr "Suppression du fichier %s impossible: " #: src/libdar/cat_tools.hpp:41 msgid "[--- REMOVED ENTRY ----]" msgstr "[-- ENTRÉE SUPPRIMÉE --]" #: src/libdar/archive_version.cpp:47 msgid "Archive version too high, use a more recent version of libdar" msgstr "" "Version d'archive trop élevé, utiliser une version plus récente de libdar" #: src/libdar/archive_version.cpp:77 msgid "Reached End of File while reading archive version" msgstr "Fin de fichier atteinte pendant la lecture de la version d'archive" #: src/libdar/archive_version.cpp:90 src/libdar/archive_version.cpp:99 msgid "Unexpected value while reading archive version" msgstr "Valeur inattendue pendant la lecture de la version d'archive" #: src/libdar/archive_version.cpp:97 msgid "Reached premature end of file while reading archive version" msgstr "Fin de fichier atteinte lors de la lecture de la version d'archive" #: src/libdar/cache.cpp:69 msgid "wrong value given as initial_size argument while initializing cache" msgstr "" "Mauvaise valeur donnée à \"initial_size\" lors de l'initialisation du cache" #: src/libdar/fsa_family.cpp:58 msgid "creation date" msgstr "date de création" #: src/libdar/fsa_family.cpp:60 msgid "append only" msgstr "ajout seul" #: src/libdar/fsa_family.cpp:62 msgid "compressed" msgstr "compressé" #: src/libdar/fsa_family.cpp:64 msgid "no dump flag" msgstr "drapeau no dump" #: src/libdar/fsa_family.cpp:66 msgid "immutable" msgstr "immutable" #: src/libdar/fsa_family.cpp:68 msgid "journalized" msgstr "journalisé" #: src/libdar/fsa_family.cpp:70 msgid "secure deletion" msgstr "suppression sécurisée" #: src/libdar/fsa_family.cpp:72 msgid "no tail merging" msgstr "pas d'ajout en fin" #: src/libdar/fsa_family.cpp:74 msgid "undeletable" msgstr "insuppressible" #: src/libdar/fsa_family.cpp:76 msgid "no atime update" msgstr "pas de mise à jour de atime" #: src/libdar/fsa_family.cpp:78 msgid "synchronous directory" msgstr "répertoire synchrone" #: src/libdar/fsa_family.cpp:80 msgid "synchronous update" msgstr "mise à jour synchrone" #: src/libdar/fsa_family.cpp:82 msgid "top of directory hierarchy" msgstr "sommet de hiérarchie de répertoires" #: src/libdar/filesystem_specific_attribute.cpp:665 msgid "Failed setting (opening) extX family FSA: " msgstr "Echec d'affectation (ouverture) des FSA extX: " #: src/libdar/filesystem_specific_attribute.cpp:678 msgid "Failed reading existing extX family FSA: " msgstr "Echec de lecture des FSA existant de la famille extX : " #: src/libdar/filesystem_specific_attribute.cpp:705 #: src/libdar/filesystem_specific_attribute.cpp:718 #: src/libdar/filesystem_specific_attribute.cpp:731 #: src/libdar/filesystem_specific_attribute.cpp:744 #: src/libdar/filesystem_specific_attribute.cpp:763 #: src/libdar/filesystem_specific_attribute.cpp:777 #: src/libdar/filesystem_specific_attribute.cpp:790 #: src/libdar/filesystem_specific_attribute.cpp:803 #: src/libdar/filesystem_specific_attribute.cpp:816 #: src/libdar/filesystem_specific_attribute.cpp:829 #: src/libdar/filesystem_specific_attribute.cpp:842 #: src/libdar/filesystem_specific_attribute.cpp:855 #, c-format msgid "" "Warning: FSA %s/%s support has not been found at compilation time, cannot " "restore it for inode %s" msgstr "" "Attention: le support des FSA %s/%s n'a pas été activé lors de la " "compilation. Impossible de le restaurer pour l'inode %s" #: src/libdar/filesystem_specific_attribute.cpp:900 msgid "Failed set extX family FSA: " msgstr "Echec d'affectation des FSA extX : " #: src/libdar/filesystem_specific_attribute.cpp:927 #, c-format msgid "" "Not setting FSA extX IMMUTABLE flags for %s due to of lack of capability" msgstr "" "Pas d'affectation du FSA extX IMMUTABLE pour %s à cause du défaut de " "privilège pour le faire" #: src/libdar/filesystem_specific_attribute.cpp:955 #, c-format msgid "" "Not setting FSA extX SYSTEM RESOURCE flags for %s due to of lack of " "capability" msgstr "" "Pas d'affectation du FSA extX SYSTEM RESOURCE pour %s à cause du défaut de " "privilège pour le faire" #: src/libdar/filesystem_specific_attribute.cpp:973 #, c-format msgid "" "Warning! %s Filesystem Specific Attribute support have not been activated at " "compilation time and could not be restored for %s" msgstr "" "Attention ! Le support des FSA %s n'a pas été activé lors de la compilation. " "Ces attributs ne peuvent être restaurés pour %s" #: src/libdar/filesystem_specific_attribute.cpp:993 #, c-format msgid "" "Birth Time attribute cannot be restored for %s because no FSA familly able " "to carry that attribute could be activated at compilation time." msgstr "" "L'attribut date de création ne peut pas être restauré pour %s car aucune " "famille de FSA capable de le supporté n'a été activée lors de la compilation." #: src/libdar/filesystem_specific_attribute.cpp:1158 msgid "Unexepected value for boolean FSA, data corruption may have occurred" msgstr "" "Valeur inattendue pour un FSA boolean, une corruption de données est peut-" "être survenue" #: src/libdar/filesystem_specific_attribute.cpp:1162 msgid "Error while reading FSA: " msgstr "Erreur lors de la lecture des FSA : " #: src/libdar/data_tree.cpp:99 msgid "reached End of File before all expected data could be read" msgstr "" "Fin de fichier atteinte alors que toutes les données n'ont pu être lues" #: src/libdar/data_tree.cpp:115 msgid "Unexpected value found in database" msgstr "Valeur inattendue trouvée dans la base" #: src/libdar/data_tree.cpp:628 #, c-format msgid "" "Archive number | Data | status || EA " "| status \n" msgstr "" "Numéro d'archive | Données | statut || Attributs " "Étendus | statut\n" #: src/libdar/data_tree.cpp:629 #, c-format msgid "" "---------------+-------------------------+--------++-------------------------" "+----------\n" msgstr "" "-----------------+------------------------+--------+" "+---------------------------+------------\n" #: src/libdar/data_tree.cpp:846 #, c-format msgid "" "Dates of file's %S are not increasing when database's archive number grows. " "Concerned file is: %S" msgstr "" "Les dates de %S ne sont pas croissante avec le numéro des archives. Fichier " "concerné : %S" #: src/libdar/data_tree.cpp:849 msgid "" "Dates are not increasing for all files when database's archive number grows, " "working with this database may lead to improper file's restored version. " "Please reorder the archive within the database in the way that the older is " "the first archive and so on up to the most recent archive being the last of " "the database" msgstr "" "Les dates ne croissent pas avec le numéro des archives pour tous les " "fichiers, l'utilisation de cette base de donnée peut conduire à la " "restauration d'une mauvaise version d'un tel fichier. S'il s'agit d'une " "erreur d'ordonnancement des archives dans la base, il est recommandé de le " "corriger afin d'avoir les archives les plus anciennes aux numéros les plus " "petits et les plus récentes aux numéros les plus grands " #: src/libdar/data_tree.cpp:852 msgid "Do you want to ignore the same type of error for other files?" msgstr "" "Voulez-vous ignorer le même type d'erreur pour les prochains fichiers ?" #: src/libdar/data_tree.cpp:889 msgid "Unexpected end of file" msgstr "Fin de fichier inattendue" #: src/libdar/data_tree.cpp:1105 msgid "" "This database has been corrupted probably due to a bug in release 2.4.0 to " "2.4.9, and it has not been possible to cleanup this corruption, please " "rebuild the database from archives or extracted \"catalogues\", if the " "database has never been used by one of the previously mentioned released, " "you are welcome to open a bug report and provide as much as possible details " "about the circumstances" msgstr "" "Cette base de donnée a été corrompue probablement à cause d'un bogue présent " "dans les versions 2.4.0 à 2.4.9, et il n'a pas été possible de corriger " "cette corruption. Merci de reconstruire cette base à partir des archives (ou " "catalogues extraits). Si cette base n'a jamais été utilisée avec l'une " "quelconque des versions mentionnées précédemment, merci d'ouvrir un rapport " "de bogue en fournissant le plus de détails concernant les circonstances de " "ce problème." #: src/libdar/data_tree.cpp:1187 msgid "[ Saved ]" msgstr "[ Sauvé ]" #: src/libdar/data_tree.cpp:1189 src/libdar/data_tree.cpp:1194 msgid "[ ]" msgstr "[ ]" #: src/libdar/data_tree.cpp:1192 msgid "[ EA ]" msgstr "[Attrib.]" #: src/libdar/data_tree.cpp:1415 msgid "Unknown record type" msgstr "Type d'enregistrement inconnu" #: src/libdar/data_tree.cpp:1449 msgid "removed " msgstr "supprimé " #: src/libdar/data_tree.cpp:1450 msgid "present " msgstr "présent " #: src/libdar/data_tree.cpp:1451 msgid "saved " msgstr "sauvé " #: src/libdar/data_tree.cpp:1452 msgid "absent " msgstr "absent " #: src/libdar/criterium.cpp:137 msgid "cannot evaluate an empty chain in an overwriting policy" msgstr "ne peut pas évaluer une chaîne vide comme politique d'écrasement" #: src/libdar/criterium.cpp:567 msgid "" "Cannot evaluate this crit_and criterium as no criterium has been added to it" msgstr "" "Ne peut pas évaluer cet objet crit_and car aucun autre objet criterium n'y a " "été ajouté" #: src/libdar/criterium.cpp:636 msgid "" "Cannot evaluate this crit_or criterium as no criterium has been added to it" msgstr "" "Ne peut pas évaluer cet objet crit_or car aucun autre objet criterium n'y a " "été ajouté" #: src/libdar/criterium.cpp:669 src/libdar/criterium.cpp:740 #: src/libdar/criterium.cpp:820 #, c-format msgid "" "Conflict found while selecting the file to retain in the resulting archive:" msgstr "" "Conflit lors de la sélection du fichier à conserver dans l'archive " "résultante : " #: src/libdar/criterium.cpp:670 #, c-format msgid "User Decision requested for data of file %S" msgstr "Décision de l'utilisateur requise pour les données de %S" #: src/libdar/criterium.cpp:673 msgid "" "\n" "Your decision about file's data:\n" "[P]reserve\n" "[O]verwrite\n" "mark [S]aved and preserve\n" "mark saved and overwri[T]e\n" "[R]emove\n" "[*] keep undefined\n" "[A]bort\n" " Your Choice? " msgstr "" "\n" "Votre décision à propos des données du fichier :\n" "[P] préserver\n" "[O] écraser\n" "[S] marquer comme déjà sauvé et préserver\n" "[T] marquer comme déjà sauvé et écraser\n" "[R] supprimer l'entrée\n" "[*] laisser non défini\n" "[A] arrêter l'opération\n" " Votre choix ?" #: src/libdar/criterium.cpp:675 src/libdar/criterium.cpp:746 #: src/libdar/criterium.cpp:826 msgid "" "Please answer by the character between brackets ('[' and ']') and press " "return" msgstr "" "Merci de répondre avec un des caractères entre crochets et appuyer sur " "\"entrée\"" #: src/libdar/criterium.cpp:705 src/libdar/criterium.cpp:784 #: src/libdar/criterium.cpp:852 #, c-format msgid "" "Warning, are you sure you want to abort (please answer \"%S\" to confirm)? " msgstr "" "Attention, êtes-vous sûr de vouloir arrêter (répondre \"%S\" pour confirmer)?" #: src/libdar/criterium.cpp:709 src/libdar/criterium.cpp:788 #: src/libdar/criterium.cpp:856 msgid "Cancellation no confirmed" msgstr "Arrêt non confirmé" #: src/libdar/criterium.cpp:712 src/libdar/criterium.cpp:791 #: src/libdar/criterium.cpp:859 msgid "Unknown choice: " msgstr "Choix inconnu : " #: src/libdar/criterium.cpp:741 #, c-format msgid "User Decision requested for EA of file %S" msgstr "Décision de l'utilisateur requise pour les AE du fichier %S" #: src/libdar/criterium.cpp:744 msgid "" "\n" "Your decision about file's EA:\n" "[p]reserve\n" "[o]verwrite\n" "mark [s]aved and preserve\n" "mark saved and overwri[t]e\n" "[m]erge EA and preserve\n" "merge EA a[n]d overwrite\n" "[r]emove\n" "[*] keep undefined\n" "[a]bort\n" " Your choice? " msgstr "" "\n" "Votre décision pour les AE du fichier :\n" "[p] préserver\n" "[o] écraser\n" "[s] marquer comme déjà sauvé et préserver\n" "[t] marquer comme déjà sauvé et écraser\n" "[m] fusionner les EA et préserver\n" "[n] fusionner les EA et écraser\n" "[r] supprimer tous les EA\n" "[*] laisser l'action non définie\n" "[a] arrêter l'opération\n" " Votre choix ? " #: src/libdar/criterium.cpp:821 #, c-format msgid "User Decision requested for FSA of file %S" msgstr "Décision de l'utilisateur requise pour les FSA du fichier %S" #: src/libdar/criterium.cpp:824 msgid "" "\n" "Your decision about file's FSA:\n" "[p]reserve\n" "[o]verwrite\n" "mark [s]aved and preserve\n" "mark saved and overwri[t]e\n" "[*] keep undefined\n" "[a]bort\n" " Your choice? " msgstr "" "\n" "Votre décision à propos des FSA du fichier :\n" "[p] préserver\n" "[o] écraser\n" "marquer comme déjà [s]auvé et préserver\n" "[t] marquer comme déjà sauvé et écraser\n" "[*] laisser non défini\n" "[a]rrêter l'opération\n" " Votre choix ?" #: src/libdar/criterium.cpp:893 #, c-format msgid "Entry information:\t\"in place\"\t\"to be added\"" msgstr "Informations sur les entrées :\t\"en place\"\t\"à ajouter\"" #: src/libdar/criterium.cpp:894 #, c-format msgid "Is inode :\t %S \t\t %S" msgstr "Est une inode :\t %S \t\t %S" #: src/libdar/criterium.cpp:895 #, c-format msgid "Is directory :\t %S \t\t %S" msgstr "Est un répertoire :\t %S \t\t %S" #: src/libdar/criterium.cpp:896 #, c-format msgid "Is plain file :\t %S \t\t %S" msgstr "Est un fichier :\t %S \t\t %S" #: src/libdar/criterium.cpp:897 #, c-format msgid "Is hard linked :\t %S \t\t %S" msgstr "Est un lien dur :\t %S \t\t %S" #: src/libdar/criterium.cpp:898 #, c-format msgid "Entry type :\t %s \t %s" msgstr "Type d'entrée :\t %s \t %s" #: src/libdar/criterium.cpp:902 msgid "me" msgstr "moi" #: src/libdar/criterium.cpp:911 #, c-format msgid "Data more recent :\t %S \t\t %S" msgstr "Données plus récentes :\t %S \t\t %S" #: src/libdar/criterium.cpp:921 #, c-format msgid "Data size :\t %i \t\t %i" msgstr "Taille des données :\t %i \t\t %i" #: src/libdar/criterium.cpp:922 #, c-format msgid "Sparse file :\t %S \t\t %S" msgstr "Fichier à trou :\t %S \t\t %S" #: src/libdar/criterium.cpp:923 #, c-format msgid "Dirty file :\t %S \t\t %S" msgstr "Inode sale :\t %S \t\t %S" #: src/libdar/criterium.cpp:925 #, c-format msgid "Data full saved :\t %S \t\t %S" msgstr "Données sauvées :\t %S \t\t %S" #: src/libdar/criterium.cpp:926 #, c-format msgid "EA full saved :\t %S \t\t %S" msgstr "Attributs Étendus sauvés :\t %S \t\t %S" #: src/libdar/criterium.cpp:928 #, c-format msgid "EA more recent :\t %S \t\t %S" msgstr "Attr. Etend. plus récents :\t %S \t\t %S" #: src/libdar/criterium.cpp:929 #, c-format msgid "FSA full saved :\t %S \t\t %S" msgstr "FSA sauvés complètement :\t %S \t\t %S" #: src/libdar/criterium.cpp:934 #, c-format msgid "FSA familly :\t %S \t\t %S" msgstr "Famille de FSA :\t %S \t\t %S" #: src/libdar/criterium.cpp:943 #, c-format msgid "EA number :\t %i \t\t %i" msgstr "Nombre d'Attributs Étendus :\t %i \t\t %i" #: src/libdar/criterium.cpp:946 #, c-format msgid "EA size :\t %i \t\t %i" msgstr "Taille totale des Attr. Eten.:\t %i \t\t %i" #: src/libdar/criterium.cpp:965 msgid "directory" msgstr "répertoire" #: src/libdar/criterium.cpp:969 src/libdar/cat_tools.cpp:387 msgid "hard linked inode" msgstr "inode liée en dur" #: src/libdar/criterium.cpp:971 msgid "plain file" msgstr "fichier plein" #: src/libdar/criterium.cpp:973 msgid "soft link" msgstr "lien symbolique" #: src/libdar/criterium.cpp:975 src/libdar/cat_tools.cpp:372 msgid "char device" msgstr "fichier spécial caractère" #: src/libdar/criterium.cpp:977 src/libdar/cat_tools.cpp:375 msgid "block device" msgstr "fichier spécial bloc" #: src/libdar/criterium.cpp:979 msgid "named pipe" msgstr "tube nommé" #: src/libdar/criterium.cpp:981 msgid "unix socket" msgstr "prise unix" #: src/libdar/criterium.cpp:983 msgid "deleted entry" msgstr "entrée supprimée" #: src/libdar/criterium.cpp:985 msgid "door inode" msgstr "inode Porte" #: src/libdar/cat_lien.cpp:97 msgid "symbolic link does not point to the same target: " msgstr "le lien symbolique ne pointe pas sur la même cible: " #: src/libdar/sparse_file.cpp:157 msgid "Incoherent structure in data carrying sparse files: unknown mark" msgstr "" "Incohérence dans la structure de données gérant les fichiers à trou : marque " "inconnue" #: src/libdar/sparse_file.cpp:311 msgid "Cannot skip forward to restore a hole" msgstr "Ne peut peut aller plus loin pour restaurer un trou" #: src/libdar/sparse_file.cpp:325 msgid "Data corruption or unknown sparse_file mark found in file's data" msgstr "" "Corruption de donnée ou mark inconnue au sein des données d'un fichier à trou" #: src/libdar/trivial_sar.cpp:188 #, c-format msgid "%S already exists, and overwritten is forbidden, aborting" msgstr "%S existe déjà et l'écrasement est interdit, j'abandonne" #: src/libdar/trivial_sar.cpp:190 #, c-format msgid "%S is about to be overwritten, continue ?" msgstr "%S est sur le point d'être écrasé, on continue ?" #: src/libdar/trivial_sar.cpp:213 src/libdar/trivial_sar.cpp:226 #: src/libdar/sar.cpp:1081 src/libdar/sar.cpp:1151 src/libdar/sar.cpp:1161 #, c-format msgid "Failed creating slice %S: " msgstr "Impossible de créer la tranche %S : " #: src/libdar/trivial_sar.cpp:449 msgid "This archive has slices and is not possible to read from a pipe" msgstr "" "Cette archive est constituée de plusieurs tranches et ne peut pas être lue " "depuis un tube" #: src/libdar/trivial_sar.cpp:486 msgid "" "This archive is not single sliced, more data exists in the next slices but " "cannot be read from the current pipe, aborting" msgstr "" "Cette archive est constituée de plusieurs tranches et ne peut pas être lue " "depuis un tube" #: src/libdar/trivial_sar.cpp:524 msgid "Cannot skip to a valid position in file" msgstr "Impossible de se positionner à un endroit valide dans le fichier" #: src/libdar/cat_tools.cpp:120 msgid "[DIRTY]" msgstr "[SALE ]" #: src/libdar/cat_tools.cpp:122 src/libdar/cat_tools.cpp:138 msgid "[Saved]" msgstr "[Sauvé]" #: src/libdar/cat_tools.cpp:125 src/libdar/cat_tools.cpp:141 msgid "[InRef]" msgstr "[EnRef]" #: src/libdar/cat_tools.cpp:354 msgid "ignored directory" msgstr "répertoire ignoré" #: src/libdar/cat_tools.cpp:357 msgid "folder" msgstr "répertoire" #: src/libdar/cat_tools.cpp:360 msgid "deleted file" msgstr "entrée supprimée" #: src/libdar/cat_tools.cpp:363 msgid "door" msgstr "porte" #: src/libdar/cat_tools.cpp:366 msgid "file" msgstr "fichier" #: src/libdar/cat_tools.cpp:369 msgid "symlink" msgstr "lien symbolique" #: src/libdar/cat_tools.cpp:378 msgid "pipe" msgstr "tube nommé" #: src/libdar/cat_tools.cpp:381 msgid "socket" msgstr "prise unix" #: src/libdar/cat_tools.cpp:384 msgid "ignored entry" msgstr "entrée ignorée" #: src/libdar/cat_tools.cpp:390 msgid "end of directory" msgstr "fin de répertoire" #: src/libdar/label.cpp:123 msgid "Incomplete label" msgstr "label incomplet" #: src/libdar/tuyau.cpp:143 msgid "Error while creating anonymous pipe: " msgstr "Erreur lors de la création d'un tube anonyme : " #: src/libdar/tuyau.cpp:171 msgid "Pipe's other end is not known, cannot provide a filedescriptor on it" msgstr "" "L'autre extrémité du tube est inconnue, impossible d'en fournir un " "descripteur de fichier" #: src/libdar/tuyau.cpp:185 msgid "" "Pipe's other end is not known, cannot close any filedescriptor pointing on it" msgstr "" "L'autre extrémité du tube est inconnue, impossible de fermer un quelconque " "descripteur de fichier pointant dessus" #: src/libdar/tuyau.cpp:312 msgid "Error while reading from pipe: " msgstr "Erreur lors de la lecture depuis un tube : " #: src/libdar/tuyau.cpp:366 src/libdar/tuyau.cpp:371 msgid "Error while writing data to pipe: " msgstr "Erreur lors de l'écriture sur un tube : " #: src/libdar/tuyau.cpp:368 src/libdar/fichier_global.cpp:107 msgid "" "No space left on device, you have the opportunity to make room now. When " "ready : can we continue ?" msgstr "" "Plus d'espace disque disponible, vous avez la possibilité d'en faire " "maintenant. Quand ce sera fait, pouvons-nous continuer ?" #: src/libdar/tuyau.cpp:422 msgid "Error opening pipe: " msgstr "Erreur lors de l'ouverture du tube : " #: src/libdar/tuyau.cpp:511 msgid "File mode is neither read nor write" msgstr "Le mode d'ouverture du fichier n'est ni en lecture ni en écriture" #: src/libdar/slice_layout.cpp:52 msgid "Missing data while reading slice_layout object" msgstr "Défaut de données lors de la lecture d'un object slice_layout" #: src/libdar/escape.cpp:137 msgid "" "Adding an explicit escape sequence of type seqt_not_a_sequence is forbidden" msgstr "" "L'ajout explicite d'une séquence d'échappement de type seqt_not_a_sequence " "est interdit" #: src/libdar/escape.cpp:839 msgid "Unknown escape sequence type" msgstr "Type de séquence d'échappement inconnue" #: src/libdar/semaphore.cpp:127 msgid "Error while converting UID/GID to string for backup hook file: " msgstr "" "Erreur lors de la conversion UID/GID en chaîne pour le crochet d'exécution " "lors de la sauvegarde d'un fichier" #: src/libdar/catalogue.cpp:148 src/libdar/catalogue.cpp:166 #: src/libdar/catalogue.cpp:168 msgid "incoherent catalogue structure" msgstr "structure incohérente du catalogue" #: src/libdar/catalogue.cpp:159 msgid "" "LAX MODE: catalogue label does not match archive label, as if it was an " "extracted catalogue, assuming data corruption occurred and fixing the " "catalogue to be considered an a plain internal catalogue" msgstr "" "MODE RELAX : l'étiquette du catalogue ne correspond pas à celle de " "l'archive, comme s'il s'agissait d'un catalogue isolé, on suppose qu'une " "corruption a eu lieu et que le catalogue est une catalogue normal interne à " "l'archive" #: src/libdar/catalogue.cpp:211 msgid "CRC failed for table of contents (aka \"catalogue\")" msgstr "Erreur de CRC pour le catalogue" #: src/libdar/catalogue.cpp:213 msgid "" "LAX MODE: CRC failed for catalogue, the archive contents is corrupted. This " "may even lead dar to see files in the archive that never existed, but this " "will most probably lead to other failures in restoring files. Shall we " "proceed anyway?" msgstr "" "MODE RELAX : erreur de CRC pour le catalogue, le contenu de l'archive est " "corrompu. Ceci peut même amener dar à voir des fichiers dans l'archive qui " "n'ont jamais existé, mais conduira plus probablement à d'autres échecs lors " "de la restauration des fichiers. Doit-on poursuivre malgré tout ?" #: src/libdar/catalogue.cpp:272 msgid "root does not have a parent directory" msgstr "la racine n'a pas de répertoire père" #: src/libdar/catalogue.cpp:312 msgid "no current directory defined" msgstr "aucun répertoire courant défini" #: src/libdar/catalogue.cpp:316 msgid "root directory has no parent directory" msgstr "la racine n'a pas de répertoire père" #: src/libdar/catalogue.cpp:338 msgid "no current reading directory defined" msgstr "aucun répertoire courant défini pour la lecture" #: src/libdar/catalogue.cpp:410 src/libdar/catalogue.cpp:424 msgid " is not present in the archive" msgstr " n'est pas présent dans l'archive" #: src/libdar/catalogue.cpp:502 msgid "Cannot recurs in a non directory entry" msgstr "" "Impossible de poursuivre la récursion dans une entrée qui n'est pas un " "répertoire" #: src/libdar/catalogue.cpp:505 msgid "" "The entry to recurs in does not exist, cannot add further entry to that " "absent subdirectory" msgstr "" "L'entrée dans laquelle poursuivre la récursion n'existe pas. Impossible " "d'ajouter celle-ci à un répertoire absent" #: src/libdar/catalogue.cpp:574 msgid "root has no parent directory" msgstr "la racine n'a pas de répertoire père" #: src/libdar/catalogue.cpp:933 #, c-format msgid "" "Access mode | User | Group | Size | Date | " "[Data ][ EA ][FSA][Compr][S]| Filename\n" msgstr "" "droit d'accès |propr.|groupe |taille | date | " "[donnée][ EA ][FSA][compr][S]| nom de fichier\n" #: src/libdar/catalogue.cpp:978 #, c-format msgid "%S [%c] [ REMOVED ENTRY ] (%S) %S\n" msgstr "%S [%c] [ ENTREÉ SUPPR. ] (%S) %S\n" #: src/libdar/catalogue.cpp:1009 src/libdar/catalogue.cpp:1142 msgid " Extended Attribute: [" msgstr " Attribut Étendu : [" #: src/libdar/catalogue.cpp:1048 #, c-format msgid "" "[Data ][ EA ][FSA][Compr][S]| Permission | User | Group | Size | " "Date | filename\n" msgstr "" "[Data ][ EA ][FSA][compr][S]| accès |proprio |groupe |taille " "| date | nom de fichier\n" #: src/libdar/datetime.cpp:305 msgid "Unknown time unit" msgstr "Unité de temps inconnue" #: src/libdar/libdar.cpp:155 msgid "Caught an unknown Egeneric exception: " msgstr "Une exception Egeneric inconnue a été interceptée : " #: src/libdar/libdar.cpp:160 msgid "Caught a none libdar exception" msgstr "Une exception non \"libdar\" a été interceptée" #: src/libdar/libdar.cpp:272 msgid "Invald nullptr argument given to 'ptr'" msgstr "valeur nullptr donnée à \"ptr\"" #: src/libdar/libdar.cpp:319 msgid "Invalid nullptr pointer given to close_archive" msgstr "valeur nullptr donnée à \"close_archive\"" #: src/libdar/libdar.cpp:358 msgid "Initialization problem for liblzo2 library" msgstr "Problème d'initialisation pour la bibliothèque liblzo2" #: src/libdar/libdar.cpp:375 src/libdar/libdar.cpp:397 #, c-format msgid "Too old version for libgcrypt, minimum required version is %s\n" msgstr "" "Version trop ancienne pour libgcrypt, la version minimale requise est %s\n" #: src/libdar/libdar.cpp:384 #, c-format msgid "Error while activating libgcrypt's memory guard: %s/%s" msgstr "Erreur lors de l'activation du garde de mémoire de libgcrypt : %s/%s" #: src/libdar/libdar.cpp:388 #, c-format msgid "Error while telling libgcrypt that initialization is finished: %s/%s" msgstr "" "Erreur lors de la communication à libgcrypt que l'initialisation est " "terminée : %s/%s" #: src/libdar/libdar.cpp:393 msgid "libgcrypt not initialized and libdar not allowed to do so" msgstr "" "libgcrypt n'a pas été initialisée et libdar n'est pas autorisé à le faire" #: src/libdar/libdar.cpp:404 #, c-format msgid "GPGME version requirement is not satisfied, requires version > %s" msgstr "" "prérequis insatisfait pour GPGME, une version supérieure à %s est nécessaire" #: src/libdar/libdar.cpp:408 #, c-format msgid "GPGME engine not available: %s" msgstr "le moteur GPGME n'est pas disponible: %s" #: src/libdar/libdar.cpp:441 src/libdar/libdar.cpp:461 #: src/libdar/libdar.cpp:480 src/libdar/libdar.cpp:502 #: src/libdar/libdar.cpp:522 msgid "Invalid nullptr argument given to 'ptr'" msgstr "valeur nullptr donnée à \"ptr\"" #: src/libdar/compressor.cpp:171 src/libdar/compressor.cpp:199 msgid "" "incompatible compression library version or unsupported feature required " "from compression library" msgstr "" "version incompatible de la bibliothèque de compression ou fonctionnalité " "requises incompatible aveec cette bibliothèque" #: src/libdar/compressor.cpp:329 msgid "compressed data is corrupted" msgstr "données compressées corrompues" #: src/libdar/compressor.cpp:465 msgid "compressed data CRC error" msgstr "erreur de CRC sur les données compressées" #: src/libdar/compressor.cpp:552 src/libdar/compressor.cpp:582 #: src/libdar/compressor.cpp:722 src/libdar/compressor.cpp:787 msgid "lzo compression" msgstr "compression lzo" #: src/libdar/compressor.cpp:708 #, c-format msgid "Probable bug in liblzo2: lzo1x_*_compress returned unexpected code %d" msgstr "" "Bogue probable dans liblzo2 : lzo1x_*_compress a retourné un code non " "prévu : %d" #: src/libdar/compressor.cpp:743 msgid "data corruption detected: Incoherence in LZO compressed data" msgstr "" "Corruption de données détectée : incohérence dans les données compressées en " "LZO" #: src/libdar/compressor.cpp:747 src/libdar/compressor.cpp:769 #: src/libdar/compressor.cpp:783 msgid "compressed data corruption detected" msgstr "données compressées corrompues" #: src/libdar/compressor.cpp:757 msgid "data corruption detected: Too large block of compressed data" msgstr "" "Corruption de données détectée : Bloc de données compressées trop grand" #: src/libdar/compressor.cpp:759 msgid "" "Too large block of compressed data: Either due to data corruption or current " "system limitation where SSIZE_MAX value implied smaller buffers than required" msgstr "" "Bloc de données compressées trop grand : Soit à cause d'une corruption de " "données soit à cause d'une limitation système où la valeur de SSIZE_MAX " "implique un tampon mémoire plus petit que celui requis" #: src/libdar/compressor.cpp:818 src/libdar/compressor.cpp:837 #: src/libdar/compressor.cpp:856 msgid "unknown compression" msgstr "compression inconnue" #: src/libdar/compressor.cpp:874 #, c-format msgid "unknown compression algorithm: %S" msgstr "algorithme de compression inconnue : %S" #: src/libdar/macro_tools.cpp:136 msgid "Locating archive contents..." msgstr "Localisation du contenu de l'archive ..." #: src/libdar/macro_tools.cpp:148 msgid "Reading archive contents..." msgstr "Lecture du contenu de l'archive ..." #: src/libdar/macro_tools.cpp:185 msgid "Missing catalogue in file." msgstr "Pas de catalogue dans le fichier." #: src/libdar/macro_tools.cpp:285 msgid "" "LAX MODE: catalogue computed hash does not match the signed hash of the " "archive, ignoring" msgstr "" "LAX MODE: le hashage du catalogue ne correspond pas au hashage signé de " "l'archive, erreur ignorée" #: src/libdar/macro_tools.cpp:287 msgid "" "Catalogue computed hash does not match the signed hash of the archive, " "archive has been modified since it was signed!" msgstr "" "Le hashage du catalogue ne correspond pas au hashage signé de l'archive, " "l'archive a été modifiée depuis sa création !" #: src/libdar/macro_tools.cpp:316 msgid "Cannot open catalogue: " msgstr "Ouverture du catalogue impossible : " #: src/libdar/macro_tools.cpp:390 msgid "Opening standard input to read the archive..." msgstr "Ouverture de l'entrée standard pour lire l'archive ..." #: src/libdar/macro_tools.cpp:398 #, c-format msgid "Opening named pipe %S as input to read the archive..." msgstr "Ouverture du tube nommé %S comme source pour lire l'archive ..." #: src/libdar/macro_tools.cpp:411 #, c-format msgid "" "Opening a pair of pipes to read the archive, expecting dar_slave at the " "other ends..." msgstr "" "Ouverture d'une paire de tubes pour lire l'archive, dar_slave doit être " "utilisé à l'autre extrémité de ces tubes ..." #: src/libdar/macro_tools.cpp:441 msgid "Opening the archive using the multi-slice abstraction layer..." msgstr "Ouverture de l'archive par la couche d'abstraction des tranches..." #: src/libdar/macro_tools.cpp:470 msgid "Reading the archive header..." msgstr "Lecture de l'en-tête de l'archive ..." #: src/libdar/macro_tools.cpp:472 msgid "Reading the archive trailer..." msgstr "Lecture de la fin de l'archive ..." #: src/libdar/macro_tools.cpp:496 #, c-format msgid "" "Error while reading archive's header, this may be because this archive is an " "old encrypted archive or that data corruption took place, Assuming it is an " "old archive, we have to read the header at the beginning of the first " "slice..." msgstr "" "Erreur lors de l'ouverture de l'en-tête de l'archive. Ce peut être dû à une " "ancienne archive chiffrée ou à une corruption de l'archive. On supposons " "qu'il s'agit d'une ancienne archive, pour laquelle pour laquelle l'en-tête " "n'est présent qu'au début de la première tranche ..." #: src/libdar/macro_tools.cpp:507 msgid "" "Found a correct archive header at the beginning of the archive, which does " "not stands to be an old archive, the end of the archive is corrupted and " "thus the catalogue is not readable, aborting. Either retry providing in " "addition an isolated catalogue of that archive to perform the operation, or " "try reading the archive in sequential mode or try in lax mode or, last " "chance, try both lax and sequential read mode at the same time" msgstr "" "Un en-tête d'archive a bien été trouvé en début d'archive, il n'indique pas " "que l'archive est d'un ancien format, la fin de l'archive est donc bel et " "bien corrompue. Arrêt de l'opération. Vous avez la possibilité soit de " "fournir une catalogue isolé en complément de cette archive soit de tenter " "une lecture séquentielle soit essayer le mode \"relax\" soit comme dernière " "chance à la fois le mode \"relax\" et la lecture sequentielle" #: src/libdar/macro_tools.cpp:509 msgid "" "Found a correct archive header at the beginning of the archive, which does " "not stands to be an old archive, the end of the archive is thus corrupted. " "Without external catalogue provided and as we do not read the archive in " "sequential mode, there is very little chance to retreive something from this " "corrupted archive. Do we continue anyway ?" msgstr "" "Un en-tête d'archive a bien été trouvé en début d'archive, il n'indique pas " "que l'archive est d'un ancien format, la fin de l'archive est donc bel et " "bien corrompue. Sans l'aide d'un catalogue externe de cette archive et comme " "nous ne procédons pas à une lecture sequentielle, il n'y a que peu de chance " "d'arriver à extraire quelque chose de cette archive corrompue. On continue " "quand même ?" #: src/libdar/macro_tools.cpp:518 #, c-format msgid "Opening construction layer..." msgstr "Ouverture d'une couche de construction ..." #: src/libdar/macro_tools.cpp:534 msgid "Considering cyphering layer..." msgstr "Considération d'une couche de chiffrement ..." #: src/libdar/macro_tools.cpp:543 msgid "" "LAX MODE: Archive seems to be ciphered, but you did not have provided any " "encryption algorithm, assuming data corruption and considering that the " "archive is not ciphered" msgstr "" "MODE RELAX : L'archive semble chiffrée, mais aucun algorithme de chiffrement " "n'a été fourni, on suppose qu'il s'agit d'une corruption des données et " "qu'en fait l'archive n'est pas chiffrée" #: src/libdar/macro_tools.cpp:546 #, c-format msgid "" "The archive %S is encrypted and no encryption cipher has been given, cannot " "open archive." msgstr "" "L'archive %S est chiffrée mais aucune algorithme de chiffrement n'a été " "donné. Ouverture de l'archive impossible." #: src/libdar/macro_tools.cpp:577 msgid "" "WARNING: support for secure memory was not available at compilation time, in " "case of heavy memory load, this may lead the password you are about to " "provide to be wrote to disk (swap space) in clear. You have been warned!" msgstr "" "ATTENTION : le support pour la mémoire sécurisé n'a pas été disponible lors " "de la compilation. En case d'utilisation importante de la mémoire, le mot de " "passe sur le point d'être fourni peut être écrit sur disque en clair " "(fichier d'échange). Vous avez été prévenu !" #: src/libdar/macro_tools.cpp:578 src/libdar/macro_tools.cpp:1312 #, c-format msgid "Archive %S requires a password: " msgstr "L'archive %S nécessite un mot de passe : " #: src/libdar/macro_tools.cpp:587 msgid "No cyphering layer opened, adding cache layer for better performance" msgstr "" "Aucune couche de chiffrement n'a été ouverte. Ajout d'une couche de cache " "pour améliorer les performances" #: src/libdar/macro_tools.cpp:593 msgid "" "Failed opening the cache layer, lack of memory, archive read performances " "will not be optimized" msgstr "" "Echec de l'ouverture de la couche de cache, faute de mémoire disponible, " "l'archive sera lue sans optimisation des performances" #: src/libdar/macro_tools.cpp:598 msgid "No cyphering layer opened" msgstr "Aucune couche de chiffrement ouverte" #: src/libdar/macro_tools.cpp:607 src/libdar/macro_tools.cpp:651 msgid "Opening cyphering layer..." msgstr "Ouverture d'une couche de chiffrement ..." #: src/libdar/macro_tools.cpp:658 msgid "Unknown encryption algorithm" msgstr "Algorithme de chiffrement inconnu" #: src/libdar/macro_tools.cpp:678 src/libdar/macro_tools.cpp:1419 msgid "Creating a new thread to run the previously created layers..." msgstr "" "Création d'une nouvelle file pour exécuter les couches précédemment " "créées ..." #: src/libdar/macro_tools.cpp:698 msgid "Opening escape sequence abstraction layer..." msgstr "Ouverture d'une couche de gestion des séquences d'échappement ..." #: src/libdar/macro_tools.cpp:703 msgid "" "LAX MODE: Archive is flagged as having escape sequence (which is normal in " "recent archive versions). However if this is not expected, shall I assume a " "data corruption occurred in this field and that this flag should be ignored? " "(If unsure, refuse)" msgstr "" "MODE RELAX : l'archive est marquée comme ayant des séquences d'échappement " "(ce qui est normal pour une version récente d'archive). Cependant, si ce " "n'est pas attendu, doit-on considérer qu'une corruption des données a eu " "lieu pour ce champ et ignorer cette marque ? (En cas de doute, refuser)" #: src/libdar/macro_tools.cpp:718 msgid "" "Sequential read asked, but this archive is flagged to not have the necessary " "embedded escape sequences for that operation, aborting" msgstr "" "Lecture séquentielle demandée, mais cette archive est marquée comme ne " "possédant pas de séquence d'échappement nécessaire pour cette opération. " "Opération abandonnée" #: src/libdar/macro_tools.cpp:723 msgid "" "LAX MODE: the requested sequential read mode relies on escape sequence which " "seem to be absent from this archive. Assuming data corruption occurred. " "However, if no data corruption occurred and thus no escape sequence are " "present in this archive, do not use sequential reading mode to explore this " "archive else you will just get nothing usable from it" msgstr "" "MODE RELAX : La lecture séqentielle demandée a besoin que l'archive " "contienne de séquences d'échappement ce qui ne semble pas être le cas ici. " "On suppose qu'il s'agit d'une corruption de données. Cependant, si tel n'est " "pas le cas, et si aucune séquence d'échappement n'est effectivement présente " "dans cette archive, il ne faut pas utiliser le mode de lecture séquentielle " "pour lire cette archive, aucune information pertinente ne pourrait en être " "extraite" #: src/libdar/macro_tools.cpp:729 msgid "" "LAX MODE: Archive is flagged to not have escape sequence which is not the " "case by default since archive format 8 (release 2.4.x). If corruption " "occurred and an escape sequence is present, this may lead data restoration " "to fail, answering no at this question will let me consider that an escape " "sequence layer has to be added in spite of the archive flags. Do you want to " "continue as suggested by the archive flag, thus without escape sequence " "layer?" msgstr "" "MODE RELAX : L'archive est marquée comme ne possédant pas de séquence " "d'échappement ce qui n'est plus le cas par défaut depuis le format 8 " "(release 2.4.x). Si une corruption a eu lieu sur ce champ et " "qu'effectivement des séquences d'échappement sont présentes, ceci peut " "conduire à un échec de la restauration. Répondre non à la question suivante " "permettra d'insérer une couche de traitement des séquences d'échappement " "lors de la lecture malgré les indications présentes dans l'en-tête de " "l'archive. Voulez-vous continuer comme le suggère l'en-tête de l'archive, " "c'est-à-dire sans couche de gestion des séquences d'échappement ?" #: src/libdar/macro_tools.cpp:760 src/libdar/macro_tools.cpp:1465 msgid "Creating a new thread to run the escape layer..." msgstr "Création d'une nouvelle file pour exécuter la couche d'échappement ..." #: src/libdar/macro_tools.cpp:778 msgid "" "Opening the compression abstraction layer (compression algorithm used is " "none)..." msgstr "" "Ouverture de la couche d'abstraction gérant la compression (aucun algorithme " "de compression utilisé)..." #: src/libdar/macro_tools.cpp:780 msgid "Opening the compression layer..." msgstr "Ouverture de la couche de d'abstraction gérant la compression ..." #: src/libdar/macro_tools.cpp:804 src/libdar/macro_tools.cpp:1497 msgid "Creating a new thread to run the compression layer..." msgstr "" "Création d'une nouvelle file d'exécution pour le couche de compression..." #: src/libdar/macro_tools.cpp:818 src/libdar/macro_tools.cpp:1507 msgid "All layers have been created successfully" msgstr "Toutes les couches d'abstraction ont été crées avec succès" #: src/libdar/macro_tools.cpp:821 #, c-format msgid "" "Warning, the archive %S has been encrypted. A wrong key is not possible to " "detect, it would cause DAR to report the archive as corrupted\n" msgstr "" "Attention, l'archive %S a été chiffrée. Une mauvaise clef est impossible à " "détecter, cela aura pour conséquence la détection d'une corruption de " "l'archive.\n" #: src/libdar/macro_tools.cpp:858 msgid "" "LAX MODE: The catalogue (table of contents) usually takes a few percents of " "the archive at its end, which percentage do you want me to scan (answer by " "an *integer* number between 0 and 100)? " msgstr "" "MODE RELAX : le catalogue (table des matières) occupe en générale quelques " "pourcentages de l'archive à sa fin. Quel pourcentage voulez-vous qu'il soit " "balayé pour sa recherche (répondre par un *entier* entre 0 et 100) ? " #: src/libdar/macro_tools.cpp:864 #, c-format msgid "LAX MODE: %i is not a valid percent value" msgstr "MODE RELAX : %i n'est pas une valeur valide de pourcentage" #: src/libdar/macro_tools.cpp:868 #, c-format msgid "%S is not a valid number" msgstr "%S n'est pas nombre valide" #: src/libdar/macro_tools.cpp:874 #, c-format msgid "" "LAX MODE: Beginning search of the catalogue (from the end toward the " "beginning of the archive, on %i %% of its length), this may take a while..." msgstr "" "MODE RELAX : Début de la recherche du catalogue (de la fin vers le début de " "l'archive pour %i %% de sa longueur), l'opération peut durer longtemps ...\"" #: src/libdar/macro_tools.cpp:883 msgid "" "LAX MODE: Cannot skip at the end of the archive! Using current position to " "start the catalogue search" msgstr "" "MODE RELAX : Impossible d'aller à la fin de l'archive ! On utilise la " "position actuelle comme point de départ de la recherche du catalogue" #: src/libdar/macro_tools.cpp:888 msgid "LAX MODE: Failed to read the catalogue (no data to inspect)" msgstr "MODE RELAX : Échec de lecture du catalogue (aucune donnée à inspecter)" #: src/libdar/macro_tools.cpp:891 msgid "" "LAX MODE: Failed to read the catalogue (0 bytes of the archive length asked " "to look for the catalogue)" msgstr "" "MODE RELAX : Échec de lecture du catalogue (0 octets de l'archive demandé " "pour sa recherche)" #: src/libdar/macro_tools.cpp:902 msgid "" "LAX MODE: Escape sequence seems present in this archive. I have thus two " "different methods, either I look for the escape sequence indicating the " "start of the catalogue or I try each position in turn in the hope it will " "not be data that look like a catalogue" msgstr "" "MODE RELAX : Séquences d'échappement présentes dans l'archive. Deux méthodes " "différentes sont disponibles pour localiser le catalogue : soit on recherche " "la séquence d'échappement indiquant le début du catalogue, soit on essaie " "les différentes positions tour à tour dans l'espoir que cette portion de " "l'archive ressemblera à la structure d'un catalogue" #: src/libdar/macro_tools.cpp:905 msgid "LAX MODE: Trying to locate the escape sequence (safer choice) ?" msgstr "" "MODE RELAX : On essaie de localiser la séquence d'échappement (conseillé) ? " #: src/libdar/macro_tools.cpp:910 msgid "" "LAX MODE: Good point! I could find the escape sequence marking the beginning " "of the catalogue, now trying to read it..." msgstr "" "MODE RELAX : Bonne nouvelle ! La séquence d'échappement marquant le début du " "catalogue a été trouvée ! On essaie maintenant de le lire ..." #: src/libdar/macro_tools.cpp:919 msgid "" "LAX MODE: Escape sequence could not be found, it may have been corrupted or " "out of the scanned portion of the archive, trying to find the catalogue the " "other way" msgstr "" "MODE RELAX : La séquence d'échappement n'a pas pu être trouvée, elle a soit " "été corrompue, soit elle est hors du périmètre de recherche dans l'archive. " "On essaye de trouver le catalogue par l'autre méthode, patience ..." #: src/libdar/macro_tools.cpp:942 #, c-format msgid "LAX MODE: %i %% remaining" msgstr "MODE RELAX : %i %% restant" #: src/libdar/macro_tools.cpp:954 #, c-format msgid "" "Could read a catalogue data structure at offset %i, it contains the " "following:" msgstr "" "La structure de donnée du catalogue a pu être lue à %i de l'archive, elle " "contient ceci :" #: src/libdar/macro_tools.cpp:956 msgid "Do you want to use it for the operation?" msgstr "Voulez-vous l'utiliser pour l'opération ?" #: src/libdar/macro_tools.cpp:988 msgid "" "LAX MODE: Reached the end of the area to scan, FAILED to find any catalogue" msgstr "" "MODE RELAX : Fin de la zone de recherche atteinte, ECHEC de la localisation " "du catalogue" #: src/libdar/macro_tools.cpp:998 msgid "LAX MODE: Failed to read the catalogue" msgstr "MODE RELAX : Échec de lecture du catalogue" #: src/libdar/macro_tools.cpp:1006 msgid "" "The format version of the archive is too high for that software version, try " "reading anyway?" msgstr "" "La version du format ce cette archive est trop grand pour cette version " "d'application. On essaye quand même lire cette archive ?" #: src/libdar/macro_tools.cpp:1087 msgid "" "Creating low layer: Writing archive into a black hole object (equivalent to /" "dev/null)..." msgstr "" "Création de la couche de base : Ecriture de l'archive dans un trou noir " "(équivalent à /dev/null) ..." #: src/libdar/macro_tools.cpp:1096 msgid "Creating low layer: Writing archive into standard output object..." msgstr "" "Création de la couche de base : Ecriture de l'archive vers la sortie " "standard ..." #: src/libdar/macro_tools.cpp:1110 msgid "Creating low layer: Writing archive into a plain file object..." msgstr "" "Création de la couche de base : Ecriture de l'archive dans un fichier " "normal ..." #: src/libdar/macro_tools.cpp:1131 msgid "" "Creating low layer: Writing archive into a sar object (Segmentation and " "Reassembly) for slicing..." msgstr "" "Création de la couche de base : Ecriture de l'archive vers un objet sar " "(Segmentation and Reassemblement) pour le découpage en tranches ..." #: src/libdar/macro_tools.cpp:1169 msgid "Adding cache layer over pipe to provide limited skippability..." msgstr "" "Ajout d'une couche de cache au-dessus du tube pour fournir une capacité de " "déplacement limitée" #: src/libdar/macro_tools.cpp:1197 msgid "" "WARNING: support for secure memory was not available at compilation time, in " "case of heavy memory load, this may lead the password/passphrase provided to " "be wrote to disk (swap space) in clear. You have been warned!" msgstr "" "ATTENTION : le support pour la mémoire sécurisé n'a pas été disponible lors " "de la compilation. En cas d'utilisation importante de la mémoire, les mots " "de passe peuvent être écrit sur disque en clair (fichier d'échange). Vous " "avez été prévenus !" #: src/libdar/macro_tools.cpp:1212 msgid "Generating random key for symmetric encryption..." msgstr "" "Génération d'une clef de chiffrement aléatoire pour le chiffrement " "symmétrique ..." #: src/libdar/macro_tools.cpp:1220 msgid "" "Scrambling is a very weak encryption algorithm, this is a non-sens to use " "with asymmetric encryption" msgstr "" "Le chiffrement \"scramble\" est très faible. C'est un non-sens de l'utiliser " "avec le chiffrement asymétrique" #: src/libdar/macro_tools.cpp:1260 #, c-format msgid "" "For your information, this is the iteration %d for which the randomly " "generated key is reported to be weak by libgcrypt, continuing generating " "another random key... patience" msgstr "" "Pour information, c'est l'itération n°%d pour laquelle la clef aléatoire " "générée est considérée comme faible par libgcrypt. La rechercher d'une " "nouvelle clef aléatoire continue ... patience" #: src/libdar/macro_tools.cpp:1264 #, c-format msgid "" "... A strong randomly generated key could be found after %d iteration(s)" msgstr "" "Une clef forte générée aléatoirement a pu être trouvée après %d iteration(s)" #: src/libdar/macro_tools.cpp:1271 msgid "Key generated" msgstr "Clef générée" #: src/libdar/macro_tools.cpp:1313 msgid "Please confirm your password: " msgstr "Merci de confirmer le mot de passe : " #: src/libdar/macro_tools.cpp:1317 msgid "The two passwords are not identical. Aborting" msgstr "Les deux mots de passes ne sont pas identiques. Abandon" #: src/libdar/macro_tools.cpp:1347 msgid "Writing down the archive header..." msgstr "Ecriture de l'en-tête de l'archive ..." #: src/libdar/macro_tools.cpp:1363 msgid "Adding a new layer on top: scrambler object..." msgstr "Ajout d'une nouvelle couche : Chiffrement faible ..." #: src/libdar/macro_tools.cpp:1375 msgid "Adding a new layer on top: Strong encryption object..." msgstr "Ajout d'une nouvelle couche : Chiffrement fort ..." #: src/libdar/macro_tools.cpp:1392 msgid "Adding a new layer on top: Caching layer for better performances..." msgstr "" "Ajout d'une nouvelle couche : Cache pour de meilleures performances ..." #: src/libdar/macro_tools.cpp:1437 msgid "Writing down the initial elastic buffer through the encryption layer..." msgstr "Ecriture du tampon élastique initial via la couche de chiffrement ..." #: src/libdar/macro_tools.cpp:1449 msgid "Adding a new layer on top: Escape layer to allow sequential reading..." msgstr "" "Ajout d'une nouvelle couche : Couche d'échappement pour permettre la lecture " "séquentielle ..." #: src/libdar/macro_tools.cpp:1479 msgid "Adding a new layer on top: compression..." msgstr "Ajout d'une nouvelle couche : Compression ..." #: src/libdar/macro_tools.cpp:1521 msgid "Error creating archive layers: " msgstr "Erreur pendant la création des couches pour l'archive : " #: src/libdar/macro_tools.cpp:1630 msgid "Writing down archive contents..." msgstr "Ecriture du contenu de l'archive ..." #: src/libdar/macro_tools.cpp:1654 msgid "Calculating the signature of the catalogue hash..." msgstr "Calcul de la signature du hashage du catalogue ..." #: src/libdar/macro_tools.cpp:1670 msgid "Writing down the signed hash of the catalogue..." msgstr "Ecriture de la signature du catalogue..." #: src/libdar/macro_tools.cpp:1720 msgid "Closing the compression layer..." msgstr "Fermeture de la couche de compression ..." #: src/libdar/macro_tools.cpp:1735 msgid "Closing the escape layer..." msgstr "Fermeture de la couche d'échappement..." #: src/libdar/macro_tools.cpp:1755 msgid "Writing down the first archive terminator..." msgstr "Ecriture du premier terminateur d'archive..." #: src/libdar/macro_tools.cpp:1761 msgid "writing down the final elastic buffer through the encryption layer..." msgstr "Ecriture du tampon élastique terminal via la couche de chiffrement ..." #: src/libdar/macro_tools.cpp:1800 msgid "Closing the encryption layer..." msgstr "Fermeture de la couche de chiffrement ..." #: src/libdar/macro_tools.cpp:1822 msgid "Writing down archive trailer..." msgstr "Ecriture de la fin d'archive ..." #: src/libdar/macro_tools.cpp:1827 msgid "Writing down the second archive terminator..." msgstr "Ecriture du second terminateur d'archive ..." #: src/libdar/macro_tools.cpp:1838 msgid "Closing archive low layer..." msgstr "Fermeture de la couche de base ..." #: src/libdar/macro_tools.cpp:1843 msgid "Archive is closed." msgstr "L'archive est fermée." #: src/libdar/entrepot.cpp:151 msgid "Error met while creating the hash file: " msgstr "Erreur lors de la cration du fichier de hashage : " #: src/libdar/tlv.cpp:66 msgid "Missing data to initiate a TLV object" msgstr "il manque des données initialiser un objet TLV" #: src/libdar/filesystem.cpp:174 #, c-format msgid "Error reading inode of file %s : %s" msgstr "Erreur lors de la lecture de l'inode de %s : %s" #: src/libdar/filesystem.cpp:179 #, c-format msgid "Failed reading inode information for %s: " msgstr "Erreur lors de l'obtention d'informations sur l'inode %s :" #: src/libdar/filesystem.cpp:187 msgid "Cannot read inode for " msgstr "Impossible de lire l'inode de " #: src/libdar/filesystem.cpp:283 msgid "Unknown file type! file name is: " msgstr "Type de fichier inconnu ! Le nom du fichier est : " #: src/libdar/filesystem.cpp:316 msgid "Error reading EA for " msgstr "Erreur lors de la lecture des AE pour " #: src/libdar/filesystem.cpp:566 src/libdar/filesystem.cpp:802 msgid "Non existent file: " msgstr "Fichier inexistant : " #: src/libdar/filesystem.cpp:568 src/libdar/filesystem.cpp:804 msgid "File must be a directory: " msgstr "Le fichier doit être un répertoire : " #: src/libdar/filesystem.cpp:653 #, c-format msgid "Cannot read directory contents: %s : " msgstr "Impossible de lire le contenu du répertoire : %s : " #: src/libdar/filesystem.cpp:690 msgid "Ignoring file with NODUMP flag set: " msgstr "Fichier sans le drapeau NODUMP ignoré : " #: src/libdar/filesystem.cpp:698 src/libdar/filesystem.cpp:703 msgid "Error reading directory contents: " msgstr "Erreur lors de la lecture du contenu du répertoire : " #: src/libdar/filesystem.cpp:698 src/libdar/filesystem.cpp:703 msgid " . Ignoring file or directory" msgstr " . Fichier ou répertoire ignoré" #: src/libdar/filesystem.cpp:1082 #, c-format msgid "" "Error creating hard link %s : %s\n" " Trying to duplicate the inode" msgstr "" "Erreur lors de la création du lien dur %s : %s\n" " Tentative de duplication de l'inode" #: src/libdar/filesystem.cpp:1096 #, c-format msgid "" "Error creating hard link : %s , the inode to link with [ %s ] has " "disappeared, re-creating it" msgstr "" "Erreur lors de la création du lien dur : %s , l'inode à lier [ %s ] a " "disparue, elle va être recréée" #: src/libdar/filesystem.cpp:1103 #, c-format msgid "" "Error creating hard link : %s , the inode to link with [ %s ] is not " "present, cannot restore this hard link" msgstr "" "Erreur lors de la création du lien dur : %s , l'inode à lier [ %s ] n'est " "pas présente, le lien dur ne peut pas être restauré" #: src/libdar/filesystem.cpp:1175 msgid "Bad CRC, data corruption occurred" msgstr "Mauvais CRC, une corruption des données a eu lieu" #: src/libdar/filesystem.cpp:1225 msgid "Error creating Unix socket file: " msgstr "Erreur lors de la création de la prise Unix : " #: src/libdar/filesystem.cpp:1245 msgid "Could not create inode: " msgstr "Création d'une inode impossible : " #: src/libdar/filesystem.cpp:1247 msgid "Cannot create inode: " msgstr "Création d'une inode impossible : " #: src/libdar/filesystem.cpp:1247 msgid " Ready to continue ?" msgstr " Prêt à continuer ?" #: src/libdar/filesystem.cpp:1442 msgid "Cannot remove non-existent file from filesystem: " msgstr "" "Impossible de supprimer in fichier qui n'existe pas dans le système de " "fichier : " #: src/libdar/filesystem.cpp:1447 src/libdar/filesystem.cpp:1740 msgid "Restoring file's data: " msgstr "Restauration des données du fichier : " #: src/libdar/filesystem.cpp:1464 src/libdar/filesystem.cpp:1935 msgid "Restoring file's EA: " msgstr "Restauration des Attributs Étendus du fichier : " #: src/libdar/filesystem.cpp:1475 src/libdar/filesystem.cpp:1578 #, c-format msgid "Restoration of EA for %S aborted: " msgstr "Restauration des EA de %S arrêtée : " #: src/libdar/filesystem.cpp:1485 src/libdar/filesystem.cpp:2078 msgid "Restoring file's FSA: " msgstr "Restauration des FSA du fichier : " #: src/libdar/filesystem.cpp:1498 src/libdar/filesystem.cpp:1590 #, c-format msgid "Restoration of FSA for %S aborted: " msgstr "Restauration des FSA de %S arrêtée : " #: src/libdar/filesystem.cpp:1659 #, c-format msgid "%S is about to be removed from filesystem, continue?" msgstr "" "%S est sur le point d'être supprimé du système de fichier, continue t-on ?" #: src/libdar/filesystem.cpp:1664 src/libdar/filesystem.cpp:1673 #, c-format msgid "Removing file (reason is file recorded as removed in archive): %S" msgstr "" "Suppressin du fichier (fichier marqué comme supprimé dans l'archive) : %S" #: src/libdar/filesystem.cpp:1671 #, c-format msgid "" "%S must be removed, but does not match expected type, remove it anyway ?" msgstr "" "%S est sur le point d'être supprimé, mais le type de fichier ne correspond " "pas avec ce qui est attendu, l'efface t-on ?" #: src/libdar/filesystem.cpp:1679 #, c-format msgid "" "%S: Overwriting policy (Data) is undefined for that file, do not know " "whether removal is allowed or not!" msgstr "" "%S : La politique d'écrasement (Données) reste non définie pour ce fichier, " "impossible donc de savoir si la suppression est autorisée ou non !" #: src/libdar/filesystem.cpp:1716 #, c-format msgid "" "Directory %S cannot be restored: overwriting not allowed and a non-directory " "inode of that name already exists, all files in that directory will be " "skipped for restoration:" msgstr "" "Le répertoire %S ne peut pas être restauré : écrasement interdit et une " "inode n'étant pas un répertoire existe déjà sous ce nom. Aucun fichiers de " "ce répertoire ne sera restauré : " #: src/libdar/filesystem.cpp:1725 #, c-format msgid "%S is about to be overwritten, OK?" msgstr "%S est sur le point d'être écrasé, OK ?" #: src/libdar/filesystem.cpp:1771 #, c-format msgid "Existing EA for %S could not be read and preserved: " msgstr "" "les Attributs Étendus existants de %S n'ont pas pu être lu ni préservé : " #: src/libdar/filesystem.cpp:1789 #, c-format msgid "Existing FSA for %S could not be read and preserved: " msgstr "les FSA existants de %S n'ont pas pu être lu ni préservé : " #: src/libdar/filesystem.cpp:1818 #, c-format msgid "Existing EA for %S could not be preserved : " msgstr "les AE existants de %S n'ont pas pu être préservés : " #: src/libdar/filesystem.cpp:1835 #, c-format msgid "Existing FSA for %S could not be preserved : " msgstr "les FSA existants de %S n'ont pas pu être préservés : " #: src/libdar/filesystem.cpp:1850 #, c-format msgid "" "%S is about to be deleted (required by overwriting policy), do you agree?" msgstr "" "%S est sur le point d'être supprimé (action requise par la politique " "d'écrasement), OK ?" #: src/libdar/filesystem.cpp:1852 #, c-format msgid "Removing file (reason is overwriting policy): %S" msgstr "Suppression du fichier (politique d'écrasement) : %S" #: src/libdar/filesystem.cpp:1858 #, c-format msgid "" "%S: Overwriting policy (Data) is undefined for that file, do not know " "whether overwriting is allowed or not!" msgstr "" "%S : La politique d'écrasement (Données) reste non définie pour ce fichier, " "impossible de savoir si l'écrasement est autorisé ou pas !" #: src/libdar/filesystem.cpp:1914 #, c-format msgid "EA for %S are about to be overwritten, OK?" msgstr "Des Attributs Étendus de %S sont sur le point d'être écrasés, OK ?" #: src/libdar/filesystem.cpp:1929 #, c-format msgid "" "EA for %S have not been overwritten because this file is a hard link " "pointing to an already restored inode" msgstr "" "Les Attributs Étendus pour %S n'ont pas été écrasés à car ce fichier est un " "lien dur pointant sur une inode déjà restaurée" #: src/libdar/filesystem.cpp:1949 #, c-format msgid "EA for %S are about to be removed, OK?" msgstr "Les Attributs Étendus de %S sont sur le point d'être supprimés, OK ?" #: src/libdar/filesystem.cpp:1960 #, c-format msgid "" "EA for %S have not been cleared as requested by the overwriting policy " "because this file is a hard link pointing to an already restored inode" msgstr "" "Les Attributs Étendus pour %S n'ont pas été effacés tel prévu par la " "politique d'écrasement car ce fichier est un lien dur pointant sur une inode " "déjà restaurée" #: src/libdar/filesystem.cpp:1966 msgid "Clearing file's EA (requested by overwriting policy): " msgstr "" "Effacement des attributs étendus (requis par la politique d'écrasement) : " #: src/libdar/filesystem.cpp:1979 #, c-format msgid "EA for %S are about to be merged, OK?" msgstr "Les Attributs Étendus de %S sont sur le point d'être fusionnés, OK ?" #: src/libdar/filesystem.cpp:2005 #, c-format msgid "" "%S: Overwriting policy (EA) is undefined for that file, do not know whether " "overwriting is allowed or not!" msgstr "" "%S : La politique d'écrasement (Attributs Étendus) reste non définie pour ce " "fichier, impossible de savoir si l'écrasement est autorisé ou pas !" #: src/libdar/filesystem.cpp:2057 src/libdar/filesystem.cpp:2103 #, c-format msgid "FSA for %S are about to be overwritten, OK?" msgstr "Les FSA de %S sont sur le point d'être écrasés, OK ?" #: src/libdar/filesystem.cpp:2072 #, c-format msgid "" "FSA for %S have not been overwritten because this file is a hard link " "pointing to an already restored inode" msgstr "" "Les FSA de %S n'ont pas été écrasés car ce fichier est un lien dur pointant " "sur une inode déjà restaurée" #: src/libdar/filesystem.cpp:2129 #, c-format msgid "" "%S: Overwriting policy (FSA) is undefined for that file, do not know whether " "overwriting is allowed or not!" msgstr "" "%S : La politique d'écrasement (FSA) reste non définie pour ce fichier, " "impossible de savoir si l'écrasement est autorisé ou pas !" #: src/libdar/filesystem.cpp:2189 msgid "Cannot get inode information about file to remove " msgstr "Impossible d'obtenir d'information sur l'inode d'un fichier à effacer " #: src/libdar/filesystem.cpp:2202 msgid "Cannot remove directory " msgstr "Suppression de répertoire impossible " #: src/libdar/filesystem.cpp:2206 msgid "Cannot remove file " msgstr "Suppression de fichier impossible " #: src/libdar/filesystem.cpp:2255 msgid "" "uid value is too high for this system for libdar be able to restore it " "properly" msgstr "" "valeur d'UID trop grande pour ce système pour que libdar puisse le restaurer " "correctement" #: src/libdar/filesystem.cpp:2259 msgid "" "gid value is too high for this system for libdar be able to restore it " "properly" msgstr "" "valeur de GID trop grande pour ce système pour que libdar puisse le " "restaurer correctement" #: src/libdar/filesystem.cpp:2263 src/libdar/filesystem.cpp:2267 msgid "Could not restore original file ownership: " msgstr "Affection du fichier à son propriétaire d'origine impossible : " #: src/libdar/filesystem.cpp:2281 #, c-format msgid "Cannot restore permissions of %s : %s" msgstr "Restauration des droits d'accès de %s impossible : %s" #: src/libdar/filesystem.cpp:2367 #, c-format msgid "Failed to open %S while checking for nodump flag: %s" msgstr "" "Impossible d'ouvrir %S pendant la consultation du drapeau \"nodump\" : %s" #: src/libdar/filesystem.cpp:2381 #, c-format msgid "Cannot get ext2 attributes (and nodump flag value) for %S : %s" msgstr "Impossible d'accéder aux attributs ext2 (drapeau nodump) pour %S : %s" #: src/libdar/filesystem.cpp:2414 #, c-format msgid "Cannot get inode information for %s : %s" msgstr "Impossible d'obtenir des informations sur l'inode %s : %s" #: src/libdar/filesystem.cpp:2443 #, c-format msgid "" "Replacing %s in the -R option by the directory pointed to by this symbolic " "link: " msgstr "" "Remplacement de %s dans l'option -R par le répertoire pointé par ce lien " "symbolique" #: src/libdar/filesystem.cpp:2446 #, c-format msgid "" "The given path %s must be a directory (or symbolic link to an existing " "directory)" msgstr "Le chemin %s doit être un répertoire (ou un lien sur un répertoire)" #: src/libdar/tronc.cpp:256 src/libdar/tronc.cpp:298 msgid "Cannot skip to the current position in \"tronc\"" msgstr "Impossible de se déplacer à la position courante dans un \"tronc\"" #: src/libdar/tronc.cpp:310 msgid "Tried to write out of size limited file" msgstr "Tentative d'écriture hors d'un fichier de taille limitée" #: src/libdar/cat_file.cpp:394 msgid "cannot provide data from a \"not saved\" file object" msgstr "impossible de fournir des données pour un fichier non sauvegardé" #: src/libdar/cat_file.cpp:397 msgid "data has been cleaned, object is now empty" msgstr "données purgées, l'objet est maintenant vide" #: src/libdar/cat_file.cpp:656 msgid "can't read data CRC: No escape mark found for that file" msgstr "" "Ne peut lire le CRC sur les données : aucune séquence d'échappement trouvée " "pour ce fichier" #: src/libdar/cat_file.cpp:704 #, c-format msgid "not same size: %i <--> %i" msgstr "tailles différentes : %i <--> %i" #: src/libdar/cat_file.cpp:753 #, c-format msgid "different file data, offset of first difference is: %i" msgstr "" "les donnes ne correspondent pas: position de la première différence au sein " "du fichier: %i" #: src/libdar/cat_file.cpp:761 msgid "" "Same data but CRC value could not be verified because we did not guessed " "properly its width (sequential read restriction)" msgstr "" "Données identiques mais CRC non vérifié, car sa largeur n'a pas été devinée " "correctement (restriction due à la lecture sequentielle)" #: src/libdar/cat_file.cpp:763 msgid "Same data but stored CRC does not match the data!?!" msgstr "" "Même donnée, mais le CRC enregistré ne correspond pas à ces données !?!" #: src/libdar/cat_file.cpp:815 msgid "" "CRC difference concerning file's data (comparing with an isolated catalogue)" msgstr "" "Difference de CRC concernant les données du fichier (comparaison depuis un " "catalogue isolé)" #: src/libdar/crypto_asym.cpp:86 src/libdar/crypto_asym.cpp:139 #: src/libdar/crypto_asym.cpp:175 src/libdar/crypto_asym.cpp:233 #: src/libdar/crypto_asym.cpp:292 msgid "Unexpected error reported by GPGME: " msgstr "Erreur inattendue retournée par GPGME : " #: src/libdar/crypto_asym.cpp:137 msgid "Key found but users are not all trusted" msgstr "" "Clef trouvée mais tous les utilisateurs n'ont pas un niveau de confiance " "suffisant" #: src/libdar/crypto_asym.cpp:169 msgid "No data to decrypt" msgstr "Aucune donnée à déchiffrer" #: src/libdar/crypto_asym.cpp:171 msgid "Invalid Cipher text" msgstr "Texte de chiffrement invalide" #: src/libdar/crypto_asym.cpp:173 msgid "Failed retreiving passphrase" msgstr "Echec de récupération de la phrase secrète" #: src/libdar/crypto_asym.cpp:188 msgid "Failed creating GPGME context: " msgstr "Échec de création d'un contexte GPGME : " #: src/libdar/crypto_asym.cpp:192 msgid "Failed setting GPGME context with OpenPGP protocol: " msgstr "Echec de paramétrage d'un contexte GPGME avec le protocole OpenPGP : " #: src/libdar/crypto_asym.cpp:306 #, c-format msgid "No valid signing key could be find for %S" msgstr "Aucune clef de signature valide n'a pu être trouvée pour %S" #: src/libdar/crypto_asym.cpp:308 #, c-format msgid "No valid encryption key could be find for %S" msgstr "Aucune clef de chiffrement valide n'a pu être trouvée pour %S" #: src/libdar/crypto_asym.cpp:319 msgid "No signatory remain with a valid key, signing is impossible, aborting" msgstr "" "Aucun signataire avec une clef valide ne demeure, la signature de l'archive " "est impossible, arrêt de l'opération" #: src/libdar/crypto_asym.cpp:321 msgid "" "No recipient remain with a valid key, encryption is impossible, aborting" msgstr "" "Aucun destinataire avec une clef valide ne demeure, le chiffrement est " "impossible, arrêt de l'opération" #: src/libdar/crypto_asym.cpp:394 #, c-format msgid "Passphrase required for key %s :" msgstr "Phrase secrète requise pour la clef %s : " #: src/libdar/crypto_asym.cpp:415 msgid "Error, invalid passphrase given, try again:" msgstr "Erreur, phrase secrète invalide, nouvel essai : " #: src/libdar/crypto_asym.cpp:423 msgid "Error, while sending the passphrase to GPGME:" msgstr "Erreur lors de l'envoie de la phrase secrète à GPGME : " #: src/libdar/crypto_asym.cpp:425 msgid "Failed sending the totality of the passphrase to GPGME" msgstr "Echec de l'envoi de la totalité de la phrase secrète à GPGME" #: src/libdar/crypto_asym.cpp:432 msgid "Failed sending CR after the passphrase" msgstr "Impossible d'envoyer un retour-chariot après la phrase secrète" #: src/libdar/crypto_sym.cpp:74 msgid "" "Current implementation of blowfish encryption is not compatible with old " "(weak) implementation, use dar-2.3.x software (or other software based on " "libdar-4.4.x) to read this archive" msgstr "" "L'implémentation actuelle du chiffrement blowfish n'est pas compatible avec " "l'ancienne implémentation (boguée), utiliser dar-2.3.x (ou autre logiciel " "basé sur libdar-4.4.x) pour lire cette archive" #: src/libdar/crypto_sym.cpp:85 src/libdar/crypto_sym.cpp:147 #, c-format msgid "Cyphering algorithm not available in libgcrypt: %s/%s" msgstr "Algorithme de chiffrement non disponible dans libgcrypt : %s/%s" #: src/libdar/crypto_sym.cpp:91 src/libdar/crypto_sym.cpp:582 #, c-format msgid "" "Failed retrieving from libgcrypt the block size used by the cyphering " "algorithm: %s/%s" msgstr "" "Échec lors de la récupération de la taille de bloc utilisée par libgcrypt " "pour l'algorithme de chiffrement : %s/%s" #: src/libdar/crypto_sym.cpp:108 #, c-format msgid "Error while opening libgcrypt key handle: %s/%s" msgstr "" "Erreur lors de l'ouverture d'une référence de clef pour libgcrypt: %s/%s" #: src/libdar/crypto_sym.cpp:116 #, c-format msgid "Error while assigning key to libgcrypt key handle: %s/%s" msgstr "" "Erreur lors de l'assignation d'une clef à une référence de libgcrypt : %s/%s" #: src/libdar/crypto_sym.cpp:133 msgid "Missing strong encryption support (libgcrypt)" msgstr "Absence de support pour le chiffrement fort (libgcrypt)" #: src/libdar/crypto_sym.cpp:152 msgid "Failed retrieving from libgcrypt the maximum key length" msgstr "Échec de la récupération de la longueur maximum possible des clefs" #: src/libdar/crypto_sym.cpp:185 #, c-format msgid "" "Error while opening libgcrypt key handle to check password strength: %s/%s" msgstr "" "Erreur lors de la création d'un manipulateur de clef lors de la vérification " "de la force du mot de passe : %s/%s" #: src/libdar/crypto_sym.cpp:197 #, c-format msgid "" "Error while assigning key to libgcrypt key handle to check password " "strength: %s/%s" msgstr "" "Erreur lors de l'assignation d'une clef à un manipulateur de clef lors de la " "vérification de la force du mot de passe : %s/%s" #: src/libdar/crypto_sym.cpp:267 #, c-format msgid "Error while resetting encryption key for a new block: %s/%s" msgstr "" "Erreur lors de la réinitialisation de la clef de chiffrement pour un nouveau " "bloc : %s/%s" #: src/libdar/crypto_sym.cpp:271 src/libdar/crypto_sym.cpp:295 #, c-format msgid "Error while setting IV for current block: %s/%s" msgstr "" "Erreur lors de la détermination du vecteur initial (IV) pour le bloc " "courant : %s/%s" #: src/libdar/crypto_sym.cpp:274 #, c-format msgid "Error while cyphering data: %s/%s" msgstr "Erreur lors du chiffrement des données : %s/%s" #: src/libdar/crypto_sym.cpp:280 src/libdar/crypto_sym.cpp:304 msgid "blowfish strong encryption support" msgstr "Support pour le chiffrement avec l'algorithme blowfish" #: src/libdar/crypto_sym.cpp:298 #, c-format msgid "Error while decyphering data: %s/%s" msgstr "Erreur lors du déchiffrement des données : %s/%s" #: src/libdar/crypto_sym.cpp:339 #, c-format msgid "Error while generating IV: %s/%s" msgstr "Erreur lors de la génération du vecteur initial (IV) : %s/%s" #: src/libdar/crypto_sym.cpp:380 #, c-format msgid "Error! SHA1 not available in libgcrypt: %s/%s" msgstr "Erreur ! SHA1 n'est pas disponible dans libgcrypt : %s/%s" #: src/libdar/crypto_sym.cpp:386 #, c-format msgid "Error while derivating key from password (HMAC open): %s/%s" msgstr "" "Erreur lors de la création de la clef à partir du mot de passe (ouverture " "HMAC) : %s/%s" #: src/libdar/crypto_sym.cpp:392 #, c-format msgid "Error while derivating key from password (HMAC set key): %s/%s" msgstr "" "Erreur lors du calcul de la clef à partir du mot de passe (HMAC set key) : " "%s/%s" #: src/libdar/crypto_sym.cpp:534 #, c-format msgid "Error while creating ESSIV handle: %s/%s" msgstr "Erreur lors de la création d'une référence ESSIV : %s/%s" #: src/libdar/crypto_sym.cpp:542 #, c-format msgid "" "Failed retrieving from libgcrypt the key length to use (essiv key): %s/%s" msgstr "Échec de la récupération de la longueur de clef à utiliser : %s/%s" #: src/libdar/crypto_sym.cpp:563 #, c-format msgid "Error while assigning key to libgcrypt key handle (essiv): %s/%s" msgstr "" "Erreur lors de l'assignation d'une clef à une référence de clef de libgcrypt " "(essiv) : %s/%s" #: src/libdar/crypto_sym.cpp:572 #, c-format msgid "" "Failed retrieving from libgcrypt the block size used by the cyphering " "algorithm (essiv): %s/%s" msgstr "" "Impossible de connaître la taille de bloc utilisée par l'algorithme de " "chiffrement : %s/%s" #: src/libdar/crypto_sym.cpp:627 src/libdar/crypto_sym.cpp:633 #: src/libdar/crypto_sym.cpp:642 src/libdar/crypto_sym.cpp:650 #: src/libdar/crypto_sym.cpp:683 msgid "Library used for blowfish encryption does not respect RFC 3962" msgstr "" "La bibliothèque de chiffrement pour l'algorithme blowfish ne respecte pas la " "RFC 3962" #: src/libdar/wrapperlib.cpp:156 src/libdar/wrapperlib.cpp:161 msgid "Cannot copy a wrapperlib object (NOT IMPLEMENTED)" msgstr "La copie d'un objet wrapperlib n'est pas implémentée, copie impossible" #: src/libdar/wrapperlib.cpp:476 msgid "compressReset called but compressInit never called before" msgstr "" "\"compressReset appelé alors que \"compressInit\" n'a jamais été invoqué au " "préalable" #: src/libdar/mask_list.cpp:95 #, c-format msgid "Cannot allocate memory for buffer while reading %S" msgstr "Impossible d'allouer de mémoire pour un tampon lors de la lecture %S" #: src/libdar/mask_list.cpp:121 msgid "Found '" msgstr "Trouvé '" #: src/libdar/mask_list.cpp:170 msgid "" "Mask_list's prefix must be an absolute path or start with \"\" string " "for archive merging" msgstr "" "Le préfixe pour une mask_list doit être un chemin absolu ou commencer par la " "chaîne \"\" pour la fusion d'archives" #: src/libdar/mask_list.cpp:192 #, c-format msgid "" "Error met while reading line\n" "\t%S\n" " from file %S: %S" msgstr "" "Erreur lors de la lecture de la ligne\n" "\t%S\n" " à partir du fichier %S : %S" #: src/libdar/mask_list.cpp:209 #, c-format msgid "Too much line in file %S (integer overflow)" msgstr "Trop de lignes dans le fichier %S (dépassement d'entiers)" #: src/libdar/generic_file_overlay_for_gpgme.cpp:55 #, c-format msgid "Error creating data buffer overlay for GPGME: %s" msgstr "Erreur de création d'un tampon pour GPGME: %s " #: src/libdar/generic_file_overlay_for_gpgme.cpp:107 msgid "File offset too large to be stored in off_t type" msgstr "" "Indexe du fichier trop grand pour être stocké var un variable de type off_t" #: src/libdar/capabilities.cpp:90 #, c-format msgid "Error met while checking for capability %S: %s" msgstr "Erreur lors de la vérifiation de la capacité %S : %s" #: src/libdar/cat_directory.cpp:133 msgid "" "LAX MODE: Error met building a catalogue entry, skipping this entry and " "continuing. Skipped error is: " msgstr "" "MODE RELAX : Erreur lors de la construction d'une entrée du catalogue, on " "ignore et on passe à la suivante. L'erreur rencontrée était : " #: src/libdar/cat_directory.cpp:176 msgid "missing data to build a cat_directory" msgstr "il manque des données pour construire un répertoire" #: src/libdar/cat_directory.cpp:425 #, c-format msgid "Cannot remove nonexistent entry %S from catalogue" msgstr "Ne peut pas supprimer l'entrée %S du catalogue car elle n'y existe pas" #: src/libdar/cat_directory.cpp:586 msgid "listing() method must be given" msgstr "la méthode listing() doit être fournie" #: src/libdar/cat_directory.cpp:593 msgid "argument must be a relative path" msgstr "l'argument doit être un chemin relatif" #: src/libdar/crc.cpp:211 src/libdar/crc.cpp:312 msgid "Invalid size for CRC width" msgstr "Taille invalide pour un CRC" #: src/libdar/mask.hpp:273 msgid "No mask in the list of mask to operate on" msgstr "Aucun masque sur lequel opérer dans la liste de masque" #: src/libdar/mask.hpp:306 msgid "No mask to operate on in the list of mask" msgstr "Aucun masque sur lequel opérer dans la liste de masque" #: src/libdar/user_interaction.cpp:116 msgid "Continue? " msgstr "Continuer ?" #: src/libdar/user_interaction.cpp:217 msgid "nullptr given as argument of user_interaction_callback()" msgstr "l'argument nullptr a été transmis à user_interaction_callback()" #: src/libdar/user_interaction.cpp:254 src/libdar/user_interaction.cpp:259 #: src/libdar/user_interaction.cpp:276 src/libdar/user_interaction.cpp:280 #: src/libdar/user_interaction.cpp:297 src/libdar/user_interaction.cpp:301 #: src/libdar/user_interaction.cpp:322 src/libdar/user_interaction.cpp:326 #: src/libdar/user_interaction.cpp:349 src/libdar/user_interaction.cpp:353 #: src/libdar/user_interaction.cpp:370 src/libdar/user_interaction.cpp:374 #: src/libdar/user_interaction.cpp:391 src/libdar/user_interaction.cpp:395 #: src/libdar/user_interaction.cpp:414 src/libdar/user_interaction.cpp:418 #: src/libdar/user_interaction.cpp:437 src/libdar/user_interaction.cpp:441 msgid "No exception allowed from libdar callbacks" msgstr "" "Aucune exception n'est autorisée en provenance d'une fonction de rappel de " "libdar" #: src/libdar/int_tools.cpp:65 msgid "a binary digit is either 0 or 1" msgstr "Un chiffre binaire est soit 0 soit 1" #: src/libdar/archive_options.cpp:155 msgid "Cannot get catalogue of reference as it has not been provided" msgstr "" "Impossible d'obtenir le catalogue de référence car il n'a pas été fourni" #: src/libdar/archive_options.cpp:173 msgid "Error, catalogue of reference has not been provided" msgstr "Erreur, le catalogue de référence n'a pas été fourni" #: src/libdar/archive_options.cpp:1182 src/libdar/archive_options.cpp:1189 msgid "No mask available" msgstr "Aucun masque disponible" #: src/libdar/header.cpp:103 src/libdar/header.cpp:111 #: src/libdar/header.cpp:114 src/libdar/header.cpp:116 msgid "Reached end of file while reading slice header" msgstr "" "Fin de fichier atteinte lors de la lecture d'un en-tête de tranche d'archive" #: src/libdar/header.cpp:130 src/libdar/header.cpp:152 msgid "" "LAX MODE: slice size is not possible to read, (lack of virtual memory?), " "continuing anyway..." msgstr "" "MODE RELAX : Impossible de lire la taille des tranches, (manque de mémoire " "virtuelle ?), on continue malgré tout ..." #: src/libdar/header.cpp:167 msgid "" "LAX MODE: first slice size is not possible to read, (lack of virtual " "memory?), continuing anyway..." msgstr "" "MODE RELAX : la taille de la première tranche est impossible à lire (manque " "de mémoire virtuelle ?), on continue malgré tout ..." #: src/libdar/header.cpp:180 msgid "" "Archive format older than \"08\" (release 2.4.0) cannot be read through a " "single pipe. It only can be read using dar_slave or normal plain file (slice)" msgstr "" "Un format d'archive plus ancien que \"08\" (release 2.4.0) ne peut être lu à " "partir d'un seul tube, seule la lecture avec dar_slave ou à partir de " "fichiers (c'est à dire de tranches) est possible" #: src/libdar/header.cpp:182 msgid "" "LAX MODE: first slice size is not possible to read, continuing anyway..." msgstr "" "MODE RELAX : la taille de la première tranche est impossible à lire, on " "continue malgré tout ... " #: src/libdar/header.cpp:197 msgid "Badly formatted SAR header (unknown TLV type in slice header)" msgstr "" "En-tête SAR mal-formé (type de TLV inconnu dans l'en-tête d'une tranche)" #: src/libdar/header.cpp:200 msgid "LAX MODE: Unknown data in slice header, ignoring and continuing" msgstr "" "MODE RELAX : Data inconnue dans un en-tête de tranche, on ignore et on " "continue" #: src/libdar/header.cpp:368 msgid "incomplete data set name found in a slice header" msgstr "Nom incomplet de jeu de données rencontré dans un en-tête de tranche" #: src/libdar/header.cpp:372 #, c-format msgid "" "Unknown entry found in slice header (type = %d), option not supported. The " "archive you are reading may have been generated by a more recent version of " "libdar, ignore this entry and continue anyway?" msgstr "" "Entrée inconnue trouvé dans l'en-tête de tranche (type = %d), option non " "supportée. L'archive lue peut avoir été crée par une version plus récente de " "libdar, est-ce qu'on ignore cette entrée et on continue ?" #: src/libdar/hash_fichier.cpp:96 #, c-format msgid "" "Error while initializing hash: Hash algorithm not available in libgcrypt: %s/" "%s" msgstr "" "Erreur lors de l'initialisation d'une fonction de hashage : Algorithme non " "disponible dans libgcrypt : %s/%s" #: src/libdar/hash_fichier.cpp:100 #, c-format msgid "Error while creating hash handle: %s/%s" msgstr "" "Erreur lors de la création d'une référence pour générer un somme de " "contrôle : %s/%s" #: src/libdar/hash_fichier.cpp:102 src/libdar/hash_fichier.cpp:138 #: src/libdar/hash_fichier.cpp:153 msgid "" "Missing hashing algorithms support (which is part of strong encryption " "support, using libgcrypt)" msgstr "" "Aucun support pour les algorithmes de hashage (partie intégrante du support " "pour le chiffrement fort, grâce à libgcrypt)" #: src/libdar/hash_fichier.cpp:186 msgid "Failed writing down the hash: " msgstr "Échec lors de l'écriture de la somme de contrôle : " #: src/libdar/cat_device.cpp:94 src/libdar/cat_device.cpp:97 msgid "missing data to build a special device" msgstr "il manque des données pour construire un fichier spécial" #: src/libdar/cat_device.cpp:145 #, c-format msgid "devices have not the same major number: %d <--> %d" msgstr "les fichiers spéciaux n'ont pas le même numéro majeur : %d <--> %d" #: src/libdar/cat_device.cpp:147 #, c-format msgid "devices have not the same minor number: %d <--> %d" msgstr "les fichiers spéciaux n'ont pas le même numéro mineur : %d <--> %d" #: src/libdar/sar.cpp:165 #, c-format msgid "" "Error met while opening the last slice: %S. Trying to open the archive using " "the first slice..." msgstr "" "Erreur rencontrée lors de l'ouverture de la dernière tranche : %S . " "Tentative d'ouverture à partir de la première tranche ..." #: src/libdar/sar.cpp:215 msgid "File size too small" msgstr "Taille de fichier trop petite" #: src/libdar/sar.cpp:219 msgid "First file size too small" msgstr "Taille du premier fichier trop petite" #: src/libdar/sar.cpp:709 msgid "LAX MODE: Caught exception: " msgstr "MODE RELAX : Exception attrapée : " #: src/libdar/sar.cpp:710 #, c-format msgid "" "LAX MODE: %S is missing, You have the possibility to create a zero byte " "length file under the name of this slice, to replace this missing file. This " "will of course generate error messages about the information that is missing " "in this slice, but at least libdar will be able to continue. Can we continue " "now?" msgstr "" "MODE RELAX : %S est manquant. Vous avez la possibilité de créer un fichier " "de taille nulle de ce nom pour remplacer le fichier manquant. Ceci génèrera " "bien sûr des messages d'erreurs à propos des informations manquantes dans " "cette tranche, mais au moins libdar pourra continuer. Peut on continuer " "maintenant ?" #: src/libdar/sar.cpp:722 #, c-format msgid "%S is required for further operation, please provide the file." msgstr "" "%S est requis pour la suite des opérations, merci de fournir ce fichier." #: src/libdar/sar.cpp:724 #, c-format msgid "" "%S is required for further operation, please provide the file if you have it." msgstr "" "%S est requis pour la suite des opérations, merci de fournir ce fichier si " "vous l'avez." #: src/libdar/sar.cpp:729 #, c-format msgid "Failed reading slice %S: " msgstr "Impossible de lire la tranche %S : " #: src/libdar/sar.cpp:766 #, c-format msgid "%S has a bad or corrupted header, please provide the correct file." msgstr "%S a un en-tête corrompu ou malformé, merci de fournir le bon fichier." #: src/libdar/sar.cpp:770 #, c-format msgid "" "LAX MODE: %S has a bad or corrupted header, trying to guess original values " "and continuing if possible" msgstr "" "MODE RELAX : %S a un en-tête corrompu, tentative de détermination des " "valeurs d'origine puis on continue si c'est possible" #: src/libdar/sar.cpp:780 #, c-format msgid "" "%S is not a valid file (wrong magic number), please provide the good file." msgstr "" "%S n'est pas un fichier valide (mauvais numéro magique), merci de fournir le " "bon fichier." #: src/libdar/sar.cpp:784 #, c-format msgid "" "LAX MODE: In spite of its name, %S does not appear to be a dar slice, " "assuming a data corruption took place and continuing" msgstr "" "MODE RELAX : En dépit de son nom, %S ne semble pas être une tranche " "d'archive, on suppose qu'une corruption des données a eu lieu et on continue" #: src/libdar/sar.cpp:788 msgid "" "This is an old archive, it can only be opened starting by the first slice" msgstr "" "Ceci est une ancienne archive, elle doit être ouverte en lisant d'abord la " "première tranche" #: src/libdar/sar.cpp:815 msgid "" "LAX MODE: Due to probable data corruption, dar could not determine the " "correct size of slices in this archive. For recent archive, this information " "is duplicated in each slice, do you want to try opening another slice to get " "this value if present?" msgstr "" "MODE RELAX : A cause d'une corruption probable des données, libdar ne peut " "déterminer la taille exacte des tranches. Pour des archives récentes, cette " "information est dupliquée dans chaque tranche. Voulez-vous essayer de lire " "une autre tranche pour récupérer cette information ?" #: src/libdar/sar.cpp:819 msgid "LAX MODE: Please provide the slice number to read: " msgstr "MODE RELAX : Merci de fournir le numéro de la tranche à lire : " #: src/libdar/sar.cpp:827 msgid "LAX MODE: Please provide an strictly positive integer number" msgstr "MODE RELAX : Merci de fournir un nombre entier strictement positif" #: src/libdar/sar.cpp:833 #, c-format msgid "LAX MODE: opening slice %i to read its slice header" msgstr "" "MODE RELAX : ouverture de la tranche %i afin de lire l'en-tête de tranche" #: src/libdar/sar.cpp:835 #, c-format msgid "LAX MODE: closing slice %i, header properly fetched" msgstr "" "MODE RELAX : fermeture de la tranche %i, l'en-tête a pu être lu correctement" #: src/libdar/sar.cpp:841 msgid "" "LAX MODE: In spite of a the absence of a known slice size, continuing anyway" msgstr "" "MODE RELAX : On continue malgré l'absence d'information à propos de la " "taille des tranches" #: src/libdar/sar.cpp:848 msgid "Incoherent slice header: First slice size too small" msgstr "En-tête de tranche incohérent : taille de première tranche trop petite" #: src/libdar/sar.cpp:850 msgid "incoherent slice header: Slice size too small" msgstr "En-tête de tranche incohérent : taille de tranche trop petite" #: src/libdar/sar.cpp:856 #, c-format msgid "Error opening %S : " msgstr "Erreur d'ouverture de %S : " #: src/libdar/sar.cpp:856 msgid " . Retry ?" msgstr " . Essayer à nouveau ?" #: src/libdar/sar.cpp:867 msgid " is a slice from another backup, please provide the correct slice." msgstr " est une tranche d'une autre archive, merci de fournir le bon fichier." #: src/libdar/sar.cpp:872 msgid "" "LAX MODE: internal name of the slice leads dar to consider it is not member " "of the same archive. Assuming data corruption occurred and relying on the " "filename of this slice as proof of its membership to the archive" msgstr "" "MODE RELAX : le nom interne de la tranche laisse à penser qu'elle ne fait " "pas partie de la même archive. On suppose qu'il s'agit d'une corruption de " "données et on ignore cette erreur" #: src/libdar/sar.cpp:897 msgid "" "Data corruption met at end of slice, forbidden flag found at this position" msgstr "" "Corruption de données rencontré en fin de tranche, drapeau interdit à cet " "endroit" #: src/libdar/sar.cpp:903 msgid "Data corruption met at end of slice, unknown flag found" msgstr "Corruption de données rencontrée en fin de tranche, drapeau inconnu" #: src/libdar/sar.cpp:918 #, c-format msgid "" "Two different slices (%i and %i) are marked as the last slice of the backup!" msgstr "" "Deux tranches différentes %i et %i sont toutes les deux marquées comme la " "dernière de l'archive !" #: src/libdar/sar.cpp:921 #, c-format msgid "" "LAX MODE: slices %i and %i are both recorded as last slice of the archive, " "keeping the higher number as the real last slice" msgstr "" "MODE RELAX : les tranches %i et %i sont toutes les deux marquées comme la " "dernière de l'archive, on considère que la dernière est celle de numéro le " "plus élevé" #: src/libdar/sar.cpp:944 #, c-format msgid "Slice %S has an unknown flag (neither terminal nor non_terminal file)." msgstr "" "La tranche %S possède un drapeau inconnu (ni terminal ni non-terminal)." #: src/libdar/sar.cpp:954 #, c-format msgid "" "Due to data corruption, it is not possible to know if slice %S is the last " "slice of the archive or not. I need your help to figure out this. At the " "following prompt please answer either one of the following words: \"last\" " "or \"notlast\" according to the nature of this slice (you can also answer " "with \"abort\" to abort the program immediately): " msgstr "" "A cause d'une corruption des données, il n'est pas possible si la tranche %S " "est ou non la dernière de l'archive. Merci de votre aide pour le déterminer. " "A l'invite qui suit, merci de répondre par \"dernier\" ou \"non dernier\" " "selon la nature de cette tranche (vous pouvez-aussi répondre par \"stop\" " "pour arrêter le programme immédiatement) : " #: src/libdar/sar.cpp:956 src/libdar/sar.cpp:960 msgid "last" msgstr "dernier" #: src/libdar/sar.cpp:956 msgid "notlast" msgstr "non dernier" #: src/libdar/sar.cpp:956 src/libdar/sar.cpp:958 msgid "abort" msgstr "stop" #: src/libdar/sar.cpp:972 msgid "" "LAX MODE: Slice flag corrupted, but a slice of higher number has been seen, " "thus the header flag was surely not indicating this slice as the last of the " "archive. Continuing" msgstr "" "MODE RELAX : Le drapeau de tranche est corrompu, mais comme une tranche de " "numéro supérieur a déjà été vu, ce drapeau ne pouvait pas indiquer cette " "tranche comme la dernière de l'archive, on continue" #: src/libdar/sar.cpp:1016 #, c-format msgid "failed openning slice %S: %S. Will try to erase it first, if allowed" msgstr "" "Echec d'ouverture de la tranche %S: %S. Nouvelle tentative avec écrasement " "préalable, si autorisé" #: src/libdar/sar.cpp:1102 msgid "file exists, and DONT_ERASE option is set." msgstr "le fichier existe et l'option contre l'écrasement a été activée." #: src/libdar/sar.cpp:1107 msgid " is about to be overwritten." msgstr " est sur le point d'être écrasé." #: src/libdar/sar.cpp:1185 msgid "" "First slice size is too small to even just be able to drop the slice header" msgstr "" "La taille de la première tranche est trop petite pour être en mesure " "contenir ne serait-ce que l'en-tête de tranche" #: src/libdar/sar.cpp:1187 msgid "Slice size is too small to even just be able to drop the slice header" msgstr "" "La taille de tranche est trop petite pour être en mesure de contenir ne " "serait-ce que l'en-tête de tranche" #: src/libdar/sar.cpp:1250 msgid "Finished writing to file " msgstr "Écriture terminée dans le fichier " #: src/libdar/sar.cpp:1250 msgid ", ready to continue ? " msgstr ", prêt à continuer ? " #: src/libdar/sar.cpp:1255 msgid "" "If you really want to abort the archive creation hit CTRL-C, then press " "enter." msgstr "" "Si vous voulez vraiment arrêter la création de l'archive, appuyez sur CTRL+C " "puis appuyez sur la touche entrée" #: src/libdar/sar.cpp:1287 msgid "file not open" msgstr "Fichier non ouvert" #: src/libdar/sar.cpp:1321 msgid "The last file of the set is not present in " msgstr "Le dernier fichier (tranche) de l'archive n'est pas présent dans " #: src/libdar/sar.cpp:1321 msgid " , please provide it." msgstr " , veuillez le fournir." #: src/libdar/sar.cpp:1335 #, c-format msgid "" "No backup file is present in %S for archive %S, please provide the last file " "of the set." msgstr "" "Aucune tranche n'est présent dans %S pour l'archive %S, merci de fournir la " "dernière tranche de l'archive." #: src/libdar/escape_catalogue.cpp:89 msgid "" "incoherent data after escape sequence, cannot read internal data set label" msgstr "" "incohérence à la suite d'une séquence d'échappement : impossible de lire le " "label interne du jeu de données" #: src/libdar/escape_catalogue.cpp:99 msgid "Could not find tape mark for the internal catalogue" msgstr "Impossible de trouver la séquence d'échappement du catalogue interne" #: src/libdar/escape_catalogue.cpp:429 msgid "" "Escape sequences used for reading lead the archive to place some files out " "of the specified root. To overcome this problem, try reading the archive in " "direct mode (not using sequential reading), try repairing the archive using " "Parchive if redundancy data has been created or in last resort try using the " "lax mode" msgstr "" "Les séquences d'échappement utilisées pour lire l'archive conduisent à " "placer des fichiers en dehors de l'aborescence spécifiée. Pour résoudre ce " "problème, essayer de lire l'archive en mode direct, essayez de réparer " "l'archive avec Parchive si des fichiers de redondance ont été crées ou en " "dernier lieu essayez de lire l'archive en mode relax" #: src/libdar/escape_catalogue.cpp:432 msgid "" "LAX MODE: Archive directory structure is corrupted, it would lead to place " "some files out of the specified root directory. Restoring different " "directory contents at the root not out of it, which will put files of " "different directories in the specified root directory" msgstr "" "La structure de répertoires de l'archive est corrompue, elle conduirait à " "placer des fichiers en dehors de sa racine. Restauration du contenu de tels " "répertoires à la racine et non en dehors" #: src/libdar/escape_catalogue.cpp:447 msgid "" "LAX MODE: found unknown catalogue entry, assuming data corruption occurred. " "Skipping to the next entry, this may lead to improper directory structure " "being restored, if the corrupted data was a directory" msgstr "" "MODE RELAX : entrée inconnue trouvée dans le catalogue, on considère qu'une " "corruption de données a eu lieu. Passage à l'entrée suivante, ce qui peut " "conduire à une mauvaise restauration de la structure de répertoires, si " "cette entrée corrompue était un répertoire" #: src/libdar/escape_catalogue.cpp:454 msgid "Corrupted entry following an escape mark in the archive" msgstr "" "Entrée corrompue dans l'archive à la suite d'une séquence d'échappement" #: src/libdar/escape_catalogue.cpp:483 msgid "" "Uncompleted archive! Assuming it has been interrupted during the backup " "process. If an error has been reported just above, simply ignore it, this is " "about the file that was saved at the time of the interruption." msgstr "" "Archive incomplète ! On considère qu'elle a été interrompue lors du " "processus de sauvegarde. Si une erreur a été reportée juste avant, on peut " "l'ignorer, il s'agit du fichier qui était en cours de sauvegarde au moment " "de l'interruption." #: src/libdar/escape_catalogue.cpp:518 msgid "Cannot extract from the internal catalogue the list of files to remove" msgstr "" "Impossible d'extraire du catalogue interne la liste des fichiers à effacer" #: src/libdar/escape_catalogue.cpp:591 msgid "" "Archive internal catalogue is properly signed but its content does not match " "the tape marks used so far for sequentially reading. Possible data " "corruption or archive compromission occurred! if data extracted in " "sequential read mode does not match the data extracted in direct access " "mode, consider the sequential data has been been modified after the archive " "has been generated" msgstr "" "Le catalogue interne de l'archive est correctement signé mais ne correspond " "pas aux marques de bandes utilisée pour la lecture séquentielle. Il est " "possible qu'une corruption de donnée ou une compromission de l'archive ait " "eu lieu! Si les données extraites en mode séquentiel ne correspondent pas à " "celle extraites en mode drect, on peut considérer que l'archive a été " "modifié suite depuis sa création." #: src/libdar/escape_catalogue.cpp:729 msgid "" "Resetting the sequential reading process of the archive contents while it is " "not finished, will make all data unread so far becoming inaccessible" msgstr "" "Remettre à zéro le processus de lecture séquentielle alors qu'il n'est pas " "terminé, rendra inaccessible toute les données non lues jusque là" #: src/libdar/statistics.cpp:81 msgid "Error while initializing \"mutex\" for class \"statistics\": " msgstr "" "Erreur lors de l'initialisation de \"mutex\" pour la classe \"statistics\" : " #: src/libdar/real_infinint.cpp:69 src/libdar/limitint.hpp:269 msgid "Reached end of file before all data could be read" msgstr "" "Fin de fichier atteinte alors que toutes les données n'ont pu être lues" #: src/libdar/real_infinint.cpp:82 src/libdar/limitint.hpp:282 msgid "Badly formed \"infinint\" or not supported format" msgstr "\"infinint\" malformé ou format non supporté" #: src/libdar/real_infinint.cpp:246 src/libdar/limitint.hpp:420 msgid "" "Subtracting an \"infinint\" greater than the first, \"infinint\" cannot be " "negative" msgstr "" "Soustraction d'un \"infinint\" par un autre plus grand que le premier. Un " "\"infinint\" ne peut pas être négatif" #: src/libdar/real_infinint.cpp:839 src/libdar/limitint.hpp:461 #: src/libdar/limitint.hpp:470 msgid "Division by zero" msgstr "Division par zéro" #: src/libdar/integers.cpp:36 #, c-format msgid "%s type length is not %d byte(s) but %d" msgstr "la longueur du type %s n'est pas %d octet(s) mais %d" #: src/libdar/integers.cpp:44 #, c-format msgid "%s type is not a signed type as expected" msgstr "%s n'est pas un type signé tel attendu" #: src/libdar/integers.cpp:46 #, c-format msgid "%s type is not an unsigned type as expected" msgstr "%s n'est pas un type non signé tel attendu" #: src/libdar/integers.cpp:101 #, c-format msgid "" "type %s is neither big nor little endian! Do not know how to handle integer " "in a portable manner on this host, aborting" msgstr "" "le type %s n'est ni grand-boutiste ni petit-boutiste ! Impossible de savoir " "comment gérer ce type d'entier d'une manière portable sur ce système." #: src/libdar/integers.cpp:154 msgid "incoherent endian between U_16 and U_32" msgstr "boutisme incohérent entre U_16 et U_32" #: src/libdar/integers.cpp:156 msgid "incoherent endian between U_16 and U_64" msgstr "boutisme incohérent entre U_16 et U_64" #: src/libdar/integers.cpp:158 msgid "incoherent endian between U_16 and U_I" msgstr "boutisme incohérent entre U_16 et U_U" #: src/libdar/filesystem_specific_attribute.hpp:243 msgid "true" msgstr "vrai" #: src/libdar/filesystem_specific_attribute.hpp:243 msgid "false" msgstr "faux" #: src/libdar/archive.hpp:146 msgid "Archive copy constructor is not implemented" msgstr "Le constructeur de recopie pour la classe archive n'est pas implémenté" #: src/libdar/archive.hpp:147 msgid "Archive assignment operator is not implemented" msgstr "L'opérateur d'assignation la classe archive n'est pas implémenté" #: src/libdar/database_header.cpp:87 msgid "Cannot create database, file exists" msgstr "Impossible de créer la base, un fichier de même nom existe déjà" #: src/libdar/database_header.cpp:128 #, c-format msgid "Error reading database %S : " msgstr "Erreur lors de la lecture de la base %S : " #: src/libdar/database_header.cpp:135 msgid "" "The format version of this database is too high for that software version, " "use a more recent software to read or modify this database" msgstr "" "La version du format de cette base de données et trop élevé pour cette " "version de logiciel. Utiliser une version du logiciel plus récente pour lire " "ou modifier cette base de donnée" #: src/libdar/database_header.cpp:138 msgid "Unknown header option in database, aborting\n" msgstr "En-tête inconnu dans la base de donnée, abandon\n" #: src/libdar/cat_etoile.cpp:44 msgid "Hard links of directories are not supported" msgstr "Les liens durs pour les répertoires ne sont pas supportés" #: src/libdar/path.cpp:61 src/libdar/path.cpp:83 msgid "Empty string is not a valid path" msgstr "Une chaîne vide n'est pas un chemin valide" #: src/libdar/path.cpp:91 #, c-format msgid "%S is an not a valid path: %S" msgstr "%S n'est pas un chemin valide : %S" #: src/libdar/path.cpp:195 msgid "Cannot add an absolute path" msgstr "Impossible d'ajouter un chemin absolu" #: src/libdar/path.cpp:328 msgid "Empty string as subdirectory does not make a valid path" msgstr "" "Une chaîne vide en tant que sous-répertoire ne donne pas un chemin valide" #: src/libdar/storage.cpp:85 msgid "Not enough data to initialize storage field" msgstr "Pas assez de données pour initialiser le champ \"storage\"" #: src/libdar/storage.cpp:110 msgid "Asking for an element out of array" msgstr "Un élément hors des limites est demandé" #: src/libdar/storage.cpp:162 msgid "The iterator is not indexing the object it has been asked to write to" msgstr "" "L'itérateur n'indexe pas l'objet sur lequel il lui a été demandé d'écrire" #: src/libdar/storage.cpp:196 msgid "The iterator is not indexing the object it has been asked to read from" msgstr "" "L'itérateur n'indexe pas l'objet sur lequel il lui a été demandé de lire" #: src/libdar/storage.cpp:509 msgid "The iterator is not indexing the object it has been defined for" msgstr "L'itérateur n'indexe pas l'objet pour lequel il a été défini" #: src/libdar/storage.cpp:763 src/libdar/storage.cpp:828 msgid "Iterator does not point to data" msgstr "L'itérateur ne pointe pas sur des données" #: src/libdar/storage.cpp:822 msgid "Reference storage of the iterator is empty or non existent" msgstr "Le \"storage\" de référence de l'itérateur est vide ou non existant" #: src/libdar/storage.cpp:839 msgid "The iterator position is not inside the storage of reference" msgstr "" "La position de l'itérateur n'est pas contenue dans le \"storage\" de " "référence" #: src/libdar/entrepot.hpp:79 msgid "root's entrepot must be an absolute path: " msgstr "La racine de l'entrepot doit être une chemin absolu: " #: src/libdar/database.cpp:114 msgid "Badly formatted database" msgstr "Base de donnée malformée" #: src/libdar/database.cpp:162 msgid "Cannot write down a read-only database" msgstr "Impossible d'écrire une base en lecture seule" #: src/libdar/database.cpp:210 msgid "Empty string is an invalid archive basename" msgstr "Une chaîne vide est un nom d'archive invalide" #: src/libdar/database.cpp:212 msgid "Cannot add another archive, database is full" msgstr "Base de donnée pleine, impossible d'ajouter une nouvelle archive" #: src/libdar/database.cpp:238 src/libdar/database.cpp:240 msgid "Incorrect archive range in database" msgstr "Intervalle d'archive incorrecte pour la base" #: src/libdar/database.cpp:267 src/libdar/database.cpp:286 #: src/libdar/database.cpp:403 msgid "Non existent archive in database" msgstr "Archive inexistante dans la base" #: src/libdar/database.cpp:306 src/libdar/database.cpp:308 msgid "Invalid archive number: " msgstr "Numéro d'archive invalide : " #: src/libdar/database.cpp:363 #, c-format msgid "dar path : %S\n" msgstr "chemin de dar : %S\n" #: src/libdar/database.cpp:364 #, c-format msgid "dar options : %S\n" msgstr "options de dar : %S\n" #: src/libdar/database.cpp:365 #, c-format msgid "database version: %d\n" msgstr "version : %d\n" #: src/libdar/database.cpp:367 #, c-format msgid "archive # | path | basename\n" msgstr "num archive | chemin | nom d'archive\n" #: src/libdar/database.cpp:377 msgid "" msgstr "" #: src/libdar/database.cpp:427 msgid "Invalid path, path must be relative" msgstr "Chemin invalide, le chemin doit être relatif" #: src/libdar/database.cpp:433 src/libdar/database.cpp:438 #: src/libdar/database.cpp:442 msgid "Non existent file in database" msgstr "Fichier inexistant dans la base" #: src/libdar/database.cpp:469 #, c-format msgid " archive # | most recent/total data | most recent/total EA\n" msgstr "" " Num. archive | fichier plus récent / total | EA plus récent / total\n" #: src/libdar/database.cpp:470 #, c-format msgid "--------------+-------------------------+-----------------------\n" msgstr "" "--------------+------------------------------+-----------------------\n" #: src/libdar/database.cpp:503 msgid "Checking chronological ordering of files between the archives..." msgstr "" "Vérification de l'ordonnancement chronologique des fichiers entre les " "archives ..." #: src/libdar/database.cpp:526 msgid "File recorded as removed at this date in database: " msgstr "" "Fichier enregistré comme supprimé à cette date dans la base de données : " #: src/libdar/database.cpp:530 msgid "File not found in database: " msgstr "Fichier non trouvé dans la base" #: src/libdar/database.cpp:534 msgid "" "File found in database but impossible to restore (only found \"unchanged\" " "in differential backups): " msgstr "" "Fichier trouvé dans la base mais impossible à restaurer (n'est présent que " "comme \"inchangé\" dans des archives différentielles)" #: src/libdar/database.cpp:556 msgid "" "Extended Attribute of file found in database but impossible to restore (only " "found \"unchanged\" in differential backups): " msgstr "" "Attributs Étendus du fichier trouvés dans la base mais impossibles à " "restaurer (ne sont présents que comme \"inchangés\" dans des archives " "différentielles)" #: src/libdar/database.cpp:578 #, c-format msgid "%S did not exist before specified date and cannot be restored" msgstr "%S n'existait pas avant la date spécifiée et ne peut être restauré" #: src/libdar/database.cpp:600 #, c-format msgid "" "Either archives in database are not properly tidied, or file last " "modification date has been artificially set to an more ancient date. This " "may lead improper Extended Attribute restoration for inode %S" msgstr "" "Soit les archives dans la base ne sont pas correctement rangées, soit la " "date de dernière modification du fichier a été artificiellement modifiée à " "une valeur plus ancienne. Ceci peut mener à une restauration incorrecte des " "Attributs Étendus de l'inode %S" #: src/libdar/database.cpp:620 #, c-format msgid "Cannot restore file %S : non existent file in database" msgstr "" "Impossible de restaurer le fichier %S : fichier inexistant dans le base" #: src/libdar/database.cpp:676 msgid "Error while restoring the following files: " msgstr "Erreur pendant la restauration des fichiers suivants : " #: src/libdar/database.cpp:685 msgid "Cannot restore any file, nothing done" msgstr "Aucun fichier ne peut être restauré, aucune action n'a été réalisée" #: src/libdar/database.cpp:698 src/libdar/database.cpp:706 #, c-format msgid "Invalid archive number: %d" msgstr "Numéro d'archive invalide : %d" #: src/libdar/ea_filesystem.cpp:183 #, c-format msgid "Error while adding EA %s : %s" msgstr "Erreur d'ajout de l'EA %s : %s" #: src/libdar/ea_filesystem.cpp:214 #, c-format msgid "Error while removing %s : %s" msgstr "Erreur de suppression de %s : %s" #: src/libdar/ea_filesystem.cpp:246 src/libdar/ea_filesystem.cpp:274 #, c-format msgid "Error reading attribute %s of file %s : %s" msgstr "Erreur lors de la lecture de l'attribut %s du fichier %s : %s" #: src/libdar/ea_filesystem.cpp:330 src/libdar/ea_filesystem.cpp:348 #, c-format msgid "Error retrieving EA list for %s : %s" msgstr "Erreur lors de l'inventaire des AE pour %s : %s" #: src/libdar/terminateur.cpp:133 msgid "Badly formatted terminator, cannot extract catalogue location: " msgstr "" "Terminateur malformé, la position du catalogue ne peut être déterminée : " #: src/dar_suite/line_tools.cpp:90 src/dar_suite/line_tools.cpp:108 msgid "Index out of range" msgstr "Index hors limites" #: src/dar_suite/line_tools.cpp:237 msgid "Syntax error in --retry-on-change argument: " msgstr "" "Erreur de syntaxe dans l'argument fourni à l'option --retry-on-change : " #: src/dar_suite/line_tools.cpp:252 msgid "Unknown TLV record type" msgstr "Type d'enregistrement inconnu" #: src/dar_suite/line_tools.cpp:293 src/dar_suite/line_tools.cpp:323 msgid "Unbalanced parenthesis in expression: " msgstr "Parenthèses non équilibrées correctement dans l'expression suivante : " #: src/dar_suite/line_tools.cpp:391 #, c-format msgid "Unknown macro %%%d in user comment" msgstr "Macro %%%d inconnue dans le cadre de commentaire utilisateur" #: src/dar_suite/line_tools.cpp:583 #, c-format msgid "Invalid number in string: %S" msgstr "Nombre invalide dans la chaîne : %S" #: src/dar_suite/line_tools.cpp:819 msgid "unknown cryptographic algorithm: " msgstr "algorithme de chiffrement inconnu : " #: src/dar_suite/line_tools.cpp:839 #, c-format msgid "" "| Signature Status| Key Status | Finger Print " "| Signature Date |" msgstr "" "|Etat de signature| Etat de la clef | Emprunte de la " "clef | Date de signature" #: src/dar_suite/hide_file.cpp:33 msgid "hide_file cannot be initialized with write-only file" msgstr "" "\"hide_file\" ne peut pas être initialisé avec un fichier en écriture seule" #: src/dar_suite/dar_cp.cpp:131 #, c-format msgid "usage : %s \n" msgstr "usage : %s \n" #: src/dar_suite/dar_cp.cpp:143 src/dar_suite/dar_slave.cpp:286 #: src/dar_suite/dar_xform.cpp:581 src/dar_suite/dar_manager.cpp:912 #: src/dar_suite/command_line.cpp:2170 #, c-format msgid " compiled the %s with %s version %s\n" msgstr "compilé le %s avec %s version %s\n" #: src/dar_suite/dar_cp.cpp:144 src/dar_suite/dar_slave.cpp:287 #: src/dar_suite/dar_xform.cpp:582 src/dar_suite/dar_manager.cpp:913 #: src/dar_suite/command_line.cpp:2171 #, c-format msgid " %s is part of the Disk ARchive suite (Release %s)\n" msgstr " %s fait partie de la suite Disk ARchive (Release %s)\n" #: src/dar_suite/dar_cp.cpp:145 #, c-format msgid " %s comes with ABSOLUTELY NO WARRANTY; for details type `dar -W'." msgstr "" " %s est fourni SANS AUCUNE GARANTIE; pour les détails\n" " taper `dar -W'." #: src/dar_suite/dar_cp.cpp:146 msgid " This is free software, and you are welcome to redistribute it under" msgstr "" " Ceci est un logiciel libre, vous pouvez\n" " le redistribuer sous certaines conditions ;" #: src/dar_suite/dar_cp.cpp:147 msgid "" " certain conditions; type `dar -L | more' for details.\n" "\n" msgstr "" " taper `dar -L | more'\n" " pour les détails.\n" "\n" #: src/dar_suite/dar_cp.cpp:151 msgid "Unexpected exception from libdar" msgstr "Exception non attendue levée par libdar" #: src/dar_suite/dar_cp.cpp:168 #, c-format msgid "Memory allocation failed : %s" msgstr "Échec de l'allocation mémoire : %s" #: src/dar_suite/dar_cp.cpp:184 #, c-format msgid "Cannot open source file : %s" msgstr "Fichier source impossible à ouvrir : %s" #: src/dar_suite/dar_cp.cpp:195 #, c-format msgid "Cannot open destination file : %s" msgstr "Fichier destination impossible à ouvrir : %s" #: src/dar_suite/dar_cp.cpp:220 #, c-format msgid "Starting the copy of %u byte(s)" msgstr "Début de la copie de %u octet(s)" #: src/dar_suite/dar_cp.cpp:230 #, c-format msgid "" "Error reading source file (we are at %.2f %% of data copied), trying to read " "further: %s\n" msgstr "" "Erreur lors de la lecture du fichier source (%.2f %% des données a été " "copiée), on essaie de lire plus loin : %s\n" #: src/dar_suite/dar_cp.cpp:234 #, c-format msgid "" "Skipping done (missing %.0f byte(s)), found correct data to read, continuing " "the copy...\n" msgstr "" "Saut effectué (manque %.0f octet(s)), données correctes trouvées, on " "continue la copie...\n" #: src/dar_suite/dar_cp.cpp:240 msgid "" "Reached End of File, no correct data could be found after the last error\n" msgstr "" "Fin de fichier atteinte, aucune donnée correcte n'a pu être trouvée après la " "dernière erreur\n" #: src/dar_suite/dar_cp.cpp:248 #, c-format msgid "Copy finished. Missing %.0f byte(s) of data\n" msgstr "Copie terminée. Il manque %.0f octet(s) de données\n" #: src/dar_suite/dar_cp.cpp:249 #, c-format msgid "Which is %.2f %% of the total amount of data\n" msgstr "Ce qui correspond à %.2f %% de la quantité totale de donnés\n" #: src/dar_suite/dar_cp.cpp:258 msgid "Cannot seek back one char" msgstr "Ne peut pas lire un caractère en arrière" #: src/dar_suite/dar_cp.cpp:269 src/dar_suite/dar_cp.cpp:354 msgid "Cannot write to destination, aborting" msgstr "" "Impossible d'écrire dans le fichier destination, abandon de l'opération" #: src/dar_suite/dar_cp.cpp:313 msgid "Cannot seek in file" msgstr "Ne peut pas déplacer la lecture dans le fichier" #: src/dar_suite/dar_cp.cpp:357 #, c-format msgid "Non fatal error while writing to destination file, retrying\n" msgstr "" "Erreur non fatale lors de l'écriture des données, on essaie à nouveau\n" #: src/dar_suite/dar_suite.cpp:147 #, c-format msgid "" "We have linked with an incompatible version of libdar. Expecting version %d." "%d.x but having linked with version %d.%d.%d" msgstr "" "Nous utilisons une version incompatible de libdar. La version attendue est " "%d.%d.x alors que la version actuellement utilisée est %d.%d.%d" #: src/dar_suite/dar_suite.cpp:159 msgid "NOT YET IMPLEMENTED FEATURE has been used: " msgstr "une FONCTIONNALITÉ NON ENCORE IMPLÉMENTÉE a été sollicitée :" #: src/dar_suite/dar_suite.cpp:160 msgid "Please check documentation or upgrade your software if available" msgstr "Merci de vérifier la documentation et/ou de mettre à jour ce logiciel" #: src/dar_suite/dar_suite.cpp:165 msgid "SEEMS TO BE A HARDWARE PROBLEM: " msgstr "IL SEMBLE QU'IL Y AIT UN PROBLÈME MATÉRIEL :" #: src/dar_suite/dar_suite.cpp:166 msgid "Please check your hardware" msgstr "Merci de vérifier votre matériel" #: src/dar_suite/dar_suite.cpp:171 msgid "Lack of SECURED memory to achieve the operation, aborting operation" msgstr "Pas assez de mémoire SÉCURISÉE pour terminer l'opération, abandon" #: src/dar_suite/dar_suite.cpp:176 src/dar_suite/dar_suite.cpp:181 msgid "Lack of memory to achieve the operation, aborting operation" msgstr "Pas assez de mémoire pour terminer l'opération, abandon" #: src/dar_suite/dar_suite.cpp:186 src/dar_suite/dar_suite.cpp:232 msgid "FATAL error, aborting operation" msgstr "Erreur FATALE, abandon" #: src/dar_suite/dar_suite.cpp:192 msgid "Aborting program. User refused to continue while asking: " msgstr "Abandon. L'utilisateur a refusé de continuer lors de la question : " #: src/dar_suite/dar_suite.cpp:197 msgid "Program has been aborted for the following reason: " msgstr "Le programme a été arrêté pour la raison suivante : " #: src/dar_suite/dar_suite.cpp:207 msgid "Aborting program. An error occurred concerning user command execution: " msgstr "" "Abandon. une erreur est survenue lors de l'exécution d'une commande " "utilisateur : " #: src/dar_suite/dar_suite.cpp:212 msgid "Aborting program. An error occurred while calling libdar: " msgstr "Abandon. Une erreur est survenue lors d'un appel à libdar : " #: src/dar_suite/dar_suite.cpp:217 src/dar_suite/dar_suite.cpp:222 msgid "Aborting program. " msgstr "Arrêt du programme. " #: src/dar_suite/dar_suite.cpp:227 msgid "" "Aborting program. The requested operation needs a feature that has been " "disabled at compilation time: " msgstr "" "Abandon. L'opération demandée nécessite une fonctionnalité qui n'a pas été " "activée à la compilation : " #: src/dar_suite/dar_suite.cpp:239 src/dar_suite/dar_suite.cpp:259 msgid "INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINER" msgstr "" "ERREUR INTERNE, MERCI DE RAPPORTER L'AFFICHAGE PRÉCÉDENT AU MAINTENEUR DU " "PROGRAMME" #: src/dar_suite/dar_suite.cpp:258 msgid "CAUGHT A NON (LIB)DAR EXCEPTION" msgstr "EXCEPTION NON (LIB)DAR ATTRAPÉE" #: src/dar_suite/dar_suite.cpp:266 msgid "" "SANITY CHECK: AT LEAST ONE THREAD_CANCELLATION OBJECT HAS NOT BEEN DESTROYED " "AND REMAINS IN MEMORY WHILE THE PROGRAM REACHED ITS END" msgstr "" "AUTO-CONTROL : AU MOINS UNE FILE D'EXÉCUTION N'A PAS ÉTÉ DÉTRUITE ET RESTE " "EN MÉMOIRE ALORS QUE LE PROGRAMME TOUCHE À SA FIN" #: src/dar_suite/dar_suite.cpp:292 #, c-format msgid "Long options support : %s\n" msgstr "Options longues supportées : %s\n" #: src/dar_suite/dar_suite.cpp:308 #, c-format msgid "Received signal: %s" msgstr "Signal %s reçu" #: src/dar_suite/dar_suite.cpp:310 #, c-format msgid "Received signal: %d" msgstr "Signal reçu : %d" #: src/dar_suite/dar_suite.cpp:316 msgid "Archive fast termination engaged" msgstr "Mise en route de la procédure de terminaison rapide de l'archive" #: src/dar_suite/dar_suite.cpp:320 msgid "Archive delayed termination engaged" msgstr "Mise en route de la procédure de terminaison de l'archive" #: src/dar_suite/dar_suite.cpp:324 msgid "" "Disabling signal handler, the next time this signal is received the program " "will abort immediately" msgstr "" "Désactivation du gestionnaire de signal. La prochaine réception de ce signal " "arrêtera immédiatement le programme" #: src/dar_suite/dar_suite.cpp:328 msgid "" "Cannot cleanly abort the operation, thread-safe support is missing, will " "thus abruptly stop the program, generated archive may be unusable" msgstr "" "Impossible d'arrêter proprement l'opération, l'absence de support pour un " "environnement multi-tâches arrêtera abruptement le programme, en conséquence " "l'archive générée risque fortement d'être inutilisable." #: src/dar_suite/dar_slave.cpp:175 msgid "Cannot read arguments on command line, aborting" msgstr "Impossible de lire les arguments en ligne de commande, abandon" #: src/dar_suite/dar_slave.cpp:185 msgid "Missing argument to -i option" msgstr "Pas d'argument à l'option -i" #: src/dar_suite/dar_slave.cpp:193 msgid "Missing argument to -o option" msgstr "Pas d'argument à l'option -o" #: src/dar_suite/dar_slave.cpp:207 msgid "Missing argument to -E option" msgstr "Pas d'argument à l'option -E" #: src/dar_suite/dar_slave.cpp:217 src/dar_suite/dar_xform.cpp:470 #: src/dar_suite/command_line.cpp:1611 msgid "Missing argument to --min-digits" msgstr "Il manque un argument à --min-digits" #: src/dar_suite/dar_slave.cpp:225 src/dar_suite/dar_xform.cpp:478 #, c-format msgid "Missing parameter to option -%c" msgstr "Pas d'argument à l'option -%c" #: src/dar_suite/dar_slave.cpp:227 src/dar_suite/dar_slave.cpp:230 #: src/dar_suite/dar_xform.cpp:480 src/dar_suite/dar_manager.cpp:495 #: src/dar_suite/dar_manager.cpp:498 src/dar_suite/command_line.cpp:1692 #: src/dar_suite/command_line.cpp:1695 #, c-format msgid "Ignoring unknown option -%c" msgstr "Option inconnue -%c ignorée" #: src/dar_suite/dar_slave.cpp:236 msgid "Missing archive basename, see -h option for help" msgstr "Il manque le nom de base de l'archive, voir l'option -h pour l'aide" #: src/dar_suite/dar_slave.cpp:242 src/dar_suite/dar_xform.cpp:495 msgid "Too many argument on command line, see -h option for help" msgstr "" "Trop d'arguments sur la ligne de commande, voir l'option -h pour l'aide" #: src/dar_suite/dar_slave.cpp:262 src/dar_suite/dar_slave.cpp:267 #: src/dar_suite/dar_xform.cpp:542 src/dar_suite/dar_xform.cpp:544 #: src/dar_suite/dar_xform.cpp:546 src/dar_suite/dar_xform.cpp:561 #: src/dar_suite/dar_manager.cpp:866 src/dar_suite/dar_manager.cpp:889 #: src/dar_suite/dar_manager.cpp:892 src/dar_suite/command_line.cpp:1711 #: src/dar_suite/command_line.cpp:1720 src/dar_suite/command_line.cpp:1723 #: src/dar_suite/command_line.cpp:1761 src/dar_suite/command_line.cpp:1786 #: src/dar_suite/command_line.cpp:1791 src/dar_suite/command_line.cpp:1795 #, c-format msgid "\n" msgstr "\n" #: src/dar_suite/dar_slave.cpp:263 src/dar_suite/dar_xform.cpp:547 #: src/dar_suite/command_line.cpp:1724 #, c-format msgid "Common options:\n" msgstr "Options communes :\n" #: src/dar_suite/dar_slave.cpp:264 #, c-format msgid "" " -i pipe to use instead of std input to read orders from dar\n" msgstr "" " -i tube à utiliser à la place de l'entrée standard pour lire " "les ordres de dar\n" #: src/dar_suite/dar_slave.cpp:265 #, c-format msgid "" " -o pipe to use instead of std output to write data to dar\n" msgstr "" " -o tube à utiliser en place de la sortie standard pour " "envoyer les données à dar\n" #: src/dar_suite/dar_slave.cpp:266 #, c-format msgid "" " -E \t command line to execute between slices of the archive\n" msgstr "" " -E \t ligne de commande à exécuter entre les tranches d'une " "archive\n" #: src/dar_suite/dar_slave.cpp:268 src/dar_suite/dar_xform.cpp:562 #: src/dar_suite/dar_manager.cpp:893 #, c-format msgid "See man page for more options.\n" msgstr "Voir la page de manuel pour plus d'options.\n" #: src/dar_suite/dar_slave.cpp:281 src/dar_suite/dar_xform.cpp:576 #: src/dar_suite/dar_manager.cpp:907 #, c-format msgid " Using libdar %u.%u.%u built with compilation time options:\n" msgstr " Libdar %u.%u.%u utilisée, compilé avec les options :\n" #: src/dar_suite/dar_slave.cpp:283 src/dar_suite/dar_xform.cpp:578 #: src/dar_suite/dar_manager.cpp:909 #, c-format msgid " Using libdar %u.%u built with compilation time options:\n" msgstr " Libdar %u%u utilisé, compilé avec les options :\n" #: src/dar_suite/dar_slave.cpp:288 #, c-format msgid " %s comes with ABSOLUTELY NO WARRANTY;" msgstr " %s est fourni sans AUCUNE GARANTIE ; " #: src/dar_suite/dar_slave.cpp:289 msgid "" " for details\n" " type `dar -W'." msgstr "" "Pour les détails\n" "taper `dar -W'." #: src/dar_suite/dar_slave.cpp:290 src/dar_suite/dar_xform.cpp:584 #: src/dar_suite/dar_manager.cpp:915 src/dar_suite/command_line.cpp:2173 msgid "" " This is free software, and you are welcome\n" " to redistribute it under certain conditions;" msgstr "" " Ceci est un logiciel libre, vous pouvez\n" " le redistribuer sous certaines conditions ;" #: src/dar_suite/dar_slave.cpp:291 msgid "" " type `dar -L | more'\n" " for details.\n" "\n" msgstr "" " taper `dar -L | more'\n" " pour les détails.\n" "\n" #: src/dar_suite/crit_action_cmd_line.cpp:116 msgid "Missing } in conditional statement: " msgstr "Il manque un } dans la condition suivante : " #: src/dar_suite/crit_action_cmd_line.cpp:120 msgid "Missing [ after } in conditional statement: " msgstr "Il manque un [ après un } dans la condition suivante : " #: src/dar_suite/crit_action_cmd_line.cpp:123 msgid "Missing ] in conditional statement: " msgstr "Il manque un ] dans la condition suivante : " #: src/dar_suite/crit_action_cmd_line.cpp:201 #, c-format msgid "Unknown policy for data '%c' in expression %S" msgstr "La politique '%c' est inconnue pour les données dans l'expression %S" #: src/dar_suite/crit_action_cmd_line.cpp:234 #, c-format msgid "Unknown policy for EA '%c' in expression %S" msgstr "La politique '%c' est inconnue pour les AE dans l'expression %S" #: src/dar_suite/crit_action_cmd_line.cpp:244 msgid "Unknown expression in overwriting policy: " msgstr "Expression inconnue dans la politique d'écrasement : " #: src/dar_suite/crit_action_cmd_line.cpp:427 msgid "Unknown atomic operator, or atomic not allowed with an argument: " msgstr "Opérateur unitaire inconnu ou non autorisé avec un argument : " #: src/dar_suite/crit_action_cmd_line.cpp:506 msgid "Unknown character found while parsing conditional string: " msgstr "" "Caractère inconnu trouvé lors de l'analyse de la chaîne conditionnelle " "suivante : " #: src/dar_suite/crit_action_cmd_line.cpp:515 msgid "Unknown expression found while parsing conditional string: " msgstr "" "Expression inconnue trouvée lors de l'analyse de la chaîne conditionnelle " "suivante : " #: src/dar_suite/dar_xform.cpp:268 msgid "Error transforming the archive :" msgstr "Erreur lors de la transformation de l'archive : " #: src/dar_suite/dar_xform.cpp:351 src/dar_suite/command_line.cpp:968 msgid "Only one -s option is allowed" msgstr "Une seule option -s est permise" #: src/dar_suite/dar_xform.cpp:353 msgid "Missing argument to -s" msgstr "Il manque un argument à -s" #: src/dar_suite/dar_xform.cpp:364 msgid "Invalid size for option -s" msgstr "Taille invalide donnée via l'option -s" #: src/dar_suite/dar_xform.cpp:371 msgid "Missing argument to -S" msgstr "Il manque un argument à l'option -S" #: src/dar_suite/dar_xform.cpp:376 src/dar_suite/dar_xform.cpp:394 #: src/dar_suite/command_line.cpp:993 src/dar_suite/command_line.cpp:1011 msgid "Only one -S option is allowed" msgstr "Une seule option -S est permise" #: src/dar_suite/dar_xform.cpp:384 msgid "Giving -S option the same value as the one given to -s is useless" msgstr "" "Donner à l'option -S la même valeur que celle donnée à l'option -s est " "inutile" #: src/dar_suite/dar_xform.cpp:388 msgid "Invalid size for option -S" msgstr "Taille invalide donnée via l'option -S" #: src/dar_suite/dar_xform.cpp:425 msgid "Missing argument to -E" msgstr "Il manque un argument à l'option -E" #: src/dar_suite/dar_xform.cpp:433 msgid "Missing argument to -F" msgstr "Il manque un argument à l'option -F" #: src/dar_suite/dar_xform.cpp:441 src/dar_suite/command_line.cpp:1327 msgid "-a option requires an argument" msgstr "Il manque un argument à l'option -a" #: src/dar_suite/dar_xform.cpp:448 msgid "Unknown parameter given to -a option: " msgstr "Paramètre inconnu donné à l'option -a : " #: src/dar_suite/dar_xform.cpp:454 msgid "Missing argument to -^" msgstr "Il manque un argument à -^" #: src/dar_suite/dar_xform.cpp:459 src/dar_suite/command_line.cpp:1597 msgid "Missing argument to --hash" msgstr "Il manque un argument à --hash" #: src/dar_suite/dar_xform.cpp:466 src/dar_suite/command_line.cpp:1607 msgid "Unknown parameter given to --hash option: " msgstr "Paramètre inconnu donné à l'option --hash : " #: src/dar_suite/dar_xform.cpp:490 msgid "" "Missing source or destination argument on command line, see -h option for " "help" msgstr "Il manque la source ou la destination, voir l'option -h pour l'aide" #: src/dar_suite/dar_xform.cpp:505 msgid "Invalid argument as source archive" msgstr "Argument invalide donné comme archive source" #: src/dar_suite/dar_xform.cpp:512 msgid "Invalid argument as destination archive" msgstr "Argument invalide donné comme archive destination" #: src/dar_suite/dar_xform.cpp:518 msgid "Archive on stdout is not compatible with slicing (-s option)" msgstr "" "La production d'archive sur stdout n'est pas compatible avec plusieurs " "tranches (option -s)" #: src/dar_suite/dar_xform.cpp:543 #, c-format msgid "\t\t the first non options argument is the archive to read\n" msgstr "" "\t\t le premier argument qui n'est pas une option est le nom de l'archive à " "lire\n" #: src/dar_suite/dar_xform.cpp:545 #, c-format msgid "\t\t the second non option argument is the archive to create\n" msgstr "" "\t\t le second argument qui n'est pas une option et le nom de l'archive à " "créer\n" #: src/dar_suite/dar_xform.cpp:548 src/dar_suite/dar_manager.cpp:887 #, c-format msgid " -h\t\t displays this help information\n" msgstr " -h\t\t affiche cette page d'aide\n" #: src/dar_suite/dar_xform.cpp:549 #, c-format msgid " -V\t\t displays version information\n" msgstr " -V\t\t affiche la version\n" #: src/dar_suite/dar_xform.cpp:550 src/dar_suite/command_line.cpp:1769 #, c-format msgid "" " -s split the archive in several files of size \n" msgstr "" " -s coupe l'archive en tranches de taille octets\n" #: src/dar_suite/dar_xform.cpp:551 #, c-format msgid " -S first file size\n" msgstr " -S taille de la première tranche\n" #: src/dar_suite/dar_xform.cpp:552 src/dar_suite/command_line.cpp:1773 #, c-format msgid " -p\t\t pauses before writing to a new file\n" msgstr " -p\t\t arrêt (pause) après chaque tranche\n" #: src/dar_suite/dar_xform.cpp:553 src/dar_suite/command_line.cpp:1735 #, c-format msgid " -n\t\t don't overwrite files\n" msgstr " -n\t\t ne pas écraser de fichier\n" #: src/dar_suite/dar_xform.cpp:554 src/dar_suite/command_line.cpp:1736 #, c-format msgid " -w\t\t don't warn before overwriting files\n" msgstr " -w\t\t ne pas avertir avant un écrasement de fichier\n" #: src/dar_suite/dar_xform.cpp:555 src/dar_suite/command_line.cpp:1738 #, c-format msgid " -b\t\t ring the terminal bell when user action is required\n" msgstr " -b\t\tfait sonner le terminal pour solliciter l'utilisateur\n" #: src/dar_suite/dar_xform.cpp:556 #, c-format msgid "" " -E \t command to execute between slices of destination archive\n" msgstr "" " -E \t commande à exéctuer après chaque tranche de l'archive " "destination\n" #: src/dar_suite/dar_xform.cpp:557 #, c-format msgid " -F \t command to execute between slice of source archive\n" msgstr "" " -F \t commande à exécuter avant chaque tranche de l'archive " "source\n" #: src/dar_suite/dar_xform.cpp:558 src/dar_suite/command_line.cpp:1771 #, c-format msgid " -aSI \t slice size suffixes k, M, T, G, etc. are power of 10\n" msgstr "" " -aSI \t signification des suffixes k, M, T, G, etc. comme puissances de " "10\n" #: src/dar_suite/dar_xform.cpp:559 src/dar_suite/command_line.cpp:1772 #, c-format msgid " -abinary\t slice size suffixes k, M, T, G, etc. are power of 2\n" msgstr "" " -abinary\t signification des suffixes k, M, T, G, etc. comme puissances " "de 2\n" #: src/dar_suite/dar_xform.cpp:560 src/dar_suite/command_line.cpp:1785 #, c-format msgid " -^ \t permission[:user[:group]] of created slices\n" msgstr "" " -^ \t permission[:utilisateur[:groupe]] pour la création des " "tranches\n" #: src/dar_suite/dar_xform.cpp:583 src/dar_suite/dar_manager.cpp:914 #: src/dar_suite/command_line.cpp:2172 #, c-format msgid "" " %s comes with ABSOLUTELY NO WARRANTY; for details\n" " type `%s -W'." msgstr "" " %s est fourni SANS AUCUNE GARANTIE ; pour les détails\n" " taper '%s -W'." #: src/dar_suite/dar_xform.cpp:585 src/dar_suite/dar_manager.cpp:916 #: src/dar_suite/command_line.cpp:2174 #, c-format msgid "" " type `%s -L | more'\n" " for details.\n" "\n" msgstr "" " taper '%s -L | more'\n" "pour les détails.\n" "\n" #: src/dar_suite/dar.cpp:133 msgid "Considering the (first) archive of reference:" msgstr "Traitement de la (première) archive de référence :" #: src/dar_suite/dar.cpp:155 src/dar_suite/dar.cpp:195 msgid "" "Using sequential reading mode for archive source is not possible for merging " "operation" msgstr "" "le mode de lecture séquentiel n'est pas possible lors de la fusion d'archive" #: src/dar_suite/dar.cpp:172 msgid "Considering the second (alias auxiliary) archive of reference:" msgstr "Prise en compte de l'archive de référence auxilaire :" #: src/dar_suite/dar.cpp:239 src/dar_suite/dar.cpp:303 #: src/dar_suite/dar.cpp:397 src/dar_suite/dar.cpp:468 msgid "Archive signature is only possible with gnupg encryption" msgstr "La signature d'un archive n'est possible qu'avec le chiffrement gnupg" #: src/dar_suite/dar.cpp:340 msgid "" "Making room in memory (releasing memory used by archive of reference)..." msgstr "" "Nettoyage mémoire (libération de la mémoire utilisée par l'archive de " "référence) ..." #: src/dar_suite/dar.cpp:368 msgid "Now performing on-fly isolation..." msgstr "Réalisation de l'isolation à la volée ..." #: src/dar_suite/dar.cpp:590 msgid "All files asked could not be restored" msgstr "Tous les fichiers demandés n'ont pu être restaurés" #: src/dar_suite/dar.cpp:669 msgid "Some file comparisons failed" msgstr "Des comparaisons de fichier ont échoué" #: src/dar_suite/dar.cpp:740 msgid "" "Some files are corrupted in the archive and it will not be possible to " "restore them" msgstr "" "Certains fichiers sont corrompus dans l'archive et ne pourront pas être " "restaurés" #: src/dar_suite/dar.cpp:790 msgid "Continue listing archive contents?" msgstr "Continuer avec le contenu de l'archive ?" #: src/dar_suite/dar.cpp:811 src/dar_suite/dar.cpp:832 msgid "Final memory cleanup..." msgstr "Finalisation du nettoyage de la mémoire ..." #: src/dar_suite/dar.cpp:890 #, c-format msgid " %i inode(s) saved\n" msgstr " %i inode(s) sauvées\n" #: src/dar_suite/dar.cpp:891 #, c-format msgid " including %i hard link(s) treated\n" msgstr " avec %i lien(s) physique(s) enregistré(s)\n" #: src/dar_suite/dar.cpp:892 #, c-format msgid "" " %i inode(s) changed at the moment of the backup and could not be saved " "properly\n" msgstr "" " %i inode(s) modifiée(s) au moment de sa (leurs) sauvegarde n'a (n'ont) pas " "pu être sauvée correctement\n" #: src/dar_suite/dar.cpp:893 #, c-format msgid " %i byte(s) have been wasted in the archive to resave changing files" msgstr "" "%i octet(s) ont été gaspillé(s) dans l'archive lors de re-tentatives de " "sauvegarde de fichiers ayant changés" #: src/dar_suite/dar.cpp:894 #, c-format msgid " %i inode(s) not saved (no inode/file change)\n" msgstr " %i inode(s) non sauvées (pas de changement)\n" #: src/dar_suite/dar.cpp:895 #, c-format msgid " %i inode(s) failed to be saved (filesystem error)\n" msgstr "" " %i sauvegarde(s) d'inode(s) échouée(s) (erreur du système de fichiers)\n" #: src/dar_suite/dar.cpp:896 src/dar_suite/dar.cpp:926 #: src/dar_suite/dar.cpp:986 #, c-format msgid " %i inode(s) ignored (excluded by filters)\n" msgstr " %i inode(s) ignoré(s) (exclus par les filtres)\n" #: src/dar_suite/dar.cpp:897 #, c-format msgid " %i inode(s) recorded as deleted from reference backup\n" msgstr "" " %i fichier(s) enregistré(s) comme supprimé(s) depuis l'archive de " "référence\n" #: src/dar_suite/dar.cpp:899 src/dar_suite/dar.cpp:930 #: src/dar_suite/dar.cpp:994 #, c-format msgid " Total number of inode(s) considered: %i\n" msgstr " Nombre total d'inode(s) considérée(s) : %i\n" #: src/dar_suite/dar.cpp:902 src/dar_suite/dar.cpp:990 #, c-format msgid " EA saved for %i inode(s)\n" msgstr " Attributs Étendus sauvés pour %i inode(s)\n" #: src/dar_suite/dar.cpp:904 src/dar_suite/dar.cpp:992 #, c-format msgid " FSA saved for %i inode(s)\n" msgstr " FSA sauvés pour %i inode(s)\n" #: src/dar_suite/dar.cpp:922 #, c-format msgid " %i inode(s) restored\n" msgstr " %i inode(s) restauré(s)\n" #: src/dar_suite/dar.cpp:923 #, c-format msgid " including %i hard link(s)\n" msgstr " avec %i lien(s) physique(s)\n" #: src/dar_suite/dar.cpp:924 #, c-format msgid " %i inode(s) not restored (not saved in archive)\n" msgstr " %i inode(s) non restaurée(s) (non sauvée(s) dans l'archive)\n" #: src/dar_suite/dar.cpp:925 #, c-format msgid " %i inode(s) not restored (overwriting policy decision)\n" msgstr "" " %i inode(s) non restaurée(s) (décision de la politique d'écrasement)\n" #: src/dar_suite/dar.cpp:927 #, c-format msgid " %i inode(s) failed to restore (filesystem error)\n" msgstr " %i inode(s) n'ayant pu être restaurée(s) (erreur système)\n" #: src/dar_suite/dar.cpp:928 #, c-format msgid " %i inode(s) deleted\n" msgstr " %i inode(s) supprimée(s)\n" #: src/dar_suite/dar.cpp:933 #, c-format msgid " EA restored for %i inode(s)\n" msgstr " Attributs Étendus restaurés pour %i inode(s)\n" #: src/dar_suite/dar.cpp:935 #, c-format msgid " FSA restored for %i inode(s)\n" msgstr " FSA restaurés pour %i inode(s)\n" #: src/dar_suite/dar.cpp:947 src/dar_suite/dar.cpp:964 #, c-format msgid " %i item(s) treated\n" msgstr " %i entrée(s) traitée(s)\n" #: src/dar_suite/dar.cpp:948 #, c-format msgid " %i item(s) do not match those on filesystem\n" msgstr "" " %i entrée(s) ne correspond(ent) pas à ce qui est sur le système de " "fichiers\n" #: src/dar_suite/dar.cpp:949 src/dar_suite/dar.cpp:966 #, c-format msgid " %i item(s) ignored (excluded by filters)\n" msgstr " %i entrée(s) ignorée(s) (exclus par les filtres)\n" #: src/dar_suite/dar.cpp:951 src/dar_suite/dar.cpp:968 #, c-format msgid " Total number of items considered: %i\n" msgstr " Nombre total d'entrée(s) considérée(s) : %i\n" #: src/dar_suite/dar.cpp:965 #, c-format msgid " %i item(s) with error\n" msgstr " %i entrée(s) avec erreur\n" #: src/dar_suite/dar.cpp:984 #, c-format msgid " %i inode(s) added to archive\n" msgstr " %i inode(s) ajoutée(s) à l'archive\n" #: src/dar_suite/dar.cpp:985 #, c-format msgid " with %i hard link(s) recorded\n" msgstr " avec %i lien(s) physique(s) enregistré(s)\n" #: src/dar_suite/dar.cpp:987 #, c-format msgid " %i inode(s) recorded as deleted\n" msgstr " %i inode(s) enregistrée(s) comme supprimée(s)\n" #: src/dar_suite/dar_manager.cpp:230 msgid "Decompressing and loading database header to memory..." msgstr "" "Décompression et chargement de l'en-tête de la base de donnée en mémoire..." #: src/dar_suite/dar_manager.cpp:232 msgid "Decompressing and loading database to memory..." msgstr "Décompression et chargement de la base de données en mémoire ..." #: src/dar_suite/dar_manager.cpp:244 msgid "Error met while processing operation: " msgstr "Erreur lors du traitement de l'opération : " #: src/dar_suite/dar_manager.cpp:314 msgid "-B option cannot be given inside a batch file" msgstr "" "l'option -B ne peut pas être utilisée à l'intérieur d'un fichier de " "traitement par lot" #: src/dar_suite/dar_manager.cpp:451 msgid "Running batch file from a batch file is not allowed" msgstr "" "Lancer un fichier de traitement par lot à partir d'un autre fichier de " "traitement par lot n'est pas autorisée" #: src/dar_suite/dar_manager.cpp:467 msgid "-9 option is only valid after -A option, ignoring it" msgstr "" "l'option -9 n'est valide uniquement qu'après l'option -A et sera ignorée ici" #: src/dar_suite/dar_manager.cpp:480 #, c-format msgid "invalid number give to -; option: %s" msgstr "L'argument fourni à l'option -; est un nombre invalide : %s" #: src/dar_suite/dar_manager.cpp:523 msgid "-e option is only available when using -r option, aborting" msgstr "" "-e n'est disponible qu'avec l'option -r, abandon de l'opération en cours" #: src/dar_suite/dar_manager.cpp:530 msgid "No action specified, aborting" msgstr "Aucune action spécifiée, abandon" #: src/dar_suite/dar_manager.cpp:542 src/dar_suite/dar_manager.cpp:546 msgid "Ignoring extra arguments on command line" msgstr "Les arguments supplémentaires sur la ligne de commande sont ignorés" #: src/dar_suite/dar_manager.cpp:552 src/dar_suite/dar_manager.cpp:569 msgid "Missing argument to command line, aborting" msgstr "Pas assez d'arguments sur la ligne de commande, abandon" #: src/dar_suite/dar_manager.cpp:561 msgid "Arguments to -r must be relative path (never begin by '/')" msgstr "" "L'argument donnée à l'option -r doit être un chemin relatif (jamais " "commencer par '/')" #: src/dar_suite/dar_manager.cpp:583 msgid "No database specified, aborting" msgstr "Pas de base de donnée spécifiée, abandon" #: src/dar_suite/dar_manager.cpp:589 msgid "Parse error on command line (or included files): " msgstr "Erreur de syntaxe en ligne de commande (ou dans un fichier inclus) : " #: src/dar_suite/dar_manager.cpp:602 msgid "Creating file..." msgstr "Création de fichier ..." #: src/dar_suite/dar_manager.cpp:603 msgid "Formatting file as an empty database..." msgstr "Mise en forme du fichier en base de donnée vide ..." #: src/dar_suite/dar_manager.cpp:607 msgid "Database has been successfully created empty." msgstr "La base de donnée a été initialisée avec succès." #: src/dar_suite/dar_manager.cpp:622 src/dar_suite/dar_manager.cpp:1091 msgid "Reading catalogue of the archive to add..." msgstr "Lecture du catalogue de l'archive à ajouter ..." #: src/dar_suite/dar_manager.cpp:636 src/dar_suite/dar_manager.cpp:1100 msgid "Updating database with catalogue..." msgstr "Ajout des informations issues du catalogue à la base de donnée..." #: src/dar_suite/dar_manager.cpp:643 src/dar_suite/dar_manager.cpp:837 #: src/dar_suite/dar_manager.cpp:1103 src/dar_suite/dar_manager.cpp:1133 #: src/dar_suite/dar_manager.cpp:1227 msgid "Checking date ordering of files between archives..." msgstr "Vérification de l'ordonnancement des dates entre les archives ..." #: src/dar_suite/dar_manager.cpp:657 src/dar_suite/dar_manager.cpp:841 #: src/dar_suite/dar_manager.cpp:1229 msgid "" "Some files do not follow chronological order when archive index increases " "withing the database, this can lead dar_manager to restored a wrong version " "of these files" msgstr "" "Certains fichiers ne sont pas rangés par ordre chronologique en suivant des " "indices croissants d'archive au sein de la base de donnée, ceci peut amener " "dar_manager à ne pas restaurer la bonne version d'un de ces fichiers" #: src/dar_suite/dar_manager.cpp:684 src/dar_suite/dar_manager.cpp:1122 msgid "Removing information from the database..." msgstr "Suppression des informations de la base ..." #: src/dar_suite/dar_manager.cpp:704 src/dar_suite/dar_manager.cpp:724 #: src/dar_suite/dar_manager.cpp:738 src/dar_suite/dar_manager.cpp:752 msgid "Changing database header information..." msgstr "Mise à jour des en-têtes de la base de données ..." #: src/dar_suite/dar_manager.cpp:769 msgid "" "Looking in archives for requested files, classifying files archive by " "archive..." msgstr "" "Recherche des archives contenant les versions les plus récentes des fichiers " "et tri des fichiers par archive à utiliser pour la restauration ..." #: src/dar_suite/dar_manager.cpp:816 src/dar_suite/dar_manager.cpp:1152 msgid "Computing statistics..." msgstr "Calcul des statistiques ..." #: src/dar_suite/dar_manager.cpp:826 msgid "" "Negative number or zero not allowed when moving an archive inside a database" msgstr "" "Nombre négatif ou nul non autorisé pour le déplacement d'une archive au sein " "de la base" #: src/dar_suite/dar_manager.cpp:833 msgid "Changing database information..." msgstr "Mise à jour des informations de la base de données ..." #: src/dar_suite/dar_manager.cpp:867 #, c-format msgid "Commands:\n" msgstr "Commandes :\n" #: src/dar_suite/dar_manager.cpp:868 #, c-format msgid " -C creates an empty database\n" msgstr " -C création d'une base vide\n" #: src/dar_suite/dar_manager.cpp:869 #, c-format msgid " -B specify the database to use (read or modify)\n" msgstr " -B base de donnée à utiliser\n" #: src/dar_suite/dar_manager.cpp:870 #, c-format msgid " -A add an archive to the database\n" msgstr " -A ajoute une archive à la base\n" #: src/dar_suite/dar_manager.cpp:871 #, c-format msgid "" " -l\t\t gives information about the archive compiled in the database\n" msgstr " -l\t\t affiche les archives utilisées dans la base de donnée\n" #: src/dar_suite/dar_manager.cpp:872 #, c-format msgid " -D delete an archive from the database\n" msgstr " -D suppression d'archives de la base\n" #: src/dar_suite/dar_manager.cpp:873 #, c-format msgid "" " -b \t change the basename to use for the give archive number\n" msgstr "" " -b \t change le nom de base de l'archive dont le numéro est " "donnée\n" #: src/dar_suite/dar_manager.cpp:874 #, c-format msgid "" " -p \t change the path to use for the given archive number\n" msgstr "" " -p \t change le chemin associé à l'archive du numéro donné en " "argument\n" #: src/dar_suite/dar_manager.cpp:875 #, c-format msgid " -o specify a list of option to always pass to dar\n" msgstr " -o liste d'options à transmettre à dar\n" #: src/dar_suite/dar_manager.cpp:876 #, c-format msgid " -d specify the path to dar\n" msgstr " -d chemin de la commande dar\n" #: src/dar_suite/dar_manager.cpp:877 #, c-format msgid " -r \t restores the given files\n" msgstr " -r \t restauration des fichiers spécifiés\n" #: src/dar_suite/dar_manager.cpp:878 #, c-format msgid "" " -w \t only with -r, restores in state just before the given date\n" msgstr "" " -w \t uniquement avec -r, restaure les fichiers dans leur état à " "la date donnée\n" #: src/dar_suite/dar_manager.cpp:879 #, c-format msgid "" " -u \t list the most recent files contained in the given " "archive\n" msgstr "" " -u \t liste les fichiers les plus récents contenus dans " "l'archive donnée\n" #: src/dar_suite/dar_manager.cpp:880 #, c-format msgid " -f \t list the archives where the given file is present\n" msgstr "" " -f \t liste les archives où est présent le fichier donnée\n" #: src/dar_suite/dar_manager.cpp:881 #, c-format msgid " -s\t\t shows the number of most recent file by archive\n" msgstr "" " -s\t\t affiche la quantité de fichiers les plus récent par archive\n" #: src/dar_suite/dar_manager.cpp:882 #, c-format msgid " -m \t move an archive within a given database.\n" msgstr " -m \t change la position d'une archive dans une base.\n" #: src/dar_suite/dar_manager.cpp:883 #, c-format msgid " -i\t\t user interactive mode\n" msgstr " -i\t\t mode interactif\n" #: src/dar_suite/dar_manager.cpp:884 #, c-format msgid " -c\t\t check database for dates order\n" msgstr " -c\t\t vérifie la base pour l'ordonnancement des dates\n" #: src/dar_suite/dar_manager.cpp:885 #, c-format msgid "" " -L execute on a given database a batch of action as defined " "by\n" msgstr "" " -L exécute un fichier de traitement par lot sur une base tel " "défini par\n" #: src/dar_suite/dar_manager.cpp:886 #, c-format msgid "\t\t the provided file.\n" msgstr "\t\t le fichier fourni.\n" #: src/dar_suite/dar_manager.cpp:888 #, c-format msgid " -V\t\t displays software version\n" msgstr " -V\t\t Informations de version\n" #: src/dar_suite/dar_manager.cpp:890 #, c-format msgid "Options:\n" msgstr "Options :\n" #: src/dar_suite/dar_manager.cpp:891 #, c-format msgid " -v\t\t display more information about what is going on\n" msgstr " -v\t\t mode verbeux\n" #: src/dar_suite/dar_manager.cpp:973 msgid "Corrupted database :" msgstr "Base de données corrompue : " #: src/dar_suite/dar_manager.cpp:1022 #, c-format msgid "" "\n" "\n" "\t Dar Manager Database used [%s] : %S\n" msgstr "" "\n" "\n" "\t Base de donnée utilisée [%s] : %S\n" #: src/dar_suite/dar_manager.cpp:1022 msgid "Saved" msgstr "Sauvé" #: src/dar_suite/dar_manager.cpp:1022 msgid "Not Saved" msgstr "Non Sauvé" #: src/dar_suite/dar_manager.cpp:1024 #, c-format msgid "" "\t Pause each %d line of output\n" "\n" msgstr "" "\t Pause toutes les %d lignes d'affichage\n" "\n" #: src/dar_suite/dar_manager.cpp:1026 #, c-format msgid "" "\t No pause in output\n" "\n" msgstr "" "\t Pas de pause lors de l'affichage\n" "\n" #: src/dar_suite/dar_manager.cpp:1027 #, c-format msgid " l : list database contents \t A : Add an archive\n" msgstr " l : contenu de la base \t\tA : Ajout d'une archive\n" #: src/dar_suite/dar_manager.cpp:1028 #, c-format msgid " u : list archive contents \t D : Remove an archive\n" msgstr " u : contenu d'une archive \t\tD : Suppression d'une archive\n" #: src/dar_suite/dar_manager.cpp:1029 #, c-format msgid " f : give file localization \t m : modify archive order\n" msgstr " f : localisation d'un fichier \t\tm : change l'ordre des archives\n" #: src/dar_suite/dar_manager.cpp:1030 #, c-format msgid " p : modify path of archives \t b : modify basename of archives\n" msgstr "" " p : modifie le chemin d'un archive \tb : modifie le nom de base d'une " "archive\n" #: src/dar_suite/dar_manager.cpp:1031 #, c-format msgid " d : path to dar \t o : options to dar\n" msgstr " d : chemin de dar \to : option passées à dar\n" #: src/dar_suite/dar_manager.cpp:1032 #, c-format msgid " w : write changes to file \t s : database statistics\n" msgstr "" " w : enregistre les changements \ts : statistiques de la base de données\n" #: src/dar_suite/dar_manager.cpp:1033 #, c-format msgid "" " a : Save as \t n : pause each 'n' line (zero for no pause)\n" msgstr "" " a : Sauver sous\n" " n : pause chaque 'n' ligne d'affichage (zéro pour aucune pause)\n" #: src/dar_suite/dar_manager.cpp:1034 #, c-format msgid "" " c : check date order\n" "\n" msgstr " c : vérification de l'ordre des dates\n" #: src/dar_suite/dar_manager.cpp:1035 #, c-format msgid "" " q : quit\n" "\n" msgstr "" " q : Sortir\n" "\n" #: src/dar_suite/dar_manager.cpp:1036 #, c-format msgid " Choice: " msgstr " Choix : " #: src/dar_suite/dar_manager.cpp:1053 msgid "Archive number: " msgstr "Numéro d'archive : " #: src/dar_suite/dar_manager.cpp:1060 msgid "File to look for: " msgstr "Fichier à chercher : " #: src/dar_suite/dar_manager.cpp:1064 msgid "Archive number to modify: " msgstr "Numéro d'archive à modifier : " #: src/dar_suite/dar_manager.cpp:1068 #, c-format msgid "New basename for archive number %d: " msgstr "Nouveau numéro pour l'archive %d : " #: src/dar_suite/dar_manager.cpp:1073 msgid "Path to dar (empty string to use the default from PATH variable): " msgstr "Chemin de dar (chemin vide pour l'utilisation de la variable PATH) : " #: src/dar_suite/dar_manager.cpp:1078 src/dar_suite/dar_manager.cpp:1084 #: src/dar_suite/dar_manager.cpp:1354 msgid "Compressing and writing back database to file..." msgstr "Compression et enregistrement de la base de donnée dans le fichier..." #: src/dar_suite/dar_manager.cpp:1083 msgid "New database name: " msgstr "Nouveau nom pour la base de données : " #: src/dar_suite/dar_manager.cpp:1090 msgid "Archive basename (or extracted catalogue basename) to add: " msgstr "Nom de base de l'archive à ajouter : " #: src/dar_suite/dar_manager.cpp:1117 msgid "Archive number to remove: " msgstr "Numéro d'archive à supprimer : " #: src/dar_suite/dar_manager.cpp:1121 #, c-format msgid "Are you sure to remove archive number %d ?" msgstr "Étes vous sûr de vouloir supprimer l'archive numéro %d ?" #: src/dar_suite/dar_manager.cpp:1127 msgid "Archive number to move: " msgstr "Numéro de l'archive à déplacer : " #: src/dar_suite/dar_manager.cpp:1129 msgid "In which position to insert this archive: " msgstr "Position à laquelle insérer l'archive : " #: src/dar_suite/dar_manager.cpp:1138 msgid "Archive number who's path to modify: " msgstr "Numéro de l'archive dont le chemin doit être modifié : " #: src/dar_suite/dar_manager.cpp:1142 #, c-format msgid "New path to give to archive number %d: " msgstr "Nouveau chemin de l'archive %d : " #: src/dar_suite/dar_manager.cpp:1156 msgid "How much line to display at once: " msgstr "Nombre de ligne à afficher à chaque fois : " #: src/dar_suite/dar_manager.cpp:1160 msgid "Checking file's dates ordering..." msgstr "Vérification de l'ordonnancement des dates de fichiers ..." #: src/dar_suite/dar_manager.cpp:1168 src/dar_suite/dar_manager.cpp:1189 msgid "Database not saved, Do you really want to quit ?" msgstr "Base de données non sauvegardée, voulez-vous vraiment sortir ?" #: src/dar_suite/dar_manager.cpp:1169 src/dar_suite/dar_manager.cpp:1190 #, c-format msgid "Continuing the action under process which is to exit... so we exit!" msgstr "On continue l'action en cours qui est de sorti ... donc on sort !" #: src/dar_suite/dar_manager.cpp:1178 #, c-format msgid "Unknown choice\n" msgstr "Choix inconnu\n" #: src/dar_suite/dar_manager.cpp:1204 #, c-format msgid "re-enabling all signal handlers and continuing\n" msgstr "" "réactivation des gestionnaires de signaux et poursuite des opérations\n" #: src/dar_suite/dar_manager.cpp:1211 #, c-format msgid "Error performing the requested action: %S" msgstr "Erreur pendant l'exécution de l'action demandée : %S " #: src/dar_suite/dar_manager.cpp:1231 msgid "No problem found" msgstr "Aucun problème rencontré" #: src/dar_suite/dar_manager.cpp:1260 msgid "Opening and reading the batch file..." msgstr "Ouverture et lecture du fichier de traitement par lot..." #: src/dar_suite/dar_manager.cpp:1284 #, c-format msgid "" "\n" "\tExecuting batch file line: %S\n" " " msgstr "" "\n" "\tExécution de la ligne : %S\n" " " #: src/dar_suite/dar_manager.cpp:1293 #, c-format msgid "Syntax error in batch file: %S" msgstr "Erreur de syntaxe dans le fichier de traitement par lot : %S" #: src/dar_suite/dar_manager.cpp:1296 msgid "Syntax error in batch file: -C option not allowed" msgstr "" "Erreur de syntaxe dans le fichier de traitement par lot : option -C non " "autorisée" #: src/dar_suite/dar_manager.cpp:1299 msgid "Syntax error in batch file: -i option not allowed" msgstr "" "Erreur de syntaxe dans le fichier de traitement par lot : option -i non " "autorisée" #: src/dar_suite/dar_manager.cpp:1307 msgid "Aborting batch operation: " msgstr "Abandon du traitement par lot :" #: src/dar_suite/dar_manager.cpp:1318 #, c-format msgid "Enter each argument line by line, press return at the end\n" msgstr "" "Entrer chaque argument ligne par ligne puis appuyer sur entrée à la fin\n" #: src/dar_suite/dar_manager.cpp:1319 #, c-format msgid "To terminate enter an empty line\n" msgstr "Pour terminer entrer une ligne vide\n" #: src/dar_suite/dar_manager.cpp:1446 #, c-format msgid "Absolute value too high for an archive number: %d" msgstr "Valeur absolue trop élevée pour un numéro d'archive : %d" #: src/dar_suite/shell_interaction.cpp:174 msgid "" "No terminal found for user interaction. All questions will be assumed a " "negative answer (less destructive choice), which most of the time will abort " "the program." msgstr "" "Aucun terminal n'a été trouvé pour interagir avec l'utilisateur. On " "considérera une réponse négative à toutes les questions posées à " "l'utilisateur (choix le moins destructeur), ce qui la plupart du temps " "arrêtera le programme." #: src/dar_suite/shell_interaction.cpp:234 msgid "Error reading character: " msgstr "Erreur pendant la lecture d'un caractère : " #: src/dar_suite/shell_interaction.cpp:259 msgid "Error while changing user terminal properties: " msgstr "Erreur lors du changement des propriétés du terminal : " #: src/dar_suite/shell_interaction.cpp:297 msgid " [return = YES | Esc = NO]" msgstr " [Entrée = OUI | Echap = NON]" #: src/dar_suite/shell_interaction.cpp:316 msgid "Error while reading user answer from terminal: " msgstr "Erreur lors de la lecture de la réponse sur le terminal : " #: src/dar_suite/shell_interaction.cpp:321 msgid "Continuing..." msgstr "Poursuite..." #: src/dar_suite/shell_interaction.cpp:323 msgid "Escaping..." msgstr "Annulation..." #: src/dar_suite/shell_interaction.cpp:409 msgid "Secured string can only be read from a terminal" msgstr "Une chaine sécurés ne peut être saisie que depuis un terminal" #: src/dar_suite/shell_interaction.cpp:434 msgid "provided password is too long for the allocated memory" msgstr "le mot de passe fourni est trop grand pour la mémoire allouée" #: src/dar_suite/command_line.cpp:361 msgid "User target found on command line or included file(s):" msgstr "" "Cible(s) utilisateur(s) trouvée(s) en ligne de commande ou dans un fichier " "inclus :" #: src/dar_suite/command_line.cpp:370 msgid "No user target found on command line" msgstr "Aucune cible utilisateur trouvée sur la ligne de commande" #: src/dar_suite/command_line.cpp:388 #, c-format msgid "Given user target(s) could not be found: %S" msgstr "Les cibles utilisateurs suivantes n'ont pas été trouvées: %S" #: src/dar_suite/command_line.cpp:392 #, c-format msgid "Missing -c -x -d -t -l -C -+ option, see `%S -h' for help" msgstr "" "Il manque l'une des options -c -x -d -t -l -C -+, tapez '%S -h' pour l'aide" #: src/dar_suite/command_line.cpp:394 msgid "" "Slicing (-s option), is not compatible with archive on standard output (\"-" "\" as filename)" msgstr "" "Le découpage en tranches (option -s) n'est pas compatible avec la production " "de l'archive sur la sortie standard (\"-\" en nom d'archive)" #: src/dar_suite/command_line.cpp:415 msgid "-af option is only available with -c" msgstr "-af n'est disponible qu'avec l'option -c ou -+" #: src/dar_suite/command_line.cpp:417 msgid "-A option is not available with -l" msgstr "-A n'est disponible qu'avec l'option -l" #: src/dar_suite/command_line.cpp:419 msgid "with -C option, -A option is mandatory" msgstr "l'option -A est obligatoire quand -C est utilisé" #: src/dar_suite/command_line.cpp:421 msgid "with -+ option, -A option is mandatory" msgstr "l'option -A est obligatoire quand -+ est utilisé" #: src/dar_suite/command_line.cpp:423 msgid "-wa is only useful with -x option" msgstr "-wa n'est utile qu'avec l'option -x" #: src/dar_suite/command_line.cpp:426 msgid "-o is mandatory when using \"-A -\" with \"-c -\" \"-C -\" or \"-+ -\"" msgstr "" "l'option -o est obligatoire quand \"-A -\" est utilisé conjointement avec \"-" "c -\", \"-C -\" ou \"-+ -\"" #: src/dar_suite/command_line.cpp:436 msgid "-z option needs only to be used with -c -C or -+ options" msgstr "-z n'est utile qu'avec les options -c , -C ou -+" #: src/dar_suite/command_line.cpp:438 msgid "-S option requires the use of -s" msgstr "l'option -S nécessite l'utilisation de -s" #: src/dar_suite/command_line.cpp:440 msgid "ignoring -O option, as it is useless in this situation" msgstr "option -O ignorée car inutile dans cette situation" #: src/dar_suite/command_line.cpp:447 #, c-format msgid "" "File ownership will not be restored as %s has not the CHOWN capability nor " "is running as root. to avoid this message use -O option" msgstr "" "l'appartenance du fichier ne sera pas restauré car %s ne possède pas la " "capacité CHOWN ni n'est lancé en tant que root. Pour éviter ce message " "utiliser l'option -O" #: src/dar_suite/command_line.cpp:455 #, c-format msgid "" "Furtive read mode has been disabled as %s has not the FOWNER capability nor " "is running as root" msgstr "" "La lecture furtive a été désactivé car %s ne possède pas la capacité FOWNER " "ni n'est lancé en tant que root" #: src/dar_suite/command_line.cpp:460 msgid "-F is only useful with -A option, for the archive of reference" msgstr "" "L'option -F n'est utile qu'avec l'option -A, car elle concerne l'archive de " "référence" #: src/dar_suite/command_line.cpp:463 msgid "-J is only useful with -A option, for the archive of reference" msgstr "" "L'option -J n'est utile qu'avec l'option -A, car elle concerne l'archive de " "référence" #: src/dar_suite/command_line.cpp:466 msgid "-f in only available with -x option, ignoring" msgstr "-f n'est disponible qu'avec l'option -x, -f sera ignoré ici" #: src/dar_suite/command_line.cpp:468 msgid "-m is only useful with -c" msgstr "-m n'est utile qu'avec l'option -c" #: src/dar_suite/command_line.cpp:474 msgid "-H is only useful with -A option when making a backup" msgstr "Lors d'une sauvegarde, l'option -H n'est utile qu'avec l'option -A" #: src/dar_suite/command_line.cpp:480 msgid "-H is only useful with -r option when extracting" msgstr "Lors d'une restauration, -H n'est utile qu'avec l'option -r" #: src/dar_suite/command_line.cpp:484 msgid "-H is only useful with -c, -d or -x" msgstr "-H n'est utile qu'avec -c, -d ou -x" #: src/dar_suite/command_line.cpp:488 msgid "-as is only available with -l, ignoring -as option" msgstr "-as n'est disponible qu'avec l'option -l, -as sera ignoré ici" #: src/dar_suite/command_line.cpp:490 msgid "-e is only useful with -x, -c or -+ options" msgstr "-wa n'est utile qu'avec les options -x, -c ou -+" #: src/dar_suite/command_line.cpp:492 msgid "-ac is only useful with -c or -d" msgstr "-ac n'est utile qu'avec -c ou -d" #: src/dar_suite/command_line.cpp:494 msgid "-M is only useful with -c" msgstr "-M n'est utile qu'avec l'option -c" #: src/dar_suite/command_line.cpp:496 msgid "The snapshot backup (-A +) is only available with -c option, ignoring" msgstr "" "L'option de \"photographie\" (-A +) n'est disponible qu'avec l'option -c" #: src/dar_suite/command_line.cpp:498 msgid "" "The Cache Directory Tagging Standard is only useful while performing a " "backup, ignoring it here" msgstr "" "L'utilisation du standard de marquage des répertoires de cache n'est utile " "que lors d'une sauvegarde" #: src/dar_suite/command_line.cpp:501 msgid "-@ is only available with -+ and -c options" msgstr "-@ n'est disponible qu'avec les options -+ et -c" #: src/dar_suite/command_line.cpp:503 msgid "-$ is only available with -+ option and -c options" msgstr "-$ n'est disponible qu'avec les options -x et -c" #: src/dar_suite/command_line.cpp:505 msgid "-~ is only available with -+ and -c options" msgstr "-~ n'est disponible qu'avec les options -+ et -c" #: src/dar_suite/command_line.cpp:507 #, c-format msgid "-%% is only available with -+ option" msgstr "-%% n'est disponible qu'avec l'option -+" #: src/dar_suite/command_line.cpp:510 msgid "" "-$ is only useful with -@ option, for the auxiliary archive of reference" msgstr "" "L'option -$ n'est utile qu'avec l'option -@, pour l'archive de référence " "auxiliaire" #: src/dar_suite/command_line.cpp:512 #, c-format msgid "" "-%% is only useful with -@ option, for the auxiliary archive of reference" msgstr "" "L'option -%% n'est utile qu'avec l'option -@ pour l'archive auxiliaire de " "référence" #: src/dar_suite/command_line.cpp:514 msgid "" "-~ is only useful with -@ option, for the auxiliary archive of reference" msgstr "" "L'option -~ n'est utile qu'avec l'option -@, car elle concerne l'archive " "auxiliaire de référence" #: src/dar_suite/command_line.cpp:517 msgid "-ak is only available while merging (operation -+), ignoring -ak" msgstr "-ak n'est disponible qu'avec l'option -+ et sera ignoré ici" #: src/dar_suite/command_line.cpp:522 msgid "" "Compression option (-z option) is useless and ignored when using -ak option" msgstr "" "La compression (option -z) est inutile et ignorée lorsque -ak est utilisé" #: src/dar_suite/command_line.cpp:529 msgid "" "--sparse-file-min-size only available while saving or merging archives, " "ignoring" msgstr "" "--sparse-file-min-size n'est disponible que lors de sauvegarde ou fusion " "d'archives et sera ignoré ici" #: src/dar_suite/command_line.cpp:532 msgid "" "To use --sparse-file-min-size while merging archive, you need to use -ah " "option too, please check man page for details" msgstr "" "L'utilisation de --sparse-file-min-size lors requière l'utilisation " "conjointe de l'option -ah, voir la page de manuel pour plus de détails" #: src/dar_suite/command_line.cpp:538 msgid "-k option is only useful with -x option" msgstr "l'option -k n'est utile qu'avec l'option -x" #: src/dar_suite/command_line.cpp:541 msgid "-konly and -kignore cannot be used at the same time" msgstr "-konly et kignore ne peuvent être utilisés en même temps" #: src/dar_suite/command_line.cpp:544 msgid "-p and -Q options are mutually exclusives" msgstr "les options -p et -Q sont mutuellement exclusives" #: src/dar_suite/command_line.cpp:547 msgid "-vf is only useful with -c option" msgstr "-vf n'est utile qu'avec l'option -c" #: src/dar_suite/command_line.cpp:589 msgid "" "-Y and -Z are only useful with compression (-z option), ignoring any -Y and -" "Z option" msgstr "" "-Y et -Z ne sont utiles qu'avec la compression de données (option -z), -Y et " "-Z seront ignorés ici" #: src/dar_suite/command_line.cpp:591 msgid "-m is only useful with compression (-z option), ignoring -m" msgstr "" "-m n'est utile qu'avec la compression de données (option -z), -m sera " "ignorés ici" #: src/dar_suite/command_line.cpp:641 msgid "" "-= option is valid only while saving files, thus in conjunction with -c " "option, ignoring" msgstr "" "l'option -= n'est valide que lors de la sauvegarde (option -c) et sera " "ignorée, ici" #: src/dar_suite/command_line.cpp:643 msgid "" "-= option will be ignored as it is useless if you do not specify to which " "files or directories this backup hook is to be applied, thanks to -< and -> " "options. See man page for more details." msgstr "" "l'option -= sera ignorée car inutile faute d'indication des fichiers ou " "répertoires auxquelles l'appliquer. Voir les options -< et -> dans la page " "de manuel pour plus de détails" #: src/dar_suite/command_line.cpp:649 msgid "" "backup hook feature (-<, -> or -= options) is only available when saving " "files, ignoring" msgstr "" "La fonctionnalité d'action de sauvegarde (options-< -> et -=) n'est " "disponible que lors de la sauvegarde et sera ignorée ici" #: src/dar_suite/command_line.cpp:698 msgid "-/ option is only useful with -+ option, ignoring" msgstr "l'option -/ n'est utile qu'avec -+ et sera ignorée ici" #: src/dar_suite/command_line.cpp:709 msgid "" "-. option is only useful when merging, creating or isolating an archive, " "ignoring" msgstr "" "l'option -. n'est utile que lors de fusion, de création ou d'isolation " "d'archives et sera ignorée ici" #: src/dar_suite/command_line.cpp:714 #, c-format msgid "" "The following user comment will be placed in clear text in the archive: %S" msgstr "" "Les commentaires utilisateur suivants seront placés en clair dans " "l'archive : %S" #: src/dar_suite/command_line.cpp:729 msgid "Parse error: " msgstr "Erreur de syntaxe : " #: src/dar_suite/command_line.cpp:772 msgid " Only one option of -c -d -t -l -C -x or -+ is allowed" msgstr " Une seule option parmi -c -d -t -l -C, -x ou -+ est permise" #: src/dar_suite/command_line.cpp:806 msgid "Only one -A option is allowed" msgstr "Une seule option -A est permise" #: src/dar_suite/command_line.cpp:833 msgid "Error while parsing -A argument as a date: " msgstr "Erreur de syntaxe dans la date donné à l'option -A : " #: src/dar_suite/command_line.cpp:898 msgid "Choose only one compression algorithm" msgstr "Choisir un seul algorithme de compression" #: src/dar_suite/command_line.cpp:904 msgid "-w option is useless with -n" msgstr "-w est inutile avec -n" #: src/dar_suite/command_line.cpp:916 msgid "Unknown argument given to -w: " msgstr "Argument inconnu donné à -w : " #: src/dar_suite/command_line.cpp:936 src/dar_suite/command_line.cpp:943 #: src/dar_suite/command_line.cpp:950 msgid "\"-k\" (or \"-kignore\") and \"-konly\" are not compatible" msgstr "\"-k\" (ou \"-kignore\") et \"-konly\" ne sont pas compatibles" #: src/dar_suite/command_line.cpp:954 #, c-format msgid "Unknown argument given to -k : %s" msgstr "Argument inconnu donné à -k : %s" #: src/dar_suite/command_line.cpp:958 msgid "Only one -R option is allowed" msgstr "Une seule option -R est permise" #: src/dar_suite/command_line.cpp:1001 msgid "" "Giving to -S option the same value as the one given to -s option is useless" msgstr "Donner à -S la même valeur que celle donnée à -s est inutile" #: src/dar_suite/command_line.cpp:1076 msgid "-r is useless with -n" msgstr "L'option -r est inutile avec -n" #: src/dar_suite/command_line.cpp:1205 #, c-format msgid "" "File inclusion loop detected. The file %s includes itself directly or " "through other files (-B option)" msgstr "" "Boucle dans l'inclusion des fichiers. Le fichier %s s'inclut lui-même " "directement ou via d'autres fichiers (option -B)" #: src/dar_suite/command_line.cpp:1222 #, c-format msgid "Error reading included file (%s): " msgstr "Erreur pendant la l'analyse d'un fichier inclus (%s) : " #: src/dar_suite/command_line.cpp:1227 #, c-format msgid "Error in included file (%s): " msgstr "Erreur dans le fichier inclus %s : " #: src/dar_suite/command_line.cpp:1245 src/dar_suite/command_line.cpp:2476 #: src/dar_suite/command_line.cpp:2553 #, c-format msgid "In included file %S: " msgstr "Dans le fichier inclus %S : " #: src/dar_suite/command_line.cpp:1288 #, c-format msgid "" "%d is the default value for -m, no need to specify it on command line, " "ignoring" msgstr "" "%d est la valeur par défaut pour -m, il n'est pas nécessaire de préciser " "cette valeur" #: src/dar_suite/command_line.cpp:1305 msgid "" "--nodump feature has not been activated at compilation time, it is thus not " "available" msgstr "" "La fonctionnalité --nodump n'a pas été activée lors de la compilation, cette " "option n'est donc pas disponible" #: src/dar_suite/command_line.cpp:1321 msgid "Argument given to -H is not a positive integer number" msgstr "L'argument donné à -H doit être un entier positif" #: src/dar_suite/command_line.cpp:1374 msgid "" "-ak option need not be specified more than once, ignoring extra -ak options" msgstr "inutile de spécifier l'option -ak plus d'une fois" #: src/dar_suite/command_line.cpp:1380 msgid "-af must be present before -A option not after!" msgstr "L'option -af doit être placée avant l'option -A, et non pas après" #: src/dar_suite/command_line.cpp:1382 msgid "" "-af option need not be specified more than once, ignoring extra -af options" msgstr "Inutile de spécifier plus d'une fois l'option -af" #: src/dar_suite/command_line.cpp:1406 #, c-format msgid "Unknown argument given to -a : %s" msgstr "Argument inconnu donné à -a : %s" #: src/dar_suite/command_line.cpp:1421 msgid "" "Warning: -G option is an experimental and unsupported feature, read man page " "about -G option for more information" msgstr "" "Attentuion: L'option -G est expérimentale et non supportée. Lire la page de " "manuel à propos de cette option pour plus d'information" #: src/dar_suite/command_line.cpp:1450 msgid "Only one -@ option is allowed" msgstr "Une seule option -@ est permise" #: src/dar_suite/command_line.cpp:1506 msgid "Syntax error in overwriting policy: " msgstr "Erreur de syntaxe dans la politique d'écrasement : " #: src/dar_suite/command_line.cpp:1539 #, c-format msgid "" "%d is the default value for --sparse-file-min-size, no need to specify it on " "command line, ignoring" msgstr "" "%d est la valeur par défaut pour --sparse-file-min-size, il n'est pas " "nécessaire de préciser cette valeur" #: src/dar_suite/command_line.cpp:1560 #, c-format msgid "Unknown argument given to -2 : %s" msgstr "Argument inconnu donné à -2 : %s" #: src/dar_suite/command_line.cpp:1620 msgid "Error while parsing --min-digits option: " msgstr "Erreur de syntaxe concernant --min-digits : " #: src/dar_suite/command_line.cpp:1626 msgid "Missing argument to --backup-hook-execute" msgstr "Argument manquant pour --backup-hook-execute" #: src/dar_suite/command_line.cpp:1708 #, c-format msgid "" "usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] " "[options...]\n" msgstr "" "usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] " "[options...]\n" #: src/dar_suite/command_line.cpp:1712 #, c-format msgid "Commands are:\n" msgstr "Les commandes sont :\n" #: src/dar_suite/command_line.cpp:1713 #, c-format msgid " -c creates an archive\n" msgstr " -c créer une archive\n" #: src/dar_suite/command_line.cpp:1714 #, c-format msgid " -x extracts files from the archive\n" msgstr " -x restauration de fichiers\n" #: src/dar_suite/command_line.cpp:1715 #, c-format msgid " -d compares the archive with the existing filesystem\n" msgstr " -d comparaison de l'archive avec le fichiers existants\n" #: src/dar_suite/command_line.cpp:1716 #, c-format msgid " -t tests the archive integrity\n" msgstr " -t test l'intégrité d'une archive\n" #: src/dar_suite/command_line.cpp:1717 #, c-format msgid " -l lists the contents of the archive\n" msgstr " -l affichage du contenu d'une archive\n" #: src/dar_suite/command_line.cpp:1718 #, c-format msgid " -C isolates the catalogue from an archive\n" msgstr " -C isole le catalogue d'une archive\n" #: src/dar_suite/command_line.cpp:1719 #, c-format msgid " -+ merge two archives / create a sub archive\n" msgstr " -+ fusion de deux archive / création de sous-archive\n" #: src/dar_suite/command_line.cpp:1721 #, c-format msgid " -h displays this help information\n" msgstr " -h affiche cette page d'aide\n" #: src/dar_suite/command_line.cpp:1722 #, c-format msgid " -V displays version information\n" msgstr " -V affiche les informations de version\n" #: src/dar_suite/command_line.cpp:1725 #, c-format msgid " -v\t\t verbose output\n" msgstr " -v\t\t affichage détaillé\n" #: src/dar_suite/command_line.cpp:1726 #, c-format msgid " -q\t\t suppress final statistics report\n" msgstr " -q\t\t supprime le rapport final de statistiques\n" #: src/dar_suite/command_line.cpp:1727 #, c-format msgid " -vs\t\t display skipped files\n" msgstr " -V\t\t affiche les fichiers ignorés\n" #: src/dar_suite/command_line.cpp:1728 #, c-format msgid " -R \t filesystem root directory (current dir by default)\n" msgstr "" " -R \t répertoire à considérer comme racine (rep. courant par " "défaut)\n" #: src/dar_suite/command_line.cpp:1729 #, c-format msgid "" " -X \t files to exclude from the operation (none by default)\n" msgstr "" " -X \t fichiers à exclure de l'opération (aucun par défault)\n" #: src/dar_suite/command_line.cpp:1730 #, c-format msgid " -I \t files to include in the operation (all by default)\n" msgstr "" " -I \t fichiers à inclure dans l'opération (tous par défaut)\n" #: src/dar_suite/command_line.cpp:1731 #, c-format msgid " -P \t subdirectory to exclude from the operation\n" msgstr " -P \t sous-répertoires à exclure de l'opération\n" #: src/dar_suite/command_line.cpp:1732 #, c-format msgid " -g \t subdirectory to include in the operation\n" msgstr " -g \t sous-répertoire à inclure dans l'opération\n" #: src/dar_suite/command_line.cpp:1733 #, c-format msgid " -[ filename contains a list of files to include\n" msgstr " -[ fichier contenant une liste de fichiers à inclure\n" #: src/dar_suite/command_line.cpp:1734 #, c-format msgid " -] \t filename contains a list of files to exclude\n" msgstr " -] \t fichier contenant une liste de fichiers à exclure\n" #: src/dar_suite/command_line.cpp:1737 #, c-format msgid " -wa\t\t don't warn before overwriting and removing files\n" msgstr "" " -wa\t\t ne pas avertir ni avant écrasement ni avant suppression de " "fichier\n" #: src/dar_suite/command_line.cpp:1739 #, c-format msgid "" " -O[ignore-owner | mtime | inode-type] do not consider user and group\n" msgstr "" " -O[ignore-owner | mtime | inode-type] ne pas prendre en compte la " "propriété des fichiers\n" #: src/dar_suite/command_line.cpp:1740 #, c-format msgid "\t\t ownership\n" msgstr "\t\t propriété\n" #: src/dar_suite/command_line.cpp:1741 #, c-format msgid " -H [N]\t ignore shift in dates of an exact number of hours\n" msgstr "" " -H [N]\t considère identiques des dates qui diffèrent d'un nombre " "entier d'heures\n" #: src/dar_suite/command_line.cpp:1742 #, c-format msgid " -E \t command to execute between slices\n" msgstr " -E \t commande exécutée entre les tranches\n" #: src/dar_suite/command_line.cpp:1743 #, c-format msgid " -F \t same as -E but for the archive of reference\n" msgstr " -F \t comme -E mais pour l'archive de référence\n" #: src/dar_suite/command_line.cpp:1744 #, c-format msgid " -u \t mask to ignore certain EA\n" msgstr " -u \t masque de sélection des Attributs Étendus\n" #: src/dar_suite/command_line.cpp:1745 #, c-format msgid " -U \t mask to allow certain EA\n" msgstr " -U \t masque d'exclusion d'Attributs Étendus\n" #: src/dar_suite/command_line.cpp:1746 #, c-format msgid " -K \t use as key to encrypt/decrypt\n" msgstr " -K \t mot de passe à utiliser pour chiffrer/déchiffrer\n" #: src/dar_suite/command_line.cpp:1747 #, c-format msgid "" " -J \t same as -K but it does concern the archive of reference\n" msgstr " -J \t comme -K mais pour l'archive de référence\n" #: src/dar_suite/command_line.cpp:1748 #, c-format msgid " -# encryption block size\n" msgstr " -# taille des blocs de chiffrement\n" #: src/dar_suite/command_line.cpp:1749 #, c-format msgid " -* same as -# but for archive of reference\n" msgstr " -* comme -# mais pour l'archive de référence\n" #: src/dar_suite/command_line.cpp:1750 #, c-format msgid " -B read options from given file\n" msgstr " -B lit les options à partir du fichier\n" #: src/dar_suite/command_line.cpp:1751 #, c-format msgid " -N\t\t do not read ~/.darrc nor /etc/darrc configuration file\n" msgstr " -N\t\t ignore ~/.darrc et /etc/darrc s'ils sont présents\n" #: src/dar_suite/command_line.cpp:1752 #, c-format msgid " -e\t\t dry run, fake execution, nothing is produced\n" msgstr " -e\t\t exécution à vide (rien n'est écrit sur le disque)\n" #: src/dar_suite/command_line.cpp:1753 #, c-format msgid " -Q\t\t suppress the initial warning when not launched from a tty\n" msgstr " -Q\t\t supprime le message initial si non lancé depuis un tty\n" #: src/dar_suite/command_line.cpp:1754 #, c-format msgid " -aa\t\t do not try to preserve atime of file open for reading.\n" msgstr "" " -aa\t\t ne cherche pas à conserver atime des fichiers ouverts en " "lecture.\n" #: src/dar_suite/command_line.cpp:1755 #, c-format msgid " -ac\t\t do not try to preserve ctime (default behavior).\n" msgstr "" " -ac\t\t ne cherche pas à conserver ctime (comportement par défaut).\n" #: src/dar_suite/command_line.cpp:1756 #, c-format msgid " -am\t\t set ordered mode for all filters\n" msgstr " -am\t\t filtres en mode ordonné\n" #: src/dar_suite/command_line.cpp:1757 #, c-format msgid " -an\t\t the masks that follow are now case insensitive\n" msgstr "" " -an\t\t dans les masques suivants majuscules et minuscules sont " "équivalents\n" #: src/dar_suite/command_line.cpp:1758 #, c-format msgid " -acase\t the masks that follow are now case sensitive\n" msgstr "" " -acase\t\t dans les masques qui suivent majuscules et minuscules sont " "différents\n" #: src/dar_suite/command_line.cpp:1759 #, c-format msgid " -ar\t\t set the following masks to be regex expressions\n" msgstr "" " -ar\t\t bascule les masques suivants comme expression régulières\n" #: src/dar_suite/command_line.cpp:1760 #, c-format msgid " -ag\t\t set the following masks to be glob expressions\n" msgstr " -ag\t\t bascule les masques suivants comme expression glob\n" #: src/dar_suite/command_line.cpp:1762 #, c-format msgid "Saving / Isolation / merging options (to use with -c, -C or -+):\n" msgstr "" "Options de sauvegarde / d'isolation / fusion (à utiliser avec -c, -C ou -" "+) :\n" #: src/dar_suite/command_line.cpp:1763 #, c-format msgid " -A [path/] archive to take as reference\n" msgstr " -A [chemin/] archive à prendre comme référence\n" #: src/dar_suite/command_line.cpp:1764 #, c-format msgid " -@ [path/] auxiliary archive of reference for merging\n" msgstr "" " -@ [chemin/] archive à prendre comme référence auxiliaire\n" #: src/dar_suite/command_line.cpp:1765 #, c-format msgid " -$ \t encryption key for auxiliary archive\n" msgstr " -$ \t clef de chiffrement de l'archive auxiliaire\n" #: src/dar_suite/command_line.cpp:1766 #, c-format msgid " -~ \t command between slices of the auxiliary archive\n" msgstr "" " -~ \t commande à exécuter entre les tranches d'une archive " "auxiliaire\n" #: src/dar_suite/command_line.cpp:1767 #, c-format msgid " -z [[algo:]level]\t compress data in archive. -z = -z9 = -zgzip:9\n" msgstr " -z [[algo:]niveau]\t compression des données\n" #: src/dar_suite/command_line.cpp:1768 #, c-format msgid "" " Available algo: gzip,bzip2,lzo,xz. Exemples: -zlzo -zxz:5 -z1 -z\n" msgstr "" " Algorithmes disponibles : gzip, bzip2, lzo, xz. Exemples -zlzo:5 -z1\n" #: src/dar_suite/command_line.cpp:1770 #, c-format msgid " -S first file size (if different from following ones)\n" msgstr "" " -S taille de la première tranche (si elle doit différente " "des autres)\n" #: src/dar_suite/command_line.cpp:1774 #, c-format msgid " -D\t\t excluded directories are stored as empty directories\n" msgstr "" " -D\t\t les répertoires exclus sont enregistrés comme des répertoires " "vides\n" #: src/dar_suite/command_line.cpp:1775 #, c-format msgid " -Z \t do not compress the matching filenames\n" msgstr " -Z \t ne pas compresser ces fichiers\n" #: src/dar_suite/command_line.cpp:1776 #, c-format msgid " -Y \t do only compress the matching filenames\n" msgstr " -Y \t ne compresser que ces fichiers\n" #: src/dar_suite/command_line.cpp:1777 #, c-format msgid " -m \t do not compress file smaller than \n" msgstr "" " -m \t ne pas compresser les fichiers de taille inférieure à " " octets\n" #: src/dar_suite/command_line.cpp:1778 #, c-format msgid " --nodump\t do not backup, files having the nodump 'd' flag set\n" msgstr "" " --nodump\t ne pas sauver les fichiers ayant le drapeau 'd' positionné\n" #: src/dar_suite/command_line.cpp:1779 #, c-format msgid "" " -@ [path/] Do on-fly catalogue isolation of the resulting " "archive\n" msgstr "" " -@ [chemin/] Réalise une isolation à la volée de l'archive crée\n" #: src/dar_suite/command_line.cpp:1780 #, c-format msgid " -M\t\t stay in the same filesystem while scanning directories\n" msgstr "" " -M\t\t reste dans le même système de fichiers lors du parcours de " "l'arborescence\n" #: src/dar_suite/command_line.cpp:1781 #, c-format msgid " -,\t\t ignore directories that follow the Directory Tagging\n" msgstr " -,\t\t ignore les répertoires marqués comme répertoire cache\n" #: src/dar_suite/command_line.cpp:1782 #, c-format msgid "\t\t Standard\n" msgstr "\t\t Standard\n" #: src/dar_suite/command_line.cpp:1783 #, c-format msgid "" " -/ \t which way dar can overwrite files at archive merging or\n" msgstr "" " -/ \t défini que quelle façon dar peut écraser des fichiers lors " "de la fusion\n" #: src/dar_suite/command_line.cpp:1784 #, c-format msgid "\t\t extraction time\n" msgstr "\t\t ou lors de l'extraction d'une archive\n" #: src/dar_suite/command_line.cpp:1787 #, c-format msgid "Restoring options (to use with -x) :\n" msgstr "Options de restauration (à utiliser avec -x) :\n" #: src/dar_suite/command_line.cpp:1788 #, c-format msgid " -k\t\t do not remove files destroyed since the reference backup\n" msgstr " -k\t\t non suppression des fichiers enregistrés comme détruits\n" #: src/dar_suite/command_line.cpp:1789 #, c-format msgid " -r\t\t do not restore file older than those on filesystem\n" msgstr "" " -r\t\t ne pas restaurer de fichiers plus anciens que ceux sur le " "système de fichiers\n" #: src/dar_suite/command_line.cpp:1790 #, c-format msgid " -f\t\t do not restore directory structure\n" msgstr " -f\t\t ne pas restaurer l'arborescence de répertoire\n" #: src/dar_suite/command_line.cpp:1792 #, c-format msgid "Reading options (to use with -x, -d, -t, -l, -A)\n" msgstr "Options de lecture (à utiliser avec -x, -d, -t, -l, -A) :\n" #: src/dar_suite/command_line.cpp:1793 #, c-format msgid "" " -i pipe to use instead of std input to read data from " "dar_slave\n" msgstr "" " -i tube à utiliser à la place de l'entrée standard pour lire " "les données de dar_slave\n" #: src/dar_suite/command_line.cpp:1794 #, c-format msgid "" " -o pipe to use instead of std output to orders dar_slave\n" msgstr "" " -o tube à utiliser au lieu de la sortie standard pour " "ordonner dar_slave\n" #: src/dar_suite/command_line.cpp:1796 #, c-format msgid "Listing options (to use with -l):\n" msgstr "Options de listing (à utiliser avec -l) :\n" #: src/dar_suite/command_line.cpp:1797 #, c-format msgid " -T\t\t tree output format\n" msgstr " -T\t\t affichage sous forme d'arbre\n" #: src/dar_suite/command_line.cpp:1798 #, c-format msgid " -as\t\t only list files saved in the archive\n" msgstr " -as\t\taffichage uniquement des fichiers sauvegardés\n" #: src/dar_suite/command_line.cpp:1799 #, c-format msgid "" "\n" "\n" msgstr "" "\n" "\n" #: src/dar_suite/command_line.cpp:1800 #, c-format msgid "" "Type \"man dar\" for more details and for all other available options.\n" msgstr "" "Taper \"man dar\" pour plus de détails et pour connaître toutes les autres " "options disponibles.\n" #: src/dar_suite/command_line.cpp:2166 #, c-format msgid " Using libdar %u.%u.%u built with compilation time options:" msgstr "Libdar %u.%u.%u utilisée, construite avec les options suivantes :" #: src/dar_suite/command_line.cpp:2167 #, c-format msgid " Using libdar %u.%u built with compilation time options:" msgstr "Libdar %u.%u utilisée, construite avec les options suivantes :" #: src/dar_suite/command_line.cpp:2378 #, c-format msgid "Arguments read from %S :" msgstr "Arguments lus depuis %S :" #: src/dar_suite/command_line.cpp:2871 #, c-format msgid "" "%s does not name a compression \"[algorithm][:][level]\" , like for examples " "\"gzip\", \"lzo\", \"bzip2\", \"lzo:3\", \"gzip:2\", \"8\" or \"1\". Please " "review the man page about -z option" msgstr "" "%s ne désigne pas une compression \"[algo][:][niveau]\", comme par exemple " "\"gzip\", \"lzo\", \"bzip2\", \"lzo:3\", \"gzip:2\", \"8\" ou \"1\". Merci " "de revoir la description de l'option -z dans la page de manuel" #: src/dar_suite/command_line.cpp:2890 msgid "Compression level must be between 1 and 9, included" msgstr "le niveau de compression doit être compris entre 1 et 9 inclus" #: src/dar_suite/command_line.cpp:2918 msgid "unknown FSA family: " msgstr "Famille d'attributs FSA inconnue : " #: src/dar_suite/command_line.cpp:2950 #, c-format msgid "" "User target named \"%s\" is not allowed (reserved word for conditional " "syntax)" msgstr "" "La cible utilisateur \"%s\" n'est pas autorisée (cible réservé pour la " "syntaxe conditionnelle)" #: src/check/all_features.cpp:54 msgid "-" msgstr "-" #~ msgid "" #~ "CRC of file to apply binary diff to does not match the expected CRC value" #~ msgstr "" #~ "CRC du fichir auquel appliquer la différence binaire ne correspond pas à " #~ "la valeur de CRC attendue" #~ msgid "Error met while feeding data to librsync: " #~ msgstr "Erreur lors de l'envoi de données à librsync: " #~ msgid "Error releasing librsync job: " #~ msgstr "Erreur lors de la libération d'un travail de librsync: " #~ msgid "nullptr argument given to \"sauv_path\"" #~ msgstr "Valeur nullptr donnée à \"filename\"" #~ msgid "nullptr argument given to \"filename\"" #~ msgstr "Valeur nullptr donnée à \"filename\"" #~ msgid "nullptr argument given to \"extension\"" #~ msgstr "Valeur nullptr donnée à \"extension\"" #~ msgid "Strong encryption support" #~ msgstr "Support pour le chiffrement fort" #~ msgid " -j\t\t ask user what to do when memory is exhausted\n" #~ msgstr "" #~ " -j\t\t permet à l'utilisateur d'agir quand la mémoire virtuelle fait " #~ "défaut\n" #~ msgid "" #~ "------------------+----------------" #~ "+----------------------------------------+-------------------------+" #~ msgstr "" #~ "-----------------+------------------------+--------+" #~ "+---------------------------+------------" #~ msgid "" #~ "---------------+------+-------+-------+-------------------------------" #~ "+------------------------------+-----------\n" #~ msgstr "" #~ "-----------------+------------------------+--------+" #~ "+---------------------------+------------\n" #~ msgid "" #~ "-----------------------------+------------+-------+-------+-------" #~ "+-------------------------------+------------\n" #~ msgstr "" #~ "-----------------+------------------------+--------+" #~ "+---------------------------+------------\n" #~ msgid "Preparing the archive contents for isolation..." #~ msgstr "Préparation du contenu de l'archive en vue de son isolation ..." #~ msgid "Current implementation does not support this (new) crypto algorithm" #~ msgstr "" #~ "L'implémentation actuelle ne support pas ce (nouvel) algorithme de " #~ "chiffrement" #~ msgid "Not supported flag or archive corruption" #~ msgstr "Drapeau non supporté ou archive corrompue" #~ msgid "" #~ "Cannot convert group to gid in statically linked binary, either directly " #~ "provide the GID or run libdar from a dynamically linked executable" #~ msgstr "" #~ "Impossible de convertir un nom de groupe en numéro (GID) dans un " #~ "exécutable lié statiquement. Fournir soit directement le GID soit " #~ "utiliser un exécutable lié dynamiquement" #~ msgid "" #~ "too low value (< 10) given as observation_read_number argument while " #~ "initializing cache" #~ msgstr "" #~ "Valeur trop faible (< 10) donnée à \"observation_read_number\" lors de " #~ "l'initialisation du cache" #~ msgid "" #~ "too low value (< 10) given as observation_write_number argument while " #~ "initializing cache" #~ msgstr "" #~ "Valeur trop faible (< 10) donnée à \"observation_write_number\" lors de " #~ "l'initialisation du cache" #~ msgid "" #~ "too high value (> 50) given as unused_read_ratio argument, while " #~ "initializing cache" #~ msgstr "" #~ "Valeur trop grande (> 50) donnée à \"unused_read_ratio\" lors de " #~ "l'initialisation du cache" #~ msgid "" #~ "unused_write_ratio must be less than max_size_hit_write_ratio, while " #~ "initializing cache" #~ msgstr "" #~ "\"unused_write_ratio\" doit être inférieur ou égal à " #~ "\"max_size_hit_write_ratio\", lors de l'initialisation du cache" #~ msgid "" #~ "max_size must be greater or equal to initial_size, while initializing " #~ "cache" #~ msgstr "" #~ "max_size doit être supérieur ou égal à initial_size pour l'initialisation " #~ "du cache" #~ msgid "incompatible Zlib version" #~ msgstr "version de Zlib incompatible" #~ msgid "" #~ "Could not find archive information at the end of the last slice, assuming " #~ "an old archive and trying to read at the beginning of the first slice..." #~ msgstr "" #~ "Impossible de trouver les informations sur l'archive en fin de dernière " #~ "tranche. On suppose qu'il s'agit d'un ancien format d'archive, pour " #~ "lequel cette information se trouve uniquement au début de la première " #~ "tranche ..." #~ msgid "" #~ "LAX MODE: Failed to read the archive header, I will need your help to " #~ "know what is the missing information." #~ msgstr "" #~ "MODE RELAX : Échec de lecture de l'en-tête de l'archive, Votre aide sera " #~ "nécessaire pour connaître l'information manquante." #~ msgid "" #~ "LAX MODE: Archive format revision found is [%s] but the higher version " #~ "this binary can handle is [%s]. Thus, assuming the archive version is " #~ "corrupted and falling back to the higher version this binary can support " #~ "(%s)" #~ msgstr "" #~ "MODE RELAX : La version du format d'archive est [%s] mais la version la " #~ "plus élevée que cet exécutable est capable de gérer est [%s]. On suppose " #~ "donc que l'archive est corrompue et que son format est le plus récent " #~ "qu'il est possible de gérer par cet exécutable (version %s)" #~ msgid "LAX MODE: Archive format revision found is [version %s]" #~ msgstr "MODE RELAX : Le format trouvé pour l'archive est [version %s]" #~ msgid "LAX MODE: is it correct, seen the table at the following URL: %s ?" #~ msgstr "" #~ "MODE RELAX : Est-ce correct à la lecture de la table disponible à l'URL " #~ "suivante : %s ?" #~ msgid "Cannot determine the permission to use for hash files: " #~ msgstr "" #~ "Impossible de déterminer la permission à appliquer aux fichier de hash: " #~ msgid "Error opening file " #~ msgstr "Erreur lors de l'ouverture du fichier " #~ msgid "Error opening file %s : %s" #~ msgstr "Erreur lors de l'ouverture du fichier %s : %s" #~ msgid "Position out of range" #~ msgstr "Position hors limites" #~ msgid "Read-write mode not supported for \"trivial_sar\"" #~ msgstr "Mode lecture-écriture non supporté pour \"trivial_sar\"" #~ msgid "Cannot create database %S : %s" #~ msgstr "Impossible de créer la base %S : %s" #~ msgid "system type time_t is too small to store a time/date" #~ msgstr "" #~ "Le type time_t du système est trop petit pour contenir une heure/date" #~ msgid "" #~ "Thread-safe not initialized for libdar, read manual or contact maintainer " #~ "of the application that uses libdar" #~ msgstr "" #~ "L'environnement multi-tâche na pas été initialisé pour libdar, merci de " #~ "lire le manuel d'utilisation de libdar ou de contacter le mainteneur de " #~ "l'application utilisatrice de libdar, concernée par ce problème" #~ msgid "Cannot initialize mutex: " #~ msgstr "Initialisation des \"mutex\" impossible : " #~ msgid "Aborting operations for the EA of %S : error while adding EA %s : %s" #~ msgstr "" #~ "Abandon des opérations pour les AE de %S : erreur pendant l'ajout de l'AE " #~ "%s : %s" #~ msgid "Aborting operations for the EAs of %S : error while removing %s : %s" #~ msgstr "" #~ "Abandon des opérations pour les AE de %S : erreur lors de la suppression " #~ "de %s : %s" #~ msgid "" #~ " -z [bzip2[:level]] compress data in archive using bzip2 algorithm.\n" #~ msgstr " -z [bzip2[:niveau]]\t compression avec l'algorithme bzip2\n" #~ msgid "" #~ "No more (virtual) memory available, you have the opportunity to stop un-" #~ "necessary applications to free up some memory. Can we continue now ?" #~ msgstr "" #~ "Plus de mémoire (virtuelle) disponible, vous avez la possibilité " #~ "d'arrêter certaines applications pour faire de la place. On continue " #~ "maintenant ?" #~ msgid "Cannot open file %S : %s" #~ msgstr "Le fichier %S ne peut pas être ouvert : %s" #~ msgid "User target found on command line:" #~ msgstr "Cible utilisateur trouvée en ligne de commande :" #~ msgid "" #~ "Note that -y option is deprecated it will be removed in future release, " #~ "please use -z option instead (read man page for details)" #~ msgstr "" #~ "Noter que l'option -y est obsolète et sera supprimée dans une prochaine " #~ "version, merci d'utiliser l'option -z à la place (voir la page de manuel " #~ "pour les détails)" #~ msgid "Choose either -z or -y not both" #~ msgstr "Choisir soit -z soit -y pas les deux à la fois" #~ msgid "" #~ "-G option is obsolete, use -@ option instead, see man page for details" #~ msgstr "" #~ "l'option -G est obsolète, utilise -@ à la place, voir la page de manuel " #~ "pour plus de détails" #~ msgid "NULL given as argument" #~ msgstr "NULL fourni comme argument" #~ msgid "NULL argument given to \"fs_root\"" #~ msgstr "Valeur NULL donnée à \"fs_root\"" #~ msgid "NULL argument given to \"selection\"" #~ msgstr "Valeur NULL donnée à \"selection\"" #~ msgid "NULL argument given to \"subtree\"" #~ msgstr "Valeur NULL donnée à \"subtree\"" #~ msgid "NULL argument given to \"execute\"" #~ msgstr "Valeur NULL donnée à \"execute\"" #~ msgid "NULL argument given to \"compr_mask\"" #~ msgstr "Valeur NULL donnée à \"compr_mask\"" #~ msgid "NULL argument given to \"min_compr_size\"" #~ msgstr "Valeur NULL donnée à \"min_compr_size\"" #~ msgid "NULL argument given to \"ea_mask\"" #~ msgstr "Valeur NULL donnée à \"ea_mask\"" #~ msgid "Cannot determine location of the end of cyphered data: " #~ msgstr "Impossible de localiser la fin des données chiffrées : " #~ msgid "Argument given to \"major\" is a NULL pointer" #~ msgstr "valeur NULL donnée à \"major\"" #~ msgid "Argument given to \"minor\" is a NULL pointer" #~ msgstr "Valeur NULL donnée à \"minor\"" #~ msgid "Argument given to \"medium\" is a NULL pointer" #~ msgstr "Valeur NULL donnée à \"medium\"" #~ msgid "argument given to \"minor\" is a NULL pointer" #~ msgstr "Valeur NULL donnée à \"minor\"" #~ msgid "invalid NULL argument given as mask option" #~ msgstr "argument NULL invalide donné pour l'option mask" #~ msgid "invalid NULL argument given as crit_action option" #~ msgstr "argument NULL invalide donné pour l'option crit_action" #~ msgid "-~ is only available with -+ option and -c options" #~ msgstr "-~ n'est disponible qu'avec les options -+ et -c" #~ msgid "End of file reached while skipping to the begin of a word" #~ msgstr "Fin de fichier atteinte lors du déplacement vers le début d'un mot" #~ msgid "Reached end of file while reading a word" #~ msgstr "Fin de fichier atteinte lors de la lecture d'un mot" #~ msgid "different file data" #~ msgstr "données différentes" #~ msgid "" #~ "Archive format older than \"08\" (release 2.4.0) cannot be read through a " #~ "single pipe, only using dar_slave or normal plain file (slice) method" #~ msgstr "" #~ "Un format d'archive plus ancien que \"08\" (release 2.4.0) ne peut être " #~ "lu à partir d'un seul tube, seule la lecture avec dar_slave ou à partir " #~ "de fichiers (c'est à dire de tranches) est possible" #~ msgid "unary operator" #~ msgstr "opérateur unaire" #~ msgid "Corrupted database, empty entry found" #~ msgstr "Base de données corrompue, entrée vide trouvée" #~ msgid "Reached End of File while reading CRC data" #~ msgstr "Fin de fichier atteinte pendant la lecture d'un CRC" #~ msgid "Error checking for presence of file " #~ msgstr "Erreur lors de la vérification de la présence du fichier " dar-2.5.3/po/stamp-po0000644000175000017520000000001212642474573011322 00000000000000timestamp dar-2.5.3/po/Makefile.in.in0000644000175000017520000004155312642474463012326 00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.19 GETTEXT_MACRO_VERSION = 0.19 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SED = @SED@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot POFILESDEPS_yes = $(POFILESDEPS_) POFILESDEPS_no = POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) DISTFILESDEPS_ = update-po DISTFILESDEPS_yes = $(DISTFILESDEPS_) DISTFILESDEPS_no = DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. CHECK_MACRO_VERSION = \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # The determination of whether the package xyz is a GNU one is based on the # heuristic whether some file in the top level directory mentions "GNU xyz". # If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed package_gnu="$(PACKAGE_GNU)"; \ test -n "$$package_gnu" || { \ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ -size -10000000c -exec grep 'GNU @PACKAGE@' \ /dev/null '{}' ';' 2>/dev/null; \ else \ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu=yes; \ else \ package_gnu=no; \ fi; \ }; \ if test "$$package_gnu" = "yes"; then \ package_prefix='GNU '; \ else \ package_prefix=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(POFILESDEPS) @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/po/Rules-quot0000644000175000017520000000416512642474463011655 00000000000000# This file, Rules-quot, can be copied and used freely without restrictions. # Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ ;; \ *) \ $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ ;; \ esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ ; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header dar-2.5.3/po/fr.gmo0000644000175000017520000057142412642474573010776 00000000000000Þ•9ä)÷¬Sˆo‰o˜o®o;¾oúo=pQp hp‰p!‹p­p(°pÙpùñpÐëq—¼r TsGõs=tYtGxt)Àt7êt;"u1^u?uCÐuJvO_vC¯v2óv5&w@\w0w.Îw-ýw?+x<kxH¨x4ñxK&yEry>¸y?÷yC7zJ{z9ÆzO{AP{A’{HÔ{;|DY|Cž|#â|F}M})k}$•}'º}$â}F~8N~7‡~@¿~=>>A}B¿C€<F€:ƒ€:¾€,ù€:&;a0>ÎI ‚)W‚‚9œ‚+Ö‚7ƒ-:ƒBhƒ9«ƒ)åƒ&„ 6„PW„L¨„Cõ„G9…)…=«…;é… %†IF†J†BÛ†.‡FM‡+”‡=À‡*þ‡:)ˆHdˆ#­ˆ*шLüˆ:I‰„‰!ž‰.À‰Kï‰<;Š'xŠD ŠBåŠ%(‹$N‹%s‹%™‹*¿‹,ê‹$Œ%<Œ%bŒ%ˆŒ%®Œ%ÔŒ%úŒ% $F%k%‘%·%Ý%Ž%)Ž%OŽ%uŽ%›Ž@ÁŽDGQf¸3Î2+51a8“.Ì!û7‘U‘l‘-€‘*®‘Ù‘î‘&’A-’Ao’3±’å’û’“3“O“k“1‡“1¹“ë“”#”?” ]”h”&€”.§”^Ö” 5•?•R•p•‹•ª•‰Æ•‹P–6Ü–—_(—Yˆ—Dâ—)'˜&Q˜8x˜9±˜;ë˜<'™d™K™Ë™8ã™$š2Aš8tš­šBÊš ›*›2I›|›–›?²› ò›$þ›%#œ5Iœ7œ·œ4לO /\/Œ/¼#ì9ž=JžBˆžIËž"Ÿ)8Ÿ4bŸ—ŸJµŸ M >g H¦ lï h\¡jÅ¡k0¢œ¢c¹¢O£¬m£(¤+C¤'o¤—¤¬¤ä2ŤHø¤$A¥If¥A°¥Yò¥UL¦P¢¦Qó¦1E§4w§X¬§½¨+è"ï¨-©>@©5©#µ©0Ù©> ªIª cªU„ªÚª ùª/«$J«Ko«@»«Kü«2H¬+{¬:§¬-â¬'­38­l­;†­>­)®+®!A®c®!€®8¢®+Û®H¯HP¯ ™¯º¯8¯û¯°G)°:q°f¬°9±1M±1±r±±$²=²C[²FŸ²6æ²)³.G³Kv³?³L´%O´)u´)Ÿ´(É´ ò´.µ;Bµ+~µ#ªµ ε•﵃…¶y ·ƒ¸"–¸*¹¸ä¸ÿ¸¹%3¹WY¹±¹Â¹<Dº8º-ººèº!»*%»=P»*Ž»5¹»ï»:¼"C¼*f¼Ñ‘¼!c½.…½´½Ò½=î½,¾?E¾/…¾Šµ¾E@¿†¿¥¿LÅ¿#À$6À[À2wÀ2ªÀÝÀôÀÁ,*Á2WÁŠÁŠ¡ÁH,Â'uÂŽÂ1,Ã#^ÂÃD˜ÃLÝÃK*ÄFvÄ+½Ä=éÄO'Å9wÅ>±ÅðÅ3 Æ2=Æ(pÆ'™Æ%ÁÆçÆ'üÆŒ$DZÇ!ÉÇëÇÿÇ#È/@È%pÈ(–È¿ÈÖÈ?ëÈ&+ÉGRɚɳÉÇÉ1ßÉ1Ê%CÊ6iÊ% ÊÆÊàÊ"ôÊË3/ËcË%~Ë'¤Ë.ÌË-ûË)Ì&BÌỉÌ% ÌÆÌuÝÌ0SÍ+„ͰÍ&ÏÍ'öÍ Î@?Î3€Î!´Î%ÖÎ6üÎ3Ï PÏqÏ‘Ï­Ï ¼ÏÇÏ(ØÏ0Ð*2Ð3]ÐK‘Ð2ÝÐÑK(ÑtÑ-“Ñ>ÁÑ+Ò",Ò OÒCZÒ žÒ¬Ò,ËÒøÒÓ2Ó7GÓ:ÓºÓ3ÓÓHÔ+PÔN|Ô5ËÔ0Õ=2ÕpÕYÕ?ÛÕbÖB~Ö/ÁÖ3ñÖµ%×5Û×.Ø&@ØgØmØ6rØJ©Ø7ôØ@,ÙmÙÙF­Ù+ôÙN ÚJoÚºÚÓÚ-óÚ0!Û:RÛaÜ6ïÜ/&ݤVÝbûݬ^Þ ßb+ߎß=Ÿß(ÝßUà2\áqá%â*'â&Râyâjãrã’ã²ãNÒã2!ämTä"Âä>åä$åDåIåÉOå7æ2Qæ+„æ °æ:Ñæ ç$*ç9Oç+‰çµç*Ôç!ÿç!è0Aè?rè]²èké*|é0§é1Øé0 ê%;êaê~ê.œê(Ëê_ôê&Të_{ë2Ûë$ì+3ì_ì.sì¢ì¼ì)Ñìûì*í<íVí"sí"–í#¹íYÝí7î$Rî%wî0î Îîïî6 ïAï@_ïS ï8ôï*-ð/Xð/ˆð¸ð?Öð(ñ%?ñ'eñ!ñ#¯ñ;Óñ>ò)Nòxò)˜ò Âò9ãòOó&móJ”ó/ßó.ô)>ô+hôS”ôTèô=õçWõ-?ömöö/­öÝö;úö6÷M÷+j÷–÷ª÷/Ä÷'ô÷+øDHøø"«øÎø-ìø3ù+Nù-zù8¨ù áú,íú4û-Oû5}ûy³û-üMü+mük™üýO%ý3uý©ýÉýcäý_Hþ¨þ)Äþ)îþÿ2ÿ^OÿV®ÿI7O&‡6®å*4-4b—"¶ÙicybÝh@e©#3N0k‚œ3cS!·Ùí)?-W…!ŸÁKÛ­''Õý­V³  ^ { Aš 1Ü  +- AY K› +ç " ?6 Nv 9Å (ÿ $(Mi*ªCÆ@ BKIŽ3Ø@ M#^‚™¨¹ÉÚ*í-&Cj~—'²"Ú'ý.%Tq#‚¦ÁÜ#÷;[{›»'Ù ,f<3£×)ñ ÷&Á©à¡Š,í½e«æ.Œº¢÷]fU ¡¼ ^!=`"&ž"fÅ";,#wh#Là#z-$<¨$úå$3à%K&¬`&¿ '`Í'?.(|n(xë(¿d)?$*$d*Y‰*Æã*3ª+cÞ+HB,Ÿ‹,Ë+-Ö÷-3Î.]/{`/^Ü/;1CJ1Ž1;¥1!á1>2"B2 e2'†2®2 Ë2Pì2H=3]†3ä3.4914,k4$˜40½4)î45 35T5k5‰5 5·5Î5ì5 6*!6L6*g6%’6.¸6`ç6H7Nh7-·7$å7 8' 8+58La8$®8Ó8'ç809@9X^9·9DÑ9d:{:Ž:*®:9Ù:+;?;)Q;){;¥;H¶;Eÿ;‰E<fÏ<b6=¡™=$;>,`>)> ·>Ø>ö>< ? G?$Q?+v?H¢?Në?":@]@b@h@ƒ@¡@¿@Ý@û@UA%oA•A¬AÊA,åA5B-HBIvB>ÀBQÿB QC rC.|Cˆ«C14D fDtD#D ´DBÕDMEDfEN«E@úE;FVFEuFE»FG G3@GGtG1¼GIîG18H.jH;™H!ÕH'÷HI*;I1fI˜IL¶IJ("JKJ_JsJ&’J:¹JôJAK0GK)xK¢KQ½K#L‘3L"ÅL#èL M"M9M%QM3wM„«M0N ²N-ÓNyO3{O¯OAµO÷O*PdBP/§P×Pƒ÷P*{Q$¦QYËQF%RElRX²R SS(S¤|S9!T[T{TO›T*ëT,UCU1bU1”U$ÆU_ëUYKVr¥VVWdoW[ÔWJ0X\{X…ØXQ^Y&°YF×YEZ?dZ<¤Z§áZ̉[+V\P‚\EÓ\-]ÊG]?^=R^W^yè^…b_Iè`?2a;ra!®avÐašGb9âb+c>Hc'‡cL¯cEüc&Bd$idÓŽdDbeQ§eùe$f55f kf"Œf.¯fÞf!öf!g!:g\gA{g:½gøghh2hÅOhi;2i*ni!™i »i,Éi"öi*j&Dj+kj-—jÅjÙj øjk +k#8k)\k*†k+±k+Ýk6 lL@lVlcälVHnOŸn}ïnMmo@»oüo}qÜŽq×kr~Cs5ÂsCøs]k…ª…$À…å… ÿ… †Z†9k†Ò¥†x‡—‡ž‡¢‡²‡ µ‡Ö‡%ì‡&ˆ9ˆ Xˆcˆhˆ%kˆ&‘ˆ¸ˆȈ$åˆ ‰‰X'‰€‰4…‰º‰Ô‰*܉8Š @ŠLŠ QŠ\ŠdŠ6mŠ/¤Š:ÔŠ‹ ‹(‹0‹9‹R‹&[‹%‚‹¨‹*Å‹ð‹ù‹Œ2Œ<9ŒvŒ†Œ Œ1—ŒÉŒÑŒçŒúŒB?TޔޝŽËŽwÐŽOH ˜ ¤°Å!Ù!û !+"MPp&Á&è ‘E‘C`‘¤‘g¨‘Å’Ö“+å“”P!”r”P‹”$Ü”*•,•.•M•&P•w•0‘•;–Ôþ—óÓ˜KÇ™š -š[Nš1ªš>Üš;›9W›@‘›JÒ›YœLwœFÄœ/ ;;3w6«(â2 žN>ž:žNÈž7ŸTOŸO¤Ÿ<ôŸV1 Hˆ <Ñ C¡WR¡Tª¡:ÿ¡]:¢<˜¢AÕ¢Q£1i£V›£'ò£9¤"T¤w¤+“¤H¿¤1¥1:¥Dl¥C±¥Rõ¥OH¦M˜¦Qæ¦G8§T€§>Õ§#¨O8¨Dˆ¨6ͨ=©OB©:’©Í©;ç©2#ª<Vª8“ªG̪=«$R«!w«™«f´«_¬B{¬?¾¬*þ¬W)­A­$íYè­aB®6¤®-Û®S ¯4]¯X’¯8ë¯E$°Fj°&±°<ذU±k±±(Ÿ±8ȱ[²N]² ¬²1ͲPÿ²&P³$w³%œ³%³*è³/´$C´%h´%Ž´%´´%Ú´%µ%&µ%Lµ$rµ%—µ%½µ%ãµ% ¶%/¶%U¶%{¶%¡¶-ǶFõ¶l<·$©·hη7¸HR¸;›¸0׸=¹FF¹-¹/»¹Më¹9ºSºMiº2·ºêº»&»FF»F»6Ô» ¼#¼?¼_¼¼›¼1·¼?é¼)½E½a½}½½+´½,à½A ¾€O¾ о Ú¾.û¾+*¿ V¿w¿”•¿”*À<¿ÀüÀeÁUvÁUÌÁ,"Â-OÂ>}Â1¼ÂAîÂ60ÃgÃR…Ã'ØÃ+Ä!,Ä<NÄA‹Ä ÍÄFîÄ 5Å!VÅ2xÅ&«Å&ÒÅNùÅ HÆ)VÆ+€Æ;¬ÆJèÆ+3Ç8_ÇN˜Ç/çÇ/È/GÈ#wÈ8›ÈBÔÈFÉX^É'·É0ßÉJÊ"[ÊY~ÊØÊWóÊHKËw”ˆ ÌŽ“Ì"Í‚³Í6ÎiUÎU¿ÎÄÏ&ÚÏ*Ð4,ÐaÐxÐŽÐ0ÐSÁÐ(ÑS>ÑF’Ñ^ÙÑm8Òf¦Òe Ó6sÓLªÓS÷Ó±KÔ0ýÔ'.ÕVVÕU­ÕBÖ#FÖ;jÖU¦Ö"üÖ)×bI×#¬× Ð×Añ×.3Ø1bØ;”Ø1ÐØ=Ù0@ÙHqÙ;ºÙ+öÙ8"Ú"[ÚQ~ÚaÐÚ12ÛdÛ#„Û¨Û#¿Û0ãÛ0Ü`EÜL¦Ü(óÜÝE#Ýi݉ÝRžÝ<ñÝf.ÞC•ÞCÙÞ8ßxVßÏß ìßG à]Uà2³à-æà4áWIá^¡áMâ2Nâ:â1¼â5îâ)$ã@Nã%ãFµã9üã@6äÁwäš9å’Ôågç"}ç* çËç!êç è7,èYdè¾èšÒè[méEÉé2ê Bê"cê*†êI±ê8ûê14ëfëV€ë'×ë*ÿëò*ì1íKOí›í²íHÉíîI+î*uî– îU7ï%ï³ï[Óï0/ð1`ð&’ð¹ð2Ùð, ñ9ñ%Lñ@rñD³ñ$øñÎòmìò=Zó®˜óFGô?Žô"ÎôSñôWEõVõJôõA?öHöjÊöO5÷E…÷0Ë÷?ü÷F<ø9ƒø9½ø:÷ø:2ùEmù–³ù$Jú,oú!œú'¾ú5æú>û3[û.û¾ûÝûGúûQBüa”ü%öü"ý&?ýQfýF¸ýCÿýGCþ5‹þ(Áþ/êþ9ÿ,TÿSÿ'Õÿ3ýÿ@1@rH³&ü-# QrG!Øvú1q*£,Î4û206cRšAí:/)jJ”"ß)),'V~ ”¡.µEä+*>VI•9ßP5-†2´5çA(_ ˆA” Ö/ã3 &G /n ž G» Q "U Dx X½ ? YV I° Fú NA  d¨ P ‹^ Qê C<7€ĸ?}7½.õ$*T2Q‡CÙM+k+—RÃ-SDR˜+ë+0C>tž³YRK¬@ø¶9fð´W+ p8©G»)S-FˆÈDQB–DÙ z¿+:+f+’g¾J&‹q3ýP1+‚®³ÿ¹I¹ 4!-8!*f!H‘!EÚ! "1>"5p"*¦"2Ñ".#83#.l#S›#dï#}T$AÒ$C%CX%Iœ%>æ%5%&#[&4&2´&}ç&+e'…‘'G(1_(7‘(É(<å(+")%N)5t)&ª)=Ñ)+**;*5f*7œ*/Ô*q+0v+/§+6×+(,07,&h,D,Ô,\ó,}P-LÎ-2.7N.I†./Ð.m/8n//§/T×/.,00[0WŒ0Pä0:514p15¥1<Û1I2lb25Ï2p3Hv37¿3,÷35$4yZ4zÔ4$O5t5G‰6'Ñ6+ù6:%7 `7Y7"Û7%þ77$8 \8+}8T©87þ8169Uh9#¾9(â9- :99:4s:0¨:7Ù:W; i<5w<I­<6÷<;.=™j=>)>4E>hz>*ã>Y?<h?(¥?$Î?~ó?~r@5ñ@7'A:_A#šA*¾AZéArDBB·BBúB>=C<|C#¹C.ÝCE DGRD3šD5ÎD«E°E~ÄElCF°Fv0GA§G%éGHK/H£{HIIuiI"ßIJ J?JAUJ+—J1ÃJ"õJ"K%;KsaK½ÕK3“LÇL¬ÐL‡}NPkP(ˆPL±PRþP(QQ<zQN·Q<R9CR+}RS©RnýRVlSCÃS(T0TLT(iT$’TY·T\UYnUQÈUFVUaV·V,ÇVôVWW)W8WKW6^W•W¯WËWéWX$X1CX,uX¢X'ÀX#èX Y,YLY&hY&Y*¶Y+áY+ Z+9Z+eZ)‘Z%»ZRáZ 4[6A[zx[5ó[)]:D]¾]$>^uc_¼ÙaÈ–b—_c"÷cŠe"¥e Èe¥ÒfÔxgMhˆdiÛíi`ÉjO*l*zl\¥lFmŠImZÔm/nBÀn$o?(pXhpÇÁp܉qmfrLÔrŠ!s}¬s*tO0u.€ua¯uávLóv€@waÁwÄ#xèx¶ñyI¨ztòzŸg{È|Ð}Aâ}$~7@~"x~U›~*ñ~%+B(n —¸TI€vž€"08Ki7µ,íC‚,^‚‹‚$ª‚#Ï‚ó‚#ƒ#4ƒXƒsƒƒ­ƒ7ȃ!„<"„._„=Ž„xÌ„E…Cc…7§…,ß… †2†<C†W€†#؆&ü†!#‡DE‡ Їj«‡$ˆi;ˆk¥ˆ‰(,‰QU‰E§‰0퉊66Š6mФŠg½Šp%‹É–‹‡`Œ}èŒâf9IŽ=ƒŽ;ÁŽ ýŽ>FT ›H¥8î\'b„)ç‘‘!‘>‘^‘~‘ž‘¾‘tÞ‘8S’Œ’*ª’)Õ’Aÿ’?A“6“L¸“B”gH”A°” ò”-ý”s+•EŸ•å•,ú•.'–)V–F€–qÇ–Y9—O“—Eã— )˜%J˜Jp˜P»˜. ™);™4e™Tš™Bï™]2šGšLØšB%›6h›@Ÿ›#à›/œ:4œ%oœc•œ"ùœ*GX&g,ŽA»ýIž4až+–žžSáž'5ŸŒ]Ÿ$êŸ% 05 "f &‰ /° mà |N¡°Ë¡,|¢&©¢„ТGU££N££$ò£H¤j`¤=ˤ, ¥¤6¥*Û¥+¦Z2¦G¦jÕ¦‡@§&ȧQï§ÜA¨E©+d© ©k±©*ªHHª<‘ªQΪQ «3r«d¦«q ¬m}¬\ë¬vH­q¿­P1®€‚®´¯C¸¯$ü¯H!°Ij°<´°Lñ°Ù>±²A³e^³Fij7 ´êC´Y.µWˆµ`àµYA¶Ì›¶[h¸Uĸ9¹$T¹Šy¹ÈºGͺ9»IO»8™»aÒ»^4¼F“¼)Ú¼ì½Wñ½iI¾³¾(;Iö¾'@¿&h¿<¿Ì¿ ê¿ À ,ÀMÀ>lÀR«ÀþÀ Á!Á!@ÁÏbÁ'2ÂUZÂ5°Â2æÂÃ0(Ã<YÃ,–Ã(ÃÃ?ìÃD,ÄqÄ#Ä&³ÄÚÄòÄAÅ;HÅ<„Å8ÁÅ%úÅS Æ\tÆLÑÆ|Çm›ÈM ÉÀWÉFÊR_ÊS²ÊÌ —Ìô¢Í|—Î>ÏSSÏj§ÏKМ^ЃûÐyÑ-ùÑŠ'Ó<²ÓïÓ$õÓ Ô&;Ô,bÔEÔ,ÕÔ(Õ7+ÕcÕ4gÕ œÕ ¦Õ °ÕºÕÓÕuÛÕQÖYÖ$aÖ†Ö‹Ö’Ö,›Ö ÈÖ0ÓÖ0×-5×&c×|Š×*Ø)2Ø\ØaØ6vØ­Ø[³Ø@Ù@PÙ‘ÙR«Ù þÙ)Ú2ÚQÚpÚÚ’Ú¨ÚP¾ÚGÛ,WÛ„Û5šÛÐÛáÛ'òÛBÜB]Ü8 ÜÙÜ6öÜZ-݈Ý3¤Ý3ØÝ% Þ 2Þ=ÞUÞ [Þ.gÞ(–Þ¿ÞÑÞ6ÚÞ0ß8Bßa{ß,Ýß àà@àXàkà tàZàÚàßàñàIá[ámá2|á ¯á¹á"Õákøá&dâ&‹â%²â=ØâwãDŽãhÓãZ<ä—ä;²ä"îä åå~$åI£åðíå&Þæç ççç!#ç!Eç3gç8›ç*Ôç ÿç èè*è*Bèmè‰è/©èÙèéèmüèjé4pé ¥é Æé(Òé?ûé;ê Bê Mê[êcê=lêFªêGñê9ë Më[ë dënë„ë$ë$²ë$×ë5üë2ì;ìWìwìY€ìÚì ðìûì4 í@íPíeí{íeí7öî#.ïRïnï‘sïYð_ð nð#yðð'²ð$Úðÿð(ñ"8ñP[ñ0¬ñ0ÝñòFòIdò®òa²ò\¹0µI¯o <¯Ô5Ìsº÷yBr@Ô j2@NÏk4Û¦˜)XÛ• —ª-¢¦-N&£?!¾]ys'€-UGÅDF·©C¢/ ²´a…ÀŠú:Ðì  4ó E!¼šËs1tM]ñH¾ý?”a°½\–È%Ü q')ÌõT—Šû䦈hñ¬u* ®±2t?-ÍårOãÉŽÂùÉë¤î³ó7h,4º¡Å©@_͌ศÍÇ…æo²áÈH] ´i`™Š×NïžT~¯ùS{}–™_*à/„øC Z¾ʬ@Û[1б×Ò("Ú <$4±Ìb°„3#|σT4*d¬:ÁŒaDúˆm‚ªF ªwiˆ½ò¢ª“!e÷.›,¡ìó5|OvD‰A1; 5`ÒœZB%™«’ÔåÚíÏÐLïÝo¨R—duí&`íg ƒšiÙ†Kºî Aºš<˜Æ¤÷9*(ÆúW~*Ožü}˜f8¿YgËMë·^‰€V™`qV<ôuK¸ÑJ*ÄÿœEç”vŸ3±‘ Ü(cW%Ü?IE µ‘êé´¨Ñõ`wÁôÒæ"ò%ßÀ–"ê;¦­Öˆ/ÃJ UD¸ýtŒQcˆ¸‹wM•0(j(ÿâY¯;šEÖÈS¶á} w+õ]R W..'Å"Ì1ŽÅîöÑi7I|lgBHûÝèv×y"û8â‰rèÿS&R¥œÇ¡à†·rŸV¼êiJHzµÉÊFð2Œ‡9+7„JOÍ\‡pÊxÕ>‘øPŽ f îÀR’©nÇ…¡Õ‰×ö–¢ƒÖÕËß•›"0ꃀÉZ¥ÁðÎb‘_x¤¦c{/!)|¤ØÄ'§ÆÔ5¥ë¿ß Aì§3nbâ×NÇÿ$šÏV³<$ ü²¹Ä¤XbÝ'½/sPæ“ÖÊ$YV ¥#)ä=1À‰ÜvŠŸp€®¨{þàœÿIÆy:½lfÏxlñùXÞ,\P¯ýæN{~¶3W†g‡ç­Í#»¿Û•pù¶®t í·7oxÃ^XoÑG‚á0Ð2‡ákú â•YQöG‹ô^C¼»ô£ž.[b$KaRƒ%çõ¾´+2Îáû“7¾’÷QÂÐèþìL²ìLÓz[« ˜ q ZH#Êf‹ ¬Ôžc‚ò#ò6«­“yUØjãã3qÛÅB8m[¡,Ëu^,3ïç¿UÁ »åé§›L)hm ðß±ä¸åÞ…¼„ß?ðt@›¶zÒv¥dâî>²ø+Ó ³Ú‚ø§5uÓÚ\¨Âø:8üüa€µ½M ÎÚ+»Géã®mªäÝê£ÈTZS#ݰ>6&ËõØÂnñ6³$}ãÙFÆ.MïPÓô!¹.’>¹å”…U™ÞÙàó£ö~ JÖ:Sw0®rÃT‡6·%—C^céIÙÌ0òþ´)†Þ©QüÞ8eØú°èdкÒ,hçqÈž­ 6†8l1~ð&4>Ç& deL» 9[æ{ñ9éOÁ'­¢/9!¶Ÿù’2óKœ«-جûFkóèÎmn›ej¼=ï—_=Ä„µ–kCgBD‹“]K”hɹë¿kÎfzÙ°À‚Ó =5xý£6=äj”þÃY-_}ö©(pŽ7˜zes‘lŸ;ý§þÜë9WŽŒpPíGnX+÷ÑA«ÕAE|;ÄÕQ‹ Standard extraction time ownership the first non options argument is the archive to read the provided file. the second non option argument is the archive to create No pause in output Pause each %d line of output Executing batch file line: %S Dar Manager Database used [%s] : %S CATALOGUE CONTENTS : WARNING! This archive only contains the contents of another archive, it can only be used as reference for differential backup or as rescue in case of corruption of the original archive's content. You cannot restore any data from this archive alone Your decision about file's EA: [p]reserve [o]verwrite mark [s]aved and preserve mark saved and overwri[t]e [m]erge EA and preserve merge EA a[n]d overwrite [r]emove [*] keep undefined [a]bort Your choice? Your decision about file's FSA: [p]reserve [o]verwrite mark [s]aved and preserve mark saved and overwri[t]e [*] keep undefined [a]bort Your choice? Your decision about file's data: [P]reserve [O]verwrite mark [S]aved and preserve mark saved and overwri[T]e [R]emove [*] keep undefined [A]bort Your Choice? Available algo: gzip,bzip2,lzo,xz. Exemples: -zlzo -zxz:5 -z1 -z Extended Attribute: [ including %i hard link(s) %i file(s) have been record as destroyed since backup of reference -# encryption block size -$ encryption key for auxiliary archive -* same as -# but for archive of reference -+ merge two archives / create a sub archive -, ignore directories that follow the Directory Tagging --nodump do not backup, files having the nodump 'd' flag set -/ which way dar can overwrite files at archive merging or -@ [path/] Do on-fly catalogue isolation of the resulting archive -@ [path/] auxiliary archive of reference for merging -A add an archive to the database -A [path/] archive to take as reference -B specify the database to use (read or modify) -B read options from given file -C isolates the catalogue from an archive -C creates an empty database -D excluded directories are stored as empty directories -D delete an archive from the database -E command line to execute between slices of the archive -E command to execute between slices -E command to execute between slices of destination archive -F command to execute between slice of source archive -F same as -E but for the archive of reference -H [N] ignore shift in dates of an exact number of hours -I files to include in the operation (all by default) -J same as -K but it does concern the archive of reference -K use as key to encrypt/decrypt -L execute on a given database a batch of action as defined by -M stay in the same filesystem while scanning directories -N do not read ~/.darrc nor /etc/darrc configuration file -O[ignore-owner | mtime | inode-type] do not consider user and group -P subdirectory to exclude from the operation -Q suppress the initial warning when not launched from a tty -R filesystem root directory (current dir by default) -S first file size -S first file size (if different from following ones) -T tree output format -U mask to allow certain EA -V displays software version -V displays version information -V displays version information -X files to exclude from the operation (none by default) -Y do only compress the matching filenames -Z do not compress the matching filenames -[ filename contains a list of files to include -] filename contains a list of files to exclude -^ permission[:user[:group]] of created slices -aSI slice size suffixes k, M, T, G, etc. are power of 10 -aa do not try to preserve atime of file open for reading. -abinary slice size suffixes k, M, T, G, etc. are power of 2 -ac do not try to preserve ctime (default behavior). -acase the masks that follow are now case sensitive -ag set the following masks to be glob expressions -am set ordered mode for all filters -an the masks that follow are now case insensitive -ar set the following masks to be regex expressions -as only list files saved in the archive -b ring the terminal bell when user action is required -b change the basename to use for the give archive number -c check database for dates order -c creates an archive -d compares the archive with the existing filesystem -d specify the path to dar -e dry run, fake execution, nothing is produced -f do not restore directory structure -f list the archives where the given file is present -g subdirectory to include in the operation -h displays this help information -h displays this help information -i user interactive mode -i pipe to use instead of std input to read data from dar_slave -i pipe to use instead of std input to read orders from dar -k do not remove files destroyed since the reference backup -l gives information about the archive compiled in the database -l lists the contents of the archive -m do not compress file smaller than -m move an archive within a given database. -n don't overwrite files -o pipe to use instead of std output to orders dar_slave -o pipe to use instead of std output to write data to dar -o specify a list of option to always pass to dar -p pauses before writing to a new file -p change the path to use for the given archive number -q suppress final statistics report -r do not restore file older than those on filesystem -r restores the given files -s shows the number of most recent file by archive -s split the archive in several files of size -t tests the archive integrity -u mask to ignore certain EA -u list the most recent files contained in the given archive -v display more information about what is going on -v verbose output -vs display skipped files -w don't warn before overwriting files -w only with -r, restores in state just before the given date -wa don't warn before overwriting and removing files -x extracts files from the archive -z [[algo:]level] compress data in archive. -z = -z9 = -zgzip:9 -~ command between slices of the auxiliary archive Can uses multiple threads : %s Detected system/CPU endian : %s Extended Attributes support : %s Furtive read mode support : %s Integer size used : %d bits Integer size used : unlimited Large dir. speed optimi. : %s Large files support (> 2GB) : %s Libbz2 compression (bzip2) : %s Liblzma compression (xz) : %s Liblzo2 compression (lzo) : %s Libz compression (gzip) : %s Linux ext2/3/4 FSA support : %s Mac OS X HFS+ FSA support : %s Posix fadvise support : %s Public key ciphers (gpgme) : %s Restores dates of symlinks : %s Special allocation scheme : %s Strong encryption (libgcrypt): %s Thread safe support : %s Timestamp read accuracy : %S Timestamp write accuracy : %S ext2fs NODUMP flag support : %s including %i hard link(s) treated archive # | most recent/total data | most recent/total EA %i byte(s) have been wasted in the archive to resave changing files %i inode(s) added to archive %i inode(s) changed at the moment of the backup and could not be saved properly %i inode(s) deleted %i inode(s) failed to be saved (filesystem error) %i inode(s) failed to restore (filesystem error) %i inode(s) ignored (excluded by filters) %i inode(s) not restored (not saved in archive) %i inode(s) not restored (overwriting policy decision) %i inode(s) not saved (no inode/file change) %i inode(s) recorded as deleted %i inode(s) recorded as deleted from reference backup %i inode(s) restored %i inode(s) saved %i item(s) do not match those on filesystem %i item(s) ignored (excluded by filters) %i item(s) treated %i item(s) with error %s comes with ABSOLUTELY NO WARRANTY; %s comes with ABSOLUTELY NO WARRANTY; for details type `%s -W'. %s comes with ABSOLUTELY NO WARRANTY; for details type `dar -W'. %s is part of the Disk ARchive suite (Release %s) , please provide it. - Door entries : %i - block devices : %i - character devices : %i - directories : %i - named pipes : %i - number of inode with hard link : %i - number of reference to hard linked inodes: %i - plain files : %i - symbolic links : %i - unix sockets : %i . Ignoring file or directory . Retry ? . Retry command-line ? . Retry to launch dar as previously ? : Failed resaving uncompressed the inode data : Resaving uncompressed the inode data to gain space is not possible, keeping data compressed Choice: Continue anyway ? EA restored for %i inode(s) EA saved for %i inode(s) FSA restored for %i inode(s) FSA saved for %i inode(s) IF POSSIBLE TRY TO PRODUCE THIS ERROR, A SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH IN SOLVING THIS PROBLEM. THANKS IF POSSIBLE TRY TO REPRODUCE THIS ERROR, A SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH IN SOLVING THIS PROBLEM. THANKS Only one option of -c -d -t -l -C -x or -+ is allowed Ready to continue ? THANKS TO REPORT THE PREVIOUS OUTPUT TO MAINTAINER GIVING A DESCRIPTION OF THE CIRCUMSTANCES. This is free software, and you are welcome to redistribute it under certain conditions; This is free software, and you are welcome to redistribute it under Total number of inode(s) considered: %i Total number of items considered: %i Using libdar %u.%u built with compilation time options: Using libdar %u.%u built with compilation time options: Using libdar %u.%u.%u built with compilation time options: Using libdar %u.%u.%u built with compilation time options: [return = YES | Esc = NO] a : Save as n : pause each 'n' line (zero for no pause) c : check date order certain conditions; type `dar -L | more' for details. compiled the %s with %s version %s d : path to dar o : options to dar f : give file localization m : modify archive order for details type `dar -W'. is a slice from another backup, please provide the correct slice. is about to be overwritten. is not present in the archive l : list database contents A : Add an archive not merged (user choice) not restored (user choice) p : modify path of archives b : modify basename of archives q : quit type `%s -L | more' for details. type `dar -L | more' for details. u : list archive contents D : Remove an archive w : write changes to file s : database statistics with %i hard link(s) recorded "-k" (or "-kignore") and "-konly" are not compatible"first_file_size" cannot be different from zero if "file_size" is equal to zero# E X I T I N G ! ## NOT CAUGHT EXCEPTION, ## UNEXPECTED EXCEPTION, #%S [%c] [ REMOVED ENTRY ] (%S) %S %S already exists, and overwritten is forbidden, aborting%S did not exist before specified date and cannot be restored%S has a bad or corrupted header, please provide the correct file.%S is about to be deleted (required by overwriting policy), do you agree?%S is about to be overwritten, OK?%S is about to be overwritten, continue ?%S is about to be removed from filesystem, continue?%S is an not a valid path: %S%S is not a valid file (wrong magic number), please provide the good file.%S is not a valid number%S is required for further operation, please provide the file if you have it.%S is required for further operation, please provide the file.%S must be removed, but does not match expected type, remove it anyway ?%S: Overwriting policy (Data) is undefined for that file, do not know whether overwriting is allowed or not!%S: Overwriting policy (Data) is undefined for that file, do not know whether removal is allowed or not!%S: Overwriting policy (EA) is undefined for that file, do not know whether overwriting is allowed or not!%S: Overwriting policy (FSA) is undefined for that file, do not know whether overwriting is allowed or not!%d is not a valid block size%d is the default value for --sparse-file-min-size, no need to specify it on command line, ignoring%d is the default value for -m, no need to specify it on command line, ignoring%s does not name a compression "[algorithm][:][level]" , like for examples "gzip", "lzo", "bzip2", "lzo:3", "gzip:2", "8" or "1". Please review the man page about -z option%s type is not a signed type as expected%s type is not an unsigned type as expected%s type length is not %d byte(s) but %d, compression ratio , ready to continue ? --$ is only available with -+ option and -c options-$ is only useful with -@ option, for the auxiliary archive of reference-%% is only available with -+ option-%% is only useful with -@ option, for the auxiliary archive of reference--------------+-------------------------+----------------------- ---------------+-------------------------+--------++-------------------------+---------- --nodump feature has not been activated at compilation time, it is thus not available--sparse-file-min-size only available while saving or merging archives, ignoring-. option is only useful when merging, creating or isolating an archive, ignoring-/ option is only useful with -+ option, ignoring-9 option is only valid after -A option, ignoring it-= option is valid only while saving files, thus in conjunction with -c option, ignoring-= option will be ignored as it is useless if you do not specify to which files or directories this backup hook is to be applied, thanks to -< and -> options. See man page for more details.-@ is only available with -+ and -c options-A option is not available with -l-B option cannot be given inside a batch file-F is only useful with -A option, for the archive of reference-H is only useful with -A option when making a backup-H is only useful with -c, -d or -x-H is only useful with -r option when extracting-J is only useful with -A option, for the archive of reference-M is only useful with -c-S option requires the use of -s-Y and -Z are only useful with compression (-z option), ignoring any -Y and -Z option-a option requires an argument-ac is only useful with -c or -d-af must be present before -A option not after!-af option is only available with -c-af option need not be specified more than once, ignoring extra -af options-ak is only available while merging (operation -+), ignoring -ak-ak option need not be specified more than once, ignoring extra -ak options-as is only available with -l, ignoring -as option-e is only useful with -x, -c or -+ options-e option is only available when using -r option, aborting-f in only available with -x option, ignoring-k option is only useful with -x option-konly and -kignore cannot be used at the same time-m is only useful with -c-m is only useful with compression (-z option), ignoring -m-o is mandatory when using "-A -" with "-c -" "-C -" or "-+ -"-p and -Q options are mutually exclusives-r is useless with -n-vf is only useful with -c option-w option is useless with -n-wa is only useful with -x option-z option needs only to be used with -c -C or -+ options-~ is only available with -+ and -c options-~ is only useful with -@ option, for the auxiliary archive of reference... A strong randomly generated key could be found after %d iteration(s): file not present in filesystemA problem occurred while reading this archive contents: Aborting batch operation: Aborting program. Aborting program. An error occurred concerning user command execution: Aborting program. An error occurred while calling libdar: Aborting program. The requested operation needs a feature that has been disabled at compilation time: Aborting program. User refused to continue while asking: Aborting program: child process died unexpectedlyAbsolute value too high for an archive number: %dAccess mode | User | Group | Size | Date | [Data ][ EA ][FSA][Compr][S]| Filename Adding %S to archive: %SAdding Hard link to archive: Adding a new layer on top: Caching layer for better performances...Adding a new layer on top: Escape layer to allow sequential reading...Adding a new layer on top: Strong encryption object...Adding a new layer on top: compression...Adding a new layer on top: scrambler object...Adding an explicit escape sequence of type seqt_not_a_sequence is forbiddenAdding cache layer over pipe to provide limited skippability...Adding reference to files that have been destroyed since reference backup...All files asked could not be restoredAll layers have been created successfullyAn empty string is not a valid group nameAn empty string is not a valid user nameArchive %S requires a password: Archive assignment operator is not implementedArchive basename (or extracted catalogue basename) to add: Archive copy constructor is not implementedArchive delayed termination engagedArchive fast termination engagedArchive format older than "08" (release 2.4.0) cannot be read through a single pipe. It only can be read using dar_slave or normal plain file (slice)Archive internal catalogue is not identically signed as the archive itself, this might be the sign the archive has been compromisedArchive internal catalogue is properly signed but its content does not match the tape marks used so far for sequentially reading. Possible data corruption or archive compromission occurred! if data extracted in sequential read mode does not match the data extracted in direct access mode, consider the sequential data has been been modified after the archive has been generatedArchive is closed.Archive is composed of %i file(s) Archive is signed : %S Archive number to modify: Archive number to move: Archive number to remove: Archive number who's path to modify: Archive number | Data | status || EA | status Archive number: Archive of reference is not signed properly (no the same signatories for the archive and the internal catalogue), do we continue?Archive on stdout is not compatible with slicing (-s option)Archive signature is only possible with gnupg encryptionArchive size is unknown (reading from a pipe)Archive size is: %i bytes Archive total size is : %i bytes Archive version format : %s Archive version too high, use a more recent version of libdarAre you sure to remove archive number %d ?Argument given to -H is not a positive integer numberArguments read from %S :Arguments to -r must be relative path (never begin by '/')Asking for an element out of arrayAsymmetric key encryption used : %S At least one slice of an old archive with the same name remains in the directory %s. It is advised to remove all the old archive's slices before creating an archive of same name. Can I remove these old slices?Bad CRC, data corruption occurredBad answer from peer, while closing connectionBad formatted date expressionBadly formated octal numberBadly formatted SAR header (unknown TLV type in slice header)Badly formatted databaseBadly formatted terminator, cannot extract catalogue location: Badly formed "infinint" or not supported formatBirth Time attribute cannot be restored for %s because no FSA familly able to carry that attribute could be activated at compilation time.Both reference archive are nullptr, cannot merge archive from nothingBuilding the catalog object...CAUGHT A NON (LIB)DAR EXCEPTIONCRC difference concerning file's data (comparing with an isolated catalogue)CRC error detected while reading EACRC error detected while reading FSACRC error: data corruption.CRC failed for table of contents (aka "catalogue")Calculating the signature of the catalogue hash...Can't read saved data.Cancellation no confirmedCannot add an absolute pathCannot add another archive, database is fullCannot allocate memory for buffer while reading %SCannot block signals: Cannot cleanly abort the operation, thread-safe support is missing, will thus abruptly stop the program, generated archive may be unusableCannot compare EA: EA support has not been activated at compilation timeCannot compare files in write only modeCannot convert username to uid in statically linked binary, either directly provide the UID or run libdar from a dynamically linked executableCannot copy a wrapperlib object (NOT IMPLEMENTED)Cannot create database, file existsCannot create inode: Cannot dup() filedescriptor while copying "fichier_local" object: %sCannot evaluate this crit_and criterium as no criterium has been added to itCannot evaluate this crit_or criterium as no criterium has been added to itCannot extract from the internal catalogue the list of files to removeCannot flush read a write-only generic_fileCannot get catalogue of reference as it has not been providedCannot get data name of the archive, this archive is not completely initializedCannot get effective permission given a file descriptor: Cannot get ext2 attributes (and nodump flag value) for %S : %sCannot get file size: %sCannot get full path of current working directory: Cannot get inode information about file to remove Cannot get inode information for %s : %sCannot get inode information for %s: %sCannot get last modification date: %sCannot get mtime: %sCannot get size of %S: not a plain fileCannot handle such a too large integer. Use a full version of libdar (compiled to rely on the "infinint" integer type) to solve this problemCannot open catalogue: Cannot open destination file : %sCannot open file : Cannot open source file : %sCannot read "fcntl" file's flags : Cannot read arguments on command line, abortingCannot read directory contents: %s : Cannot read file information for %s : %sCannot read inode for Cannot read on inputCannot receive that much data in regard to the allocated memoryCannot recurs in a non directory entryCannot reduce the string to a size that is larger than its current sizeCannot remove directory Cannot remove file Cannot remove file %s: Cannot remove non-existent file from filesystem: Cannot remove nonexistent entry %S from catalogueCannot restore any file, nothing doneCannot restore file %S : non existent file in databaseCannot restore permissions of %s : %sCannot seek back one charCannot seek in fileCannot set "fcntl" file's flags : Cannot set birth time: Cannot set last access and last modification time: Cannot skip at end of fileCannot skip forward to restore a holeCannot skip to a valid position in fileCannot skip to the current position in "tronc"Cannot sync write on a read-only generic_fileCannot unblock signals: Cannot write down a read-only databaseCannot write down the archive: Cannot write on outputCannot write to destination, abortingCannot write to outputCatalogue computed hash does not match the signed hash of the archive, archive has been modified since it was signed!Catalogue size in archive : %i bytes Catalogue size in archive : N/A Caught a none libdar exceptionCaught an unknown Egeneric exception: Changing database header information...Changing database information...Checking chronological ordering of files between the archives...Checking date ordering of files between archives...Checking file's dates ordering...Choose only one compression algorithmClearing file's EA (requested by overwriting policy): Closing archive low layer...Closing the compression layer...Closing the encryption layer...Closing the escape layer...Commands are: Commands: Common options: Communication problem with peer, retry ?Compressing and writing back database to file...Compression algorithm used : %S Compression level must be between 1 and 9, includedCompression option (-z option) is useless and ignored when using -ak optionCompression_level must be between 1 and 9 includedComputing statistics...Conflict found while selecting the file to retain in the resulting archive:Considering cyphering layer...Considering the (first) archive of reference:Considering the second (alias auxiliary) archive of reference:Consistency check failed for archive headerContinue listing archive contents?Continue? Continuing the action under process which is to exit... so we exit!Continuing...Copied data does not match CRCCopy finished. Missing %.0f byte(s) of data Corrupted data read from pipeCorrupted data read on pipeCorrupted database :Corrupted entry following an escape mark in the archiveCorruption met while reading header_version data structureCould not create inode: Could not find tape mark for the internal catalogueCould not open directory %s in furtive read mode (%s), using normal modeCould not restore original file ownership: Could read a catalogue data structure at offset %i, it contains the following:Creating a new thread to run the compression layer...Creating a new thread to run the escape layer...Creating a new thread to run the previously created layers...Creating file...Creating low layer: Writing archive into a black hole object (equivalent to /dev/null)...Creating low layer: Writing archive into a plain file object...Creating low layer: Writing archive into a sar object (Segmentation and Reassembly) for slicing...Creating low layer: Writing archive into standard output object...Crypto block size must be greater than 10 bytesCurrent Working Directory cannot be a relative pathCurrent implementation of blowfish encryption is not compatible with old (weak) implementation, use dar-2.3.x software (or other software based on libdar-4.4.x) to read this archiveCyphering algorithm not available in libgcrypt: %s/%sDAR sub-process has terminated with exit code DAR terminated upon signal reception: DIFF DataData corruption may have occurred, cannot decrypt dataData corruption met at end of slice, forbidden flag found at this positionData corruption met at end of slice, unknown flag foundData corruption or unknown sparse_file mark found in file's dataData full saved : %S %SData more recent : %S %SData of file %S from first archive has been preserved from overwritingData of file %S is about to be %S, proceed?Data of file %S taken from the first archive of reference has been overwrittenData of file %S taken from the first archive of reference has been removedData should be read-onlyData size : %i %iDatabase has been successfully created empty.Database not saved, Do you really want to quit ?Dates are not increasing for all files when database's archive number grows, working with this database may lead to improper file's restored version. Please reorder the archive within the database in the way that the older is the first archive and so on up to the most recent archive being the last of the databaseDates of file's %S are not increasing when database's archive number grows. Concerned file is: %SDecompressing and loading database header to memory...Decompressing and loading database to memory...Decremental mode is useless when merging is not applied to both an archive of reference and an auxiliary archive of reference. Ignore decremental mode and continue?Detected Cache Directory Tagging Standard for %s, the contents of that directory will not be savedDirectory %S cannot be restored: overwriting not allowed and a non-directory inode of that name already exists, all files in that directory will be skipped for restoration:Dirty file : %S %SDisabling signal handler, the next time this signal is received the program will abort immediatelyDivision by zeroDo you want to ignore the same type of error for other files?Do you want to use it for the operation?Due to data corruption, it is not possible to know if slice %S is the last slice of the archive or not. I need your help to figure out this. At the following prompt please answer either one of the following words: "last" or "notlast" according to the nature of this slice (you can also answer with "abort" to abort the program immediately): EA and FSA of file %S are about to be %S, proceed?EA and FSA of file %S from first archive have been updated with those of same named file of the auxiliary archiveEA for %S are about to be merged, OK?EA for %S are about to be overwritten, OK?EA for %S are about to be removed, OK?EA for %S have not been cleared as requested by the overwriting policy because this file is a hard link pointing to an already restored inodeEA for %S have not been overwritten because this file is a hard link pointing to an already restored inodeEA full saved : %S %SEA more recent : %S %SEA number : %i %iEA of file %S from first archive have been dropped and marked as already savedEA of file %S from first archive have been removedEA of file %S from first archive have been updated with those of the same named file of the auxiliary archiveEA of file %S has been overwrittenEA of file %S has been overwritten and marked as already savedEA size : %i %iERR ERR Either archives in database are not properly tidied, or file last modification date has been artificially set to an more ancient date. This may lead improper Extended Attribute restoration for inode %SEmpty string as subdirectory does not make a valid pathEmpty string given as argument to tools_readlink()Empty string is an invalid archive basenameEmpty string is not a valid pathEnter each argument line by line, press return at the end Entry information CRC failureEntry information CRC failure for %SEntry information CRC failure for %S. Ignore the failure?Entry information: "in place" "to be added"Entry type : %s %sError code %d to message conversion failedError creating Unix socket file: Error creating archive layers: Error creating data buffer overlay for GPGME: %sError creating hard link %s : %s Trying to duplicate the inodeError creating hard link : %s , the inode to link with [ %s ] has disappeared, re-creating itError creating hard link : %s , the inode to link with [ %s ] is not present, cannot restore this hard linkError during user command line execution: Error found while looking fo GID of group %s: %SError found while looking for GID of group %s: %SError found while looking for UID of user %s: %SError getting file reading position: Error getting size of file: Error in included file (%s): Error met while checking for capability %S: %sError met while creating the hash file: Error met while opening the last slice: %S. Trying to open the archive using the first slice...Error met while processing operation: Error met while reading archive of reference slicing layout, ignoring this field and continuingError met while reading line %S from file %S: %SError met while reading next entry: Error met while retrieving current time: %SError opening %S : Error opening directory in furtive read mode: Error opening directory: Error opening pipe: Error performing the requested action: %SError reading EA for Error reading attribute %s of file %s : %sError reading character: Error reading database %S : Error reading directory contents: Error reading included file (%s): Error reading inode of file %s : %sError reading source file (we are at %.2f %% of data copied), trying to read further: %s Error removing file %s: %sError retrieving EA list for %s : %sError saving Extended Attributes for Error saving Filesystem Specific Attributes for Error transforming the archive :Error trying to run %s: %sError while activating libgcrypt's memory guard: %s/%sError while adding EA %s : %sError while assigning key to libgcrypt key handle (essiv): %s/%sError while assigning key to libgcrypt key handle to check password strength: %s/%sError while assigning key to libgcrypt key handle: %s/%sError while calling fork() to launch dar: Error while changing user terminal properties: Error while comparing archive with filesystem: Error while considering file Error while converting UID/GID to string for backup hook file: Error while creating ESSIV handle: %s/%sError while creating anonymous pipe: Error while creating hash handle: %s/%sError while cyphering data: %s/%sError while decyphering data: %s/%sError while derivating key from password (HMAC open): %s/%sError while derivating key from password (HMAC set key): %s/%sError while fetching archive properties: Error while fetching hostname: Error while fetching information for %S: Error while generating IV: %s/%sError while initializing "mutex" for class "statistics": Error while initializing hash: Hash algorithm not available in libgcrypt: %s/%sError while listing archive contents: Error while opening libgcrypt key handle to check password strength: %s/%sError while opening libgcrypt key handle: %s/%sError while opening the archive of reference: Error while parsing --min-digits option: Error while parsing -A argument as a date: Error while reading CRC for EA from the archive: No escape mark found for that fileError while reading CRC for FSA from the archive: No escape mark found for that fileError while reading FSA: Error while reading archive's header, this may be because this archive is an old encrypted archive or that data corruption took place, Assuming it is an old archive, we have to read the header at the beginning of the first slice...Error while reading data for a secure memory:Error while reading from file: Error while reading from pipe: Error while reading user answer from terminal: Error while removing %s : %sError while resetting encryption key for a new block: %s/%sError while restoring Error while restoring data: Error while restoring the following files: Error while saving Error while saving data: Error while setting IV for current block: %s/%sError while setting file permission: %sError while setting file user ownership: %sError while telling libgcrypt that initialization is finished: %s/%sError while testing archive: Error while writing data to pipe: Error while writing to file: Error! SHA1 not available in libgcrypt: %s/%sError, catalogue of reference has not been providedError, invalid passphrase given, try again:Error, while sending the passphrase to GPGME:Escape sequences used for reading lead the archive to place some files out of the specified root. To overcome this problem, try reading the archive in direct mode (not using sequential reading), try repairing the archive using Parchive if redundancy data has been created or in last resort try using the lax modeEscaping...Existing EA for %S could not be preserved : Existing EA for %S could not be read and preserved: Existing FSA for %S could not be preserved : Existing FSA for %S could not be read and preserved: Extended Attribute of file found in database but impossible to restore (only found "unchanged" in differential backups): FATAL error, aborting operationFSA familly : %S %SFSA for %S are about to be overwritten, OK?FSA for %S have not been overwritten because this file is a hard link pointing to an already restored inodeFSA full saved : %S %SFSA of file %S from first archive have been dropped and marked as already savedFSA of file %S from first archive have been removedFailed creating GPGME context: Failed creating slice %S: Failed driving dar_slave to the end of archive: %S. Trying to open the archive from the first bytesFailed opening the cache layer, lack of memory, archive read performances will not be optimizedFailed reading CRC for EA: Failed reading existing extX family FSA: Failed reading inode information for %s: Failed reading slice %S: Failed retreiving passphraseFailed retrieving from libgcrypt the block size used by the cyphering algorithm (essiv): %s/%sFailed retrieving from libgcrypt the block size used by the cyphering algorithm: %s/%sFailed retrieving from libgcrypt the key length to use (essiv key): %s/%sFailed retrieving from libgcrypt the maximum key lengthFailed sending CR after the passphraseFailed sending the totality of the passphrase to GPGMEFailed set extX family FSA: Failed setting (opening) extX family FSA: Failed setting GPGME context with OpenPGP protocol: Failed to open %S while checking for nodump flag: %sFailed writing down the hash: Fatal error on user command line: File %S has changed during backup and is probably not saved in a valid state ("dirty file"), do you want to consider it for restoration anyway?File %S line %dFile found in database but impossible to restore (only found "unchanged" in differential backups): File had changed during backup and had been copied another time, restoring the next copy of file: File has disappeared while we were reading it, cannot check whether it has changed during its backup: %SFile inclusion loop detected. The file %s includes itself directly or through other files (-B option)File mode is neither read nor writeFile must be a directory: File not found in database: File offset too large to be stored in off_t typeFile ownership will not be restored as %s has not the CHOWN capability nor is running as root. to avoid this message use -O optionFile recorded as removed at this date in database: File selection has been aborted. Now building the resulting archive with the already selected filesFile size : %i bytes File size too smallFile size: %i bytes File to look for: Filesystem Specific Attribute are missingFinal memory cleanup...Finished Inspecting directory %S , saved %S%SFinished writing to file First file size : %i bytes First file size too smallFirst slice size is too small to even just be able to drop the slice headerFor your information, this is the iteration %d for which the randomly generated key is reported to be weak by libgcrypt, continuing generating another random key... patienceFormatting file as an empty database...Found 'Found a correct archive header at the beginning of the archive, which does not stands to be an old archive, the end of the archive is corrupted and thus the catalogue is not readable, aborting. Either retry providing in addition an isolated catalogue of that archive to perform the operation, or try reading the archive in sequential mode or try in lax mode or, last chance, try both lax and sequential read mode at the same timeFound a correct archive header at the beginning of the archive, which does not stands to be an old archive, the end of the archive is thus corrupted. Without external catalogue provided and as we do not read the archive in sequential mode, there is very little chance to retreive something from this corrupted archive. Do we continue anyway ?Furtive read modeFurtive read mode has been disabled as %s has not the FOWNER capability nor is running as rootGPGME engine not available: %sGPGME version requirement is not satisfied, requires version > %sGenerating random key for symmetric encryption...Given date must be in the pastGiven user target(s) could not be found: %SGiving -S option the same value as the one given to -s is uselessGiving to -S option the same value as the one given to -s option is uselessHard links of directories are not supportedHow much line to display at once: INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINERIf you really want to abort the archive creation hit CTRL-C, then press enter.Ignore previous error on user command line and continue ?Ignoring extra arguments on command lineIgnoring file with NODUMP flag set: Ignoring unknown option -%cIn included file %S: In which position to insert this archive: Incoherent answer from peerIncoherent catalogue structure: duplicated hard linked inode's dataIncoherent catalogue structure: hard linked data is not an inodeIncoherent catalogue structure: hard linked inode's data not foundIncoherent catalogue structure: unknown status flag for hard linked inodeIncoherent slice header: First slice size too smallIncoherent structure in data carrying sparse files: unknown markIncomplete labelIncorrect archive range in databaseIncorrect day of monthIncorrect hourIncorrect minuteIncorrect monthIncorrect secondIndex out of rangeInitialization problem for liblzo2 libraryInput cannot be readInspecting directory Invald nullptr argument given to 'ptr'Invalid Cipher textInvalid archive number: Invalid archive number: %dInvalid argument as destination archiveInvalid argument as source archiveInvalid nullptr argument given to 'ptr'Invalid nullptr pointer given to close_archiveInvalid number in string: %SInvalid number: Invalid path, path must be relativeInvalid size for CRC widthInvalid size for option -SInvalid size for option -sInvalid wide-char found in string: Is directory : %S %SIs hard linked : %S %SIs inode : %S %SIs plain file : %S %SIterator does not point to dataKey cannot be an empty stringKey found but users are not all trustedKey generatedLAX MODE: "%S" is not a valid archive formatLAX MODE: %S has a bad or corrupted header, trying to guess original values and continuing if possibleLAX MODE: %S is missing, You have the possibility to create a zero byte length file under the name of this slice, to replace this missing file. This will of course generate error messages about the information that is missing in this slice, but at least libdar will be able to continue. Can we continue now?LAX MODE: %i %% remainingLAX MODE: %i is not a valid percent valueLAX MODE: Archive directory structure is corrupted, it would lead to place some files out of the specified root directory. Restoring different directory contents at the root not out of it, which will put files of different directories in the specified root directoryLAX MODE: Archive is flagged as having escape sequence (which is normal in recent archive versions). However if this is not expected, shall I assume a data corruption occurred in this field and that this flag should be ignored? (If unsure, refuse)LAX MODE: Archive is flagged to not have escape sequence which is not the case by default since archive format 8 (release 2.4.x). If corruption occurred and an escape sequence is present, this may lead data restoration to fail, answering no at this question will let me consider that an escape sequence layer has to be added in spite of the archive flags. Do you want to continue as suggested by the archive flag, thus without escape sequence layer?LAX MODE: Archive seems to be ciphered, but you did not have provided any encryption algorithm, assuming data corruption and considering that the archive is not cipheredLAX MODE: Archive seems to be only an isolated catalogue (no data in it), Can I assume data corruption occurred and consider the archive as being a real archive?LAX MODE: Beginning search of the catalogue (from the end toward the beginning of the archive, on %i %% of its length), this may take a while...LAX MODE: CRC failed for catalogue, the archive contents is corrupted. This may even lead dar to see files in the archive that never existed, but this will most probably lead to other failures in restoring files. Shall we proceed anyway?LAX MODE: Cannot skip at the end of the archive! Using current position to start the catalogue searchLAX MODE: Caught exception: LAX MODE: Could not find a whole catalogue in the archive. If you have an isolated catalogue, stop here and use it as backup of the internal catalogue, else continue but be advised that all data will not be able to be retrieved...LAX MODE: Do you want to bypass some sanity checks and try again reading the archive contents (this may take some time, this may also fail)?LAX MODE: Do you want to try finding portions of the original catalogue if some remain (this may take even more time and in any case, it will only permit to recover some files, at most)?LAX MODE: Due to probable data corruption, dar could not determine the correct size of slices in this archive. For recent archive, this information is duplicated in each slice, do you want to try opening another slice to get this value if present?LAX MODE: Error met building a catalogue entry, skipping this entry and continuing. Skipped error is: LAX MODE: Escape sequence could not be found, it may have been corrupted or out of the scanned portion of the archive, trying to find the catalogue the other wayLAX MODE: Escape sequence seems present in this archive. I have thus two different methods, either I look for the escape sequence indicating the start of the catalogue or I try each position in turn in the hope it will not be data that look like a catalogueLAX MODE: Failed to read the archive header's format version.LAX MODE: Failed to read the catalogueLAX MODE: Failed to read the catalogue (0 bytes of the archive length asked to look for the catalogue)LAX MODE: Failed to read the catalogue (no data to inspect)LAX MODE: Good point! I could find the escape sequence marking the beginning of the catalogue, now trying to read it...LAX MODE: In spite of a the absence of a known slice size, continuing anywayLAX MODE: In spite of its name, %S does not appear to be a dar slice, assuming a data corruption took place and continuingLAX MODE: Please provide an strictly positive integer numberLAX MODE: Please provide the archive format: You can use the table at %s to find the archive format depending on the release version, (for example if this archive has been created using dar release 2.3.4 to 2.3.7 answer "6" without the quotes here): LAX MODE: Please provide the slice number to read: LAX MODE: Reached the end of the area to scan, FAILED to find any catalogueLAX MODE: Slice flag corrupted, but a slice of higher number has been seen, thus the header flag was surely not indicating this slice as the last of the archive. ContinuingLAX MODE: The catalogue (table of contents) usually takes a few percents of the archive at its end, which percentage do you want me to scan (answer by an *integer* number between 0 and 100)? LAX MODE: The end of the archive is corrupted, cannot get the archive contents (the "catalogue")LAX MODE: Trying to locate the escape sequence (safer choice) ?LAX MODE: Unexpected saved status for class "cat_detruit" object, assuming data corruption occurred, ignoring and continuingLAX MODE: Unexpected saved status for end of directory entry, assuming data corruption occurred, ignoring and continuingLAX MODE: Unknown compression algorithm used, assuming data corruption occurred. Please help me, answering with one of the following words "none", "gzip", "bzip2" or "lzo" at the next prompt:LAX MODE: Unknown data in slice header, ignoring and continuingLAX MODE: Using archive format "%d"?LAX MODE: catalogue computed hash does not match the signed hash of the archive, ignoringLAX MODE: catalogue label does not match archive label, as if it was an extracted catalogue, assuming data corruption occurred and fixing the catalogue to be considered an a plain internal catalogueLAX MODE: closing slice %i, header properly fetchedLAX MODE: first slice size is not possible to read, (lack of virtual memory?), continuing anyway...LAX MODE: first slice size is not possible to read, continuing anyway...LAX MODE: found unknown catalogue entry, assuming data corruption occurred, cannot read further the catalogue as I do not know the length of this type of entryLAX MODE: found unknown catalogue entry, assuming data corruption occurred. Skipping to the next entry, this may lead to improper directory structure being restored, if the corrupted data was a directoryLAX MODE: internal name of the slice leads dar to consider it is not member of the same archive. Assuming data corruption occurred and relying on the filename of this slice as proof of its membership to the archiveLAX MODE: opening slice %i to read its slice headerLAX MODE: slice size is not possible to read, (lack of virtual memory?), continuing anyway...LAX MODE: slices %i and %i are both recorded as last slice of the archive, keeping the higher number as the real last sliceLAX MODE: the requested sequential read mode relies on escape sequence which seem to be absent from this archive. Assuming data corruption occurred. However, if no data corruption occurred and thus no escape sequence are present in this archive, do not use sequential reading mode to explore this archive else you will just get nothing usable from itLack of MemoryLack of SECURED memory to achieve the operation, aborting operationLack of Secured MemoryLack of memory to achieve the operation, aborting operationLast file size : %i bytes Library used for blowfish encryption does not respect RFC 3962Listing options (to use with -l): Loading catalogue into memory...Loading isolated catalogue in memory...Locating archive contents...Long options support : %s Looking in archives for requested files, classifying files archive by archive...Making room in memory (releasing memory used by archive of reference)...Mask_list's prefix must be an absolute path or start with "" string for archive mergingMemory allocation failed : %sMerging/filtering files from the %s archive...Missing -c -x -d -t -l -C -+ option, see `%S -h' for helpMissing [ after } in conditional statement: Missing ] in conditional statement: Missing archive basename, see -h option for helpMissing argument to --backup-hook-executeMissing argument to --hashMissing argument to --min-digitsMissing argument to -EMissing argument to -E optionMissing argument to -FMissing argument to -SMissing argument to -^Missing argument to -i optionMissing argument to -o optionMissing argument to -sMissing argument to command line, abortingMissing catalogue in file.Missing data for encrypted symmetrical keyMissing data to initiate a TLV objectMissing data while reading slice_layout objectMissing hashing algorithms support (which is part of strong encryption support, using libgcrypt)Missing parameter to option -%cMissing source or destination argument on command line, see -h option for helpMissing strong encryption support (libgcrypt)Missing } in conditional statement: NONO FILE IN THAT DIRECTORY CAN BE SAVED.NOT YET IMPLEMENTED FEATURE has been used: Negative number or zero not allowed when moving an archive inside a databaseNew basename for archive number %d: New database name: New path to give to archive number %d: No Filesystem Specific Attribute to compare withNo action specified, abortingNo backup file is present in %S for archive %S, please provide the last file of the set.No cyphering layer openedNo cyphering layer opened, adding cache layer for better performanceNo data found in that archive, sequentially reading the catalogue found at the end of the archive...No data to decryptNo database specified, abortingNo exception allowed from libdar callbacksNo file in this directory will be considered for merging.No file in this directory will be restored.No mask availableNo mask in the list of mask to operate onNo mask to operate on in the list of maskNo problem foundNo recipient remain with a valid key, encryption is impossible, abortingNo signatory remain with a valid key, signing is impossible, abortingNo slice layout of the archive of reference for the current isolated catalogue is available, cannot provide slicing information, abortingNo space left for inode, you have the opportunity to make some room now. When done : can we continue ?No space left on device, you have the opportunity to make room now. When ready : can we continue ?No terminal found for user interaction. All questions will be assumed a negative answer (less destructive choice), which most of the time will abort the program.No user target found on command lineNo valid encryption key could be find for %SNo valid signing key could be find for %SNon existent archive in databaseNon existent file in databaseNon existent file: Non fatal error while writing to destination file, retrying Not SavedNot a zero terminated string in fileNot enough data to initialize storage fieldNot setting FSA extX IMMUTABLE flags for %s due to of lack of capabilityNot setting FSA extX SYSTEM RESOURCE flags for %s due to of lack of capabilityNow performing on-fly isolation...OK OK OK, keeping %S as basenameOnly one -@ option is allowedOnly one -A option is allowedOnly one -R option is allowedOnly one -S option is allowedOnly one -s option is allowedOpening a pair of pipes to read the archive, expecting dar_slave at the other ends...Opening and reading the batch file...Opening archive %s ...Opening construction layer...Opening cyphering layer...Opening escape sequence abstraction layer...Opening named pipe %S as input to read the archive...Opening standard input to read the archive...Opening the archive of reference %s to retreive the isolated catalog ... Opening the archive using the multi-slice abstraction layer...Opening the compression abstraction layer (compression algorithm used is none)...Opening the compression layer...Options: Out of range index requested for a secu_stringOverwriting not allowed while a slice of a previous archive with the same basename has been found in the %s directory, Operation abortedParse error on command line (or included files): Parse error: Parse error: Unmatched `%c'Partial request received, aborting Passphrase required for key %s :Path to dar (empty string to use the default from PATH variable): Pipe's other end is not known, cannot close any filedescriptor pointing on itPipe's other end is not known, cannot provide a filedescriptor on itPlease answer by the character between brackets ('[' and ']') and press returnPlease check documentation or upgrade your software if availablePlease check your hardwarePlease confirm your password: Previous archive size does not include headers present in each slice Probable bug in liblzo2: lzo1x_*_compress returned unexpected code %dProcessing files for backup...Processing files for merging...Program has been aborted for the following reason: Reached End of File while reading archive header_version data structureReached End of File while reading archive versionReached End of File, no correct data could be found after the last error Reached end of file before all data could be readReached end of file while reading slice headerReached premature end of file while reading archive versionReading a write only generic_fileReading ahead a write only generic_fileReading archive contents...Reading catalogue of the archive to add...Reading options (to use with -x, -d, -t, -l, -A) Reading the archive header...Reading the archive of reference from pipe or standard input is not possibleReading the archive trailer...Ready to start writing down the archive?Received signal: %dReceived signal: %sReceived unknown special orderRecording hard link into the archive: Reference storage of the iterator is empty or non existentRemoving file %sRemoving file (reason is file recorded as removed in archive): %SRemoving file (reason is overwriting policy): %SRemoving information from the database...Removing the dirty file %SReplacing %s in the -R option by the directory pointed to by this symbolic link: Resaving file without compression: Resetting the sequential reading process of the archive contents while it is not finished, will make all data unread so far becoming inaccessibleRestoration of EA for %S aborted: Restoration of FSA for %S aborted: Restoring file's EA: Restoring file's FSA: Restoring file's data: Restoring options (to use with -x) : Running batch file from a batch file is not allowedSANITY CHECK: AT LEAST ONE THREAD_CANCELLATION OBJECT HAS NOT BEEN DESTROYED AND REMAINS IN MEMORY WHILE THE PROGRAM REACHED ITS ENDSECURITY WARNING! SUSPICIOUS FILE %S: ctime changed since archive of reference was done, while no other inode information changedSEEMS TO BE A HARDWARE PROBLEM: SKIPPED (hard link in sequential read mode): Same data but CRC value could not be verified because we did not guessed properly its width (sequential read restriction)Same data but stored CRC does not match the data!?!SavedSaving / Isolation / merging options (to use with -c, -C or -+): Saving Extended Attributes for Saving Filesystem Specific Attributes for Scrambling is a very weak encryption algorithm, this is a non-sens to use with asymmetric encryptionSecured string can only be read from a terminalSee man page for more options. Sequential read asked, but this archive is flagged to not have the necessary embedded escape sequences for that operation, abortingSequential reading marks : %s Size too large for an elastic bufferSkipping done (missing %.0f byte(s)), found correct data to read, continuing the copy... Slice %S has an unknown flag (neither terminal nor non_terminal file).Slice size is too small to even just be able to drop the slice headerSlicing (-s option), is not compatible with archive on standard output ("-" as filename)Some file comparisons failedSome files are corrupted in the archive and it will not be possible to restore themSome files do not follow chronological order when archive index increases withing the database, this can lead dar_manager to restored a wrong version of these filesSorry, file size is unknown at this step of the program. Sparse file : %S %SStarting the copy of %u byte(s)Subtracting an "infinint" greater than the first, "infinint" cannot be negativeSymmetric key encryption used : %S Syntax error in --retry-on-change argument: Syntax error in batch file: %SSyntax error in batch file: -C option not allowedSyntax error in batch file: -i option not allowedSyntax error in overwriting policy: The Cache Directory Tagging Standard is only useful while performing a backup, ignoring it hereThe archive %S is encrypted and no encryption cipher has been given, cannot open archive.The archive and the isolated catalogue do not correspond to the same data, they are thus incompatible between themThe basename '+' is reserved for special a purpose that has no meaning in this contextThe catalogue will be filled while sequentially reading the archive, preparing the data structure...The entry to recurs in does not exist, cannot add further entry to that absent subdirectoryThe following user comment will be placed in clear text in the archive: %SThe format version of the archive is too high for that software version, try reading anyway?The format version of this database is too high for that software version, use a more recent software to read or modify this databaseThe given path %s must be a directory (or symbolic link to an existing directory)The global data compression ratio is: The iterator is not indexing the object it has been asked to read fromThe iterator is not indexing the object it has been asked to write toThe iterator is not indexing the object it has been defined forThe iterator position is not inside the storage of referenceThe just restored file %S has been marked as dirty (sequential reading can only detect the dirty status after restoration), do we remove this just restored dirty file?The just restored file %S has been marked as dirty (sequential reading can only detect the dirty status after restoration), removing the just restored dirty file as it is asked to ignore this type of fileThe last file of the set is not present in The overall archive size includes %i byte(s) wasted due to bad compression ratioThe snapshot backup (-A +) is only available with -c option, ignoringThe two passwords are not identical. AbortingThis archive contains an isolated catalogue, it cannot be used for this operation. It can only be used as reference for a incremental/differential backup or as backup of the original archive's catalogueThis archive has slices and is not possible to read from a pipeThis archive is not exploitable, check documentation for moreThis archive is not exploitable, check the archive class usage in the API documentationThis archive is not single sliced, more data exists in the next slices but cannot be read from the current pipe, abortingThis database has been corrupted probably due to a bug in release 2.4.0 to 2.4.9, and it has not been possible to cleanup this corruption, please rebuild the database from archives or extracted "catalogues", if the database has never been used by one of the previously mentioned released, you are welcome to open a bug report and provide as much as possible details about the circumstancesThis is an old archive, it can only be opened starting by the first sliceThread cancellation requested, aborting as properly as possibleThread cancellation requested, aborting as soon as possibleTo terminate enter an empty line To use --sparse-file-min-size while merging archive, you need to use -ah option too, please check man page for detailsToo large block of compressed data: Either due to data corruption or current system limitation where SSIZE_MAX value implied smaller buffers than requiredToo many argument on command line, see -h option for helpToo much line in file %S (integer overflow)Too old version for libgcrypt, minimum required version is %s Tried to write out of size limited fileTwo different slices (%i and %i) are marked as the last slice of the backup!Type "man dar" for more details and for all other available options. Unbalanced parenthesis in expression: Uncomplete answer received from peerUncompleted archive! Assuming it has been interrupted during the backup process. If an error has been reported just above, simply ignore it, this is about the file that was saved at the time of the interruption.Unexepected value for boolean FSA, data corruption may have occurredUnexpected answer from slave, communication problem or bug may hang the operationUnexpected end of fileUnexpected error reported by GPGME: Unexpected error while waiting for dar to terminate: Unexpected exception from libdarUnexpected value found in databaseUnexpected value while reading archive versionUnknown TLV record typeUnknown argument given to -2 : %sUnknown argument given to -a : %sUnknown argument given to -k : %sUnknown argument given to -w: Unknown atomic operator, or atomic not allowed with an argument: Unknown character found while parsing conditional string: Unknown choice Unknown choice: Unknown crypto algorithmUnknown encryption algorithmUnknown entry found in slice header (type = %d), option not supported. The archive you are reading may have been generated by a more recent version of libdar, ignore this entry and continue anyway?Unknown escape sequence typeUnknown expression found while parsing conditional string: Unknown expression in overwriting policy: Unknown file type! file name is: Unknown groupUnknown header option in database, aborting Unknown macro %%%d in user commentUnknown parameter given to --hash option: Unknown parameter given to -a option: Unknown policy for EA '%c' in expression %SUnknown policy for data '%c' in expression %SUnknown record typeUnknown substitution string: %Unknown suffix [%c] in string %SUnknown time unitUnknown userUpdating database with catalogue...User Decision requested for EA of file %SUser Decision requested for FSA of file %SUser Decision requested for data of file %SUser comment : %S User target found on command line or included file(s):User target named "%s" is not allowed (reserved word for conditional syntax)Using sequential reading mode for archive source is not possible for merging operationUsing the slice layout of the archive of reference recorded at the time this isolated catalogue was done Note: if this reference has been resliced this isolated catalogue has been created, the resulting slicing information given here will be wrong and will probably lead to an error. Check documentation to know hos to manually specify the slicing to useUsing user provided modified slicing (first slice = %i bytes, other slices = %i bytes)WARNING! File modified while reading it for backup, but no more retry allowed: WARNING! File modified while reading it for backup. No more retry for that file to not exceed the wasted byte limit. File is WARNING! File modified while reading it for backup. Performing retry %i of %iWARNING! Incorrect signature found for archive, continue anyway?WARNING! The archive is located in the directory to backup, this may create an endless loop when the archive will try to save itself. You can either add -X "%S.*.%S" on the command line, or change the location of the archive (see -h for help). Do you really want to continue?WARNING! This is an isolated catalogue, no data or EA is present in this archive, only the catalogue structure can be checkedWARNING: support for secure memory was not available at compilation time, in case of heavy memory load, this may lead the password you are about to provide to be wrote to disk (swap space) in clear. You have been warned!WARNING: support for secure memory was not available at compilation time, in case of heavy memory load, this may lead the password/passphrase provided to be wrote to disk (swap space) in clear. You have been warned!Warning! %s Filesystem Specific Attribute support have not been activated at compilation time and could not be restored for %sWarning! No file in that directory will be restored: Warning! No file in this directory will be considered for merging: Warning, %S seems more to be a slice name than a base name. Do you want to replace it by %S ?Warning, are you sure you want to abort (please answer "%S" to confirm)? Warning, the archive %S has been encrypted. A wrong key is not possible to detect, it would cause DAR to report the archive as corrupted Warning: -G option is an experimental and unsupported feature, read man page about -G option for more informationWarning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %sWarning: No slice layout of the archive of reference has been recorded in this isolated catalogue. The additional slicing information you provided may still lead the operation to fail because the archive has an _unsupported_ (too old) format for this featureWe have linked with an incompatible version of libdar. Expecting version %d.%d.x but having linked with version %d.%d.%dWhich is %.2f %% of the total amount of data WorseWriting down archive contents...Writing down archive trailer...Writing down the archive header...Writing down the first archive terminator...Writing down the initial elastic buffer through the encryption layer...Writing down the second archive terminator...Writing down the signed hash of the catalogue...Writing to a read only generic_fileYESZero is not a valid size for an elastic buffer[ ][ EA ][ Saved ][--- REMOVED ENTRY ----][DIRTY][Data ][ EA ][FSA][Compr][S]| Permission | User | Group | Size | Date | filename [InRef][Saved]a binary digit is either 0 or 1abortabsentabsent an empty string is an invalid argumentappend onlyappending data after the end of a secure_memoryappending data over secure_memory its endarchive # | path | basename argument must be a relative pathbackup hook feature (-<, -> or -= options) is only available when saving files, ignoringbadly structured inode: unknown inode flagbadly structured inode: unknown inode flag for FSAbigblock deviceblowfish strong encryption supportbzip2can't read data CRC: No escape mark found for that filecannot evaluate an empty chain in an overwriting policycannot provide data from a "not saved" file objectchar devicecompressReset called but compressInit never called beforecompressedcompressed data CRC errorcompressed data corruption detectedcompressed data is corruptedcorrupted filecreation datedar options : %S dar path : %S data corruption detected: Incoherence in LZO compressed datadata corruption detected: Too large block of compressed datadata has been cleaned, object is now emptydatabase version: %d date before 1970 is not alloweddeleted entrydeleted filedestroyed entries information devices have not the same major number: %d <--> %ddevices have not the same minor number: %d <--> %ddifference of last modification date: %S <--> %Sdifferent Extended Attributesdifferent Filesystem Specific Attributesdifferent file data, offset of first difference is: %idifferent file typedifferent owner (uid): %i <--> %idifferent owner group (gid): %i <--> %idifferent permission: %S <--> %Sdirectorydistribution of inode(s) doordoor inodedropped from the archive and marked as already savedelastic buffer incoherent structureend of directoryerror!execution of [ %S ] returned error code: %dexecve() failed. (process table is full ?)execvp() failed but did not returned error codefailed openning slice %S: %S. Will try to erase it first, if allowedfailed reading CRC from file: falsefilefile exists, and DONT_ERASE option is set.file not openfirstfoldergid value is too high for this system for libdar be able to restore it properlygziphard linked inodehard links information hide_file cannot be initialized with write-only fileignored directoryignored entryignoring -O option, as it is useless in this situationimmutablein file %S line %Sincoherent catalogue structureincoherent data after escape sequence, cannot read internal data set labelincoherent endian between U_16 and U_32incoherent endian between U_16 and U_64incoherent endian between U_16 and U_Iincoherent slice header: Slice size too smallincompatible compression library version or unsupported feature required from compression libraryincomplete data set name found in a slice headerinode last change date (ctime) greater, EA might be differentinode last change date (ctime) greater, FSA might be differentinvalid decimal digitinvalid number give to -; option: %sit seems to be a bug herejournalizedlastlast char of user command-line to execute is '%', (use '%%' instead to avoid this message)libgcrypt not initialized and libdar not allowed to do solibgcrypt version < %s. Ligcrypt used has a bug that leads md5 and sha1 hash results to be erroneous for files larger than 256 Gio (gibioctet), do you really want to spend CPU cycles calculating a useless hash?listing() method must be givenlittlelzolzo compressionmemerged with possible overwritingmissing data to buildmissing data to build a cat_directorymissing data to build a special devicemissing data to build an inodenamed pipenextnono Extended Attribute to compare withno Extended Attributes to compare withno atime updateno current directory definedno current reading directory definedno dump flagno tail mergingnodump flag feature has not been activated at compilation time, it is thus not availablenonenot enough space provided to dump the elastic buffernot same size: %i <--> %inotlastnullptr argument given to tools_readlink()nullptr given as argument of user_interaction_callback()overwrittenpipeplain filepresentpresent provided password is too long for the allocated memoryre-enabling all signal handlers and continuing reached End of File before all expected data could be readread and writeread onlyremovedremoved removed from the archivereplacedroot directory has no parent directoryroot does not have a parent directoryroot has no parent directoryroot's entrepot must be an absolute path: saved saved inode : %i scrambling (weak encryption)secondsecu_string randomization requested exceeds storage capacitysecure deletionsocketsoft linksymbolic link does not point to the same target: symlinksynchronous directorysynchronous updatesystem() call failed: the "Keep file compressed" feature is not possible when merging two archives using different compression algorithms (This is for a future version of dar). You can still merge these two archives but without keeping file compressed (thus you will probably like to use compression (-z or -y options) for the resulting archivetoo large elastic buffer or elastic buffer incoherent structuretop of directory hierarchytotal number of inode : %i truetype %s is neither big nor little endian! Do not know how to handle integer in a portable manner on this host, abortinguid value is too high for this system for libdar be able to restore it properlyundeletableunix socketunknown FSA family: unknown compressionunknown compression algorithm: %Sunknown cryptographic algorithm: unknown entryunknown type of data in catalogueusage : %s usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] [options...] with -+ option, -A option is mandatorywith -C option, -A option is mandatorywrite onlywriting down the final elastic buffer through the encryption layer...wrong value given as initial_size argument while initializing cacheyes| Signature Status| Key Status | Finger Print | Signature Date |Project-Id-Version: DAR 2.5.0 Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?group_id=65612MSGID_BUGS_ADDRESS =atid=511612 POT-Creation-Date: 2016-01-04 14:36+0100 PO-Revision-Date: 2016-01-04 14:46+0100 Last-Translator: Denis Corbin Language-Team: French Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Standard ou lors de l'extraction d'une archive propriété le premier argument qui n'est pas une option est le nom de l'archive à lire le fichier fourni. le second argument qui n'est pas une option et le nom de l'archive à créer Pas de pause lors de l'affichage Pause toutes les %d lignes d'affichage Exécution de la ligne : %S Base de donnée utilisée [%s] : %S CONTENU DU CATALOGUE : ATTENTION ! Cette archive ne contient que la liste du contenu d'une autre archive et ne peut être utilisé qu'en tant que référence pour une sauvegarde différentielle ou comme secours en cas de corruption de l'archive d'origine. Il est impossible de restaurer des données à partir de cette archive seule Votre décision pour les AE du fichier : [p] préserver [o] écraser [s] marquer comme déjà sauvé et préserver [t] marquer comme déjà sauvé et écraser [m] fusionner les EA et préserver [n] fusionner les EA et écraser [r] supprimer tous les EA [*] laisser l'action non définie [a] arrêter l'opération Votre choix ? Votre décision à propos des FSA du fichier : [p] préserver [o] écraser marquer comme déjà [s]auvé et préserver [t] marquer comme déjà sauvé et écraser [*] laisser non défini [a]rrêter l'opération Votre choix ? Votre décision à propos des données du fichier : [P] préserver [O] écraser [S] marquer comme déjà sauvé et préserver [T] marquer comme déjà sauvé et écraser [R] supprimer l'entrée [*] laisser non défini [A] arrêter l'opération Votre choix ? Algorithmes disponibles : gzip, bzip2, lzo, xz. Exemples -zlzo:5 -z1 Attribut Étendu : [ avec %i lien(s) physique(s) %i fichier(s) ont été enregistré(s) comme détruit(s) depuis la sauvegarde de référence -# taille des blocs de chiffrement -$ clef de chiffrement de l'archive auxiliaire -* comme -# mais pour l'archive de référence -+ fusion de deux archive / création de sous-archive -, ignore les répertoires marqués comme répertoire cache --nodump ne pas sauver les fichiers ayant le drapeau 'd' positionné -/ défini que quelle façon dar peut écraser des fichiers lors de la fusion -@ [chemin/] Réalise une isolation à la volée de l'archive crée -@ [chemin/] archive à prendre comme référence auxiliaire -A ajoute une archive à la base -A [chemin/] archive à prendre comme référence -B base de donnée à utiliser -B lit les options à partir du fichier -C isole le catalogue d'une archive -C création d'une base vide -D les répertoires exclus sont enregistrés comme des répertoires vides -D suppression d'archives de la base -E ligne de commande à exécuter entre les tranches d'une archive -E commande exécutée entre les tranches -E commande à exéctuer après chaque tranche de l'archive destination -F commande à exécuter avant chaque tranche de l'archive source -F comme -E mais pour l'archive de référence -H [N] considère identiques des dates qui diffèrent d'un nombre entier d'heures -I fichiers à inclure dans l'opération (tous par défaut) -J comme -K mais pour l'archive de référence -K mot de passe à utiliser pour chiffrer/déchiffrer -L exécute un fichier de traitement par lot sur une base tel défini par -M reste dans le même système de fichiers lors du parcours de l'arborescence -N ignore ~/.darrc et /etc/darrc s'ils sont présents -O[ignore-owner | mtime | inode-type] ne pas prendre en compte la propriété des fichiers -P sous-répertoires à exclure de l'opération -Q supprime le message initial si non lancé depuis un tty -R répertoire à considérer comme racine (rep. courant par défaut) -S taille de la première tranche -S taille de la première tranche (si elle doit différente des autres) -T affichage sous forme d'arbre -U masque d'exclusion d'Attributs Étendus -V Informations de version -V affiche la version -V affiche les informations de version -X fichiers à exclure de l'opération (aucun par défault) -Y ne compresser que ces fichiers -Z ne pas compresser ces fichiers -[ fichier contenant une liste de fichiers à inclure -] fichier contenant une liste de fichiers à exclure -^ permission[:utilisateur[:groupe]] pour la création des tranches -aSI signification des suffixes k, M, T, G, etc. comme puissances de 10 -aa ne cherche pas à conserver atime des fichiers ouverts en lecture. -abinary signification des suffixes k, M, T, G, etc. comme puissances de 2 -ac ne cherche pas à conserver ctime (comportement par défaut). -acase dans les masques qui suivent majuscules et minuscules sont différents -ag bascule les masques suivants comme expression glob -am filtres en mode ordonné -an dans les masques suivants majuscules et minuscules sont équivalents -ar bascule les masques suivants comme expression régulières -as affichage uniquement des fichiers sauvegardés -b fait sonner le terminal pour solliciter l'utilisateur -b change le nom de base de l'archive dont le numéro est donnée -c vérifie la base pour l'ordonnancement des dates -c créer une archive -d comparaison de l'archive avec le fichiers existants -d chemin de la commande dar -e exécution à vide (rien n'est écrit sur le disque) -f ne pas restaurer l'arborescence de répertoire -f liste les archives où est présent le fichier donnée -g sous-répertoire à inclure dans l'opération -h affiche cette page d'aide -h affiche cette page d'aide -i mode interactif -i tube à utiliser à la place de l'entrée standard pour lire les données de dar_slave -i tube à utiliser à la place de l'entrée standard pour lire les ordres de dar -k non suppression des fichiers enregistrés comme détruits -l affiche les archives utilisées dans la base de donnée -l affichage du contenu d'une archive -m ne pas compresser les fichiers de taille inférieure à octets -m change la position d'une archive dans une base. -n ne pas écraser de fichier -o tube à utiliser au lieu de la sortie standard pour ordonner dar_slave -o tube à utiliser en place de la sortie standard pour envoyer les données à dar -o liste d'options à transmettre à dar -p arrêt (pause) après chaque tranche -p change le chemin associé à l'archive du numéro donné en argument -q supprime le rapport final de statistiques -r ne pas restaurer de fichiers plus anciens que ceux sur le système de fichiers -r restauration des fichiers spécifiés -s affiche la quantité de fichiers les plus récent par archive -s coupe l'archive en tranches de taille octets -t test l'intégrité d'une archive -u masque de sélection des Attributs Étendus -u liste les fichiers les plus récents contenus dans l'archive donnée -v mode verbeux -v affichage détaillé -V affiche les fichiers ignorés -w ne pas avertir avant un écrasement de fichier -w uniquement avec -r, restaure les fichiers dans leur état à la date donnée -wa ne pas avertir ni avant écrasement ni avant suppression de fichier -x restauration de fichiers -z [[algo:]niveau] compression des données -~ commande à exécuter entre les tranches d'une archive auxiliaire Recours à plusieurs threads : %s Boutisme du système/CPU : %s Support Attributs Étendus : %s Lecture furtive supportée : %s Entiers utilisés : %d bits Entiers utilisés : sans limites Optim. grands répertoires : %s Support fichiers géants : %s Compression libbz2 (bzip2) : %s Compression liblzma (xz) : %s Compression liblzo2 (lzo) : %s Compression libz (gzip) : %s Support FSA ext2/3/4 : %s Support FSA HFS+ de Mac OS X : %s Support de Posix fadvise : %s Chiffrement clef pub.(gpgme) : %s Symlinks, dates restorées : %s Allocation mémoire optimisée : %s Chiffrement fort (libgcrypt) : %s Compat. environ. multi-tâches: %s Temps, précision en lecture : %S Temps, précision en écriture : %S Support drapeau NODUMP : %s avec %i lien(s) physique(s) enregistré(s) Num. archive | fichier plus récent / total | EA plus récent / total %i octet(s) ont été gaspillé(s) dans l'archive lors de re-tentatives de sauvegarde de fichiers ayant changés %i inode(s) ajoutée(s) à l'archive %i inode(s) modifiée(s) au moment de sa (leurs) sauvegarde n'a (n'ont) pas pu être sauvée correctement %i inode(s) supprimée(s) %i sauvegarde(s) d'inode(s) échouée(s) (erreur du système de fichiers) %i inode(s) n'ayant pu être restaurée(s) (erreur système) %i inode(s) ignoré(s) (exclus par les filtres) %i inode(s) non restaurée(s) (non sauvée(s) dans l'archive) %i inode(s) non restaurée(s) (décision de la politique d'écrasement) %i inode(s) non sauvées (pas de changement) %i inode(s) enregistrée(s) comme supprimée(s) %i fichier(s) enregistré(s) comme supprimé(s) depuis l'archive de référence %i inode(s) restauré(s) %i inode(s) sauvées %i entrée(s) ne correspond(ent) pas à ce qui est sur le système de fichiers %i entrée(s) ignorée(s) (exclus par les filtres) %i entrée(s) traitée(s) %i entrée(s) avec erreur %s est fourni sans AUCUNE GARANTIE ; %s est fourni SANS AUCUNE GARANTIE ; pour les détails taper '%s -W'. %s est fourni SANS AUCUNE GARANTIE; pour les détails taper `dar -W'. %s fait partie de la suite Disk ARchive (Release %s) , veuillez le fournir. - entrées Door : %i - fichiers spéciaux bloc : %i - fichiers spéciaux char : %i - répertoires : %i - tubes nommés : %i - nombre d'inode ayant des liens durs : %i - nombre de référence à des inodes ayant des liens durs : %i - fichiers normaux : %i - liens symboliques : %i - prises unix : %i . Fichier ou répertoire ignoré . Essayer à nouveau ? . Essayer à nouveau la ligne de commande ? . Doit-on relancer dar comme précédemment ? : Echec de la sauvegarde sans compression des données de l'inodeResauver sans compression les données de l'inode pour gagner de la place n'est pas possible, on conserve les données compressées Choix : Doit-on continuer malgré tout ? Attributs Étendus restaurés pour %i inode(s) Attributs Étendus sauvés pour %i inode(s) FSA restaurés pour %i inode(s) FSA sauvés pour %i inode(s) SI POSSIBLE ESSAYEZ DE REPRODUIRE L'ERREUR, UN SCÉNARIO QUI PERMET DE LA REPRODUIRE SERAIT UTILE POUR CORRIGER CE PROBLÈME. MERCI SI POSSIBLE ESSAYEZ DE REPRODUIRE L'ERREUR, UN SCÉNARIO QUI PERMET DE LA REPRODUIRE SERAIT UTILE POUR CORRIGER CE PROBLÈME. MERCI Une seule option parmi -c -d -t -l -C, -x ou -+ est permise Prêt à continuer ? MERCI DE REPORTER L'AFFICHAGE PRÉCÉDENT AU MAINTENEUR EN DONNANT UNE DESCRIPTION DES CIRCONSTANCES. Ceci est un logiciel libre, vous pouvez le redistribuer sous certaines conditions ; Ceci est un logiciel libre, vous pouvez le redistribuer sous certaines conditions ; Nombre total d'inode(s) considérée(s) : %i Nombre total d'entrée(s) considérée(s) : %i Libdar %u.%u utilisée, construite avec les options suivantes : Libdar %u%u utilisé, compilé avec les options : Libdar %u.%u.%u utilisée, construite avec les options suivantes : Libdar %u.%u.%u utilisée, compilé avec les options : [Entrée = OUI | Echap = NON] a : Sauver sous n : pause chaque 'n' ligne d'affichage (zéro pour aucune pause) c : vérification de l'ordre des dates taper `dar -L | more' pour les détails. compilé le %s avec %s version %s d : chemin de dar o : option passées à dar f : localisation d'un fichier m : change l'ordre des archives Pour les détails taper `dar -W'. est une tranche d'une autre archive, merci de fournir le bon fichier. est sur le point d'être écrasé. n'est pas présent dans l'archive l : contenu de la base A : Ajout d'une archive non fusionné (choix de l'utilisateur) non restauré (choix de l'utilisateur) p : modifie le chemin d'un archive b : modifie le nom de base d'une archive q : Sortir taper '%s -L | more' pour les détails. taper `dar -L | more' pour les détails. u : contenu d'une archive D : Suppression d'une archive w : enregistre les changements s : statistiques de la base de données avec %i lien(s) physique(s) enregistré(s) "-k" (ou "-kignore") et "-konly" ne sont pas compatibles"first_file_size" ne peut être différent de zéro si "file_size est égal à zéro# A B A N D O N ! ## EXCEPTION NON ATTRAPÉE, ## EXCEPTION NON ATTENDUE, #%S [%c] [ ENTREÉ SUPPR. ] (%S) %S %S existe déjà et l'écrasement est interdit, j'abandonne%S n'existait pas avant la date spécifiée et ne peut être restauré%S a un en-tête corrompu ou malformé, merci de fournir le bon fichier.%S est sur le point d'être supprimé (action requise par la politique d'écrasement), OK ?%S est sur le point d'être écrasé, OK ?%S est sur le point d'être écrasé, on continue ?%S est sur le point d'être supprimé du système de fichier, continue t-on ?%S n'est pas un chemin valide : %S%S n'est pas un fichier valide (mauvais numéro magique), merci de fournir le bon fichier.%S n'est pas nombre valide%S est requis pour la suite des opérations, merci de fournir ce fichier si vous l'avez.%S est requis pour la suite des opérations, merci de fournir ce fichier.%S est sur le point d'être supprimé, mais le type de fichier ne correspond pas avec ce qui est attendu, l'efface t-on ?%S : La politique d'écrasement (Données) reste non définie pour ce fichier, impossible de savoir si l'écrasement est autorisé ou pas !%S : La politique d'écrasement (Données) reste non définie pour ce fichier, impossible donc de savoir si la suppression est autorisée ou non !%S : La politique d'écrasement (Attributs Étendus) reste non définie pour ce fichier, impossible de savoir si l'écrasement est autorisé ou pas !%S : La politique d'écrasement (FSA) reste non définie pour ce fichier, impossible de savoir si l'écrasement est autorisé ou pas !%d n'est pas une taille valide%d est la valeur par défaut pour --sparse-file-min-size, il n'est pas nécessaire de préciser cette valeur%d est la valeur par défaut pour -m, il n'est pas nécessaire de préciser cette valeur%s ne désigne pas une compression "[algo][:][niveau]", comme par exemple "gzip", "lzo", "bzip2", "lzo:3", "gzip:2", "8" ou "1". Merci de revoir la description de l'option -z dans la page de manuel%s n'est pas un type signé tel attendu%s n'est pas un type non signé tel attendula longueur du type %s n'est pas %d octet(s) mais %d, taux de compression , prêt à continuer ? --$ n'est disponible qu'avec les options -x et -cL'option -$ n'est utile qu'avec l'option -@, pour l'archive de référence auxiliaire-%% n'est disponible qu'avec l'option -+L'option -%% n'est utile qu'avec l'option -@ pour l'archive auxiliaire de référence--------------+------------------------------+----------------------- -----------------+------------------------+--------++---------------------------+------------ La fonctionnalité --nodump n'a pas été activée lors de la compilation, cette option n'est donc pas disponible--sparse-file-min-size n'est disponible que lors de sauvegarde ou fusion d'archives et sera ignoré icil'option -. n'est utile que lors de fusion, de création ou d'isolation d'archives et sera ignorée icil'option -/ n'est utile qu'avec -+ et sera ignorée icil'option -9 n'est valide uniquement qu'après l'option -A et sera ignorée icil'option -= n'est valide que lors de la sauvegarde (option -c) et sera ignorée, icil'option -= sera ignorée car inutile faute d'indication des fichiers ou répertoires auxquelles l'appliquer. Voir les options -< et -> dans la page de manuel pour plus de détails-@ n'est disponible qu'avec les options -+ et -c-A n'est disponible qu'avec l'option -ll'option -B ne peut pas être utilisée à l'intérieur d'un fichier de traitement par lotL'option -F n'est utile qu'avec l'option -A, car elle concerne l'archive de référenceLors d'une sauvegarde, l'option -H n'est utile qu'avec l'option -A-H n'est utile qu'avec -c, -d ou -xLors d'une restauration, -H n'est utile qu'avec l'option -rL'option -J n'est utile qu'avec l'option -A, car elle concerne l'archive de référence-M n'est utile qu'avec l'option -cl'option -S nécessite l'utilisation de -s-Y et -Z ne sont utiles qu'avec la compression de données (option -z), -Y et -Z seront ignorés iciIl manque un argument à l'option -a-ac n'est utile qu'avec -c ou -dL'option -af doit être placée avant l'option -A, et non pas après-af n'est disponible qu'avec l'option -c ou -+Inutile de spécifier plus d'une fois l'option -af-ak n'est disponible qu'avec l'option -+ et sera ignoré iciinutile de spécifier l'option -ak plus d'une fois-as n'est disponible qu'avec l'option -l, -as sera ignoré ici-wa n'est utile qu'avec les options -x, -c ou -+-e n'est disponible qu'avec l'option -r, abandon de l'opération en cours-f n'est disponible qu'avec l'option -x, -f sera ignoré icil'option -k n'est utile qu'avec l'option -x-konly et kignore ne peuvent être utilisés en même temps-m n'est utile qu'avec l'option -c-m n'est utile qu'avec la compression de données (option -z), -m sera ignorés icil'option -o est obligatoire quand "-A -" est utilisé conjointement avec "-c -", "-C -" ou "-+ -"les options -p et -Q sont mutuellement exclusivesL'option -r est inutile avec -n-vf n'est utile qu'avec l'option -c-w est inutile avec -n-wa n'est utile qu'avec l'option -x-z n'est utile qu'avec les options -c , -C ou -+-~ n'est disponible qu'avec les options -+ et -cL'option -~ n'est utile qu'avec l'option -@, car elle concerne l'archive auxiliaire de référenceUne clef forte générée aléatoirement a pu être trouvée après %d iteration(s) : fichier absent du système de fichiersUne erreur est survenue lors de la lecture du contenu de l'archive : Abandon du traitement par lot :Arrêt du programme. Abandon. une erreur est survenue lors de l'exécution d'une commande utilisateur : Abandon. Une erreur est survenue lors d'un appel à libdar : Abandon. L'opération demandée nécessite une fonctionnalité qui n'a pas été activée à la compilation : Abandon. L'utilisateur a refusé de continuer lors de la question : Arrêt du programme : le processus fils est mort de façon inattendueValeur absolue trop élevée pour un numéro d'archive : %ddroit d'accès |propr.|groupe |taille | date | [donnée][ EA ][FSA][compr][S]| nom de fichier Ajout du %S à l'archive : %SAjout de lien dur à l'archive : Ajout d'une nouvelle couche : Cache pour de meilleures performances ...Ajout d'une nouvelle couche : Couche d'échappement pour permettre la lecture séquentielle ...Ajout d'une nouvelle couche : Chiffrement fort ...Ajout d'une nouvelle couche : Compression ...Ajout d'une nouvelle couche : Chiffrement faible ...L'ajout explicite d'une séquence d'échappement de type seqt_not_a_sequence est interditAjout d'une couche de cache au-dessus du tube pour fournir une capacité de déplacement limitéeAjout des fichiers qui ont été détruits depuis la sauvegarde de référence ...Tous les fichiers demandés n'ont pu être restaurésToutes les couches d'abstraction ont été crées avec succèsUne chaîne vide n'est pas un nom de groupe valideUne chaîne vide n'est pas un nom d'utilisateur valideL'archive %S nécessite un mot de passe : L'opérateur d'assignation la classe archive n'est pas implémentéNom de base de l'archive à ajouter : Le constructeur de recopie pour la classe archive n'est pas implémentéMise en route de la procédure de terminaison de l'archiveMise en route de la procédure de terminaison rapide de l'archiveUn format d'archive plus ancien que "08" (release 2.4.0) ne peut être lu à partir d'un seul tube, seule la lecture avec dar_slave ou à partir de fichiers (c'est à dire de tranches) est possibleLe catalogue interne de l'archive n'a pas été signé de la même façon que l'archive elle-même, c'est probablement le signe d'une compromission de l'archiveLe catalogue interne de l'archive est correctement signé mais ne correspond pas aux marques de bandes utilisée pour la lecture séquentielle. Il est possible qu'une corruption de donnée ou une compromission de l'archive ait eu lieu! Si les données extraites en mode séquentiel ne correspondent pas à celle extraites en mode drect, on peut considérer que l'archive a été modifié suite depuis sa création.L'archive est fermée.Archive composée de %i fichier(s) Signature de l'archive : %S Numéro d'archive à modifier : Numéro de l'archive à déplacer : Numéro d'archive à supprimer : Numéro de l'archive dont le chemin doit être modifié : Numéro d'archive | Données | statut || Attributs Étendus | statut Numéro d'archive : L'archive de référence n'est pas signée correctement (difference de signataire entre le catalogue interne et l'archive elle-même), est-ce qu'on continue ?La production d'archive sur stdout n'est pas compatible avec plusieurs tranches (option -s)La signature d'un archive n'est possible qu'avec le chiffrement gnupgTaille d'archive inconnue (lecture depuis un tube)Taille de l'archive : %i octets Taille totale : %i octets Version du format de l'archive : %s Version d'archive trop élevé, utiliser une version plus récente de libdarÉtes vous sûr de vouloir supprimer l'archive numéro %d ?L'argument donné à -H doit être un entier positifArguments lus depuis %S :L'argument donnée à l'option -r doit être un chemin relatif (jamais commencer par '/')Un élément hors des limites est demandéClef de chiffrement asymmétrique : %S Au moins une tranche d'une ancienne archive ayant le même nom reste présente dans le répertoire %s. Il est conseillé de supprimer toutes les anciennes tranches avant de créer une archive de même nom. Peut-on supprimer les anciennes tranches ?Mauvais CRC, une corruption des données a eu lieuRéponse incohérente du correspondant pendant la terminaison de la connexionMauvais format de dateNombre octal malforméeEn-tête SAR mal-formé (type de TLV inconnu dans l'en-tête d'une tranche)Base de donnée malforméeTerminateur malformé, la position du catalogue ne peut être déterminée : "infinint" malformé ou format non supportéL'attribut date de création ne peut pas être restauré pour %s car aucune famille de FSA capable de le supporté n'a été activée lors de la compilation.Les deux archives de référence sont nullptr, impossible de fusionner à partir de rienConstruction de l'objet catalogue ...EXCEPTION NON (LIB)DAR ATTRAPÉEDifference de CRC concernant les données du fichier (comparaison depuis un catalogue isolé)Erreur de CRC détectée lors de la lecture des AEErreur de CRC détectée lors de la lecture des FSAErreur de parité : données corrompues.Erreur de CRC pour le catalogueCalcul de la signature du hashage du catalogue ...Impossible de lire les données sauvegardées.Arrêt non confirméImpossible d'ajouter un chemin absoluBase de donnée pleine, impossible d'ajouter une nouvelle archiveImpossible d'allouer de mémoire pour un tampon lors de la lecture %SImpossible de bloquer les signaux : Impossible d'arrêter proprement l'opération, l'absence de support pour un environnement multi-tâches arrêtera abruptement le programme, en conséquence l'archive générée risque fortement d'être inutilisable.Comparaison d'AE impossible : le support pour les Attributs Étendus n'a pas été activé lors de la compilationImpossible de comparer des fichiers ouverts en écriture seuleImpossible de convertir un nom d'utilisateur en numéro (UID) dans un executable lié statiquement. Fournir soit directement l'UID soit utiliser un exécutable lié dynamiquementLa copie d'un objet wrapperlib n'est pas implémentée, copie impossibleImpossible de créer la base, un fichier de même nom existe déjàCréation d'une inode impossible : Impossible de dup()liquer un descripteur pendant la copie d'un "fichier_local" : %sNe peut pas évaluer cet objet crit_and car aucun autre objet criterium n'y a été ajoutéNe peut pas évaluer cet objet crit_or car aucun autre objet criterium n'y a été ajoutéImpossible d'extraire du catalogue interne la liste des fichiers à effacerNe peut pas purger la lecture d'un generic_file en écriture seuleImpossible d'obtenir le catalogue de référence car il n'a pas été fourniImpossible d'obtenir le nom de données de cette archive ; cette archive n'est pas complètement initialiséeImpossible d'obtenir les droits d'accès à partir d'un description de fichier : Impossible d'accéder aux attributs ext2 (drapeau nodump) pour %S : %sImposible de connaître la taille du fichier : %sImpossible d'obtenir le chemin complet du répertoire courant : Impossible d'obtenir d'information sur l'inode d'un fichier à effacer Impossible d'obtenir des informations sur l'inode %s : %sImpossible d'obtenir des informations sur l'inode %s : %sImpossible d'obtenir la date de dernière modification : %sImpossible d'obtenir la date de dernière modification : %sImpossible de connaître la taill de %S: ce n'est pas un fichier pleinImpossible de gérer un entier aussi grand. Utiliser la version complète de libdar (compilé pour utiliser le type "infinint") pour résoudre ce problèmeOuverture du catalogue impossible : Fichier destination impossible à ouvrir : %sImpossible d'ouvrir le fichier : Fichier source impossible à ouvrir : %sImpossible de lire les drapeaux "fcntl" du fichier : Impossible de lire les arguments en ligne de commande, abandonImpossible de lire le contenu du répertoire : %s : Impossible d'obtenir d'information sur %s : %sImpossible de lire l'inode de Lecture impossible en entréeNe peut recevoir autant de donnée en regard de la place mémoire allouéeImpossible de poursuivre la récursion dans une entrée qui n'est pas un répertoireImpossible de réduire la taille du chaîne à une valeur qui est plus grande que sa taille actuelleSuppression de répertoire impossible Suppression de fichier impossible Suppression du fichier %s impossible: Impossible de supprimer in fichier qui n'existe pas dans le système de fichier : Ne peut pas supprimer l'entrée %S du catalogue car elle n'y existe pasAucun fichier ne peut être restauré, aucune action n'a été réaliséeImpossible de restaurer le fichier %S : fichier inexistant dans le baseRestauration des droits d'accès de %s impossible : %sNe peut pas lire un caractère en arrièreNe peut pas déplacer la lecture dans le fichierImpossible de modifier les drapeaux "fcntl" du fichier : Impossible de définir la date de naissance: Impossible de positionner les dates de dernier accès et de dernière modification : Ne peut pas atteindre la fin du fichierNe peut peut aller plus loin pour restaurer un trouImpossible de se positionner à un endroit valide dans le fichierImpossible de se déplacer à la position courante dans un "tronc"Ne peut pas synchroniser l'écriture sur un generic_file en lecture seuleImpossible de débloquer les signaux : Impossible d'écrire une base en lecture seuleImpossible d'écrire l'archive : Écriture impossible en sortieImpossible d'écrire dans le fichier destination, abandon de l'opérationImpossible d'écrire sur la sortieLe hashage du catalogue ne correspond pas au hashage signé de l'archive, l'archive a été modifiée depuis sa création !Taille du catalogue dans l'archive : %i octets Taille du catalogue dans l'archive : NC Une exception non "libdar" a été interceptéeUne exception Egeneric inconnue a été interceptée : Mise à jour des en-têtes de la base de données ...Mise à jour des informations de la base de données ...Vérification de l'ordonnancement chronologique des fichiers entre les archives ...Vérification de l'ordonnancement des dates entre les archives ...Vérification de l'ordonnancement des dates de fichiers ...Choisir un seul algorithme de compressionEffacement des attributs étendus (requis par la politique d'écrasement) : Fermeture de la couche de base ...Fermeture de la couche de compression ...Fermeture de la couche de chiffrement ...Fermeture de la couche d'échappement...Les commandes sont : Commandes : Options communes : Problème de communication, essayer à nouveau ?Compression et enregistrement de la base de donnée dans le fichier...Algorithme de compression utilisé : %S le niveau de compression doit être compris entre 1 et 9 inclusLa compression (option -z) est inutile et ignorée lorsque -ak est utilisé"Compression_level" doit être compris entre 1 et 9 inclusCalcul des statistiques ...Conflit lors de la sélection du fichier à conserver dans l'archive résultante : Considération d'une couche de chiffrement ...Traitement de la (première) archive de référence :Prise en compte de l'archive de référence auxilaire :Échec de la vérification de cohérence pour l'en-tête de l'archiveContinuer avec le contenu de l'archive ?Continuer ?On continue l'action en cours qui est de sorti ... donc on sort !Poursuite...Les données copiées ne correspondent pas au CRCCopie terminée. Il manque %.0f octet(s) de données Données corrompues lues depuis un tubeLes données lues depuis un tube sont corrompuesBase de données corrompue : Entrée corrompue dans l'archive à la suite d'une séquence d'échappementCorruption rencontrée lors de la lecture de la structure de donnée header_versionCréation d'une inode impossible : Impossible de trouver la séquence d'échappement du catalogue interneÉchec lors de l'ouverture du répertoire %s en mode furtif (%s), ouverture en mode normalAffection du fichier à son propriétaire d'origine impossible : La structure de donnée du catalogue a pu être lue à %i de l'archive, elle contient ceci :Création d'une nouvelle file d'exécution pour le couche de compression...Création d'une nouvelle file pour exécuter la couche d'échappement ...Création d'une nouvelle file pour exécuter les couches précédemment créées ...Création de fichier ...Création de la couche de base : Ecriture de l'archive dans un trou noir (équivalent à /dev/null) ...Création de la couche de base : Ecriture de l'archive dans un fichier normal ...Création de la couche de base : Ecriture de l'archive vers un objet sar (Segmentation and Reassemblement) pour le découpage en tranches ...Création de la couche de base : Ecriture de l'archive vers la sortie standard ...La taille d'un bloc de chiffrement doit être supérieure à 10 octetsLe répetoire courant ne peut pas être un chemin relatifL'implémentation actuelle du chiffrement blowfish n'est pas compatible avec l'ancienne implémentation (boguée), utiliser dar-2.3.x (ou autre logiciel basé sur libdar-4.4.x) pour lire cette archiveAlgorithme de chiffrement non disponible dans libgcrypt : %s/%sLe sous-processus DAR a terminé avec le code de sortie Arrêt de DAR suite à la reception du signal : DIFF DonnéesUne corruption de données semble avoir eu lieu, impossible de déchiffrer les donnéesCorruption de données rencontré en fin de tranche, drapeau interdit à cet endroitCorruption de données rencontrée en fin de tranche, drapeau inconnuCorruption de donnée ou mark inconnue au sein des données d'un fichier à trouDonnées sauvées : %S %SDonnées plus récentes : %S %SLes données du fichier %S de la première archive ont été préservés de l'écrasementLe fichier %S est sur le point d'être %S, OK?Les données du fichier %S pris de la première archive de référence ont été écraséesLes données du fichier %S pris de la première archive de référence ont été retirésLes données devraient être en lecture seuleTaille des données : %i %iLa base de donnée a été initialisée avec succès.Base de données non sauvegardée, voulez-vous vraiment sortir ?Les dates ne croissent pas avec le numéro des archives pour tous les fichiers, l'utilisation de cette base de donnée peut conduire à la restauration d'une mauvaise version d'un tel fichier. S'il s'agit d'une erreur d'ordonnancement des archives dans la base, il est recommandé de le corriger afin d'avoir les archives les plus anciennes aux numéros les plus petits et les plus récentes aux numéros les plus grands Les dates de %S ne sont pas croissante avec le numéro des archives. Fichier concerné : %SDécompression et chargement de l'en-tête de la base de donnée en mémoire...Décompression et chargement de la base de données en mémoire ...Le mode décrémental est inutile lorsqu'il n'est pas appliqué à la fois à une archive de référence et à une archive auxiliaire de référence. Ignorer le mode décrémental et continuer ?Détection d'une marque de répertoire cache pour %s, le contenu de ce répertoire ne sera pas sauvegardéLe répertoire %S ne peut pas être restauré : écrasement interdit et une inode n'étant pas un répertoire existe déjà sous ce nom. Aucun fichiers de ce répertoire ne sera restauré : Inode sale : %S %SDésactivation du gestionnaire de signal. La prochaine réception de ce signal arrêtera immédiatement le programmeDivision par zéroVoulez-vous ignorer le même type d'erreur pour les prochains fichiers ?Voulez-vous l'utiliser pour l'opération ?A cause d'une corruption des données, il n'est pas possible si la tranche %S est ou non la dernière de l'archive. Merci de votre aide pour le déterminer. A l'invite qui suit, merci de répondre par "dernier" ou "non dernier" selon la nature de cette tranche (vous pouvez-aussi répondre par "stop" pour arrêter le programme immédiatement) : Les EA et FSA du le fichier %S sont sur le point d'être %S, d'accord ?Les EA et FSA du fichier %S de la première archive ont été mis à jour avec ceux du fichier de même nom provenant de l'archive auxiliaireLes Attributs Étendus de %S sont sur le point d'être fusionnés, OK ?Des Attributs Étendus de %S sont sur le point d'être écrasés, OK ?Les Attributs Étendus de %S sont sur le point d'être supprimés, OK ?Les Attributs Étendus pour %S n'ont pas été effacés tel prévu par la politique d'écrasement car ce fichier est un lien dur pointant sur une inode déjà restauréeLes Attributs Étendus pour %S n'ont pas été écrasés à car ce fichier est un lien dur pointant sur une inode déjà restauréeAttributs Étendus sauvés : %S %SAttr. Etend. plus récents : %S %SNombre d'Attributs Étendus : %i %iLes Attributs Étendus du fichier %S de la première archive ont été retirés et marqués comme déjà sauvésLes attributs étendus du fichier %S de la première archive ont été retirésLes Attributs Étendus du fichier %S de la première archive ont été mis à jour avec ceux du fichier de même nom pris de l'archive auxiliaireLes Attributs Étendus du fichier %S ont été écrasésLes Attributs Étendus du fichier %S ont été écrasés et marqués comme déjà sauvésTaille totale des Attr. Eten.: %i %iERR ERR Soit les archives dans la base ne sont pas correctement rangées, soit la date de dernière modification du fichier a été artificiellement modifiée à une valeur plus ancienne. Ceci peut mener à une restauration incorrecte des Attributs Étendus de l'inode %SUne chaîne vide en tant que sous-répertoire ne donne pas un chemin valideValeur NULL donnée à en argument de tools_readlink()Une chaîne vide est un nom d'archive invalideUne chaîne vide n'est pas un chemin valideEntrer chaque argument ligne par ligne puis appuyer sur entrée à la fin Erreur de CRC sur l'information d'une entrée dans la table de contenuErreur de CRC sur l'entrée %SErreur de CRC sur l'entrée %S. Ignorer l'erreur ?Informations sur les entrées : "en place" "à ajouter"Type d'entrée : %s %sErreur lors de la conversion du code %d en messageErreur lors de la création de la prise Unix : Erreur pendant la création des couches pour l'archive : Erreur de création d'un tampon pour GPGME: %s Erreur lors de la création du lien dur %s : %s Tentative de duplication de l'inodeErreur lors de la création du lien dur : %s , l'inode à lier [ %s ] a disparue, elle va être recrééeErreur lors de la création du lien dur : %s , l'inode à lier [ %s ] n'est pas présente, le lien dur ne peut pas être restauréErreur pendant l'exécution de la ligne de commande utilisateur : Erreur recontrée lors de la recherche de GID pour le groupe %s : %SErreur recontrée lors de la recherche de GID pour le groupe %s : %SErreur rencontrée lors de la recherche de l'UID pour l'utilisateur %s: %SErreur lors de l'obtention de la position du fichier à lire : Erreur pendant l'obtention de la taille du fichier : Erreur dans le fichier inclus %s : Erreur lors de la vérifiation de la capacité %S : %sErreur lors de la cration du fichier de hashage : Erreur rencontrée lors de l'ouverture de la dernière tranche : %S . Tentative d'ouverture à partir de la première tranche ...Erreur lors du traitement de l'opération : Erreur lors de la lecture des informations de découpage de l'archive de référence. Erreur ignorée, on continue sans cette informationErreur lors de la lecture de la ligne %S à partir du fichier %S : %SErreur lors de la lecture de l'entrée suivante : Erreur lors de la récupération de l'heure courante : %SErreur d'ouverture de %S : Erreur lors de l'ouverture d'un répertoire en mode furtif : Erreur lors de l'ouverture du répertoire : Erreur lors de l'ouverture du tube : Erreur pendant l'exécution de l'action demandée : %S Erreur lors de la lecture des AE pour Erreur lors de la lecture de l'attribut %s du fichier %s : %sErreur pendant la lecture d'un caractère : Erreur lors de la lecture de la base %S : Erreur lors de la lecture du contenu du répertoire : Erreur pendant la l'analyse d'un fichier inclus (%s) : Erreur lors de la lecture de l'inode de %s : %sErreur lors de la lecture du fichier source (%.2f %% des données a été copiée), on essaie de lire plus loin : %s Erreur lors de la suppression du fichier %s : %sErreur lors de l'inventaire des AE pour %s : %sErreur lors de la sauvegarde des Attributs Étendus de Erreur lors de la sauvegarde des FSA de Erreur lors de la transformation de l'archive : Erreur lors de l'execution de %s : %sErreur lors de l'activation du garde de mémoire de libgcrypt : %s/%sErreur d'ajout de l'EA %s : %sErreur lors de l'assignation d'une clef à une référence de clef de libgcrypt (essiv) : %s/%sErreur lors de l'assignation d'une clef à un manipulateur de clef lors de la vérification de la force du mot de passe : %s/%sErreur lors de l'assignation d'une clef à une référence de libgcrypt : %s/%sErreur lors de l'appel à fork() pour lancer dar : Erreur lors du changement des propriétés du terminal : Erreur pendant la comparaison de l'archive avec le système de fichiers : Erreur lors de la prise en compte du fichier : Erreur lors de la conversion UID/GID en chaîne pour le crochet d'exécution lors de la sauvegarde d'un fichierErreur lors de la création d'une référence ESSIV : %s/%sErreur lors de la création d'un tube anonyme : Erreur lors de la création d'une référence pour générer un somme de contrôle : %s/%sErreur lors du chiffrement des données : %s/%sErreur lors du déchiffrement des données : %s/%sErreur lors de la création de la clef à partir du mot de passe (ouverture HMAC) : %s/%sErreur lors du calcul de la clef à partir du mot de passe (HMAC set key) : %s/%sErreur lors de la recherche des propriétés de l'archive : Erreur lors de recherche du nom d'hôte (hostname) : Erreur lors de la recherche d'informations pour %S : Erreur lors de la génération du vecteur initial (IV) : %s/%sErreur lors de l'initialisation de "mutex" pour la classe "statistics" : Erreur lors de l'initialisation d'une fonction de hashage : Algorithme non disponible dans libgcrypt : %s/%sErreur lors de l'affichage du contenu de l'archive : Erreur lors de la création d'un manipulateur de clef lors de la vérification de la force du mot de passe : %s/%sErreur lors de l'ouverture d'une référence de clef pour libgcrypt: %s/%sErreur lors de l'ouverture de l'archive de référence : Erreur de syntaxe concernant --min-digits : Erreur de syntaxe dans la date donné à l'option -A : Erreur lors de la lecture du CRC pour des AE à partir de l'archive : Aucune séquence d'échappement trouvé pour ce fichierErreur lors de la lecture du CRC pour des FSA à partir de l'archive : Aucune séquence d'échappement trouvé pour ce fichierErreur lors de la lecture des FSA : Erreur lors de l'ouverture de l'en-tête de l'archive. Ce peut être dû à une ancienne archive chiffrée ou à une corruption de l'archive. On supposons qu'il s'agit d'une ancienne archive, pour laquelle pour laquelle l'en-tête n'est présent qu'au début de la première tranche ...Erreur lors de la lecture de donnée destinée à une mémoire sécurisée : Erreur lors de la lecture du fichier : Erreur lors de la lecture depuis un tube : Erreur lors de la lecture de la réponse sur le terminal : Erreur de suppression de %s : %sErreur lors de la réinitialisation de la clef de chiffrement pour un nouveau bloc : %s/%sErreur lors de la restauration de Erreur lors de la restauration de : "Erreur pendant la restauration des fichiers suivants : Erreur lors de la sauvegarde de Erreur lors de la sauvegarde des données : Erreur lors de la détermination du vecteur initial (IV) pour le bloc courant : %s/%sErreur lors de la configuration des droits d'accès : %sErreur lors de la changement de propriétaire : %sErreur lors de la communication à libgcrypt que l'initialisation est terminée : %s/%sErreur lors du test de l'archive : Erreur lors de l'écriture sur un tube : Erreur lors de l'enregistrement du fichier : Erreur ! SHA1 n'est pas disponible dans libgcrypt : %s/%sErreur, le catalogue de référence n'a pas été fourniErreur, phrase secrète invalide, nouvel essai : Erreur lors de l'envoie de la phrase secrète à GPGME : Les séquences d'échappement utilisées pour lire l'archive conduisent à placer des fichiers en dehors de l'aborescence spécifiée. Pour résoudre ce problème, essayer de lire l'archive en mode direct, essayez de réparer l'archive avec Parchive si des fichiers de redondance ont été crées ou en dernier lieu essayez de lire l'archive en mode relaxAnnulation...les AE existants de %S n'ont pas pu être préservés : les Attributs Étendus existants de %S n'ont pas pu être lu ni préservé : les FSA existants de %S n'ont pas pu être préservés : les FSA existants de %S n'ont pas pu être lu ni préservé : Attributs Étendus du fichier trouvés dans la base mais impossibles à restaurer (ne sont présents que comme "inchangés" dans des archives différentielles)Erreur FATALE, abandonFamille de FSA : %S %SLes FSA de %S sont sur le point d'être écrasés, OK ?Les FSA de %S n'ont pas été écrasés car ce fichier est un lien dur pointant sur une inode déjà restauréeFSA sauvés complètement : %S %SLes FSA du fichier %S de la première archive ont été retirés et marqués comme déjà sauvésLes FSA du fichier %S de la première archive ont été retirésÉchec de création d'un contexte GPGME : Impossible de créer la tranche %S : dar_slave n'est pas arrivé à atteindre la fin de l'archive: %S. Tentantive d'ouverture de l'archive depuis les premiers octetsEchec de l'ouverture de la couche de cache, faute de mémoire disponible, l'archive sera lue sans optimisation des performancesEchec de lecture du CRC pour les Attributs Etendus : Echec de lecture des FSA existant de la famille extX : Erreur lors de l'obtention d'informations sur l'inode %s :Impossible de lire la tranche %S : Echec de récupération de la phrase secrèteImpossible de connaître la taille de bloc utilisée par l'algorithme de chiffrement : %s/%sÉchec lors de la récupération de la taille de bloc utilisée par libgcrypt pour l'algorithme de chiffrement : %s/%sÉchec de la récupération de la longueur de clef à utiliser : %s/%sÉchec de la récupération de la longueur maximum possible des clefsImpossible d'envoyer un retour-chariot après la phrase secrèteEchec de l'envoi de la totalité de la phrase secrète à GPGMEEchec d'affectation des FSA extX : Echec d'affectation (ouverture) des FSA extX: Echec de paramétrage d'un contexte GPGME avec le protocole OpenPGP : Impossible d'ouvrir %S pendant la consultation du drapeau "nodump" : %sÉchec lors de l'écriture de la somme de contrôle : Erreur fatale sur la ligne de commande utilisateur : Le fichier %S a changé lors de sa sauvegarde and n'est probablement pas sauvé un état valide ("fichier sale"), voulez-vous malgré tout le considérer pour la restauration ?Fichier %S ligne %dFichier trouvé dans la base mais impossible à restaurer (n'est présent que comme "inchangé" dans des archives différentielles)Le fichier a changé lors de sauvegarde mais a été sauvé plusieurs fois, restauration de la copie suivante : Le fichier a disparu alors que nous étions en train de le lire, impossible de vérifier s'il a changé lors de sa sauvegarde : %SBoucle dans l'inclusion des fichiers. Le fichier %s s'inclut lui-même directement ou via d'autres fichiers (option -B)Le mode d'ouverture du fichier n'est ni en lecture ni en écritureLe fichier doit être un répertoire : Fichier non trouvé dans la baseIndexe du fichier trop grand pour être stocké var un variable de type off_tl'appartenance du fichier ne sera pas restauré car %s ne possède pas la capacité CHOWN ni n'est lancé en tant que root. Pour éviter ce message utiliser l'option -OFichier enregistré comme supprimé à cette date dans la base de données : La sélection des fichiers a été interrompue. Construction de l'archive résultante avec les fichiers déjà sélectionnésTaille des fichiers : %i octets Taille de fichier trop petiteTaille du fichier : %i octets Fichier à chercher : Les attributs spécifiques au système de fichier (FSA) font défautFinalisation du nettoyage de la mémoire ...Fin de l'inspection du répertoire %S , sauvé %S%SÉcriture terminée dans le fichier Fichier initial : %i octets Taille du premier fichier trop petiteLa taille de la première tranche est trop petite pour être en mesure contenir ne serait-ce que l'en-tête de tranchePour information, c'est l'itération n°%d pour laquelle la clef aléatoire générée est considérée comme faible par libgcrypt. La rechercher d'une nouvelle clef aléatoire continue ... patienceMise en forme du fichier en base de donnée vide ...Trouvé 'Un en-tête d'archive a bien été trouvé en début d'archive, il n'indique pas que l'archive est d'un ancien format, la fin de l'archive est donc bel et bien corrompue. Arrêt de l'opération. Vous avez la possibilité soit de fournir une catalogue isolé en complément de cette archive soit de tenter une lecture séquentielle soit essayer le mode "relax" soit comme dernière chance à la fois le mode "relax" et la lecture sequentielleUn en-tête d'archive a bien été trouvé en début d'archive, il n'indique pas que l'archive est d'un ancien format, la fin de l'archive est donc bel et bien corrompue. Sans l'aide d'un catalogue externe de cette archive et comme nous ne procédons pas à une lecture sequentielle, il n'y a que peu de chance d'arriver à extraire quelque chose de cette archive corrompue. On continue quand même ?Mode de lecture furtifLa lecture furtive a été désactivé car %s ne possède pas la capacité FOWNER ni n'est lancé en tant que rootle moteur GPGME n'est pas disponible: %sprérequis insatisfait pour GPGME, une version supérieure à %s est nécessaireGénération d'une clef de chiffrement aléatoire pour le chiffrement symmétrique ...la date fournie doit être dans le passéeLes cibles utilisateurs suivantes n'ont pas été trouvées: %SDonner à l'option -S la même valeur que celle donnée à l'option -s est inutileDonner à -S la même valeur que celle donnée à -s est inutileLes liens durs pour les répertoires ne sont pas supportésNombre de ligne à afficher à chaque fois : ERREUR INTERNE, MERCI DE RAPPORTER L'AFFICHAGE PRÉCÉDENT AU MAINTENEUR DU PROGRAMMESi vous voulez vraiment arrêter la création de l'archive, appuyez sur CTRL+C puis appuyez sur la touche entréeIgnorer l'erreur précédente concernant la ligne de commande utilisateur et continuer ?Les arguments supplémentaires sur la ligne de commande sont ignorésFichier sans le drapeau NODUMP ignoré : Option inconnue -%c ignoréeDans le fichier inclus %S : Position à laquelle insérer l'archive : Réponse incohérente du correspondantIncohérence dans le catalogue : duplication des données associées à une inode liée en durstructure incohérente du catalogue : les données liées en dur ne sont pas celles d'une inodestructure incohérente du catalogue : données non trouvée pour une inode ayant un lien durIncohérence dans le catalogue : drapeau d'état inconnu pour une inode liée en durEn-tête de tranche incohérent : taille de première tranche trop petiteIncohérence dans la structure de données gérant les fichiers à trou : marque inconnuelabel incompletIntervalle d'archive incorrecte pour la baseQuantième inconnuHeure incorrecteMinute incorrecteMois incorrectSeconde incorrecteIndex hors limitesProblème d'initialisation pour la bibliothèque liblzo2l'entrée ne peut être lueInspection d'un répertoire valeur nullptr donnée à "ptr"Texte de chiffrement invalideNuméro d'archive invalide : Numéro d'archive invalide : %dArgument invalide donné comme archive destinationArgument invalide donné comme archive sourcevaleur nullptr donnée à "ptr"valeur nullptr donnée à "close_archive"Nombre invalide dans la chaîne : %SNuméro invalide : Chemin invalide, le chemin doit être relatifTaille invalide pour un CRCTaille invalide donnée via l'option -STaille invalide donnée via l'option -sCaractère large invalide dans la chaîne : Est un répertoire : %S %SEst un lien dur : %S %SEst une inode : %S %SEst un fichier : %S %SL'itérateur ne pointe pas sur des donnéesUne clef ne peut être une chaîne videClef trouvée mais tous les utilisateurs n'ont pas un niveau de confiance suffisantClef généréeMODE RELAX : "%S" n'est pas un format d'archive valideMODE RELAX : %S a un en-tête corrompu, tentative de détermination des valeurs d'origine puis on continue si c'est possibleMODE RELAX : %S est manquant. Vous avez la possibilité de créer un fichier de taille nulle de ce nom pour remplacer le fichier manquant. Ceci génèrera bien sûr des messages d'erreurs à propos des informations manquantes dans cette tranche, mais au moins libdar pourra continuer. Peut on continuer maintenant ?MODE RELAX : %i %% restantMODE RELAX : %i n'est pas une valeur valide de pourcentageLa structure de répertoires de l'archive est corrompue, elle conduirait à placer des fichiers en dehors de sa racine. Restauration du contenu de tels répertoires à la racine et non en dehorsMODE RELAX : l'archive est marquée comme ayant des séquences d'échappement (ce qui est normal pour une version récente d'archive). Cependant, si ce n'est pas attendu, doit-on considérer qu'une corruption des données a eu lieu pour ce champ et ignorer cette marque ? (En cas de doute, refuser)MODE RELAX : L'archive est marquée comme ne possédant pas de séquence d'échappement ce qui n'est plus le cas par défaut depuis le format 8 (release 2.4.x). Si une corruption a eu lieu sur ce champ et qu'effectivement des séquences d'échappement sont présentes, ceci peut conduire à un échec de la restauration. Répondre non à la question suivante permettra d'insérer une couche de traitement des séquences d'échappement lors de la lecture malgré les indications présentes dans l'en-tête de l'archive. Voulez-vous continuer comme le suggère l'en-tête de l'archive, c'est-à-dire sans couche de gestion des séquences d'échappement ?MODE RELAX : L'archive semble chiffrée, mais aucun algorithme de chiffrement n'a été fourni, on suppose qu'il s'agit d'une corruption des données et qu'en fait l'archive n'est pas chiffréeMODE RELAX : L'archive semble n'être qu'un catalogue isolé (aucune donnée présente), Doit-on considérer qu'il s'agit plutôt d'une corruption et peut-on considérer que l'archive est une vraie archive ?MODE RELAX : Début de la recherche du catalogue (de la fin vers le début de l'archive pour %i %% de sa longueur), l'opération peut durer longtemps ..."MODE RELAX : erreur de CRC pour le catalogue, le contenu de l'archive est corrompu. Ceci peut même amener dar à voir des fichiers dans l'archive qui n'ont jamais existé, mais conduira plus probablement à d'autres échecs lors de la restauration des fichiers. Doit-on poursuivre malgré tout ?MODE RELAX : Impossible d'aller à la fin de l'archive ! On utilise la position actuelle comme point de départ de la recherche du catalogueMODE RELAX : Exception attrapée : MODE RELAX : Impossible de trouver un catalogue entier dans l'archive. Si vous possédez un catalogue isolé, arrêter à ce stade et utilisez-le en secours du catalogue interne. Sinon continuez mais soyez prévenus que toutes les données ne pourront pas être récupéréesMODE RELAX : Voulez-vous ignorer les tests de cohérence et tenter à nouveau la lecture du contenu de l'archive (ce qui peut prendre du temps et peut aussi échouer) ?MODE RELAX : Voulez-vous rechercher des morceaux du catalogue d'origine s'il en reste (ce qui peut prendre encore plus de temps et en tout état de cause, ne permettra au plus de récupérer que quelques fichiers) ?MODE RELAX : A cause d'une corruption probable des données, libdar ne peut déterminer la taille exacte des tranches. Pour des archives récentes, cette information est dupliquée dans chaque tranche. Voulez-vous essayer de lire une autre tranche pour récupérer cette information ?MODE RELAX : Erreur lors de la construction d'une entrée du catalogue, on ignore et on passe à la suivante. L'erreur rencontrée était : MODE RELAX : La séquence d'échappement n'a pas pu être trouvée, elle a soit été corrompue, soit elle est hors du périmètre de recherche dans l'archive. On essaye de trouver le catalogue par l'autre méthode, patience ...MODE RELAX : Séquences d'échappement présentes dans l'archive. Deux méthodes différentes sont disponibles pour localiser le catalogue : soit on recherche la séquence d'échappement indiquant le début du catalogue, soit on essaie les différentes positions tour à tour dans l'espoir que cette portion de l'archive ressemblera à la structure d'un catalogueMODE RELAX : Échec de lecture de la version du format de l'en-tête de l'archiveMODE RELAX : Échec de lecture du catalogueMODE RELAX : Échec de lecture du catalogue (0 octets de l'archive demandé pour sa recherche)MODE RELAX : Échec de lecture du catalogue (aucune donnée à inspecter)MODE RELAX : Bonne nouvelle ! La séquence d'échappement marquant le début du catalogue a été trouvée ! On essaie maintenant de le lire ...MODE RELAX : On continue malgré l'absence d'information à propos de la taille des tranchesMODE RELAX : En dépit de son nom, %S ne semble pas être une tranche d'archive, on suppose qu'une corruption des données a eu lieu et on continueMODE RELAX : Merci de fournir un nombre entier strictement positifMODE RELAX : Merci d'indiquer le format de l'archive : Vous pouvez utiliser la table à l'URL %s pour trouver la version de format en fonction de la release de dar/libdar (par exemple si l'archive a été crée en utilisant une version de dar de 2.3.4 à 2.3.7 indiquer "6" sans les guillemets) : MODE RELAX : Merci de fournir le numéro de la tranche à lire : MODE RELAX : Fin de la zone de recherche atteinte, ECHEC de la localisation du catalogueMODE RELAX : Le drapeau de tranche est corrompu, mais comme une tranche de numéro supérieur a déjà été vu, ce drapeau ne pouvait pas indiquer cette tranche comme la dernière de l'archive, on continueMODE RELAX : le catalogue (table des matières) occupe en générale quelques pourcentages de l'archive à sa fin. Quel pourcentage voulez-vous qu'il soit balayé pour sa recherche (répondre par un *entier* entre 0 et 100) ? MODE RELAX : La fin de l'archive est corrompue, impossible d'obtenir le contenu de l'archive (le "catalogue")MODE RELAX : On essaie de localiser la séquence d'échappement (conseillé) ? MODE RELAX : état de sauvegarde inattendu pour un objet de la classe "cat_detruit", corruption de données probable et ignorée. On continueMODE RELAX : état de sauvegarde inattendu pour une fin de répertoire, corruption des données probable et ignorée. On continueMODE RELAX : Un algorithme de compression inconnu a été utilisé, on suppose qu'une corruption des données a eu lieu. Merci de m'aider à déterminer le mode de compression qui a été utilisé en saisissant l'un des mots suivants "aucun", "gzip", "bzip2" ou "lzo" : MODE RELAX : Data inconnue dans un en-tête de tranche, on ignore et on continueMODE RELAX : Suivre le format d'archive "%d" ?LAX MODE: le hashage du catalogue ne correspond pas au hashage signé de l'archive, erreur ignoréeMODE RELAX : l'étiquette du catalogue ne correspond pas à celle de l'archive, comme s'il s'agissait d'un catalogue isolé, on suppose qu'une corruption a eu lieu et que le catalogue est une catalogue normal interne à l'archiveMODE RELAX : fermeture de la tranche %i, l'en-tête a pu être lu correctementMODE RELAX : la taille de la première tranche est impossible à lire (manque de mémoire virtuelle ?), on continue malgré tout ...MODE RELAX : la taille de la première tranche est impossible à lire, on continue malgré tout ... MODE RELAX : Entrée inconnue dans le catalogue, corruption de données probable qui interdit de lire plus avant le contenu de l'archive car aucune la longueur de cet enregistrement n'est pas connueMODE RELAX : entrée inconnue trouvée dans le catalogue, on considère qu'une corruption de données a eu lieu. Passage à l'entrée suivante, ce qui peut conduire à une mauvaise restauration de la structure de répertoires, si cette entrée corrompue était un répertoireMODE RELAX : le nom interne de la tranche laisse à penser qu'elle ne fait pas partie de la même archive. On suppose qu'il s'agit d'une corruption de données et on ignore cette erreurMODE RELAX : ouverture de la tranche %i afin de lire l'en-tête de trancheMODE RELAX : Impossible de lire la taille des tranches, (manque de mémoire virtuelle ?), on continue malgré tout ...MODE RELAX : les tranches %i et %i sont toutes les deux marquées comme la dernière de l'archive, on considère que la dernière est celle de numéro le plus élevéMODE RELAX : La lecture séqentielle demandée a besoin que l'archive contienne de séquences d'échappement ce qui ne semble pas être le cas ici. On suppose qu'il s'agit d'une corruption de données. Cependant, si tel n'est pas le cas, et si aucune séquence d'échappement n'est effectivement présente dans cette archive, il ne faut pas utiliser le mode de lecture séquentielle pour lire cette archive, aucune information pertinente ne pourrait en être extraiteManque de mémoirePas assez de mémoire SÉCURISÉE pour terminer l'opération, abandonManque de mémoire sécuriséePas assez de mémoire pour terminer l'opération, abandonFichier final : %i octets La bibliothèque de chiffrement pour l'algorithme blowfish ne respecte pas la RFC 3962Options de listing (à utiliser avec -l) : Chargement en mémoire du catalogue...Chargement en mémoire du catalogue isolé...Localisation du contenu de l'archive ...Options longues supportées : %s Recherche des archives contenant les versions les plus récentes des fichiers et tri des fichiers par archive à utiliser pour la restauration ...Nettoyage mémoire (libération de la mémoire utilisée par l'archive de référence) ...Le préfixe pour une mask_list doit être un chemin absolu ou commencer par la chaîne "" pour la fusion d'archivesÉchec de l'allocation mémoire : %sFusion/Filtrage des fichiers de l'archive %s ...Il manque l'une des options -c -x -d -t -l -C -+, tapez '%S -h' pour l'aideIl manque un [ après un } dans la condition suivante : Il manque un ] dans la condition suivante : Il manque le nom de base de l'archive, voir l'option -h pour l'aideArgument manquant pour --backup-hook-executeIl manque un argument à --hashIl manque un argument à --min-digitsIl manque un argument à l'option -EPas d'argument à l'option -EIl manque un argument à l'option -FIl manque un argument à l'option -SIl manque un argument à -^Pas d'argument à l'option -iPas d'argument à l'option -oIl manque un argument à -sPas assez d'arguments sur la ligne de commande, abandonPas de catalogue dans le fichier.Données absentes pour le chiffrement asymétrique des donnéesil manque des données initialiser un objet TLVDéfaut de données lors de la lecture d'un object slice_layoutAucun support pour les algorithmes de hashage (partie intégrante du support pour le chiffrement fort, grâce à libgcrypt)Pas d'argument à l'option -%cIl manque la source ou la destination, voir l'option -h pour l'aideAbsence de support pour le chiffrement fort (libgcrypt)Il manque un } dans la condition suivante : NONAUCUN FICHIER DE CE RÉPERTOIRE NE PEUT ÊTRE SAUVÉ.une FONCTIONNALITÉ NON ENCORE IMPLÉMENTÉE a été sollicitée :Nombre négatif ou nul non autorisé pour le déplacement d'une archive au sein de la baseNouveau numéro pour l'archive %d : Nouveau nom pour la base de données : Nouveau chemin de l'archive %d : Aucun attribut spécifique au système de fichier avec lequel comparerAucune action spécifiée, abandonAucune tranche n'est présent dans %S pour l'archive %S, merci de fournir la dernière tranche de l'archive.Aucune couche de chiffrement ouverteAucune couche de chiffrement n'a été ouverte. Ajout d'une couche de cache pour améliorer les performancesAucune donnée trouvée dans cette archive, lecture séquentielle du catalogue situé à la fin de l 'archive...Aucune donnée à déchiffrerPas de base de donnée spécifiée, abandonAucune exception n'est autorisée en provenance d'une fonction de rappel de libdarAucun fichier de ce répertoire ne sera pris en compte pour la fusion.Aucun fichier de ce répertoire ne sera restauré.Aucun masque disponibleAucun masque sur lequel opérer dans la liste de masqueAucun masque sur lequel opérer dans la liste de masqueAucun problème rencontréAucun destinataire avec une clef valide ne demeure, le chiffrement est impossible, arrêt de l'opérationAucun signataire avec une clef valide ne demeure, la signature de l'archive est impossible, arrêt de l'opérationAucune information de découpage en tranche n'est disponible à propos de l'archive dont a été isolé le présent catalogue. Impossible de localiser les fichiers au sein de l'archive, arrêt des opérations.Plus d'espace disponibles pour les inodes, vous avez la possibilité d'en faire maintenant. Quand ce sera fait, pouvons-nous continuer ?Plus d'espace disque disponible, vous avez la possibilité d'en faire maintenant. Quand ce sera fait, pouvons-nous continuer ?Aucun terminal n'a été trouvé pour interagir avec l'utilisateur. On considérera une réponse négative à toutes les questions posées à l'utilisateur (choix le moins destructeur), ce qui la plupart du temps arrêtera le programme.Aucune cible utilisateur trouvée sur la ligne de commandeAucune clef de chiffrement valide n'a pu être trouvée pour %SAucune clef de signature valide n'a pu être trouvée pour %SArchive inexistante dans la baseFichier inexistant dans la baseFichier inexistant : Erreur non fatale lors de l'écriture des données, on essaie à nouveau Non SauvéLa chaîne lue depuis un fichier n'est pas terminée par le caractère zéroPas assez de données pour initialiser le champ "storage"Pas d'affectation du FSA extX IMMUTABLE pour %s à cause du défaut de privilège pour le fairePas d'affectation du FSA extX SYSTEM RESOURCE pour %s à cause du défaut de privilège pour le faireRéalisation de l'isolation à la volée ...OK OK OK, on garde %S comme nom de baseUne seule option -@ est permiseUne seule option -A est permiseUne seule option -R est permiseUne seule option -S est permiseUne seule option -s est permiseOuverture d'une paire de tubes pour lire l'archive, dar_slave doit être utilisé à l'autre extrémité de ces tubes ...Ouverture et lecture du fichier de traitement par lot...Ouverture de l'archive %s ...Ouverture d'une couche de construction ...Ouverture d'une couche de chiffrement ...Ouverture d'une couche de gestion des séquences d'échappement ...Ouverture du tube nommé %S comme source pour lire l'archive ...Ouverture de l'entrée standard pour lire l'archive ...Ouverture de l'archive de référence %s pour récupérer le catalogue isolé ...Ouverture de l'archive par la couche d'abstraction des tranches...Ouverture de la couche d'abstraction gérant la compression (aucun algorithme de compression utilisé)...Ouverture de la couche de d'abstraction gérant la compression ...Options : Index hors limite demandé pour un secu_stringÉcrasement interdit alors qu'une tranche de même nom de base a été trouvée dans le répertoire %s. Opération avortéeErreur de syntaxe en ligne de commande (ou dans un fichier inclus) : Erreur de syntaxe : Erreur de syntaxe : `%c' sans correspondanceRequête partielle reçue, opération abandonnée Phrase secrète requise pour la clef %s : Chemin de dar (chemin vide pour l'utilisation de la variable PATH) : L'autre extrémité du tube est inconnue, impossible de fermer un quelconque descripteur de fichier pointant dessusL'autre extrémité du tube est inconnue, impossible d'en fournir un descripteur de fichierMerci de répondre avec un des caractères entre crochets et appuyer sur "entrée"Merci de vérifier la documentation et/ou de mettre à jour ce logicielMerci de vérifier votre matérielMerci de confirmer le mot de passe : La taille de l'archive ne tient pas compte des en-têtes de chaque tranche Bogue probable dans liblzo2 : lzo1x_*_compress a retourné un code non prévu : %dTraitement des fichiers pour la sauvegarde ...Traitement des fichier pour la fusion ...Le programme a été arrêté pour la raison suivante : Fin de fichier atteinte pendant la lecture de la structure de données header_versionFin de fichier atteinte pendant la lecture de la version d'archiveFin de fichier atteinte, aucune donnée correcte n'a pu être trouvée après la dernière erreur Fin de fichier atteinte alors que toutes les données n'ont pu être luesFin de fichier atteinte lors de la lecture d'un en-tête de tranche d'archiveFin de fichier atteinte lors de la lecture de la version d'archiveLecture sur un "generic_file" ouvert en écriture seuleLecture par anticipation sur un "generic_file" en écriture seuleLecture du contenu de l'archive ...Lecture du catalogue de l'archive à ajouter ...Options de lecture (à utiliser avec -x, -d, -t, -l, -A) : Lecture de l'en-tête de l'archive ...La lecture de l'archive de référence à partir d'une tube ou de l'entrée standard n'est pas possibleLecture de la fin de l'archive ...Prêt à commencer l'écriture de l'archive ?Signal reçu : %dSignal %s reçul'ordre ordre spécial reçu est inconnuEnregistrement de lien dur dans l'archive : Le "storage" de référence de l'itérateur est vide ou non existantSuppression du fichier %sSuppressin du fichier (fichier marqué comme supprimé dans l'archive) : %SSuppression du fichier (politique d'écrasement) : %SSuppression des informations de la base ...Suppression du fichier sale %SRemplacement de %s dans l'option -R par le répertoire pointé par ce lien symboliqueSauve à nouveau mais sans compression: Remettre à zéro le processus de lecture séquentielle alors qu'il n'est pas terminé, rendra inaccessible toute les données non lues jusque làRestauration des EA de %S arrêtée : Restauration des FSA de %S arrêtée : Restauration des Attributs Étendus du fichier : Restauration des FSA du fichier : Restauration des données du fichier : Options de restauration (à utiliser avec -x) : Lancer un fichier de traitement par lot à partir d'un autre fichier de traitement par lot n'est pas autoriséeAUTO-CONTROL : AU MOINS UNE FILE D'EXÉCUTION N'A PAS ÉTÉ DÉTRUITE ET RESTE EN MÉMOIRE ALORS QUE LE PROGRAMME TOUCHE À SA FINAVERTISSEMENT DE SECURITÉ ! FICHIER SUSPECT %S : la date ctime a changé depuis que l'archive de référence a été faite, alors qu'aucune autre propriété de cette inode n'a changéIL SEMBLE QU'IL Y AIT UN PROBLÈME MATÉRIEL :SAUTÉ (lien dur en mode sequentiel) : Données identiques mais CRC non vérifié, car sa largeur n'a pas été devinée correctement (restriction due à la lecture sequentielle)Même donnée, mais le CRC enregistré ne correspond pas à ces données !?!SauvéOptions de sauvegarde / d'isolation / fusion (à utiliser avec -c, -C ou -+) : Sauvegarde des Attributs Étendus de Sauvegarde des attributs spécifiques au système de fichier Étendus pour Le chiffrement "scramble" est très faible. C'est un non-sens de l'utiliser avec le chiffrement asymétriqueUne chaine sécurés ne peut être saisie que depuis un terminalVoir la page de manuel pour plus d'options. Lecture séquentielle demandée, mais cette archive est marquée comme ne possédant pas de séquence d'échappement nécessaire pour cette opération. Opération abandonnéeMarques pour lecture séquentielle : %s taille trop grande pour un tampon élastiqueSaut effectué (manque %.0f octet(s)), données correctes trouvées, on continue la copie... La tranche %S possède un drapeau inconnu (ni terminal ni non-terminal).La taille de tranche est trop petite pour être en mesure de contenir ne serait-ce que l'en-tête de trancheLe découpage en tranches (option -s) n'est pas compatible avec la production de l'archive sur la sortie standard ("-" en nom d'archive)Des comparaisons de fichier ont échouéCertains fichiers sont corrompus dans l'archive et ne pourront pas être restaurésCertains fichiers ne sont pas rangés par ordre chronologique en suivant des indices croissants d'archive au sein de la base de donnée, ceci peut amener dar_manager à ne pas restaurer la bonne version d'un de ces fichiersDésolé, la taille du fichier est inconnue à cette étape du programme Fichier à trou : %S %SDébut de la copie de %u octet(s)Soustraction d'un "infinint" par un autre plus grand que le premier. Un "infinint" ne peut pas être négatifClef de chiffrement symmétrique : %S Erreur de syntaxe dans l'argument fourni à l'option --retry-on-change : Erreur de syntaxe dans le fichier de traitement par lot : %SErreur de syntaxe dans le fichier de traitement par lot : option -C non autoriséeErreur de syntaxe dans le fichier de traitement par lot : option -i non autoriséeErreur de syntaxe dans la politique d'écrasement : L'utilisation du standard de marquage des répertoires de cache n'est utile que lors d'une sauvegardeL'archive %S est chiffrée mais aucune algorithme de chiffrement n'a été donné. Ouverture de l'archive impossible.L'archive et le catalogue isolé ne correspondent pas aux mêmes données, ils sont donc incompatibles entre euxLe nom de base '+' est réservé pour un usage particulier qui n'a aucun sens dans ce contexteLe catalogue sera construit au fil de la lecture séquentielle de l'archive. Préparation de la structure de données ...L'entrée dans laquelle poursuivre la récursion n'existe pas. Impossible d'ajouter celle-ci à un répertoire absentLes commentaires utilisateur suivants seront placés en clair dans l'archive : %SLa version du format ce cette archive est trop grand pour cette version d'application. On essaye quand même lire cette archive ?La version du format de cette base de données et trop élevé pour cette version de logiciel. Utiliser une version du logiciel plus récente pour lire ou modifier cette base de donnéeLe chemin %s doit être un répertoire (ou un lien sur un répertoire)La taux de compression global est : L'itérateur n'indexe pas l'objet sur lequel il lui a été demandé de lireL'itérateur n'indexe pas l'objet sur lequel il lui a été demandé d'écrireL'itérateur n'indexe pas l'objet pour lequel il a été définiLa position de l'itérateur n'est pas contenue dans le "storage" de référenceLe fichier juste restauré %S a été marqué comme sale (en lecture séquentielle cet état ne peut être détecté qu'après la restauration du fichier), voulez-vous supprimer le fichier sale qui vient juste d'être restauré ?Le fichier juste restauré %S a été marqué comme sale (en lecture séquentielle cet état ne peut être détecté qu'après la restauration du fichier), suppression du fichier sale qui vient juste d'être restauré, puisqu'il a été demandé d'ignorer ce type de fichierLe dernier fichier (tranche) de l'archive n'est pas présent dans La taille totale de l'archive inclut %i octet(s) gaspillé(s) à cause d'un mauvais taux de compressionL'option de "photographie" (-A +) n'est disponible qu'avec l'option -cLes deux mots de passes ne sont pas identiques. AbandonCette archive ne contient qu'un catalogue isolé et ne peut pas être utilisée pour cette opération. Elle ne peut servir que de référence pour une sauvegarde incrémentale/décrémentale ou comme secours du catalogue de l'archive d'origineCette archive est constituée de plusieurs tranches et ne peut pas être lue depuis un tubeCette archive n'est pas exploitable, vérifier la documentation pour plus d'informationsCette archive n'est pas exploitable, vérifier la documentation de l'API pour plus d'informationsCette archive est constituée de plusieurs tranches et ne peut pas être lue depuis un tubeCette base de donnée a été corrompue probablement à cause d'un bogue présent dans les versions 2.4.0 à 2.4.9, et il n'a pas été possible de corriger cette corruption. Merci de reconstruire cette base à partir des archives (ou catalogues extraits). Si cette base n'a jamais été utilisée avec l'une quelconque des versions mentionnées précédemment, merci d'ouvrir un rapport de bogue en fournissant le plus de détails concernant les circonstances de ce problème.Ceci est une ancienne archive, elle doit être ouverte en lisant d'abord la première trancheDemande d'arrêt de file d'exécution reçue, on termine proprement l'opération en coursDemande d'arrêt de file d'exécution reçue, arrêt immédiatPour terminer entrer une ligne vide L'utilisation de --sparse-file-min-size lors requière l'utilisation conjointe de l'option -ah, voir la page de manuel pour plus de détailsBloc de données compressées trop grand : Soit à cause d'une corruption de données soit à cause d'une limitation système où la valeur de SSIZE_MAX implique un tampon mémoire plus petit que celui requisTrop d'arguments sur la ligne de commande, voir l'option -h pour l'aideTrop de lignes dans le fichier %S (dépassement d'entiers)Version trop ancienne pour libgcrypt, la version minimale requise est %s Tentative d'écriture hors d'un fichier de taille limitéeDeux tranches différentes %i et %i sont toutes les deux marquées comme la dernière de l'archive !Taper "man dar" pour plus de détails et pour connaître toutes les autres options disponibles. Parenthèses non équilibrées correctement dans l'expression suivante : Réponse incomplète reçue du correspondantArchive incomplète ! On considère qu'elle a été interrompue lors du processus de sauvegarde. Si une erreur a été reportée juste avant, on peut l'ignorer, il s'agit du fichier qui était en cours de sauvegarde au moment de l'interruption.Valeur inattendue pour un FSA boolean, une corruption de données est peut-être survenueRéponse inattendue de l'esclave, problème un de communication ou un bogue risque de suspendre l'opérationFin de fichier inattendueErreur inattendue retournée par GPGME : Erreur inattendue reçue lors de l'attente de la fin d'execution de dar : Exception non attendue levée par libdarValeur inattendue trouvée dans la baseValeur inattendue pendant la lecture de la version d'archiveType d'enregistrement inconnuArgument inconnu donné à -2 : %sArgument inconnu donné à -a : %sArgument inconnu donné à -k : %sArgument inconnu donné à -w : Opérateur unitaire inconnu ou non autorisé avec un argument : Caractère inconnu trouvé lors de l'analyse de la chaîne conditionnelle suivante : Choix inconnu Choix inconnu : Algorithme de chiffrement inconnuAlgorithme de chiffrement inconnuEntrée inconnue trouvé dans l'en-tête de tranche (type = %d), option non supportée. L'archive lue peut avoir été crée par une version plus récente de libdar, est-ce qu'on ignore cette entrée et on continue ?Type de séquence d'échappement inconnueExpression inconnue trouvée lors de l'analyse de la chaîne conditionnelle suivante : Expression inconnue dans la politique d'écrasement : Type de fichier inconnu ! Le nom du fichier est : Groupe inconnuEn-tête inconnu dans la base de donnée, abandon Macro %%%d inconnue dans le cadre de commentaire utilisateurParamètre inconnu donné à l'option --hash : Paramètre inconnu donné à l'option -a : La politique '%c' est inconnue pour les AE dans l'expression %SLa politique '%c' est inconnue pour les données dans l'expression %SType d'enregistrement inconnuChaîne de substitution inconnue : %Suffixe inconnu [%c] dans la chaîne %SUnité de temps inconnueUtilisateur inconnuAjout des informations issues du catalogue à la base de donnée...Décision de l'utilisateur requise pour les AE du fichier %SDécision de l'utilisateur requise pour les FSA du fichier %SDécision de l'utilisateur requise pour les données de %SCommentaires de l'utilisateur : %S Cible(s) utilisateur(s) trouvée(s) en ligne de commande ou dans un fichier inclus :La cible utilisateur "%s" n'est pas autorisée (cible réservé pour la syntaxe conditionnelle)le mode de lecture séquentiel n'est pas possible lors de la fusion d'archiveUtilisation des tailles de découpage de l'archive de référence enregistrées lors de l'isolation du catalogue Note : Si l'archive de référence à été réagencée en tranche après l'isolation, les informations de découpage utilisée ici sont incorrectes et conduiront probablement à une erreur. Regardez la documentation pour savoir comment définir manuellement le découpage en tranchesUtilisation du découpage fourni par l'utilisateur (première tranche = %i octets, autres tranches = %i octets)ATTENTION ! Fichier modifié pendant sa sauvegarde, plus de nouvelle tentativeATTENTION ! Fichier modifié lors de la lecture pour sa sauvegarde. Pas de nouvelle tentative pour ce fichier afin de de pas dépasser la taille maximale de gaspillage autorisée. Le fichier est ATTENTION ! Fichier modifié pendant sa sauvegarde. Tentative %i sur %iATTENTION ! Signature incorrecte trouvée pour l'archive, on continue malgré tout ?ATTENTION ! L'archive se trouve dans un des répertoires à sauvegarder, cela peut créer une boucle sans fin lorsque l'archive essaiera de se sauvegarder elle-même. Il est soit possible d'ajouter -X "%S.*.%S" sur la ligne de commande ou bien il faut changer l'archive de place (voir l'option -h pour l'aide). Voulez-vous vraiment continuer ?ATTENTION ! Ceci est un catalogue isolé, aucune donnée ou AE n'est présent dans cette archive, seule la structure du catalogue peut être validéeATTENTION : le support pour la mémoire sécurisé n'a pas été disponible lors de la compilation. En case d'utilisation importante de la mémoire, le mot de passe sur le point d'être fourni peut être écrit sur disque en clair (fichier d'échange). Vous avez été prévenu !ATTENTION : le support pour la mémoire sécurisé n'a pas été disponible lors de la compilation. En cas d'utilisation importante de la mémoire, les mots de passe peuvent être écrit sur disque en clair (fichier d'échange). Vous avez été prévenus !Attention ! Le support des FSA %s n'a pas été activé lors de la compilation. Ces attributs ne peuvent être restaurés pour %sAttention ! Aucun fichier de ce répertoire ne sera restauré : Attention ! Aucun fichier de ce répertoire ne sera pris en compte pour la fusion : Attention, %S semble être un nom de fichier plutôt qu'un nom de base. Souhaitez-vous le remplacer par %S ?Attention, êtes-vous sûr de vouloir arrêter (répondre "%S" pour confirmer)?Attention, l'archive %S a été chiffrée. Une mauvaise clef est impossible à détecter, cela aura pour conséquence la détection d'une corruption de l'archive. Attentuion: L'option -G est expérimentale et non supportée. Lire la page de manuel à propos de cette option pour plus d'informationAttention: le support des FSA %s/%s n'a pas été activé lors de la compilation. Impossible de le restaurer pour l'inode %sAttention: Aucune information de découpage en tranche pour l'archive de référence n'a été enregistré avec ce catalogue isolé. Les informations que vous avez fournies manuellement peuvent conduire l'opération à échouer car cette archive a un format _non supporté_ (trop vieux) pour cette fonctionnalitéNous utilisons une version incompatible de libdar. La version attendue est %d.%d.x alors que la version actuellement utilisée est %d.%d.%dCe qui correspond à %.2f %% de la quantité totale de donnés Pire Ecriture du contenu de l'archive ...Ecriture de la fin d'archive ...Ecriture de l'en-tête de l'archive ...Ecriture du premier terminateur d'archive...Ecriture du tampon élastique initial via la couche de chiffrement ...Ecriture du second terminateur d'archive ...Ecriture de la signature du catalogue..."Écriture sur un "generic_file" ouvert en lecture seuleOUIZéro n'est pas une taille valide de tampon élastique[ ][Attrib.][ Sauvé ][-- ENTRÉE SUPPRIMÉE --][SALE ][Data ][ EA ][FSA][compr][S]| accès |proprio |groupe |taille | date | nom de fichier [EnRef][Sauvé]Un chiffre binaire est soit 0 soit 1stopabsentabsent une chaîne vide n'est pas un argument valideajout seulajout de données après la fin d'un secure_memoryajout de données après la fin d'un secure_memorynum archive | chemin | nom d'archive l'argument doit être un chemin relatifLa fonctionnalité d'action de sauvegarde (options-< -> et -=) n'est disponible que lors de la sauvegarde et sera ignorée iciinode mal-formée : drapeau d'inode inconnuinode mal-formée : drapeau de FSA inconnugrosfichier spécial blocSupport pour le chiffrement avec l'algorithme blowfishbzip2Ne peut lire le CRC sur les données : aucune séquence d'échappement trouvée pour ce fichierne peut pas évaluer une chaîne vide comme politique d'écrasementimpossible de fournir des données pour un fichier non sauvegardéfichier spécial caractère"compressReset appelé alors que "compressInit" n'a jamais été invoqué au préalablecompresséerreur de CRC sur les données compresséesdonnées compressées corrompuesdonnées compressées corrompuesfichier corrompudate de créationoptions de dar : %S chemin de dar : %S Corruption de données détectée : incohérence dans les données compressées en LZOCorruption de données détectée : Bloc de données compressées trop granddonnées purgées, l'objet est maintenant videversion : %d les dates antérieurs à l'an 1970 ne sont pas permisesentrée suppriméeentrée suppriméeinformation sur les entrées supprimées les fichiers spéciaux n'ont pas le même numéro majeur : %d <--> %dles fichiers spéciaux n'ont pas le même numéro mineur : %d <--> %ddifférence de date de dernière modification : %S <--> %SAttributs Étendus différentsattributs spécifiques au système de fichier différentsles donnes ne correspondent pas: position de la première différence au sein du fichier: %itypes de fichier différentsgroupes propriétaires différents (uid) : %i <--> %igroupes propriétaires différents (gid) : %i <--> %idroits d'accès différents: %S <--> %Srépertoirerépartition des inodes porteinode Porteretiré de l'archive et marqué comme déjà sauvéStructure incohérent du tampon élastiquefin de répertoireErreur !l'exécution de [ %S ] a retourné un code d'erreur : %dexecve() a échoué. (table de processus pleine ?)execvp() a échoué mais n'a pas retourné de code d'erreurEchec d'ouverture de la tranche %S: %S. Nouvelle tentative avec écrasement préalable, si autoriséEchec de lecture du CRC depuis le fichier : fauxfichierle fichier existe et l'option contre l'écrasement a été activée.Fichier non ouvertpremièrerépertoirevaleur de GID trop grande pour ce système pour que libdar puisse le restaurer correctementgzipinode liée en durinformation sur les liens durs "hide_file" ne peut pas être initialisé avec un fichier en écriture seulerépertoire ignoréentrée ignoréeoption -O ignorée car inutile dans cette situationimmutabledans le fichier %S ligne %Sstructure incohérente du catalogueincohérence à la suite d'une séquence d'échappement : impossible de lire le label interne du jeu de donnéesboutisme incohérent entre U_16 et U_32boutisme incohérent entre U_16 et U_64boutisme incohérent entre U_16 et U_UEn-tête de tranche incohérent : taille de tranche trop petiteversion incompatible de la bibliothèque de compression ou fonctionnalité requises incompatible aveec cette bibliothèqueNom incomplet de jeu de données rencontré dans un en-tête de tranchedate de dernier changement de l'inode (ctime) plus récent, les Attributs Étendus peuvent être différentsdate de dernier changement de l'inode (ctime) plus récent, les FSA peuvent être différentschiffre décimal non valideL'argument fourni à l'option -; est un nombre invalide : %sIl semble qu'il y ait un bogue icijournalisédernierLe dernier caractère de la ligne de commande utilisateur à exécuter est '%', (utiliser '%%' à la place pour éviter ce message)libgcrypt n'a pas été initialisée et libdar n'est pas autorisé à le faireversion de libgcrypt < %s. Cette version de ligcrypt a un bug qui conduit les calculs de hash md5 et sha1 à être faux pour des fichiers plus grands que 256 Gio (gibioctet), voulez-vous vraiment perdre du temps à calculer ces hash inutiles ?la méthode listing() doit être fourniepetitlzocompression lzomoifusionné avec écrasement possiblemanque de données pour construireil manque des données pour construire un répertoireil manque des données pour construire un fichier spécialdonnées absentes pour construire une inodetube nommésuivantenonaucun Attribut Étendu avec lequel compareraucun Attribut Étendu avec lequel comparerpas de mise à jour de atimeaucun répertoire courant définiaucun répertoire courant défini pour la lecturedrapeau no dumppas d'ajout en finLa fonctionnalité --nodump n'a pas été activée lors de la compilation, cette option n'est donc pas disponibleaucunPas assez de mémoire pour écrire le tampon élastiquetailles différentes : %i <--> %inon dernierValeur nullptr donnée à tools_readlink()l'argument nullptr a été transmis à user_interaction_callback()écrasétube nomméfichier pleinprésentprésent le mot de passe fourni est trop grand pour la mémoire allouéeréactivation des gestionnaires de signaux et poursuite des opérations Fin de fichier atteinte alors que toutes les données n'ont pu être lueslecture et écriturelecture seulesupprimésupprimé supprimé de l'archiveremplacéla racine n'a pas de répertoire pèrela racine n'a pas de répertoire pèrela racine n'a pas de répertoire pèreLa racine de l'entrepot doit être une chemin absolu: sauvé inode sauvegardée : %i scrambling (chiffrement faible)deuxièmeLa requète de génération d'une chaîne sécurisée aléatoire dépasse sa capacité de stockagesuppression sécuriséeprise unixlien symboliquele lien symbolique ne pointe pas sur la même cible: lien symboliquerépertoire synchronemise à jour synchronesystem() a échoué : La fonctionnalité de fusion sans décompression/recompression n'est pas disponible avec des archives utilisant différents algorithmes de compression (Ce sera pour une prochaine version de dar). Vous pouvez cependant fusionner ces deux archives avec décompression/recompression et aurez probablement intérêt à compresser (option -z ou -y) l'archive résultanteTampon élastique trop grand ou de structure incohérentesommet de hiérarchie de répertoiresnombre total d'inode : %i vraile type %s n'est ni grand-boutiste ni petit-boutiste ! Impossible de savoir comment gérer ce type d'entier d'une manière portable sur ce système.valeur d'UID trop grande pour ce système pour que libdar puisse le restaurer correctementinsuppressibleprise unixFamille d'attributs FSA inconnue : compression inconnuealgorithme de compression inconnue : %Salgorithme de chiffrement inconnu : entrée inconnuetype de donnée inconnu dans le catalogueusage : %s usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] [options...] l'option -A est obligatoire quand -+ est utilisél'option -A est obligatoire quand -C est utiliséécriture seuleEcriture du tampon élastique terminal via la couche de chiffrement ...Mauvaise valeur donnée à "initial_size" lors de l'initialisation du cacheoui|Etat de signature| Etat de la clef | Emprunte de la clef | Date de signaturedar-2.5.3/po/ChangeLog0000644000175000017520000000073612642474463011424 000000000000002016-01-04 gettextize * Makefile.in.in: New file, from gettext-0.19.3. * Rules-quot: New file, from gettext-0.19.3. * boldquot.sed: New file, from gettext-0.19.3. * en@boldquot.header: New file, from gettext-0.19.3. * en@quot.header: New file, from gettext-0.19.3. * insert-header.sin: New file, from gettext-0.19.3. * quot.sed: New file, from gettext-0.19.3. * remove-potcdate.sin: New file, from gettext-0.19.3. * POTFILES.in: New file. dar-2.5.3/po/boldquot.sed0000644000175000017520000000033112642474463012167 00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g dar-2.5.3/po/insert-header.sin0000644000175000017520000000124012642474463013106 00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } dar-2.5.3/po/quot.sed0000644000175000017520000000023112642474463011325 00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g dar-2.5.3/po/en@quot.header0000644000175000017520000000226312642474463012434 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # dar-2.5.3/po/remove-potcdate.sin0000644000175000017520000000066012642474463013457 00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } dar-2.5.3/po/sv.gmo0000644000175000017520000040726412642474573011017 00000000000000Þ•ô¼Q\? T¡T°TÆT;ÖTU=+UiU €U¡U!£UÅU(ÈUñUù VÐW ÔWuX‘XG°X)øX7"Y;ZY1–Y?ÈYCZJLZO—ZCçZ2+[5^[@”[0Õ[.\-5\?c\<£\Hà\4)]K^]Eª]>ð]?/^Co^J³^9þ^O8_Aˆ_AÊ_H `;U`D‘`CÖ`#aF>a…a)£a$Ía'òa$bF?b8†b7¿b@÷b=8c>vcAµcB÷cC:d<~d:»d:öd,1e:^e;™e0Õe>fIEf)f¹f9Ôf+g7:g-rgB g9ãg)h&Gh nhPhLàhC-iGqi)¹i=ãi;!j ]jI~jJÈjBk.VkF…k+Ìk=øk*6l:alHœl#ål* mL4m:m¼m!Öm.ømK'n<sn'°nBØn%o@AoD‚oÇoQæo8p3Np2‚p+µp1áp8q.Lq!{q7qÕqìq-r*.rYrnr&†rA­rAïr31ses{s—s³sÏsës1t19tkt‡t£t¿t Ýtèt&u 'u1uDubu‰}u‹v6“vÊv_ßvY?wD™w)Þw&x8/x9hx;¢x<ÞxyK6y‚y8šy$Óy2øy8+zdzBzÄzáz2{3{M{?i{ ©{$µ{%Ú{5|76|n|4Ž|OÃ|/}/C}/s}#£}9Ç}=~I?~"‰~)¬~4Ö~ )HBl‹høja€Ì€cé€OM¬(J‚+s‚'Ÿ‚Ç‚2Þ‚Hƒ$ZƒIƒAɃU „Pa„Q²„1…X6…½…+M†"y†-œ†>ʆ5 ‡#?‡0c‡>”‡Ó‡ 퇈 -ˆ/Nˆ$~ˆK£ˆ@ïˆK0‰2|‰+¯‰:Û‰-Š'DŠ3lŠ Š>ºŠùŠ‹!,‹HN‹ —‹¸‹8À‹ù‹ŒG'Œ:oŒfªŒ91K}K›Lç%4Ž)ZŽ „Ž.¥Ž;ÔŽ+#< `•":Un%‰W¯‘<‘U‘!p‘*’‘=½‘*û‘5&’\’:u’"°’!Ó’.õ’$“=B“€“?™“/Ù“ ”#)”M”2i”œ”³”,Í”2ú”-•ŠD•HÏ•'–1@–#r–––L¬–Kù–FE—=Œ—OÊ—>˜Y˜3r˜2¦˜(Ù˜™™!/™Q™e™/‚™%²™(Ø™šš?-š&mšG”šÜšõš1 ›1;›%m›6“›%ʛ𛠜3œRœ%mœ.“œ-œðœ )%@f0}®&Í'ô ž@=ž!~ž% ž6Æžýž ŸŸ((Ÿ0QŸ*‚Ÿ3­Ÿ2០, -K +y "¥  È CÓ  ¡%¡,D¡q¡¡«¡7À¡ø¡H¢+Z¢N†¢Õ¢/æ¢3£µJ£5¤.6¤&e¤Œ¤6’¤Jɤ7¥@L¥¥F­¥+ô¥N ¦Jo¦º¦-Ó¦0§:2§am¨6Ϩ/©¤6©bÛ©¬>ªëª «=«%Z«*€«&««Ò«j`¬ˬë¬ ­N+­2z­m­­"®>>®}®‚®7ˆ®+À® ì®: ¯H¯$f¯9‹¯+ůñ¯!°?2°]r°kа*<±%g±±_ª±& ²21².d²“²­²)²ì²*³-³G³"d³#‡³Y«³$´%*´ P´6q´@¨´8é´*"µ/Mµ/}µ­µ?˵( ¶%4¶'Z¶!‚¶#¤¶;ȶ>·)C·)m· —·O¸·&¸//¸._¸)ޏ+¸¸Sä¸ç8¹- ºNºnº/Žº;¾ºúº»+.»Z»n»/ˆ»'¸»+à»D ¼Q¼"o¼’¼-°¼3Þ¼8½ K¾,W¾4„¾¹¾_Ù¾V9¿4¿Å¿"ä¿À—Àb§Àh ÁesÁ#ÙÁýÁÂ35ÂciÂ!ÍÂïÂÃÃ+Ã!EÃgÃKÃ'ÍÃõÃýÃÄA.ÄKpÄ+¼Ä"èÄ? ÅNKÅ9šÅ(ÔÅ$ýÅ"Æ>Æ*TÆÆC›Æ@߯B ÇIcÇ3­Ç@áÇ"È#3ÈWÈnÈÈÈ È*³ÈÞÈóÈ' É"4ÉWÉ#tɘɳÉÎÉéÉ Ê)ÊIÊiʉÊ,§ÊÔÊ)îÊ Ë÷#̩͡ÅÍgÎíøÎeæÏLÐæiÐŒPѺÝÑ÷˜ÒfÓ¡÷Ó™Ô&›ÕfÂÕ;)ÖweÖLÝÖ<*×úg×3bØK–Ø¬âØ¿Ù`OÚ?°ÚxðÚ¿iÛ?)Ü$iÜÆŽÜ3UÝc‰ÝHíÝŸ6ÞËÖÞÖ¢ß3yà]­à{ á^‡áæâCõâ;9ã!uã>—ã"Öãùã äP7ä]ˆäæä9å,>å$kå0å)Áåëå æ'æ>æ\æsæŠæ¡æ¿æÝæ*ôæç`:ç›çN»ç- è$8è]è'`è+ˆèL´è$é&é':ébéX€éÙéóé*ê9>ê+xê)¤êÎêfßêbFë¡©ë$Kì pì‘ì¯ì<Ãì í$ í+/í"[í~íƒí‰í¤íÂíàíþíîU:î%î¶îÔî,ïî5ï-Rï>€ïQ¿ï ð 2ðˆ<ð1Åð ÷ð#ñB)ñMlñDºñNÿñ@NòòªòEÉòEó3Uó1‰óI»ó1ô.7ô;fô!¢ôÄô*àô1 õ=õL[õ(¨õÑõåõùõ&ö:?özöA‹ö0ÍöþöQ÷‘k÷ý÷ø%+ø3Qø„…ø ù-+ùyYù3ÓùúA úOúƒoú*óú$ûYCûEûXãû<üSYü¤­ü9RýŒýO¬ý,üý)þ1Hþ1zþ$¬þ_ÑþY1ÿr‹ÿVþÿ[UJ±\ü…YQßF1Ex?¾<þ§;Ìã+°EÜ-"ÊP?=[W™yñIk?µ;õ!1vSšÊ9e +Ÿ >Ë ' L2 & $¦ ÓË QŸ ñ 5  > "_ .‚ ± !É !ë ! / AN : Ë Û ì Å"è;*A!l,Ž"»*Þ& +0-\Šž ½#Þ)+,+XL„VÑO(}xMöD}XÜÖ5³Cé]-I‹‰Õx_.Ø#+./ ^ h r|•¥­ÍÓÚ&ã)  4XU*®Ù Ý"ê 77K2ƒ ¶9Âü#:W<f<£*à  +92X0‹¼Ú!î' 8 Yc }4ˆ#½á+è**? jxO~ÎÓå4ý62i|J›'æ' &6 -] 0‹ =¼ ú $!5!O!9T!Ž!­!´!¸!È! Ë!ì!&")" H"S"X"%["&"¨"$Å"Xê"C#4H#}#—# Ÿ# «#¶#¾#6Ç#/þ#:.$i$ x$‚$Š$“$¬$&µ$%Ü$%%(%D% K%1U%‡%Bž%?á&!'w='Oµ' ((!%(!G( i(!w("™(P¼(& )&4) [)Cf)ª)à®)+ž+»+JË+,H0,y,-‘,¿,Á,Þ,,á,- $-ò0.´#/Ø/#ó/I0*a06Œ08Ã04ü0:11>l1^«1Y 2Cd24¨25Ý2L35`3*–3(Á33ê354LT4<¡4MÞ4L,59y59³5Lí5>:6My6QÇ697HS7Hœ79å7C8Gc8(«8MÔ8$"9/G9#w9$›9!À9Oâ992:7l:L¤:Nñ:E@;@†;7Ç;Dÿ;7D<I|<BÆ<5 =H?=Bˆ=2Ë=Lþ=GK>>“>Ò>2ë>6?;U?(‘?9º?;ô?'0@%X@"~@k¡@j AHxACÁA$B6*B7aB™Bd¹BcC[‚C6ÞCHD1^DCD0ÔD/EA5E"wE/šEIÊE3FHF#fF3ŠFV¾FBG&XG=G1½G@ïGI0HzHQ™H!ëH2 I7@I0xI7©IEáI4'J$\JQJÓJñJ0K68K oKK&¬KCÓKAL4YLŽLL¹LÕLñL M4*M2_M’M®MËMçMN%N7=NuN|N"’NµNÔN’bOBõO8PmOP`½PPQ%oQ%•QJ»QJRMQRMŸRíRR S^S5~S%´S<ÚS7TOTDoT´TÓT9óT -U"NUJqU¼U'ËU(óU8V8UV&ŽV6µVWìV/DW0tW0¥W#ÖW<úW=7XNuX#ÄX-èX;Y RYsYEYiÕYs?Zt³Z"([pK[\¼[£\1½\-ï\%]C]2^]J‘],Ü]L ^AV^d˜^Xý^eV_?¼_nü_Ïk`2;a)na+˜aAÄaHb-ObA}bA¿b c'"c"Jc*mc1˜c.ÊcWùcLQdWžd=ödA4eJve8Áe6úe21fdfHƒfÌf%çf7 gLEg’g­gB³göghQ#h;uhq±hB#i/fi%–iR¼iSj/cj“j ²j2Ój@k0Gk)xk$¢k‘ÇkYl xl ™l!ºl*ÜlXm `mGnm¶m&Ñm*ømA#n5en;›n×nMòn*@oko4†o»oIÛo%p8@p7yp#±p$ÕpúpKq`q|q4’q1Çqùq„rM—r!år9sAsasKusJÁsQ t2^tJ‘t>Ütu8:u;su'¯u×uñu v$v9v/Uv#…v(©vÒvêv?w#CwUgw½wÒw5æw/x-Lx=zx.¸xçxy@yXy9wy,±y7Þyz1zMz!hzŠz2¦zÙz)ùz'#{K{3i{#{#Á{>å{$| 5|A|2X|4‹|+À|9ì|9&}`}!w}&™}-À} î} ~F~c~r~*’~ ½~!Þ~5KIa5«Qá 3€7A€3y€Ô­€7‚+º#æ ‚-‚]>‚Lœ‚Ké‚ 5ƒIVƒ4 ƒLÕƒI"„l„.‹„-º„è„N†4P†1…†¦·†c^‡±Â‡ tˆ•ˆ/§ˆ)׈3‰'5‰•]‰nó‰ bŠƒŠ£ŠQÊ4‹hJ‹!³‹@Õ‹ŒŒ;!Œ*]Œ(ˆŒ@±Œ$òŒ,=D.‚±$ÑHöb?Žt¢Ž7(O!x|š+9C&}¤À4Û‘/-‘]‘!z‘#œ‘)À‘fê‘*Q’+|’¨’5È’Fþ’DE“-Š“5¸“1î“ ”D=”'‚” ª”&Ë”ò”%•C7•@{•&¼•*ã•–L+–$x–2–&Ж+÷–-#—SQ—饗-˜½˜!Ú˜2ü˜G/™w™!™,²™ß™ñ™5š,>š+kšL—šäš)øš"›.?›$n›_“› óœ*ÿœ4*_[}dÙF>ž"…ž(¨ž­Ñž ŸrŸp uq 1ç ¡3¡7M¡S…¡!Ù¡û¡¢&¢;¢"X¢!{¢t¢$£7£>£*P£M{£lÉ£$6¤([¤F„¤BˤE¥(T¥&}¥¤¥Ä¥.Û¥" ¦A-¦Do¦G´¦Jü¦NG§F–§ݧ"õ§¨.¨=¨M¨]¨+|¨¨¨¾¨Õ¨ õ¨©.1©`©"©"¢© Å©!æ© ª )ªJª!jª-Œªºª)Õªÿª¬–­ª«­V®ëÖ®n¯1°íN°™<±ÁÖ±:˜²aÓ³›5´Ñ´.ãµl¶I¶eɶ[/·&‹·è²·G›¸Vã¸Û:¹ÅºYܺ<6»ls»¡à»J‚¼%ͼ­ó¼?¡½€á½bb¾–ž³\¿ëÀSüÀtPÁ¤ÅÁEj °ÃF¼Ã:Ä!>ÄH`Ä'©ÄÑÄ#ïÄLÅh`Å#ÉÅ<íÅ!*ÆLÆ1fÆ*˜ÆÃÆ!߯Ç"Ç<ÇTÇlÇ"„Ç"§ÇÊÇ)âÇ Èj"È$ÈO²È.É1ÉKÉ"OÉ-rÉS É#ôÉÊ)+Ê%UÊQ{Ê"ÍÊ$ðÊ0Ë;FË0‚Ë%³ËÙËsîËjb̯ÍÌ*}Í"¨ÍËÍêÍ4Î 6Î"@Î;cÎ&ŸÎÆÎËÎÑÎ&îÎ&Ï&<Ï&cÏ&ŠÏY±Ï Ð+ÐIÐ(fÐ=Ð0ÍÐIþÐPHÑ™Ñ ·Ñ{ÄÑ7@Ò xÒ"„ÒK§ÒNóÒDBÓJ‡ÓLÒÓÔ9ÔKQÔBÔ-àÔ*ÕH9Õ1‚Õ5´Õ-êÕ(ÖAÖ2ZÖ6ÖÄÖOÙÖ%)×O×c×w×”×3´×è×Gø×2@ØsØ[’Ø¡îØÙ¨Ù4ÂÙ:÷Ù†2Ú"¹Ú2ÜÚvÛ.†ÛµÛX¼ÛÜ„4Ü(¹Ü*âÜe ÝlsÝ_àÝ#@ÞSdÞŸ¸ÞAXß#šßU¾ß(à=à1Wà1‰à#»àxßàWXáf°ádâm|âIêâ\4ã—‘ã`)äKŠäKÖäB"å@e弦åøcæ)\çH†ç'Ïçð÷çIèèP2ébƒécæéfJê9±ê6ëê%"ë~Hë´ÇëB|ì'¿ì>çì.&ísUí#Éí ííÑîOàî0ï0Aïrïï,°ïÝï"ðï"ð"6ðYðGyð8Áð úð ññ.ñÄIñò9'ò(aòŠò+©ò&Õò/üò+,ó)Xó+‚ó®ó½óÖó!öó*ô,Cô(pôN™ôièô`Rõ—³õ^Kö ªöy¶÷ù0ø:*ù7eù[ùKùù—EúxÝú1Vû*ˆû³û:¶û ñû ûû üü*ü2ü:ü'Cükü rüü(Žü)·ü*áüp ý,}ýªý ¯ý&ºýáý;çý9#þ3]þ ‘þ@þÞþ%üþ!"ÿDÿ@Sÿ@”ÿ$Õÿ!úÿ"1.T/ƒ³ ÌÙ"ø;@ W3c,—Ä-É-÷5% [iXqÊÏâ1B3v †V§,þ,++XF„@ËC P)f­H³ü 1'5]*x"£ ÆÒÙ)Ý)1!OdqÖDÜ!@ I V ` j<w3´4è ,  <  F P h "o "’ µ Ò Û ÷  ý ) 2 dP Mµ  y X—  ð ü   1 L ] !v \˜ 0õ 0&WHh±ñe¢-Ê_ Êgõ”Î5þïRçܳ´Ý|yd¿£‡Øûý’×úÙ²¡!×9«¾Ð Ä·ãKè×±3NÓN¤}ÒByœ4é£1»5I1ˆuÐO5óÇ3ÃNr‹ß`(:s gô™Á—¢«ô·o•ÄM‡Ç¯#Ú)wPæaÅ!Š‘¹ x¶¸ZV ©¤Ðä âêÆ[øyJ%äц ¡μziÀ­qq”ìÓÛš=+º^æEQÕ‘ÎÉü,·q_⎳d›]+—÷ófÖ–XTƒ£ÒK祚#ý$sÕÐ>â6ÀµP”f]æmÄaŒ¥A€r€±j(ô.“ÔGÖÈ‚YiùYü–¢CIÿ0_ÙÀ4(àè$¡Ç®œ7sÃt ä§ÆWàÔwFðá¬ó/U&&E 0Uhh˜vîž <ë˜èJñ“!Np6Ö¼Ê) MFšH"Û'~ÀÆ'ÉØ7†}CdCXYV¼ˆWÁ±ºzXQÍ æR¹è3%Î{cfŒÛ…@¶S9å•уOÏ´ëöš‡‰…§Ì\nÈ™Keu‘C)=LTã÷ žŸÜ"2x¬Aªct겨6%hD,Ë,Å­§òÇé™lž.'?•äIOâBÌ µ‚^Móœðíb^Ë ‰Ó9A–w„Ï;û Ãß,¾\ž\«h׋忯|kݟݪkïM3„SõÙ:˜Š=~ŒªíV‡LÔ˜½jѦ~†›Oƒí>k  ÜÂÈ[‹o;ŒÕÏ]0ˆv™>¯ø’ïn ¦RuíL¦à/©8GZmÉ_ ŠßA vr뻉°ò¿i|S„¸÷þ7@}ùm½2Ìaù@P«öb“µx ¨0ÁÂvî£+‘¿ƒ¦Flô.7EŸ¨Ù½-=ºì;›¯ÌºÊ³*Gáp®¹*Æqk“Q³êz¸d§–Ýÿ¬ÍB¡¾`ˆ—cÚßþjEc*Zz:#Þx¤‚>-îî6ÓFÈy(`µ*»­ï+{·ðàPaKSg‹’1éÚÞ?± ÿW õ'$½{$2„˪Š:p\%¾iû4Ž[ì`&Ö²I-»ú pDoì²”l1øáÍ^öØU WÁ8LD¶­Õ.J´ZbýH[Uò#ËuÛ"Ò{ëGÂn8w;•ÃÏÞ®H<<gé~]ÍBŸeÒŽ€?/"l¬®Düò|ç‚ …ñ<Ž¥V}/tÑY5)H‰¼—Éåå’Üj¶9Q©°oTJ&¨†Rb¤r¹XÞ›ãs°Å?fã!T…©úØtm¥e2¢ênİ@´Åñ€Úá¸Â8Ô4œçð Standard extraction time ownership the first non options argument is the archive to read the provided file. the second non option argument is the archive to create No pause in output Pause each %d line of output Executing batch file line: %S Dar Manager Database used [%s] : %S CATALOGUE CONTENTS : WARNING! This archive only contains the contents of another archive, it can only be used as reference for differential backup or as rescue in case of corruption of the original archive's content. You cannot restore any data from this archive alone Your decision about file's EA: [p]reserve [o]verwrite mark [s]aved and preserve mark saved and overwri[t]e [m]erge EA and preserve merge EA a[n]d overwrite [r]emove [*] keep undefined [a]bort Your choice? Your decision about file's data: [P]reserve [O]verwrite mark [S]aved and preserve mark saved and overwri[T]e [R]emove [*] keep undefined [A]bort Your Choice? Extended Attribute: [ including %i hard link(s) %i file(s) have been record as destroyed since backup of reference -# encryption block size -$ encryption key for auxiliary archive -* same as -# but for archive of reference -+ merge two archives / create a sub archive -, ignore directories that follow the Directory Tagging --nodump do not backup, files having the nodump 'd' flag set -/ which way dar can overwrite files at archive merging or -@ [path/] Do on-fly catalogue isolation of the resulting archive -@ [path/] auxiliary archive of reference for merging -A add an archive to the database -A [path/] archive to take as reference -B specify the database to use (read or modify) -B read options from given file -C isolates the catalogue from an archive -C creates an empty database -D excluded directories are stored as empty directories -D delete an archive from the database -E command line to execute between slices of the archive -E command to execute between slices -E command to execute between slices of destination archive -F command to execute between slice of source archive -F same as -E but for the archive of reference -H [N] ignore shift in dates of an exact number of hours -I files to include in the operation (all by default) -J same as -K but it does concern the archive of reference -K use as key to encrypt/decrypt -L execute on a given database a batch of action as defined by -M stay in the same filesystem while scanning directories -N do not read ~/.darrc nor /etc/darrc configuration file -O[ignore-owner | mtime | inode-type] do not consider user and group -P subdirectory to exclude from the operation -Q suppress the initial warning when not launched from a tty -R filesystem root directory (current dir by default) -S first file size -S first file size (if different from following ones) -T tree output format -U mask to allow certain EA -V displays software version -V displays version information -V displays version information -X files to exclude from the operation (none by default) -Y do only compress the matching filenames -Z do not compress the matching filenames -[ filename contains a list of files to include -] filename contains a list of files to exclude -^ permission[:user[:group]] of created slices -aSI slice size suffixes k, M, T, G, etc. are power of 10 -aa do not try to preserve atime of file open for reading. -abinary slice size suffixes k, M, T, G, etc. are power of 2 -ac do not try to preserve ctime (default behavior). -acase the masks that follow are now case sensitive -ag set the following masks to be glob expressions -am set ordered mode for all filters -an the masks that follow are now case insensitive -ar set the following masks to be regex expressions -as only list files saved in the archive -b ring the terminal bell when user action is required -b change the basename to use for the give archive number -c check database for dates order -c creates an archive -d compares the archive with the existing filesystem -d specify the path to dar -e dry run, fake execution, nothing is produced -f do not restore directory structure -f list the archives where the given file is present -g subdirectory to include in the operation -h displays this help information -h displays this help information -i user interactive mode -i pipe to use instead of std input to read data from dar_slave -i pipe to use instead of std input to read orders from dar -k do not remove files destroyed since the reference backup -l gives information about the archive compiled in the database -l lists the contents of the archive -m do not compress file smaller than -m move an archive within a given database. -n don't overwrite files -o pipe to use instead of std output to orders dar_slave -o pipe to use instead of std output to write data to dar -o specify a list of option to always pass to dar -p pauses before writing to a new file -p change the path to use for the given archive number -q suppress final statistics report -r do not restore file older than those on filesystem -r restores the given files -s shows the number of most recent file by archive -s split the archive in several files of size -t tests the archive integrity -u mask to ignore certain EA -u list the most recent files contained in the given archive -v display more information about what is going on -v verbose output -vs display skipped files -w don't warn before overwriting files -w only with -r, restores in state just before the given date -wa don't warn before overwriting and removing files -x extracts files from the archive -~ command between slices of the auxiliary archive including %i hard link(s) treated archive # | most recent/total data | most recent/total EA %i byte(s) have been wasted in the archive to resave changing files %i inode(s) added to archive %i inode(s) changed at the moment of the backup and could not be saved properly %i inode(s) deleted %i inode(s) failed to be saved (filesystem error) %i inode(s) failed to restore (filesystem error) %i inode(s) ignored (excluded by filters) %i inode(s) not restored (not saved in archive) %i inode(s) not restored (overwriting policy decision) %i inode(s) not saved (no inode/file change) %i inode(s) recorded as deleted %i inode(s) recorded as deleted from reference backup %i inode(s) restored %i inode(s) saved %i item(s) do not match those on filesystem %i item(s) ignored (excluded by filters) %i item(s) treated %i item(s) with error %s comes with ABSOLUTELY NO WARRANTY; %s comes with ABSOLUTELY NO WARRANTY; for details type `%s -W'. %s comes with ABSOLUTELY NO WARRANTY; for details type `dar -W'. %s is part of the Disk ARchive suite (Release %s) , please provide it. - Door entries : %i - block devices : %i - character devices : %i - directories : %i - named pipes : %i - number of inode with hard link : %i - number of reference to hard linked inodes: %i - plain files : %i - symbolic links : %i - unix sockets : %i . Ignoring file or directory . Retry ? . Retry command-line ? . Retry to launch dar as previously ? Choice: Continue anyway ? EA restored for %i inode(s) EA saved for %i inode(s) IF POSSIBLE TRY TO PRODUCE THIS ERROR, A SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH IN SOLVING THIS PROBLEM. THANKS IF POSSIBLE TRY TO REPRODUCE THIS ERROR, A SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH IN SOLVING THIS PROBLEM. THANKS Only one option of -c -d -t -l -C -x or -+ is allowed Ready to continue ? THANKS TO REPORT THE PREVIOUS OUTPUT TO MAINTAINER GIVING A DESCRIPTION OF THE CIRCUMSTANCES. This is free software, and you are welcome to redistribute it under certain conditions; This is free software, and you are welcome to redistribute it under Total number of inode(s) considered: %i Total number of items considered: %i Using libdar %u.%u built with compilation time options: Using libdar %u.%u built with compilation time options: Using libdar %u.%u.%u built with compilation time options: Using libdar %u.%u.%u built with compilation time options: [return = YES | Esc = NO] a : Save as n : pause each 'n' line (zero for no pause) c : check date order certain conditions; type `dar -L | more' for details. compiled the %s with %s version %s d : path to dar o : options to dar f : give file localization m : modify archive order for details type `dar -W'. is a slice from another backup, please provide the correct slice. is about to be overwritten. is not present in the archive l : list database contents A : Add an archive not merged (user choice) not restored (user choice) p : modify path of archives b : modify basename of archives q : quit type `%s -L | more' for details. type `dar -L | more' for details. u : list archive contents D : Remove an archive w : write changes to file s : database statistics with %i hard link(s) recorded "-k" (or "-kignore") and "-konly" are not compatible"first_file_size" cannot be different from zero if "file_size" is equal to zero# E X I T I N G ! ## NOT CAUGHT EXCEPTION, ## UNEXPECTED EXCEPTION, #%S [%c] [ REMOVED ENTRY ] (%S) %S %S already exists, and overwritten is forbidden, aborting%S did not exist before specified date and cannot be restored%S is about to be deleted (required by overwriting policy), do you agree?%S is about to be overwritten, OK?%S is about to be overwritten, continue ?%S is about to be removed from filesystem, continue?%S is an not a valid path: %S%S is not a valid number%S must be removed, but does not match expected type, remove it anyway ?%S: Overwriting policy (Data) is undefined for that file, do not know whether overwriting is allowed or not!%S: Overwriting policy (Data) is undefined for that file, do not know whether removal is allowed or not!%S: Overwriting policy (EA) is undefined for that file, do not know whether overwriting is allowed or not!%d is not a valid block size%d is the default value for --sparse-file-min-size, no need to specify it on command line, ignoring%d is the default value for -m, no need to specify it on command line, ignoring%s does not name a compression "[algorithm][:][level]" , like for examples "gzip", "lzo", "bzip2", "lzo:3", "gzip:2", "8" or "1". Please review the man page about -z option%s type is not a signed type as expected%s type is not an unsigned type as expected%s type length is not %d byte(s) but %d, ready to continue ? -$ is only available with -+ option and -c options-$ is only useful with -@ option, for the auxiliary archive of reference-%% is only available with -+ option-%% is only useful with -@ option, for the auxiliary archive of reference--------------+-------------------------+----------------------- --nodump feature has not been activated at compilation time, it is thus not available--sparse-file-min-size only available while saving or merging archives, ignoring-. option is only useful when merging, creating or isolating an archive, ignoring-/ option is only useful with -+ option, ignoring-= option is valid only while saving files, thus in conjunction with -c option, ignoring-= option will be ignored as it is useless if you do not specify to which files or directories this backup hook is to be applied, thanks to -< and -> options. See man page for more details.-@ is only available with -+ and -c options-A option is not available with -l-B option cannot be given inside a batch file-F is only useful with -A option, for the archive of reference-H is only useful with -A option when making a backup-H is only useful with -c, -d or -x-H is only useful with -r option when extracting-J is only useful with -A option, for the archive of reference-M is only useful with -c-S option requires the use of -s-a option requires an argument-ac is only useful with -c or -d-af must be present before -A option not after!-af option is only available with -c-af option need not be specified more than once, ignoring extra -af options-ak is only available while merging (operation -+), ignoring -ak-ak option need not be specified more than once, ignoring extra -ak options-as is only available with -l, ignoring -as option-e is only useful with -x, -c or -+ options-e option is only available when using -r option, aborting-f in only available with -x option, ignoring-k option is only useful with -x option-konly and -kignore cannot be used at the same time-m is only useful with -c-o is mandatory when using "-A -" with "-c -" "-C -" or "-+ -"-r is useless with -n-w option is useless with -n-wa is only useful with -x option-~ is only useful with -@ option, for the auxiliary archive of reference: file not present in filesystemA problem occurred while reading this archive contents: Aborting batch operation: Aborting program. Aborting program. An error occurred concerning user command execution: Aborting program. An error occurred while calling libdar: Aborting program. The requested operation needs a feature that has been disabled at compilation time: Aborting program. User refused to continue while asking: Absolute value too high for an archive number: %dAdding Hard link to archive: Adding an explicit escape sequence of type seqt_not_a_sequence is forbiddenAdding reference to files that have been destroyed since reference backup...All files asked could not be restoredAll layers have been created successfullyArchive %S requires a password: Archive assignment operator is not implementedArchive basename (or extracted catalogue basename) to add: Archive copy constructor is not implementedArchive delayed termination engagedArchive fast termination engagedArchive format older than "08" (release 2.4.0) cannot be read through a single pipe. It only can be read using dar_slave or normal plain file (slice)Archive is composed of %i file(s) Archive number to modify: Archive number to move: Archive number to remove: Archive number who's path to modify: Archive number | Data | status || EA | status Archive number: Archive on stdout is not compatible with slicing (-s option)Archive size is: %i bytes Archive total size is : %i bytes Archive version format : %s Archive version too high, use a more recent version of libdarAre you sure to remove archive number %d ?Argument given to -H is not a positive integer numberArguments read from %S :Arguments to -r must be relative path (never begin by '/')Asking for an element out of arrayBad CRC, data corruption occurredBad answer from peer, while closing connectionBad formatted date expressionBadly formatted SAR header (unknown TLV type in slice header)Badly formatted databaseBadly formatted terminator, cannot extract catalogue location: Badly formed "infinint" or not supported formatCAUGHT A NON (LIB)DAR EXCEPTIONCRC error detected while reading EACRC error: data corruption.CRC failed for table of contents (aka "catalogue")Can't read saved data.Cancellation no confirmedCannot add another archive, database is fullCannot allocate memory for buffer while reading %SCannot block signals: Cannot cleanly abort the operation, thread-safe support is missing, will thus abruptly stop the program, generated archive may be unusableCannot compare EA: EA support has not been activated at compilation timeCannot compare files in write only modeCannot copy a wrapperlib object (NOT IMPLEMENTED)Cannot create database, file existsCannot create inode: Cannot evaluate this crit_and criterium as no criterium has been added to itCannot evaluate this crit_or criterium as no criterium has been added to itCannot extract from the internal catalogue the list of files to removeCannot get catalogue of reference as it has not been providedCannot get data name of the archive, this archive is not completely initializedCannot get ext2 attributes (and nodump flag value) for %S : %sCannot get file size: %sCannot get full path of current working directory: Cannot get inode information about file to remove Cannot get inode information for %s : %sCannot get mtime: %sCannot open catalogue: Cannot open destination file : %sCannot open file : Cannot open source file : %sCannot read arguments on command line, abortingCannot read directory contents: %s : Cannot read file information for %s : %sCannot read inode for Cannot read on inputCannot receive that much data in regard to the allocated memoryCannot recurs in a non directory entryCannot reduce the string to a size that is larger than its current sizeCannot remove directory Cannot remove file Cannot remove non-existent file from filesystem: Cannot remove nonexistent entry %S from catalogueCannot restore any file, nothing doneCannot restore file %S : non existent file in databaseCannot restore permissions of %s : %sCannot seek back one charCannot seek in fileCannot set last access and last modification time: Cannot skip at end of fileCannot skip forward to restore a holeCannot skip to the current position in "tronc"Cannot sync write on a read-only generic_fileCannot unblock signals: Cannot write down the archive: Cannot write on outputCannot write to destination, abortingCannot write to outputCatalogue size in archive : %i bytes Caught a none libdar exceptionCaught an unknown Egeneric exception: Changing database header information...Changing database information...Checking chronological ordering of files between the archives...Checking file's dates ordering...Choose only one compression algorithmClearing file's EA (requested by overwriting policy): Commands are: Commands: Common options: Communication problem with peer, retry ?Compressing and writing back database to file...Compression algorithm used : %S Compression level must be between 1 and 9, includedCompression_level must be between 1 and 9 includedComputing statistics...Considering cyphering layer...Considering the (first) archive of reference:Consistency check failed for archive headerContinue listing archive contents?Continue? Continuing the action under process which is to exit... so we exit!Continuing...Copied data does not match CRCCopy finished. Missing %.0f byte(s) of data Corrupted data read from pipeCorrupted data read on pipeCorrupted database :Corrupted entry following an escape mark in the archiveCould not create inode: Could not open directory %s in furtive read mode (%s), using normal modeCould not restore original file ownership: Could read a catalogue data structure at offset %i, it contains the following:Creating file...Crypto block size must be greater than 10 bytesCurrent Working Directory cannot be a relative pathCurrent implementation of blowfish encryption is not compatible with old (weak) implementation, use dar-2.3.x software (or other software based on libdar-4.4.x) to read this archiveCyphering algorithm not available in libgcrypt: %s/%sDAR sub-process has terminated with exit code DAR terminated upon signal reception: DIFF Data corruption may have occurred, cannot decrypt dataData corruption met at end of slice, forbidden flag found at this positionData corruption met at end of slice, unknown flag foundData corruption or unknown sparse_file mark found in file's dataData full saved : %S %SData of file %S from first archive has been preserved from overwritingData of file %S is about to be %S, proceed?Data of file %S taken from the first archive of reference has been overwrittenData of file %S taken from the first archive of reference has been removedData should be read-onlyDatabase has been successfully created empty.Database not saved, Do you really want to quit ?Dates are not increasing for all files when database's archive number grows, working with this database may lead to improper file's restored version. Please reorder the archive within the database in the way that the older is the first archive and so on up to the most recent archive being the last of the databaseDates of file's %S are not increasing when database's archive number grows. Concerned file is: %SDecompressing and loading database header to memory...Decompressing and loading database to memory...Decremental mode is useless when merging is not applied to both an archive of reference and an auxiliary archive of reference. Ignore decremental mode and continue?Detected Cache Directory Tagging Standard for %s, the contents of that directory will not be savedDirectory %S cannot be restored: overwriting not allowed and a non-directory inode of that name already exists, all files in that directory will be skipped for restoration:Dirty file : %S %SDivision by zeroDo you want to ignore the same type of error for other files?EA for %S are about to be merged, OK?EA for %S are about to be overwritten, OK?EA for %S are about to be removed, OK?EA for %S have not been cleared as requested by the overwriting policy because this file is a hard link pointing to an already restored inodeEA for %S have not been overwritten because this file is a hard link pointing to an already restored inodeEA full saved : %S %SEA more recent : %S %SEA number : %i %iEA of file %S from first archive have been dropped and marked as already savedEA of file %S from first archive have been removedEA of file %S from first archive have been updated with those of the same named file of the auxiliary archiveEA of file %S has been overwrittenEA of file %S has been overwritten and marked as already savedERR ERR Empty string as subdirectory does not make a valid pathEmpty string is an invalid archive basenameEmpty string is not a valid pathEnter each argument line by line, press return at the end Entry information CRC failureEntry information CRC failure for %SEntry information CRC failure for %S. Ignore the failure?Entry information: "in place" "to be added"Entry type : %s %sError creating Unix socket file: Error creating hard link %s : %s Trying to duplicate the inodeError creating hard link : %s , the inode to link with [ %s ] has disappeared, re-creating itError creating hard link : %s , the inode to link with [ %s ] is not present, cannot restore this hard linkError during user command line execution: Error getting file reading position: Error getting size of file: Error met while opening the last slice: %S. Trying to open the archive using the first slice...Error met while processing operation: Error met while reading line %S from file %S: %SError opening directory in furtive read mode: Error opening directory: Error opening pipe: Error performing the requested action: %SError reading EA for Error reading attribute %s of file %s : %sError reading character: Error reading database %S : Error reading directory contents: Error reading inode of file %s : %sError reading source file (we are at %.2f %% of data copied), trying to read further: %s Error retrieving EA list for %s : %sError saving Extended Attributes for Error transforming the archive :Error while activating libgcrypt's memory guard: %s/%sError while assigning key to libgcrypt key handle (essiv): %s/%sError while assigning key to libgcrypt key handle: %s/%sError while calling fork() to launch dar: Error while changing user terminal properties: Error while comparing archive with filesystem: Error while considering file Error while converting UID/GID to string for backup hook file: Error while creating ESSIV handle: %s/%sError while creating anonymous pipe: Error while creating hash handle: %s/%sError while cyphering data: %s/%sError while decyphering data: %s/%sError while derivating key from password (HMAC open): %s/%sError while derivating key from password (HMAC set key): %s/%sError while fetching archive properties: Error while fetching information for %S: Error while generating IV: %s/%sError while initializing hash: Hash algorithm not available in libgcrypt: %s/%sError while listing archive contents: Error while opening libgcrypt key handle: %s/%sError while opening the archive of reference: Error while parsing --min-digits option: Error while parsing -A argument as a date: Error while reading CRC for EA from the archive: No escape mark found for that fileError while reading archive's header, this may be because this archive is an old encrypted archive or that data corruption took place, Assuming it is an old archive, we have to read the header at the beginning of the first slice...Error while reading data for a secure memory:Error while reading from file: Error while reading from pipe: Error while reading user answer from terminal: Error while resetting encryption key for a new block: %s/%sError while restoring Error while restoring data: Error while restoring the following files: Error while saving Error while saving data: Error while setting IV for current block: %s/%sError while setting file permission: %sError while setting file user ownership: %sError while telling libgcrypt that initialization is finished: %s/%sError while testing archive: Error while writing data to pipe: Error while writing to file: Error! SHA1 not available in libgcrypt: %s/%sError, catalogue of reference has not been providedEscape sequences used for reading lead the archive to place some files out of the specified root. To overcome this problem, try reading the archive in direct mode (not using sequential reading), try repairing the archive using Parchive if redundancy data has been created or in last resort try using the lax modeEscaping...Existing EA for %S could not be preserved : Existing EA for %S could not be read and preserved: FATAL error, aborting operationFailed opening the cache layer, lack of memory, archive read performances will not be optimizedFailed retrieving from libgcrypt the block size used by the cyphering algorithm: %s/%sFailed to open %S while checking for nodump flag: %sFailed writing down the hash: Fatal error on user command line: File %S has changed during backup and is probably not saved in a valid state ("dirty file"), do you want to consider it for restoration anyway?File %S line %dFile had changed during backup and had been copied another time, restoring the next copy of file: File has disappeared while we were reading it, cannot check whether it has changed during its backup: %SFile inclusion loop detected. The file %s includes itself directly or through other files (-B option)File mode is neither read nor writeFile must be a directory: File not found in database: File recorded as removed at this date in database: File selection has been aborted. Now building the resulting archive with the already selected filesFile size : %i bytes File size too smallFile size: %i bytes File to look for: Finished writing to file First file size : %i bytes First file size too smallFirst slice size is too small to even just be able to drop the slice headerFormatting file as an empty database...Found 'Furtive read modeGiven date must be in the pastGiving -S option the same value as the one given to -s is uselessGiving to -S option the same value as the one given to -s option is uselessHard links of directories are not supportedHow much line to display at once: INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINERIf you really want to abort the archive creation hit CTRL-C, then press enter.Ignore previous error on user command line and continue ?Ignoring extra arguments on command lineIgnoring file with NODUMP flag set: Ignoring unknown option -%cIn included file %S: In which position to insert this archive: Incoherent answer from peerIncoherent catalogue structure: duplicated hard linked inode's dataIncoherent catalogue structure: hard linked data is not an inodeIncoherent catalogue structure: hard linked inode's data not foundIncoherent catalogue structure: unknown status flag for hard linked inodeIncoherent slice header: First slice size too smallIncoherent structure in data carrying sparse files: unknown markIncomplete labelIncorrect archive range in databaseIncorrect day of monthIncorrect minuteIncorrect monthIncorrect secondIndex out of rangeInitialization problem for liblzo2 libraryInput cannot be readInvalid archive number: Invalid argument as destination archiveInvalid argument as source archiveInvalid number in string: %SInvalid path, path must be relativeInvalid size for CRC widthInvalid size for option -SInvalid size for option -sIs directory : %S %SIs hard linked : %S %SIs inode : %S %SIs plain file : %S %SIterator does not point to dataKey cannot be an empty stringLAX MODE: "%S" is not a valid archive formatLAX MODE: %i %% remainingLAX MODE: %i is not a valid percent valueLAX MODE: Archive directory structure is corrupted, it would lead to place some files out of the specified root directory. Restoring different directory contents at the root not out of it, which will put files of different directories in the specified root directoryLAX MODE: Archive is flagged as having escape sequence (which is normal in recent archive versions). However if this is not expected, shall I assume a data corruption occurred in this field and that this flag should be ignored? (If unsure, refuse)LAX MODE: Archive seems to be ciphered, but you did not have provided any encryption algorithm, assuming data corruption and considering that the archive is not cipheredLAX MODE: Archive seems to be only an isolated catalogue (no data in it), Can I assume data corruption occurred and consider the archive as being a real archive?LAX MODE: Beginning search of the catalogue (from the end toward the beginning of the archive, on %i %% of its length), this may take a while...LAX MODE: CRC failed for catalogue, the archive contents is corrupted. This may even lead dar to see files in the archive that never existed, but this will most probably lead to other failures in restoring files. Shall we proceed anyway?LAX MODE: Cannot skip at the end of the archive! Using current position to start the catalogue searchLAX MODE: Caught exception: LAX MODE: Could not find a whole catalogue in the archive. If you have an isolated catalogue, stop here and use it as backup of the internal catalogue, else continue but be advised that all data will not be able to be retrieved...LAX MODE: Do you want to bypass some sanity checks and try again reading the archive contents (this may take some time, this may also fail)?LAX MODE: Do you want to try finding portions of the original catalogue if some remain (this may take even more time and in any case, it will only permit to recover some files, at most)?LAX MODE: Due to probable data corruption, dar could not determine the correct size of slices in this archive. For recent archive, this information is duplicated in each slice, do you want to try opening another slice to get this value if present?LAX MODE: Error met building a catalogue entry, skipping this entry and continuing. Skipped error is: LAX MODE: Escape sequence could not be found, it may have been corrupted or out of the scanned portion of the archive, trying to find the catalogue the other wayLAX MODE: Escape sequence seems present in this archive. I have thus two different methods, either I look for the escape sequence indicating the start of the catalogue or I try each position in turn in the hope it will not be data that look like a catalogueLAX MODE: Failed to read the catalogueLAX MODE: Failed to read the catalogue (0 bytes of the archive length asked to look for the catalogue)LAX MODE: Failed to read the catalogue (no data to inspect)LAX MODE: Good point! I could find the escape sequence marking the beginning of the catalogue, now trying to read it...LAX MODE: In spite of a the absence of a known slice size, continuing anywayLAX MODE: Please provide an strictly positive integer numberLAX MODE: Please provide the archive format: You can use the table at %s to find the archive format depending on the release version, (for example if this archive has been created using dar release 2.3.4 to 2.3.7 answer "6" without the quotes here): LAX MODE: Please provide the slice number to read: LAX MODE: Reached the end of the area to scan, FAILED to find any catalogueLAX MODE: Slice flag corrupted, but a slice of higher number has been seen, thus the header flag was surely not indicating this slice as the last of the archive. ContinuingLAX MODE: The catalogue (table of contents) usually takes a few percents of the archive at its end, which percentage do you want me to scan (answer by an *integer* number between 0 and 100)? LAX MODE: The end of the archive is corrupted, cannot get the archive contents (the "catalogue")LAX MODE: Trying to locate the escape sequence (safer choice) ?LAX MODE: Unexpected saved status for end of directory entry, assuming data corruption occurred, ignoring and continuingLAX MODE: Unknown compression algorithm used, assuming data corruption occurred. Please help me, answering with one of the following words "none", "gzip", "bzip2" or "lzo" at the next prompt:LAX MODE: Unknown data in slice header, ignoring and continuingLAX MODE: Using archive format "%d"?LAX MODE: catalogue label does not match archive label, as if it was an extracted catalogue, assuming data corruption occurred and fixing the catalogue to be considered an a plain internal catalogueLAX MODE: closing slice %i, header properly fetchedLAX MODE: first slice size is not possible to read, (lack of virtual memory?), continuing anyway...LAX MODE: first slice size is not possible to read, continuing anyway...LAX MODE: found unknown catalogue entry, assuming data corruption occurred, cannot read further the catalogue as I do not know the length of this type of entryLAX MODE: found unknown catalogue entry, assuming data corruption occurred. Skipping to the next entry, this may lead to improper directory structure being restored, if the corrupted data was a directoryLAX MODE: internal name of the slice leads dar to consider it is not member of the same archive. Assuming data corruption occurred and relying on the filename of this slice as proof of its membership to the archiveLAX MODE: opening slice %i to read its slice headerLAX MODE: slice size is not possible to read, (lack of virtual memory?), continuing anyway...LAX MODE: slices %i and %i are both recorded as last slice of the archive, keeping the higher number as the real last sliceLAX MODE: the requested sequential read mode relies on escape sequence which seem to be absent from this archive. Assuming data corruption occurred. However, if no data corruption occurred and thus no escape sequence are present in this archive, do not use sequential reading mode to explore this archive else you will just get nothing usable from itLack of MemoryLack of SECURED memory to achieve the operation, aborting operationLack of memory to achieve the operation, aborting operationLast file size : %i bytes Library used for blowfish encryption does not respect RFC 3962Listing options (to use with -l): Locating archive contents...Long options support : %s Looking in archives for requested files, classifying files archive by archive...Mask_list's prefix must be an absolute path or start with "" string for archive mergingMemory allocation failed : %sMissing -c -x -d -t -l -C -+ option, see `%S -h' for helpMissing [ after } in conditional statement: Missing ] in conditional statement: Missing archive basename, see -h option for helpMissing argument to --backup-hook-executeMissing argument to --hashMissing argument to --min-digitsMissing argument to -EMissing argument to -E optionMissing argument to -FMissing argument to -SMissing argument to -^Missing argument to -i optionMissing argument to -o optionMissing argument to -sMissing argument to command line, abortingMissing catalogue in file.Missing hashing algorithms support (which is part of strong encryption support, using libgcrypt)Missing parameter to option -%cMissing source or destination argument on command line, see -h option for helpMissing strong encryption support (libgcrypt)Missing } in conditional statement: NONO FILE IN THAT DIRECTORY CAN BE SAVED.NOT YET IMPLEMENTED FEATURE has been used: Negative number or zero not allowed when moving an archive inside a databaseNew basename for archive number %d: New database name: New path to give to archive number %d: No action specified, abortingNo backup file is present in %S for archive %S, please provide the last file of the set.No cyphering layer openedNo database specified, abortingNo exception allowed from libdar callbacksNo file in this directory will be considered for merging.No file in this directory will be restored.No mask in the list of mask to operate onNo problem foundNo space left for inode, you have the opportunity to make some room now. When done : can we continue ?No space left on device, you have the opportunity to make room now. When ready : can we continue ?No terminal found for user interaction. All questions will be assumed a negative answer (less destructive choice), which most of the time will abort the program.No user target found on command lineNon existent archive in databaseNon existent file in databaseNon existent file: Non fatal error while writing to destination file, retrying Not SavedNot a zero terminated string in fileNot enough data to initialize storage fieldNow performing on-fly isolation...OK OK OK, keeping %S as basenameOnly one -@ option is allowedOnly one -A option is allowedOnly one -R option is allowedOnly one -S option is allowedOnly one -s option is allowedOpening a pair of pipes to read the archive, expecting dar_slave at the other ends...Opening and reading the batch file...Opening construction layer...Opening cyphering layer...Opening escape sequence abstraction layer...Opening named pipe %S as input to read the archive...Opening standard input to read the archive...Opening the archive using the multi-slice abstraction layer...Opening the compression abstraction layer (compression algorithm used is none)...Opening the compression layer...Options: Overwriting not allowed while a slice of a previous archive with the same basename has been found in the %s directory, Operation abortedParse error on command line (or included files): Parse error: Partial request received, aborting Path to dar (empty string to use the default from PATH variable): Pipe's other end is not known, cannot close any filedescriptor pointing on itPipe's other end is not known, cannot provide a filedescriptor on itPlease answer by the character between brackets ('[' and ']') and press returnPlease check documentation or upgrade your software if availablePlease check your hardwarePlease confirm your password: Previous archive size does not include headers present in each slice Probable bug in liblzo2: lzo1x_*_compress returned unexpected code %dProgram has been aborted for the following reason: Reached End of File while reading archive versionReached End of File, no correct data could be found after the last error Reached end of file before all data could be readReached end of file while reading slice headerReached premature end of file while reading archive versionReading a write only generic_fileReading archive contents...Reading catalogue of the archive to add...Reading options (to use with -x, -d, -t, -l, -A) Reading the archive header...Reading the archive of reference from pipe or standard input is not possibleReady to start writing down the archive?Received signal: %dReceived signal: %sReceived unknown special orderRecording hard link into the archive: Reference storage of the iterator is empty or non existentRemoving file %sRemoving file (reason is file recorded as removed in archive): %SRemoving file (reason is overwriting policy): %SRemoving the dirty file %SReplacing %s in the -R option by the directory pointed to by this symbolic link: Resetting the sequential reading process of the archive contents while it is not finished, will make all data unread so far becoming inaccessibleRestoring file's EA: Restoring file's data: Restoring options (to use with -x) : Running batch file from a batch file is not allowedSANITY CHECK: AT LEAST ONE THREAD_CANCELLATION OBJECT HAS NOT BEEN DESTROYED AND REMAINS IN MEMORY WHILE THE PROGRAM REACHED ITS ENDSEEMS TO BE A HARDWARE PROBLEM: SKIPPED (hard link in sequential read mode): Same data but CRC value could not be verified because we did not guessed properly its width (sequential read restriction)Same data but stored CRC does not match the data!?!SavedSaving / Isolation / merging options (to use with -c, -C or -+): Saving Extended Attributes for Sequential read asked, but this archive is flagged to not have the necessary embedded escape sequences for that operation, abortingSequential reading marks : %s Size too large for an elastic bufferSkipping done (missing %.0f byte(s)), found correct data to read, continuing the copy... Slice size is too small to even just be able to drop the slice headerSlicing (-s option), is not compatible with archive on standard output ("-" as filename)Some file comparisons failedSome files are corrupted in the archive and it will not be possible to restore themSome files do not follow chronological order when archive index increases withing the database, this can lead dar_manager to restored a wrong version of these filesSorry, file size is unknown at this step of the program. Sparse file : %S %SSubtracting an "infinint" greater than the first, "infinint" cannot be negativeSyntax error in --retry-on-change argument: Syntax error in batch file: %SSyntax error in batch file: -C option not allowedSyntax error in batch file: -i option not allowedSyntax error in overwriting policy: The Cache Directory Tagging Standard is only useful while performing a backup, ignoring it hereThe archive %S is encrypted and no encryption cipher has been given, cannot open archive.The archive and the isolated catalogue do not correspond to the same data, they are thus incompatible between themThe basename '+' is reserved for special a purpose that has no meaning in this contextThe entry to recurs in does not exist, cannot add further entry to that absent subdirectoryThe following user comment will be placed in clear text in the archive: %SThe format version of the archive is too high for that software version, try reading anyway?The format version of this database is too high for that software version, use a more recent software to read or modify this databaseThe given path %s must be a directory (or symbolic link to an existing directory)The iterator is not indexing the object it has been asked to read fromThe iterator is not indexing the object it has been asked to write toThe iterator is not indexing the object it has been defined forThe iterator position is not inside the storage of referenceThe just restored file %S has been marked as dirty (sequential reading can only detect the dirty status after restoration), do we remove this just restored dirty file?The just restored file %S has been marked as dirty (sequential reading can only detect the dirty status after restoration), removing the just restored dirty file as it is asked to ignore this type of fileThe last file of the set is not present in The snapshot backup (-A +) is only available with -c option, ignoringThe two passwords are not identical. AbortingThis archive contains an isolated catalogue, it cannot be used for this operation. It can only be used as reference for a incremental/differential backup or as backup of the original archive's catalogueThis archive has slices and is not possible to read from a pipeThis archive is not exploitable, check documentation for moreThis archive is not exploitable, check the archive class usage in the API documentationThis archive is not single sliced, more data exists in the next slices but cannot be read from the current pipe, abortingThis is an old archive, it can only be opened starting by the first sliceThread cancellation requested, aborting as properly as possibleThread cancellation requested, aborting as soon as possibleTo terminate enter an empty line To use --sparse-file-min-size while merging archive, you need to use -ah option too, please check man page for detailsToo large block of compressed data: Either due to data corruption or current system limitation where SSIZE_MAX value implied smaller buffers than requiredToo many argument on command line, see -h option for helpToo much line in file %S (integer overflow)Too old version for libgcrypt, minimum required version is %s Tried to write out of size limited fileTwo different slices (%i and %i) are marked as the last slice of the backup!Unbalanced parenthesis in expression: Uncomplete answer received from peerUncompleted archive! Assuming it has been interrupted during the backup process. If an error has been reported just above, simply ignore it, this is about the file that was saved at the time of the interruption.Unexpected answer from slave, communication problem or bug may hang the operationUnexpected end of fileUnexpected error while waiting for dar to terminate: Unexpected exception from libdarUnexpected value found in databaseUnexpected value while reading archive versionUnknown TLV record typeUnknown argument given to -2 : %sUnknown argument given to -a : %sUnknown argument given to -k : %sUnknown argument given to -w: Unknown atomic operator, or atomic not allowed with an argument: Unknown character found while parsing conditional string: Unknown choice Unknown choice: Unknown crypto algorithmUnknown encryption algorithmUnknown entry found in slice header (type = %d), option not supported. The archive you are reading may have been generated by a more recent version of libdar, ignore this entry and continue anyway?Unknown escape sequence typeUnknown expression found while parsing conditional string: Unknown expression in overwriting policy: Unknown file type! file name is: Unknown header option in database, aborting Unknown macro %%%d in user commentUnknown parameter given to --hash option: Unknown parameter given to -a option: Unknown policy for EA '%c' in expression %SUnknown policy for data '%c' in expression %SUnknown record typeUnknown substitution string: %Unknown suffix [%c] in string %SUpdating database with catalogue...User Decision requested for EA of file %SUser Decision requested for data of file %SUser comment : %S User target named "%s" is not allowed (reserved word for conditional syntax)Using sequential reading mode for archive source is not possible for merging operationWARNING! File modified while reading it for backup, but no more retry allowed: WARNING! File modified while reading it for backup. No more retry for that file to not exceed the wasted byte limit. File is WARNING! File modified while reading it for backup. Performing retry %i of %iWARNING! The archive is located in the directory to backup, this may create an endless loop when the archive will try to save itself. You can either add -X "%S.*.%S" on the command line, or change the location of the archive (see -h for help). Do you really want to continue?WARNING! This is an isolated catalogue, no data or EA is present in this archive, only the catalogue structure can be checkedWARNING: support for secure memory was not available at compilation time, in case of heavy memory load, this may lead the password you are about to provide to be wrote to disk (swap space) in clear. You have been warned!Warning! No file in that directory will be restored: Warning! No file in this directory will be considered for merging: Warning, %S seems more to be a slice name than a base name. Do you want to replace it by %S ?Warning, are you sure you want to abort (please answer "%S" to confirm)? Warning, the archive %S has been encrypted. A wrong key is not possible to detect, it would cause DAR to report the archive as corrupted We have linked with an incompatible version of libdar. Expecting version %d.%d.x but having linked with version %d.%d.%dWhich is %.2f %% of the total amount of data Writing to a read only generic_fileYESZero is not a valid size for an elastic buffer[ ][ EA ][ Saved ][--- REMOVED ENTRY ----][DIRTY][InRef][Saved]a binary digit is either 0 or 1abortabsentabsent an empty string is an invalid argumentarchive # | path | basename argument must be a relative pathbackup hook feature (-<, -> or -= options) is only available when saving files, ignoringbadly structured inode: unknown inode flagbigblock deviceblowfish strong encryption supportbzip2can't read data CRC: No escape mark found for that filecannot evaluate an empty chain in an overwriting policycannot provide data from a "not saved" file objectchar devicecompressReset called but compressInit never called beforecompressed data CRC errorcompressed data corruption detectedcompressed data is corruptedcorrupted filedata corruption detected: Incoherence in LZO compressed datadata corruption detected: Too large block of compressed datadata has been cleaned, object is now emptydate before 1970 is not alloweddeleted entrydestroyed entries information devices have not the same major number: %d <--> %ddifference of last modification date: %S <--> %Sdifferent Extended Attributesdifferent file typedifferent owner (uid): %i <--> %idifferent owner group (gid): %i <--> %idifferent permission: %S <--> %Sdirectorydistribution of inode(s) door inodedropped from the archive and marked as already savedelastic buffer incoherent structureerror!execution of [ %S ] returned error code: %dexecve() failed. (process table is full ?)file exists, and DONT_ERASE option is set.file not openfirstgid value is too high for this system for libdar be able to restore it properlygziphard linked inodehard links information hide_file cannot be initialized with write-only fileignoring -O option, as it is useless in this situationin file %S line %Sincoherent catalogue structureincoherent data after escape sequence, cannot read internal data set labelincoherent endian between U_16 and U_32incoherent endian between U_16 and U_64incoherent endian between U_16 and U_Iincoherent slice header: Slice size too smallincomplete data set name found in a slice headerinode last change date (ctime) greater, EA might be differentinvalid decimal digitinvalid number give to -; option: %sit seems to be a bug herelastlibgcrypt not initialized and libdar not allowed to do solisting() method must be givenlittlelzolzo compressionmemerged with possible overwritingmissing data to buildmissing data to build a special devicemissing data to build an inodenamed pipenextnono Extended Attribute to compare withno Extended Attributes to compare withno current directory definedno current reading directory definednodump flag feature has not been activated at compilation time, it is thus not availablenonenot enough space provided to dump the elastic buffernot same size: %i <--> %inotlastoverwrittenplain filepresentpresent provided password is too long for the allocated memoryre-enabling all signal handlers and continuing reached End of File before all expected data could be readread and writeread onlyremovedremoved removed from the archivereplacedroot directory has no parent directoryroot does not have a parent directoryroot has no parent directorysaved saved inode : %i secondsoft linksymbolic link does not point to the same target: system() call failed: the "Keep file compressed" feature is not possible when merging two archives using different compression algorithms (This is for a future version of dar). You can still merge these two archives but without keeping file compressed (thus you will probably like to use compression (-z or -y options) for the resulting archivetoo large elastic buffer or elastic buffer incoherent structuretotal number of inode : %i type %s is neither big nor little endian! Do not know how to handle integer in a portable manner on this host, abortinguid value is too high for this system for libdar be able to restore it properlyunix socketunknown compressionunknown compression algorithm: %Sunknown cryptographic algorithm: unknown entryunknown type of data in catalogueusage : %s usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] [options...] with -+ option, -A option is mandatorywith -C option, -A option is mandatorywrite onlywrong value given as initial_size argument while initializing cacheyesProject-Id-Version: sv Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?group_id=65612MSGID_BUGS_ADDRESS =atid=511612 POT-Creation-Date: 2016-01-04 14:36+0100 PO-Revision-Date: 2012-04-15 11:28+0200 Last-Translator: Peter Landgren Language-Team: Swedish Language: sv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: Lokalize 1.0 Plural-Forms: nplurals=2; plural=(n != 1); Standard uthämtningstillfälle ägarskap det första icke alternativargumentet är det arkiv som skall läsas den lämnade filen. det andra icke alternativargumentet är det arkiv som skall skapas Ingen paus i utdata Gör en paus för var %d -te rad i utdata Utför batch-fil rad: %S Dar Manager Database använde [%s] : %S KATALOGINNEHÃ…LL : VARNING! Detta arkiv innehÃ¥ller bara innehÃ¥llet av ett annat arkiv, det kan endast användas som referense vid differentiell säkerhetskopiering eller som räddning vid förstört innehÃ¥ll i originalarkivet. Du kan Ã¥terställa alla data frÃ¥n detta arkiv ensamt ditt beslut om filens EA: [p] bevara [o] skrivöver [s] märk som sparad och bevara [t] märk som sparad och överskriv [m] slÃ¥ ihop EA och bevara [n] slÃ¥ ihop EA och överskriv [r] tag bort [*] behÃ¥ll oförändrad [a] avbryt Ditt val? Ditt beslut om fildata: [P] bevara [O] skriva över [S] märk som sparad och bevara [T] märk som sparad och överskriv [R] tag bort [*] behÃ¥ll odefinierad [A] avbryt Ditt val? Extended Attribut: [ inkluderande %i hÃ¥rd länk(s) %i filer har noterats som förstörda sedan referenssäkerhetskopian -# krypteringsblockstorlek -$ krypteringsnyckel för hjälparkiv -* samma som -# men för referensarkivet -+ sammanfoga tvÃ¥ arkiv / skapa ett underarkiv -, ignorera mappar som följer "Directory Tagging" --nodump tag ej med filer med 'nodump'-flaggan 'd' satt -/ pÃ¥ vilket sätt dar kan skriva över filer vid ihopslagning av arkiv eller -@ [sökväg/] Gör katalogisolation av det resulterande arkivet i flykten -@ [sökväg/] referenshjälparkiv för sammanslagning -A lägg till ett arkiv till databasen -A [sökväg/] arkiv att ta som referens -B specificerar använd databas (läsning eller modifiering) -B läs alternativ frÃ¥n angiven fil -C isolerar katalogen frÃ¥n ett arkiv -C skapar en tom databas -D uteslutna mappar lagras som tomma mappar -D tag bort ett arkiv frÃ¥n databasen -E kommandorad, som skall utföras mellan delar i ett arkiv -E kommadon som skall utföras mellan delar -E kommando, som skall utföras mellan delar hos mÃ¥larkivet -F kommando, som skall utföras mellan delar i källarkivet -F spara som -E men för referensarkivet -H [N] ignorera datumbyte pÃ¥ en fixt antal timmar -I filer som skall inkluderas i Ã¥tgärden (alla som standard) -J samma som -K men det avser referensarkivet -K använd som nyckel för att kryptera/dekryptera -L utför pÃ¥ en given databas en serie Ã¥tgärder definierad av -M stanna i samma filsysytem medan mappar avsöks -N läs inte ~/.darrc eller /etc/darrc inställningsparameterfil -O[ignorera-ägare | mtime | inode-typ] beakta inte ägare och grupp -P mapp som skall utelutas i Ã¥tgärden -Q undertyck begynnelsevarningen om ej startad frÃ¥n en tty -R filsystemets rotmapp (gällande mapp som standard) -S första filens storlek -S första filens storlek (om skild frÃ¥n de efterföljandes) -T trädformat pÃ¥ utmatning -U mask för att tillÃ¥ta viss EA -V visar programvaruversion -V visar versionsinformation -V visar versionsinformation -X filer som skall uteslutas frÃ¥n Ã¥tgärden (inga som standard) -Y komprimera endast de matchande filnamnen -Z komprimera inte de matchande filnamnen -[ filnamn innehÃ¥ller en lista pÃ¥ filer som skall tas med -] filnamn innehÃ¥ller en lista pÃ¥ filer som skall uteslutas -^ permission[:användare[:grupp]] för skapade bitar -aSI delstorlekssuffix k, M, T, G, etc. är tio-potenser -aa bevara inte 'atime' hos en läsöppnad fil. -abinary delstorlekssuffix k, M, T, G, etc. är tvÃ¥-potenser -ac bevara inte 'ctime' (standarduppträdande). -acase efterföljande masker är känsliga för liten/stor bokstav -ag ställ in följande masker att vara 'glob expressions' -am ställ in 'ordered mode' för alla filter -an efterföljande masker är okänsliga för liten/stor bokstav -ar ställ in följande masker att vara reguljära uttryck -as lista bara filer som sparats i arkivet -b ring pÃ¥ terminalens klocka när en användarÃ¥tgärd mÃ¥ste till -b byt basnamnet att användas för det givna arkivnummret -c kontrollera databasen med avseende pÃ¥ datumordning -c skapar ett arkiv -d jämför arkivet med existerande filsystem -d specificera sökvägen till dar -e torrsim, fejkad exekvering, inget är producerat -f Ã¥terställ ej mappstrukturen -f lista de arkiv där den givna filen finns -g mapp som skall inkluderas i Ã¥tgärden -h visa denna hjälpinformation -h visar denna hjälpinformation -i interaktiv användarmod -i rör som används i stället för 'std input' till att läsa data frÃ¥n 'dar_slave' -i rör som änvänds i stället för 'std input' till att läsa beordringar frÃ¥n dar -k tag ej bort filer, förstörda sedan referenssäkerhetskopian -l lämna information om det arkiv 'kompilerat' i databasen -l listar innehÃ¥llet i arkivet -m komprimera inte filer mindre än -m flytta ett arkiv inom en given databas. -n skriv ej över filer -o rör som används i stället för 'std output' till att berordra 'dar_slave' -i rör som används i stället för 'std output' till att skriva data till dar -o specificera en lista med alternativ som alltid skall lämnas till dar -p gör en paus innan skrivning till en ny fil -p byt sökvägen att användas för det givna arkivnummret -q undertryck slutgiltig statistikrapport -r Ã¥terställ ej filer som är äldre än de i filsystemet -r Ã¥terställer de givna filerna -s visa antalet senaste filer mot arkiv -s klyv arkivet i flera filer av storlek -t testar arkivets integritet -u mask för att ignorera viss EA -u lista det senaste filerna innehÃ¥llna i det givna arkivet -v visar mer information om vad som pÃ¥gÃ¥r -v detaljerade utdata -vs visa överhoppade filer -w varna inte före överskrivning av filer -w endast med -r, Ã¥terställer status alldeles före det givna datumet -wa varna inte vid överskrivning och borttagande av filer -x extraherar filer frÃ¥n arkivet -~ kommando mellan avsnitt hos hjälparkivet inkluderande %i hÃ¥rd(a) länk(ar) behandlade arkiv # | senaste/total data | senaste/total EA %i byte(s) har förbrukats i arkivet för att Ã¥terspara ändrande filer %i inod(er) lagda till arkiv %i inode(er) ändrade vid säkerhetskopieringstillfället och kunde inte sparas %i inod(er) borttagen/borttagna %i nod(er) misslyckades att spara (filsystemfel) %i inod(er) gick inte att Ã¥terställa (filsystemfel) %i inod(er) ignorerad(e) (uteslutna av filter) %i inod(er) ej Ã¥terställd(a) (ej sparad(e) i arkiv) %i inod(er) ej Ã¥terställd(a) (beslut enl. överskrivningspolicyn) %i inod(er) ej sparad(e) (ingen inode/fil ändrad) %i inod(er) noterade som borttagna %i inoder(er) noterad(e) som borttagen/borttagna frÃ¥n referenssäkerhetskopian %i inod(er) Ã¥terställd(a) %i inod(er) sparade %i inod(er) matchar ej motsvarande i filsystem %i företeelse(r) ignorerad(e) (uteslutna av filter) %i företeelse(r) behandlad(e) %i företeelse(r) med fel %s kommer med ABSOLUT INGA GARANTIER; %s kommer med ABSOLUT INGEN GARANTI, för detaljer skriv '%s -W'. %s medför ABSOLUT INGA GARANTIER; för detaljer skriv 'dar -W'. %s är en del av Disk ARchieve sviten (UtgÃ¥va %s) . hämta den. - 'Door entries' : %i - blockenheter : %i - teckenenheter : %i - mappar : %i - namngivna rör : %i - antal inoder med hÃ¥rd länk : %i - antal referenser till hÃ¥rdlänkade inoder: %i - enkla filer : %i - symboliska länkar :%i - unix socklar : %i . Ignorerar fil eller mapp : Försöka igen ? . Försöka med kommandoraden igen ? . Försök att starta dar pÃ¥ samma sätt som förut ? Val: Fortsätta likväl ? EA Ã¥terställt för %i inod(er) EA sparat för %i inoder(er) OM MÖJLIGT FÖRSÖK ATT SKAPA DETTA FEL, ETT SCENARIO SOM KAN Ã…TERSKAPA DET ÄR TILL STOR HJÄLP VID PROBLEMSLÖSNINGEN TACK OM MÖJLIGT FÖRSÖK ATT Ã…TERSKAPA DETTA FEL, ETT SCENARIO SOM KAN Ã…TERSKAPA DET ÄR TILL STOR HJÄLP VID PROBLEMSLÖSNINGEN TACK Endast ett alternativ av -c -d -t -l -C -x eller -+ är tillÃ¥tet Klar att fortsätta ? TACKSAM FÖR RAPPORT OM FÖREGÃ…ENDE UTMATNING TILL UNDERHÃ…LLAREN MED EN BESKRIVNING AV OMSTÄNDIGHETERNA. Detta är fri programvara, och du är välkommen att Ã¥terdistribuera den under vissa villkor; Detta är fri programvara, och du är välkommen att Ã¥terdistribuera den under Totalt antal övervägda inoder: %i Totalt antal övervägda poster: %i Använder libdar med %u.%u byggt med kompileringstillfällets alternativ: Använder libdar %u.%u byggd med alternativ vid kompileringstillfället: Använder libdar med %u.%u.%u byggt med kompileringstillfällets alternativ: Använder libdar %u.%u.%u byggd med alternativ vid kompileringstillfället: [vagnretur = JA | Esc = NEJ] a : Spara som n : gör paus var n-te rad (noll ger ingen paus) c : kontrollera datumordning vissa villkor; skriv 'dar -L | more' för detaljer. kompilerad den %s med %s version %s d : sökväg till dar o : alternativ hos dar f : ange filplats m : modifiera arkiveringsordning för detaljer skriv 'dar -W'. är en del frÃ¥n en annan säkerhetskopia, hämta den rätta delen. skall till att skrivas över. är inte närvarande i arkivet l : listar databasinnehÃ¥ll A : lägg till ett arkiv ej ihopslagen (användares val) ej Ã¥terställd (användares val) p : modifiera sökväg för arkiven b : modifiera basnamn för arkiven q : avsluta skriv '%s -L | more' för detaljer. skriv 'dar -L | more' för detaljer. u : listar databasinnehÃ¥ll D : Tar bort ett arkiv w : skriv ändringar till fil s : databasstatistik med %i hÃ¥rd(a) länk(ar) noterad(e) "-k" (eller "-kignore") och "-konly" är ej kompatibla"första_filstorleken" kan inte vara skild frÃ¥n noll om "filstorlek" är lika med noll# A V B B Y T E R ! ## ICKE FÃ…NGAT AVBROTT, ## OVÄNTAT AVBROTT, #%S [%c] [ FLYTTAD ENTRY ] (%S) %S %S finns redan och överskrivning är ej tillÃ¥ten, avbryter%S fanns ej före specificerat datum och kan ej Ã¥terställas%S skall till at tas bort (krav frÃ¥n överskrivningspolicy), är du överens?%S skall till att överskrivas, OK?%S skall till att skrivas över, fortsätta ?%S skall till att tas bort frÃ¥n filsystemet, fortsätta ? %S är ej en giltig sökväg: %S%S är inte ett giltigt tal%S mÃ¥ste tas bort, men matchar inte förvänta typ, ta bort ändÃ¥ ?%S: Överskrivningspolicy är obestämd för denna fil, vet ej huruvida överskrivning tillÃ¥ts eller ej!%S: Överskrivningspolicy (Data) är odefinierat för denna fil, vet ej huruvida bortagande är tillÃ¥tet eller ej!%S: Överskrivningspolicyn (EA) är obestämd för denna fil, vet ej huruvida överskrivning är tillÃ¥ten eller ej!%d är inte en giltig blockstorlek%d är standardvärdet för --sparse-file-min-size, inget behov att specificera det pÃ¥ kommandoraden, ignorerar%d är standardvärdet för -m, inget behov att specificera det pÃ¥ kommandoraden, ignorerar%s namnger inte en kompression "[algoritm][:][nivÃ¥]" , sÃ¥som t. ex. "gzip", "lzo", "bzip2", "lzo:3", "gzip:2", "8" eller "1". Titta pÃ¥ man page om -z alternativ%s type är ej ett tal med tecken som förväntat%s typ är ej tal utan tecken som förväntat%s typlängd är ej %d byte(s) men %d, beredd att fortsätta ? -$ är bara tillgängligt med -+ och -c alternativ-$ är bara nyttigt med -@ alternativ, för det hjälpande referensarkivet-%% är bara tillgängligt med -+ alternativ-%% är bara nyttigt med -@ alternativ, för det hjälpande referensarkivet--------------+-------------------------+----------------------- --nodump-funktionen har ej aktiverats vid kompileringstillfället, sÃ¥lunda är den ej tillgängligt--sparse-file-min-size är bara tillgängligt under arkivs sparande eller ihopslagning. -. alternativ är endast användbart vid sammanslagning, skapande eller isolering av arkiv, ignorerar-/ alternativ är användbart bara med -+ alternativ, ignoreras-= alternativ är bara giltigt option under sparande av filer, sÃ¥lunda i samband med -c alternativ, ignorerar-= valet kommer att ignoreras dÃ¥ det är oanvändbart om du inte specificerar till vilka filer eller mappar denna koppling skall tillämpas, tack vare -< och -> valen. Se man page för ytterligare detaljer.-@ är bara tillgängligt med -+ och -c alternativ-A alternativ är ej tillgängligt med -l-B alternativ kan ej ges inuti en batch-fil-F är endast användbart med -A alternativ, för referensarkivet-H är endast användbart med -A alternativ dÃ¥ en säkerhetskopia görs-H är endast användbart med -c, -d eller -x-H är endast användbart med -r alternativ dÃ¥ extrahering görs-J är endast användbart med -A alternativ, för referensarkivet-M är endast användbart med -c-S alternativ kräver användning av -s-a alternativ kräver ett argument-ac är endast användbart med -c eller -d-af mÃ¥ste finnas före -A alternativ inte efter!-af alternativ är endast tillgängligt med -c-af alternativ behöver inte specificeras mer än en gÃ¥ng, ignorer extra af alternativ-ak är bara tillgängligt under sammanfogning (operation -+), ignorerar -ak-ak alternativ behöver inte specificeras mer än en gÃ¥ng, ignorer extra ak alternativ-as är endast tillgängligt med -l, ignorerar -as alternativ-e alternativ är användbart bara med -x, -c eller -+ alternativ-e alternativ är bara tillgängligt när -r alternativ används, avbryter-f är endast tillgängligt med -x alternativ, ignorerar-k alternativ är användbart bara med alternativet -x"-konly" och "-kignore" kan ej användas samtidigt-m är bara användbart med -c-o är obligatorisk tillsammans med "-A -" with "-c -" "-C -" or "-+ -"-r är oanvändbart med -n-w alternativ är oanvändbart med -n-wa alternativ är användbart bara med alternativet -x-~ is är bara nyttig med -@ alternativ, för det hjälpande referensarkivet: fil finns inte filsystemEtt problem inträffade vid läsning av innehÃ¥let i detta arkiv: Avbryter batch-Ã¥tgärd: Avbryter program. Avbryter program. Ett fel inträffade angÃ¥ende utförande av användarkommando: Avbryter program. Ett fel inträffade vid anrop av libdar: Avbryter program. Den begärda Ã¥tgärden behöver funktioner, som har avaktiverats vid kompileringstillfället: Avbryter program. Användare vägrade fortsätta vid förfrÃ¥gan: Absolutvärdet för stort för arkiv nummer: %dLägger till hÃ¥rd länk till arkiv: Lägga till en tydlig escape-sekvens av typen 'seqt_not_a_sequence' är förbjudetLägger till hänvisning till filer, som har förstörts sedan referensbackuppen...Alla efterfrÃ¥gade filer kunde ej Ã¥terställasAlla lager har skapats korrektArkiv %S kräver ett lösenord: "Archive assignment operator" är ej implementeradArkivbasnamn (eller extraherat katalogbasnamn) att lägga till: "Archive copy constructor" är ej implementeradFördröjd avslutning pÃ¥ arkiv inkopplatSnabb avslutning pÃ¥ arkiv inkopplatArkivformat äldre än "08" (utgÃ¥va 2.4.0) kan ej läsas genom ett ensamt rör. Det kana bara läsas genom dar_slave eller normal planfilsmetodArkivet bestÃ¥r av %i fil(er) Arkivnummer, som skall ändras: Arkivnummer, som skall flyttas: Arkivnummer, som skall tas bort: Arkivnummer, vars sökväg skall ändras: Arkivnummer | Data | status || EA | status Arkivnummer: Arkiv pÃ¥ 'std output' är inte kompatibelt med delning (-s alternativ)Arkivstorlek är: %i byte Arkivets totala storlek är : %i byte Arkivets versionsformat : %s Arkivversion är för hög, använd en senare version av 'libdar'Är du säker pÃ¥ att du vill ta bort arkiv nummer %dDet argument, som ges till -H, är inte ett positivt heltalArgument läses frÃ¥n %S :Argument till -r mÃ¥ste vara en relativ sökväg (fÃ¥r aldrig börja med '/')Begäran om ett element utanför en tabellFel i CRC, data förstörtFel svar frÃ¥n 'peer' vid stängning av förbindelseDÃ¥ligt formaterad datumuttryckFelaktigt formaterad SAR-huvud (okänd TLV-typ i delsäkerhetskopiehuvud)DÃ¥ligt formaterad databasFel utformat avslutning, kan ej extrahera katalogplats: Felaktigt format 'infinint' eller ej understött formatFÃ…NGADE ETT ICKE- (LIB)DAR-AVBROTTCRC-fel upptäckt vid läsning av EACRC-fel: data förstört.CRC misslyckades för innehÃ¥llsförtäckning (ocksÃ¥ känts som "katalog")Kan ej läsas sparade data.Avbrott ej bekräftatKan ej lägga till ytterligare arkiv, databasen fullKan ej tilldela buffertminne under läsning av %SKan ej blockera signal: Kan inte avbryta uppdraget rent, 'thread-safe'-stöd saknas, kommer att stoppa programmet abrupt, skapat arkiv kan vara oanvändbartKan ej jämföra EA: EA-stöd har inte aktiverats vid kompileringstillfälletKan ej jämföra filer i skrivmodKan ej kopiera ett 'wrapperlib'-objekt (EJ IMPLEMENTERAT)Kan ej skapa databas, fil finnsKan ej skapa inod: Kan ej utvärdera crit_and criterium dÃ¥ inget kriterium har lagts till detKan ej utvärdera crit_or criterium dÃ¥ inget kriterium har lagts till detKan ej extrahera frÃ¥n den interna katalogen lista med filer, som skall tas bort Kan ej fÃ¥ referenskatalog dÃ¥ den ej har lämnatsKan ej hämta datanamn för arkivet, detta arkiv är ej helt initialiseratKan ej fÃ¥ ext2-attribut (och nodump-flaggvärde) för %S : %sKan inte hämta filstorlek: %sKan ej fÃ¥ komplett sökväg till gällande arbetsmapp: Kan ej fÃ¥r inodsinformation om den fil som skall tas bort Kan ej fÃ¥ inodinformation för %s : %sKan inte hämta mtime: %sKan ej öppna katalog: Kan ej öppna mÃ¥lfil : %sKan ej öppna fil : Kan ej öppna källfil : %sKan ej läsa argument pÃ¥ kommandorad, avbryterKan ej läsa mappinnehÃ¥llet: %s : Kan ej läsa filinformation för %s : %sKan ej läsa inod för Kan ej läsa pÃ¥ 'input'kan ej ta emot sÃ¥ mycket data med hänsyn till allokerat minneKan ej gÃ¥ rekursivt i en icke-mappKan ej reducera en sträng till en storlek, som är större än dess aktuella storlekKan ej ta bort mapp Kan ej ta bort fil Kan ej ta bort icke befintlig fil frÃ¥n filsystemet: Kan ej flytta obefintligt data %S frÃ¥n katalogKan ej Ã¥terställa nÃ¥gon fil, inget utförtKan ej Ã¥terställa fil %S : icke existerande fil i databasenKan ej Ã¥terställe behörigheter för %s : %sKan ej leta bakÃ¥t ett teckenKan ej leta i filKan ej sätta senaste tillgÃ¥ngtid och senaste modifieringstid: Kan ej hoppa över vid filslutKan ej hoppa över framÃ¥t för att Ã¥terställa ett hÃ¥lKan ej hoppa till aktuell position i "tronc"Kan ej synka skrivning med en skrivskyddad allmän fil.Kan ej frisläppa signal: Kan ej skriva till arkivet:Kan ej skriva pÃ¥ 'output'Kan ej skriva till mÃ¥l, avbryterKan ej skriva till 'output'Katalogstorlek i arkiv : %i byte FÃ¥ngade att icke-libdaravbrottFÃ¥ngade ett okänt 'Egeneric exception:'Ändrar information i databashuvudet...Ändrar databasinformation...Kontrollerar datumordning hos filer mellan arkiv...Kontrollerar filers datumordning...Välj bara en komprimeringsalgoritmNollställning av fils EA (begärd av överskrivninsgpolicy): Kommandona är: Kommandon: Allmänna alternativ: Kommunikationsproblem med 'peer', försöka igen ?Komprimerar och skriver tillbaka databas till fil...Utnyttjad kompressionsalgoritm : %S KomprimeringsnivÃ¥n mÃ¥ste ligga mellan 1 och 9 inklusiveKompressionsnivÃ¥n mÃ¥ste ligga mellan 1 och 9, inklusiveBeräknar statistik...Funderar pÃ¥ chiffreringsnivÃ¥...Beaktar det (första) referensarkivet:Sundhetskontroll misslyckades för arkivhuvudFortsätta lista arkivinnehÃ¥ll?Fortsätta? Fortsätter aktuell process,vilket är att avsluta... sÃ¥ vi avslutar!Fortsätter...Kopierade data matchar inte CRCKopiering avslutad. Saknar %.0f byte data Felaktiga data lästa frÃ¥n rörFelkaktiga data lästa frÃ¥n rörFörstörd databas :Förstörd post följande ett escape-märke i arkivetKunde ej skapa inod: Kunde inte öppna mapp %s i smygläsningsmode (%s), använder normal modeKunde inte Ã¥terställa ursprunglig ägare till fil: Kunde inte läsa en katalogdatastruktur med offset %i, det innehÃ¥ller följande:Skapar fil...Krypteringsblockstorlek mÃ¥ste vara större än 10 byteAktuell arbetsmapp kan ej vara en relativ sökvägAktuell implementering av blowfish-kryptering är ej kompatibel med den gamla (svaga) implementeringen. Använd dar-2.3.x programvara (eller annan programvara grundad pÃ¥ libdar-4.4.x) för att läsa detta arkiv.Cyphering-algoritm inte tillgänglig i libgcrypt: %s/%sDAR underprocess har avslutats med exitkod DAR avslutat vid signalmottagande: DIFF data har förstörts, kan en dechiffrera dataData förstört vid slutet pÃ¥ delsäkerhetskopian, förbjuden flagga hittad i denna positionData förstört vid slutet pÃ¥ delsäkerhetskopian, förbjuden flagga hittadFörstörda data eller ett okänt märke för gles fil hittat i filens dataData helt sparat : %S %SData frÃ¥n fil %S frÃ¥n första arkivet har bevarats frÃ¥n överskrivningData hos filen %S skall till att bli %S, fortsätta?Data frÃ¥n fil %S taget frÃ¥n det första referensarkivet har skrivits överData frÃ¥n fil %S taget frÃ¥n det första referensarkivet har tagits bortData bör vara endast läsningDatabasen har med lyckat resultat skapats tom.Databas ej sparad. Vill du verkligen avsluta?datum är ej i stigande ordning för alla filer, när databasens arkivnummer ökar, arbete med denna databas kan leda till felaktig version för Ã¥terställd fil. Ordna om arkivet inom databasen sÃ¥ att det äldsta är det första arkivet och det senaste är det sista i databasenFils datum %S ökar ej när databasens arkivnummer växer. Berörd fil är: %SDekomprimerar och laddar databashuvud in i minnet...Dekomprimerar och laddar databasen in i minnet...Mod med stegvis minskning är oanvändbar när hopslagning inte är tillämpbar pÃ¥ bÃ¥de arkivreferens och en extra arkivreferens. Ignorera denna mod och fortsätta?Upptäckt "Cache Directory Tagging Standard" för %s, innehÃ¥llet i den mappen kommer aj att sparasMappen %S kan ej Ã¥terställas: överskrivning ej tillÃ¥ten och en icke-mapp-inod med det namnet finns redan, alla filer i den mappen kommer att hoppas över vid Ã¥terhämtning:Smutsig fil : %S %SDivision med nollVill du ignorera samma feltyp för andra filer?EA för %S skall till att slÃ¥s ihop, OK?NÃ¥gra EA för %S skall till att skrivas över, OK?EA för %S skall till att tas bort, OK?EA for %S har ej nollställt enligt begäran frÃ¥n överskrivnngspolicyn eftersom denna fil är en hÃ¥rd länk pekande pÃ¥ en redan Ã¥terställd inodEA för %S har ej skrivits över eftersom denna fil är en hÃ¥rd länk pekande pÃ¥ en redan Ã¥terskapad inode.EA helt sparat : %S %SEA senare : %S %SEA tal : %i %iEA för fil %S frÃ¥n första arkivet har släppts och markerats som redan sparadeEA för fil %S frÃ¥n första arkivet har tagits bortEA för fil %S frÃ¥n första arkivet har uppdaterats med dessa med samma filnamn frÃ¥n det extra arkivetEA för fil %S har skrivits överEA för fil %S har skrivits över och markerats som redan sparatERR ERR En tom sträng som undermapp utgör inte en giltig sökvägTom sträng är ett ogiltigt arkivabasnamnEn tom sträng är ej en giltig sökvägMata in varje argument rad för rad, tryck vagnretur vid slutet Inmatad information CRC-misslyckandeInmatad information CRC-misslyckande för %SInmatad information CRC-misslyckande för %S. Ignorera detta?Notis information: "i plats" "att läggas tillNotistyp : %s %sFel vid skapande av UNIX sockelfil: Fel vid skapande av hÃ¥rd länk %s : %s Försöker att duplicera inodenFel vid skapande av hÃ¥rd länk %s , inoden till länk med [ %s ] har försvunnit, Ã¥terskapar denFel vid skapande av hÃ¥rd länk %s , inoden till länk med [ %s ] finns inte, kan ej Ã¥terställa denna hÃ¥rda länkFel vid utförande av användarkommandoradsexekvering: Fel vid hämtning av fils läsposition: Fel vid hämtning av filstorlek: Fel vid öppning av sista delsäkerhetskopia: %S. Försöker öppna arkivet genom att använda första delsäkerhetskopia...Fel uppstÃ¥tt vid bearbetande av Ã¥tgärd: Fel pÃ¥träffat vid läsning av rad %S frÃ¥n fil %S: %SFel vid öppning i smygläsningsmode: Fel vid öppnande av mapp: Fel vid öppnade av rör: Fel vid genomförande av den begärda Ã¥tgärden: %SFel vid läsning av EA för Fel vid läsning av attribut %s hos fil %s : %sFel vid läsning av tecken: Fel vid läsning av databas %S : Fel vid läsning av mappinnehÃ¥ll: Fel vid läsning av inod för fil %s : %sFel vid läsning av källfil ( vi är vid %.2f %% av kopierade data), försöker att läsa vidare: %s Fel vid räddning av EA-lista för %s : %sFel vid sparande av Extended Attribut för Fel vid omvandling av arkivet :Fel vid aktivering av 'libgcrypts' minnesskydd: %s/%sFel vid tilldelning av nyckel till libgcrypt key handle (essiv): %s/%sFel vid tilldelning av nyckel till libgcrypts nyckelhanterare: %s/%sFel vid anrop av fork() för att starta dar: Fel vid ändring av användarterminalens egenskaper: Fel vid jämförelse mellan arkiv och filsystem: Fel vid bestämning av fil: Fel vid omvandling av UID/GID till sträng för "backup hook file": Fel vid skapande av ESSIV handle: %s/%sFel vid skapande av anonym pip: Fel vid skapande av hash handle: %s/%sFel vid kodning av data: %s/%sFel vid dechiffrering av data: %s/%sFel vid härledning av nyckel frÃ¥n lösenord (HMAC öppnat): %s/%sFel vid härledning av key frÃ¥n lösenord (HMAC set key): %s/%sFel vid hämtning av arkivegenskaper: Fel vid hämtning av information för %S: Fel vi skapande av IV: %s/%sFel vid initiering av hash: Hash algoritm ej tillgänglig i libgcrypt: %s/%sFel vid listning av arkivinnehÃ¥ll: Fel vid öppnande av 'libgcrypt key handle': %s/%sFel vid öppnande av referensarkivet: Fel vid analys av --min-digits alternativ: Fel vid analys av -A-argument som ett datum: Fel vid läsning CRC för EA frÃ¥n arkiv: Inget escape-märke funnet för denna filFel vid läsning av arkivhuvud. Detta kan bero pÃ¥ att arkivet är ett gammalt krypterat arkiv eller att data har förstörts. Under antagande att det är ett gammalt arkiv, mÃ¥ste huvudet läsas frÃ¥n början av den första delen...Fel vid läsning av data frÃ¥n säkert minne:Fel vid läsning frÃ¥n fil: Fel vid läsning frÃ¥n ett rör: Fel vid läsning av användarsvar frÃ¥n terminal: Fel vid Ã¥terställning av krypteringsnyckel för ett nytt block: %s/%sFel vid Ã¥terställning Fel vid Ã¥terställande av data. Fel vid Ã¥terställande av följande filer: Fel vid sparande Fel vid datasparande: Fel vid inställning av IV för aktuellt block: %s/%sFel vid tilldelning av en fils egenskaper:%sFel vid inställning av ägare till fil: %sFel vid meddelande till 'libgcrypt' att initialiseringen är avslutad: %s/%sFel vid arkivtest: Fel vid skrivning av data till ett rör: Fel vid skrivning till fil: Fel SHA1 ej tillgängligt i 'libgcrypt': %s/%sFel, referenskatalog har aj lämnatsEscape-sekvens använd för läsning leder till att arkivet placerar vissa filer utanför den specificerade roten. För att klara detta problem, försök att läsa arkivet i direkt mode (använd ej sekvensiell läsning), försök reaparera arkivet med hlälp av Parchive om redundanta data har skapats eller som sista utväg försök använda lax modeAvbryter...Befintlig EA för %S kunde inte bevaras : Befintlig EA för %S kunde inte läsas och bevaras: FATALT fel, avbryter Ã¥tgärdMisslyckades med att öppna "cache"-nivÃ¥n, minnesbrist, arkivläsförmÃ¥ga blir ej optimalMisslyckades med att hämta frÃ¥n libgcrypt den blockstorlek använd vid cyphering algoritmen: %s/%sMisslyckades att öppna %S medan kontroll av nodump-flagga gjordes: %sMisslyckades med att notera hash: Ödesdigert fel i användarkommandorad: Filen %S har ändrats under säkerhetskopieringen och är sannolikt inte sparad i ett giltigt tillstÃ¥nd ("smutsig fil"), vill du ta med den i Ã¥terställningen i alla fall?Fil %S rad %dFil har ändrats under säkerhetskopiering och har kopierats en annan gÃ¥ng, Ã¥terställer nästa kopia av filen: Fil försvann medan den lästes, kan ej kontrollera huruvida den har ändrats under dess säkerhetskopiering: %SSlinga i filinkludering har upptäckts. Filen %s inkluderar sig själv direkt eller genom andra filer (-B alternativ)FiltillstÃ¥nd är varken läsning eller skrivningFil mÃ¥ste vara en mapp: Fil ej funnen i databas: Fil noterad som borttagen vid detta datum i databasen: Filval har avbrutits. Skapar nu det resulterande arkivet med de redan valda filernaFilstorlek : %i byte Filstorlek för litenFilstorlek: %i byte Fil att leta efter: Klar med skrivning till fil Första filens storlek : %i byte Första filens storlek för litenFörsta delsäkerhetskopiestorlek är för liten för att till och med kunna pÃ¥ plats med delsäkerhetskopiehuvudetFormaterar fil som en tom databas...Fann 'SmygläsningsmodeAngivet datum mÃ¥ste vara i det förgÃ¥gnaAtt ge -S alternativet samma värde som det som gavs till -s är oanvändbartOm man ger till -S alternativet samma värde, som det som man ger till -s alternativet, är det oanvändbartHÃ¥rda länkar för mappar stöds ejHur mycket rad, som skall visas genast: INTERNT FEL, RAPPORTERA FÖREGÃ…ENDE UTDATA TILL PROGRAMUNDERHÃ…LLARENOm du verkligen vill stoppa dar, tryck CTLR-C och sedan vagnretur Ignorera föregÃ¥ende fel frÃ¥n användarkommandorad och fortsätta ?Ignorerer extra argument pÃ¥ kommandoradIgnorerar fil med NODUMP-flagga satt: Ignorerar okänt alternativ -%cI ingÃ¥ende filer %S: PÃ¥ vilkenplats skall detta arkiv läggas in: Osammanhängande svar frÃ¥n 'peer'Ej enhetlig katalogstruktur: duplicerad hÃ¥rdlänkade inodes dataOsammanhängande katalogstruktur: hÃ¥rdlänkade data är ej en inodeOsammanhängande katalogstruktur: hÃ¥rdlänkade inoders data ej hittadeEj enhetlig katalogstruktur: obekant statusflagga för hÃ¥rdlänkad inode.Felaktig delsäkerhetskopiehuvud: första delsäkerhetskopiestorlek för litenIcke översenstämmande struktur i data med glesa filer. okänt märkeEj fullständig etikettFelaktigt arkivomrÃ¥de i databasenFelaktig dag i mÃ¥nadFelaktig minutFelaktig mÃ¥nadFelaktig sekundIndex utanför giltigt omrÃ¥deInitieringsproblem för liblzo2-biblioteket'Input' kan ej läsasOgiltigt arkivnummer: Ogiltigt argument som mÃ¥larkivOgiltigt argument som källarkivOgiltigt tal i sträng: %SOgiltig sökväg, sökväg mÃ¥ste vara relativOgiltig storlek för CRC-breddOgiltig storlek för -S alternativOgiltig storlek för -s alternativÄr mappar : %S %SÄr hÃ¥rdlänkad : %S %SÄr inode : %S %SÄr enkel fil : %S %S'Iteratorn' pekar inte pÃ¥ dataNyckel kan ej vara en tom strängLAX MODE: "%S" är ej ett giltigt arkivformatLAX MODE: %i %% Ã¥terstÃ¥rLAX MODE: %i är ej giltigt procentvärdeLAX MODE: mappstrukturen i arkivet är förstört, det skulle leda till vissa filer placeras utanför den angivna rotmappen. Ã…terställning av andra mappars innehÃ¥ll vid roten, ej utanför den, vilket kommer att lägga filer frÃ¥n andra mappar i den angivna rotmappen.LAX MODE: Arkiv är flaggat som om det har 'escape sekvens markeringar' (vilket är normalt i tidigare arkivversioner). Om detta inte är förväntat, skall jag antaga att data förstörts i detta fält och att denna flagga skall ignoreras? (Om osäker, vägra)LAX MODE: Arkivet verkar vara chiffrerat, men du har ej angett nÃ¥gon chifferalgoritm, antar dataförstörelse och betraktar arkivet som ej chiffreratLAX MODE: Arkivet verkar utgöras av bara en isolerad katalog (inga data i det). Kan det antagas att data förstörts och kan det arkivet betraktas som ett riktigt arkiv?LAX MODE: Börjar med att avsöka katalogen (frÃ¥n slutet mot början av arkivet %i %% av arkivet), detta kan ta ett bra tag...LAX MODE: CRC misslyckades, arkivinnehÃ¥llet är förstört. Detta kan leda till att dar ser filer i arkivet, vilka aldrig funnits men detta kommer sannolikt leda till andar fel vid Ã¥terställande av filer. Skall vi fortsätta ändÃ¥?LAX MODE: Kan ej hoppa över i slutet av arkivet! Amvänder aktuell position till att börja katalogsökningenLAX MODE: fÃ¥ngade avbrott: LAX MODE: Kunde inte hitta hela katalogen i arkivet. Om du har en isolerad katalog, stanna här och använd den som säkerhetskopia för den interna katalogen, i annat fall fortsätt, men kom ihÃ¥g att alla data inte kan Ã¥terställas...LAX MODE: vill du hoppa över nÃ¥gra vettighetskontroller och försöka igen att läsa arkivinnehÃ¥llet (detta kan lite tid, detta kan även misslyckas)?LAX MODE: vill du försöka finna delar av originalkatalogen om nÃ¥got Ã¥terstÃ¥r (detta kan ta mycket tid och in vilket fall som helst kommer bara nÃ¥gra filer, som mest, att Ã¥terställas.)?LAX MODE: PÃ¥ grund av trolig dataförstörelse, kan 'dar' inte avgöra det rätta storleken pÃ¥ delsäkerhetskopian i detta arkiv. För senare arkiv är denna information dubblerad i varje delsäkerhetskopia, vill du försöka att öppna en annan delsäkerhetskopia för att fÃ¥ tag pÃ¥ detta värde om det finns?LAX MODE: fel vid skapnde av mapp, hoppar över detta data och fortsätter. Överhoppat fel var: LAX MODE: Escape-sekvens kunde inte hittas, den kan ha blivit förstörd or utanför avsökt del av arkivet, försöker hitta katalogen den andra vägen...LAX MODE: escape-sekvenser verkar finnas i detta rakiv. Jag har dÃ¥ tvÃ¥ olika metoder, antingen letar jag efter escape-sekvenser visande pÃ¥ en katalogbörjan eller sÃ¥ försöker jag vid varje position i ordning i hopp om att det inte är data, som ser ut som en katalog.LAX MODE: Misslyckades med att läsa katalogenLAX MODE: Misslyckades med att läsa katalogen (0 byte hos arkivlängden medförde att leta efter katalogen)LAX MODE: Misslyckades med att läsa katalogen (inga data att inspektera)LAX MODE: Bra ide! kunde hitta escape-sekvensen markerande katalogbörjan, försöker nu läsa den...LAX MODE: Trots frÃ¥nvaron av en känd delsäkerhetskopiestorlek, fortsätter hur som helstLAX MODE: Skriv in ett positivt heltalLAX MODE: Upplys om arkivformatet. Du kan använda tabellen vid %s att finna arkivformatet beroende pÃ¥ version., till exempel om detta arkiv har skapats med "dar" version 2.3.4 till 2.3.7, svara "6", (utan anföringstecken) här:" LAX MODE: Skriv in numret pÃ¥ den delsäkerhetskopia som skall läsas: LAX MODE: NÃ¥dde slutet pÃ¥ avsökt omrÃ¥de, misslyckades med att hitta nÃ¥gon katalogLAX MODE: delsäkerhetskopieflagga förstörd, men en delsäkerhetskopia med högre nummer har setts, sÃ¥lunda indikerade denna delsäkerhetskopieflagga inte denna delsäkerhetskopia som den sista i arkivet. FortsätterLAX MODE: katalogen (InnehÃ¥llsförteckning) tar normalt upp nÃ¥gra procent av arkivet i dess slut. Hur stor del procentuellt, vill du att jag skall avsöka (svara med ett heltal mellan 0 och 100)?LAX MODE: Slutet pÃ¥ arkivet är förstört, kan ej hämta arkivinnehÃ¥llet ("katalogen")LAX MODE: Försöker hitta escape-sekvensen (säkrare val) ?LAX MODE: Oväntat sparat status för mappslutpost, antar dataförstörelse skett, ignorerar och fortsätterLAX MODE: Okänd komprimeringsalgoritm använd, antar data förstörda. Hjälp mig genom att svara med ett av orden "none", "gzip", "bzip2" or "lzo" pÃ¥ frÃ¥gan:LAX MODE: Okänt data i delsäkerhetskopiehuvud, ignorerar och fortsätterLAX MODE: Använder arkivformat "%d"?LAX MODE: katalogetikett matchar inte arkivetikett, som om det vore en extraherad katalog, antar dataförstörelse skett och fixar till katalogen som en enkel intern katalogLAX MODE: stänger delsäkerhetskopia %i, huvud hämtat korrektLAX MODE: första delsäkerhetskopiestorlek är ej möjlig att läsa, (brist pÃ¥ virtuellt minne?), fortsätter hur som helst...LAX MODE: första delsäkerhetskopiestorlek är ej möjlig att läsa, fortsätter hur som helst...LAX MODE: hittade obekant kataloguppgift, antar att data förstörts, kan ej läsa vidare i katalogen dÃ¥ jag ej vet längden pÃ¥ denna typ av uppgiftLAX MODE: hittat okänd katalogpost antar data förstört. Hoppar över till nästa post, detta kan leda till att felaktig mappstruktur Ã¥terställs om förstört data var en mappLAX MODE: det interna namnet pÃ¥ delsäkerhetskopian leder 'dar' till att besluta att den inte är frÃ¥n samma arkiv. Anar dataförstörelse och litande pÃ¥ filnamnet pÃ¥ denna delsäkerhetskopia som bevis pÃ¥ dess medlemskap i arkivetLAX MODE: öppnar delsäkerhetskopia %i för att läsa dess delsäkerhetskopiehuvudLax MODE: delsäkerhetskopiestorlek ej möjlig att läsa, (brist pÃ¥ virtuellt minne?); fortsätter hur som helst...LAX MODE: delsäkerhetskopior %i och %i är bägge noterade som den sista delsäkerhetskopian, behÃ¥ller det högre talet som den verkligt sista delsäkerhetskopianLAX MODE: en begärda läget sekvensiell läsning bygger pÃ¥ escape-sekvenser vilket värkar saknas i detta arkiv. Antar att data förstörts. Men om inga data förstörts och ändÃ¥ ingen escape-sekvens finns i arkivet, använd inte läget sekvensiell läsning för att undersöka detta arkiv du fÃ¥r inget matnyttigt av detMinnesbristBrist pÃ¥ SÄKERT minne för att utföra Ã¥tgärden, avbryter densammaMinnesbrist för att utföra Ã¥tgärden, avbryter densammaSista filens storlek : %i byte Bibliotek, som används för blowfish-kryptering respekterar ej RFC 3962Listalternativ (att användas vid -l): Letar efter arkivinnehÃ¥ll...Stöd för lÃ¥nga alternativ : %s Letar i arkiven för begärda filer, klassificerar filer arkiv för arkiv...Mask_lists prefix mÃ¥ste vara en absolut sökväg eller börja med ""-sträng vid arkivhopslagningMinnestilldelning misslyckades : %sSaknar -c -x -d -t -l -C -+ alternativ, se %S -h för hjälpSaknat [ efter } i villkorssats: Saknat ] i villkorssats: Saknar arkivbasnamn, se -h alternativ för hjälpSaknar argument till --backup-hook-executeSaknar argument till --hashSaknar argument till --min-digitsSaknar argument till -ESaknar argument till -E alternativSaknar argument till -FSaknar argument till -SSaknar argument till -^Saknar argument till -i alternativSaknar argument till -o alternativSaknar argument till -sSaknar argument pÃ¥ kommandorad, avbryterKatalog saknas i fil.Saknar stöd för 'hashing'-algoritm (vilket är en del av stödet för stark kryptering genom 'libgcrypt'Saknar parameter till alternativ -%cSaknar käll- eller mÃ¥l-argument pÃ¥ kommandorad, se -h alternativ för hjälpSaknar stöd för stark kryptering (libgcrypt)Saknat } i villkorssats: NEJINGEN FIL I DEN MAPPEN KAN SPARAS.EN INTE IMPLEMENTERAD FUNKTION har använts: Negativt tal eller noll är ej tillÃ¥tet vid flyttning av ett arkiv inom en databasNytt basnamn för arkiv nummer %d: Nytt databasnamn: Ny sökväg att ge till arkif nummer %d: Ingen Ã¥tgärd specificerad, avbryterIngen säkerhetskopiefil finns i %S för arkiv %S, ge de n sista filen i mängdenIngen chiffreringslager öppnat...Ingen databas specificerad, avbryterInget avbrott tillÃ¥tet frÃ¥n libdar 'callbacks'Ingen fil i denna mapp kommer att tas med vid ihopslagning.Ingen fil i denna mapp kommer att Ã¥terställas.Ingen mask i masklistan att jobba medInga problem hittadeInget utrymme kvar för inod, du har möjlighet att skapa en del plats nu. När det är gjort : kan vi fortsätta ?Inget utrymme kvar pÃ¥ enhet, du har möjlighet att skapa plats nu. När du är klar : kan vi fortsätta ?Ingen terminal hittad för användarinteraktion. Alla frÃ¥gor kommer att anses negativt besvarade (minst skadliga val), vilket i det flesta fall kommer att avbryta programmet.Inget användarmÃ¥l funnet pÃ¥ kommandoradIcke existerande arkiv i databasenIcke existerande fil i databasIcke-existerande fil: Icke fatalt fel vid skrivning till mÃ¥lfil, gör om Ej sparadInte en nollavslutad sträng i filInte tillräckligt med data för att initiera lagringsfältNu genomförs 'i flykten'-isolation...OK OK OK, behÃ¥ller %S som basnamnEndast ett -@ alternativ är tillÃ¥tetEndast ett -A alternativ är tillÃ¥tetEndast ett -R alternativ är tillÃ¥tetEndast ett -S alternativ är tillÃ¥tetEndast ett -s alternativ är tillÃ¥tetÖppnar ett par pipes för att läsa arkivet, förväntar mig dar_slave i andra ändan...Öppnar och läser batch-fil...Öppnar konstruktionsnivÃ¥...Öppnar chiffreringslager...Öppnar escape-sekvensabstraktionslagretÖppnar namngiven pipe %S som input för att läsa arkivet...Öppnar standard-input för att läsa arkivet...Öppnar arkivet genom att använda abstraktionsnivÃ¥ med 'multi-slice'...Öppnar kompressionsabstraktionslagret ( ingen kompressionsalgoritm används)...Öppnar kompressionslagret...Alternativ: Överskrivning ej tillÃ¥ten dÃ¥ en del av ett tidigare arkiv med samma basnamn har hittats i %s-mappen. Ã…tgärden avbrutenAnalysfel i kommandoraden (eller i inkluderade filer): Analysfel: DelförfrÃ¥gan mottagen, avbryter Sökväg till dar (vid tom sträng används standard frÃ¥n PATH-variabel): Rörs andra ända okänt, kan ej stänga nÃ¥gon filbeskrivning pekande pÃ¥ detRörs andra ända okänt, kan ej erhÃ¥lla en filbeskrivning för detSvara med de tecken mellan hakparenteser ('[' och ']') och tryck vagnreturKontrollera dokumentationen eller uppgradera din programvara om tillgängligKontrollera din hÃ¥rdvaraBekräfta lösenordet: FöregÃ¥ende arkivstorlek inbegriper inte det huvud, som finns i varje del Möjligt fel i liblso2: lzo1x_*_compress lämnade oväntad kod %dProgarmmet har avslutats av följande orsak: NÃ¥tt filslut vid läsning av arkivversionNÃ¥tt filslut, inga korrekta data kunde Ã¥terfinnas efter senaste felet Kommit till filslut innan alla data kunnat läsasNÃ¥tt filslut vid läsning av delsäkerhetskopiehuvudNÃ¥dde filslut under läsning av arkivversionLäsning av en 'write only generic_file'Läser arkivinnehÃ¥ll...Läsning av arkivkatalogen för att lägga till...Läsalternativ (att användas vid -x, -d, -t, -l, -A) Läser arkivhuvud...Läsning av referensarkivet frÃ¥n ett rör eller standard input är ej möjligtKlart att börja skriva till arkivet?Mottagen signal: %dMottagen signal: %sMottaget okänd specialorderSparar hÃ¥rd länk till arkiv: Referenslager hos iteratorn är tomt eller finns ejTar bort fil %sTar bort fil (orsaken är att fil är noterad som bortagen i arkiv): %STar bort fil (orsak är överskrivningspolicy): %STar bort den smutsiga filen %SÃ…terställer %s i -R alternativet genom den mapp, pekad pÃ¥ frÃ¥n denna symboliska länk: Nollställning av den sekvensiella läsprocessen av arkivinnehÃ¥llet medan den inte är avslutad, kommer att göra alla data oläsbara och sÃ¥ lÃ¥ngt oÃ¥tkomligaÃ…terställer fils EA: Ã…terställer fils data: Ã…terställningsalternativ (att användas vid -x) : Att köra en batch-fil frÃ¥n en batch-fil är ej tillÃ¥tetSUNDHETSKONTROLL: Ã…TMINSTONE ETT TRÃ…DAT AVBROTTSOBJEKT HAR INTE FÖRSTÖRTS OCH FINNS KVAR I MINNE MEDAN PROGRAMMET NÃ…DDE SITT SLUTVERKAR VARA ETT HÃ…RDVARUPROBLEM: ÖVERHOPPAD (hÃ¥rd länk i sekvensiell läsmode): Samma data men CRC-värdet kunde inte verifieras, ty vi gissade inte korrekt dess bredd (sekvensiell läsbegränsning)Samma data men lagrat CRC matchar inte data!?!SparadSparande- / Isolations- / sammanfogningsalternativ (att användas med -c, -C eller -+): Sparar Extended Attribut för Sekvensiell läsning begärd, men detta arkiv är flaggat för att inte ha nödvändiga escepsekvenser för denna Ã¥tgärd, avbryterSekvensiell läsnings markeringar : %s För stor storlek för en elastisk buffertÖverhoppning gjord (missade %.0f byte), fann riktiga data för läsning, fortsätter kopieringen... Delsäkerhetskopiestorlek är för liten för att till och med kunna pÃ¥ plats med delsäkerhetskopiehuvudetDelning (-s alternativ), är inte kompatibelt med arkiv pÃ¥ 'standard output' ("-" som filnamn)Vissa filjämförelser misslyckadesNÃ¥gra filer i arkivet är förstörda och det är ej möjligt att Ã¥terställa demVissa filer följer inte kronologisk ordning när arkivindex ökas inom databasen. Detta kan leda till att dar_manager Ã¥terhämtar fel version av dessa filer.Tyvärr, filstorleken är okänd vid detta stadium i programmet. Gles fil : %S %S Subtraktion av en 'infinint' större än det första, 'infinint' kan ej vara negativtSyntaxfel i --retry-on-change argument: Syntaxfel i batch-fil: %SSyntaxfel i batch-fil: -C alternativ ej tillÃ¥tetSyntaxfel i batch-fil: -i alternativ ej tillÃ¥tetSyntaxfel i överskrivningspolicy: "Cache Directory Tagging Standard" är bara användbart medan en säkerhetskopiering görs, tar ej hänsyn till det härArkivet %S är krypterat och ingen krypteringschiffer har getts, kan ej öppna arkivet.Arkivert och den isolerade katalogen mostavar inte samma data, de är sÃ¥lunda inkompatibla med varannBasnamnet '+' är reserverat för speciella ändamÃ¥l, som inte har nÃ¥gon mening i detta sammanhangPosten at gÃ¥ rekursivt in i saknas, kqan ej lägga till ytterligare poster till den obefintliga undermappen.Följande användarkommentar kommer att placeras i klartext i arkivet: %SArkivets formatversion är för högt för denna programvaruversion, försöka läsa ändÃ¥?Formatversionen för denna databas är för hög för denna programvaruversion, använd en senare programvara för att läsa eller ändra denna databasDen uppgivna sökvägen %s mÃ¥ste vara en mapp (eller en symbolisk länk till en befintlig mapp)'Iteratorn' indexerar inte det objekt den har blivit ombedd att läsa frÃ¥n'Iteratorn' indexerar inte det objekt den har blivit ombedd att skriva till'Iteratorn' indexerar inte det objekt som den har definierats förIteratorns position är ej innanför referensens lagringsutrymmeDen precis Ã¥terställda filen %S har markerats som smutsig (sekvensiell läsning kan bara detektera smutsigt status efter Ã¥terställning), skall vi ta bort den precis Ã¥terställd filen?Den precis Ã¥terställda filen %S har markerats som smutsig (sekvensiell läsning kan bara detektera smutsigt status efter Ã¥terställning), genom borttagande av den just Ã¥terställda smutsiga filen som det är frÃ¥gat om att ignorera denna filtypDen sista filen i omgÃ¥ngen finns inte i Snabb-backup (-A +) är bara tillgängligt med -c aalternativ, ignorerarDe tvÃ¥ lösenorden är olika. AvbryterDetta arkiv innehÃ¥ller en isolerad katalog, det kan ej användas för denna Ã¥tgärd. Det kan bara användas som referens vid inkrementell/differentiell säkerhetskopiering eller som säkerhetskopiering av det ursprungliga arkivets katalogDetta arkiv har delar och har ej möjlighet att bli lästa frÃ¥n ett rörDetta arkiv kan inte utnyttjas, kontrollera dokumentationen för mer informationDetta arkiv kan inte utnyttjas, kontrollera, hur man använder arkivklassen, i API-dokumentationenDetta arkiv har delar och men det är ej möjlighet att läsa följand del frÃ¥n ett rör, avbryterDetta är ett gammalt arkiv, det kan bara öppnas genom att börja med den första delsäkerhetskopianTrÃ¥d-avbrott begärt, avbryter sÃ¥ snart snyggt möjligtTrÃ¥d-avbrott begärt, avbryter sÃ¥ snart som möjligtAvsluta genom att mata in en tom rad För att utnyttja --sparse-file-min-size under arkivihopslaygnin, mÃ¥ste du använda -ah valet ocksÃ¥se man page för detaljerFör stort block med komprimerade data: antingen pÃ¥ grund av förstörda data eller begränsningar i aktuellt system där SSIZE_MAX-värdet indikerar mindre buffertar än begärdaFör mÃ¥nga argument pÃ¥ kommandorad, se -h alternativ för hjälpFör mycket rad i fil %S (heltalsspill)För gammal version av libgcrypt, som minst krävs version %s Försökte skriva 'out of size' begränsad filTvÃ¥ olika delsäkerhetskopior (%i och %i) är markerade som den sista delsäkerhetskopian i denna säkerhetskopia!Obalanserade parenteser i uttryck: Ofullständigt svar frÃ¥n 'peer'Ej komplett arkiv! Antar det har blivit avbrutet vid säkerhetskopieringen. Om ett fel har precis rapporterats ovan, strunta i det helt enkelt, detta är om den fil, som sparades vid tidpunkten för avbrottet.Oväntat svar frÃ¥n slav, kommunikationsproblem eller bug kan hänga Ã¥tgärdenOväntat filslutOväntat fel vid väntan pÃ¥ att dar avslutas: Oväntat avbrott frÃ¥n libdarOväntat värde hitta i databasOväntat värde vid läsning av arkivversionOkänd TLV-posttypOkänt argument givet till -2 : %sOkänt argument givet till -a : %sOkänt argument givet till -k : %sOkänt argument givet till -w: Okänd 'atomic' operator eller 'atomic' ej tillÃ¥ten med ett argument: Okänt tecken hittat under kontroll av villkorssträng: Okänt val Okänt val: Okänd krypteringsalgoritmOkänd krypteringsalgoritmOkänd post hittad i delsäkerhetskopiehuvud (typ= = %d), alternativ ej stött. Arkivet du läser kan ha skapats av en senare version av 'libdar', ignorera denna post och fortsätta hur som helst?Okänd escape-sekvenstypOkänt uttryck hittat under kontroll av villkorssträng: Okänt uttryck i överskrivningspolicy: Okänd filtyp! filnamnet är: Okänt alternativ i databashuvud, avbryter Okänt makro %%%d i användarkommentarOkänd parameter givet till --hash alternativ: Okänd parameter givet till -a alternativ: Okönd policy för EA '%c' i uttrycket %SOkänd policy för data '%c' i uttrycket %SOkänd posttypOkänd utbytessträng :%Okänt suffix [%c] i sträng %SUppdaterar databas med katalog...Användarbeslut begärt för EA hos fil %SAnvändarbeslut begärt för data hos fil %SAnvändar kommentar : %S AnvändarmÃ¥l kallat "%s" är ej tillÃ¥tet (reseverat ord för villkorssyntax)Att använda inställningen sekvensiell läsning för källarkiv är ej möjligt vid hopslagningsÃ¥tgärdVARNING! Fil ändrad under läsning för säkerhetskopiering, men inga fler försök tillÃ¥tna: VARNING! Fil ändrad vid läsning för säkerhetskopiering. Inga fler försök för den filen för att inte överskrida bortkastad byt-gräns. Fil är VARNING! Fil ändrad under läsning för säkerhetskopiering. Genomför nytt försök %i av %iVarning! Arkivet är placerat i backupmappen, detta kan skapa en ändlös slinga när arkivet försöker spara sig själv. Du kan antingen lägga till -X "%S.*.%S" till kommandoraden eller ändra platsen för arkivet. (se -h för hjälp) Vill du verkligen fortsätta?VARNING! Detta är en isolerad katalog, inga data eller EA finns i detta arkiv, endast katalogstrukturen kan kontrollerasVARNING: stöd för säkert minne var ej tillgängligt vid kompileringstillfället. Vid stor minnesbelastning kan detta leda till att det lösenord du skall till och lämna kan skrivas till disk (växlingsutrymme) i klartext. Du har härmed varnats!Varning! Ingen fil i den mappen kommer att Ã¥terställas: Varning! Ingen fil i den mappen kommer att slÃ¥s ihop: Varning, %S verkar mer vara namn pÃ¥ en del och inte ett basnamn. Vill du byta det mot %S ?Varning, är du säker du vill avbryta (svara med "%S" för att bekräfta)?Varning, arkivet %S har krypterats. En felaktig nyckel är omöjlig att detektera, det skulle leda till att DAR rapporterar att arkivet var förstört Vi har länkats med en inkompatibel version av libdar. Förväntad version %d.%d.x men blev länkad med version %d.%d.%dVilket är %.2f %% av det totala mängden data) Skrivning till en 'read only generic-file'JANoll är inte en gÃ¥ngbar storlek för en elastisk buffert[ ][ EA ][ Sparad ][--- BORTAGNA DATA ----] [SMUTS][InRef][Sparad]en binär siffra är antingen 0 eller 1avbrytfrÃ¥nvarandefrÃ¥nvarande en tom sträng är ett ogiltigt argumentarkiv # | sökväg | basnamn argumentet mÃ¥ste vara en relativ sökväg'backup hook' funktion (-<, -> or -= options) är bara tillgänglig vid sparande av filer when saving, ignorerardÃ¥ligt strukturerad inod: okänd inodflaggastorblockenhetstöd för 'blowfish' stark krypteringbzip2kan ej läsa CRC: inget escape-märke hittat för denna filkan ej utvärdera en tom kedja i en överskrivningspolicykan inte förse data frÃ¥n en "not saved"-filobjektteckenenhet'compressReset' anropad men 'compressInit' anropades inte förstCRC-fel hos komprimerade dataförstörda komprimerade data hittadekomprimerade data är förstördaförstörd filförstörda data hittade: oegentligheter i LZO-komprimerade dataförstörda data hittade: För stort block med komprimerade datadata har rensats, objekt är nu tomtdatum före 1970 är ej tillÃ¥tetfördröjd inmatninginformation om förstörda poster enheter har inte samma 'major'-tal: %d <--> %dskillnad mot senaste ändringsdatum: %S <--> %Sandra Utvidgade Attributannan filtypannan ägare (uid): %i <--> %iannan ägargrupp (gid): %i <--> %iandra behörigheter: %S <--> %Smappfördelning av inoder 'door' inodsläppt frÃ¥n arkivet och markerad som redan sparadosammanhängande struktur i elastisk buffertfel!utförande av [ %S ] resulterade i felkod: %dexecve() misslyckades. (full processtabell ?)fil finns, och 'DONT_ERASE'-alternativ är inställt.fil ej öppenförstagid-värde för högt för detta system för 'libdar' att kunna Ã¥terställa den säkertgziphÃ¥rdlänkad inodeinformation om hÃ¥rda länkar 'hide_file' kan ej initieras med 'write-only'-filignorerar -O alternativ, dÃ¥ det är värdelöst i denna situationi fil %S rad %Sosammanhängande katalogstrukturej översenstämmande data efter escape-sekvens, kan ej läsa intern datamängsetikettosammanhängande endian mellan U_16 och U_32osammanhängande endian mellan U_16 och U_64osammanhängande endian mellan U_16 och U_IFelaktig delsäkerhetskopiehuvud: delsäkerhetskopiestorlek för litenej komplett datamängdsnamn hittat i ett delsäkerhetskopiehuvudinods senaste ändringsdatum (ctime) är större, EA kan vara annatogiltig decimalsiffraOgiltigt tal givet till -; alternativ: %sdet verkar vara en bugg härsista'libgcrypt' är ej initialiserad och 'libdar' ej tillÃ¥ten att göra sÃ¥list()-metod mÃ¥ste angeslitenlzolzo-komprimeringjagihopslagning med möjlig överskrivningdata saknas för att byggadata saknas till att skapa en specialenhetdata saknas för att bygga en inodnamnad pipenästanejinga Utvidgade Attribut att jämföra me inga Utvidgade Attribut att jämföra me ingen aktuell mapp definieradingen aktuell läsmapp definierad--nodump-funktionen har ej aktiverats vid kompileringstillfället, sÃ¥lunda är den ej tillgängligtingetinte försedd med tillräckligt med plats att dumpa elastisk buffertinte samma storlek: %i <--> %iej sistaöverskrivenenkel filbefintlignärvarande lämnat lösenord är för lÃ¥ngt för det tilldelade minnetÃ¥terställer alla signalhanterare och fortsätter nÃ¥dde filslut innan alla väntade data kunde läsasläs och skrivenbart läsningborttagenborttagenborttagen frÃ¥n arkivetersattrotmappen har ingen föräldramapprot har inte nÃ¥gon föräldramapprot har ingen föräldramappsparad sparad inode : %i andramjuk länksymbolisk länk pekar inte pÃ¥ samma mÃ¥lsystem()-anrop misslyckades: Egenskapen "BehÃ¥lla fil komprimerad" är inte möjlig när man slÃ¥r ihop tvÃ¥ arkiv med olika komprimeringsalgoritmer. (Detta är för en kommande version av dar). Du kan fortfarande slÃ¥ ihop dessa tvÃ¥ arkiv men utan att behÃ¥lla filer komprimerade (med ändÃ¥ vill du kanske använda komprimering (-z eller -y-alternativ) för det resulterande arkivetför stor elastisk buffert eller osammanhängande struktur i elastisk bufferttotalt antal inoder : %i typ %s är varken big eller little endian! FörstÃ¥r ej hantera heltal pÃ¥ ett flyttbart sätt pÃ¥ denna värd, avbryteruid-värde för högt för detta system för 'libdar' att kunna Ã¥terställa den säkertunix sockelokänd komprimeringokänd komprimeringsalgoritm: %Sokänd krypteringsalgoritmOkänd inmatningokänd datatyp i kataloganvändning ; %s Användning: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] [alternativ...] med -+ alternativ är -A alternativ obligatoriskmed -c alternativ är -A alternativ obligatoriskenbart skrivningfel värde givet till argumentet initial_size medan cachen initialiserasjadar-2.5.3/po/dar.pot0000644000175000017430000047774312642474445011164 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: dar 2.5.3\n" "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" "group_id=65612MSGID_BUGS_ADDRESS =atid=511612\n" "POT-Creation-Date: 2016-01-04 14:36+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/libdar/archive_options.hpp:424 src/libdar/fichier_local.cpp:410 #: src/libdar/archive_options.cpp:1383 msgid "Furtive read mode" msgstr "" #: src/libdar/zapette.cpp:102 msgid "Partial request received, aborting\n" msgstr "" #: src/libdar/zapette.cpp:175 msgid "Corrupted data read on pipe" msgstr "" #: src/libdar/zapette.cpp:189 msgid "Input cannot be read" msgstr "" #: src/libdar/zapette.cpp:191 msgid "Cannot write to output" msgstr "" #: src/libdar/zapette.cpp:193 msgid "Data should be read-only" msgstr "" #: src/libdar/zapette.cpp:269 msgid "Cannot skip at end of file" msgstr "" #: src/libdar/zapette.cpp:294 msgid "Received unknown special order" msgstr "" #: src/libdar/zapette.cpp:320 msgid "Cannot read on input" msgstr "" #: src/libdar/zapette.cpp:322 msgid "Cannot write on output" msgstr "" #: src/libdar/zapette.cpp:352 #, c-format msgid "" "Failed driving dar_slave to the end of archive: %S. Trying to open the " "archive from the first bytes" msgstr "" #: src/libdar/zapette.cpp:468 msgid "Uncomplete answer received from peer" msgstr "" #: src/libdar/zapette.cpp:525 msgid "Communication problem with peer, retry ?" msgstr "" #: src/libdar/zapette.cpp:541 src/libdar/zapette.cpp:555 msgid "Incoherent answer from peer" msgstr "" #: src/libdar/zapette.cpp:550 msgid "Bad answer from peer, while closing connection" msgstr "" #: src/libdar/zapette.cpp:560 src/libdar/zapette.cpp:565 #: src/libdar/zapette.cpp:570 msgid "" "Unexpected answer from slave, communication problem or bug may hang the " "operation" msgstr "" #: src/libdar/zapette.cpp:573 msgid "Corrupted data read from pipe" msgstr "" #: src/libdar/cat_detruit.cpp:46 msgid "missing data to build" msgstr "" #: src/libdar/erreurs.hpp:114 msgid "Lack of Memory" msgstr "" #: src/libdar/erreurs.hpp:126 msgid "Lack of Secured Memory" msgstr "" #: src/libdar/erreurs.hpp:169 msgid "" "Cannot handle such a too large integer. Use a full version of libdar " "(compiled to rely on the \"infinint\" integer type) to solve this problem" msgstr "" #: src/libdar/erreurs.hpp:300 msgid "Thread cancellation requested, aborting as soon as possible" msgstr "" #: src/libdar/erreurs.hpp:300 msgid "Thread cancellation requested, aborting as properly as possible" msgstr "" #: src/libdar/filtre.cpp:225 src/libdar/filtre.cpp:581 #: src/libdar/filtre.cpp:1103 src/libdar/filtre.cpp:1279 #: src/libdar/filtre.cpp:2407 msgid "Inspecting directory " msgstr "" #: src/libdar/filtre.cpp:261 #, c-format msgid "" "File %S has changed during backup and is probably not saved in a valid state " "(\"dirty file\"), do you want to consider it for restoration anyway?" msgstr "" #: src/libdar/filtre.cpp:271 msgid "" "File had changed during backup and had been copied another time, restoring " "the next copy of file: " msgstr "" #: src/libdar/filtre.cpp:342 #, c-format msgid "" "The just restored file %S has been marked as dirty (sequential reading can " "only detect the dirty status after restoration), do we remove this just " "restored dirty file?" msgstr "" #: src/libdar/filtre.cpp:349 #, c-format msgid "" "The just restored file %S has been marked as dirty (sequential reading can " "only detect the dirty status after restoration), removing the just restored " "dirty file as it is asked to ignore this type of file" msgstr "" #: src/libdar/filtre.cpp:351 #, c-format msgid "Removing the dirty file %S" msgstr "" #: src/libdar/filtre.cpp:424 msgid " not restored (user choice)" msgstr "" #: src/libdar/filtre.cpp:428 msgid "No file in this directory will be restored." msgstr "" #: src/libdar/filtre.cpp:446 msgid "Error while restoring " msgstr "" #: src/libdar/filtre.cpp:451 msgid "Warning! No file in that directory will be restored: " msgstr "" #: src/libdar/filtre.cpp:620 msgid "Recording hard link into the archive: " msgstr "" #: src/libdar/filtre.cpp:687 #, c-format msgid "" "SECURITY WARNING! SUSPICIOUS FILE %S: ctime changed since archive of " "reference was done, while no other inode information changed" msgstr "" #: src/libdar/filtre.cpp:955 msgid "Error while saving " msgstr "" #: src/libdar/filtre.cpp:970 msgid "NO FILE IN THAT DIRECTORY CAN BE SAVED." msgstr "" #: src/libdar/filtre.cpp:975 msgid "Cannot write down the archive: " msgstr "" #: src/libdar/filtre.cpp:992 msgid ", compression ratio " msgstr "" #: src/libdar/filtre.cpp:998 #, c-format msgid "Finished Inspecting directory %S , saved %S%S" msgstr "" #: src/libdar/filtre.cpp:1095 msgid "SKIPPED (hard link in sequential read mode): " msgstr "" #: src/libdar/filtre.cpp:1131 msgid "OK " msgstr "" #: src/libdar/filtre.cpp:1142 src/libdar/filtre.cpp:1174 msgid "DIFF " msgstr "" #: src/libdar/filtre.cpp:1174 msgid ": file not present in filesystem" msgstr "" #: src/libdar/filtre.cpp:1226 msgid "ERR " msgstr "" #: src/libdar/filtre.cpp:1301 msgid "Data" msgstr "" #: src/libdar/filtre.cpp:1310 msgid "Can't read saved data." msgstr "" #: src/libdar/filtre.cpp:1356 msgid "CRC error: data corruption." msgstr "" #: src/libdar/filtre.cpp:1429 msgid "OK " msgstr "" #: src/libdar/filtre.cpp:1464 msgid "ERR " msgstr "" #: src/libdar/filtre.cpp:1529 msgid "" "Decremental mode is useless when merging is not applied to both an archive " "of reference and an auxiliary archive of reference. Ignore decremental mode " "and continue?" msgstr "" #: src/libdar/filtre.cpp:1633 msgid "first" msgstr "" #: src/libdar/filtre.cpp:1636 msgid "second" msgstr "" #: src/libdar/filtre.cpp:1639 msgid "next" msgstr "" #: src/libdar/filtre.cpp:1642 #, c-format msgid "Merging/filtering files from the %s archive..." msgstr "" #: src/libdar/filtre.cpp:1724 msgid "overwritten" msgstr "" #: src/libdar/filtre.cpp:1728 src/libdar/filtre.cpp:1772 msgid "dropped from the archive and marked as already saved" msgstr "" #: src/libdar/filtre.cpp:1731 msgid "removed" msgstr "" #: src/libdar/filtre.cpp:1736 #, c-format msgid "Data of file %S is about to be %S, proceed?" msgstr "" #: src/libdar/filtre.cpp:1765 msgid "replaced" msgstr "" #: src/libdar/filtre.cpp:1768 msgid "removed from the archive" msgstr "" #: src/libdar/filtre.cpp:1775 msgid "merged with possible overwriting" msgstr "" #: src/libdar/filtre.cpp:1780 #, c-format msgid "EA and FSA of file %S are about to be %S, proceed?" msgstr "" #: src/libdar/filtre.cpp:1844 #, c-format msgid "" "EA and FSA of file %S from first archive have been updated with those of " "same named file of the auxiliary archive" msgstr "" #: src/libdar/filtre.cpp:1854 #, c-format msgid "" "EA of file %S from first archive have been dropped and marked as already " "saved" msgstr "" #: src/libdar/filtre.cpp:1860 #, c-format msgid "" "FSA of file %S from first archive have been dropped and marked as already " "saved" msgstr "" #: src/libdar/filtre.cpp:1870 src/libdar/filtre.cpp:2007 #, c-format msgid "EA of file %S from first archive have been removed" msgstr "" #: src/libdar/filtre.cpp:1878 #, c-format msgid "FSA of file %S from first archive have been removed" msgstr "" #: src/libdar/filtre.cpp:1892 #, c-format msgid "Data of file %S from first archive has been preserved from overwriting" msgstr "" #: src/libdar/filtre.cpp:1943 #, c-format msgid "" "Data of file %S taken from the first archive of reference has been removed" msgstr "" #: src/libdar/filtre.cpp:1946 #, c-format msgid "" "Data of file %S taken from the first archive of reference has been " "overwritten" msgstr "" #: src/libdar/filtre.cpp:1980 #, c-format msgid "EA of file %S has been overwritten" msgstr "" #: src/libdar/filtre.cpp:1984 src/libdar/filtre.cpp:2000 #, c-format msgid "EA of file %S has been overwritten and marked as already saved" msgstr "" #: src/libdar/filtre.cpp:1990 src/libdar/filtre.cpp:1995 #, c-format msgid "" "EA of file %S from first archive have been updated with those of the same " "named file of the auxiliary archive" msgstr "" #: src/libdar/filtre.cpp:2279 msgid " not merged (user choice)" msgstr "" #: src/libdar/filtre.cpp:2283 msgid "No file in this directory will be considered for merging." msgstr "" #: src/libdar/filtre.cpp:2303 msgid "Error while considering file " msgstr "" #: src/libdar/filtre.cpp:2307 msgid "Warning! No file in this directory will be considered for merging: " msgstr "" #: src/libdar/filtre.cpp:2343 msgid "" "File selection has been aborted. Now building the resulting archive with the " "already selected files" msgstr "" #: src/libdar/filtre.cpp:2509 msgid "Adding Hard link to archive: " msgstr "" #: src/libdar/filtre.cpp:2580 msgid "failed reading CRC from file: " msgstr "" #: src/libdar/filtre.cpp:2608 msgid "Failed reading CRC for EA: " msgstr "" #: src/libdar/filtre.cpp:2619 msgid "Error met while reading next entry: " msgstr "" #: src/libdar/filtre.cpp:2685 msgid "Resaving file without compression: " msgstr "" #: src/libdar/filtre.cpp:2689 #, c-format msgid "Adding %S to archive: %S" msgstr "" #: src/libdar/filtre.cpp:2809 msgid "Copied data does not match CRC" msgstr "" #: src/libdar/filtre.cpp:2926 msgid " : Failed resaving uncompressed the inode data" msgstr "" #: src/libdar/filtre.cpp:2936 msgid "" " : Resaving uncompressed the inode data to gain space is not possible, " "keeping data compressed" msgstr "" #: src/libdar/filtre.cpp:2956 #, c-format msgid "" "File has disappeared while we were reading it, cannot check whether it has " "changed during its backup: %S" msgstr "" #: src/libdar/filtre.cpp:2991 #, c-format msgid "" "WARNING! File modified while reading it for backup. Performing retry %i of %i" msgstr "" #: src/libdar/filtre.cpp:3004 msgid "" "WARNING! File modified while reading it for backup. No more retry for that " "file to not exceed the wasted byte limit. File is " msgstr "" #: src/libdar/filtre.cpp:3011 msgid "" "WARNING! File modified while reading it for backup, but no more retry " "allowed: " msgstr "" #: src/libdar/filtre.cpp:3071 msgid "Saving Extended Attributes for " msgstr "" #: src/libdar/filtre.cpp:3138 msgid "Error saving Extended Attributes for " msgstr "" #: src/libdar/filtre.cpp:3170 msgid "Saving Filesystem Specific Attributes for " msgstr "" #: src/libdar/filtre.cpp:3228 msgid "Error saving Filesystem Specific Attributes for " msgstr "" #: src/libdar/archive.cpp:105 #, c-format msgid "Opening archive %s ..." msgstr "" #: src/libdar/archive.cpp:141 #, c-format msgid "" "Opening the archive of reference %s to retreive the isolated catalog ... " msgstr "" #: src/libdar/archive.cpp:152 msgid "" "Reading the archive of reference from pipe or standard input is not possible" msgstr "" #: src/libdar/archive.cpp:154 msgid "" "The basename '+' is reserved for special a purpose that has no meaning in " "this context" msgstr "" #: src/libdar/archive.cpp:196 msgid "Error while opening the archive of reference: " msgstr "" #: src/libdar/archive.cpp:213 msgid "Loading isolated catalogue in memory..." msgstr "" #: src/libdar/archive.cpp:226 msgid "" "Archive of reference is not signed properly (no the same signatories for the " "archive and the internal catalogue), do we continue?" msgstr "" #: src/libdar/archive.cpp:233 msgid "" "The archive and the isolated catalogue do not correspond to the same data, " "they are thus incompatible between them" msgstr "" #: src/libdar/archive.cpp:242 msgid "Loading catalogue into memory..." msgstr "" #: src/libdar/archive.cpp:254 src/libdar/archive.cpp:289 #: src/libdar/escape_catalogue.cpp:575 msgid "" "Archive internal catalogue is not identically signed as the archive itself, " "this might be the sign the archive has been compromised" msgstr "" #: src/libdar/archive.cpp:268 msgid "" "No data found in that archive, sequentially reading the catalogue found at " "the end of the archive..." msgstr "" #: src/libdar/archive.cpp:299 msgid "" "The catalogue will be filled while sequentially reading the archive, " "preparing the data structure..." msgstr "" #: src/libdar/archive.cpp:339 #, c-format msgid "" "LAX MODE: The end of the archive is corrupted, cannot get the archive " "contents (the \"catalogue\")" msgstr "" #: src/libdar/archive.cpp:340 msgid "" "LAX MODE: Do you want to bypass some sanity checks and try again reading the " "archive contents (this may take some time, this may also fail)?" msgstr "" #: src/libdar/archive.cpp:356 #, c-format msgid "" "LAX MODE: Could not find a whole catalogue in the archive. If you have an " "isolated catalogue, stop here and use it as backup of the internal " "catalogue, else continue but be advised that all data will not be able to be " "retrieved..." msgstr "" #: src/libdar/archive.cpp:357 msgid "" "LAX MODE: Do you want to try finding portions of the original catalogue if " "some remain (this may take even more time and in any case, it will only " "permit to recover some files, at most)?" msgstr "" #: src/libdar/archive.cpp:584 src/libdar/archive.cpp:1726 msgid "Compression_level must be between 1 and 9 included" msgstr "" #: src/libdar/archive.cpp:586 src/libdar/archive.cpp:1728 msgid "" "\"first_file_size\" cannot be different from zero if \"file_size\" is equal " "to zero" msgstr "" #: src/libdar/archive.cpp:588 src/libdar/archive.cpp:1730 msgid "Crypto block size must be greater than 10 bytes" msgstr "" #: src/libdar/archive.cpp:616 msgid "Both reference archive are nullptr, cannot merge archive from nothing" msgstr "" #: src/libdar/archive.cpp:645 msgid "" "the \"Keep file compressed\" feature is not possible when merging two " "archives using different compression algorithms (This is for a future " "version of dar). You can still merge these two archives but without keeping " "file compressed (thus you will probably like to use compression (-z or -y " "options) for the resulting archive" msgstr "" #: src/libdar/archive.cpp:772 src/libdar/archive.cpp:1064 msgid "This archive is not exploitable, check documentation for more" msgstr "" #: src/libdar/archive.cpp:828 msgid "Error while restoring data: " msgstr "" #: src/libdar/archive.cpp:859 src/libdar/archive.cpp:1150 msgid "" "This archive is not exploitable, check the archive class usage in the API " "documentation" msgstr "" #: src/libdar/archive.cpp:867 src/libdar/archive.cpp:869 #: src/libdar/criterium.cpp:662 src/libdar/criterium.cpp:734 #: src/libdar/criterium.cpp:814 msgid "yes" msgstr "" #: src/libdar/archive.cpp:867 src/libdar/archive.cpp:869 msgid "no" msgstr "" #: src/libdar/archive.cpp:868 src/libdar/header_version.cpp:118 #: src/libdar/crypto.cpp:42 msgid "none" msgstr "" #: src/libdar/archive.cpp:873 #, c-format msgid "Archive version format : %s\n" msgstr "" #: src/libdar/archive.cpp:874 #, c-format msgid "Compression algorithm used : %S\n" msgstr "" #: src/libdar/archive.cpp:875 #, c-format msgid "Symmetric key encryption used : %S\n" msgstr "" #: src/libdar/archive.cpp:876 #, c-format msgid "Asymmetric key encryption used : %S\n" msgstr "" #: src/libdar/archive.cpp:877 #, c-format msgid "Archive is signed : %S\n" msgstr "" #: src/libdar/archive.cpp:878 #, c-format msgid "Sequential reading marks : %s\n" msgstr "" #: src/libdar/archive.cpp:878 msgid "present" msgstr "" #: src/libdar/archive.cpp:878 msgid "absent" msgstr "" #: src/libdar/archive.cpp:880 #, c-format msgid "Catalogue size in archive : %i bytes\n" msgstr "" #: src/libdar/archive.cpp:882 #, c-format msgid "Catalogue size in archive : N/A\n" msgstr "" #: src/libdar/archive.cpp:883 #, c-format msgid "" "User comment : %S\n" "\n" msgstr "" #: src/libdar/archive.cpp:889 #, c-format msgid "Archive is composed of %i file(s)\n" msgstr "" #: src/libdar/archive.cpp:891 #, c-format msgid "File size: %i bytes\n" msgstr "" #: src/libdar/archive.cpp:895 #, c-format msgid "First file size : %i bytes\n" msgstr "" #: src/libdar/archive.cpp:896 #, c-format msgid "File size : %i bytes\n" msgstr "" #: src/libdar/archive.cpp:897 #, c-format msgid "Last file size : %i bytes\n" msgstr "" #: src/libdar/archive.cpp:902 #, c-format msgid "Archive total size is : %i bytes\n" msgstr "" #: src/libdar/archive.cpp:910 #, c-format msgid "Archive size is: %i bytes\n" msgstr "" #: src/libdar/archive.cpp:911 #, c-format msgid "Previous archive size does not include headers present in each slice\n" msgstr "" #: src/libdar/archive.cpp:914 #, c-format msgid "Archive size is unknown (reading from a pipe)" msgstr "" #: src/libdar/archive.cpp:934 #, c-format msgid "" "The overall archive size includes %i byte(s) wasted due to bad compression " "ratio" msgstr "" #: src/libdar/archive.cpp:937 msgid "The global data compression ratio is: " msgstr "" #: src/libdar/archive.cpp:943 #, c-format msgid "" "\n" "WARNING! This archive only contains the contents of another archive, it can " "only be used as reference for differential backup or as rescue in case of " "corruption of the original archive's content. You cannot restore any data " "from this archive alone\n" msgstr "" #: src/libdar/archive.cpp:999 #, c-format msgid "" "Using user provided modified slicing (first slice = %i bytes, other slices = " "%i bytes)" msgstr "" #: src/libdar/archive.cpp:1002 msgid "" "Using the slice layout of the archive of reference recorded at the time this " "isolated catalogue was done\n" " Note: if this reference has been resliced this isolated catalogue has been " "created, the resulting slicing information given here will be wrong and will " "probably lead to an error. Check documentation to know hos to manually " "specify the slicing to use" msgstr "" #: src/libdar/archive.cpp:1012 msgid "" "Warning: No slice layout of the archive of reference has been recorded in " "this isolated catalogue. The additional slicing information you provided may " "still lead the operation to fail because the archive has an _unsupported_ " "(too old) format for this feature" msgstr "" #: src/libdar/archive.cpp:1014 msgid "" "No slice layout of the archive of reference for the current isolated " "catalogue is available, cannot provide slicing information, aborting" msgstr "" #: src/libdar/archive.cpp:1030 msgid "Error while listing archive contents: " msgstr "" #: src/libdar/archive.cpp:1113 msgid "Error while comparing archive with filesystem: " msgstr "" #: src/libdar/archive.cpp:1162 msgid "" "WARNING! This is an isolated catalogue, no data or EA is present in this " "archive, only the catalogue structure can be checked" msgstr "" #: src/libdar/archive.cpp:1197 msgid "A problem occurred while reading this archive contents: " msgstr "" #: src/libdar/archive.cpp:1212 msgid "Error while testing archive: " msgstr "" #: src/libdar/archive.cpp:1733 msgid "" "nodump flag feature has not been activated at compilation time, it is thus " "not available" msgstr "" #: src/libdar/archive.cpp:1792 #, c-format msgid "" "WARNING! The archive is located in the directory to backup, this may create " "an endless loop when the archive will try to save itself. You can either add " "-X \"%S.*.%S\" on the command line, or change the location of the archive " "(see -h for help). Do you really want to continue?" msgstr "" #: src/libdar/archive.cpp:1959 msgid "Ready to start writing down the archive?" msgstr "" #: src/libdar/archive.cpp:1999 msgid "Building the catalog object..." msgstr "" #: src/libdar/archive.cpp:2014 #, c-format msgid "Error while fetching information for %S: " msgstr "" #: src/libdar/archive.cpp:2058 msgid "Processing files for backup..." msgstr "" #: src/libdar/archive.cpp:2113 msgid "Processing files for merging..." msgstr "" #: src/libdar/archive.cpp:2170 msgid "" "Adding reference to files that have been destroyed since reference backup..." msgstr "" #: src/libdar/archive.cpp:2217 msgid "Error while saving data: " msgstr "" #: src/libdar/archive.cpp:2279 msgid "WARNING! Incorrect signature found for archive, continue anyway?" msgstr "" #: src/libdar/archive.cpp:2309 msgid "" "Cannot get data name of the archive, this archive is not completely " "initialized" msgstr "" #: src/libdar/archive.cpp:2334 msgid "" "This archive contains an isolated catalogue, it cannot be used for this " "operation. It can only be used as reference for a incremental/differential " "backup or as backup of the original archive's catalogue" msgstr "" #: src/libdar/archive.cpp:2341 msgid "" "LAX MODE: Archive seems to be only an isolated catalogue (no data in it), " "Can I assume data corruption occurred and consider the archive as being a " "real archive?" msgstr "" #: src/libdar/archive.cpp:2346 msgid "Error while fetching archive properties: " msgstr "" #: src/libdar/archive.cpp:2371 msgid "Sorry, file size is unknown at this step of the program.\n" msgstr "" #: src/libdar/archive.cpp:2449 #, c-format msgid "" "libgcrypt version < %s. Ligcrypt used has a bug that leads md5 and sha1 hash " "results to be erroneous for files larger than 256 Gio (gibioctet), do you " "really want to spend CPU cycles calculating a useless hash?" msgstr "" #: src/libdar/cat_inode.cpp:158 msgid "badly structured inode: unknown inode flag" msgstr "" #: src/libdar/cat_inode.cpp:169 src/libdar/cat_inode.cpp:172 #: src/libdar/cat_inode.cpp:182 msgid "missing data to build an inode" msgstr "" #: src/libdar/cat_inode.cpp:280 msgid "badly structured inode: unknown inode flag for FSA" msgstr "" #: src/libdar/cat_inode.cpp:394 msgid "different file type" msgstr "" #: src/libdar/cat_inode.cpp:399 #, c-format msgid "different owner (uid): %i <--> %i" msgstr "" #: src/libdar/cat_inode.cpp:405 #, c-format msgid "different owner group (gid): %i <--> %i" msgstr "" #: src/libdar/cat_inode.cpp:411 #, c-format msgid "different permission: %S <--> %S" msgstr "" #: src/libdar/cat_inode.cpp:419 #, c-format msgid "difference of last modification date: %S <--> %S" msgstr "" #: src/libdar/cat_inode.cpp:434 msgid "different Extended Attributes" msgstr "" #: src/libdar/cat_inode.cpp:440 msgid "no Extended Attribute to compare with" msgstr "" #: src/libdar/cat_inode.cpp:442 src/libdar/cat_inode.cpp:463 msgid "" "Cannot compare EA: EA support has not been activated at compilation time" msgstr "" #: src/libdar/cat_inode.cpp:456 msgid "inode last change date (ctime) greater, EA might be different" msgstr "" #: src/libdar/cat_inode.cpp:461 msgid "no Extended Attributes to compare with" msgstr "" #: src/libdar/cat_inode.cpp:490 msgid "different Filesystem Specific Attributes" msgstr "" #: src/libdar/cat_inode.cpp:496 msgid "No Filesystem Specific Attribute to compare with" msgstr "" #: src/libdar/cat_inode.cpp:504 msgid "inode last change date (ctime) greater, FSA might be different" msgstr "" #: src/libdar/cat_inode.cpp:507 msgid "Filesystem Specific Attribute are missing" msgstr "" #: src/libdar/cat_inode.cpp:793 msgid "CRC error detected while reading EA" msgstr "" #: src/libdar/cat_inode.cpp:937 msgid "" "Error while reading CRC for EA from the archive: No escape mark found for " "that file" msgstr "" #: src/libdar/cat_inode.cpp:1166 msgid "CRC error detected while reading FSA" msgstr "" #: src/libdar/cat_inode.cpp:1290 msgid "" "Error while reading CRC for FSA from the archive: No escape mark found for " "that file" msgstr "" #: src/libdar/scrambler.cpp:34 msgid "Key cannot be an empty string" msgstr "" #: src/libdar/tools.cpp:158 src/libdar/criterium.cpp:880 #: src/dar_suite/dar_suite.cpp:287 msgid "YES" msgstr "" #: src/libdar/tools.cpp:158 src/libdar/criterium.cpp:881 #: src/dar_suite/dar_suite.cpp:289 msgid "NO" msgstr "" #: src/libdar/tools.cpp:239 msgid "Not a zero terminated string in file" msgstr "" #: src/libdar/tools.cpp:277 #, c-format msgid "Cannot get file size: %s" msgstr "" #: src/libdar/tools.cpp:329 #, c-format msgid "Unknown suffix [%c] in string %S" msgstr "" #: src/libdar/tools.cpp:503 msgid "Cannot read \"fcntl\" file's flags : " msgstr "" #: src/libdar/tools.cpp:509 msgid "Cannot set \"fcntl\" file's flags : " msgstr "" #: src/libdar/tools.cpp:589 src/libdar/tools.cpp:594 src/libdar/tools.cpp:606 #: src/libdar/tools.cpp:611 msgid "Invalid number: " msgstr "" #: src/libdar/tools.cpp:710 msgid "date before 1970 is not allowed" msgstr "" #: src/libdar/tools.cpp:715 msgid "Incorrect month" msgstr "" #: src/libdar/tools.cpp:720 msgid "Incorrect day of month" msgstr "" #: src/libdar/tools.cpp:725 msgid "Incorrect hour" msgstr "" #: src/libdar/tools.cpp:730 msgid "Incorrect minute" msgstr "" #: src/libdar/tools.cpp:735 msgid "Incorrect second" msgstr "" #: src/libdar/tools.cpp:739 msgid "Bad formatted date expression" msgstr "" #: src/libdar/tools.cpp:854 msgid "Given date must be in the past" msgstr "" #: src/libdar/tools.cpp:889 src/libdar/tools.cpp:978 msgid "Error while calling fork() to launch dar: " msgstr "" #: src/libdar/tools.cpp:903 src/libdar/tools.cpp:1008 msgid "Unexpected error while waiting for dar to terminate: " msgstr "" #: src/libdar/tools.cpp:909 src/libdar/tools.cpp:1014 msgid "DAR terminated upon signal reception: " msgstr "" #: src/libdar/tools.cpp:915 src/libdar/tools.cpp:1020 msgid " . Retry to launch dar as previously ?" msgstr "" #: src/libdar/tools.cpp:920 src/libdar/tools.cpp:927 src/libdar/tools.cpp:1025 #: src/libdar/tools.cpp:1032 msgid " Continue anyway ?" msgstr "" #: src/libdar/tools.cpp:925 src/libdar/tools.cpp:1030 msgid "DAR sub-process has terminated with exit code " msgstr "" #: src/libdar/tools.cpp:1129 #, c-format msgid " Libz compression (gzip) : %s\n" msgstr "" #: src/libdar/tools.cpp:1130 #, c-format msgid " Libbz2 compression (bzip2) : %s\n" msgstr "" #: src/libdar/tools.cpp:1131 #, c-format msgid " Liblzo2 compression (lzo) : %s\n" msgstr "" #: src/libdar/tools.cpp:1132 #, c-format msgid " Liblzma compression (xz) : %s\n" msgstr "" #: src/libdar/tools.cpp:1133 #, c-format msgid " Strong encryption (libgcrypt): %s\n" msgstr "" #: src/libdar/tools.cpp:1134 #, c-format msgid " Public key ciphers (gpgme) : %s\n" msgstr "" #: src/libdar/tools.cpp:1135 #, c-format msgid " Extended Attributes support : %s\n" msgstr "" #: src/libdar/tools.cpp:1136 #, c-format msgid " Large files support (> 2GB) : %s\n" msgstr "" #: src/libdar/tools.cpp:1137 #, c-format msgid " ext2fs NODUMP flag support : %s\n" msgstr "" #: src/libdar/tools.cpp:1138 #, c-format msgid " Special allocation scheme : %s\n" msgstr "" #: src/libdar/tools.cpp:1140 #, c-format msgid " Integer size used : unlimited\n" msgstr "" #: src/libdar/tools.cpp:1142 #, c-format msgid " Integer size used : %d bits\n" msgstr "" #: src/libdar/tools.cpp:1143 #, c-format msgid " Thread safe support : %s\n" msgstr "" #: src/libdar/tools.cpp:1144 #, c-format msgid " Furtive read mode support : %s\n" msgstr "" #: src/libdar/tools.cpp:1145 #, c-format msgid " Linux ext2/3/4 FSA support : %s\n" msgstr "" #: src/libdar/tools.cpp:1146 #, c-format msgid " Mac OS X HFS+ FSA support : %s\n" msgstr "" #: src/libdar/tools.cpp:1151 msgid "big" msgstr "" #: src/libdar/tools.cpp:1154 msgid "little" msgstr "" #: src/libdar/tools.cpp:1157 msgid "error!" msgstr "" #: src/libdar/tools.cpp:1162 #, c-format msgid " Detected system/CPU endian : %s" msgstr "" #: src/libdar/tools.cpp:1163 #, c-format msgid " Posix fadvise support : %s" msgstr "" #: src/libdar/tools.cpp:1164 #, c-format msgid " Large dir. speed optimi. : %s" msgstr "" #: src/libdar/tools.cpp:1169 #, c-format msgid " Timestamp read accuracy : %S\n" msgstr "" #: src/libdar/tools.cpp:1174 #, c-format msgid " Timestamp write accuracy : %S\n" msgstr "" #: src/libdar/tools.cpp:1175 #, c-format msgid " Restores dates of symlinks : %s\n" msgstr "" #: src/libdar/tools.cpp:1177 #, c-format msgid " Can uses multiple threads : %s\n" msgstr "" #: src/libdar/tools.cpp:1234 #, c-format msgid "" "Warning, %S seems more to be a slice name than a base name. Do you want to " "replace it by %S ?" msgstr "" #: src/libdar/tools.cpp:1239 #, c-format msgid "OK, keeping %S as basename" msgstr "" #: src/libdar/tools.cpp:1274 msgid "Cannot get full path of current working directory: " msgstr "" #: src/libdar/tools.cpp:1301 msgid "nullptr argument given to tools_readlink()" msgstr "" #: src/libdar/tools.cpp:1303 msgid "Empty string given as argument to tools_readlink()" msgstr "" #: src/libdar/tools.cpp:1330 #, c-format msgid "Cannot read file information for %s : %s" msgstr "" #: src/libdar/tools.cpp:1428 msgid "Cannot set birth time: " msgstr "" #: src/libdar/tools.cpp:1458 msgid "Cannot set last access and last modification time: " msgstr "" #: src/libdar/tools.cpp:1542 msgid "Aborting program: child process died unexpectedly" msgstr "" #: src/libdar/tools.cpp:1550 #, c-format msgid "Error trying to run %s: %s" msgstr "" #: src/libdar/tools.cpp:1553 msgid "execvp() failed but did not returned error code" msgstr "" #: src/libdar/tools.cpp:1625 src/libdar/tools.cpp:1633 #, c-format msgid "Error met while retrieving current time: %S" msgstr "" #: src/libdar/tools.cpp:1777 #, c-format msgid "Removing file %s" msgstr "" #: src/libdar/tools.cpp:1781 #, c-format msgid "Error removing file %s: %s" msgstr "" #: src/libdar/tools.cpp:1807 #, c-format msgid "" "Overwriting not allowed while a slice of a previous archive with the same " "basename has been found in the %s directory, Operation aborted" msgstr "" #: src/libdar/tools.cpp:1813 #, c-format msgid "" "At least one slice of an old archive with the same name remains in the " "directory %s. It is advised to remove all the old archive's slices before " "creating an archive of same name. Can I remove these old slices?" msgstr "" #: src/libdar/tools.cpp:1864 src/libdar/tools.cpp:1871 #, c-format msgid "Cannot get inode information for %s: %s" msgstr "" #: src/libdar/tools.cpp:1881 msgid "Current Working Directory cannot be a relative path" msgstr "" #: src/libdar/tools.cpp:1898 msgid "Cannot block signals: " msgstr "" #: src/libdar/tools.cpp:1908 msgid "Cannot unblock signals: " msgstr "" #: src/libdar/tools.cpp:1928 src/libdar/tools.cpp:1949 #, c-format msgid "Cannot get last modification date: %s" msgstr "" #: src/libdar/tools.cpp:1953 #, c-format msgid "Cannot get size of %S: not a plain file" msgstr "" #: src/libdar/tools.cpp:1966 #, c-format msgid "Cannot get mtime: %s" msgstr "" #: src/libdar/tools.cpp:2072 #, c-format msgid "Parse error: Unmatched `%c'" msgstr "" #: src/libdar/tools.cpp:2125 msgid "Unknown substitution string: %" msgstr "" #: src/libdar/tools.cpp:2132 msgid "" "last char of user command-line to execute is '%', (use '%%' instead to avoid " "this message)" msgstr "" #: src/libdar/tools.cpp:2186 msgid "execve() failed. (process table is full ?)" msgstr "" #: src/libdar/tools.cpp:2188 msgid "system() call failed: " msgstr "" #: src/libdar/tools.cpp:2190 #, c-format msgid "execution of [ %S ] returned error code: %d" msgstr "" #: src/libdar/tools.cpp:2197 msgid "Error during user command line execution: " msgstr "" #: src/libdar/tools.cpp:2197 msgid " . Retry command-line ?" msgstr "" #: src/libdar/tools.cpp:2202 msgid "Ignore previous error on user command line and continue ?" msgstr "" #: src/libdar/tools.cpp:2242 msgid "Fatal error on user command line: " msgstr "" #: src/libdar/tools.cpp:2368 src/libdar/tools.cpp:2374 msgid "Badly formated octal number" msgstr "" #: src/libdar/tools.cpp:2471 msgid "Cannot get effective permission given a file descriptor: " msgstr "" #: src/libdar/tools.cpp:2487 #, c-format msgid "Error while setting file permission: %s" msgstr "" #: src/libdar/tools.cpp:2508 msgid "An empty string is not a valid user name" msgstr "" #: src/libdar/tools.cpp:2546 src/libdar/tools.cpp:2568 msgid "Unknown user" msgstr "" #: src/libdar/tools.cpp:2548 src/libdar/tools.cpp:2570 #, c-format msgid "Error found while looking for UID of user %s: %S" msgstr "" #: src/libdar/tools.cpp:2578 src/libdar/tools.cpp:2672 msgid "" "Cannot convert username to uid in statically linked binary, either directly " "provide the UID or run libdar from a dynamically linked executable" msgstr "" #: src/libdar/tools.cpp:2603 msgid "An empty string is not a valid group name" msgstr "" #: src/libdar/tools.cpp:2639 src/libdar/tools.cpp:2662 msgid "Unknown group" msgstr "" #: src/libdar/tools.cpp:2641 #, c-format msgid "Error found while looking fo GID of group %s: %S" msgstr "" #: src/libdar/tools.cpp:2664 #, c-format msgid "Error found while looking for GID of group %s: %S" msgstr "" #: src/libdar/tools.cpp:2701 #, c-format msgid "Error while setting file user ownership: %s" msgstr "" #: src/libdar/tools.cpp:2838 msgid "Error while fetching hostname: " msgstr "" #: src/libdar/tools.cpp:2868 msgid "Worse" msgstr "" #: src/libdar/tools.cpp:2888 #, c-format msgid "Error code %d to message conversion failed" msgstr "" #: src/libdar/tools.cpp:2943 msgid "Invalid wide-char found in string: " msgstr "" #: src/libdar/deci.cpp:46 msgid "invalid decimal digit" msgstr "" #: src/libdar/deci.cpp:132 msgid "an empty string is an invalid argument" msgstr "" #: src/libdar/elastic.cpp:73 msgid "Zero is not a valid size for an elastic buffer" msgstr "" #: src/libdar/elastic.cpp:75 msgid "Size too large for an elastic buffer" msgstr "" #: src/libdar/elastic.cpp:92 src/libdar/elastic.cpp:98 #: src/libdar/elastic.cpp:128 src/libdar/elastic.cpp:134 #: src/libdar/elastic.cpp:150 src/libdar/elastic.cpp:158 #: src/libdar/elastic.cpp:187 src/libdar/elastic.cpp:195 #: src/libdar/elastic.cpp:205 msgid "elastic buffer incoherent structure" msgstr "" #: src/libdar/elastic.cpp:124 src/libdar/elastic.cpp:183 msgid "too large elastic buffer or elastic buffer incoherent structure" msgstr "" #: src/libdar/elastic.cpp:212 msgid "not enough space provided to dump the elastic buffer" msgstr "" #: src/libdar/cat_mirage.cpp:141 msgid "Incoherent catalogue structure: hard linked inode's data not found" msgstr "" #: src/libdar/cat_mirage.cpp:178 msgid "Incoherent catalogue structure: hard linked data is not an inode" msgstr "" #: src/libdar/cat_mirage.cpp:215 msgid "Incoherent catalogue structure: duplicated hard linked inode's data" msgstr "" #: src/libdar/cat_mirage.cpp:229 msgid "" "Incoherent catalogue structure: unknown status flag for hard linked inode" msgstr "" #: src/libdar/secu_string.cpp:102 src/libdar/secu_string.cpp:141 msgid "Error while reading data for a secure memory:" msgstr "" #: src/libdar/secu_string.cpp:119 msgid "appending data over secure_memory its end" msgstr "" #: src/libdar/secu_string.cpp:133 msgid "appending data after the end of a secure_memory" msgstr "" #: src/libdar/secu_string.cpp:136 msgid "Cannot receive that much data in regard to the allocated memory" msgstr "" #: src/libdar/secu_string.cpp:154 msgid "Cannot reduce the string to a size that is larger than its current size" msgstr "" #: src/libdar/secu_string.cpp:164 msgid "secu_string randomization requested exceeds storage capacity" msgstr "" #: src/libdar/secu_string.cpp:177 msgid "Out of range index requested for a secu_string" msgstr "" #: src/libdar/fichier_local.cpp:151 msgid "Error getting size of file: " msgstr "" #: src/libdar/fichier_local.cpp:261 msgid "Error getting file reading position: " msgstr "" #: src/libdar/fichier_local.cpp:293 src/libdar/fichier_local.cpp:295 msgid "Error while reading from file: " msgstr "" #: src/libdar/fichier_local.cpp:344 src/libdar/fichier_local.cpp:350 msgid "Error while writing to file: " msgstr "" #: src/libdar/fichier_local.cpp:428 msgid "" "No space left for inode, you have the opportunity to make some room now. " "When done : can we continue ?" msgstr "" #: src/libdar/fichier_local.cpp:437 msgid "Cannot open file : " msgstr "" #: src/libdar/fichier_local.cpp:460 #, c-format msgid "Cannot dup() filedescriptor while copying \"fichier_local\" object: %s" msgstr "" #: src/libdar/generic_file.cpp:120 msgid "Reading ahead a write only generic_file" msgstr "" #: src/libdar/generic_file.cpp:135 msgid "Reading a write only generic_file" msgstr "" #: src/libdar/generic_file.cpp:145 msgid "Writing to a read only generic_file" msgstr "" #: src/libdar/generic_file.cpp:315 msgid "Cannot compare files in write only mode" msgstr "" #: src/libdar/generic_file.cpp:402 msgid "Cannot sync write on a read-only generic_file" msgstr "" #: src/libdar/generic_file.cpp:413 msgid "Cannot flush read a write-only generic_file" msgstr "" #: src/libdar/generic_file.cpp:489 msgid "read only" msgstr "" #: src/libdar/generic_file.cpp:492 msgid "write only" msgstr "" #: src/libdar/generic_file.cpp:495 msgid "read and write" msgstr "" #: src/libdar/header_version.cpp:74 msgid "LAX MODE: Failed to read the archive header's format version." msgstr "" #: src/libdar/header_version.cpp:77 #, c-format msgid "" "LAX MODE: Please provide the archive format: You can use the table at %s to " "find the archive format depending on the release version, (for example if " "this archive has been created using dar release 2.3.4 to 2.3.7 answer \"6\" " "without the quotes here): " msgstr "" #: src/libdar/header_version.cpp:82 #, c-format msgid "LAX MODE: \"%S\" is not a valid archive format" msgstr "" #: src/libdar/header_version.cpp:88 #, c-format msgid "LAX MODE: Using archive format \"%d\"?" msgstr "" #: src/libdar/header_version.cpp:117 msgid "" "LAX MODE: Unknown compression algorithm used, assuming data corruption " "occurred. Please help me, answering with one of the following words \"none" "\", \"gzip\", \"bzip2\" or \"lzo\" at the next prompt:" msgstr "" #: src/libdar/header_version.cpp:120 msgid "gzip" msgstr "" #: src/libdar/header_version.cpp:122 msgid "bzip2" msgstr "" #: src/libdar/header_version.cpp:124 msgid "lzo" msgstr "" #: src/libdar/header_version.cpp:131 src/libdar/header_version.cpp:139 #: src/libdar/header_version.cpp:150 src/libdar/header_version.cpp:168 msgid "Reached End of File while reading archive header_version data structure" msgstr "" #: src/libdar/header_version.cpp:201 msgid "Corruption met while reading header_version data structure" msgstr "" #: src/libdar/header_version.cpp:218 msgid "Missing data for encrypted symmetrical key" msgstr "" #: src/libdar/header_version.cpp:235 msgid "" "Error met while reading archive of reference slicing layout, ignoring this " "field and continuing" msgstr "" #: src/libdar/header_version.cpp:256 src/libdar/header_version.cpp:258 #: src/libdar/header_version.cpp:280 src/libdar/header_version.cpp:282 msgid "Consistency check failed for archive header" msgstr "" #: src/libdar/tronconneuse.cpp:61 #, c-format msgid "%d is not a valid block size" msgstr "" #: src/libdar/tronconneuse.cpp:439 src/libdar/crypto_sym.cpp:301 msgid "Data corruption may have occurred, cannot decrypt data" msgstr "" #: src/libdar/crypto.cpp:44 msgid "scrambling (weak encryption)" msgstr "" #: src/libdar/crypto.cpp:102 msgid "Unknown crypto algorithm" msgstr "" #: src/libdar/erreurs.cpp:131 #, c-format msgid "File %S line %d" msgstr "" #: src/libdar/erreurs.cpp:131 msgid "it seems to be a bug here" msgstr "" #: src/libdar/erreurs.cpp:160 #, c-format msgid "in file %S line %S" msgstr "" #: src/libdar/erreurs.cpp:179 msgid "# UNEXPECTED EXCEPTION, #" msgstr "" #: src/libdar/erreurs.cpp:180 src/libdar/erreurs.cpp:193 msgid "# E X I T I N G ! #" msgstr "" #: src/libdar/erreurs.cpp:183 src/libdar/erreurs.cpp:196 msgid "" " THANKS TO REPORT THE PREVIOUS OUTPUT TO MAINTAINER\n" " GIVING A DESCRIPTION OF THE CIRCUMSTANCES." msgstr "" #: src/libdar/erreurs.cpp:184 msgid "" " IF POSSIBLE TRY TO REPRODUCE THIS ERROR, A\n" " SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n" " IN SOLVING THIS PROBLEM. THANKS" msgstr "" #: src/libdar/erreurs.cpp:192 msgid "# NOT CAUGHT EXCEPTION, #" msgstr "" #: src/libdar/erreurs.cpp:197 msgid "" " IF POSSIBLE TRY TO PRODUCE THIS ERROR, A\n" " SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n" " IN SOLVING THIS PROBLEM. THANKS" msgstr "" #: src/libdar/cat_entree.cpp:126 #, c-format msgid "" "\n" "CATALOGUE CONTENTS :\n" "\n" msgstr "" #: src/libdar/cat_entree.cpp:127 #, c-format msgid "total number of inode : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:128 #, c-format msgid "saved inode : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:129 #, c-format msgid "distribution of inode(s)\n" msgstr "" #: src/libdar/cat_entree.cpp:130 #, c-format msgid " - directories : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:131 #, c-format msgid " - plain files : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:132 #, c-format msgid " - symbolic links : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:133 #, c-format msgid " - named pipes : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:134 #, c-format msgid " - unix sockets : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:135 #, c-format msgid " - character devices : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:136 #, c-format msgid " - block devices : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:137 #, c-format msgid " - Door entries : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:138 #, c-format msgid "hard links information\n" msgstr "" #: src/libdar/cat_entree.cpp:139 #, c-format msgid " - number of inode with hard link : %i\n" msgstr "" #: src/libdar/cat_entree.cpp:140 #, c-format msgid " - number of reference to hard linked inodes: %i\n" msgstr "" #: src/libdar/cat_entree.cpp:141 #, c-format msgid "destroyed entries information\n" msgstr "" #: src/libdar/cat_entree.cpp:142 #, c-format msgid "" " %i file(s) have been record as destroyed since backup of reference\n" "\n" msgstr "" #: src/libdar/cat_entree.cpp:189 src/libdar/cat_entree.cpp:232 #: src/libdar/cat_entree.cpp:242 msgid "corrupted file" msgstr "" #: src/libdar/cat_entree.cpp:234 msgid "" "LAX MODE: Unexpected saved status for end of directory entry, assuming data " "corruption occurred, ignoring and continuing" msgstr "" #: src/libdar/cat_entree.cpp:244 msgid "" "LAX MODE: Unexpected saved status for class \"cat_detruit\" object, assuming " "data corruption occurred, ignoring and continuing" msgstr "" #: src/libdar/cat_entree.cpp:253 msgid "unknown type of data in catalogue" msgstr "" #: src/libdar/cat_entree.cpp:256 msgid "" "LAX MODE: found unknown catalogue entry, assuming data corruption occurred, " "cannot read further the catalogue as I do not know the length of this type " "of entry" msgstr "" #: src/libdar/cat_entree.cpp:307 msgid "unknown entry" msgstr "" #: src/libdar/cat_entree.cpp:308 #, c-format msgid "Entry information CRC failure for %S. Ignore the failure?" msgstr "" #: src/libdar/cat_entree.cpp:314 #, c-format msgid "Entry information CRC failure for %S" msgstr "" #: src/libdar/cat_entree.cpp:316 msgid "Entry information CRC failure" msgstr "" #: src/libdar/etage.cpp:112 msgid "Error opening directory in furtive read mode: " msgstr "" #: src/libdar/etage.cpp:116 #, c-format msgid "" "Could not open directory %s in furtive read mode (%s), using normal mode" msgstr "" #: src/libdar/etage.cpp:141 msgid "Error opening directory: " msgstr "" #: src/libdar/etage.cpp:181 #, c-format msgid "" "Detected Cache Directory Tagging Standard for %s, the contents of that " "directory will not be saved" msgstr "" #: src/libdar/entrepot_local.cpp:161 #, c-format msgid "Cannot remove file %s: " msgstr "" #: src/libdar/cat_tools.hpp:41 msgid "[--- REMOVED ENTRY ----]" msgstr "" #: src/libdar/archive_version.cpp:47 msgid "Archive version too high, use a more recent version of libdar" msgstr "" #: src/libdar/archive_version.cpp:77 msgid "Reached End of File while reading archive version" msgstr "" #: src/libdar/archive_version.cpp:90 src/libdar/archive_version.cpp:99 msgid "Unexpected value while reading archive version" msgstr "" #: src/libdar/archive_version.cpp:97 msgid "Reached premature end of file while reading archive version" msgstr "" #: src/libdar/cache.cpp:69 msgid "wrong value given as initial_size argument while initializing cache" msgstr "" #: src/libdar/fsa_family.cpp:58 msgid "creation date" msgstr "" #: src/libdar/fsa_family.cpp:60 msgid "append only" msgstr "" #: src/libdar/fsa_family.cpp:62 msgid "compressed" msgstr "" #: src/libdar/fsa_family.cpp:64 msgid "no dump flag" msgstr "" #: src/libdar/fsa_family.cpp:66 msgid "immutable" msgstr "" #: src/libdar/fsa_family.cpp:68 msgid "journalized" msgstr "" #: src/libdar/fsa_family.cpp:70 msgid "secure deletion" msgstr "" #: src/libdar/fsa_family.cpp:72 msgid "no tail merging" msgstr "" #: src/libdar/fsa_family.cpp:74 msgid "undeletable" msgstr "" #: src/libdar/fsa_family.cpp:76 msgid "no atime update" msgstr "" #: src/libdar/fsa_family.cpp:78 msgid "synchronous directory" msgstr "" #: src/libdar/fsa_family.cpp:80 msgid "synchronous update" msgstr "" #: src/libdar/fsa_family.cpp:82 msgid "top of directory hierarchy" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:665 msgid "Failed setting (opening) extX family FSA: " msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:678 msgid "Failed reading existing extX family FSA: " msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:705 #: src/libdar/filesystem_specific_attribute.cpp:718 #: src/libdar/filesystem_specific_attribute.cpp:731 #: src/libdar/filesystem_specific_attribute.cpp:744 #: src/libdar/filesystem_specific_attribute.cpp:763 #: src/libdar/filesystem_specific_attribute.cpp:777 #: src/libdar/filesystem_specific_attribute.cpp:790 #: src/libdar/filesystem_specific_attribute.cpp:803 #: src/libdar/filesystem_specific_attribute.cpp:816 #: src/libdar/filesystem_specific_attribute.cpp:829 #: src/libdar/filesystem_specific_attribute.cpp:842 #: src/libdar/filesystem_specific_attribute.cpp:855 #, c-format msgid "" "Warning: FSA %s/%s support has not been found at compilation time, cannot " "restore it for inode %s" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:900 msgid "Failed set extX family FSA: " msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:927 #, c-format msgid "" "Not setting FSA extX IMMUTABLE flags for %s due to of lack of capability" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:955 #, c-format msgid "" "Not setting FSA extX SYSTEM RESOURCE flags for %s due to of lack of " "capability" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:973 #, c-format msgid "" "Warning! %s Filesystem Specific Attribute support have not been activated at " "compilation time and could not be restored for %s" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:993 #, c-format msgid "" "Birth Time attribute cannot be restored for %s because no FSA familly able " "to carry that attribute could be activated at compilation time." msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:1158 msgid "Unexepected value for boolean FSA, data corruption may have occurred" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:1162 msgid "Error while reading FSA: " msgstr "" #: src/libdar/data_tree.cpp:99 msgid "reached End of File before all expected data could be read" msgstr "" #: src/libdar/data_tree.cpp:115 msgid "Unexpected value found in database" msgstr "" #: src/libdar/data_tree.cpp:628 #, c-format msgid "" "Archive number | Data | status || EA " "| status \n" msgstr "" #: src/libdar/data_tree.cpp:629 #, c-format msgid "" "---------------+-------------------------+--------++-------------------------" "+----------\n" msgstr "" #: src/libdar/data_tree.cpp:846 #, c-format msgid "" "Dates of file's %S are not increasing when database's archive number grows. " "Concerned file is: %S" msgstr "" #: src/libdar/data_tree.cpp:849 msgid "" "Dates are not increasing for all files when database's archive number grows, " "working with this database may lead to improper file's restored version. " "Please reorder the archive within the database in the way that the older is " "the first archive and so on up to the most recent archive being the last of " "the database" msgstr "" #: src/libdar/data_tree.cpp:852 msgid "Do you want to ignore the same type of error for other files?" msgstr "" #: src/libdar/data_tree.cpp:889 msgid "Unexpected end of file" msgstr "" #: src/libdar/data_tree.cpp:1105 msgid "" "This database has been corrupted probably due to a bug in release 2.4.0 to " "2.4.9, and it has not been possible to cleanup this corruption, please " "rebuild the database from archives or extracted \"catalogues\", if the " "database has never been used by one of the previously mentioned released, " "you are welcome to open a bug report and provide as much as possible details " "about the circumstances" msgstr "" #: src/libdar/data_tree.cpp:1187 msgid "[ Saved ]" msgstr "" #: src/libdar/data_tree.cpp:1189 src/libdar/data_tree.cpp:1194 msgid "[ ]" msgstr "" #: src/libdar/data_tree.cpp:1192 msgid "[ EA ]" msgstr "" #: src/libdar/data_tree.cpp:1415 msgid "Unknown record type" msgstr "" #: src/libdar/data_tree.cpp:1449 msgid "removed " msgstr "" #: src/libdar/data_tree.cpp:1450 msgid "present " msgstr "" #: src/libdar/data_tree.cpp:1451 msgid "saved " msgstr "" #: src/libdar/data_tree.cpp:1452 msgid "absent " msgstr "" #: src/libdar/criterium.cpp:137 msgid "cannot evaluate an empty chain in an overwriting policy" msgstr "" #: src/libdar/criterium.cpp:567 msgid "" "Cannot evaluate this crit_and criterium as no criterium has been added to it" msgstr "" #: src/libdar/criterium.cpp:636 msgid "" "Cannot evaluate this crit_or criterium as no criterium has been added to it" msgstr "" #: src/libdar/criterium.cpp:669 src/libdar/criterium.cpp:740 #: src/libdar/criterium.cpp:820 #, c-format msgid "" "Conflict found while selecting the file to retain in the resulting archive:" msgstr "" #: src/libdar/criterium.cpp:670 #, c-format msgid "User Decision requested for data of file %S" msgstr "" #: src/libdar/criterium.cpp:673 msgid "" "\n" "Your decision about file's data:\n" "[P]reserve\n" "[O]verwrite\n" "mark [S]aved and preserve\n" "mark saved and overwri[T]e\n" "[R]emove\n" "[*] keep undefined\n" "[A]bort\n" " Your Choice? " msgstr "" #: src/libdar/criterium.cpp:675 src/libdar/criterium.cpp:746 #: src/libdar/criterium.cpp:826 msgid "" "Please answer by the character between brackets ('[' and ']') and press " "return" msgstr "" #: src/libdar/criterium.cpp:705 src/libdar/criterium.cpp:784 #: src/libdar/criterium.cpp:852 #, c-format msgid "" "Warning, are you sure you want to abort (please answer \"%S\" to confirm)? " msgstr "" #: src/libdar/criterium.cpp:709 src/libdar/criterium.cpp:788 #: src/libdar/criterium.cpp:856 msgid "Cancellation no confirmed" msgstr "" #: src/libdar/criterium.cpp:712 src/libdar/criterium.cpp:791 #: src/libdar/criterium.cpp:859 msgid "Unknown choice: " msgstr "" #: src/libdar/criterium.cpp:741 #, c-format msgid "User Decision requested for EA of file %S" msgstr "" #: src/libdar/criterium.cpp:744 msgid "" "\n" "Your decision about file's EA:\n" "[p]reserve\n" "[o]verwrite\n" "mark [s]aved and preserve\n" "mark saved and overwri[t]e\n" "[m]erge EA and preserve\n" "merge EA a[n]d overwrite\n" "[r]emove\n" "[*] keep undefined\n" "[a]bort\n" " Your choice? " msgstr "" #: src/libdar/criterium.cpp:821 #, c-format msgid "User Decision requested for FSA of file %S" msgstr "" #: src/libdar/criterium.cpp:824 msgid "" "\n" "Your decision about file's FSA:\n" "[p]reserve\n" "[o]verwrite\n" "mark [s]aved and preserve\n" "mark saved and overwri[t]e\n" "[*] keep undefined\n" "[a]bort\n" " Your choice? " msgstr "" #: src/libdar/criterium.cpp:893 #, c-format msgid "Entry information:\t\"in place\"\t\"to be added\"" msgstr "" #: src/libdar/criterium.cpp:894 #, c-format msgid "Is inode :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:895 #, c-format msgid "Is directory :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:896 #, c-format msgid "Is plain file :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:897 #, c-format msgid "Is hard linked :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:898 #, c-format msgid "Entry type :\t %s \t %s" msgstr "" #: src/libdar/criterium.cpp:902 msgid "me" msgstr "" #: src/libdar/criterium.cpp:911 #, c-format msgid "Data more recent :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:921 #, c-format msgid "Data size :\t %i \t\t %i" msgstr "" #: src/libdar/criterium.cpp:922 #, c-format msgid "Sparse file :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:923 #, c-format msgid "Dirty file :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:925 #, c-format msgid "Data full saved :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:926 #, c-format msgid "EA full saved :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:928 #, c-format msgid "EA more recent :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:929 #, c-format msgid "FSA full saved :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:934 #, c-format msgid "FSA familly :\t %S \t\t %S" msgstr "" #: src/libdar/criterium.cpp:943 #, c-format msgid "EA number :\t %i \t\t %i" msgstr "" #: src/libdar/criterium.cpp:946 #, c-format msgid "EA size :\t %i \t\t %i" msgstr "" #: src/libdar/criterium.cpp:965 msgid "directory" msgstr "" #: src/libdar/criterium.cpp:969 src/libdar/cat_tools.cpp:387 msgid "hard linked inode" msgstr "" #: src/libdar/criterium.cpp:971 msgid "plain file" msgstr "" #: src/libdar/criterium.cpp:973 msgid "soft link" msgstr "" #: src/libdar/criterium.cpp:975 src/libdar/cat_tools.cpp:372 msgid "char device" msgstr "" #: src/libdar/criterium.cpp:977 src/libdar/cat_tools.cpp:375 msgid "block device" msgstr "" #: src/libdar/criterium.cpp:979 msgid "named pipe" msgstr "" #: src/libdar/criterium.cpp:981 msgid "unix socket" msgstr "" #: src/libdar/criterium.cpp:983 msgid "deleted entry" msgstr "" #: src/libdar/criterium.cpp:985 msgid "door inode" msgstr "" #: src/libdar/cat_lien.cpp:97 msgid "symbolic link does not point to the same target: " msgstr "" #: src/libdar/sparse_file.cpp:157 msgid "Incoherent structure in data carrying sparse files: unknown mark" msgstr "" #: src/libdar/sparse_file.cpp:311 msgid "Cannot skip forward to restore a hole" msgstr "" #: src/libdar/sparse_file.cpp:325 msgid "Data corruption or unknown sparse_file mark found in file's data" msgstr "" #: src/libdar/trivial_sar.cpp:188 #, c-format msgid "%S already exists, and overwritten is forbidden, aborting" msgstr "" #: src/libdar/trivial_sar.cpp:190 #, c-format msgid "%S is about to be overwritten, continue ?" msgstr "" #: src/libdar/trivial_sar.cpp:213 src/libdar/trivial_sar.cpp:226 #: src/libdar/sar.cpp:1081 src/libdar/sar.cpp:1151 src/libdar/sar.cpp:1161 #, c-format msgid "Failed creating slice %S: " msgstr "" #: src/libdar/trivial_sar.cpp:449 msgid "This archive has slices and is not possible to read from a pipe" msgstr "" #: src/libdar/trivial_sar.cpp:486 msgid "" "This archive is not single sliced, more data exists in the next slices but " "cannot be read from the current pipe, aborting" msgstr "" #: src/libdar/trivial_sar.cpp:524 msgid "Cannot skip to a valid position in file" msgstr "" #: src/libdar/cat_tools.cpp:120 msgid "[DIRTY]" msgstr "" #: src/libdar/cat_tools.cpp:122 src/libdar/cat_tools.cpp:138 msgid "[Saved]" msgstr "" #: src/libdar/cat_tools.cpp:125 src/libdar/cat_tools.cpp:141 msgid "[InRef]" msgstr "" #: src/libdar/cat_tools.cpp:354 msgid "ignored directory" msgstr "" #: src/libdar/cat_tools.cpp:357 msgid "folder" msgstr "" #: src/libdar/cat_tools.cpp:360 msgid "deleted file" msgstr "" #: src/libdar/cat_tools.cpp:363 msgid "door" msgstr "" #: src/libdar/cat_tools.cpp:366 msgid "file" msgstr "" #: src/libdar/cat_tools.cpp:369 msgid "symlink" msgstr "" #: src/libdar/cat_tools.cpp:378 msgid "pipe" msgstr "" #: src/libdar/cat_tools.cpp:381 msgid "socket" msgstr "" #: src/libdar/cat_tools.cpp:384 msgid "ignored entry" msgstr "" #: src/libdar/cat_tools.cpp:390 msgid "end of directory" msgstr "" #: src/libdar/label.cpp:123 msgid "Incomplete label" msgstr "" #: src/libdar/tuyau.cpp:143 msgid "Error while creating anonymous pipe: " msgstr "" #: src/libdar/tuyau.cpp:171 msgid "Pipe's other end is not known, cannot provide a filedescriptor on it" msgstr "" #: src/libdar/tuyau.cpp:185 msgid "" "Pipe's other end is not known, cannot close any filedescriptor pointing on it" msgstr "" #: src/libdar/tuyau.cpp:312 msgid "Error while reading from pipe: " msgstr "" #: src/libdar/tuyau.cpp:366 src/libdar/tuyau.cpp:371 msgid "Error while writing data to pipe: " msgstr "" #: src/libdar/tuyau.cpp:368 src/libdar/fichier_global.cpp:107 msgid "" "No space left on device, you have the opportunity to make room now. When " "ready : can we continue ?" msgstr "" #: src/libdar/tuyau.cpp:422 msgid "Error opening pipe: " msgstr "" #: src/libdar/tuyau.cpp:511 msgid "File mode is neither read nor write" msgstr "" #: src/libdar/slice_layout.cpp:52 msgid "Missing data while reading slice_layout object" msgstr "" #: src/libdar/escape.cpp:137 msgid "" "Adding an explicit escape sequence of type seqt_not_a_sequence is forbidden" msgstr "" #: src/libdar/escape.cpp:839 msgid "Unknown escape sequence type" msgstr "" #: src/libdar/semaphore.cpp:127 msgid "Error while converting UID/GID to string for backup hook file: " msgstr "" #: src/libdar/catalogue.cpp:148 src/libdar/catalogue.cpp:166 #: src/libdar/catalogue.cpp:168 msgid "incoherent catalogue structure" msgstr "" #: src/libdar/catalogue.cpp:159 msgid "" "LAX MODE: catalogue label does not match archive label, as if it was an " "extracted catalogue, assuming data corruption occurred and fixing the " "catalogue to be considered an a plain internal catalogue" msgstr "" #: src/libdar/catalogue.cpp:211 msgid "CRC failed for table of contents (aka \"catalogue\")" msgstr "" #: src/libdar/catalogue.cpp:213 msgid "" "LAX MODE: CRC failed for catalogue, the archive contents is corrupted. This " "may even lead dar to see files in the archive that never existed, but this " "will most probably lead to other failures in restoring files. Shall we " "proceed anyway?" msgstr "" #: src/libdar/catalogue.cpp:272 msgid "root does not have a parent directory" msgstr "" #: src/libdar/catalogue.cpp:312 msgid "no current directory defined" msgstr "" #: src/libdar/catalogue.cpp:316 msgid "root directory has no parent directory" msgstr "" #: src/libdar/catalogue.cpp:338 msgid "no current reading directory defined" msgstr "" #: src/libdar/catalogue.cpp:410 src/libdar/catalogue.cpp:424 msgid " is not present in the archive" msgstr "" #: src/libdar/catalogue.cpp:502 msgid "Cannot recurs in a non directory entry" msgstr "" #: src/libdar/catalogue.cpp:505 msgid "" "The entry to recurs in does not exist, cannot add further entry to that " "absent subdirectory" msgstr "" #: src/libdar/catalogue.cpp:574 msgid "root has no parent directory" msgstr "" #: src/libdar/catalogue.cpp:933 #, c-format msgid "" "Access mode | User | Group | Size | Date | " "[Data ][ EA ][FSA][Compr][S]| Filename\n" msgstr "" #: src/libdar/catalogue.cpp:978 #, c-format msgid "%S [%c] [ REMOVED ENTRY ] (%S) %S\n" msgstr "" #: src/libdar/catalogue.cpp:1009 src/libdar/catalogue.cpp:1142 msgid " Extended Attribute: [" msgstr "" #: src/libdar/catalogue.cpp:1048 #, c-format msgid "" "[Data ][ EA ][FSA][Compr][S]| Permission | User | Group | Size | " "Date | filename\n" msgstr "" #: src/libdar/datetime.cpp:305 msgid "Unknown time unit" msgstr "" #: src/libdar/libdar.cpp:155 msgid "Caught an unknown Egeneric exception: " msgstr "" #: src/libdar/libdar.cpp:160 msgid "Caught a none libdar exception" msgstr "" #: src/libdar/libdar.cpp:272 msgid "Invald nullptr argument given to 'ptr'" msgstr "" #: src/libdar/libdar.cpp:319 msgid "Invalid nullptr pointer given to close_archive" msgstr "" #: src/libdar/libdar.cpp:358 msgid "Initialization problem for liblzo2 library" msgstr "" #: src/libdar/libdar.cpp:375 src/libdar/libdar.cpp:397 #, c-format msgid "Too old version for libgcrypt, minimum required version is %s\n" msgstr "" #: src/libdar/libdar.cpp:384 #, c-format msgid "Error while activating libgcrypt's memory guard: %s/%s" msgstr "" #: src/libdar/libdar.cpp:388 #, c-format msgid "Error while telling libgcrypt that initialization is finished: %s/%s" msgstr "" #: src/libdar/libdar.cpp:393 msgid "libgcrypt not initialized and libdar not allowed to do so" msgstr "" #: src/libdar/libdar.cpp:404 #, c-format msgid "GPGME version requirement is not satisfied, requires version > %s" msgstr "" #: src/libdar/libdar.cpp:408 #, c-format msgid "GPGME engine not available: %s" msgstr "" #: src/libdar/libdar.cpp:441 src/libdar/libdar.cpp:461 #: src/libdar/libdar.cpp:480 src/libdar/libdar.cpp:502 #: src/libdar/libdar.cpp:522 msgid "Invalid nullptr argument given to 'ptr'" msgstr "" #: src/libdar/compressor.cpp:171 src/libdar/compressor.cpp:199 msgid "" "incompatible compression library version or unsupported feature required " "from compression library" msgstr "" #: src/libdar/compressor.cpp:329 msgid "compressed data is corrupted" msgstr "" #: src/libdar/compressor.cpp:465 msgid "compressed data CRC error" msgstr "" #: src/libdar/compressor.cpp:552 src/libdar/compressor.cpp:582 #: src/libdar/compressor.cpp:722 src/libdar/compressor.cpp:787 msgid "lzo compression" msgstr "" #: src/libdar/compressor.cpp:708 #, c-format msgid "Probable bug in liblzo2: lzo1x_*_compress returned unexpected code %d" msgstr "" #: src/libdar/compressor.cpp:743 msgid "data corruption detected: Incoherence in LZO compressed data" msgstr "" #: src/libdar/compressor.cpp:747 src/libdar/compressor.cpp:769 #: src/libdar/compressor.cpp:783 msgid "compressed data corruption detected" msgstr "" #: src/libdar/compressor.cpp:757 msgid "data corruption detected: Too large block of compressed data" msgstr "" #: src/libdar/compressor.cpp:759 msgid "" "Too large block of compressed data: Either due to data corruption or current " "system limitation where SSIZE_MAX value implied smaller buffers than required" msgstr "" #: src/libdar/compressor.cpp:818 src/libdar/compressor.cpp:837 #: src/libdar/compressor.cpp:856 msgid "unknown compression" msgstr "" #: src/libdar/compressor.cpp:874 #, c-format msgid "unknown compression algorithm: %S" msgstr "" #: src/libdar/macro_tools.cpp:136 msgid "Locating archive contents..." msgstr "" #: src/libdar/macro_tools.cpp:148 msgid "Reading archive contents..." msgstr "" #: src/libdar/macro_tools.cpp:185 msgid "Missing catalogue in file." msgstr "" #: src/libdar/macro_tools.cpp:285 msgid "" "LAX MODE: catalogue computed hash does not match the signed hash of the " "archive, ignoring" msgstr "" #: src/libdar/macro_tools.cpp:287 msgid "" "Catalogue computed hash does not match the signed hash of the archive, " "archive has been modified since it was signed!" msgstr "" #: src/libdar/macro_tools.cpp:316 msgid "Cannot open catalogue: " msgstr "" #: src/libdar/macro_tools.cpp:390 msgid "Opening standard input to read the archive..." msgstr "" #: src/libdar/macro_tools.cpp:398 #, c-format msgid "Opening named pipe %S as input to read the archive..." msgstr "" #: src/libdar/macro_tools.cpp:411 #, c-format msgid "" "Opening a pair of pipes to read the archive, expecting dar_slave at the " "other ends..." msgstr "" #: src/libdar/macro_tools.cpp:441 msgid "Opening the archive using the multi-slice abstraction layer..." msgstr "" #: src/libdar/macro_tools.cpp:470 msgid "Reading the archive header..." msgstr "" #: src/libdar/macro_tools.cpp:472 msgid "Reading the archive trailer..." msgstr "" #: src/libdar/macro_tools.cpp:496 #, c-format msgid "" "Error while reading archive's header, this may be because this archive is an " "old encrypted archive or that data corruption took place, Assuming it is an " "old archive, we have to read the header at the beginning of the first " "slice..." msgstr "" #: src/libdar/macro_tools.cpp:507 msgid "" "Found a correct archive header at the beginning of the archive, which does " "not stands to be an old archive, the end of the archive is corrupted and " "thus the catalogue is not readable, aborting. Either retry providing in " "addition an isolated catalogue of that archive to perform the operation, or " "try reading the archive in sequential mode or try in lax mode or, last " "chance, try both lax and sequential read mode at the same time" msgstr "" #: src/libdar/macro_tools.cpp:509 msgid "" "Found a correct archive header at the beginning of the archive, which does " "not stands to be an old archive, the end of the archive is thus corrupted. " "Without external catalogue provided and as we do not read the archive in " "sequential mode, there is very little chance to retreive something from this " "corrupted archive. Do we continue anyway ?" msgstr "" #: src/libdar/macro_tools.cpp:518 #, c-format msgid "Opening construction layer..." msgstr "" #: src/libdar/macro_tools.cpp:534 msgid "Considering cyphering layer..." msgstr "" #: src/libdar/macro_tools.cpp:543 msgid "" "LAX MODE: Archive seems to be ciphered, but you did not have provided any " "encryption algorithm, assuming data corruption and considering that the " "archive is not ciphered" msgstr "" #: src/libdar/macro_tools.cpp:546 #, c-format msgid "" "The archive %S is encrypted and no encryption cipher has been given, cannot " "open archive." msgstr "" #: src/libdar/macro_tools.cpp:577 msgid "" "WARNING: support for secure memory was not available at compilation time, in " "case of heavy memory load, this may lead the password you are about to " "provide to be wrote to disk (swap space) in clear. You have been warned!" msgstr "" #: src/libdar/macro_tools.cpp:578 src/libdar/macro_tools.cpp:1312 #, c-format msgid "Archive %S requires a password: " msgstr "" #: src/libdar/macro_tools.cpp:587 msgid "No cyphering layer opened, adding cache layer for better performance" msgstr "" #: src/libdar/macro_tools.cpp:593 msgid "" "Failed opening the cache layer, lack of memory, archive read performances " "will not be optimized" msgstr "" #: src/libdar/macro_tools.cpp:598 msgid "No cyphering layer opened" msgstr "" #: src/libdar/macro_tools.cpp:607 src/libdar/macro_tools.cpp:651 msgid "Opening cyphering layer..." msgstr "" #: src/libdar/macro_tools.cpp:658 msgid "Unknown encryption algorithm" msgstr "" #: src/libdar/macro_tools.cpp:678 src/libdar/macro_tools.cpp:1419 msgid "Creating a new thread to run the previously created layers..." msgstr "" #: src/libdar/macro_tools.cpp:698 msgid "Opening escape sequence abstraction layer..." msgstr "" #: src/libdar/macro_tools.cpp:703 msgid "" "LAX MODE: Archive is flagged as having escape sequence (which is normal in " "recent archive versions). However if this is not expected, shall I assume a " "data corruption occurred in this field and that this flag should be ignored? " "(If unsure, refuse)" msgstr "" #: src/libdar/macro_tools.cpp:718 msgid "" "Sequential read asked, but this archive is flagged to not have the necessary " "embedded escape sequences for that operation, aborting" msgstr "" #: src/libdar/macro_tools.cpp:723 msgid "" "LAX MODE: the requested sequential read mode relies on escape sequence which " "seem to be absent from this archive. Assuming data corruption occurred. " "However, if no data corruption occurred and thus no escape sequence are " "present in this archive, do not use sequential reading mode to explore this " "archive else you will just get nothing usable from it" msgstr "" #: src/libdar/macro_tools.cpp:729 msgid "" "LAX MODE: Archive is flagged to not have escape sequence which is not the " "case by default since archive format 8 (release 2.4.x). If corruption " "occurred and an escape sequence is present, this may lead data restoration " "to fail, answering no at this question will let me consider that an escape " "sequence layer has to be added in spite of the archive flags. Do you want to " "continue as suggested by the archive flag, thus without escape sequence " "layer?" msgstr "" #: src/libdar/macro_tools.cpp:760 src/libdar/macro_tools.cpp:1465 msgid "Creating a new thread to run the escape layer..." msgstr "" #: src/libdar/macro_tools.cpp:778 msgid "" "Opening the compression abstraction layer (compression algorithm used is " "none)..." msgstr "" #: src/libdar/macro_tools.cpp:780 msgid "Opening the compression layer..." msgstr "" #: src/libdar/macro_tools.cpp:804 src/libdar/macro_tools.cpp:1497 msgid "Creating a new thread to run the compression layer..." msgstr "" #: src/libdar/macro_tools.cpp:818 src/libdar/macro_tools.cpp:1507 msgid "All layers have been created successfully" msgstr "" #: src/libdar/macro_tools.cpp:821 #, c-format msgid "" "Warning, the archive %S has been encrypted. A wrong key is not possible to " "detect, it would cause DAR to report the archive as corrupted\n" msgstr "" #: src/libdar/macro_tools.cpp:858 msgid "" "LAX MODE: The catalogue (table of contents) usually takes a few percents of " "the archive at its end, which percentage do you want me to scan (answer by " "an *integer* number between 0 and 100)? " msgstr "" #: src/libdar/macro_tools.cpp:864 #, c-format msgid "LAX MODE: %i is not a valid percent value" msgstr "" #: src/libdar/macro_tools.cpp:868 #, c-format msgid "%S is not a valid number" msgstr "" #: src/libdar/macro_tools.cpp:874 #, c-format msgid "" "LAX MODE: Beginning search of the catalogue (from the end toward the " "beginning of the archive, on %i %% of its length), this may take a while..." msgstr "" #: src/libdar/macro_tools.cpp:883 msgid "" "LAX MODE: Cannot skip at the end of the archive! Using current position to " "start the catalogue search" msgstr "" #: src/libdar/macro_tools.cpp:888 msgid "LAX MODE: Failed to read the catalogue (no data to inspect)" msgstr "" #: src/libdar/macro_tools.cpp:891 msgid "" "LAX MODE: Failed to read the catalogue (0 bytes of the archive length asked " "to look for the catalogue)" msgstr "" #: src/libdar/macro_tools.cpp:902 msgid "" "LAX MODE: Escape sequence seems present in this archive. I have thus two " "different methods, either I look for the escape sequence indicating the " "start of the catalogue or I try each position in turn in the hope it will " "not be data that look like a catalogue" msgstr "" #: src/libdar/macro_tools.cpp:905 msgid "LAX MODE: Trying to locate the escape sequence (safer choice) ?" msgstr "" #: src/libdar/macro_tools.cpp:910 msgid "" "LAX MODE: Good point! I could find the escape sequence marking the beginning " "of the catalogue, now trying to read it..." msgstr "" #: src/libdar/macro_tools.cpp:919 msgid "" "LAX MODE: Escape sequence could not be found, it may have been corrupted or " "out of the scanned portion of the archive, trying to find the catalogue the " "other way" msgstr "" #: src/libdar/macro_tools.cpp:942 #, c-format msgid "LAX MODE: %i %% remaining" msgstr "" #: src/libdar/macro_tools.cpp:954 #, c-format msgid "" "Could read a catalogue data structure at offset %i, it contains the " "following:" msgstr "" #: src/libdar/macro_tools.cpp:956 msgid "Do you want to use it for the operation?" msgstr "" #: src/libdar/macro_tools.cpp:988 msgid "" "LAX MODE: Reached the end of the area to scan, FAILED to find any catalogue" msgstr "" #: src/libdar/macro_tools.cpp:998 msgid "LAX MODE: Failed to read the catalogue" msgstr "" #: src/libdar/macro_tools.cpp:1006 msgid "" "The format version of the archive is too high for that software version, try " "reading anyway?" msgstr "" #: src/libdar/macro_tools.cpp:1087 msgid "" "Creating low layer: Writing archive into a black hole object (equivalent to /" "dev/null)..." msgstr "" #: src/libdar/macro_tools.cpp:1096 msgid "Creating low layer: Writing archive into standard output object..." msgstr "" #: src/libdar/macro_tools.cpp:1110 msgid "Creating low layer: Writing archive into a plain file object..." msgstr "" #: src/libdar/macro_tools.cpp:1131 msgid "" "Creating low layer: Writing archive into a sar object (Segmentation and " "Reassembly) for slicing..." msgstr "" #: src/libdar/macro_tools.cpp:1169 msgid "Adding cache layer over pipe to provide limited skippability..." msgstr "" #: src/libdar/macro_tools.cpp:1197 msgid "" "WARNING: support for secure memory was not available at compilation time, in " "case of heavy memory load, this may lead the password/passphrase provided to " "be wrote to disk (swap space) in clear. You have been warned!" msgstr "" #: src/libdar/macro_tools.cpp:1212 msgid "Generating random key for symmetric encryption..." msgstr "" #: src/libdar/macro_tools.cpp:1220 msgid "" "Scrambling is a very weak encryption algorithm, this is a non-sens to use " "with asymmetric encryption" msgstr "" #: src/libdar/macro_tools.cpp:1260 #, c-format msgid "" "For your information, this is the iteration %d for which the randomly " "generated key is reported to be weak by libgcrypt, continuing generating " "another random key... patience" msgstr "" #: src/libdar/macro_tools.cpp:1264 #, c-format msgid "" "... A strong randomly generated key could be found after %d iteration(s)" msgstr "" #: src/libdar/macro_tools.cpp:1271 msgid "Key generated" msgstr "" #: src/libdar/macro_tools.cpp:1313 msgid "Please confirm your password: " msgstr "" #: src/libdar/macro_tools.cpp:1317 msgid "The two passwords are not identical. Aborting" msgstr "" #: src/libdar/macro_tools.cpp:1347 msgid "Writing down the archive header..." msgstr "" #: src/libdar/macro_tools.cpp:1363 msgid "Adding a new layer on top: scrambler object..." msgstr "" #: src/libdar/macro_tools.cpp:1375 msgid "Adding a new layer on top: Strong encryption object..." msgstr "" #: src/libdar/macro_tools.cpp:1392 msgid "Adding a new layer on top: Caching layer for better performances..." msgstr "" #: src/libdar/macro_tools.cpp:1437 msgid "Writing down the initial elastic buffer through the encryption layer..." msgstr "" #: src/libdar/macro_tools.cpp:1449 msgid "Adding a new layer on top: Escape layer to allow sequential reading..." msgstr "" #: src/libdar/macro_tools.cpp:1479 msgid "Adding a new layer on top: compression..." msgstr "" #: src/libdar/macro_tools.cpp:1521 msgid "Error creating archive layers: " msgstr "" #: src/libdar/macro_tools.cpp:1630 msgid "Writing down archive contents..." msgstr "" #: src/libdar/macro_tools.cpp:1654 msgid "Calculating the signature of the catalogue hash..." msgstr "" #: src/libdar/macro_tools.cpp:1670 msgid "Writing down the signed hash of the catalogue..." msgstr "" #: src/libdar/macro_tools.cpp:1720 msgid "Closing the compression layer..." msgstr "" #: src/libdar/macro_tools.cpp:1735 msgid "Closing the escape layer..." msgstr "" #: src/libdar/macro_tools.cpp:1755 msgid "Writing down the first archive terminator..." msgstr "" #: src/libdar/macro_tools.cpp:1761 msgid "writing down the final elastic buffer through the encryption layer..." msgstr "" #: src/libdar/macro_tools.cpp:1800 msgid "Closing the encryption layer..." msgstr "" #: src/libdar/macro_tools.cpp:1822 msgid "Writing down archive trailer..." msgstr "" #: src/libdar/macro_tools.cpp:1827 msgid "Writing down the second archive terminator..." msgstr "" #: src/libdar/macro_tools.cpp:1838 msgid "Closing archive low layer..." msgstr "" #: src/libdar/macro_tools.cpp:1843 msgid "Archive is closed." msgstr "" #: src/libdar/entrepot.cpp:151 msgid "Error met while creating the hash file: " msgstr "" #: src/libdar/tlv.cpp:66 msgid "Missing data to initiate a TLV object" msgstr "" #: src/libdar/filesystem.cpp:174 #, c-format msgid "Error reading inode of file %s : %s" msgstr "" #: src/libdar/filesystem.cpp:179 #, c-format msgid "Failed reading inode information for %s: " msgstr "" #: src/libdar/filesystem.cpp:187 msgid "Cannot read inode for " msgstr "" #: src/libdar/filesystem.cpp:283 msgid "Unknown file type! file name is: " msgstr "" #: src/libdar/filesystem.cpp:316 msgid "Error reading EA for " msgstr "" #: src/libdar/filesystem.cpp:566 src/libdar/filesystem.cpp:802 msgid "Non existent file: " msgstr "" #: src/libdar/filesystem.cpp:568 src/libdar/filesystem.cpp:804 msgid "File must be a directory: " msgstr "" #: src/libdar/filesystem.cpp:653 #, c-format msgid "Cannot read directory contents: %s : " msgstr "" #: src/libdar/filesystem.cpp:690 msgid "Ignoring file with NODUMP flag set: " msgstr "" #: src/libdar/filesystem.cpp:698 src/libdar/filesystem.cpp:703 msgid "Error reading directory contents: " msgstr "" #: src/libdar/filesystem.cpp:698 src/libdar/filesystem.cpp:703 msgid " . Ignoring file or directory" msgstr "" #: src/libdar/filesystem.cpp:1082 #, c-format msgid "" "Error creating hard link %s : %s\n" " Trying to duplicate the inode" msgstr "" #: src/libdar/filesystem.cpp:1096 #, c-format msgid "" "Error creating hard link : %s , the inode to link with [ %s ] has " "disappeared, re-creating it" msgstr "" #: src/libdar/filesystem.cpp:1103 #, c-format msgid "" "Error creating hard link : %s , the inode to link with [ %s ] is not " "present, cannot restore this hard link" msgstr "" #: src/libdar/filesystem.cpp:1175 msgid "Bad CRC, data corruption occurred" msgstr "" #: src/libdar/filesystem.cpp:1225 msgid "Error creating Unix socket file: " msgstr "" #: src/libdar/filesystem.cpp:1245 msgid "Could not create inode: " msgstr "" #: src/libdar/filesystem.cpp:1247 msgid "Cannot create inode: " msgstr "" #: src/libdar/filesystem.cpp:1247 msgid " Ready to continue ?" msgstr "" #: src/libdar/filesystem.cpp:1442 msgid "Cannot remove non-existent file from filesystem: " msgstr "" #: src/libdar/filesystem.cpp:1447 src/libdar/filesystem.cpp:1740 msgid "Restoring file's data: " msgstr "" #: src/libdar/filesystem.cpp:1464 src/libdar/filesystem.cpp:1935 msgid "Restoring file's EA: " msgstr "" #: src/libdar/filesystem.cpp:1475 src/libdar/filesystem.cpp:1578 #, c-format msgid "Restoration of EA for %S aborted: " msgstr "" #: src/libdar/filesystem.cpp:1485 src/libdar/filesystem.cpp:2078 msgid "Restoring file's FSA: " msgstr "" #: src/libdar/filesystem.cpp:1498 src/libdar/filesystem.cpp:1590 #, c-format msgid "Restoration of FSA for %S aborted: " msgstr "" #: src/libdar/filesystem.cpp:1659 #, c-format msgid "%S is about to be removed from filesystem, continue?" msgstr "" #: src/libdar/filesystem.cpp:1664 src/libdar/filesystem.cpp:1673 #, c-format msgid "Removing file (reason is file recorded as removed in archive): %S" msgstr "" #: src/libdar/filesystem.cpp:1671 #, c-format msgid "" "%S must be removed, but does not match expected type, remove it anyway ?" msgstr "" #: src/libdar/filesystem.cpp:1679 #, c-format msgid "" "%S: Overwriting policy (Data) is undefined for that file, do not know " "whether removal is allowed or not!" msgstr "" #: src/libdar/filesystem.cpp:1716 #, c-format msgid "" "Directory %S cannot be restored: overwriting not allowed and a non-directory " "inode of that name already exists, all files in that directory will be " "skipped for restoration:" msgstr "" #: src/libdar/filesystem.cpp:1725 #, c-format msgid "%S is about to be overwritten, OK?" msgstr "" #: src/libdar/filesystem.cpp:1771 #, c-format msgid "Existing EA for %S could not be read and preserved: " msgstr "" #: src/libdar/filesystem.cpp:1789 #, c-format msgid "Existing FSA for %S could not be read and preserved: " msgstr "" #: src/libdar/filesystem.cpp:1818 #, c-format msgid "Existing EA for %S could not be preserved : " msgstr "" #: src/libdar/filesystem.cpp:1835 #, c-format msgid "Existing FSA for %S could not be preserved : " msgstr "" #: src/libdar/filesystem.cpp:1850 #, c-format msgid "" "%S is about to be deleted (required by overwriting policy), do you agree?" msgstr "" #: src/libdar/filesystem.cpp:1852 #, c-format msgid "Removing file (reason is overwriting policy): %S" msgstr "" #: src/libdar/filesystem.cpp:1858 #, c-format msgid "" "%S: Overwriting policy (Data) is undefined for that file, do not know " "whether overwriting is allowed or not!" msgstr "" #: src/libdar/filesystem.cpp:1914 #, c-format msgid "EA for %S are about to be overwritten, OK?" msgstr "" #: src/libdar/filesystem.cpp:1929 #, c-format msgid "" "EA for %S have not been overwritten because this file is a hard link " "pointing to an already restored inode" msgstr "" #: src/libdar/filesystem.cpp:1949 #, c-format msgid "EA for %S are about to be removed, OK?" msgstr "" #: src/libdar/filesystem.cpp:1960 #, c-format msgid "" "EA for %S have not been cleared as requested by the overwriting policy " "because this file is a hard link pointing to an already restored inode" msgstr "" #: src/libdar/filesystem.cpp:1966 msgid "Clearing file's EA (requested by overwriting policy): " msgstr "" #: src/libdar/filesystem.cpp:1979 #, c-format msgid "EA for %S are about to be merged, OK?" msgstr "" #: src/libdar/filesystem.cpp:2005 #, c-format msgid "" "%S: Overwriting policy (EA) is undefined for that file, do not know whether " "overwriting is allowed or not!" msgstr "" #: src/libdar/filesystem.cpp:2057 src/libdar/filesystem.cpp:2103 #, c-format msgid "FSA for %S are about to be overwritten, OK?" msgstr "" #: src/libdar/filesystem.cpp:2072 #, c-format msgid "" "FSA for %S have not been overwritten because this file is a hard link " "pointing to an already restored inode" msgstr "" #: src/libdar/filesystem.cpp:2129 #, c-format msgid "" "%S: Overwriting policy (FSA) is undefined for that file, do not know whether " "overwriting is allowed or not!" msgstr "" #: src/libdar/filesystem.cpp:2189 msgid "Cannot get inode information about file to remove " msgstr "" #: src/libdar/filesystem.cpp:2202 msgid "Cannot remove directory " msgstr "" #: src/libdar/filesystem.cpp:2206 msgid "Cannot remove file " msgstr "" #: src/libdar/filesystem.cpp:2255 msgid "" "uid value is too high for this system for libdar be able to restore it " "properly" msgstr "" #: src/libdar/filesystem.cpp:2259 msgid "" "gid value is too high for this system for libdar be able to restore it " "properly" msgstr "" #: src/libdar/filesystem.cpp:2263 src/libdar/filesystem.cpp:2267 msgid "Could not restore original file ownership: " msgstr "" #: src/libdar/filesystem.cpp:2281 #, c-format msgid "Cannot restore permissions of %s : %s" msgstr "" #: src/libdar/filesystem.cpp:2367 #, c-format msgid "Failed to open %S while checking for nodump flag: %s" msgstr "" #: src/libdar/filesystem.cpp:2381 #, c-format msgid "Cannot get ext2 attributes (and nodump flag value) for %S : %s" msgstr "" #: src/libdar/filesystem.cpp:2414 #, c-format msgid "Cannot get inode information for %s : %s" msgstr "" #: src/libdar/filesystem.cpp:2443 #, c-format msgid "" "Replacing %s in the -R option by the directory pointed to by this symbolic " "link: " msgstr "" #: src/libdar/filesystem.cpp:2446 #, c-format msgid "" "The given path %s must be a directory (or symbolic link to an existing " "directory)" msgstr "" #: src/libdar/tronc.cpp:256 src/libdar/tronc.cpp:298 msgid "Cannot skip to the current position in \"tronc\"" msgstr "" #: src/libdar/tronc.cpp:310 msgid "Tried to write out of size limited file" msgstr "" #: src/libdar/cat_file.cpp:394 msgid "cannot provide data from a \"not saved\" file object" msgstr "" #: src/libdar/cat_file.cpp:397 msgid "data has been cleaned, object is now empty" msgstr "" #: src/libdar/cat_file.cpp:656 msgid "can't read data CRC: No escape mark found for that file" msgstr "" #: src/libdar/cat_file.cpp:704 #, c-format msgid "not same size: %i <--> %i" msgstr "" #: src/libdar/cat_file.cpp:753 #, c-format msgid "different file data, offset of first difference is: %i" msgstr "" #: src/libdar/cat_file.cpp:761 msgid "" "Same data but CRC value could not be verified because we did not guessed " "properly its width (sequential read restriction)" msgstr "" #: src/libdar/cat_file.cpp:763 msgid "Same data but stored CRC does not match the data!?!" msgstr "" #: src/libdar/cat_file.cpp:815 msgid "" "CRC difference concerning file's data (comparing with an isolated catalogue)" msgstr "" #: src/libdar/crypto_asym.cpp:86 src/libdar/crypto_asym.cpp:139 #: src/libdar/crypto_asym.cpp:175 src/libdar/crypto_asym.cpp:233 #: src/libdar/crypto_asym.cpp:292 msgid "Unexpected error reported by GPGME: " msgstr "" #: src/libdar/crypto_asym.cpp:137 msgid "Key found but users are not all trusted" msgstr "" #: src/libdar/crypto_asym.cpp:169 msgid "No data to decrypt" msgstr "" #: src/libdar/crypto_asym.cpp:171 msgid "Invalid Cipher text" msgstr "" #: src/libdar/crypto_asym.cpp:173 msgid "Failed retreiving passphrase" msgstr "" #: src/libdar/crypto_asym.cpp:188 msgid "Failed creating GPGME context: " msgstr "" #: src/libdar/crypto_asym.cpp:192 msgid "Failed setting GPGME context with OpenPGP protocol: " msgstr "" #: src/libdar/crypto_asym.cpp:306 #, c-format msgid "No valid signing key could be find for %S" msgstr "" #: src/libdar/crypto_asym.cpp:308 #, c-format msgid "No valid encryption key could be find for %S" msgstr "" #: src/libdar/crypto_asym.cpp:319 msgid "No signatory remain with a valid key, signing is impossible, aborting" msgstr "" #: src/libdar/crypto_asym.cpp:321 msgid "" "No recipient remain with a valid key, encryption is impossible, aborting" msgstr "" #: src/libdar/crypto_asym.cpp:394 #, c-format msgid "Passphrase required for key %s :" msgstr "" #: src/libdar/crypto_asym.cpp:415 msgid "Error, invalid passphrase given, try again:" msgstr "" #: src/libdar/crypto_asym.cpp:423 msgid "Error, while sending the passphrase to GPGME:" msgstr "" #: src/libdar/crypto_asym.cpp:425 msgid "Failed sending the totality of the passphrase to GPGME" msgstr "" #: src/libdar/crypto_asym.cpp:432 msgid "Failed sending CR after the passphrase" msgstr "" #: src/libdar/crypto_sym.cpp:74 msgid "" "Current implementation of blowfish encryption is not compatible with old " "(weak) implementation, use dar-2.3.x software (or other software based on " "libdar-4.4.x) to read this archive" msgstr "" #: src/libdar/crypto_sym.cpp:85 src/libdar/crypto_sym.cpp:147 #, c-format msgid "Cyphering algorithm not available in libgcrypt: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:91 src/libdar/crypto_sym.cpp:582 #, c-format msgid "" "Failed retrieving from libgcrypt the block size used by the cyphering " "algorithm: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:108 #, c-format msgid "Error while opening libgcrypt key handle: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:116 #, c-format msgid "Error while assigning key to libgcrypt key handle: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:133 msgid "Missing strong encryption support (libgcrypt)" msgstr "" #: src/libdar/crypto_sym.cpp:152 msgid "Failed retrieving from libgcrypt the maximum key length" msgstr "" #: src/libdar/crypto_sym.cpp:185 #, c-format msgid "" "Error while opening libgcrypt key handle to check password strength: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:197 #, c-format msgid "" "Error while assigning key to libgcrypt key handle to check password " "strength: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:267 #, c-format msgid "Error while resetting encryption key for a new block: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:271 src/libdar/crypto_sym.cpp:295 #, c-format msgid "Error while setting IV for current block: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:274 #, c-format msgid "Error while cyphering data: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:280 src/libdar/crypto_sym.cpp:304 msgid "blowfish strong encryption support" msgstr "" #: src/libdar/crypto_sym.cpp:298 #, c-format msgid "Error while decyphering data: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:339 #, c-format msgid "Error while generating IV: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:380 #, c-format msgid "Error! SHA1 not available in libgcrypt: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:386 #, c-format msgid "Error while derivating key from password (HMAC open): %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:392 #, c-format msgid "Error while derivating key from password (HMAC set key): %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:534 #, c-format msgid "Error while creating ESSIV handle: %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:542 #, c-format msgid "" "Failed retrieving from libgcrypt the key length to use (essiv key): %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:563 #, c-format msgid "Error while assigning key to libgcrypt key handle (essiv): %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:572 #, c-format msgid "" "Failed retrieving from libgcrypt the block size used by the cyphering " "algorithm (essiv): %s/%s" msgstr "" #: src/libdar/crypto_sym.cpp:627 src/libdar/crypto_sym.cpp:633 #: src/libdar/crypto_sym.cpp:642 src/libdar/crypto_sym.cpp:650 #: src/libdar/crypto_sym.cpp:683 msgid "Library used for blowfish encryption does not respect RFC 3962" msgstr "" #: src/libdar/wrapperlib.cpp:156 src/libdar/wrapperlib.cpp:161 msgid "Cannot copy a wrapperlib object (NOT IMPLEMENTED)" msgstr "" #: src/libdar/wrapperlib.cpp:476 msgid "compressReset called but compressInit never called before" msgstr "" #: src/libdar/mask_list.cpp:95 #, c-format msgid "Cannot allocate memory for buffer while reading %S" msgstr "" #: src/libdar/mask_list.cpp:121 msgid "Found '" msgstr "" #: src/libdar/mask_list.cpp:170 msgid "" "Mask_list's prefix must be an absolute path or start with \"\" string " "for archive merging" msgstr "" #: src/libdar/mask_list.cpp:192 #, c-format msgid "" "Error met while reading line\n" "\t%S\n" " from file %S: %S" msgstr "" #: src/libdar/mask_list.cpp:209 #, c-format msgid "Too much line in file %S (integer overflow)" msgstr "" #: src/libdar/generic_file_overlay_for_gpgme.cpp:55 #, c-format msgid "Error creating data buffer overlay for GPGME: %s" msgstr "" #: src/libdar/generic_file_overlay_for_gpgme.cpp:107 msgid "File offset too large to be stored in off_t type" msgstr "" #: src/libdar/capabilities.cpp:90 #, c-format msgid "Error met while checking for capability %S: %s" msgstr "" #: src/libdar/cat_directory.cpp:133 msgid "" "LAX MODE: Error met building a catalogue entry, skipping this entry and " "continuing. Skipped error is: " msgstr "" #: src/libdar/cat_directory.cpp:176 msgid "missing data to build a cat_directory" msgstr "" #: src/libdar/cat_directory.cpp:425 #, c-format msgid "Cannot remove nonexistent entry %S from catalogue" msgstr "" #: src/libdar/cat_directory.cpp:586 msgid "listing() method must be given" msgstr "" #: src/libdar/cat_directory.cpp:593 msgid "argument must be a relative path" msgstr "" #: src/libdar/crc.cpp:211 src/libdar/crc.cpp:312 msgid "Invalid size for CRC width" msgstr "" #: src/libdar/mask.hpp:273 msgid "No mask in the list of mask to operate on" msgstr "" #: src/libdar/mask.hpp:306 msgid "No mask to operate on in the list of mask" msgstr "" #: src/libdar/user_interaction.cpp:116 msgid "Continue? " msgstr "" #: src/libdar/user_interaction.cpp:217 msgid "nullptr given as argument of user_interaction_callback()" msgstr "" #: src/libdar/user_interaction.cpp:254 src/libdar/user_interaction.cpp:259 #: src/libdar/user_interaction.cpp:276 src/libdar/user_interaction.cpp:280 #: src/libdar/user_interaction.cpp:297 src/libdar/user_interaction.cpp:301 #: src/libdar/user_interaction.cpp:322 src/libdar/user_interaction.cpp:326 #: src/libdar/user_interaction.cpp:349 src/libdar/user_interaction.cpp:353 #: src/libdar/user_interaction.cpp:370 src/libdar/user_interaction.cpp:374 #: src/libdar/user_interaction.cpp:391 src/libdar/user_interaction.cpp:395 #: src/libdar/user_interaction.cpp:414 src/libdar/user_interaction.cpp:418 #: src/libdar/user_interaction.cpp:437 src/libdar/user_interaction.cpp:441 msgid "No exception allowed from libdar callbacks" msgstr "" #: src/libdar/int_tools.cpp:65 msgid "a binary digit is either 0 or 1" msgstr "" #: src/libdar/archive_options.cpp:155 msgid "Cannot get catalogue of reference as it has not been provided" msgstr "" #: src/libdar/archive_options.cpp:173 msgid "Error, catalogue of reference has not been provided" msgstr "" #: src/libdar/archive_options.cpp:1182 src/libdar/archive_options.cpp:1189 msgid "No mask available" msgstr "" #: src/libdar/header.cpp:103 src/libdar/header.cpp:111 #: src/libdar/header.cpp:114 src/libdar/header.cpp:116 msgid "Reached end of file while reading slice header" msgstr "" #: src/libdar/header.cpp:130 src/libdar/header.cpp:152 msgid "" "LAX MODE: slice size is not possible to read, (lack of virtual memory?), " "continuing anyway..." msgstr "" #: src/libdar/header.cpp:167 msgid "" "LAX MODE: first slice size is not possible to read, (lack of virtual " "memory?), continuing anyway..." msgstr "" #: src/libdar/header.cpp:180 msgid "" "Archive format older than \"08\" (release 2.4.0) cannot be read through a " "single pipe. It only can be read using dar_slave or normal plain file (slice)" msgstr "" #: src/libdar/header.cpp:182 msgid "" "LAX MODE: first slice size is not possible to read, continuing anyway..." msgstr "" #: src/libdar/header.cpp:197 msgid "Badly formatted SAR header (unknown TLV type in slice header)" msgstr "" #: src/libdar/header.cpp:200 msgid "LAX MODE: Unknown data in slice header, ignoring and continuing" msgstr "" #: src/libdar/header.cpp:368 msgid "incomplete data set name found in a slice header" msgstr "" #: src/libdar/header.cpp:372 #, c-format msgid "" "Unknown entry found in slice header (type = %d), option not supported. The " "archive you are reading may have been generated by a more recent version of " "libdar, ignore this entry and continue anyway?" msgstr "" #: src/libdar/hash_fichier.cpp:96 #, c-format msgid "" "Error while initializing hash: Hash algorithm not available in libgcrypt: %s/" "%s" msgstr "" #: src/libdar/hash_fichier.cpp:100 #, c-format msgid "Error while creating hash handle: %s/%s" msgstr "" #: src/libdar/hash_fichier.cpp:102 src/libdar/hash_fichier.cpp:138 #: src/libdar/hash_fichier.cpp:153 msgid "" "Missing hashing algorithms support (which is part of strong encryption " "support, using libgcrypt)" msgstr "" #: src/libdar/hash_fichier.cpp:186 msgid "Failed writing down the hash: " msgstr "" #: src/libdar/cat_device.cpp:94 src/libdar/cat_device.cpp:97 msgid "missing data to build a special device" msgstr "" #: src/libdar/cat_device.cpp:145 #, c-format msgid "devices have not the same major number: %d <--> %d" msgstr "" #: src/libdar/cat_device.cpp:147 #, c-format msgid "devices have not the same minor number: %d <--> %d" msgstr "" #: src/libdar/sar.cpp:165 #, c-format msgid "" "Error met while opening the last slice: %S. Trying to open the archive using " "the first slice..." msgstr "" #: src/libdar/sar.cpp:215 msgid "File size too small" msgstr "" #: src/libdar/sar.cpp:219 msgid "First file size too small" msgstr "" #: src/libdar/sar.cpp:709 msgid "LAX MODE: Caught exception: " msgstr "" #: src/libdar/sar.cpp:710 #, c-format msgid "" "LAX MODE: %S is missing, You have the possibility to create a zero byte " "length file under the name of this slice, to replace this missing file. This " "will of course generate error messages about the information that is missing " "in this slice, but at least libdar will be able to continue. Can we continue " "now?" msgstr "" #: src/libdar/sar.cpp:722 #, c-format msgid "%S is required for further operation, please provide the file." msgstr "" #: src/libdar/sar.cpp:724 #, c-format msgid "" "%S is required for further operation, please provide the file if you have it." msgstr "" #: src/libdar/sar.cpp:729 #, c-format msgid "Failed reading slice %S: " msgstr "" #: src/libdar/sar.cpp:766 #, c-format msgid "%S has a bad or corrupted header, please provide the correct file." msgstr "" #: src/libdar/sar.cpp:770 #, c-format msgid "" "LAX MODE: %S has a bad or corrupted header, trying to guess original values " "and continuing if possible" msgstr "" #: src/libdar/sar.cpp:780 #, c-format msgid "" "%S is not a valid file (wrong magic number), please provide the good file." msgstr "" #: src/libdar/sar.cpp:784 #, c-format msgid "" "LAX MODE: In spite of its name, %S does not appear to be a dar slice, " "assuming a data corruption took place and continuing" msgstr "" #: src/libdar/sar.cpp:788 msgid "" "This is an old archive, it can only be opened starting by the first slice" msgstr "" #: src/libdar/sar.cpp:815 msgid "" "LAX MODE: Due to probable data corruption, dar could not determine the " "correct size of slices in this archive. For recent archive, this information " "is duplicated in each slice, do you want to try opening another slice to get " "this value if present?" msgstr "" #: src/libdar/sar.cpp:819 msgid "LAX MODE: Please provide the slice number to read: " msgstr "" #: src/libdar/sar.cpp:827 msgid "LAX MODE: Please provide an strictly positive integer number" msgstr "" #: src/libdar/sar.cpp:833 #, c-format msgid "LAX MODE: opening slice %i to read its slice header" msgstr "" #: src/libdar/sar.cpp:835 #, c-format msgid "LAX MODE: closing slice %i, header properly fetched" msgstr "" #: src/libdar/sar.cpp:841 msgid "" "LAX MODE: In spite of a the absence of a known slice size, continuing anyway" msgstr "" #: src/libdar/sar.cpp:848 msgid "Incoherent slice header: First slice size too small" msgstr "" #: src/libdar/sar.cpp:850 msgid "incoherent slice header: Slice size too small" msgstr "" #: src/libdar/sar.cpp:856 #, c-format msgid "Error opening %S : " msgstr "" #: src/libdar/sar.cpp:856 msgid " . Retry ?" msgstr "" #: src/libdar/sar.cpp:867 msgid " is a slice from another backup, please provide the correct slice." msgstr "" #: src/libdar/sar.cpp:872 msgid "" "LAX MODE: internal name of the slice leads dar to consider it is not member " "of the same archive. Assuming data corruption occurred and relying on the " "filename of this slice as proof of its membership to the archive" msgstr "" #: src/libdar/sar.cpp:897 msgid "" "Data corruption met at end of slice, forbidden flag found at this position" msgstr "" #: src/libdar/sar.cpp:903 msgid "Data corruption met at end of slice, unknown flag found" msgstr "" #: src/libdar/sar.cpp:918 #, c-format msgid "" "Two different slices (%i and %i) are marked as the last slice of the backup!" msgstr "" #: src/libdar/sar.cpp:921 #, c-format msgid "" "LAX MODE: slices %i and %i are both recorded as last slice of the archive, " "keeping the higher number as the real last slice" msgstr "" #: src/libdar/sar.cpp:944 #, c-format msgid "Slice %S has an unknown flag (neither terminal nor non_terminal file)." msgstr "" #: src/libdar/sar.cpp:954 #, c-format msgid "" "Due to data corruption, it is not possible to know if slice %S is the last " "slice of the archive or not. I need your help to figure out this. At the " "following prompt please answer either one of the following words: \"last\" " "or \"notlast\" according to the nature of this slice (you can also answer " "with \"abort\" to abort the program immediately): " msgstr "" #: src/libdar/sar.cpp:956 src/libdar/sar.cpp:960 msgid "last" msgstr "" #: src/libdar/sar.cpp:956 msgid "notlast" msgstr "" #: src/libdar/sar.cpp:956 src/libdar/sar.cpp:958 msgid "abort" msgstr "" #: src/libdar/sar.cpp:972 msgid "" "LAX MODE: Slice flag corrupted, but a slice of higher number has been seen, " "thus the header flag was surely not indicating this slice as the last of the " "archive. Continuing" msgstr "" #: src/libdar/sar.cpp:1016 #, c-format msgid "failed openning slice %S: %S. Will try to erase it first, if allowed" msgstr "" #: src/libdar/sar.cpp:1102 msgid "file exists, and DONT_ERASE option is set." msgstr "" #: src/libdar/sar.cpp:1107 msgid " is about to be overwritten." msgstr "" #: src/libdar/sar.cpp:1185 msgid "" "First slice size is too small to even just be able to drop the slice header" msgstr "" #: src/libdar/sar.cpp:1187 msgid "Slice size is too small to even just be able to drop the slice header" msgstr "" #: src/libdar/sar.cpp:1250 msgid "Finished writing to file " msgstr "" #: src/libdar/sar.cpp:1250 msgid ", ready to continue ? " msgstr "" #: src/libdar/sar.cpp:1255 msgid "" "If you really want to abort the archive creation hit CTRL-C, then press " "enter." msgstr "" #: src/libdar/sar.cpp:1287 msgid "file not open" msgstr "" #: src/libdar/sar.cpp:1321 msgid "The last file of the set is not present in " msgstr "" #: src/libdar/sar.cpp:1321 msgid " , please provide it." msgstr "" #: src/libdar/sar.cpp:1335 #, c-format msgid "" "No backup file is present in %S for archive %S, please provide the last file " "of the set." msgstr "" #: src/libdar/escape_catalogue.cpp:89 msgid "" "incoherent data after escape sequence, cannot read internal data set label" msgstr "" #: src/libdar/escape_catalogue.cpp:99 msgid "Could not find tape mark for the internal catalogue" msgstr "" #: src/libdar/escape_catalogue.cpp:429 msgid "" "Escape sequences used for reading lead the archive to place some files out " "of the specified root. To overcome this problem, try reading the archive in " "direct mode (not using sequential reading), try repairing the archive using " "Parchive if redundancy data has been created or in last resort try using the " "lax mode" msgstr "" #: src/libdar/escape_catalogue.cpp:432 msgid "" "LAX MODE: Archive directory structure is corrupted, it would lead to place " "some files out of the specified root directory. Restoring different " "directory contents at the root not out of it, which will put files of " "different directories in the specified root directory" msgstr "" #: src/libdar/escape_catalogue.cpp:447 msgid "" "LAX MODE: found unknown catalogue entry, assuming data corruption occurred. " "Skipping to the next entry, this may lead to improper directory structure " "being restored, if the corrupted data was a directory" msgstr "" #: src/libdar/escape_catalogue.cpp:454 msgid "Corrupted entry following an escape mark in the archive" msgstr "" #: src/libdar/escape_catalogue.cpp:483 msgid "" "Uncompleted archive! Assuming it has been interrupted during the backup " "process. If an error has been reported just above, simply ignore it, this is " "about the file that was saved at the time of the interruption." msgstr "" #: src/libdar/escape_catalogue.cpp:518 msgid "Cannot extract from the internal catalogue the list of files to remove" msgstr "" #: src/libdar/escape_catalogue.cpp:591 msgid "" "Archive internal catalogue is properly signed but its content does not match " "the tape marks used so far for sequentially reading. Possible data " "corruption or archive compromission occurred! if data extracted in " "sequential read mode does not match the data extracted in direct access " "mode, consider the sequential data has been been modified after the archive " "has been generated" msgstr "" #: src/libdar/escape_catalogue.cpp:729 msgid "" "Resetting the sequential reading process of the archive contents while it is " "not finished, will make all data unread so far becoming inaccessible" msgstr "" #: src/libdar/statistics.cpp:81 msgid "Error while initializing \"mutex\" for class \"statistics\": " msgstr "" #: src/libdar/real_infinint.cpp:69 src/libdar/limitint.hpp:269 msgid "Reached end of file before all data could be read" msgstr "" #: src/libdar/real_infinint.cpp:82 src/libdar/limitint.hpp:282 msgid "Badly formed \"infinint\" or not supported format" msgstr "" #: src/libdar/real_infinint.cpp:246 src/libdar/limitint.hpp:420 msgid "" "Subtracting an \"infinint\" greater than the first, \"infinint\" cannot be " "negative" msgstr "" #: src/libdar/real_infinint.cpp:839 src/libdar/limitint.hpp:461 #: src/libdar/limitint.hpp:470 msgid "Division by zero" msgstr "" #: src/libdar/integers.cpp:36 #, c-format msgid "%s type length is not %d byte(s) but %d" msgstr "" #: src/libdar/integers.cpp:44 #, c-format msgid "%s type is not a signed type as expected" msgstr "" #: src/libdar/integers.cpp:46 #, c-format msgid "%s type is not an unsigned type as expected" msgstr "" #: src/libdar/integers.cpp:101 #, c-format msgid "" "type %s is neither big nor little endian! Do not know how to handle integer " "in a portable manner on this host, aborting" msgstr "" #: src/libdar/integers.cpp:154 msgid "incoherent endian between U_16 and U_32" msgstr "" #: src/libdar/integers.cpp:156 msgid "incoherent endian between U_16 and U_64" msgstr "" #: src/libdar/integers.cpp:158 msgid "incoherent endian between U_16 and U_I" msgstr "" #: src/libdar/filesystem_specific_attribute.hpp:243 msgid "true" msgstr "" #: src/libdar/filesystem_specific_attribute.hpp:243 msgid "false" msgstr "" #: src/libdar/archive.hpp:146 msgid "Archive copy constructor is not implemented" msgstr "" #: src/libdar/archive.hpp:147 msgid "Archive assignment operator is not implemented" msgstr "" #: src/libdar/database_header.cpp:87 msgid "Cannot create database, file exists" msgstr "" #: src/libdar/database_header.cpp:128 #, c-format msgid "Error reading database %S : " msgstr "" #: src/libdar/database_header.cpp:135 msgid "" "The format version of this database is too high for that software version, " "use a more recent software to read or modify this database" msgstr "" #: src/libdar/database_header.cpp:138 msgid "Unknown header option in database, aborting\n" msgstr "" #: src/libdar/cat_etoile.cpp:44 msgid "Hard links of directories are not supported" msgstr "" #: src/libdar/path.cpp:61 src/libdar/path.cpp:83 msgid "Empty string is not a valid path" msgstr "" #: src/libdar/path.cpp:91 #, c-format msgid "%S is an not a valid path: %S" msgstr "" #: src/libdar/path.cpp:195 msgid "Cannot add an absolute path" msgstr "" #: src/libdar/path.cpp:328 msgid "Empty string as subdirectory does not make a valid path" msgstr "" #: src/libdar/storage.cpp:85 msgid "Not enough data to initialize storage field" msgstr "" #: src/libdar/storage.cpp:110 msgid "Asking for an element out of array" msgstr "" #: src/libdar/storage.cpp:162 msgid "The iterator is not indexing the object it has been asked to write to" msgstr "" #: src/libdar/storage.cpp:196 msgid "The iterator is not indexing the object it has been asked to read from" msgstr "" #: src/libdar/storage.cpp:509 msgid "The iterator is not indexing the object it has been defined for" msgstr "" #: src/libdar/storage.cpp:763 src/libdar/storage.cpp:828 msgid "Iterator does not point to data" msgstr "" #: src/libdar/storage.cpp:822 msgid "Reference storage of the iterator is empty or non existent" msgstr "" #: src/libdar/storage.cpp:839 msgid "The iterator position is not inside the storage of reference" msgstr "" #: src/libdar/entrepot.hpp:79 msgid "root's entrepot must be an absolute path: " msgstr "" #: src/libdar/database.cpp:114 msgid "Badly formatted database" msgstr "" #: src/libdar/database.cpp:162 msgid "Cannot write down a read-only database" msgstr "" #: src/libdar/database.cpp:210 msgid "Empty string is an invalid archive basename" msgstr "" #: src/libdar/database.cpp:212 msgid "Cannot add another archive, database is full" msgstr "" #: src/libdar/database.cpp:238 src/libdar/database.cpp:240 msgid "Incorrect archive range in database" msgstr "" #: src/libdar/database.cpp:267 src/libdar/database.cpp:286 #: src/libdar/database.cpp:403 msgid "Non existent archive in database" msgstr "" #: src/libdar/database.cpp:306 src/libdar/database.cpp:308 msgid "Invalid archive number: " msgstr "" #: src/libdar/database.cpp:363 #, c-format msgid "dar path : %S\n" msgstr "" #: src/libdar/database.cpp:364 #, c-format msgid "dar options : %S\n" msgstr "" #: src/libdar/database.cpp:365 #, c-format msgid "database version: %d\n" msgstr "" #: src/libdar/database.cpp:367 #, c-format msgid "archive # | path | basename\n" msgstr "" #: src/libdar/database.cpp:377 msgid "" msgstr "" #: src/libdar/database.cpp:427 msgid "Invalid path, path must be relative" msgstr "" #: src/libdar/database.cpp:433 src/libdar/database.cpp:438 #: src/libdar/database.cpp:442 msgid "Non existent file in database" msgstr "" #: src/libdar/database.cpp:469 #, c-format msgid " archive # | most recent/total data | most recent/total EA\n" msgstr "" #: src/libdar/database.cpp:470 #, c-format msgid "--------------+-------------------------+-----------------------\n" msgstr "" #: src/libdar/database.cpp:503 msgid "Checking chronological ordering of files between the archives..." msgstr "" #: src/libdar/database.cpp:526 msgid "File recorded as removed at this date in database: " msgstr "" #: src/libdar/database.cpp:530 msgid "File not found in database: " msgstr "" #: src/libdar/database.cpp:534 msgid "" "File found in database but impossible to restore (only found \"unchanged\" " "in differential backups): " msgstr "" #: src/libdar/database.cpp:556 msgid "" "Extended Attribute of file found in database but impossible to restore (only " "found \"unchanged\" in differential backups): " msgstr "" #: src/libdar/database.cpp:578 #, c-format msgid "%S did not exist before specified date and cannot be restored" msgstr "" #: src/libdar/database.cpp:600 #, c-format msgid "" "Either archives in database are not properly tidied, or file last " "modification date has been artificially set to an more ancient date. This " "may lead improper Extended Attribute restoration for inode %S" msgstr "" #: src/libdar/database.cpp:620 #, c-format msgid "Cannot restore file %S : non existent file in database" msgstr "" #: src/libdar/database.cpp:676 msgid "Error while restoring the following files: " msgstr "" #: src/libdar/database.cpp:685 msgid "Cannot restore any file, nothing done" msgstr "" #: src/libdar/database.cpp:698 src/libdar/database.cpp:706 #, c-format msgid "Invalid archive number: %d" msgstr "" #: src/libdar/ea_filesystem.cpp:183 #, c-format msgid "Error while adding EA %s : %s" msgstr "" #: src/libdar/ea_filesystem.cpp:214 #, c-format msgid "Error while removing %s : %s" msgstr "" #: src/libdar/ea_filesystem.cpp:246 src/libdar/ea_filesystem.cpp:274 #, c-format msgid "Error reading attribute %s of file %s : %s" msgstr "" #: src/libdar/ea_filesystem.cpp:330 src/libdar/ea_filesystem.cpp:348 #, c-format msgid "Error retrieving EA list for %s : %s" msgstr "" #: src/libdar/terminateur.cpp:133 msgid "Badly formatted terminator, cannot extract catalogue location: " msgstr "" #: src/dar_suite/line_tools.cpp:90 src/dar_suite/line_tools.cpp:108 msgid "Index out of range" msgstr "" #: src/dar_suite/line_tools.cpp:237 msgid "Syntax error in --retry-on-change argument: " msgstr "" #: src/dar_suite/line_tools.cpp:252 msgid "Unknown TLV record type" msgstr "" #: src/dar_suite/line_tools.cpp:293 src/dar_suite/line_tools.cpp:323 msgid "Unbalanced parenthesis in expression: " msgstr "" #: src/dar_suite/line_tools.cpp:391 #, c-format msgid "Unknown macro %%%d in user comment" msgstr "" #: src/dar_suite/line_tools.cpp:583 #, c-format msgid "Invalid number in string: %S" msgstr "" #: src/dar_suite/line_tools.cpp:819 msgid "unknown cryptographic algorithm: " msgstr "" #: src/dar_suite/line_tools.cpp:839 #, c-format msgid "" "| Signature Status| Key Status | Finger Print " "| Signature Date |" msgstr "" #: src/dar_suite/hide_file.cpp:33 msgid "hide_file cannot be initialized with write-only file" msgstr "" #: src/dar_suite/dar_cp.cpp:131 #, c-format msgid "usage : %s \n" msgstr "" #: src/dar_suite/dar_cp.cpp:143 src/dar_suite/dar_slave.cpp:286 #: src/dar_suite/dar_xform.cpp:581 src/dar_suite/dar_manager.cpp:912 #: src/dar_suite/command_line.cpp:2170 #, c-format msgid " compiled the %s with %s version %s\n" msgstr "" #: src/dar_suite/dar_cp.cpp:144 src/dar_suite/dar_slave.cpp:287 #: src/dar_suite/dar_xform.cpp:582 src/dar_suite/dar_manager.cpp:913 #: src/dar_suite/command_line.cpp:2171 #, c-format msgid " %s is part of the Disk ARchive suite (Release %s)\n" msgstr "" #: src/dar_suite/dar_cp.cpp:145 #, c-format msgid " %s comes with ABSOLUTELY NO WARRANTY; for details type `dar -W'." msgstr "" #: src/dar_suite/dar_cp.cpp:146 msgid " This is free software, and you are welcome to redistribute it under" msgstr "" #: src/dar_suite/dar_cp.cpp:147 msgid "" " certain conditions; type `dar -L | more' for details.\n" "\n" msgstr "" #: src/dar_suite/dar_cp.cpp:151 msgid "Unexpected exception from libdar" msgstr "" #: src/dar_suite/dar_cp.cpp:168 #, c-format msgid "Memory allocation failed : %s" msgstr "" #: src/dar_suite/dar_cp.cpp:184 #, c-format msgid "Cannot open source file : %s" msgstr "" #: src/dar_suite/dar_cp.cpp:195 #, c-format msgid "Cannot open destination file : %s" msgstr "" #: src/dar_suite/dar_cp.cpp:220 #, c-format msgid "Starting the copy of %u byte(s)" msgstr "" #: src/dar_suite/dar_cp.cpp:230 #, c-format msgid "" "Error reading source file (we are at %.2f %% of data copied), trying to read " "further: %s\n" msgstr "" #: src/dar_suite/dar_cp.cpp:234 #, c-format msgid "" "Skipping done (missing %.0f byte(s)), found correct data to read, continuing " "the copy...\n" msgstr "" #: src/dar_suite/dar_cp.cpp:240 msgid "" "Reached End of File, no correct data could be found after the last error\n" msgstr "" #: src/dar_suite/dar_cp.cpp:248 #, c-format msgid "Copy finished. Missing %.0f byte(s) of data\n" msgstr "" #: src/dar_suite/dar_cp.cpp:249 #, c-format msgid "Which is %.2f %% of the total amount of data\n" msgstr "" #: src/dar_suite/dar_cp.cpp:258 msgid "Cannot seek back one char" msgstr "" #: src/dar_suite/dar_cp.cpp:269 src/dar_suite/dar_cp.cpp:354 msgid "Cannot write to destination, aborting" msgstr "" #: src/dar_suite/dar_cp.cpp:313 msgid "Cannot seek in file" msgstr "" #: src/dar_suite/dar_cp.cpp:357 #, c-format msgid "Non fatal error while writing to destination file, retrying\n" msgstr "" #: src/dar_suite/dar_suite.cpp:147 #, c-format msgid "" "We have linked with an incompatible version of libdar. Expecting version %d." "%d.x but having linked with version %d.%d.%d" msgstr "" #: src/dar_suite/dar_suite.cpp:159 msgid "NOT YET IMPLEMENTED FEATURE has been used: " msgstr "" #: src/dar_suite/dar_suite.cpp:160 msgid "Please check documentation or upgrade your software if available" msgstr "" #: src/dar_suite/dar_suite.cpp:165 msgid "SEEMS TO BE A HARDWARE PROBLEM: " msgstr "" #: src/dar_suite/dar_suite.cpp:166 msgid "Please check your hardware" msgstr "" #: src/dar_suite/dar_suite.cpp:171 msgid "Lack of SECURED memory to achieve the operation, aborting operation" msgstr "" #: src/dar_suite/dar_suite.cpp:176 src/dar_suite/dar_suite.cpp:181 msgid "Lack of memory to achieve the operation, aborting operation" msgstr "" #: src/dar_suite/dar_suite.cpp:186 src/dar_suite/dar_suite.cpp:232 msgid "FATAL error, aborting operation" msgstr "" #: src/dar_suite/dar_suite.cpp:192 msgid "Aborting program. User refused to continue while asking: " msgstr "" #: src/dar_suite/dar_suite.cpp:197 msgid "Program has been aborted for the following reason: " msgstr "" #: src/dar_suite/dar_suite.cpp:207 msgid "Aborting program. An error occurred concerning user command execution: " msgstr "" #: src/dar_suite/dar_suite.cpp:212 msgid "Aborting program. An error occurred while calling libdar: " msgstr "" #: src/dar_suite/dar_suite.cpp:217 src/dar_suite/dar_suite.cpp:222 msgid "Aborting program. " msgstr "" #: src/dar_suite/dar_suite.cpp:227 msgid "" "Aborting program. The requested operation needs a feature that has been " "disabled at compilation time: " msgstr "" #: src/dar_suite/dar_suite.cpp:239 src/dar_suite/dar_suite.cpp:259 msgid "INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINER" msgstr "" #: src/dar_suite/dar_suite.cpp:258 msgid "CAUGHT A NON (LIB)DAR EXCEPTION" msgstr "" #: src/dar_suite/dar_suite.cpp:266 msgid "" "SANITY CHECK: AT LEAST ONE THREAD_CANCELLATION OBJECT HAS NOT BEEN DESTROYED " "AND REMAINS IN MEMORY WHILE THE PROGRAM REACHED ITS END" msgstr "" #: src/dar_suite/dar_suite.cpp:292 #, c-format msgid "Long options support : %s\n" msgstr "" #: src/dar_suite/dar_suite.cpp:308 #, c-format msgid "Received signal: %s" msgstr "" #: src/dar_suite/dar_suite.cpp:310 #, c-format msgid "Received signal: %d" msgstr "" #: src/dar_suite/dar_suite.cpp:316 msgid "Archive fast termination engaged" msgstr "" #: src/dar_suite/dar_suite.cpp:320 msgid "Archive delayed termination engaged" msgstr "" #: src/dar_suite/dar_suite.cpp:324 msgid "" "Disabling signal handler, the next time this signal is received the program " "will abort immediately" msgstr "" #: src/dar_suite/dar_suite.cpp:328 msgid "" "Cannot cleanly abort the operation, thread-safe support is missing, will " "thus abruptly stop the program, generated archive may be unusable" msgstr "" #: src/dar_suite/dar_slave.cpp:175 msgid "Cannot read arguments on command line, aborting" msgstr "" #: src/dar_suite/dar_slave.cpp:185 msgid "Missing argument to -i option" msgstr "" #: src/dar_suite/dar_slave.cpp:193 msgid "Missing argument to -o option" msgstr "" #: src/dar_suite/dar_slave.cpp:207 msgid "Missing argument to -E option" msgstr "" #: src/dar_suite/dar_slave.cpp:217 src/dar_suite/dar_xform.cpp:470 #: src/dar_suite/command_line.cpp:1611 msgid "Missing argument to --min-digits" msgstr "" #: src/dar_suite/dar_slave.cpp:225 src/dar_suite/dar_xform.cpp:478 #, c-format msgid "Missing parameter to option -%c" msgstr "" #: src/dar_suite/dar_slave.cpp:227 src/dar_suite/dar_slave.cpp:230 #: src/dar_suite/dar_xform.cpp:480 src/dar_suite/dar_manager.cpp:495 #: src/dar_suite/dar_manager.cpp:498 src/dar_suite/command_line.cpp:1692 #: src/dar_suite/command_line.cpp:1695 #, c-format msgid "Ignoring unknown option -%c" msgstr "" #: src/dar_suite/dar_slave.cpp:236 msgid "Missing archive basename, see -h option for help" msgstr "" #: src/dar_suite/dar_slave.cpp:242 src/dar_suite/dar_xform.cpp:495 msgid "Too many argument on command line, see -h option for help" msgstr "" #: src/dar_suite/dar_slave.cpp:262 src/dar_suite/dar_slave.cpp:267 #: src/dar_suite/dar_xform.cpp:542 src/dar_suite/dar_xform.cpp:544 #: src/dar_suite/dar_xform.cpp:546 src/dar_suite/dar_xform.cpp:561 #: src/dar_suite/dar_manager.cpp:866 src/dar_suite/dar_manager.cpp:889 #: src/dar_suite/dar_manager.cpp:892 src/dar_suite/command_line.cpp:1711 #: src/dar_suite/command_line.cpp:1720 src/dar_suite/command_line.cpp:1723 #: src/dar_suite/command_line.cpp:1761 src/dar_suite/command_line.cpp:1786 #: src/dar_suite/command_line.cpp:1791 src/dar_suite/command_line.cpp:1795 #, c-format msgid "\n" msgstr "" #: src/dar_suite/dar_slave.cpp:263 src/dar_suite/dar_xform.cpp:547 #: src/dar_suite/command_line.cpp:1724 #, c-format msgid "Common options:\n" msgstr "" #: src/dar_suite/dar_slave.cpp:264 #, c-format msgid "" " -i pipe to use instead of std input to read orders from dar\n" msgstr "" #: src/dar_suite/dar_slave.cpp:265 #, c-format msgid "" " -o pipe to use instead of std output to write data to dar\n" msgstr "" #: src/dar_suite/dar_slave.cpp:266 #, c-format msgid "" " -E \t command line to execute between slices of the archive\n" msgstr "" #: src/dar_suite/dar_slave.cpp:268 src/dar_suite/dar_xform.cpp:562 #: src/dar_suite/dar_manager.cpp:893 #, c-format msgid "See man page for more options.\n" msgstr "" #: src/dar_suite/dar_slave.cpp:281 src/dar_suite/dar_xform.cpp:576 #: src/dar_suite/dar_manager.cpp:907 #, c-format msgid " Using libdar %u.%u.%u built with compilation time options:\n" msgstr "" #: src/dar_suite/dar_slave.cpp:283 src/dar_suite/dar_xform.cpp:578 #: src/dar_suite/dar_manager.cpp:909 #, c-format msgid " Using libdar %u.%u built with compilation time options:\n" msgstr "" #: src/dar_suite/dar_slave.cpp:288 #, c-format msgid " %s comes with ABSOLUTELY NO WARRANTY;" msgstr "" #: src/dar_suite/dar_slave.cpp:289 msgid "" " for details\n" " type `dar -W'." msgstr "" #: src/dar_suite/dar_slave.cpp:290 src/dar_suite/dar_xform.cpp:584 #: src/dar_suite/dar_manager.cpp:915 src/dar_suite/command_line.cpp:2173 msgid "" " This is free software, and you are welcome\n" " to redistribute it under certain conditions;" msgstr "" #: src/dar_suite/dar_slave.cpp:291 msgid "" " type `dar -L | more'\n" " for details.\n" "\n" msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:116 msgid "Missing } in conditional statement: " msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:120 msgid "Missing [ after } in conditional statement: " msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:123 msgid "Missing ] in conditional statement: " msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:201 #, c-format msgid "Unknown policy for data '%c' in expression %S" msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:234 #, c-format msgid "Unknown policy for EA '%c' in expression %S" msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:244 msgid "Unknown expression in overwriting policy: " msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:427 msgid "Unknown atomic operator, or atomic not allowed with an argument: " msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:506 msgid "Unknown character found while parsing conditional string: " msgstr "" #: src/dar_suite/crit_action_cmd_line.cpp:515 msgid "Unknown expression found while parsing conditional string: " msgstr "" #: src/dar_suite/dar_xform.cpp:268 msgid "Error transforming the archive :" msgstr "" #: src/dar_suite/dar_xform.cpp:351 src/dar_suite/command_line.cpp:968 msgid "Only one -s option is allowed" msgstr "" #: src/dar_suite/dar_xform.cpp:353 msgid "Missing argument to -s" msgstr "" #: src/dar_suite/dar_xform.cpp:364 msgid "Invalid size for option -s" msgstr "" #: src/dar_suite/dar_xform.cpp:371 msgid "Missing argument to -S" msgstr "" #: src/dar_suite/dar_xform.cpp:376 src/dar_suite/dar_xform.cpp:394 #: src/dar_suite/command_line.cpp:993 src/dar_suite/command_line.cpp:1011 msgid "Only one -S option is allowed" msgstr "" #: src/dar_suite/dar_xform.cpp:384 msgid "Giving -S option the same value as the one given to -s is useless" msgstr "" #: src/dar_suite/dar_xform.cpp:388 msgid "Invalid size for option -S" msgstr "" #: src/dar_suite/dar_xform.cpp:425 msgid "Missing argument to -E" msgstr "" #: src/dar_suite/dar_xform.cpp:433 msgid "Missing argument to -F" msgstr "" #: src/dar_suite/dar_xform.cpp:441 src/dar_suite/command_line.cpp:1327 msgid "-a option requires an argument" msgstr "" #: src/dar_suite/dar_xform.cpp:448 msgid "Unknown parameter given to -a option: " msgstr "" #: src/dar_suite/dar_xform.cpp:454 msgid "Missing argument to -^" msgstr "" #: src/dar_suite/dar_xform.cpp:459 src/dar_suite/command_line.cpp:1597 msgid "Missing argument to --hash" msgstr "" #: src/dar_suite/dar_xform.cpp:466 src/dar_suite/command_line.cpp:1607 msgid "Unknown parameter given to --hash option: " msgstr "" #: src/dar_suite/dar_xform.cpp:490 msgid "" "Missing source or destination argument on command line, see -h option for " "help" msgstr "" #: src/dar_suite/dar_xform.cpp:505 msgid "Invalid argument as source archive" msgstr "" #: src/dar_suite/dar_xform.cpp:512 msgid "Invalid argument as destination archive" msgstr "" #: src/dar_suite/dar_xform.cpp:518 msgid "Archive on stdout is not compatible with slicing (-s option)" msgstr "" #: src/dar_suite/dar_xform.cpp:543 #, c-format msgid "\t\t the first non options argument is the archive to read\n" msgstr "" #: src/dar_suite/dar_xform.cpp:545 #, c-format msgid "\t\t the second non option argument is the archive to create\n" msgstr "" #: src/dar_suite/dar_xform.cpp:548 src/dar_suite/dar_manager.cpp:887 #, c-format msgid " -h\t\t displays this help information\n" msgstr "" #: src/dar_suite/dar_xform.cpp:549 #, c-format msgid " -V\t\t displays version information\n" msgstr "" #: src/dar_suite/dar_xform.cpp:550 src/dar_suite/command_line.cpp:1769 #, c-format msgid "" " -s split the archive in several files of size \n" msgstr "" #: src/dar_suite/dar_xform.cpp:551 #, c-format msgid " -S first file size\n" msgstr "" #: src/dar_suite/dar_xform.cpp:552 src/dar_suite/command_line.cpp:1773 #, c-format msgid " -p\t\t pauses before writing to a new file\n" msgstr "" #: src/dar_suite/dar_xform.cpp:553 src/dar_suite/command_line.cpp:1735 #, c-format msgid " -n\t\t don't overwrite files\n" msgstr "" #: src/dar_suite/dar_xform.cpp:554 src/dar_suite/command_line.cpp:1736 #, c-format msgid " -w\t\t don't warn before overwriting files\n" msgstr "" #: src/dar_suite/dar_xform.cpp:555 src/dar_suite/command_line.cpp:1738 #, c-format msgid " -b\t\t ring the terminal bell when user action is required\n" msgstr "" #: src/dar_suite/dar_xform.cpp:556 #, c-format msgid "" " -E \t command to execute between slices of destination archive\n" msgstr "" #: src/dar_suite/dar_xform.cpp:557 #, c-format msgid " -F \t command to execute between slice of source archive\n" msgstr "" #: src/dar_suite/dar_xform.cpp:558 src/dar_suite/command_line.cpp:1771 #, c-format msgid " -aSI \t slice size suffixes k, M, T, G, etc. are power of 10\n" msgstr "" #: src/dar_suite/dar_xform.cpp:559 src/dar_suite/command_line.cpp:1772 #, c-format msgid " -abinary\t slice size suffixes k, M, T, G, etc. are power of 2\n" msgstr "" #: src/dar_suite/dar_xform.cpp:560 src/dar_suite/command_line.cpp:1785 #, c-format msgid " -^ \t permission[:user[:group]] of created slices\n" msgstr "" #: src/dar_suite/dar_xform.cpp:583 src/dar_suite/dar_manager.cpp:914 #: src/dar_suite/command_line.cpp:2172 #, c-format msgid "" " %s comes with ABSOLUTELY NO WARRANTY; for details\n" " type `%s -W'." msgstr "" #: src/dar_suite/dar_xform.cpp:585 src/dar_suite/dar_manager.cpp:916 #: src/dar_suite/command_line.cpp:2174 #, c-format msgid "" " type `%s -L | more'\n" " for details.\n" "\n" msgstr "" #: src/dar_suite/dar.cpp:133 msgid "Considering the (first) archive of reference:" msgstr "" #: src/dar_suite/dar.cpp:155 src/dar_suite/dar.cpp:195 msgid "" "Using sequential reading mode for archive source is not possible for merging " "operation" msgstr "" #: src/dar_suite/dar.cpp:172 msgid "Considering the second (alias auxiliary) archive of reference:" msgstr "" #: src/dar_suite/dar.cpp:239 src/dar_suite/dar.cpp:303 #: src/dar_suite/dar.cpp:397 src/dar_suite/dar.cpp:468 msgid "Archive signature is only possible with gnupg encryption" msgstr "" #: src/dar_suite/dar.cpp:340 msgid "" "Making room in memory (releasing memory used by archive of reference)..." msgstr "" #: src/dar_suite/dar.cpp:368 msgid "Now performing on-fly isolation..." msgstr "" #: src/dar_suite/dar.cpp:590 msgid "All files asked could not be restored" msgstr "" #: src/dar_suite/dar.cpp:669 msgid "Some file comparisons failed" msgstr "" #: src/dar_suite/dar.cpp:740 msgid "" "Some files are corrupted in the archive and it will not be possible to " "restore them" msgstr "" #: src/dar_suite/dar.cpp:790 msgid "Continue listing archive contents?" msgstr "" #: src/dar_suite/dar.cpp:811 src/dar_suite/dar.cpp:832 msgid "Final memory cleanup..." msgstr "" #: src/dar_suite/dar.cpp:890 #, c-format msgid " %i inode(s) saved\n" msgstr "" #: src/dar_suite/dar.cpp:891 #, c-format msgid " including %i hard link(s) treated\n" msgstr "" #: src/dar_suite/dar.cpp:892 #, c-format msgid "" " %i inode(s) changed at the moment of the backup and could not be saved " "properly\n" msgstr "" #: src/dar_suite/dar.cpp:893 #, c-format msgid " %i byte(s) have been wasted in the archive to resave changing files" msgstr "" #: src/dar_suite/dar.cpp:894 #, c-format msgid " %i inode(s) not saved (no inode/file change)\n" msgstr "" #: src/dar_suite/dar.cpp:895 #, c-format msgid " %i inode(s) failed to be saved (filesystem error)\n" msgstr "" #: src/dar_suite/dar.cpp:896 src/dar_suite/dar.cpp:926 #: src/dar_suite/dar.cpp:986 #, c-format msgid " %i inode(s) ignored (excluded by filters)\n" msgstr "" #: src/dar_suite/dar.cpp:897 #, c-format msgid " %i inode(s) recorded as deleted from reference backup\n" msgstr "" #: src/dar_suite/dar.cpp:899 src/dar_suite/dar.cpp:930 #: src/dar_suite/dar.cpp:994 #, c-format msgid " Total number of inode(s) considered: %i\n" msgstr "" #: src/dar_suite/dar.cpp:902 src/dar_suite/dar.cpp:990 #, c-format msgid " EA saved for %i inode(s)\n" msgstr "" #: src/dar_suite/dar.cpp:904 src/dar_suite/dar.cpp:992 #, c-format msgid " FSA saved for %i inode(s)\n" msgstr "" #: src/dar_suite/dar.cpp:922 #, c-format msgid " %i inode(s) restored\n" msgstr "" #: src/dar_suite/dar.cpp:923 #, c-format msgid " including %i hard link(s)\n" msgstr "" #: src/dar_suite/dar.cpp:924 #, c-format msgid " %i inode(s) not restored (not saved in archive)\n" msgstr "" #: src/dar_suite/dar.cpp:925 #, c-format msgid " %i inode(s) not restored (overwriting policy decision)\n" msgstr "" #: src/dar_suite/dar.cpp:927 #, c-format msgid " %i inode(s) failed to restore (filesystem error)\n" msgstr "" #: src/dar_suite/dar.cpp:928 #, c-format msgid " %i inode(s) deleted\n" msgstr "" #: src/dar_suite/dar.cpp:933 #, c-format msgid " EA restored for %i inode(s)\n" msgstr "" #: src/dar_suite/dar.cpp:935 #, c-format msgid " FSA restored for %i inode(s)\n" msgstr "" #: src/dar_suite/dar.cpp:947 src/dar_suite/dar.cpp:964 #, c-format msgid " %i item(s) treated\n" msgstr "" #: src/dar_suite/dar.cpp:948 #, c-format msgid " %i item(s) do not match those on filesystem\n" msgstr "" #: src/dar_suite/dar.cpp:949 src/dar_suite/dar.cpp:966 #, c-format msgid " %i item(s) ignored (excluded by filters)\n" msgstr "" #: src/dar_suite/dar.cpp:951 src/dar_suite/dar.cpp:968 #, c-format msgid " Total number of items considered: %i\n" msgstr "" #: src/dar_suite/dar.cpp:965 #, c-format msgid " %i item(s) with error\n" msgstr "" #: src/dar_suite/dar.cpp:984 #, c-format msgid " %i inode(s) added to archive\n" msgstr "" #: src/dar_suite/dar.cpp:985 #, c-format msgid " with %i hard link(s) recorded\n" msgstr "" #: src/dar_suite/dar.cpp:987 #, c-format msgid " %i inode(s) recorded as deleted\n" msgstr "" #: src/dar_suite/dar_manager.cpp:230 msgid "Decompressing and loading database header to memory..." msgstr "" #: src/dar_suite/dar_manager.cpp:232 msgid "Decompressing and loading database to memory..." msgstr "" #: src/dar_suite/dar_manager.cpp:244 msgid "Error met while processing operation: " msgstr "" #: src/dar_suite/dar_manager.cpp:314 msgid "-B option cannot be given inside a batch file" msgstr "" #: src/dar_suite/dar_manager.cpp:451 msgid "Running batch file from a batch file is not allowed" msgstr "" #: src/dar_suite/dar_manager.cpp:467 msgid "-9 option is only valid after -A option, ignoring it" msgstr "" #: src/dar_suite/dar_manager.cpp:480 #, c-format msgid "invalid number give to -; option: %s" msgstr "" #: src/dar_suite/dar_manager.cpp:523 msgid "-e option is only available when using -r option, aborting" msgstr "" #: src/dar_suite/dar_manager.cpp:530 msgid "No action specified, aborting" msgstr "" #: src/dar_suite/dar_manager.cpp:542 src/dar_suite/dar_manager.cpp:546 msgid "Ignoring extra arguments on command line" msgstr "" #: src/dar_suite/dar_manager.cpp:552 src/dar_suite/dar_manager.cpp:569 msgid "Missing argument to command line, aborting" msgstr "" #: src/dar_suite/dar_manager.cpp:561 msgid "Arguments to -r must be relative path (never begin by '/')" msgstr "" #: src/dar_suite/dar_manager.cpp:583 msgid "No database specified, aborting" msgstr "" #: src/dar_suite/dar_manager.cpp:589 msgid "Parse error on command line (or included files): " msgstr "" #: src/dar_suite/dar_manager.cpp:602 msgid "Creating file..." msgstr "" #: src/dar_suite/dar_manager.cpp:603 msgid "Formatting file as an empty database..." msgstr "" #: src/dar_suite/dar_manager.cpp:607 msgid "Database has been successfully created empty." msgstr "" #: src/dar_suite/dar_manager.cpp:622 src/dar_suite/dar_manager.cpp:1091 msgid "Reading catalogue of the archive to add..." msgstr "" #: src/dar_suite/dar_manager.cpp:636 src/dar_suite/dar_manager.cpp:1100 msgid "Updating database with catalogue..." msgstr "" #: src/dar_suite/dar_manager.cpp:643 src/dar_suite/dar_manager.cpp:837 #: src/dar_suite/dar_manager.cpp:1103 src/dar_suite/dar_manager.cpp:1133 #: src/dar_suite/dar_manager.cpp:1227 msgid "Checking date ordering of files between archives..." msgstr "" #: src/dar_suite/dar_manager.cpp:657 src/dar_suite/dar_manager.cpp:841 #: src/dar_suite/dar_manager.cpp:1229 msgid "" "Some files do not follow chronological order when archive index increases " "withing the database, this can lead dar_manager to restored a wrong version " "of these files" msgstr "" #: src/dar_suite/dar_manager.cpp:684 src/dar_suite/dar_manager.cpp:1122 msgid "Removing information from the database..." msgstr "" #: src/dar_suite/dar_manager.cpp:704 src/dar_suite/dar_manager.cpp:724 #: src/dar_suite/dar_manager.cpp:738 src/dar_suite/dar_manager.cpp:752 msgid "Changing database header information..." msgstr "" #: src/dar_suite/dar_manager.cpp:769 msgid "" "Looking in archives for requested files, classifying files archive by " "archive..." msgstr "" #: src/dar_suite/dar_manager.cpp:816 src/dar_suite/dar_manager.cpp:1152 msgid "Computing statistics..." msgstr "" #: src/dar_suite/dar_manager.cpp:826 msgid "" "Negative number or zero not allowed when moving an archive inside a database" msgstr "" #: src/dar_suite/dar_manager.cpp:833 msgid "Changing database information..." msgstr "" #: src/dar_suite/dar_manager.cpp:867 #, c-format msgid "Commands:\n" msgstr "" #: src/dar_suite/dar_manager.cpp:868 #, c-format msgid " -C creates an empty database\n" msgstr "" #: src/dar_suite/dar_manager.cpp:869 #, c-format msgid " -B specify the database to use (read or modify)\n" msgstr "" #: src/dar_suite/dar_manager.cpp:870 #, c-format msgid " -A add an archive to the database\n" msgstr "" #: src/dar_suite/dar_manager.cpp:871 #, c-format msgid "" " -l\t\t gives information about the archive compiled in the database\n" msgstr "" #: src/dar_suite/dar_manager.cpp:872 #, c-format msgid " -D delete an archive from the database\n" msgstr "" #: src/dar_suite/dar_manager.cpp:873 #, c-format msgid "" " -b \t change the basename to use for the give archive number\n" msgstr "" #: src/dar_suite/dar_manager.cpp:874 #, c-format msgid "" " -p \t change the path to use for the given archive number\n" msgstr "" #: src/dar_suite/dar_manager.cpp:875 #, c-format msgid " -o specify a list of option to always pass to dar\n" msgstr "" #: src/dar_suite/dar_manager.cpp:876 #, c-format msgid " -d specify the path to dar\n" msgstr "" #: src/dar_suite/dar_manager.cpp:877 #, c-format msgid " -r \t restores the given files\n" msgstr "" #: src/dar_suite/dar_manager.cpp:878 #, c-format msgid "" " -w \t only with -r, restores in state just before the given date\n" msgstr "" #: src/dar_suite/dar_manager.cpp:879 #, c-format msgid "" " -u \t list the most recent files contained in the given " "archive\n" msgstr "" #: src/dar_suite/dar_manager.cpp:880 #, c-format msgid " -f \t list the archives where the given file is present\n" msgstr "" #: src/dar_suite/dar_manager.cpp:881 #, c-format msgid " -s\t\t shows the number of most recent file by archive\n" msgstr "" #: src/dar_suite/dar_manager.cpp:882 #, c-format msgid " -m \t move an archive within a given database.\n" msgstr "" #: src/dar_suite/dar_manager.cpp:883 #, c-format msgid " -i\t\t user interactive mode\n" msgstr "" #: src/dar_suite/dar_manager.cpp:884 #, c-format msgid " -c\t\t check database for dates order\n" msgstr "" #: src/dar_suite/dar_manager.cpp:885 #, c-format msgid "" " -L execute on a given database a batch of action as defined " "by\n" msgstr "" #: src/dar_suite/dar_manager.cpp:886 #, c-format msgid "\t\t the provided file.\n" msgstr "" #: src/dar_suite/dar_manager.cpp:888 #, c-format msgid " -V\t\t displays software version\n" msgstr "" #: src/dar_suite/dar_manager.cpp:890 #, c-format msgid "Options:\n" msgstr "" #: src/dar_suite/dar_manager.cpp:891 #, c-format msgid " -v\t\t display more information about what is going on\n" msgstr "" #: src/dar_suite/dar_manager.cpp:973 msgid "Corrupted database :" msgstr "" #: src/dar_suite/dar_manager.cpp:1022 #, c-format msgid "" "\n" "\n" "\t Dar Manager Database used [%s] : %S\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1022 msgid "Saved" msgstr "" #: src/dar_suite/dar_manager.cpp:1022 msgid "Not Saved" msgstr "" #: src/dar_suite/dar_manager.cpp:1024 #, c-format msgid "" "\t Pause each %d line of output\n" "\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1026 #, c-format msgid "" "\t No pause in output\n" "\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1027 #, c-format msgid " l : list database contents \t A : Add an archive\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1028 #, c-format msgid " u : list archive contents \t D : Remove an archive\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1029 #, c-format msgid " f : give file localization \t m : modify archive order\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1030 #, c-format msgid " p : modify path of archives \t b : modify basename of archives\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1031 #, c-format msgid " d : path to dar \t o : options to dar\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1032 #, c-format msgid " w : write changes to file \t s : database statistics\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1033 #, c-format msgid "" " a : Save as \t n : pause each 'n' line (zero for no pause)\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1034 #, c-format msgid "" " c : check date order\n" "\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1035 #, c-format msgid "" " q : quit\n" "\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1036 #, c-format msgid " Choice: " msgstr "" #: src/dar_suite/dar_manager.cpp:1053 msgid "Archive number: " msgstr "" #: src/dar_suite/dar_manager.cpp:1060 msgid "File to look for: " msgstr "" #: src/dar_suite/dar_manager.cpp:1064 msgid "Archive number to modify: " msgstr "" #: src/dar_suite/dar_manager.cpp:1068 #, c-format msgid "New basename for archive number %d: " msgstr "" #: src/dar_suite/dar_manager.cpp:1073 msgid "Path to dar (empty string to use the default from PATH variable): " msgstr "" #: src/dar_suite/dar_manager.cpp:1078 src/dar_suite/dar_manager.cpp:1084 #: src/dar_suite/dar_manager.cpp:1354 msgid "Compressing and writing back database to file..." msgstr "" #: src/dar_suite/dar_manager.cpp:1083 msgid "New database name: " msgstr "" #: src/dar_suite/dar_manager.cpp:1090 msgid "Archive basename (or extracted catalogue basename) to add: " msgstr "" #: src/dar_suite/dar_manager.cpp:1117 msgid "Archive number to remove: " msgstr "" #: src/dar_suite/dar_manager.cpp:1121 #, c-format msgid "Are you sure to remove archive number %d ?" msgstr "" #: src/dar_suite/dar_manager.cpp:1127 msgid "Archive number to move: " msgstr "" #: src/dar_suite/dar_manager.cpp:1129 msgid "In which position to insert this archive: " msgstr "" #: src/dar_suite/dar_manager.cpp:1138 msgid "Archive number who's path to modify: " msgstr "" #: src/dar_suite/dar_manager.cpp:1142 #, c-format msgid "New path to give to archive number %d: " msgstr "" #: src/dar_suite/dar_manager.cpp:1156 msgid "How much line to display at once: " msgstr "" #: src/dar_suite/dar_manager.cpp:1160 msgid "Checking file's dates ordering..." msgstr "" #: src/dar_suite/dar_manager.cpp:1168 src/dar_suite/dar_manager.cpp:1189 msgid "Database not saved, Do you really want to quit ?" msgstr "" #: src/dar_suite/dar_manager.cpp:1169 src/dar_suite/dar_manager.cpp:1190 #, c-format msgid "Continuing the action under process which is to exit... so we exit!" msgstr "" #: src/dar_suite/dar_manager.cpp:1178 #, c-format msgid "Unknown choice\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1204 #, c-format msgid "re-enabling all signal handlers and continuing\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1211 #, c-format msgid "Error performing the requested action: %S" msgstr "" #: src/dar_suite/dar_manager.cpp:1231 msgid "No problem found" msgstr "" #: src/dar_suite/dar_manager.cpp:1260 msgid "Opening and reading the batch file..." msgstr "" #: src/dar_suite/dar_manager.cpp:1284 #, c-format msgid "" "\n" "\tExecuting batch file line: %S\n" " " msgstr "" #: src/dar_suite/dar_manager.cpp:1293 #, c-format msgid "Syntax error in batch file: %S" msgstr "" #: src/dar_suite/dar_manager.cpp:1296 msgid "Syntax error in batch file: -C option not allowed" msgstr "" #: src/dar_suite/dar_manager.cpp:1299 msgid "Syntax error in batch file: -i option not allowed" msgstr "" #: src/dar_suite/dar_manager.cpp:1307 msgid "Aborting batch operation: " msgstr "" #: src/dar_suite/dar_manager.cpp:1318 #, c-format msgid "Enter each argument line by line, press return at the end\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1319 #, c-format msgid "To terminate enter an empty line\n" msgstr "" #: src/dar_suite/dar_manager.cpp:1446 #, c-format msgid "Absolute value too high for an archive number: %d" msgstr "" #: src/dar_suite/shell_interaction.cpp:174 msgid "" "No terminal found for user interaction. All questions will be assumed a " "negative answer (less destructive choice), which most of the time will abort " "the program." msgstr "" #: src/dar_suite/shell_interaction.cpp:234 msgid "Error reading character: " msgstr "" #: src/dar_suite/shell_interaction.cpp:259 msgid "Error while changing user terminal properties: " msgstr "" #: src/dar_suite/shell_interaction.cpp:297 msgid " [return = YES | Esc = NO]" msgstr "" #: src/dar_suite/shell_interaction.cpp:316 msgid "Error while reading user answer from terminal: " msgstr "" #: src/dar_suite/shell_interaction.cpp:321 msgid "Continuing..." msgstr "" #: src/dar_suite/shell_interaction.cpp:323 msgid "Escaping..." msgstr "" #: src/dar_suite/shell_interaction.cpp:409 msgid "Secured string can only be read from a terminal" msgstr "" #: src/dar_suite/shell_interaction.cpp:434 msgid "provided password is too long for the allocated memory" msgstr "" #: src/dar_suite/command_line.cpp:361 msgid "User target found on command line or included file(s):" msgstr "" #: src/dar_suite/command_line.cpp:370 msgid "No user target found on command line" msgstr "" #: src/dar_suite/command_line.cpp:388 #, c-format msgid "Given user target(s) could not be found: %S" msgstr "" #: src/dar_suite/command_line.cpp:392 #, c-format msgid "Missing -c -x -d -t -l -C -+ option, see `%S -h' for help" msgstr "" #: src/dar_suite/command_line.cpp:394 msgid "" "Slicing (-s option), is not compatible with archive on standard output (\"-" "\" as filename)" msgstr "" #: src/dar_suite/command_line.cpp:415 msgid "-af option is only available with -c" msgstr "" #: src/dar_suite/command_line.cpp:417 msgid "-A option is not available with -l" msgstr "" #: src/dar_suite/command_line.cpp:419 msgid "with -C option, -A option is mandatory" msgstr "" #: src/dar_suite/command_line.cpp:421 msgid "with -+ option, -A option is mandatory" msgstr "" #: src/dar_suite/command_line.cpp:423 msgid "-wa is only useful with -x option" msgstr "" #: src/dar_suite/command_line.cpp:426 msgid "-o is mandatory when using \"-A -\" with \"-c -\" \"-C -\" or \"-+ -\"" msgstr "" #: src/dar_suite/command_line.cpp:436 msgid "-z option needs only to be used with -c -C or -+ options" msgstr "" #: src/dar_suite/command_line.cpp:438 msgid "-S option requires the use of -s" msgstr "" #: src/dar_suite/command_line.cpp:440 msgid "ignoring -O option, as it is useless in this situation" msgstr "" #: src/dar_suite/command_line.cpp:447 #, c-format msgid "" "File ownership will not be restored as %s has not the CHOWN capability nor " "is running as root. to avoid this message use -O option" msgstr "" #: src/dar_suite/command_line.cpp:455 #, c-format msgid "" "Furtive read mode has been disabled as %s has not the FOWNER capability nor " "is running as root" msgstr "" #: src/dar_suite/command_line.cpp:460 msgid "-F is only useful with -A option, for the archive of reference" msgstr "" #: src/dar_suite/command_line.cpp:463 msgid "-J is only useful with -A option, for the archive of reference" msgstr "" #: src/dar_suite/command_line.cpp:466 msgid "-f in only available with -x option, ignoring" msgstr "" #: src/dar_suite/command_line.cpp:468 msgid "-m is only useful with -c" msgstr "" #: src/dar_suite/command_line.cpp:474 msgid "-H is only useful with -A option when making a backup" msgstr "" #: src/dar_suite/command_line.cpp:480 msgid "-H is only useful with -r option when extracting" msgstr "" #: src/dar_suite/command_line.cpp:484 msgid "-H is only useful with -c, -d or -x" msgstr "" #: src/dar_suite/command_line.cpp:488 msgid "-as is only available with -l, ignoring -as option" msgstr "" #: src/dar_suite/command_line.cpp:490 msgid "-e is only useful with -x, -c or -+ options" msgstr "" #: src/dar_suite/command_line.cpp:492 msgid "-ac is only useful with -c or -d" msgstr "" #: src/dar_suite/command_line.cpp:494 msgid "-M is only useful with -c" msgstr "" #: src/dar_suite/command_line.cpp:496 msgid "The snapshot backup (-A +) is only available with -c option, ignoring" msgstr "" #: src/dar_suite/command_line.cpp:498 msgid "" "The Cache Directory Tagging Standard is only useful while performing a " "backup, ignoring it here" msgstr "" #: src/dar_suite/command_line.cpp:501 msgid "-@ is only available with -+ and -c options" msgstr "" #: src/dar_suite/command_line.cpp:503 msgid "-$ is only available with -+ option and -c options" msgstr "" #: src/dar_suite/command_line.cpp:505 msgid "-~ is only available with -+ and -c options" msgstr "" #: src/dar_suite/command_line.cpp:507 #, c-format msgid "-%% is only available with -+ option" msgstr "" #: src/dar_suite/command_line.cpp:510 msgid "" "-$ is only useful with -@ option, for the auxiliary archive of reference" msgstr "" #: src/dar_suite/command_line.cpp:512 #, c-format msgid "" "-%% is only useful with -@ option, for the auxiliary archive of reference" msgstr "" #: src/dar_suite/command_line.cpp:514 msgid "" "-~ is only useful with -@ option, for the auxiliary archive of reference" msgstr "" #: src/dar_suite/command_line.cpp:517 msgid "-ak is only available while merging (operation -+), ignoring -ak" msgstr "" #: src/dar_suite/command_line.cpp:522 msgid "" "Compression option (-z option) is useless and ignored when using -ak option" msgstr "" #: src/dar_suite/command_line.cpp:529 msgid "" "--sparse-file-min-size only available while saving or merging archives, " "ignoring" msgstr "" #: src/dar_suite/command_line.cpp:532 msgid "" "To use --sparse-file-min-size while merging archive, you need to use -ah " "option too, please check man page for details" msgstr "" #: src/dar_suite/command_line.cpp:538 msgid "-k option is only useful with -x option" msgstr "" #: src/dar_suite/command_line.cpp:541 msgid "-konly and -kignore cannot be used at the same time" msgstr "" #: src/dar_suite/command_line.cpp:544 msgid "-p and -Q options are mutually exclusives" msgstr "" #: src/dar_suite/command_line.cpp:547 msgid "-vf is only useful with -c option" msgstr "" #: src/dar_suite/command_line.cpp:589 msgid "" "-Y and -Z are only useful with compression (-z option), ignoring any -Y and -" "Z option" msgstr "" #: src/dar_suite/command_line.cpp:591 msgid "-m is only useful with compression (-z option), ignoring -m" msgstr "" #: src/dar_suite/command_line.cpp:641 msgid "" "-= option is valid only while saving files, thus in conjunction with -c " "option, ignoring" msgstr "" #: src/dar_suite/command_line.cpp:643 msgid "" "-= option will be ignored as it is useless if you do not specify to which " "files or directories this backup hook is to be applied, thanks to -< and -> " "options. See man page for more details." msgstr "" #: src/dar_suite/command_line.cpp:649 msgid "" "backup hook feature (-<, -> or -= options) is only available when saving " "files, ignoring" msgstr "" #: src/dar_suite/command_line.cpp:698 msgid "-/ option is only useful with -+ option, ignoring" msgstr "" #: src/dar_suite/command_line.cpp:709 msgid "" "-. option is only useful when merging, creating or isolating an archive, " "ignoring" msgstr "" #: src/dar_suite/command_line.cpp:714 #, c-format msgid "" "The following user comment will be placed in clear text in the archive: %S" msgstr "" #: src/dar_suite/command_line.cpp:729 msgid "Parse error: " msgstr "" #: src/dar_suite/command_line.cpp:772 msgid " Only one option of -c -d -t -l -C -x or -+ is allowed" msgstr "" #: src/dar_suite/command_line.cpp:806 msgid "Only one -A option is allowed" msgstr "" #: src/dar_suite/command_line.cpp:833 msgid "Error while parsing -A argument as a date: " msgstr "" #: src/dar_suite/command_line.cpp:898 msgid "Choose only one compression algorithm" msgstr "" #: src/dar_suite/command_line.cpp:904 msgid "-w option is useless with -n" msgstr "" #: src/dar_suite/command_line.cpp:916 msgid "Unknown argument given to -w: " msgstr "" #: src/dar_suite/command_line.cpp:936 src/dar_suite/command_line.cpp:943 #: src/dar_suite/command_line.cpp:950 msgid "\"-k\" (or \"-kignore\") and \"-konly\" are not compatible" msgstr "" #: src/dar_suite/command_line.cpp:954 #, c-format msgid "Unknown argument given to -k : %s" msgstr "" #: src/dar_suite/command_line.cpp:958 msgid "Only one -R option is allowed" msgstr "" #: src/dar_suite/command_line.cpp:1001 msgid "" "Giving to -S option the same value as the one given to -s option is useless" msgstr "" #: src/dar_suite/command_line.cpp:1076 msgid "-r is useless with -n" msgstr "" #: src/dar_suite/command_line.cpp:1205 #, c-format msgid "" "File inclusion loop detected. The file %s includes itself directly or " "through other files (-B option)" msgstr "" #: src/dar_suite/command_line.cpp:1222 #, c-format msgid "Error reading included file (%s): " msgstr "" #: src/dar_suite/command_line.cpp:1227 #, c-format msgid "Error in included file (%s): " msgstr "" #: src/dar_suite/command_line.cpp:1245 src/dar_suite/command_line.cpp:2476 #: src/dar_suite/command_line.cpp:2553 #, c-format msgid "In included file %S: " msgstr "" #: src/dar_suite/command_line.cpp:1288 #, c-format msgid "" "%d is the default value for -m, no need to specify it on command line, " "ignoring" msgstr "" #: src/dar_suite/command_line.cpp:1305 msgid "" "--nodump feature has not been activated at compilation time, it is thus not " "available" msgstr "" #: src/dar_suite/command_line.cpp:1321 msgid "Argument given to -H is not a positive integer number" msgstr "" #: src/dar_suite/command_line.cpp:1374 msgid "" "-ak option need not be specified more than once, ignoring extra -ak options" msgstr "" #: src/dar_suite/command_line.cpp:1380 msgid "-af must be present before -A option not after!" msgstr "" #: src/dar_suite/command_line.cpp:1382 msgid "" "-af option need not be specified more than once, ignoring extra -af options" msgstr "" #: src/dar_suite/command_line.cpp:1406 #, c-format msgid "Unknown argument given to -a : %s" msgstr "" #: src/dar_suite/command_line.cpp:1421 msgid "" "Warning: -G option is an experimental and unsupported feature, read man page " "about -G option for more information" msgstr "" #: src/dar_suite/command_line.cpp:1450 msgid "Only one -@ option is allowed" msgstr "" #: src/dar_suite/command_line.cpp:1506 msgid "Syntax error in overwriting policy: " msgstr "" #: src/dar_suite/command_line.cpp:1539 #, c-format msgid "" "%d is the default value for --sparse-file-min-size, no need to specify it on " "command line, ignoring" msgstr "" #: src/dar_suite/command_line.cpp:1560 #, c-format msgid "Unknown argument given to -2 : %s" msgstr "" #: src/dar_suite/command_line.cpp:1620 msgid "Error while parsing --min-digits option: " msgstr "" #: src/dar_suite/command_line.cpp:1626 msgid "Missing argument to --backup-hook-execute" msgstr "" #: src/dar_suite/command_line.cpp:1708 #, c-format msgid "" "usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] " "[options...]\n" msgstr "" #: src/dar_suite/command_line.cpp:1712 #, c-format msgid "Commands are:\n" msgstr "" #: src/dar_suite/command_line.cpp:1713 #, c-format msgid " -c creates an archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1714 #, c-format msgid " -x extracts files from the archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1715 #, c-format msgid " -d compares the archive with the existing filesystem\n" msgstr "" #: src/dar_suite/command_line.cpp:1716 #, c-format msgid " -t tests the archive integrity\n" msgstr "" #: src/dar_suite/command_line.cpp:1717 #, c-format msgid " -l lists the contents of the archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1718 #, c-format msgid " -C isolates the catalogue from an archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1719 #, c-format msgid " -+ merge two archives / create a sub archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1721 #, c-format msgid " -h displays this help information\n" msgstr "" #: src/dar_suite/command_line.cpp:1722 #, c-format msgid " -V displays version information\n" msgstr "" #: src/dar_suite/command_line.cpp:1725 #, c-format msgid " -v\t\t verbose output\n" msgstr "" #: src/dar_suite/command_line.cpp:1726 #, c-format msgid " -q\t\t suppress final statistics report\n" msgstr "" #: src/dar_suite/command_line.cpp:1727 #, c-format msgid " -vs\t\t display skipped files\n" msgstr "" #: src/dar_suite/command_line.cpp:1728 #, c-format msgid " -R \t filesystem root directory (current dir by default)\n" msgstr "" #: src/dar_suite/command_line.cpp:1729 #, c-format msgid "" " -X \t files to exclude from the operation (none by default)\n" msgstr "" #: src/dar_suite/command_line.cpp:1730 #, c-format msgid " -I \t files to include in the operation (all by default)\n" msgstr "" #: src/dar_suite/command_line.cpp:1731 #, c-format msgid " -P \t subdirectory to exclude from the operation\n" msgstr "" #: src/dar_suite/command_line.cpp:1732 #, c-format msgid " -g \t subdirectory to include in the operation\n" msgstr "" #: src/dar_suite/command_line.cpp:1733 #, c-format msgid " -[ filename contains a list of files to include\n" msgstr "" #: src/dar_suite/command_line.cpp:1734 #, c-format msgid " -] \t filename contains a list of files to exclude\n" msgstr "" #: src/dar_suite/command_line.cpp:1737 #, c-format msgid " -wa\t\t don't warn before overwriting and removing files\n" msgstr "" #: src/dar_suite/command_line.cpp:1739 #, c-format msgid "" " -O[ignore-owner | mtime | inode-type] do not consider user and group\n" msgstr "" #: src/dar_suite/command_line.cpp:1740 #, c-format msgid "\t\t ownership\n" msgstr "" #: src/dar_suite/command_line.cpp:1741 #, c-format msgid " -H [N]\t ignore shift in dates of an exact number of hours\n" msgstr "" #: src/dar_suite/command_line.cpp:1742 #, c-format msgid " -E \t command to execute between slices\n" msgstr "" #: src/dar_suite/command_line.cpp:1743 #, c-format msgid " -F \t same as -E but for the archive of reference\n" msgstr "" #: src/dar_suite/command_line.cpp:1744 #, c-format msgid " -u \t mask to ignore certain EA\n" msgstr "" #: src/dar_suite/command_line.cpp:1745 #, c-format msgid " -U \t mask to allow certain EA\n" msgstr "" #: src/dar_suite/command_line.cpp:1746 #, c-format msgid " -K \t use as key to encrypt/decrypt\n" msgstr "" #: src/dar_suite/command_line.cpp:1747 #, c-format msgid "" " -J \t same as -K but it does concern the archive of reference\n" msgstr "" #: src/dar_suite/command_line.cpp:1748 #, c-format msgid " -# encryption block size\n" msgstr "" #: src/dar_suite/command_line.cpp:1749 #, c-format msgid " -* same as -# but for archive of reference\n" msgstr "" #: src/dar_suite/command_line.cpp:1750 #, c-format msgid " -B read options from given file\n" msgstr "" #: src/dar_suite/command_line.cpp:1751 #, c-format msgid " -N\t\t do not read ~/.darrc nor /etc/darrc configuration file\n" msgstr "" #: src/dar_suite/command_line.cpp:1752 #, c-format msgid " -e\t\t dry run, fake execution, nothing is produced\n" msgstr "" #: src/dar_suite/command_line.cpp:1753 #, c-format msgid " -Q\t\t suppress the initial warning when not launched from a tty\n" msgstr "" #: src/dar_suite/command_line.cpp:1754 #, c-format msgid " -aa\t\t do not try to preserve atime of file open for reading.\n" msgstr "" #: src/dar_suite/command_line.cpp:1755 #, c-format msgid " -ac\t\t do not try to preserve ctime (default behavior).\n" msgstr "" #: src/dar_suite/command_line.cpp:1756 #, c-format msgid " -am\t\t set ordered mode for all filters\n" msgstr "" #: src/dar_suite/command_line.cpp:1757 #, c-format msgid " -an\t\t the masks that follow are now case insensitive\n" msgstr "" #: src/dar_suite/command_line.cpp:1758 #, c-format msgid " -acase\t the masks that follow are now case sensitive\n" msgstr "" #: src/dar_suite/command_line.cpp:1759 #, c-format msgid " -ar\t\t set the following masks to be regex expressions\n" msgstr "" #: src/dar_suite/command_line.cpp:1760 #, c-format msgid " -ag\t\t set the following masks to be glob expressions\n" msgstr "" #: src/dar_suite/command_line.cpp:1762 #, c-format msgid "Saving / Isolation / merging options (to use with -c, -C or -+):\n" msgstr "" #: src/dar_suite/command_line.cpp:1763 #, c-format msgid " -A [path/] archive to take as reference\n" msgstr "" #: src/dar_suite/command_line.cpp:1764 #, c-format msgid " -@ [path/] auxiliary archive of reference for merging\n" msgstr "" #: src/dar_suite/command_line.cpp:1765 #, c-format msgid " -$ \t encryption key for auxiliary archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1766 #, c-format msgid " -~ \t command between slices of the auxiliary archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1767 #, c-format msgid " -z [[algo:]level]\t compress data in archive. -z = -z9 = -zgzip:9\n" msgstr "" #: src/dar_suite/command_line.cpp:1768 #, c-format msgid "" " Available algo: gzip,bzip2,lzo,xz. Exemples: -zlzo -zxz:5 -z1 -z\n" msgstr "" #: src/dar_suite/command_line.cpp:1770 #, c-format msgid " -S first file size (if different from following ones)\n" msgstr "" #: src/dar_suite/command_line.cpp:1774 #, c-format msgid " -D\t\t excluded directories are stored as empty directories\n" msgstr "" #: src/dar_suite/command_line.cpp:1775 #, c-format msgid " -Z \t do not compress the matching filenames\n" msgstr "" #: src/dar_suite/command_line.cpp:1776 #, c-format msgid " -Y \t do only compress the matching filenames\n" msgstr "" #: src/dar_suite/command_line.cpp:1777 #, c-format msgid " -m \t do not compress file smaller than \n" msgstr "" #: src/dar_suite/command_line.cpp:1778 #, c-format msgid " --nodump\t do not backup, files having the nodump 'd' flag set\n" msgstr "" #: src/dar_suite/command_line.cpp:1779 #, c-format msgid "" " -@ [path/] Do on-fly catalogue isolation of the resulting " "archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1780 #, c-format msgid " -M\t\t stay in the same filesystem while scanning directories\n" msgstr "" #: src/dar_suite/command_line.cpp:1781 #, c-format msgid " -,\t\t ignore directories that follow the Directory Tagging\n" msgstr "" #: src/dar_suite/command_line.cpp:1782 #, c-format msgid "\t\t Standard\n" msgstr "" #: src/dar_suite/command_line.cpp:1783 #, c-format msgid "" " -/ \t which way dar can overwrite files at archive merging or\n" msgstr "" #: src/dar_suite/command_line.cpp:1784 #, c-format msgid "\t\t extraction time\n" msgstr "" #: src/dar_suite/command_line.cpp:1787 #, c-format msgid "Restoring options (to use with -x) :\n" msgstr "" #: src/dar_suite/command_line.cpp:1788 #, c-format msgid " -k\t\t do not remove files destroyed since the reference backup\n" msgstr "" #: src/dar_suite/command_line.cpp:1789 #, c-format msgid " -r\t\t do not restore file older than those on filesystem\n" msgstr "" #: src/dar_suite/command_line.cpp:1790 #, c-format msgid " -f\t\t do not restore directory structure\n" msgstr "" #: src/dar_suite/command_line.cpp:1792 #, c-format msgid "Reading options (to use with -x, -d, -t, -l, -A)\n" msgstr "" #: src/dar_suite/command_line.cpp:1793 #, c-format msgid "" " -i pipe to use instead of std input to read data from " "dar_slave\n" msgstr "" #: src/dar_suite/command_line.cpp:1794 #, c-format msgid "" " -o pipe to use instead of std output to orders dar_slave\n" msgstr "" #: src/dar_suite/command_line.cpp:1796 #, c-format msgid "Listing options (to use with -l):\n" msgstr "" #: src/dar_suite/command_line.cpp:1797 #, c-format msgid " -T\t\t tree output format\n" msgstr "" #: src/dar_suite/command_line.cpp:1798 #, c-format msgid " -as\t\t only list files saved in the archive\n" msgstr "" #: src/dar_suite/command_line.cpp:1799 #, c-format msgid "" "\n" "\n" msgstr "" #: src/dar_suite/command_line.cpp:1800 #, c-format msgid "" "Type \"man dar\" for more details and for all other available options.\n" msgstr "" #: src/dar_suite/command_line.cpp:2166 #, c-format msgid " Using libdar %u.%u.%u built with compilation time options:" msgstr "" #: src/dar_suite/command_line.cpp:2167 #, c-format msgid " Using libdar %u.%u built with compilation time options:" msgstr "" #: src/dar_suite/command_line.cpp:2378 #, c-format msgid "Arguments read from %S :" msgstr "" #: src/dar_suite/command_line.cpp:2871 #, c-format msgid "" "%s does not name a compression \"[algorithm][:][level]\" , like for examples " "\"gzip\", \"lzo\", \"bzip2\", \"lzo:3\", \"gzip:2\", \"8\" or \"1\". Please " "review the man page about -z option" msgstr "" #: src/dar_suite/command_line.cpp:2890 msgid "Compression level must be between 1 and 9, included" msgstr "" #: src/dar_suite/command_line.cpp:2918 msgid "unknown FSA family: " msgstr "" #: src/dar_suite/command_line.cpp:2950 #, c-format msgid "" "User target named \"%s\" is not allowed (reserved word for conditional " "syntax)" msgstr "" #: src/check/all_features.cpp:54 msgid "-" msgstr "" dar-2.5.3/po/Makevars0000644000175000017520000000657612642474465011360 00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This tells whether or not to prepend "GNU " prefix to the package # name that gets inserted into the header of the $(DOMAIN).pot file. # Possible values are "yes", "no", or empty. If it is empty, try to # detect it automatically by scanning the files in $(top_srcdir) for # "GNU packagename" string. PACKAGE_GNU = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = http://sourceforge.net/tracker/?group_id=65612MSGID_BUGS_ADDRESS =atid=511612 # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = # These options get passed to msginit. # If you want to disable line wrapping when writing PO files, add # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and # MSGINIT_OPTIONS. MSGINIT_OPTIONS = # This tells whether or not to regenerate a PO file when $(DOMAIN).pot # has changed. Possible values are "yes" and "no". Set this to no if # the POT file is checked in the repository and the version control # program ignores timestamps. PO_DEPENDS_ON_POT = yes # This tells whether or not to forcibly update $(DOMAIN).pot and # regenerate PO files on "make dist". Possible values are "yes" and # "no". Set this to no if the POT file and PO files are maintained # externally. DIST_DEPENDS_ON_UPDATE_PO = yes dar-2.5.3/po/LINGUAS0000644000175000017430000000026412641772777010703 00000000000000# Set of available languages. fr sv # these have not been updated for a while, which might lead to bug when C formated strings (%s, %u,...) have change or have been updated # de dar-2.5.3/po/en@boldquot.header0000644000175000017520000000247112642474463013276 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # dar-2.5.3/po/POTFILES.in0000644000175000017520000001777712642474465011446 00000000000000# List of source files containing translatable strings. # Copyright (C) 1995 Free Software Foundation, Inc. ./src/examples/formula.cpp ./src/examples/prime.cpp ./src/examples/factoriel.cpp ./src/libdar/defile.cpp ./src/libdar/real_infinint.hpp ./src/libdar/mask.cpp ./src/libdar/escape.hpp ./src/libdar/scrambler.hpp ./src/libdar/archive_options.hpp ./src/libdar/etage.hpp ./src/libdar/cat_blockdev.hpp ./src/libdar/messaging.hpp ./src/libdar/entrepot_local.hpp ./src/libdar/cat_ignored_dir.cpp ./src/libdar/secu_string.hpp ./src/libdar/nls_swap.hpp ./src/libdar/zapette.cpp ./src/libdar/cat_eod.hpp ./src/libdar/erreurs_ext.cpp ./src/libdar/sparse_file.hpp ./src/libdar/cat_detruit.cpp ./src/libdar/compile_time_features.cpp ./src/libdar/range.hpp ./src/libdar/deci.hpp ./src/libdar/pile.cpp ./src/libdar/generic_file.hpp ./src/libdar/trivial_sar.hpp ./src/libdar/database_options.hpp ./src/libdar/erreurs.hpp ./src/libdar/secu_memory_file.hpp ./src/libdar/filtre.cpp ./src/libdar/user_interaction.hpp ./src/libdar/infinint.hpp ./src/libdar/cat_prise.cpp ./src/libdar/archive.cpp ./src/libdar/cat_door.hpp ./src/libdar/cat_inode.cpp ./src/libdar/scrambler.cpp ./src/libdar/tools.cpp ./src/libdar/crypto_sym.hpp ./src/libdar/tlv_list.hpp ./src/libdar/database.hpp ./src/libdar/deci.cpp ./src/libdar/defile.hpp ./src/libdar/elastic.cpp ./src/libdar/secu_memory_file.cpp ./src/libdar/mem_allocator.hpp ./src/libdar/cat_mirage.cpp ./src/libdar/secu_string.cpp ./src/libdar/libdar.hpp ./src/libdar/cat_ignored.cpp ./src/libdar/fichier_local.cpp ./src/libdar/sar_tools.hpp ./src/libdar/pile_descriptor.hpp ./src/libdar/generic_file.cpp ./src/libdar/cache.hpp ./src/libdar/sar.hpp ./src/libdar/integers.hpp ./src/libdar/cat_directory.hpp ./src/libdar/header_version.cpp ./src/libdar/tronconneuse.cpp ./src/libdar/cat_etoile.hpp ./src/libdar/data_tree.hpp ./src/libdar/crypto.cpp ./src/libdar/cat_door.cpp ./src/libdar/terminateur.hpp ./src/libdar/erreurs.cpp ./src/libdar/list_entry.hpp ./src/libdar/cat_entree.cpp ./src/libdar/crypto.hpp ./src/libdar/ea_filesystem.hpp ./src/libdar/cat_blockdev.cpp ./src/libdar/etage.cpp ./src/libdar/cat_inode.hpp ./src/libdar/archive_version.hpp ./src/libdar/entrepot_local.cpp ./src/libdar/limitint.cpp ./src/libdar/cat_tools.hpp ./src/libdar/filtre.hpp ./src/libdar/tools.hpp ./src/libdar/cat_nomme.hpp ./src/libdar/archive_version.cpp ./src/libdar/generic_to_global_file.hpp ./src/libdar/ea.cpp ./src/libdar/criterium.hpp ./src/libdar/hash_fichier.hpp ./src/libdar/cache.cpp ./src/libdar/fsa_family.cpp ./src/libdar/filesystem_specific_attribute.cpp ./src/libdar/erreurs_ext.hpp ./src/libdar/thread_cancellation.hpp ./src/libdar/mem_ui.hpp ./src/libdar/tlv_list.cpp ./src/libdar/data_tree.cpp ./src/libdar/generic_thread.hpp ./src/libdar/criterium.cpp ./src/libdar/cat_ignored_dir.hpp ./src/libdar/cat_lien.cpp ./src/libdar/sparse_file.cpp ./src/libdar/trivial_sar.cpp ./src/libdar/cat_tools.cpp ./src/libdar/cat_nomme.cpp ./src/libdar/wrapperlib.hpp ./src/libdar/mem_cluster.hpp ./src/libdar/on_pool.hpp ./src/libdar/crc.hpp ./src/libdar/label.cpp ./src/libdar/tuyau.cpp ./src/libdar/slice_layout.cpp ./src/libdar/cat_file.hpp ./src/libdar/cat_mirage.hpp ./src/libdar/pile_descriptor.cpp ./src/libdar/header.hpp ./src/libdar/escape.cpp ./src/libdar/messaging.cpp ./src/libdar/cat_detruit.hpp ./src/libdar/mem_sized.hpp ./src/libdar/fichier_global.cpp ./src/libdar/semaphore.cpp ./src/libdar/tuyau.hpp ./src/libdar/pile.hpp ./src/libdar/fichier_local.hpp ./src/libdar/cat_tube.hpp ./src/libdar/catalogue.cpp ./src/libdar/datetime.cpp ./src/libdar/libdar.cpp ./src/libdar/compressor.cpp ./src/libdar/mem_cluster.cpp ./src/libdar/zapette.hpp ./src/libdar/cygwin_adapt.hpp ./src/libdar/macro_tools.cpp ./src/libdar/entrepot.cpp ./src/libdar/tlv.cpp ./src/libdar/generic_file_overlay_for_gpgme.hpp ./src/libdar/cat_chardev.cpp ./src/libdar/memory_check.hpp ./src/libdar/memory_check.cpp ./src/libdar/mem_allocator.cpp ./src/libdar/tronc.hpp ./src/libdar/filesystem.cpp ./src/libdar/tronc.cpp ./src/libdar/cat_file.cpp ./src/libdar/crypto_asym.cpp ./src/libdar/fichier_global.hpp ./src/libdar/crypto_sym.cpp ./src/libdar/filesystem.hpp ./src/libdar/wrapperlib.cpp ./src/libdar/mask_list.cpp ./src/libdar/storage.hpp ./src/libdar/crypto_asym.hpp ./src/libdar/generic_file_overlay_for_gpgme.cpp ./src/libdar/capabilities.hpp ./src/libdar/int_tools.hpp ./src/libdar/capabilities.cpp ./src/libdar/cat_device.hpp ./src/libdar/cat_directory.cpp ./src/libdar/tronconneuse.hpp ./src/libdar/crc.cpp ./src/libdar/mask_list.hpp ./src/libdar/slave_thread.hpp ./src/libdar/trontextual.hpp ./src/libdar/compile_time_features.hpp ./src/libdar/database_header.hpp ./src/libdar/mask.hpp ./src/libdar/user_interaction.cpp ./src/libdar/fsa_family.hpp ./src/libdar/int_tools.cpp ./src/libdar/archive_options.cpp ./src/libdar/header.cpp ./src/libdar/macro_tools.hpp ./src/libdar/semaphore.hpp ./src/libdar/hash_fichier.cpp ./src/libdar/cat_ignored.hpp ./src/libdar/cat_device.cpp ./src/libdar/cat_entree.hpp ./src/libdar/sar.cpp ./src/libdar/mem_ui.cpp ./src/libdar/escape_catalogue.cpp ./src/libdar/statistics.cpp ./src/libdar/real_infinint.cpp ./src/libdar/cat_all_entrees.hpp ./src/libdar/label.hpp ./src/libdar/cat_lien.hpp ./src/libdar/elastic.hpp ./src/libdar/integers.cpp ./src/libdar/filesystem_specific_attribute.hpp ./src/libdar/memory_pool.hpp ./src/libdar/generic_thread.cpp ./src/libdar/archive.hpp ./src/libdar/escape_catalogue.hpp ./src/libdar/database_header.cpp ./src/libdar/on_pool.cpp ./src/libdar/ea.hpp ./src/libdar/tlv.hpp ./src/libdar/list_entry.cpp ./src/libdar/cat_etoile.cpp ./src/libdar/path.cpp ./src/libdar/storage.cpp ./src/libdar/limitint.hpp ./src/libdar/cat_prise.hpp ./src/libdar/memory_file.hpp ./src/libdar/trontextual.cpp ./src/libdar/datetime.hpp ./src/libdar/header_version.hpp ./src/libdar/path.hpp ./src/libdar/null_file.hpp ./src/libdar/thread_cancellation.cpp ./src/libdar/entrepot.hpp ./src/libdar/user_group_bases.hpp ./src/libdar/cat_chardev.hpp ./src/libdar/statistics.hpp ./src/libdar/database.cpp ./src/libdar/mem_sized.cpp ./src/libdar/memory_pool.cpp ./src/libdar/slice_layout.hpp ./src/libdar/range.cpp ./src/libdar/slave_thread.cpp ./src/libdar/cat_tube.cpp ./src/libdar/ea_filesystem.cpp ./src/libdar/memory_file.cpp ./src/libdar/compressor.hpp ./src/libdar/user_group_bases.cpp ./src/libdar/terminateur.cpp ./src/libdar/sar_tools.cpp ./src/libdar/catalogue.hpp ./src/dar_suite/line_tools.cpp ./src/dar_suite/hide_file.cpp ./src/dar_suite/command_line.hpp ./src/dar_suite/line_tools.hpp ./src/dar_suite/dar_cp.cpp ./src/dar_suite/dar_suite.cpp ./src/dar_suite/config_file.cpp ./src/dar_suite/dar_suite.hpp ./src/dar_suite/dar_slave.cpp ./src/dar_suite/hide_file.hpp ./src/dar_suite/crit_action_cmd_line.cpp ./src/dar_suite/dar_xform.cpp ./src/dar_suite/config_file.hpp ./src/dar_suite/no_comment.hpp ./src/dar_suite/dar.cpp ./src/dar_suite/shell_interaction.hpp ./src/dar_suite/dar_manager.cpp ./src/dar_suite/crit_action_cmd_line.hpp ./src/dar_suite/dar.hpp ./src/dar_suite/shell_interaction.cpp ./src/dar_suite/command_line.cpp ./src/dar_suite/no_comment.cpp ./src/testing/test_filesystem.cpp ./src/testing/test_limitint.cpp ./src/testing/test_mask_list.cpp ./src/testing/test_sar.cpp ./src/testing/test_cache.cpp ./src/testing/test_mask.cpp ./src/testing/test_deci.cpp ./src/testing/test_elastic.cpp ./src/testing/test_libdar.cpp ./src/testing/moving_file.cpp ./src/testing/test_catalogue.cpp ./src/testing/testtools.cpp ./src/testing/test_tronc.cpp ./src/testing/test_escape.cpp ./src/testing/test_compressor.cpp ./src/testing/test_tronconneuse.cpp ./src/testing/test_special_alloc.cpp ./src/testing/test_hide_file.cpp ./src/testing/testtools.hpp ./src/testing/test_scrambler.cpp ./src/testing/test_generic_thread.cpp ./src/testing/test_erreurs.cpp ./src/testing/test_generic_file.cpp ./src/testing/test_terminateur.cpp ./src/testing/test_infinint.cpp ./src/testing/test_tuyau.cpp ./src/testing/test_hash_fichier.cpp ./src/testing/test_path.cpp ./src/testing/test_blowfish.cpp ./src/testing/test_crypto_asym.cpp ./src/testing/test_range.cpp ./src/testing/test_storage.cpp ./src/check/all_features.cpp ./src/check/padder.cpp dar-2.5.3/po/sv.po0000644000175000017430000076764412642474445010664 00000000000000# translation of sv.po to svenska # Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # # Peter Landgren , 2005, 2006, 2007, 2009, 2011. msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: http://sourceforge.net/tracker/?" "group_id=65612MSGID_BUGS_ADDRESS =atid=511612\n" "POT-Creation-Date: 2016-01-04 14:36+0100\n" "PO-Revision-Date: 2012-04-15 11:28+0200\n" "Last-Translator: Peter Landgren \n" "Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/libdar/archive_options.hpp:424 src/libdar/fichier_local.cpp:410 #: src/libdar/archive_options.cpp:1383 msgid "Furtive read mode" msgstr "Smygläsningsmode" #: src/libdar/zapette.cpp:102 msgid "Partial request received, aborting\n" msgstr "DelförfrÃ¥gan mottagen, avbryter\n" #: src/libdar/zapette.cpp:175 msgid "Corrupted data read on pipe" msgstr "Felkaktiga data lästa frÃ¥n rör" #: src/libdar/zapette.cpp:189 msgid "Input cannot be read" msgstr "'Input' kan ej läsas" #: src/libdar/zapette.cpp:191 msgid "Cannot write to output" msgstr "Kan ej skriva till 'output'" #: src/libdar/zapette.cpp:193 msgid "Data should be read-only" msgstr "Data bör vara endast läsning" #: src/libdar/zapette.cpp:269 msgid "Cannot skip at end of file" msgstr "Kan ej hoppa över vid filslut" #: src/libdar/zapette.cpp:294 msgid "Received unknown special order" msgstr "Mottaget okänd specialorder" #: src/libdar/zapette.cpp:320 msgid "Cannot read on input" msgstr "Kan ej läsa pÃ¥ 'input'" #: src/libdar/zapette.cpp:322 msgid "Cannot write on output" msgstr "Kan ej skriva pÃ¥ 'output'" #: src/libdar/zapette.cpp:352 #, fuzzy, c-format msgid "" "Failed driving dar_slave to the end of archive: %S. Trying to open the " "archive from the first bytes" msgstr "" "Fel vid öppning av sista delsäkerhetskopia: %S. Försöker öppna arkivet genom " "att använda första delsäkerhetskopia..." #: src/libdar/zapette.cpp:468 msgid "Uncomplete answer received from peer" msgstr "Ofullständigt svar frÃ¥n 'peer'" #: src/libdar/zapette.cpp:525 msgid "Communication problem with peer, retry ?" msgstr "Kommunikationsproblem med 'peer', försöka igen ?" #: src/libdar/zapette.cpp:541 src/libdar/zapette.cpp:555 msgid "Incoherent answer from peer" msgstr "Osammanhängande svar frÃ¥n 'peer'" #: src/libdar/zapette.cpp:550 msgid "Bad answer from peer, while closing connection" msgstr "Fel svar frÃ¥n 'peer' vid stängning av förbindelse" #: src/libdar/zapette.cpp:560 src/libdar/zapette.cpp:565 #: src/libdar/zapette.cpp:570 msgid "" "Unexpected answer from slave, communication problem or bug may hang the " "operation" msgstr "" "Oväntat svar frÃ¥n slav, kommunikationsproblem eller bug kan hänga Ã¥tgärden" #: src/libdar/zapette.cpp:573 msgid "Corrupted data read from pipe" msgstr "Felaktiga data lästa frÃ¥n rör" #: src/libdar/cat_detruit.cpp:46 msgid "missing data to build" msgstr "data saknas för att bygga" #: src/libdar/erreurs.hpp:114 msgid "Lack of Memory" msgstr "Minnesbrist" #: src/libdar/erreurs.hpp:126 #, fuzzy msgid "Lack of Secured Memory" msgstr "Minnesbrist" #: src/libdar/erreurs.hpp:169 #, fuzzy msgid "" "Cannot handle such a too large integer. Use a full version of libdar " "(compiled to rely on the \"infinint\" integer type) to solve this problem" msgstr "" "kan ej hantera ett sÃ¥ stort heltal. Använd den kompletta versionen av dar-" "svitens program (kompileringsalternativ sätts till att 'using infinint' för " "att lösa detta problem" #: src/libdar/erreurs.hpp:300 msgid "Thread cancellation requested, aborting as soon as possible" msgstr "TrÃ¥d-avbrott begärt, avbryter sÃ¥ snart som möjligt" #: src/libdar/erreurs.hpp:300 msgid "Thread cancellation requested, aborting as properly as possible" msgstr "TrÃ¥d-avbrott begärt, avbryter sÃ¥ snart snyggt möjligt" #: src/libdar/filtre.cpp:225 src/libdar/filtre.cpp:581 #: src/libdar/filtre.cpp:1103 src/libdar/filtre.cpp:1279 #: src/libdar/filtre.cpp:2407 #, fuzzy msgid "Inspecting directory " msgstr "Fel vid öppnade av mapp " #: src/libdar/filtre.cpp:261 #, c-format msgid "" "File %S has changed during backup and is probably not saved in a valid state " "(\"dirty file\"), do you want to consider it for restoration anyway?" msgstr "" "Filen %S har ändrats under säkerhetskopieringen och är sannolikt inte sparad " "i ett giltigt tillstÃ¥nd (\"smutsig fil\"), vill du ta med den i " "Ã¥terställningen i alla fall?" #: src/libdar/filtre.cpp:271 msgid "" "File had changed during backup and had been copied another time, restoring " "the next copy of file: " msgstr "" "Fil har ändrats under säkerhetskopiering och har kopierats en annan gÃ¥ng, " "Ã¥terställer nästa kopia av filen: " #: src/libdar/filtre.cpp:342 #, c-format msgid "" "The just restored file %S has been marked as dirty (sequential reading can " "only detect the dirty status after restoration), do we remove this just " "restored dirty file?" msgstr "" "Den precis Ã¥terställda filen %S har markerats som smutsig (sekvensiell " "läsning kan bara detektera smutsigt status efter Ã¥terställning), skall vi ta " "bort den precis Ã¥terställd filen?" #: src/libdar/filtre.cpp:349 #, c-format msgid "" "The just restored file %S has been marked as dirty (sequential reading can " "only detect the dirty status after restoration), removing the just restored " "dirty file as it is asked to ignore this type of file" msgstr "" "Den precis Ã¥terställda filen %S har markerats som smutsig (sekvensiell " "läsning kan bara detektera smutsigt status efter Ã¥terställning), genom " "borttagande av den just Ã¥terställda smutsiga filen som det är frÃ¥gat om att " "ignorera denna filtyp" #: src/libdar/filtre.cpp:351 #, c-format msgid "Removing the dirty file %S" msgstr "Tar bort den smutsiga filen %S" #: src/libdar/filtre.cpp:424 msgid " not restored (user choice)" msgstr " ej Ã¥terställd (användares val)" #: src/libdar/filtre.cpp:428 msgid "No file in this directory will be restored." msgstr "Ingen fil i denna mapp kommer att Ã¥terställas." #: src/libdar/filtre.cpp:446 msgid "Error while restoring " msgstr "Fel vid Ã¥terställning " #: src/libdar/filtre.cpp:451 msgid "Warning! No file in that directory will be restored: " msgstr "Varning! Ingen fil i den mappen kommer att Ã¥terställas: " #: src/libdar/filtre.cpp:620 msgid "Recording hard link into the archive: " msgstr "Sparar hÃ¥rd länk till arkiv: " #: src/libdar/filtre.cpp:687 #, fuzzy, c-format msgid "" "SECURITY WARNING! SUSPICIOUS FILE %S: ctime changed since archive of " "reference was done, while no other inode information changed" msgstr "" "SÄKERHETSVARNING %S: ctime har ändrats sedan arkivering av referenser " "gjorts, medan ingen inod eller data har ändrats" #: src/libdar/filtre.cpp:955 msgid "Error while saving " msgstr "Fel vid sparande " #: src/libdar/filtre.cpp:970 msgid "NO FILE IN THAT DIRECTORY CAN BE SAVED." msgstr "INGEN FIL I DEN MAPPEN KAN SPARAS." #: src/libdar/filtre.cpp:975 msgid "Cannot write down the archive: " msgstr "Kan ej skriva till arkivet:" #: src/libdar/filtre.cpp:992 #, fuzzy msgid ", compression ratio " msgstr "lzo-komprimering" #: src/libdar/filtre.cpp:998 #, c-format msgid "Finished Inspecting directory %S , saved %S%S" msgstr "" #: src/libdar/filtre.cpp:1095 msgid "SKIPPED (hard link in sequential read mode): " msgstr "ÖVERHOPPAD (hÃ¥rd länk i sekvensiell läsmode): " #: src/libdar/filtre.cpp:1131 msgid "OK " msgstr "OK " #: src/libdar/filtre.cpp:1142 src/libdar/filtre.cpp:1174 msgid "DIFF " msgstr "DIFF " #: src/libdar/filtre.cpp:1174 msgid ": file not present in filesystem" msgstr ": fil finns inte filsystem" #: src/libdar/filtre.cpp:1226 msgid "ERR " msgstr "ERR " #: src/libdar/filtre.cpp:1301 #, fuzzy msgid "Data" msgstr "[Data]" #: src/libdar/filtre.cpp:1310 msgid "Can't read saved data." msgstr "Kan ej läsas sparade data." #: src/libdar/filtre.cpp:1356 msgid "CRC error: data corruption." msgstr "CRC-fel: data förstört." #: src/libdar/filtre.cpp:1429 msgid "OK " msgstr "OK " #: src/libdar/filtre.cpp:1464 msgid "ERR " msgstr "ERR " #: src/libdar/filtre.cpp:1529 msgid "" "Decremental mode is useless when merging is not applied to both an archive " "of reference and an auxiliary archive of reference. Ignore decremental mode " "and continue?" msgstr "" "Mod med stegvis minskning är oanvändbar när hopslagning inte är tillämpbar " "pÃ¥ bÃ¥de arkivreferens och en extra arkivreferens. Ignorera denna mod och " "fortsätta?" #: src/libdar/filtre.cpp:1633 msgid "first" msgstr "första" #: src/libdar/filtre.cpp:1636 msgid "second" msgstr "andra" #: src/libdar/filtre.cpp:1639 msgid "next" msgstr "nästa" #: src/libdar/filtre.cpp:1642 #, fuzzy, c-format msgid "Merging/filtering files from the %s archive..." msgstr "SlÃ¥r ihop/filtrerar filer frÃ¥n %s-arkiv" #: src/libdar/filtre.cpp:1724 msgid "overwritten" msgstr "överskriven" #: src/libdar/filtre.cpp:1728 src/libdar/filtre.cpp:1772 msgid "dropped from the archive and marked as already saved" msgstr "släppt frÃ¥n arkivet och markerad som redan sparad" #: src/libdar/filtre.cpp:1731 msgid "removed" msgstr "borttagen" #: src/libdar/filtre.cpp:1736 #, c-format msgid "Data of file %S is about to be %S, proceed?" msgstr "Data hos filen %S skall till att bli %S, fortsätta?" #: src/libdar/filtre.cpp:1765 msgid "replaced" msgstr "ersatt" #: src/libdar/filtre.cpp:1768 msgid "removed from the archive" msgstr "borttagen frÃ¥n arkivet" #: src/libdar/filtre.cpp:1775 msgid "merged with possible overwriting" msgstr "ihopslagning med möjlig överskrivning" #: src/libdar/filtre.cpp:1780 #, fuzzy, c-format msgid "EA and FSA of file %S are about to be %S, proceed?" msgstr "EA för fil %S skall till att bli %S, fortsätta?" #: src/libdar/filtre.cpp:1844 #, fuzzy, c-format msgid "" "EA and FSA of file %S from first archive have been updated with those of " "same named file of the auxiliary archive" msgstr "" "EA för fil %S frÃ¥n första arkivet har uppdaterats med dessa av samma filnamn " "frÃ¥n det extra arkivet" #: src/libdar/filtre.cpp:1854 #, c-format msgid "" "EA of file %S from first archive have been dropped and marked as already " "saved" msgstr "" "EA för fil %S frÃ¥n första arkivet har släppts och markerats som redan sparade" #: src/libdar/filtre.cpp:1860 #, fuzzy, c-format msgid "" "FSA of file %S from first archive have been dropped and marked as already " "saved" msgstr "" "EA för fil %S frÃ¥n första arkivet har släppts och markerats som redan sparade" #: src/libdar/filtre.cpp:1870 src/libdar/filtre.cpp:2007 #, c-format msgid "EA of file %S from first archive have been removed" msgstr "EA för fil %S frÃ¥n första arkivet har tagits bort" #: src/libdar/filtre.cpp:1878 #, fuzzy, c-format msgid "FSA of file %S from first archive have been removed" msgstr "EA för fil %S frÃ¥n första arkivet har tagits bort" #: src/libdar/filtre.cpp:1892 #, c-format msgid "Data of file %S from first archive has been preserved from overwriting" msgstr "Data frÃ¥n fil %S frÃ¥n första arkivet har bevarats frÃ¥n överskrivning" #: src/libdar/filtre.cpp:1943 #, c-format msgid "" "Data of file %S taken from the first archive of reference has been removed" msgstr "Data frÃ¥n fil %S taget frÃ¥n det första referensarkivet har tagits bort" #: src/libdar/filtre.cpp:1946 #, c-format msgid "" "Data of file %S taken from the first archive of reference has been " "overwritten" msgstr "" "Data frÃ¥n fil %S taget frÃ¥n det första referensarkivet har skrivits över" #: src/libdar/filtre.cpp:1980 #, c-format msgid "EA of file %S has been overwritten" msgstr "EA för fil %S har skrivits över" #: src/libdar/filtre.cpp:1984 src/libdar/filtre.cpp:2000 #, c-format msgid "EA of file %S has been overwritten and marked as already saved" msgstr "EA för fil %S har skrivits över och markerats som redan sparat" #: src/libdar/filtre.cpp:1990 src/libdar/filtre.cpp:1995 #, c-format msgid "" "EA of file %S from first archive have been updated with those of the same " "named file of the auxiliary archive" msgstr "" "EA för fil %S frÃ¥n första arkivet har uppdaterats med dessa med samma " "filnamn frÃ¥n det extra arkivet" #: src/libdar/filtre.cpp:2279 msgid " not merged (user choice)" msgstr " ej ihopslagen (användares val)" #: src/libdar/filtre.cpp:2283 msgid "No file in this directory will be considered for merging." msgstr "Ingen fil i denna mapp kommer att tas med vid ihopslagning." #: src/libdar/filtre.cpp:2303 msgid "Error while considering file " msgstr "Fel vid bestämning av fil: " #: src/libdar/filtre.cpp:2307 msgid "Warning! No file in this directory will be considered for merging: " msgstr "Varning! Ingen fil i den mappen kommer att slÃ¥s ihop: " #: src/libdar/filtre.cpp:2343 msgid "" "File selection has been aborted. Now building the resulting archive with the " "already selected files" msgstr "" "Filval har avbrutits. Skapar nu det resulterande arkivet med de redan valda " "filerna" #: src/libdar/filtre.cpp:2509 msgid "Adding Hard link to archive: " msgstr "Lägger till hÃ¥rd länk till arkiv: " #: src/libdar/filtre.cpp:2580 #, fuzzy msgid "failed reading CRC from file: " msgstr "Fel vid läsning frÃ¥n fil: " #: src/libdar/filtre.cpp:2608 msgid "Failed reading CRC for EA: " msgstr "" #: src/libdar/filtre.cpp:2619 #, fuzzy msgid "Error met while reading next entry: " msgstr "Fel uppstÃ¥tt vid bearbetande av Ã¥tgärd: " #: src/libdar/filtre.cpp:2685 msgid "Resaving file without compression: " msgstr "" #: src/libdar/filtre.cpp:2689 #, fuzzy, c-format msgid "Adding %S to archive: %S" msgstr "Lägger till fil till arkiv: " #: src/libdar/filtre.cpp:2809 msgid "Copied data does not match CRC" msgstr "Kopierade data matchar inte CRC" #: src/libdar/filtre.cpp:2926 msgid " : Failed resaving uncompressed the inode data" msgstr "" #: src/libdar/filtre.cpp:2936 msgid "" " : Resaving uncompressed the inode data to gain space is not possible, " "keeping data compressed" msgstr "" #: src/libdar/filtre.cpp:2956 #, c-format msgid "" "File has disappeared while we were reading it, cannot check whether it has " "changed during its backup: %S" msgstr "" "Fil försvann medan den lästes, kan ej kontrollera huruvida den har ändrats " "under dess säkerhetskopiering: %S" #: src/libdar/filtre.cpp:2991 #, c-format msgid "" "WARNING! File modified while reading it for backup. Performing retry %i of %i" msgstr "" "VARNING! Fil ändrad under läsning för säkerhetskopiering. Genomför nytt " "försök %i av %i" #: src/libdar/filtre.cpp:3004 msgid "" "WARNING! File modified while reading it for backup. No more retry for that " "file to not exceed the wasted byte limit. File is " msgstr "" "VARNING! Fil ändrad vid läsning för säkerhetskopiering. Inga fler försök för " "den filen för att inte överskrida bortkastad byt-gräns. Fil är " #: src/libdar/filtre.cpp:3011 msgid "" "WARNING! File modified while reading it for backup, but no more retry " "allowed: " msgstr "" "VARNING! Fil ändrad under läsning för säkerhetskopiering, men inga fler " "försök tillÃ¥tna: " #: src/libdar/filtre.cpp:3071 msgid "Saving Extended Attributes for " msgstr "Sparar Extended Attribut för " #: src/libdar/filtre.cpp:3138 msgid "Error saving Extended Attributes for " msgstr "Fel vid sparande av Extended Attribut för " #: src/libdar/filtre.cpp:3170 #, fuzzy msgid "Saving Filesystem Specific Attributes for " msgstr "Sparar Extended Attribut för " #: src/libdar/filtre.cpp:3228 #, fuzzy msgid "Error saving Filesystem Specific Attributes for " msgstr "Fel vid sparande av Extended Attribut för " #: src/libdar/archive.cpp:105 #, fuzzy, c-format msgid "Opening archive %s ..." msgstr "Läser arkivinnehÃ¥ll..." #: src/libdar/archive.cpp:141 #, c-format msgid "" "Opening the archive of reference %s to retreive the isolated catalog ... " msgstr "" #: src/libdar/archive.cpp:152 msgid "" "Reading the archive of reference from pipe or standard input is not possible" msgstr "" "Läsning av referensarkivet frÃ¥n ett rör eller standard input är ej möjligt" #: src/libdar/archive.cpp:154 msgid "" "The basename '+' is reserved for special a purpose that has no meaning in " "this context" msgstr "" "Basnamnet '+' är reserverat för speciella ändamÃ¥l, som inte har nÃ¥gon mening " "i detta sammanhang" #: src/libdar/archive.cpp:196 msgid "Error while opening the archive of reference: " msgstr "Fel vid öppnande av referensarkivet: " #: src/libdar/archive.cpp:213 msgid "Loading isolated catalogue in memory..." msgstr "" #: src/libdar/archive.cpp:226 msgid "" "Archive of reference is not signed properly (no the same signatories for the " "archive and the internal catalogue), do we continue?" msgstr "" #: src/libdar/archive.cpp:233 msgid "" "The archive and the isolated catalogue do not correspond to the same data, " "they are thus incompatible between them" msgstr "" "Arkivert och den isolerade katalogen mostavar inte samma data, de är sÃ¥lunda " "inkompatibla med varann" #: src/libdar/archive.cpp:242 #, fuzzy msgid "Loading catalogue into memory..." msgstr "Katalog saknas i fil." #: src/libdar/archive.cpp:254 src/libdar/archive.cpp:289 #: src/libdar/escape_catalogue.cpp:575 msgid "" "Archive internal catalogue is not identically signed as the archive itself, " "this might be the sign the archive has been compromised" msgstr "" #: src/libdar/archive.cpp:268 msgid "" "No data found in that archive, sequentially reading the catalogue found at " "the end of the archive..." msgstr "" #: src/libdar/archive.cpp:299 msgid "" "The catalogue will be filled while sequentially reading the archive, " "preparing the data structure..." msgstr "" #: src/libdar/archive.cpp:339 #, c-format msgid "" "LAX MODE: The end of the archive is corrupted, cannot get the archive " "contents (the \"catalogue\")" msgstr "" "LAX MODE: Slutet pÃ¥ arkivet är förstört, kan ej hämta arkivinnehÃ¥llet " "(\"katalogen\")" #: src/libdar/archive.cpp:340 msgid "" "LAX MODE: Do you want to bypass some sanity checks and try again reading the " "archive contents (this may take some time, this may also fail)?" msgstr "" "LAX MODE: vill du hoppa över nÃ¥gra vettighetskontroller och försöka igen att " "läsa arkivinnehÃ¥llet (detta kan lite tid, detta kan även misslyckas)?" #: src/libdar/archive.cpp:356 #, c-format msgid "" "LAX MODE: Could not find a whole catalogue in the archive. If you have an " "isolated catalogue, stop here and use it as backup of the internal " "catalogue, else continue but be advised that all data will not be able to be " "retrieved..." msgstr "" "LAX MODE: Kunde inte hitta hela katalogen i arkivet. Om du har en isolerad " "katalog, stanna här och använd den som säkerhetskopia för den interna " "katalogen, i annat fall fortsätt, men kom ihÃ¥g att alla data inte kan " "Ã¥terställas..." #: src/libdar/archive.cpp:357 msgid "" "LAX MODE: Do you want to try finding portions of the original catalogue if " "some remain (this may take even more time and in any case, it will only " "permit to recover some files, at most)?" msgstr "" "LAX MODE: vill du försöka finna delar av originalkatalogen om nÃ¥got Ã¥terstÃ¥r " "(detta kan ta mycket tid och in vilket fall som helst kommer bara nÃ¥gra " "filer, som mest, att Ã¥terställas.)?" #: src/libdar/archive.cpp:584 src/libdar/archive.cpp:1726 msgid "Compression_level must be between 1 and 9 included" msgstr "KompressionsnivÃ¥n mÃ¥ste ligga mellan 1 och 9, inklusive" #: src/libdar/archive.cpp:586 src/libdar/archive.cpp:1728 msgid "" "\"first_file_size\" cannot be different from zero if \"file_size\" is equal " "to zero" msgstr "" "\"första_filstorleken\" kan inte vara skild frÃ¥n noll om \"filstorlek\" är " "lika med noll" #: src/libdar/archive.cpp:588 src/libdar/archive.cpp:1730 msgid "Crypto block size must be greater than 10 bytes" msgstr "Krypteringsblockstorlek mÃ¥ste vara större än 10 byte" #: src/libdar/archive.cpp:616 #, fuzzy msgid "Both reference archive are nullptr, cannot merge archive from nothing" msgstr "Bägge referensarkiv är NULL, kan ej sammanfoga frÃ¥n ingenting" #: src/libdar/archive.cpp:645 msgid "" "the \"Keep file compressed\" feature is not possible when merging two " "archives using different compression algorithms (This is for a future " "version of dar). You can still merge these two archives but without keeping " "file compressed (thus you will probably like to use compression (-z or -y " "options) for the resulting archive" msgstr "" "Egenskapen \"BehÃ¥lla fil komprimerad\" är inte möjlig när man slÃ¥r ihop tvÃ¥ " "arkiv med olika komprimeringsalgoritmer. (Detta är för en kommande version " "av dar). Du kan fortfarande slÃ¥ ihop dessa tvÃ¥ arkiv men utan att behÃ¥lla " "filer komprimerade (med ändÃ¥ vill du kanske använda komprimering (-z eller -" "y-alternativ) för det resulterande arkivet" #: src/libdar/archive.cpp:772 src/libdar/archive.cpp:1064 msgid "This archive is not exploitable, check documentation for more" msgstr "" "Detta arkiv kan inte utnyttjas, kontrollera dokumentationen för mer " "information" #: src/libdar/archive.cpp:828 msgid "Error while restoring data: " msgstr "Fel vid Ã¥terställande av data. " #: src/libdar/archive.cpp:859 src/libdar/archive.cpp:1150 msgid "" "This archive is not exploitable, check the archive class usage in the API " "documentation" msgstr "" "Detta arkiv kan inte utnyttjas, kontrollera, hur man använder arkivklassen, " "i API-dokumentationen" #: src/libdar/archive.cpp:867 src/libdar/archive.cpp:869 #: src/libdar/criterium.cpp:662 src/libdar/criterium.cpp:734 #: src/libdar/criterium.cpp:814 msgid "yes" msgstr "ja" #: src/libdar/archive.cpp:867 src/libdar/archive.cpp:869 msgid "no" msgstr "nej" #: src/libdar/archive.cpp:868 src/libdar/header_version.cpp:118 #: src/libdar/crypto.cpp:42 msgid "none" msgstr "inget" #: src/libdar/archive.cpp:873 #, c-format msgid "Archive version format : %s\n" msgstr "Arkivets versionsformat : %s\n" #: src/libdar/archive.cpp:874 #, c-format msgid "Compression algorithm used : %S\n" msgstr "Utnyttjad kompressionsalgoritm : %S\n" #: src/libdar/archive.cpp:875 #, fuzzy, c-format msgid "Symmetric key encryption used : %S\n" msgstr " Stark kryptering : %s\n" #: src/libdar/archive.cpp:876 #, fuzzy, c-format msgid "Asymmetric key encryption used : %S\n" msgstr " Stark kryptering : %s\n" #: src/libdar/archive.cpp:877 #, fuzzy, c-format msgid "Archive is signed : %S\n" msgstr "Arkivets versionsformat : %s\n" #: src/libdar/archive.cpp:878 #, c-format msgid "Sequential reading marks : %s\n" msgstr "Sekvensiell läsnings markeringar : %s\n" #: src/libdar/archive.cpp:878 msgid "present" msgstr "befintlig" #: src/libdar/archive.cpp:878 msgid "absent" msgstr "frÃ¥nvarande" #: src/libdar/archive.cpp:880 #, c-format msgid "Catalogue size in archive : %i bytes\n" msgstr "Katalogstorlek i arkiv : %i byte\n" #: src/libdar/archive.cpp:882 #, fuzzy, c-format msgid "Catalogue size in archive : N/A\n" msgstr "Katalogstorlek i arkiv : %i byte\n" #: src/libdar/archive.cpp:883 #, c-format msgid "" "User comment : %S\n" "\n" msgstr "" "Användar kommentar : %S\n" "\n" #: src/libdar/archive.cpp:889 #, c-format msgid "Archive is composed of %i file(s)\n" msgstr "Arkivet bestÃ¥r av %i fil(er)\n" #: src/libdar/archive.cpp:891 #, c-format msgid "File size: %i bytes\n" msgstr "Filstorlek: %i byte\n" #: src/libdar/archive.cpp:895 #, c-format msgid "First file size : %i bytes\n" msgstr "Första filens storlek : %i byte\n" #: src/libdar/archive.cpp:896 #, c-format msgid "File size : %i bytes\n" msgstr "Filstorlek : %i byte\n" #: src/libdar/archive.cpp:897 #, c-format msgid "Last file size : %i bytes\n" msgstr "Sista filens storlek : %i byte\n" #: src/libdar/archive.cpp:902 #, c-format msgid "Archive total size is : %i bytes\n" msgstr "Arkivets totala storlek är : %i byte\n" #: src/libdar/archive.cpp:910 #, c-format msgid "Archive size is: %i bytes\n" msgstr "Arkivstorlek är: %i byte\n" #: src/libdar/archive.cpp:911 #, c-format msgid "Previous archive size does not include headers present in each slice\n" msgstr "" "FöregÃ¥ende arkivstorlek inbegriper inte det huvud, som finns i varje del\n" #: src/libdar/archive.cpp:914 #, fuzzy, c-format msgid "Archive size is unknown (reading from a pipe)" msgstr "Detta arkiv har delar och har ej möjlighet att bli lästa frÃ¥n ett rör" #: src/libdar/archive.cpp:934 #, c-format msgid "" "The overall archive size includes %i byte(s) wasted due to bad compression " "ratio" msgstr "" #: src/libdar/archive.cpp:937 msgid "The global data compression ratio is: " msgstr "" #: src/libdar/archive.cpp:943 #, c-format msgid "" "\n" "WARNING! This archive only contains the contents of another archive, it can " "only be used as reference for differential backup or as rescue in case of " "corruption of the original archive's content. You cannot restore any data " "from this archive alone\n" msgstr "" "\n" "VARNING! Detta arkiv innehÃ¥ller bara innehÃ¥llet av ett annat arkiv, det kan " "endast användas som referense vid differentiell säkerhetskopiering eller som " "räddning vid förstört innehÃ¥ll i originalarkivet. Du kan Ã¥terställa alla " "data frÃ¥n detta arkiv ensamt\n" #: src/libdar/archive.cpp:999 #, c-format msgid "" "Using user provided modified slicing (first slice = %i bytes, other slices = " "%i bytes)" msgstr "" #: src/libdar/archive.cpp:1002 msgid "" "Using the slice layout of the archive of reference recorded at the time this " "isolated catalogue was done\n" " Note: if this reference has been resliced this isolated catalogue has been " "created, the resulting slicing information given here will be wrong and will " "probably lead to an error. Check documentation to know hos to manually " "specify the slicing to use" msgstr "" #: src/libdar/archive.cpp:1012 msgid "" "Warning: No slice layout of the archive of reference has been recorded in " "this isolated catalogue. The additional slicing information you provided may " "still lead the operation to fail because the archive has an _unsupported_ " "(too old) format for this feature" msgstr "" #: src/libdar/archive.cpp:1014 msgid "" "No slice layout of the archive of reference for the current isolated " "catalogue is available, cannot provide slicing information, aborting" msgstr "" #: src/libdar/archive.cpp:1030 msgid "Error while listing archive contents: " msgstr "Fel vid listning av arkivinnehÃ¥ll: " #: src/libdar/archive.cpp:1113 msgid "Error while comparing archive with filesystem: " msgstr "Fel vid jämförelse mellan arkiv och filsystem: " #: src/libdar/archive.cpp:1162 msgid "" "WARNING! This is an isolated catalogue, no data or EA is present in this " "archive, only the catalogue structure can be checked" msgstr "" "VARNING! Detta är en isolerad katalog, inga data eller EA finns i detta " "arkiv, endast katalogstrukturen kan kontrolleras" #: src/libdar/archive.cpp:1197 msgid "A problem occurred while reading this archive contents: " msgstr "Ett problem inträffade vid läsning av innehÃ¥let i detta arkiv: " #: src/libdar/archive.cpp:1212 msgid "Error while testing archive: " msgstr "Fel vid arkivtest: " #: src/libdar/archive.cpp:1733 msgid "" "nodump flag feature has not been activated at compilation time, it is thus " "not available" msgstr "" "--nodump-funktionen har ej aktiverats vid kompileringstillfället, sÃ¥lunda är " "den ej tillgängligt" #: src/libdar/archive.cpp:1792 #, c-format msgid "" "WARNING! The archive is located in the directory to backup, this may create " "an endless loop when the archive will try to save itself. You can either add " "-X \"%S.*.%S\" on the command line, or change the location of the archive " "(see -h for help). Do you really want to continue?" msgstr "" "Varning! Arkivet är placerat i backupmappen, detta kan skapa en ändlös " "slinga när arkivet försöker spara sig själv. Du kan antingen lägga till -X " "\"%S.*.%S\" till kommandoraden eller ändra platsen för arkivet. (se -h för " "hjälp) Vill du verkligen fortsätta?" #: src/libdar/archive.cpp:1959 msgid "Ready to start writing down the archive?" msgstr "Klart att börja skriva till arkivet?" #: src/libdar/archive.cpp:1999 msgid "Building the catalog object..." msgstr "" #: src/libdar/archive.cpp:2014 #, c-format msgid "Error while fetching information for %S: " msgstr "Fel vid hämtning av information för %S: " #: src/libdar/archive.cpp:2058 msgid "Processing files for backup..." msgstr "" #: src/libdar/archive.cpp:2113 #, fuzzy msgid "Processing files for merging..." msgstr "Kontrollerar filers datumordning..." #: src/libdar/archive.cpp:2170 msgid "" "Adding reference to files that have been destroyed since reference backup..." msgstr "" "Lägger till hänvisning till filer, som har förstörts sedan " "referensbackuppen..." #: src/libdar/archive.cpp:2217 msgid "Error while saving data: " msgstr "Fel vid datasparande: " #: src/libdar/archive.cpp:2279 msgid "WARNING! Incorrect signature found for archive, continue anyway?" msgstr "" #: src/libdar/archive.cpp:2309 msgid "" "Cannot get data name of the archive, this archive is not completely " "initialized" msgstr "" "Kan ej hämta datanamn för arkivet, detta arkiv är ej helt initialiserat" #: src/libdar/archive.cpp:2334 msgid "" "This archive contains an isolated catalogue, it cannot be used for this " "operation. It can only be used as reference for a incremental/differential " "backup or as backup of the original archive's catalogue" msgstr "" "Detta arkiv innehÃ¥ller en isolerad katalog, det kan ej användas för denna " "Ã¥tgärd. Det kan bara användas som referens vid inkrementell/differentiell " "säkerhetskopiering eller som säkerhetskopiering av det ursprungliga arkivets " "katalog" #: src/libdar/archive.cpp:2341 msgid "" "LAX MODE: Archive seems to be only an isolated catalogue (no data in it), " "Can I assume data corruption occurred and consider the archive as being a " "real archive?" msgstr "" "LAX MODE: Arkivet verkar utgöras av bara en isolerad katalog (inga data i " "det). Kan det antagas att data förstörts och kan det arkivet betraktas som " "ett riktigt arkiv?" #: src/libdar/archive.cpp:2346 msgid "Error while fetching archive properties: " msgstr "Fel vid hämtning av arkivegenskaper: " #: src/libdar/archive.cpp:2371 msgid "Sorry, file size is unknown at this step of the program.\n" msgstr "Tyvärr, filstorleken är okänd vid detta stadium i programmet.\n" #: src/libdar/archive.cpp:2449 #, c-format msgid "" "libgcrypt version < %s. Ligcrypt used has a bug that leads md5 and sha1 hash " "results to be erroneous for files larger than 256 Gio (gibioctet), do you " "really want to spend CPU cycles calculating a useless hash?" msgstr "" #: src/libdar/cat_inode.cpp:158 msgid "badly structured inode: unknown inode flag" msgstr "dÃ¥ligt strukturerad inod: okänd inodflagga" #: src/libdar/cat_inode.cpp:169 src/libdar/cat_inode.cpp:172 #: src/libdar/cat_inode.cpp:182 msgid "missing data to build an inode" msgstr "data saknas för att bygga en inod" #: src/libdar/cat_inode.cpp:280 #, fuzzy msgid "badly structured inode: unknown inode flag for FSA" msgstr "dÃ¥ligt strukturerad inod: okänd inodflagga" #: src/libdar/cat_inode.cpp:394 msgid "different file type" msgstr "annan filtyp" #: src/libdar/cat_inode.cpp:399 #, c-format msgid "different owner (uid): %i <--> %i" msgstr "annan ägare (uid): %i <--> %i" #: src/libdar/cat_inode.cpp:405 #, c-format msgid "different owner group (gid): %i <--> %i" msgstr "annan ägargrupp (gid): %i <--> %i" #: src/libdar/cat_inode.cpp:411 #, c-format msgid "different permission: %S <--> %S" msgstr "andra behörigheter: %S <--> %S" #: src/libdar/cat_inode.cpp:419 #, c-format msgid "difference of last modification date: %S <--> %S" msgstr "skillnad mot senaste ändringsdatum: %S <--> %S" #: src/libdar/cat_inode.cpp:434 msgid "different Extended Attributes" msgstr "andra Utvidgade Attribut" #: src/libdar/cat_inode.cpp:440 msgid "no Extended Attribute to compare with" msgstr "inga Utvidgade Attribut att jämföra me " #: src/libdar/cat_inode.cpp:442 src/libdar/cat_inode.cpp:463 msgid "" "Cannot compare EA: EA support has not been activated at compilation time" msgstr "" "Kan ej jämföra EA: EA-stöd har inte aktiverats vid kompileringstillfället" #: src/libdar/cat_inode.cpp:456 msgid "inode last change date (ctime) greater, EA might be different" msgstr "inods senaste ändringsdatum (ctime) är större, EA kan vara annat" #: src/libdar/cat_inode.cpp:461 msgid "no Extended Attributes to compare with" msgstr "inga Utvidgade Attribut att jämföra me " #: src/libdar/cat_inode.cpp:490 #, fuzzy msgid "different Filesystem Specific Attributes" msgstr "andra Utvidgade Attribut" #: src/libdar/cat_inode.cpp:496 #, fuzzy msgid "No Filesystem Specific Attribute to compare with" msgstr "inga Utvidgade Attribut att jämföra me " #: src/libdar/cat_inode.cpp:504 #, fuzzy msgid "inode last change date (ctime) greater, FSA might be different" msgstr "inods senaste ändringsdatum (ctime) är större, EA kan vara annat" #: src/libdar/cat_inode.cpp:507 msgid "Filesystem Specific Attribute are missing" msgstr "" #: src/libdar/cat_inode.cpp:793 msgid "CRC error detected while reading EA" msgstr "CRC-fel upptäckt vid läsning av EA" #: src/libdar/cat_inode.cpp:937 msgid "" "Error while reading CRC for EA from the archive: No escape mark found for " "that file" msgstr "" "Fel vid läsning CRC för EA frÃ¥n arkiv: Inget escape-märke funnet för denna " "fil" #: src/libdar/cat_inode.cpp:1166 #, fuzzy msgid "CRC error detected while reading FSA" msgstr "CRC-fel upptäckt vid läsning av EA" #: src/libdar/cat_inode.cpp:1290 #, fuzzy msgid "" "Error while reading CRC for FSA from the archive: No escape mark found for " "that file" msgstr "" "Fel vid läsning CRC för EA frÃ¥n arkiv: Inget escape-märke funnet för denna " "fil" #: src/libdar/scrambler.cpp:34 msgid "Key cannot be an empty string" msgstr "Nyckel kan ej vara en tom sträng" #: src/libdar/tools.cpp:158 src/libdar/criterium.cpp:880 #: src/dar_suite/dar_suite.cpp:287 msgid "YES" msgstr "JA" #: src/libdar/tools.cpp:158 src/libdar/criterium.cpp:881 #: src/dar_suite/dar_suite.cpp:289 msgid "NO" msgstr "NEJ" #: src/libdar/tools.cpp:239 msgid "Not a zero terminated string in file" msgstr "Inte en nollavslutad sträng i fil" #: src/libdar/tools.cpp:277 #, c-format msgid "Cannot get file size: %s" msgstr "Kan inte hämta filstorlek: %s" #: src/libdar/tools.cpp:329 #, c-format msgid "Unknown suffix [%c] in string %S" msgstr "Okänt suffix [%c] i sträng %S" #: src/libdar/tools.cpp:503 #, fuzzy msgid "Cannot read \"fcntl\" file's flags : " msgstr "Kan ej läsa fcntl-fils flaggor : " #: src/libdar/tools.cpp:509 #, fuzzy msgid "Cannot set \"fcntl\" file's flags : " msgstr "Kan sätta fcntl-fils flaggor : " #: src/libdar/tools.cpp:589 src/libdar/tools.cpp:594 src/libdar/tools.cpp:606 #: src/libdar/tools.cpp:611 #, fuzzy msgid "Invalid number: " msgstr "Ogiltigt arkivnummer: " #: src/libdar/tools.cpp:710 msgid "date before 1970 is not allowed" msgstr "datum före 1970 är ej tillÃ¥tet" #: src/libdar/tools.cpp:715 msgid "Incorrect month" msgstr "Felaktig mÃ¥nad" #: src/libdar/tools.cpp:720 msgid "Incorrect day of month" msgstr "Felaktig dag i mÃ¥nad" #: src/libdar/tools.cpp:725 #, fuzzy msgid "Incorrect hour" msgstr "Felaktig timme pÃ¥ dag" #: src/libdar/tools.cpp:730 msgid "Incorrect minute" msgstr "Felaktig minut" #: src/libdar/tools.cpp:735 msgid "Incorrect second" msgstr "Felaktig sekund" #: src/libdar/tools.cpp:739 msgid "Bad formatted date expression" msgstr "DÃ¥ligt formaterad datumuttryck" #: src/libdar/tools.cpp:854 msgid "Given date must be in the past" msgstr "Angivet datum mÃ¥ste vara i det förgÃ¥gna" #: src/libdar/tools.cpp:889 src/libdar/tools.cpp:978 msgid "Error while calling fork() to launch dar: " msgstr "Fel vid anrop av fork() för att starta dar: " #: src/libdar/tools.cpp:903 src/libdar/tools.cpp:1008 msgid "Unexpected error while waiting for dar to terminate: " msgstr "Oväntat fel vid väntan pÃ¥ att dar avslutas: " #: src/libdar/tools.cpp:909 src/libdar/tools.cpp:1014 msgid "DAR terminated upon signal reception: " msgstr "DAR avslutat vid signalmottagande: " #: src/libdar/tools.cpp:915 src/libdar/tools.cpp:1020 msgid " . Retry to launch dar as previously ?" msgstr " . Försök att starta dar pÃ¥ samma sätt som förut ?" #: src/libdar/tools.cpp:920 src/libdar/tools.cpp:927 src/libdar/tools.cpp:1025 #: src/libdar/tools.cpp:1032 msgid " Continue anyway ?" msgstr " Fortsätta likväl ?" #: src/libdar/tools.cpp:925 src/libdar/tools.cpp:1030 msgid "DAR sub-process has terminated with exit code " msgstr "DAR underprocess har avslutats med exitkod " #: src/libdar/tools.cpp:1129 #, fuzzy, c-format msgid " Libz compression (gzip) : %s\n" msgstr " Libz-komprimering (gzip) : %s\n" #: src/libdar/tools.cpp:1130 #, fuzzy, c-format msgid " Libbz2 compression (bzip2) : %s\n" msgstr " Libbz2-komprimering (bzip2): %s\n" #: src/libdar/tools.cpp:1131 #, fuzzy, c-format msgid " Liblzo2 compression (lzo) : %s\n" msgstr " Liblzo2-komprimering (lzo) : %s\n" #: src/libdar/tools.cpp:1132 #, fuzzy, c-format msgid " Liblzma compression (xz) : %s\n" msgstr " Libz-komprimering (gzip) : %s\n" #: src/libdar/tools.cpp:1133 #, fuzzy, c-format msgid " Strong encryption (libgcrypt): %s\n" msgstr " Stark kryptering : %s\n" #: src/libdar/tools.cpp:1134 #, fuzzy, c-format msgid " Public key ciphers (gpgme) : %s\n" msgstr " Libz-komprimering (gzip) : %s\n" #: src/libdar/tools.cpp:1135 #, fuzzy, c-format msgid " Extended Attributes support : %s\n" msgstr " Stöd för Extended Attribut : %s\n" #: src/libdar/tools.cpp:1136 #, fuzzy, c-format msgid " Large files support (> 2GB) : %s\n" msgstr " Stöd för stora filer(> 2GB): %s\n" #: src/libdar/tools.cpp:1137 #, fuzzy, c-format msgid " ext2fs NODUMP flag support : %s\n" msgstr " stöd för ext2fs NODUMP-flagga : %s\n" #: src/libdar/tools.cpp:1138 #, fuzzy, c-format msgid " Special allocation scheme : %s\n" msgstr " Särskilt tilldelningsschema: %s\n" #: src/libdar/tools.cpp:1140 #, fuzzy, c-format msgid " Integer size used : unlimited\n" msgstr " Utnyttjad heltalsstorlek : obegränsad\n" #: src/libdar/tools.cpp:1142 #, fuzzy, c-format msgid " Integer size used : %d bits\n" msgstr " Utnyttjad heltalsstorlek : %d bitar\n" #: src/libdar/tools.cpp:1143 #, fuzzy, c-format msgid " Thread safe support : %s\n" msgstr " Stöd för säker trÃ¥dning : %s\n" #: src/libdar/tools.cpp:1144 #, fuzzy, c-format msgid " Furtive read mode support : %s\n" msgstr " Smygläsningsmode stödd : %s\n" #: src/libdar/tools.cpp:1145 #, fuzzy, c-format msgid " Linux ext2/3/4 FSA support : %s\n" msgstr " stöd för ext2fs NODUMP-flagga : %s\n" #: src/libdar/tools.cpp:1146 #, fuzzy, c-format msgid " Mac OS X HFS+ FSA support : %s\n" msgstr " Stöd för säker trÃ¥dning : %s\n" #: src/libdar/tools.cpp:1151 msgid "big" msgstr "stor" #: src/libdar/tools.cpp:1154 msgid "little" msgstr "liten" #: src/libdar/tools.cpp:1157 msgid "error!" msgstr "fel!" #: src/libdar/tools.cpp:1162 #, fuzzy, c-format msgid " Detected system/CPU endian : %s" msgstr " Upptäckte system/CPU endian : %s" #: src/libdar/tools.cpp:1163 #, fuzzy, c-format msgid " Posix fadvise support : %s" msgstr " Stöd för säker trÃ¥dning : %s\n" #: src/libdar/tools.cpp:1164 #, fuzzy, c-format msgid " Large dir. speed optimi. : %s" msgstr " Stöd för stora filer(> 2GB): %s" #: src/libdar/tools.cpp:1169 #, fuzzy, c-format msgid " Timestamp read accuracy : %S\n" msgstr " Stöd för säker trÃ¥dning : %s\n" #: src/libdar/tools.cpp:1174 #, c-format msgid " Timestamp write accuracy : %S\n" msgstr "" #: src/libdar/tools.cpp:1175 #, c-format msgid " Restores dates of symlinks : %s\n" msgstr "" #: src/libdar/tools.cpp:1177 #, c-format msgid " Can uses multiple threads : %s\n" msgstr "" #: src/libdar/tools.cpp:1234 #, c-format msgid "" "Warning, %S seems more to be a slice name than a base name. Do you want to " "replace it by %S ?" msgstr "" "Varning, %S verkar mer vara namn pÃ¥ en del och inte ett basnamn. Vill du " "byta det mot %S ?" #: src/libdar/tools.cpp:1239 #, c-format msgid "OK, keeping %S as basename" msgstr "OK, behÃ¥ller %S som basnamn" #: src/libdar/tools.cpp:1274 msgid "Cannot get full path of current working directory: " msgstr "Kan ej fÃ¥ komplett sökväg till gällande arbetsmapp: " #: src/libdar/tools.cpp:1301 #, fuzzy msgid "nullptr argument given to tools_readlink()" msgstr "Tomt argument givet till 'tools_readlink'" #: src/libdar/tools.cpp:1303 #, fuzzy msgid "Empty string given as argument to tools_readlink()" msgstr "Tom sträng givet som argument till 'tools_readlink'" #: src/libdar/tools.cpp:1330 #, c-format msgid "Cannot read file information for %s : %s" msgstr "Kan ej läsa filinformation för %s : %s" #: src/libdar/tools.cpp:1428 #, fuzzy msgid "Cannot set birth time: " msgstr "Kan inte hämta mtime: %s" #: src/libdar/tools.cpp:1458 msgid "Cannot set last access and last modification time: " msgstr "Kan ej sätta senaste tillgÃ¥ngtid och senaste modifieringstid: " #: src/libdar/tools.cpp:1542 msgid "Aborting program: child process died unexpectedly" msgstr "" #: src/libdar/tools.cpp:1550 #, fuzzy, c-format msgid "Error trying to run %s: %s" msgstr "Fel vid räddning av EA-lista för %s : %s" #: src/libdar/tools.cpp:1553 #, fuzzy msgid "execvp() failed but did not returned error code" msgstr "execvp misslyckades, men gav ingen felkod" #: src/libdar/tools.cpp:1625 src/libdar/tools.cpp:1633 #, fuzzy, c-format msgid "Error met while retrieving current time: %S" msgstr "Fel uppstÃ¥tt vid bearbetande av Ã¥tgärd: " #: src/libdar/tools.cpp:1777 #, c-format msgid "Removing file %s" msgstr "Tar bort fil %s" #: src/libdar/tools.cpp:1781 #, fuzzy, c-format msgid "Error removing file %s: %s" msgstr "Fel vid filöppning %s : %s" #: src/libdar/tools.cpp:1807 #, c-format msgid "" "Overwriting not allowed while a slice of a previous archive with the same " "basename has been found in the %s directory, Operation aborted" msgstr "" "Överskrivning ej tillÃ¥ten dÃ¥ en del av ett tidigare arkiv med samma basnamn " "har hittats i %s-mappen. Ã…tgärden avbruten" #: src/libdar/tools.cpp:1813 #, fuzzy, c-format msgid "" "At least one slice of an old archive with the same name remains in the " "directory %s. It is advised to remove all the old archive's slices before " "creating an archive of same name. Can I remove these old slices?" msgstr "" "Ã…tminstone en del av ett gammalt arkiv med samma basnamn Ã¥terstÃ¥r i mappen " "%s . Om du inte tar bort denna först, kommer du att fÃ¥ svÃ¥righeter att " "identifiera den sista delen av det arkiv som du ar pÃ¥ väg att skapa, ty den " "kan bli gömd bland delarna i detta gamla arkiv. Skall vi ta bort det gamla " "arkivets delar först ?" #: src/libdar/tools.cpp:1864 src/libdar/tools.cpp:1871 #, fuzzy, c-format msgid "Cannot get inode information for %s: %s" msgstr "Kan ej fÃ¥ inodinformation för %s : %s" #: src/libdar/tools.cpp:1881 msgid "Current Working Directory cannot be a relative path" msgstr "Aktuell arbetsmapp kan ej vara en relativ sökväg" #: src/libdar/tools.cpp:1898 msgid "Cannot block signals: " msgstr "Kan ej blockera signal: " #: src/libdar/tools.cpp:1908 msgid "Cannot unblock signals: " msgstr "Kan ej frisläppa signal: " #: src/libdar/tools.cpp:1928 src/libdar/tools.cpp:1949 #, fuzzy, c-format msgid "Cannot get last modification date: %s" msgstr "Kan ej sätta senaste tillgÃ¥ngtid och senaste modifieringstid: " #: src/libdar/tools.cpp:1953 #, c-format msgid "Cannot get size of %S: not a plain file" msgstr "" #: src/libdar/tools.cpp:1966 #, c-format msgid "Cannot get mtime: %s" msgstr "Kan inte hämta mtime: %s" #: src/libdar/tools.cpp:2072 #, fuzzy, c-format msgid "Parse error: Unmatched `%c'" msgstr "Analysfel: " #: src/libdar/tools.cpp:2125 msgid "Unknown substitution string: %" msgstr "Okänd utbytessträng :%" #: src/libdar/tools.cpp:2132 #, fuzzy msgid "" "last char of user command-line to execute is '%', (use '%%' instead to avoid " "this message)" msgstr "" "sista tecknet i användarkommandoraden är '%', (använd '%%' i stället sÃ¥ " "undviks detta meddelande). Ignorera det och fortsätta ?" #: src/libdar/tools.cpp:2186 msgid "execve() failed. (process table is full ?)" msgstr "execve() misslyckades. (full processtabell ?)" #: src/libdar/tools.cpp:2188 msgid "system() call failed: " msgstr "system()-anrop misslyckades: " #: src/libdar/tools.cpp:2190 #, c-format msgid "execution of [ %S ] returned error code: %d" msgstr "utförande av [ %S ] resulterade i felkod: %d" #: src/libdar/tools.cpp:2197 msgid "Error during user command line execution: " msgstr "Fel vid utförande av användarkommandoradsexekvering: " #: src/libdar/tools.cpp:2197 msgid " . Retry command-line ?" msgstr " . Försöka med kommandoraden igen ?" #: src/libdar/tools.cpp:2202 msgid "Ignore previous error on user command line and continue ?" msgstr "Ignorera föregÃ¥ende fel frÃ¥n användarkommandorad och fortsätta ?" #: src/libdar/tools.cpp:2242 msgid "Fatal error on user command line: " msgstr "Ödesdigert fel i användarkommandorad: " #: src/libdar/tools.cpp:2368 src/libdar/tools.cpp:2374 #, fuzzy msgid "Badly formated octal number" msgstr "DÃ¥ligt formaterad databas" #: src/libdar/tools.cpp:2471 #, fuzzy msgid "Cannot get effective permission given a file descriptor: " msgstr "Kan ej Ã¥terställe behörigheter för %s : %s" #: src/libdar/tools.cpp:2487 #, c-format msgid "Error while setting file permission: %s" msgstr "Fel vid tilldelning av en fils egenskaper:%s" #: src/libdar/tools.cpp:2508 #, fuzzy msgid "An empty string is not a valid user name" msgstr "En tom sträng är ej en giltig sökväg" #: src/libdar/tools.cpp:2546 src/libdar/tools.cpp:2568 #, fuzzy msgid "Unknown user" msgstr "Okänd användare: %S" #: src/libdar/tools.cpp:2548 src/libdar/tools.cpp:2570 #, fuzzy, c-format msgid "Error found while looking for UID of user %s: %S" msgstr "Fel vid anrop av fork() för att starta dar: " #: src/libdar/tools.cpp:2578 src/libdar/tools.cpp:2672 msgid "" "Cannot convert username to uid in statically linked binary, either directly " "provide the UID or run libdar from a dynamically linked executable" msgstr "" #: src/libdar/tools.cpp:2603 #, fuzzy msgid "An empty string is not a valid group name" msgstr "En tom sträng är ej en giltig sökväg" #: src/libdar/tools.cpp:2639 src/libdar/tools.cpp:2662 #, fuzzy msgid "Unknown group" msgstr "Okänd användare: %S" #: src/libdar/tools.cpp:2641 #, c-format msgid "Error found while looking fo GID of group %s: %S" msgstr "" #: src/libdar/tools.cpp:2664 #, fuzzy, c-format msgid "Error found while looking for GID of group %s: %S" msgstr "Fel vid anrop av fork() för att starta dar: " #: src/libdar/tools.cpp:2701 #, c-format msgid "Error while setting file user ownership: %s" msgstr "Fel vid inställning av ägare till fil: %s" #: src/libdar/tools.cpp:2838 #, fuzzy msgid "Error while fetching hostname: " msgstr "Fel vid listning av arkivinnehÃ¥ll: " #: src/libdar/tools.cpp:2868 #, fuzzy msgid "Worse" msgstr "[Värre]" #: src/libdar/tools.cpp:2888 #, c-format msgid "Error code %d to message conversion failed" msgstr "" #: src/libdar/tools.cpp:2943 #, fuzzy msgid "Invalid wide-char found in string: " msgstr "Ogiltigt tal i sträng: %S" #: src/libdar/deci.cpp:46 msgid "invalid decimal digit" msgstr "ogiltig decimalsiffra" #: src/libdar/deci.cpp:132 msgid "an empty string is an invalid argument" msgstr "en tom sträng är ett ogiltigt argument" #: src/libdar/elastic.cpp:73 msgid "Zero is not a valid size for an elastic buffer" msgstr "Noll är inte en gÃ¥ngbar storlek för en elastisk buffert" #: src/libdar/elastic.cpp:75 msgid "Size too large for an elastic buffer" msgstr "För stor storlek för en elastisk buffert" #: src/libdar/elastic.cpp:92 src/libdar/elastic.cpp:98 #: src/libdar/elastic.cpp:128 src/libdar/elastic.cpp:134 #: src/libdar/elastic.cpp:150 src/libdar/elastic.cpp:158 #: src/libdar/elastic.cpp:187 src/libdar/elastic.cpp:195 #: src/libdar/elastic.cpp:205 msgid "elastic buffer incoherent structure" msgstr "osammanhängande struktur i elastisk buffert" #: src/libdar/elastic.cpp:124 src/libdar/elastic.cpp:183 msgid "too large elastic buffer or elastic buffer incoherent structure" msgstr "" "för stor elastisk buffert eller osammanhängande struktur i elastisk buffert" #: src/libdar/elastic.cpp:212 msgid "not enough space provided to dump the elastic buffer" msgstr "inte försedd med tillräckligt med plats att dumpa elastisk buffert" #: src/libdar/cat_mirage.cpp:141 msgid "Incoherent catalogue structure: hard linked inode's data not found" msgstr "Osammanhängande katalogstruktur: hÃ¥rdlänkade inoders data ej hittade" #: src/libdar/cat_mirage.cpp:178 msgid "Incoherent catalogue structure: hard linked data is not an inode" msgstr "Osammanhängande katalogstruktur: hÃ¥rdlänkade data är ej en inode" #: src/libdar/cat_mirage.cpp:215 msgid "Incoherent catalogue structure: duplicated hard linked inode's data" msgstr "Ej enhetlig katalogstruktur: duplicerad hÃ¥rdlänkade inodes data" #: src/libdar/cat_mirage.cpp:229 msgid "" "Incoherent catalogue structure: unknown status flag for hard linked inode" msgstr "" "Ej enhetlig katalogstruktur: obekant statusflagga för hÃ¥rdlänkad inode." #: src/libdar/secu_string.cpp:102 src/libdar/secu_string.cpp:141 msgid "Error while reading data for a secure memory:" msgstr "Fel vid läsning av data frÃ¥n säkert minne:" #: src/libdar/secu_string.cpp:119 #, fuzzy msgid "appending data over secure_memory its end" msgstr "Fel vid läsning av data frÃ¥n säkert minne:" #: src/libdar/secu_string.cpp:133 #, fuzzy msgid "appending data after the end of a secure_memory" msgstr "Fel vid läsning av data frÃ¥n säkert minne:" #: src/libdar/secu_string.cpp:136 msgid "Cannot receive that much data in regard to the allocated memory" msgstr "kan ej ta emot sÃ¥ mycket data med hänsyn till allokerat minne" #: src/libdar/secu_string.cpp:154 msgid "Cannot reduce the string to a size that is larger than its current size" msgstr "" "Kan ej reducera en sträng till en storlek, som är större än dess aktuella " "storlek" #: src/libdar/secu_string.cpp:164 msgid "secu_string randomization requested exceeds storage capacity" msgstr "" #: src/libdar/secu_string.cpp:177 msgid "Out of range index requested for a secu_string" msgstr "" #: src/libdar/fichier_local.cpp:151 msgid "Error getting size of file: " msgstr "Fel vid hämtning av filstorlek: " #: src/libdar/fichier_local.cpp:261 msgid "Error getting file reading position: " msgstr "Fel vid hämtning av fils läsposition: " #: src/libdar/fichier_local.cpp:293 src/libdar/fichier_local.cpp:295 msgid "Error while reading from file: " msgstr "Fel vid läsning frÃ¥n fil: " #: src/libdar/fichier_local.cpp:344 src/libdar/fichier_local.cpp:350 msgid "Error while writing to file: " msgstr "Fel vid skrivning till fil: " #: src/libdar/fichier_local.cpp:428 msgid "" "No space left for inode, you have the opportunity to make some room now. " "When done : can we continue ?" msgstr "" "Inget utrymme kvar för inod, du har möjlighet att skapa en del plats nu. När " "det är gjort : kan vi fortsätta ?" #: src/libdar/fichier_local.cpp:437 msgid "Cannot open file : " msgstr "Kan ej öppna fil : " #: src/libdar/fichier_local.cpp:460 #, fuzzy, c-format msgid "Cannot dup() filedescriptor while copying \"fichier_local\" object: %s" msgstr "Kan ej dup() filbeskrivning vid kopiering av \"fichier\"-objekt: %s" #: src/libdar/generic_file.cpp:120 #, fuzzy msgid "Reading ahead a write only generic_file" msgstr "Läsning av en 'write only generic_file'" #: src/libdar/generic_file.cpp:135 msgid "Reading a write only generic_file" msgstr "Läsning av en 'write only generic_file'" #: src/libdar/generic_file.cpp:145 msgid "Writing to a read only generic_file" msgstr "Skrivning till en 'read only generic-file'" #: src/libdar/generic_file.cpp:315 msgid "Cannot compare files in write only mode" msgstr "Kan ej jämföra filer i skrivmod" #: src/libdar/generic_file.cpp:402 msgid "Cannot sync write on a read-only generic_file" msgstr "Kan ej synka skrivning med en skrivskyddad allmän fil." #: src/libdar/generic_file.cpp:413 #, fuzzy msgid "Cannot flush read a write-only generic_file" msgstr "Kan ej synka skrivning med en skrivskyddad allmän fil." #: src/libdar/generic_file.cpp:489 msgid "read only" msgstr "enbart läsning" #: src/libdar/generic_file.cpp:492 msgid "write only" msgstr "enbart skrivning" #: src/libdar/generic_file.cpp:495 msgid "read and write" msgstr "läs och skriv" #: src/libdar/header_version.cpp:74 #, fuzzy msgid "LAX MODE: Failed to read the archive header's format version." msgstr "LAX MODE: Misslyckades med att läsa katalogen" #: src/libdar/header_version.cpp:77 #, c-format msgid "" "LAX MODE: Please provide the archive format: You can use the table at %s to " "find the archive format depending on the release version, (for example if " "this archive has been created using dar release 2.3.4 to 2.3.7 answer \"6\" " "without the quotes here): " msgstr "" "LAX MODE: Upplys om arkivformatet. Du kan använda tabellen vid %s att finna " "arkivformatet beroende pÃ¥ version., till exempel om detta arkiv har skapats " "med \"dar\" version 2.3.4 till 2.3.7, svara \"6\", (utan anföringstecken) " "här:\" " #: src/libdar/header_version.cpp:82 #, c-format msgid "LAX MODE: \"%S\" is not a valid archive format" msgstr "LAX MODE: \"%S\" är ej ett giltigt arkivformat" #: src/libdar/header_version.cpp:88 #, c-format msgid "LAX MODE: Using archive format \"%d\"?" msgstr "LAX MODE: Använder arkivformat \"%d\"?" #: src/libdar/header_version.cpp:117 msgid "" "LAX MODE: Unknown compression algorithm used, assuming data corruption " "occurred. Please help me, answering with one of the following words \"none" "\", \"gzip\", \"bzip2\" or \"lzo\" at the next prompt:" msgstr "" "LAX MODE: Okänd komprimeringsalgoritm använd, antar data förstörda. Hjälp " "mig genom att svara med ett av orden \"none\", \"gzip\", \"bzip2\" or \"lzo" "\" pÃ¥ frÃ¥gan:" #: src/libdar/header_version.cpp:120 msgid "gzip" msgstr "gzip" #: src/libdar/header_version.cpp:122 msgid "bzip2" msgstr "bzip2" #: src/libdar/header_version.cpp:124 msgid "lzo" msgstr "lzo" #: src/libdar/header_version.cpp:131 src/libdar/header_version.cpp:139 #: src/libdar/header_version.cpp:150 src/libdar/header_version.cpp:168 #, fuzzy msgid "Reached End of File while reading archive header_version data structure" msgstr "NÃ¥tt filslut vid läsning av arkivversion" #: src/libdar/header_version.cpp:201 msgid "Corruption met while reading header_version data structure" msgstr "" #: src/libdar/header_version.cpp:218 msgid "Missing data for encrypted symmetrical key" msgstr "" #: src/libdar/header_version.cpp:235 msgid "" "Error met while reading archive of reference slicing layout, ignoring this " "field and continuing" msgstr "" #: src/libdar/header_version.cpp:256 src/libdar/header_version.cpp:258 #: src/libdar/header_version.cpp:280 src/libdar/header_version.cpp:282 msgid "Consistency check failed for archive header" msgstr "Sundhetskontroll misslyckades för arkivhuvud" #: src/libdar/tronconneuse.cpp:61 #, c-format msgid "%d is not a valid block size" msgstr "%d är inte en giltig blockstorlek" #: src/libdar/tronconneuse.cpp:439 src/libdar/crypto_sym.cpp:301 msgid "Data corruption may have occurred, cannot decrypt data" msgstr "data har förstörts, kan en dechiffrera data" #: src/libdar/crypto.cpp:44 #, fuzzy msgid "scrambling (weak encryption)" msgstr "Scrambling eller stark kryptering används : %s\n" #: src/libdar/crypto.cpp:102 msgid "Unknown crypto algorithm" msgstr "Okänd krypteringsalgoritm" #: src/libdar/erreurs.cpp:131 #, c-format msgid "File %S line %d" msgstr "Fil %S rad %d" #: src/libdar/erreurs.cpp:131 msgid "it seems to be a bug here" msgstr "det verkar vara en bugg här" #: src/libdar/erreurs.cpp:160 #, c-format msgid "in file %S line %S" msgstr "i fil %S rad %S" #: src/libdar/erreurs.cpp:179 msgid "# UNEXPECTED EXCEPTION, #" msgstr "# OVÄNTAT AVBROTT, #" #: src/libdar/erreurs.cpp:180 src/libdar/erreurs.cpp:193 msgid "# E X I T I N G ! #" msgstr "# A V B B Y T E R ! #" #: src/libdar/erreurs.cpp:183 src/libdar/erreurs.cpp:196 msgid "" " THANKS TO REPORT THE PREVIOUS OUTPUT TO MAINTAINER\n" " GIVING A DESCRIPTION OF THE CIRCUMSTANCES." msgstr "" " TACKSAM FÖR RAPPORT OM FÖREGÃ…ENDE UTMATNING TILL UNDERHÃ…LLAREN\n" " MED EN BESKRIVNING AV OMSTÄNDIGHETERNA." #: src/libdar/erreurs.cpp:184 msgid "" " IF POSSIBLE TRY TO REPRODUCE THIS ERROR, A\n" " SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n" " IN SOLVING THIS PROBLEM. THANKS" msgstr "" " OM MÖJLIGT FÖRSÖK ATT Ã…TERSKAPA DETTA FEL,\n" "ETT SCENARIO SOM KAN Ã…TERSKAPA DET ÄR TILL STOR HJÄLP\n" " VID PROBLEMSLÖSNINGEN TACK" #: src/libdar/erreurs.cpp:192 msgid "# NOT CAUGHT EXCEPTION, #" msgstr "# ICKE FÃ…NGAT AVBROTT, #" #: src/libdar/erreurs.cpp:197 msgid "" " IF POSSIBLE TRY TO PRODUCE THIS ERROR, A\n" " SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n" " IN SOLVING THIS PROBLEM. THANKS" msgstr "" " OM MÖJLIGT FÖRSÖK ATT SKAPA DETTA FEL,\n" "ETT SCENARIO SOM KAN Ã…TERSKAPA DET ÄR TILL STOR HJÄLP\n" " VID PROBLEMSLÖSNINGEN TACK" #: src/libdar/cat_entree.cpp:126 #, c-format msgid "" "\n" "CATALOGUE CONTENTS :\n" "\n" msgstr "" "\n" "KATALOGINNEHÃ…LL :\n" "\n" #: src/libdar/cat_entree.cpp:127 #, c-format msgid "total number of inode : %i\n" msgstr "totalt antal inoder : %i\n" #: src/libdar/cat_entree.cpp:128 #, c-format msgid "saved inode : %i\n" msgstr "sparad inode : %i\n" #: src/libdar/cat_entree.cpp:129 #, c-format msgid "distribution of inode(s)\n" msgstr "fördelning av inoder\n" #: src/libdar/cat_entree.cpp:130 #, c-format msgid " - directories : %i\n" msgstr " - mappar : %i\n" #: src/libdar/cat_entree.cpp:131 #, c-format msgid " - plain files : %i\n" msgstr " - enkla filer : %i\n" #: src/libdar/cat_entree.cpp:132 #, c-format msgid " - symbolic links : %i\n" msgstr " - symboliska länkar :%i\n" #: src/libdar/cat_entree.cpp:133 #, c-format msgid " - named pipes : %i\n" msgstr " - namngivna rör : %i\n" #: src/libdar/cat_entree.cpp:134 #, c-format msgid " - unix sockets : %i\n" msgstr " - unix socklar : %i\n" #: src/libdar/cat_entree.cpp:135 #, c-format msgid " - character devices : %i\n" msgstr " - teckenenheter : %i\n" #: src/libdar/cat_entree.cpp:136 #, c-format msgid " - block devices : %i\n" msgstr " - blockenheter : %i\n" #: src/libdar/cat_entree.cpp:137 #, c-format msgid " - Door entries : %i\n" msgstr " - 'Door entries' : %i\n" #: src/libdar/cat_entree.cpp:138 #, c-format msgid "hard links information\n" msgstr "information om hÃ¥rda länkar\n" #: src/libdar/cat_entree.cpp:139 #, c-format msgid " - number of inode with hard link : %i\n" msgstr " - antal inoder med hÃ¥rd länk : %i\n" #: src/libdar/cat_entree.cpp:140 #, c-format msgid " - number of reference to hard linked inodes: %i\n" msgstr " - antal referenser till hÃ¥rdlänkade inoder: %i\n" #: src/libdar/cat_entree.cpp:141 #, c-format msgid "destroyed entries information\n" msgstr "information om förstörda poster\n" #: src/libdar/cat_entree.cpp:142 #, c-format msgid "" " %i file(s) have been record as destroyed since backup of reference\n" "\n" msgstr "" " %i filer har noterats som förstörda sedan referenssäkerhetskopian\n" "\n" #: src/libdar/cat_entree.cpp:189 src/libdar/cat_entree.cpp:232 #: src/libdar/cat_entree.cpp:242 msgid "corrupted file" msgstr "förstörd fil" #: src/libdar/cat_entree.cpp:234 msgid "" "LAX MODE: Unexpected saved status for end of directory entry, assuming data " "corruption occurred, ignoring and continuing" msgstr "" "LAX MODE: Oväntat sparat status för mappslutpost, antar dataförstörelse " "skett, ignorerar och fortsätter" #: src/libdar/cat_entree.cpp:244 #, fuzzy msgid "" "LAX MODE: Unexpected saved status for class \"cat_detruit\" object, assuming " "data corruption occurred, ignoring and continuing" msgstr "" "LAX MODE: Oväntat sparat status för klassen \"detruit\" objekt, antar " "dataförstörelse skett, ignorerar och fortsätter" #: src/libdar/cat_entree.cpp:253 msgid "unknown type of data in catalogue" msgstr "okänd datatyp i katalog" #: src/libdar/cat_entree.cpp:256 msgid "" "LAX MODE: found unknown catalogue entry, assuming data corruption occurred, " "cannot read further the catalogue as I do not know the length of this type " "of entry" msgstr "" "LAX MODE: hittade obekant kataloguppgift, antar att data förstörts, kan ej " "läsa vidare i katalogen dÃ¥ jag ej vet längden pÃ¥ denna typ av uppgift" #: src/libdar/cat_entree.cpp:307 msgid "unknown entry" msgstr "Okänd inmatning" #: src/libdar/cat_entree.cpp:308 #, c-format msgid "Entry information CRC failure for %S. Ignore the failure?" msgstr "Inmatad information CRC-misslyckande för %S. Ignorera detta?" #: src/libdar/cat_entree.cpp:314 #, c-format msgid "Entry information CRC failure for %S" msgstr "Inmatad information CRC-misslyckande för %S" #: src/libdar/cat_entree.cpp:316 msgid "Entry information CRC failure" msgstr "Inmatad information CRC-misslyckande" #: src/libdar/etage.cpp:112 msgid "Error opening directory in furtive read mode: " msgstr "Fel vid öppning i smygläsningsmode: " #: src/libdar/etage.cpp:116 #, c-format msgid "" "Could not open directory %s in furtive read mode (%s), using normal mode" msgstr "Kunde inte öppna mapp %s i smygläsningsmode (%s), använder normal mode" #: src/libdar/etage.cpp:141 msgid "Error opening directory: " msgstr "Fel vid öppnande av mapp: " #: src/libdar/etage.cpp:181 #, c-format msgid "" "Detected Cache Directory Tagging Standard for %s, the contents of that " "directory will not be saved" msgstr "" "Upptäckt \"Cache Directory Tagging Standard\" för %s, innehÃ¥llet i den " "mappen kommer aj att sparas" #: src/libdar/entrepot_local.cpp:161 #, fuzzy, c-format msgid "Cannot remove file %s: " msgstr "Kan ej ta bort fil " #: src/libdar/cat_tools.hpp:41 msgid "[--- REMOVED ENTRY ----]" msgstr "[--- BORTAGNA DATA ----] " #: src/libdar/archive_version.cpp:47 msgid "Archive version too high, use a more recent version of libdar" msgstr "Arkivversion är för hög, använd en senare version av 'libdar'" #: src/libdar/archive_version.cpp:77 msgid "Reached End of File while reading archive version" msgstr "NÃ¥tt filslut vid läsning av arkivversion" #: src/libdar/archive_version.cpp:90 src/libdar/archive_version.cpp:99 msgid "Unexpected value while reading archive version" msgstr "Oväntat värde vid läsning av arkivversion" #: src/libdar/archive_version.cpp:97 msgid "Reached premature end of file while reading archive version" msgstr "NÃ¥dde filslut under läsning av arkivversion" #: src/libdar/cache.cpp:69 msgid "wrong value given as initial_size argument while initializing cache" msgstr "" "fel värde givet till argumentet initial_size medan cachen initialiseras" #: src/libdar/fsa_family.cpp:58 msgid "creation date" msgstr "" #: src/libdar/fsa_family.cpp:60 #, fuzzy msgid "append only" msgstr "enbart läsning" #: src/libdar/fsa_family.cpp:62 #, fuzzy msgid "compressed" msgstr "lzo-komprimering" #: src/libdar/fsa_family.cpp:64 msgid "no dump flag" msgstr "" #: src/libdar/fsa_family.cpp:66 msgid "immutable" msgstr "" #: src/libdar/fsa_family.cpp:68 msgid "journalized" msgstr "" #: src/libdar/fsa_family.cpp:70 msgid "secure deletion" msgstr "" #: src/libdar/fsa_family.cpp:72 msgid "no tail merging" msgstr "" #: src/libdar/fsa_family.cpp:74 msgid "undeletable" msgstr "" #: src/libdar/fsa_family.cpp:76 msgid "no atime update" msgstr "" #: src/libdar/fsa_family.cpp:78 #, fuzzy msgid "synchronous directory" msgstr "mapp" #: src/libdar/fsa_family.cpp:80 msgid "synchronous update" msgstr "" #: src/libdar/fsa_family.cpp:82 msgid "top of directory hierarchy" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:665 msgid "Failed setting (opening) extX family FSA: " msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:678 #, fuzzy msgid "Failed reading existing extX family FSA: " msgstr "Fel vid läsning frÃ¥n fil: " #: src/libdar/filesystem_specific_attribute.cpp:705 #: src/libdar/filesystem_specific_attribute.cpp:718 #: src/libdar/filesystem_specific_attribute.cpp:731 #: src/libdar/filesystem_specific_attribute.cpp:744 #: src/libdar/filesystem_specific_attribute.cpp:763 #: src/libdar/filesystem_specific_attribute.cpp:777 #: src/libdar/filesystem_specific_attribute.cpp:790 #: src/libdar/filesystem_specific_attribute.cpp:803 #: src/libdar/filesystem_specific_attribute.cpp:816 #: src/libdar/filesystem_specific_attribute.cpp:829 #: src/libdar/filesystem_specific_attribute.cpp:842 #: src/libdar/filesystem_specific_attribute.cpp:855 #, c-format msgid "" "Warning: FSA %s/%s support has not been found at compilation time, cannot " "restore it for inode %s" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:900 msgid "Failed set extX family FSA: " msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:927 #, c-format msgid "" "Not setting FSA extX IMMUTABLE flags for %s due to of lack of capability" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:955 #, c-format msgid "" "Not setting FSA extX SYSTEM RESOURCE flags for %s due to of lack of " "capability" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:973 #, c-format msgid "" "Warning! %s Filesystem Specific Attribute support have not been activated at " "compilation time and could not be restored for %s" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:993 #, c-format msgid "" "Birth Time attribute cannot be restored for %s because no FSA familly able " "to carry that attribute could be activated at compilation time." msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:1158 msgid "Unexepected value for boolean FSA, data corruption may have occurred" msgstr "" #: src/libdar/filesystem_specific_attribute.cpp:1162 #, fuzzy msgid "Error while reading FSA: " msgstr "Fel vid läsning frÃ¥n fil: " #: src/libdar/data_tree.cpp:99 msgid "reached End of File before all expected data could be read" msgstr "nÃ¥dde filslut innan alla väntade data kunde läsas" #: src/libdar/data_tree.cpp:115 msgid "Unexpected value found in database" msgstr "Oväntat värde hitta i databas" #: src/libdar/data_tree.cpp:628 #, c-format msgid "" "Archive number | Data | status || EA " "| status \n" msgstr "" "Arkivnummer | Data | status || " "EA | status \n" #: src/libdar/data_tree.cpp:629 #, fuzzy, c-format msgid "" "---------------+-------------------------+--------++-------------------------" "+----------\n" msgstr "--------------+-------------------------+-----------------------\n" #: src/libdar/data_tree.cpp:846 #, c-format msgid "" "Dates of file's %S are not increasing when database's archive number grows. " "Concerned file is: %S" msgstr "" "Fils datum %S ökar ej när databasens arkivnummer växer. Berörd fil är: %S" #: src/libdar/data_tree.cpp:849 msgid "" "Dates are not increasing for all files when database's archive number grows, " "working with this database may lead to improper file's restored version. " "Please reorder the archive within the database in the way that the older is " "the first archive and so on up to the most recent archive being the last of " "the database" msgstr "" "datum är ej i stigande ordning för alla filer, när databasens arkivnummer " "ökar, arbete med denna databas kan leda till felaktig version för Ã¥terställd " "fil. Ordna om arkivet inom databasen sÃ¥ att det äldsta är det första arkivet " "och det senaste är det sista i databasen" #: src/libdar/data_tree.cpp:852 msgid "Do you want to ignore the same type of error for other files?" msgstr "Vill du ignorera samma feltyp för andra filer?" #: src/libdar/data_tree.cpp:889 msgid "Unexpected end of file" msgstr "Oväntat filslut" #: src/libdar/data_tree.cpp:1105 msgid "" "This database has been corrupted probably due to a bug in release 2.4.0 to " "2.4.9, and it has not been possible to cleanup this corruption, please " "rebuild the database from archives or extracted \"catalogues\", if the " "database has never been used by one of the previously mentioned released, " "you are welcome to open a bug report and provide as much as possible details " "about the circumstances" msgstr "" #: src/libdar/data_tree.cpp:1187 msgid "[ Saved ]" msgstr "[ Sparad ]" #: src/libdar/data_tree.cpp:1189 src/libdar/data_tree.cpp:1194 msgid "[ ]" msgstr "[ ]" #: src/libdar/data_tree.cpp:1192 msgid "[ EA ]" msgstr "[ EA ]" #: src/libdar/data_tree.cpp:1415 msgid "Unknown record type" msgstr "Okänd posttyp" #: src/libdar/data_tree.cpp:1449 msgid "removed " msgstr "borttagen" #: src/libdar/data_tree.cpp:1450 msgid "present " msgstr "närvarande " #: src/libdar/data_tree.cpp:1451 msgid "saved " msgstr "sparad " #: src/libdar/data_tree.cpp:1452 msgid "absent " msgstr "frÃ¥nvarande " #: src/libdar/criterium.cpp:137 msgid "cannot evaluate an empty chain in an overwriting policy" msgstr "kan ej utvärdera en tom kedja i en överskrivningspolicy" #: src/libdar/criterium.cpp:567 msgid "" "Cannot evaluate this crit_and criterium as no criterium has been added to it" msgstr "" "Kan ej utvärdera crit_and criterium dÃ¥ inget kriterium har lagts till det" #: src/libdar/criterium.cpp:636 msgid "" "Cannot evaluate this crit_or criterium as no criterium has been added to it" msgstr "" "Kan ej utvärdera crit_or criterium dÃ¥ inget kriterium har lagts till det" #: src/libdar/criterium.cpp:669 src/libdar/criterium.cpp:740 #: src/libdar/criterium.cpp:820 #, fuzzy, c-format msgid "" "Conflict found while selecting the file to retain in the resulting archive:" msgstr "" "Konflikt funnen vid väljande av fil att behÃ¥lla i det resulterande arkivet:" #: src/libdar/criterium.cpp:670 #, c-format msgid "User Decision requested for data of file %S" msgstr "Användarbeslut begärt för data hos fil %S" #: src/libdar/criterium.cpp:673 msgid "" "\n" "Your decision about file's data:\n" "[P]reserve\n" "[O]verwrite\n" "mark [S]aved and preserve\n" "mark saved and overwri[T]e\n" "[R]emove\n" "[*] keep undefined\n" "[A]bort\n" " Your Choice? " msgstr "" "\n" "Ditt beslut om fildata:\n" "[P] bevara\n" "[O] skriva över\n" "[S] märk som sparad och bevara\n" "[T] märk som sparad och överskriv\n" "[R] tag bort\n" "[*] behÃ¥ll odefinierad\n" "[A] avbryt\n" " Ditt val? " #: src/libdar/criterium.cpp:675 src/libdar/criterium.cpp:746 #: src/libdar/criterium.cpp:826 msgid "" "Please answer by the character between brackets ('[' and ']') and press " "return" msgstr "" "Svara med de tecken mellan hakparenteser ('[' och ']') och tryck vagnretur" #: src/libdar/criterium.cpp:705 src/libdar/criterium.cpp:784 #: src/libdar/criterium.cpp:852 #, c-format msgid "" "Warning, are you sure you want to abort (please answer \"%S\" to confirm)? " msgstr "" "Varning, är du säker du vill avbryta (svara med \"%S\" för att bekräfta)?" #: src/libdar/criterium.cpp:709 src/libdar/criterium.cpp:788 #: src/libdar/criterium.cpp:856 msgid "Cancellation no confirmed" msgstr "Avbrott ej bekräftat" #: src/libdar/criterium.cpp:712 src/libdar/criterium.cpp:791 #: src/libdar/criterium.cpp:859 msgid "Unknown choice: " msgstr "Okänt val: " #: src/libdar/criterium.cpp:741 #, c-format msgid "User Decision requested for EA of file %S" msgstr "Användarbeslut begärt för EA hos fil %S" #: src/libdar/criterium.cpp:744 msgid "" "\n" "Your decision about file's EA:\n" "[p]reserve\n" "[o]verwrite\n" "mark [s]aved and preserve\n" "mark saved and overwri[t]e\n" "[m]erge EA and preserve\n" "merge EA a[n]d overwrite\n" "[r]emove\n" "[*] keep undefined\n" "[a]bort\n" " Your choice? " msgstr "" "\n" "ditt beslut om filens EA:\n" "[p] bevara\n" "[o] skrivöver\n" "[s] märk som sparad och bevara\n" "[t] märk som sparad och överskriv\n" "[m] slÃ¥ ihop EA och bevara\n" "[n] slÃ¥ ihop EA och överskriv\n" "[r] tag bort\n" "[*] behÃ¥ll oförändrad\n" "[a] avbryt\n" " Ditt val? " #: src/libdar/criterium.cpp:821 #, fuzzy, c-format msgid "User Decision requested for FSA of file %S" msgstr "Användarbeslut begärt för EA hos fil %S" #: src/libdar/criterium.cpp:824 #, fuzzy msgid "" "\n" "Your decision about file's FSA:\n" "[p]reserve\n" "[o]verwrite\n" "mark [s]aved and preserve\n" "mark saved and overwri[t]e\n" "[*] keep undefined\n" "[a]bort\n" " Your choice? " msgstr "" "\n" "Ditt beslut om fildata:\n" "[P] bevara\n" "[O] skriva över\n" "[S] märk som sparad och bevara\n" "[T] märk som sparad och överskriv\n" "[R] tag bort\n" "[*] behÃ¥ll odefinierad\n" "[A] avbryt\n" " Ditt val? " #: src/libdar/criterium.cpp:893 #, c-format msgid "Entry information:\t\"in place\"\t\"to be added\"" msgstr "Notis information:\t\"i plats\"\t\"att läggas till" #: src/libdar/criterium.cpp:894 #, c-format msgid "Is inode :\t %S \t\t %S" msgstr "Är inode :\t %S \t\t %S" #: src/libdar/criterium.cpp:895 #, c-format msgid "Is directory :\t %S \t\t %S" msgstr "Är mappar :\t %S \t\t %S" #: src/libdar/criterium.cpp:896 #, c-format msgid "Is plain file :\t %S \t\t %S" msgstr "Är enkel fil :\t %S \t\t %S" #: src/libdar/criterium.cpp:897 #, c-format msgid "Is hard linked :\t %S \t\t %S" msgstr "Är hÃ¥rdlänkad :\t %S \t\t %S" #: src/libdar/criterium.cpp:898 #, c-format msgid "Entry type :\t %s \t %s" msgstr "Notistyp :\t %s \t %s" #: src/libdar/criterium.cpp:902 msgid "me" msgstr "jag" #: src/libdar/criterium.cpp:911 #, fuzzy, c-format msgid "Data more recent :\t %S \t\t %S" msgstr "Senare data :\t %S \t %S" #: src/libdar/criterium.cpp:921 #, fuzzy, c-format msgid "Data size :\t %i \t\t %i" msgstr "Datastorlek :\t %i \t %i" #: src/libdar/criterium.cpp:922 #, c-format msgid "Sparse file :\t %S \t\t %S" msgstr "Gles fil :\t %S \t\t %S " #: src/libdar/criterium.cpp:923 #, c-format msgid "Dirty file :\t %S \t\t %S" msgstr "Smutsig fil :\t %S \t\t %S" #: src/libdar/criterium.cpp:925 #, c-format msgid "Data full saved :\t %S \t\t %S" msgstr "Data helt sparat :\t %S \t\t %S" #: src/libdar/criterium.cpp:926 #, c-format msgid "EA full saved :\t %S \t\t %S" msgstr "EA helt sparat :\t %S \t\t %S" #: src/libdar/criterium.cpp:928 #, c-format msgid "EA more recent :\t %S \t\t %S" msgstr "EA senare :\t %S \t\t %S" #: src/libdar/criterium.cpp:929 #, fuzzy, c-format msgid "FSA full saved :\t %S \t\t %S" msgstr "EA helt sparat :\t %S \t\t %S" #: src/libdar/criterium.cpp:934 #, fuzzy, c-format msgid "FSA familly :\t %S \t\t %S" msgstr "Gles fil :\t %S \t\t %S " #: src/libdar/criterium.cpp:943 #, c-format msgid "EA number :\t %i \t\t %i" msgstr "EA tal :\t %i \t\t %i" #: src/libdar/criterium.cpp:946 #, fuzzy, c-format msgid "EA size :\t %i \t\t %i" msgstr "EA storlek :\t %i \t %i" #: src/libdar/criterium.cpp:965 msgid "directory" msgstr "mapp" #: src/libdar/criterium.cpp:969 src/libdar/cat_tools.cpp:387 msgid "hard linked inode" msgstr "hÃ¥rdlänkad inode" #: src/libdar/criterium.cpp:971 msgid "plain file" msgstr "enkel fil" #: src/libdar/criterium.cpp:973 msgid "soft link" msgstr "mjuk länk" #: src/libdar/criterium.cpp:975 src/libdar/cat_tools.cpp:372 msgid "char device" msgstr "teckenenhet" #: src/libdar/criterium.cpp:977 src/libdar/cat_tools.cpp:375 msgid "block device" msgstr "blockenhet" #: src/libdar/criterium.cpp:979 msgid "named pipe" msgstr "namnad pipe" #: src/libdar/criterium.cpp:981 msgid "unix socket" msgstr "unix sockel" #: src/libdar/criterium.cpp:983 msgid "deleted entry" msgstr "fördröjd inmatning" #: src/libdar/criterium.cpp:985 msgid "door inode" msgstr "'door' inod" #: src/libdar/cat_lien.cpp:97 msgid "symbolic link does not point to the same target: " msgstr "symbolisk länk pekar inte pÃ¥ samma mÃ¥l" #: src/libdar/sparse_file.cpp:157 msgid "Incoherent structure in data carrying sparse files: unknown mark" msgstr "Icke översenstämmande struktur i data med glesa filer. okänt märke" #: src/libdar/sparse_file.cpp:311 msgid "Cannot skip forward to restore a hole" msgstr "Kan ej hoppa över framÃ¥t för att Ã¥terställa ett hÃ¥l" #: src/libdar/sparse_file.cpp:325 msgid "Data corruption or unknown sparse_file mark found in file's data" msgstr "Förstörda data eller ett okänt märke för gles fil hittat i filens data" #: src/libdar/trivial_sar.cpp:188 #, c-format msgid "%S already exists, and overwritten is forbidden, aborting" msgstr "%S finns redan och överskrivning är ej tillÃ¥ten, avbryter" #: src/libdar/trivial_sar.cpp:190 #, c-format msgid "%S is about to be overwritten, continue ?" msgstr "%S skall till att skrivas över, fortsätta ?" #: src/libdar/trivial_sar.cpp:213 src/libdar/trivial_sar.cpp:226 #: src/libdar/sar.cpp:1081 src/libdar/sar.cpp:1151 src/libdar/sar.cpp:1161 #, fuzzy, c-format msgid "Failed creating slice %S: " msgstr "Misslyckades med att notera hash: " #: src/libdar/trivial_sar.cpp:449 msgid "This archive has slices and is not possible to read from a pipe" msgstr "Detta arkiv har delar och har ej möjlighet att bli lästa frÃ¥n ett rör" #: src/libdar/trivial_sar.cpp:486 msgid "" "This archive is not single sliced, more data exists in the next slices but " "cannot be read from the current pipe, aborting" msgstr "" "Detta arkiv har delar och men det är ej möjlighet att läsa följand del frÃ¥n " "ett rör, avbryter" #: src/libdar/trivial_sar.cpp:524 #, fuzzy msgid "Cannot skip to a valid position in file" msgstr "Kan ej hoppa till aktuell position i \"tronc\"" #: src/libdar/cat_tools.cpp:120 msgid "[DIRTY]" msgstr "[SMUTS]" #: src/libdar/cat_tools.cpp:122 src/libdar/cat_tools.cpp:138 msgid "[Saved]" msgstr "[Sparad]" #: src/libdar/cat_tools.cpp:125 src/libdar/cat_tools.cpp:141 msgid "[InRef]" msgstr "[InRef]" #: src/libdar/cat_tools.cpp:354 #, fuzzy msgid "ignored directory" msgstr "mapp" #: src/libdar/cat_tools.cpp:357 msgid "folder" msgstr "" #: src/libdar/cat_tools.cpp:360 #, fuzzy msgid "deleted file" msgstr "fördröjd inmatning" #: src/libdar/cat_tools.cpp:363 msgid "door" msgstr "" #: src/libdar/cat_tools.cpp:366 msgid "file" msgstr "" #: src/libdar/cat_tools.cpp:369 #, fuzzy msgid "symlink" msgstr "mjuk länk" #: src/libdar/cat_tools.cpp:378 msgid "pipe" msgstr "" #: src/libdar/cat_tools.cpp:381 #, fuzzy msgid "socket" msgstr "unix sockel" #: src/libdar/cat_tools.cpp:384 #, fuzzy msgid "ignored entry" msgstr "fördröjd inmatning" #: src/libdar/cat_tools.cpp:390 #, fuzzy msgid "end of directory" msgstr "mapp" #: src/libdar/label.cpp:123 msgid "Incomplete label" msgstr "Ej fullständig etikett" #: src/libdar/tuyau.cpp:143 msgid "Error while creating anonymous pipe: " msgstr "Fel vid skapande av anonym pip: " #: src/libdar/tuyau.cpp:171 msgid "Pipe's other end is not known, cannot provide a filedescriptor on it" msgstr "Rörs andra ända okänt, kan ej erhÃ¥lla en filbeskrivning för det" #: src/libdar/tuyau.cpp:185 msgid "" "Pipe's other end is not known, cannot close any filedescriptor pointing on it" msgstr "" "Rörs andra ända okänt, kan ej stänga nÃ¥gon filbeskrivning pekande pÃ¥ det" #: src/libdar/tuyau.cpp:312 msgid "Error while reading from pipe: " msgstr "Fel vid läsning frÃ¥n ett rör: " #: src/libdar/tuyau.cpp:366 src/libdar/tuyau.cpp:371 msgid "Error while writing data to pipe: " msgstr "Fel vid skrivning av data till ett rör: " #: src/libdar/tuyau.cpp:368 src/libdar/fichier_global.cpp:107 msgid "" "No space left on device, you have the opportunity to make room now. When " "ready : can we continue ?" msgstr "" "Inget utrymme kvar pÃ¥ enhet, du har möjlighet att skapa plats nu. När du är " "klar : kan vi fortsätta ?" #: src/libdar/tuyau.cpp:422 msgid "Error opening pipe: " msgstr "Fel vid öppnade av rör: " #: src/libdar/tuyau.cpp:511 msgid "File mode is neither read nor write" msgstr "FiltillstÃ¥nd är varken läsning eller skrivning" #: src/libdar/slice_layout.cpp:52 msgid "Missing data while reading slice_layout object" msgstr "" #: src/libdar/escape.cpp:137 msgid "" "Adding an explicit escape sequence of type seqt_not_a_sequence is forbidden" msgstr "" "Lägga till en tydlig escape-sekvens av typen 'seqt_not_a_sequence' är " "förbjudet" #: src/libdar/escape.cpp:839 msgid "Unknown escape sequence type" msgstr "Okänd escape-sekvenstyp" #: src/libdar/semaphore.cpp:127 msgid "Error while converting UID/GID to string for backup hook file: " msgstr "Fel vid omvandling av UID/GID till sträng för \"backup hook file\": " #: src/libdar/catalogue.cpp:148 src/libdar/catalogue.cpp:166 #: src/libdar/catalogue.cpp:168 msgid "incoherent catalogue structure" msgstr "osammanhängande katalogstruktur" #: src/libdar/catalogue.cpp:159 msgid "" "LAX MODE: catalogue label does not match archive label, as if it was an " "extracted catalogue, assuming data corruption occurred and fixing the " "catalogue to be considered an a plain internal catalogue" msgstr "" "LAX MODE: katalogetikett matchar inte arkivetikett, som om det vore en " "extraherad katalog, antar dataförstörelse skett och fixar till katalogen som " "en enkel intern katalog" #: src/libdar/catalogue.cpp:211 msgid "CRC failed for table of contents (aka \"catalogue\")" msgstr "" "CRC misslyckades för innehÃ¥llsförtäckning (ocksÃ¥ känts som \"katalog\")" #: src/libdar/catalogue.cpp:213 msgid "" "LAX MODE: CRC failed for catalogue, the archive contents is corrupted. This " "may even lead dar to see files in the archive that never existed, but this " "will most probably lead to other failures in restoring files. Shall we " "proceed anyway?" msgstr "" "LAX MODE: CRC misslyckades, arkivinnehÃ¥llet är förstört. Detta kan leda till " "att dar ser filer i arkivet, vilka aldrig funnits men detta kommer sannolikt " "leda till andar fel vid Ã¥terställande av filer. Skall vi fortsätta ändÃ¥?" #: src/libdar/catalogue.cpp:272 msgid "root does not have a parent directory" msgstr "rot har inte nÃ¥gon föräldramapp" #: src/libdar/catalogue.cpp:312 msgid "no current directory defined" msgstr "ingen aktuell mapp definierad" #: src/libdar/catalogue.cpp:316 msgid "root directory has no parent directory" msgstr "rotmappen har ingen föräldramapp" #: src/libdar/catalogue.cpp:338 msgid "no current reading directory defined" msgstr "ingen aktuell läsmapp definierad" #: src/libdar/catalogue.cpp:410 src/libdar/catalogue.cpp:424 msgid " is not present in the archive" msgstr " är inte närvarande i arkivet" #: src/libdar/catalogue.cpp:502 msgid "Cannot recurs in a non directory entry" msgstr "Kan ej gÃ¥ rekursivt i en icke-mapp" #: src/libdar/catalogue.cpp:505 msgid "" "The entry to recurs in does not exist, cannot add further entry to that " "absent subdirectory" msgstr "" "Posten at gÃ¥ rekursivt in i saknas, kqan ej lägga till ytterligare poster " "till den obefintliga undermappen." #: src/libdar/catalogue.cpp:574 msgid "root has no parent directory" msgstr "rot har ingen föräldramapp" #: src/libdar/catalogue.cpp:933 #, fuzzy, c-format msgid "" "Access mode | User | Group | Size | Date | " "[Data ][ EA ][FSA][Compr][S]| Filename\n" msgstr "" "access mod | anvd | grupp | storl | datum | " "[data ][ EA ][kompr][S] | filnamn\n" #: src/libdar/catalogue.cpp:978 #, c-format msgid "%S [%c] [ REMOVED ENTRY ] (%S) %S\n" msgstr "%S [%c] [ FLYTTAD ENTRY ] (%S) %S\n" #: src/libdar/catalogue.cpp:1009 src/libdar/catalogue.cpp:1142 msgid " Extended Attribute: [" msgstr " Extended Attribut: [" #: src/libdar/catalogue.cpp:1048 #, fuzzy, c-format msgid "" "[Data ][ EA ][FSA][Compr][S]| Permission | User | Group | Size | " "Date | filename\n" msgstr "" "[data ][ EA ][kompr][S] | behörighet | anvd | grupp | storl | " "datum | filnamn\n" #: src/libdar/datetime.cpp:305 #, fuzzy msgid "Unknown time unit" msgstr "Okänt val: " #: src/libdar/libdar.cpp:155 msgid "Caught an unknown Egeneric exception: " msgstr "FÃ¥ngade ett okänt 'Egeneric exception:'" #: src/libdar/libdar.cpp:160 msgid "Caught a none libdar exception" msgstr "FÃ¥ngade att icke-libdaravbrott" #: src/libdar/libdar.cpp:272 #, fuzzy msgid "Invald nullptr argument given to 'ptr'" msgstr "Ogiltigt NULL-argument givet till 'ptr'" #: src/libdar/libdar.cpp:319 #, fuzzy msgid "Invalid nullptr pointer given to close_archive" msgstr "Ogiltig NULL-pekare givet till 'close_archive'" #: src/libdar/libdar.cpp:358 msgid "Initialization problem for liblzo2 library" msgstr "Initieringsproblem för liblzo2-biblioteket" #: src/libdar/libdar.cpp:375 src/libdar/libdar.cpp:397 #, c-format msgid "Too old version for libgcrypt, minimum required version is %s\n" msgstr "För gammal version av libgcrypt, som minst krävs version %s\n" #: src/libdar/libdar.cpp:384 #, c-format msgid "Error while activating libgcrypt's memory guard: %s/%s" msgstr "Fel vid aktivering av 'libgcrypts' minnesskydd: %s/%s" #: src/libdar/libdar.cpp:388 #, c-format msgid "Error while telling libgcrypt that initialization is finished: %s/%s" msgstr "" "Fel vid meddelande till 'libgcrypt' att initialiseringen är avslutad: %s/%s" #: src/libdar/libdar.cpp:393 msgid "libgcrypt not initialized and libdar not allowed to do so" msgstr "'libgcrypt' är ej initialiserad och 'libdar' ej tillÃ¥ten att göra sÃ¥" #: src/libdar/libdar.cpp:404 #, c-format msgid "GPGME version requirement is not satisfied, requires version > %s" msgstr "" #: src/libdar/libdar.cpp:408 #, c-format msgid "GPGME engine not available: %s" msgstr "" #: src/libdar/libdar.cpp:441 src/libdar/libdar.cpp:461 #: src/libdar/libdar.cpp:480 src/libdar/libdar.cpp:502 #: src/libdar/libdar.cpp:522 #, fuzzy msgid "Invalid nullptr argument given to 'ptr'" msgstr "Ogiltigt NULL-argument givet till 'ptr'" #: src/libdar/compressor.cpp:171 src/libdar/compressor.cpp:199 msgid "" "incompatible compression library version or unsupported feature required " "from compression library" msgstr "" #: src/libdar/compressor.cpp:329 msgid "compressed data is corrupted" msgstr "komprimerade data är förstörda" #: src/libdar/compressor.cpp:465 msgid "compressed data CRC error" msgstr "CRC-fel hos komprimerade data" #: src/libdar/compressor.cpp:552 src/libdar/compressor.cpp:582 #: src/libdar/compressor.cpp:722 src/libdar/compressor.cpp:787 msgid "lzo compression" msgstr "lzo-komprimering" #: src/libdar/compressor.cpp:708 #, c-format msgid "Probable bug in liblzo2: lzo1x_*_compress returned unexpected code %d" msgstr "Möjligt fel i liblso2: lzo1x_*_compress lämnade oväntad kod %d" #: src/libdar/compressor.cpp:743 msgid "data corruption detected: Incoherence in LZO compressed data" msgstr "förstörda data hittade: oegentligheter i LZO-komprimerade data" #: src/libdar/compressor.cpp:747 src/libdar/compressor.cpp:769 #: src/libdar/compressor.cpp:783 msgid "compressed data corruption detected" msgstr "förstörda komprimerade data hittade" #: src/libdar/compressor.cpp:757 msgid "data corruption detected: Too large block of compressed data" msgstr "förstörda data hittade: För stort block med komprimerade data" #: src/libdar/compressor.cpp:759 msgid "" "Too large block of compressed data: Either due to data corruption or current " "system limitation where SSIZE_MAX value implied smaller buffers than required" msgstr "" "För stort block med komprimerade data: antingen pÃ¥ grund av förstörda data " "eller begränsningar i aktuellt system där SSIZE_MAX-värdet indikerar mindre " "buffertar än begärda" #: src/libdar/compressor.cpp:818 src/libdar/compressor.cpp:837 #: src/libdar/compressor.cpp:856 msgid "unknown compression" msgstr "okänd komprimering" #: src/libdar/compressor.cpp:874 #, c-format msgid "unknown compression algorithm: %S" msgstr "okänd komprimeringsalgoritm: %S" #: src/libdar/macro_tools.cpp:136 msgid "Locating archive contents..." msgstr "Letar efter arkivinnehÃ¥ll..." #: src/libdar/macro_tools.cpp:148 msgid "Reading archive contents..." msgstr "Läser arkivinnehÃ¥ll..." #: src/libdar/macro_tools.cpp:185 msgid "Missing catalogue in file." msgstr "Katalog saknas i fil." #: src/libdar/macro_tools.cpp:285 msgid "" "LAX MODE: catalogue computed hash does not match the signed hash of the " "archive, ignoring" msgstr "" #: src/libdar/macro_tools.cpp:287 msgid "" "Catalogue computed hash does not match the signed hash of the archive, " "archive has been modified since it was signed!" msgstr "" #: src/libdar/macro_tools.cpp:316 msgid "Cannot open catalogue: " msgstr "Kan ej öppna katalog: " #: src/libdar/macro_tools.cpp:390 msgid "Opening standard input to read the archive..." msgstr "Öppnar standard-input för att läsa arkivet..." #: src/libdar/macro_tools.cpp:398 #, c-format msgid "Opening named pipe %S as input to read the archive..." msgstr "Öppnar namngiven pipe %S som input för att läsa arkivet..." #: src/libdar/macro_tools.cpp:411 #, c-format msgid "" "Opening a pair of pipes to read the archive, expecting dar_slave at the " "other ends..." msgstr "" "Öppnar ett par pipes för att läsa arkivet, förväntar mig dar_slave i andra " "ändan..." #: src/libdar/macro_tools.cpp:441 msgid "Opening the archive using the multi-slice abstraction layer..." msgstr "Öppnar arkivet genom att använda abstraktionsnivÃ¥ med 'multi-slice'..." #: src/libdar/macro_tools.cpp:470 msgid "Reading the archive header..." msgstr "Läser arkivhuvud..." #: src/libdar/macro_tools.cpp:472 #, fuzzy msgid "Reading the archive trailer..." msgstr "Läser arkivhuvud..." #: src/libdar/macro_tools.cpp:496 #, c-format msgid "" "Error while reading archive's header, this may be because this archive is an " "old encrypted archive or that data corruption took place, Assuming it is an " "old archive, we have to read the header at the beginning of the first " "slice..." msgstr "" "Fel vid läsning av arkivhuvud. Detta kan bero pÃ¥ att arkivet är ett gammalt " "krypterat arkiv eller att data har förstörts. Under antagande att det är ett " "gammalt arkiv, mÃ¥ste huvudet läsas frÃ¥n början av den första delen..." #: src/libdar/macro_tools.cpp:507 #, fuzzy msgid "" "Found a correct archive header at the beginning of the archive, which does " "not stands to be an old archive, the end of the archive is corrupted and " "thus the catalogue is not readable, aborting. Either retry providing in " "addition an isolated catalogue of that archive to perform the operation, or " "try reading the archive in sequential mode or try in lax mode or, last " "chance, try both lax and sequential read mode at the same time" msgstr "" "Hittade en felaktigt arkivhuvud i början av arkivet, vilket inte bevisar att " "det är ett gammalt arkiv. Slutet pÃ¥ arkivet är sÃ¥ledes förstört. Du mÃ¥ste " "använda sekvensiell läsningsteknik för att ha en chans att använda detta " "förstörda arkiv." #: src/libdar/macro_tools.cpp:509 #, fuzzy msgid "" "Found a correct archive header at the beginning of the archive, which does " "not stands to be an old archive, the end of the archive is thus corrupted. " "Without external catalogue provided and as we do not read the archive in " "sequential mode, there is very little chance to retreive something from this " "corrupted archive. Do we continue anyway ?" msgstr "" "Hittade en felaktigt arkivhuvud i början av arkivet, vilket inte bevisar att " "det är ett gammalt arkiv. Slutet pÃ¥ arkivet är sÃ¥ledes förstört. Du mÃ¥ste " "använda sekvensiell läsningsteknik för att ha en chans att använda detta " "förstörda arkiv." #: src/libdar/macro_tools.cpp:518 #, c-format msgid "Opening construction layer..." msgstr "Öppnar konstruktionsnivÃ¥..." #: src/libdar/macro_tools.cpp:534 msgid "Considering cyphering layer..." msgstr "Funderar pÃ¥ chiffreringsnivÃ¥..." #: src/libdar/macro_tools.cpp:543 msgid "" "LAX MODE: Archive seems to be ciphered, but you did not have provided any " "encryption algorithm, assuming data corruption and considering that the " "archive is not ciphered" msgstr "" "LAX MODE: Arkivet verkar vara chiffrerat, men du har ej angett nÃ¥gon " "chifferalgoritm, antar dataförstörelse och betraktar arkivet som ej " "chiffrerat" #: src/libdar/macro_tools.cpp:546 #, c-format msgid "" "The archive %S is encrypted and no encryption cipher has been given, cannot " "open archive." msgstr "" "Arkivet %S är krypterat och ingen krypteringschiffer har getts, kan ej öppna " "arkivet." #: src/libdar/macro_tools.cpp:577 msgid "" "WARNING: support for secure memory was not available at compilation time, in " "case of heavy memory load, this may lead the password you are about to " "provide to be wrote to disk (swap space) in clear. You have been warned!" msgstr "" "VARNING: stöd för säkert minne var ej tillgängligt vid " "kompileringstillfället. Vid stor minnesbelastning kan detta leda till att " "det lösenord du skall till och lämna kan skrivas till disk (växlingsutrymme) " "i klartext. Du har härmed varnats!" #: src/libdar/macro_tools.cpp:578 src/libdar/macro_tools.cpp:1312 #, c-format msgid "Archive %S requires a password: " msgstr "Arkiv %S kräver ett lösenord: " #: src/libdar/macro_tools.cpp:587 #, fuzzy msgid "No cyphering layer opened, adding cache layer for better performance" msgstr "Öppnar \"cache\"-nivÃ¥n för bättre prestanda..." #: src/libdar/macro_tools.cpp:593 msgid "" "Failed opening the cache layer, lack of memory, archive read performances " "will not be optimized" msgstr "" "Misslyckades med att öppna \"cache\"-nivÃ¥n, minnesbrist, arkivläsförmÃ¥ga " "blir ej optimal" #: src/libdar/macro_tools.cpp:598 msgid "No cyphering layer opened" msgstr "Ingen chiffreringslager öppnat..." #: src/libdar/macro_tools.cpp:607 src/libdar/macro_tools.cpp:651 msgid "Opening cyphering layer..." msgstr "Öppnar chiffreringslager..." #: src/libdar/macro_tools.cpp:658 msgid "Unknown encryption algorithm" msgstr "Okänd krypteringsalgoritm" #: src/libdar/macro_tools.cpp:678 src/libdar/macro_tools.cpp:1419 msgid "Creating a new thread to run the previously created layers..." msgstr "" #: src/libdar/macro_tools.cpp:698 msgid "Opening escape sequence abstraction layer..." msgstr "Öppnar escape-sekvensabstraktionslagret" #: src/libdar/macro_tools.cpp:703 msgid "" "LAX MODE: Archive is flagged as having escape sequence (which is normal in " "recent archive versions). However if this is not expected, shall I assume a " "data corruption occurred in this field and that this flag should be ignored? " "(If unsure, refuse)" msgstr "" "LAX MODE: Arkiv är flaggat som om det har 'escape sekvens " "markeringar' (vilket är normalt i tidigare arkivversioner). Om detta inte är " "förväntat, skall jag antaga att data förstörts i detta fält och att denna " "flagga skall ignoreras? (Om osäker, vägra)" #: src/libdar/macro_tools.cpp:718 msgid "" "Sequential read asked, but this archive is flagged to not have the necessary " "embedded escape sequences for that operation, aborting" msgstr "" "Sekvensiell läsning begärd, men detta arkiv är flaggat för att inte ha " "nödvändiga escepsekvenser för denna Ã¥tgärd, avbryter" #: src/libdar/macro_tools.cpp:723 msgid "" "LAX MODE: the requested sequential read mode relies on escape sequence which " "seem to be absent from this archive. Assuming data corruption occurred. " "However, if no data corruption occurred and thus no escape sequence are " "present in this archive, do not use sequential reading mode to explore this " "archive else you will just get nothing usable from it" msgstr "" "LAX MODE: en begärda läget sekvensiell läsning bygger pÃ¥ escape-sekvenser " "vilket värkar saknas i detta arkiv. Antar att data förstörts. Men om inga " "data förstörts och ändÃ¥ ingen escape-sekvens finns i arkivet, använd inte " "läget sekvensiell läsning för att undersöka detta arkiv du fÃ¥r inget " "matnyttigt av det" #: src/libdar/macro_tools.cpp:729 #, fuzzy msgid "" "LAX MODE: Archive is flagged to not have escape sequence which is not the " "case by default since archive format 8 (release 2.4.x). If corruption " "occurred and an escape sequence is present, this may lead data restoration " "to fail, answering no at this question will let me consider that an escape " "sequence layer has to be added in spite of the archive flags. Do you want to " "continue as suggested by the archive flag, thus without escape sequence " "layer?" msgstr "" "LAX MODE: Arkiv är flaggat att inte ha escape-sekvenser. Om data förstörts " "och en escape-sekvens finns, kan detta leda till att Ã¥terställningen " "misslyckas, svara \"no\" pÃ¥ denna frÃ¥ga kan ge mig möjligheten att lägga " "till en escape-sekvens-nivÃ¥ trots arkivflaggan. Vill du fortsätta som " "förslagits av arkivflaggan, sÃ¥lunda utan escape-sekvens-nivÃ¥?" #: src/libdar/macro_tools.cpp:760 src/libdar/macro_tools.cpp:1465 msgid "Creating a new thread to run the escape layer..." msgstr "" #: src/libdar/macro_tools.cpp:778 msgid "" "Opening the compression abstraction layer (compression algorithm used is " "none)..." msgstr "" "Öppnar kompressionsabstraktionslagret ( ingen kompressionsalgoritm " "används)..." #: src/libdar/macro_tools.cpp:780 msgid "Opening the compression layer..." msgstr "Öppnar kompressionslagret..." #: src/libdar/macro_tools.cpp:804 src/libdar/macro_tools.cpp:1497 #, fuzzy msgid "Creating a new thread to run the compression layer..." msgstr "Öppnar kompressionslagret..." #: src/libdar/macro_tools.cpp:818 src/libdar/macro_tools.cpp:1507 msgid "All layers have been created successfully" msgstr "Alla lager har skapats korrekt" #: src/libdar/macro_tools.cpp:821 #, c-format msgid "" "Warning, the archive %S has been encrypted. A wrong key is not possible to " "detect, it would cause DAR to report the archive as corrupted\n" msgstr "" "Varning, arkivet %S har krypterats. En felaktig nyckel är omöjlig att " "detektera, det skulle leda till att DAR rapporterar att arkivet var " "förstört\n" #: src/libdar/macro_tools.cpp:858 msgid "" "LAX MODE: The catalogue (table of contents) usually takes a few percents of " "the archive at its end, which percentage do you want me to scan (answer by " "an *integer* number between 0 and 100)? " msgstr "" "LAX MODE: katalogen (InnehÃ¥llsförteckning) tar normalt upp nÃ¥gra procent av " "arkivet i dess slut. Hur stor del procentuellt, vill du att jag skall avsöka " "(svara med ett heltal mellan 0 och 100)?" #: src/libdar/macro_tools.cpp:864 #, c-format msgid "LAX MODE: %i is not a valid percent value" msgstr "LAX MODE: %i är ej giltigt procentvärde" #: src/libdar/macro_tools.cpp:868 #, c-format msgid "%S is not a valid number" msgstr "%S är inte ett giltigt tal" #: src/libdar/macro_tools.cpp:874 #, c-format msgid "" "LAX MODE: Beginning search of the catalogue (from the end toward the " "beginning of the archive, on %i %% of its length), this may take a while..." msgstr "" "LAX MODE: Börjar med att avsöka katalogen (frÃ¥n slutet mot början av arkivet " "%i %% av arkivet), detta kan ta ett bra tag..." #: src/libdar/macro_tools.cpp:883 msgid "" "LAX MODE: Cannot skip at the end of the archive! Using current position to " "start the catalogue search" msgstr "" "LAX MODE: Kan ej hoppa över i slutet av arkivet! Amvänder aktuell position " "till att börja katalogsökningen" #: src/libdar/macro_tools.cpp:888 msgid "LAX MODE: Failed to read the catalogue (no data to inspect)" msgstr "" "LAX MODE: Misslyckades med att läsa katalogen (inga data att inspektera)" #: src/libdar/macro_tools.cpp:891 msgid "" "LAX MODE: Failed to read the catalogue (0 bytes of the archive length asked " "to look for the catalogue)" msgstr "" "LAX MODE: Misslyckades med att läsa katalogen (0 byte hos arkivlängden " "medförde att leta efter katalogen)" #: src/libdar/macro_tools.cpp:902 msgid "" "LAX MODE: Escape sequence seems present in this archive. I have thus two " "different methods, either I look for the escape sequence indicating the " "start of the catalogue or I try each position in turn in the hope it will " "not be data that look like a catalogue" msgstr "" "LAX MODE: escape-sekvenser verkar finnas i detta rakiv. Jag har dÃ¥ tvÃ¥ olika " "metoder, antingen letar jag efter escape-sekvenser visande pÃ¥ en " "katalogbörjan eller sÃ¥ försöker jag vid varje position i ordning i hopp om " "att det inte är data, som ser ut som en katalog." #: src/libdar/macro_tools.cpp:905 msgid "LAX MODE: Trying to locate the escape sequence (safer choice) ?" msgstr "LAX MODE: Försöker hitta escape-sekvensen (säkrare val) ?" #: src/libdar/macro_tools.cpp:910 msgid "" "LAX MODE: Good point! I could find the escape sequence marking the beginning " "of the catalogue, now trying to read it..." msgstr "" "LAX MODE: Bra ide! kunde hitta escape-sekvensen markerande katalogbörjan, " "försöker nu läsa den..." #: src/libdar/macro_tools.cpp:919 msgid "" "LAX MODE: Escape sequence could not be found, it may have been corrupted or " "out of the scanned portion of the archive, trying to find the catalogue the " "other way" msgstr "" "LAX MODE: Escape-sekvens kunde inte hittas, den kan ha blivit förstörd or " "utanför avsökt del av arkivet, försöker hitta katalogen den andra vägen..." #: src/libdar/macro_tools.cpp:942 #, c-format msgid "LAX MODE: %i %% remaining" msgstr "LAX MODE: %i %% Ã¥terstÃ¥r" #: src/libdar/macro_tools.cpp:954 #, c-format msgid "" "Could read a catalogue data structure at offset %i, it contains the " "following:" msgstr "" "Kunde inte läsa en katalogdatastruktur med offset %i, det innehÃ¥ller " "följande:" #: src/libdar/macro_tools.cpp:956 #, fuzzy msgid "Do you want to use it for the operation?" msgstr "Vill du använda det för Ã¥terhämtning?" #: src/libdar/macro_tools.cpp:988 msgid "" "LAX MODE: Reached the end of the area to scan, FAILED to find any catalogue" msgstr "" "LAX MODE: NÃ¥dde slutet pÃ¥ avsökt omrÃ¥de, misslyckades med att hitta nÃ¥gon " "katalog" #: src/libdar/macro_tools.cpp:998 msgid "LAX MODE: Failed to read the catalogue" msgstr "LAX MODE: Misslyckades med att läsa katalogen" #: src/libdar/macro_tools.cpp:1006 msgid "" "The format version of the archive is too high for that software version, try " "reading anyway?" msgstr "" "Arkivets formatversion är för högt för denna programvaruversion, försöka " "läsa ändÃ¥?" #: src/libdar/macro_tools.cpp:1087 msgid "" "Creating low layer: Writing archive into a black hole object (equivalent to /" "dev/null)..." msgstr "" #: src/libdar/macro_tools.cpp:1096 msgid "Creating low layer: Writing archive into standard output object..." msgstr "" #: src/libdar/macro_tools.cpp:1110 msgid "Creating low layer: Writing archive into a plain file object..." msgstr "" #: src/libdar/macro_tools.cpp:1131 msgid "" "Creating low layer: Writing archive into a sar object (Segmentation and " "Reassembly) for slicing..." msgstr "" #: src/libdar/macro_tools.cpp:1169 msgid "Adding cache layer over pipe to provide limited skippability..." msgstr "" #: src/libdar/macro_tools.cpp:1197 #, fuzzy msgid "" "WARNING: support for secure memory was not available at compilation time, in " "case of heavy memory load, this may lead the password/passphrase provided to " "be wrote to disk (swap space) in clear. You have been warned!" msgstr "" "VARNING: stöd för säkert minne var ej tillgängligt vid " "kompileringstillfället. Vid stor minnesbelastning kan detta leda till att " "det lösenord du skall till och lämna kan skrivas till disk (växlingsutrymme) " "i klartext. Du har härmed varnats!" #: src/libdar/macro_tools.cpp:1212 msgid "Generating random key for symmetric encryption..." msgstr "" #: src/libdar/macro_tools.cpp:1220 msgid "" "Scrambling is a very weak encryption algorithm, this is a non-sens to use " "with asymmetric encryption" msgstr "" #: src/libdar/macro_tools.cpp:1260 #, c-format msgid "" "For your information, this is the iteration %d for which the randomly " "generated key is reported to be weak by libgcrypt, continuing generating " "another random key... patience" msgstr "" #: src/libdar/macro_tools.cpp:1264 #, c-format msgid "" "... A strong randomly generated key could be found after %d iteration(s)" msgstr "" #: src/libdar/macro_tools.cpp:1271 msgid "Key generated" msgstr "" #: src/libdar/macro_tools.cpp:1313 msgid "Please confirm your password: " msgstr "Bekräfta lösenordet: " #: src/libdar/macro_tools.cpp:1317 msgid "The two passwords are not identical. Aborting" msgstr "De tvÃ¥ lösenorden är olika. Avbryter" #: src/libdar/macro_tools.cpp:1347 #, fuzzy msgid "Writing down the archive header..." msgstr "Läser arkivhuvud..." #: src/libdar/macro_tools.cpp:1363 msgid "Adding a new layer on top: scrambler object..." msgstr "" #: src/libdar/macro_tools.cpp:1375 msgid "Adding a new layer on top: Strong encryption object..." msgstr "" #: src/libdar/macro_tools.cpp:1392 #, fuzzy msgid "Adding a new layer on top: Caching layer for better performances..." msgstr "Öppnar \"cache\"-nivÃ¥n för bättre prestanda..." #: src/libdar/macro_tools.cpp:1437 msgid "Writing down the initial elastic buffer through the encryption layer..." msgstr "" #: src/libdar/macro_tools.cpp:1449 msgid "Adding a new layer on top: Escape layer to allow sequential reading..." msgstr "" #: src/libdar/macro_tools.cpp:1479 msgid "Adding a new layer on top: compression..." msgstr "" #: src/libdar/macro_tools.cpp:1521 #, fuzzy msgid "Error creating archive layers: " msgstr "Fel vid läsning av tecken: " #: src/libdar/macro_tools.cpp:1630 #, fuzzy msgid "Writing down archive contents..." msgstr "Skriver arkivinnehÃ¥ll..." #: src/libdar/macro_tools.cpp:1654 msgid "Calculating the signature of the catalogue hash..." msgstr "" #: src/libdar/macro_tools.cpp:1670 #, fuzzy msgid "Writing down the signed hash of the catalogue..." msgstr "Uppdaterar databas med katalog..." #: src/libdar/macro_tools.cpp:1720 #, fuzzy msgid "Closing the compression layer..." msgstr "Öppnar kompressionslagret..." #: src/libdar/macro_tools.cpp:1735 #, fuzzy msgid "Closing the escape layer..." msgstr "Öppnar kompressionslagret..." #: src/libdar/macro_tools.cpp:1755 #, fuzzy msgid "Writing down the first archive terminator..." msgstr "Skriver arkivinnehÃ¥ll..." #: src/libdar/macro_tools.cpp:1761 msgid "writing down the final elastic buffer through the encryption layer..." msgstr "" #: src/libdar/macro_tools.cpp:1800 #, fuzzy msgid "Closing the encryption layer..." msgstr "Öppnar kompressionslagret..." #: src/libdar/macro_tools.cpp:1822 #, fuzzy msgid "Writing down archive trailer..." msgstr "Skriver arkivinnehÃ¥ll..." #: src/libdar/macro_tools.cpp:1827 #, fuzzy msgid "Writing down the second archive terminator..." msgstr "Skriver arkivinnehÃ¥ll..." #: src/libdar/macro_tools.cpp:1838 #, fuzzy msgid "Closing archive low layer..." msgstr "Funderar pÃ¥ chiffreringsnivÃ¥..." #: src/libdar/macro_tools.cpp:1843 #, fuzzy msgid "Archive is closed." msgstr "Arkivet bestÃ¥r av %i fil(er)\n" #: src/libdar/entrepot.cpp:151 #, fuzzy msgid "Error met while creating the hash file: " msgstr "Fel vid skapande av hash handle: %s/%s" #: src/libdar/tlv.cpp:66 #, fuzzy msgid "Missing data to initiate a TLV object" msgstr "data saknas till att bygga en mapp" #: src/libdar/filesystem.cpp:174 #, c-format msgid "Error reading inode of file %s : %s" msgstr "Fel vid läsning av inod för fil %s : %s" #: src/libdar/filesystem.cpp:179 #, fuzzy, c-format msgid "Failed reading inode information for %s: " msgstr "Fel vid inhämtning av innodinformation för %s : %s" #: src/libdar/filesystem.cpp:187 msgid "Cannot read inode for " msgstr "Kan ej läsa inod för " #: src/libdar/filesystem.cpp:283 msgid "Unknown file type! file name is: " msgstr "Okänd filtyp! filnamnet är: " #: src/libdar/filesystem.cpp:316 msgid "Error reading EA for " msgstr "Fel vid läsning av EA för " #: src/libdar/filesystem.cpp:566 src/libdar/filesystem.cpp:802 msgid "Non existent file: " msgstr "Icke-existerande fil: " #: src/libdar/filesystem.cpp:568 src/libdar/filesystem.cpp:804 msgid "File must be a directory: " msgstr "Fil mÃ¥ste vara en mapp: " #: src/libdar/filesystem.cpp:653 #, c-format msgid "Cannot read directory contents: %s : " msgstr "Kan ej läsa mappinnehÃ¥llet: %s : " #: src/libdar/filesystem.cpp:690 msgid "Ignoring file with NODUMP flag set: " msgstr "Ignorerar fil med NODUMP-flagga satt: " #: src/libdar/filesystem.cpp:698 src/libdar/filesystem.cpp:703 msgid "Error reading directory contents: " msgstr "Fel vid läsning av mappinnehÃ¥ll: " #: src/libdar/filesystem.cpp:698 src/libdar/filesystem.cpp:703 msgid " . Ignoring file or directory" msgstr " . Ignorerar fil eller mapp" #: src/libdar/filesystem.cpp:1082 #, c-format msgid "" "Error creating hard link %s : %s\n" " Trying to duplicate the inode" msgstr "" "Fel vid skapande av hÃ¥rd länk %s : %s\n" " Försöker att duplicera inoden" #: src/libdar/filesystem.cpp:1096 #, c-format msgid "" "Error creating hard link : %s , the inode to link with [ %s ] has " "disappeared, re-creating it" msgstr "" "Fel vid skapande av hÃ¥rd länk %s , inoden till länk med [ %s ] har " "försvunnit, Ã¥terskapar den" #: src/libdar/filesystem.cpp:1103 #, c-format msgid "" "Error creating hard link : %s , the inode to link with [ %s ] is not " "present, cannot restore this hard link" msgstr "" "Fel vid skapande av hÃ¥rd länk %s , inoden till länk med [ %s ] finns inte, " "kan ej Ã¥terställa denna hÃ¥rda länk" #: src/libdar/filesystem.cpp:1175 msgid "Bad CRC, data corruption occurred" msgstr "Fel i CRC, data förstört" #: src/libdar/filesystem.cpp:1225 msgid "Error creating Unix socket file: " msgstr "Fel vid skapande av UNIX sockelfil: " #: src/libdar/filesystem.cpp:1245 msgid "Could not create inode: " msgstr "Kunde ej skapa inod: " #: src/libdar/filesystem.cpp:1247 msgid "Cannot create inode: " msgstr "Kan ej skapa inod: " #: src/libdar/filesystem.cpp:1247 msgid " Ready to continue ?" msgstr " Klar att fortsätta ?" #: src/libdar/filesystem.cpp:1442 msgid "Cannot remove non-existent file from filesystem: " msgstr "Kan ej ta bort icke befintlig fil frÃ¥n filsystemet: " #: src/libdar/filesystem.cpp:1447 src/libdar/filesystem.cpp:1740 msgid "Restoring file's data: " msgstr "Ã…terställer fils data: " #: src/libdar/filesystem.cpp:1464 src/libdar/filesystem.cpp:1935 msgid "Restoring file's EA: " msgstr "Ã…terställer fils EA: " #: src/libdar/filesystem.cpp:1475 src/libdar/filesystem.cpp:1578 #, fuzzy, c-format msgid "Restoration of EA for %S aborted: " msgstr "Ã…terställer EA för " #: src/libdar/filesystem.cpp:1485 src/libdar/filesystem.cpp:2078 #, fuzzy msgid "Restoring file's FSA: " msgstr "Ã…terställer fils EA: " #: src/libdar/filesystem.cpp:1498 src/libdar/filesystem.cpp:1590 #, c-format msgid "Restoration of FSA for %S aborted: " msgstr "" #: src/libdar/filesystem.cpp:1659 #, c-format msgid "%S is about to be removed from filesystem, continue?" msgstr "%S skall till att tas bort frÃ¥n filsystemet, fortsätta ? " #: src/libdar/filesystem.cpp:1664 src/libdar/filesystem.cpp:1673 #, c-format msgid "Removing file (reason is file recorded as removed in archive): %S" msgstr "Tar bort fil (orsaken är att fil är noterad som bortagen i arkiv): %S" #: src/libdar/filesystem.cpp:1671 #, c-format msgid "" "%S must be removed, but does not match expected type, remove it anyway ?" msgstr "%S mÃ¥ste tas bort, men matchar inte förvänta typ, ta bort ändÃ¥ ?" #: src/libdar/filesystem.cpp:1679 #, c-format msgid "" "%S: Overwriting policy (Data) is undefined for that file, do not know " "whether removal is allowed or not!" msgstr "" "%S: Överskrivningspolicy (Data) är odefinierat för denna fil, vet ej " "huruvida bortagande är tillÃ¥tet eller ej!" #: src/libdar/filesystem.cpp:1716 #, c-format msgid "" "Directory %S cannot be restored: overwriting not allowed and a non-directory " "inode of that name already exists, all files in that directory will be " "skipped for restoration:" msgstr "" "Mappen %S kan ej Ã¥terställas: överskrivning ej tillÃ¥ten och en icke-mapp-" "inod med det namnet finns redan, alla filer i den mappen kommer att hoppas " "över vid Ã¥terhämtning:" #: src/libdar/filesystem.cpp:1725 #, c-format msgid "%S is about to be overwritten, OK?" msgstr "%S skall till att överskrivas, OK?" #: src/libdar/filesystem.cpp:1771 #, c-format msgid "Existing EA for %S could not be read and preserved: " msgstr "Befintlig EA för %S kunde inte läsas och bevaras: " #: src/libdar/filesystem.cpp:1789 #, fuzzy, c-format msgid "Existing FSA for %S could not be read and preserved: " msgstr "Befintlig EA för %S kunde inte läsas och bevaras: " #: src/libdar/filesystem.cpp:1818 #, c-format msgid "Existing EA for %S could not be preserved : " msgstr "Befintlig EA för %S kunde inte bevaras : " #: src/libdar/filesystem.cpp:1835 #, fuzzy, c-format msgid "Existing FSA for %S could not be preserved : " msgstr "Befintlig EA för %S kunde inte bevaras : " #: src/libdar/filesystem.cpp:1850 #, c-format msgid "" "%S is about to be deleted (required by overwriting policy), do you agree?" msgstr "" "%S skall till at tas bort (krav frÃ¥n överskrivningspolicy), är du överens?" #: src/libdar/filesystem.cpp:1852 #, c-format msgid "Removing file (reason is overwriting policy): %S" msgstr "Tar bort fil (orsak är överskrivningspolicy): %S" #: src/libdar/filesystem.cpp:1858 #, c-format msgid "" "%S: Overwriting policy (Data) is undefined for that file, do not know " "whether overwriting is allowed or not!" msgstr "" "%S: Överskrivningspolicy är obestämd för denna fil, vet ej huruvida " "överskrivning tillÃ¥ts eller ej!" #: src/libdar/filesystem.cpp:1914 #, c-format msgid "EA for %S are about to be overwritten, OK?" msgstr "NÃ¥gra EA för %S skall till att skrivas över, OK?" #: src/libdar/filesystem.cpp:1929 #, c-format msgid "" "EA for %S have not been overwritten because this file is a hard link " "pointing to an already restored inode" msgstr "" "EA för %S har ej skrivits över eftersom denna fil är en hÃ¥rd länk pekande pÃ¥ " "en redan Ã¥terskapad inode." #: src/libdar/filesystem.cpp:1949 #, c-format msgid "EA for %S are about to be removed, OK?" msgstr "EA för %S skall till att tas bort, OK?" #: src/libdar/filesystem.cpp:1960 #, c-format msgid "" "EA for %S have not been cleared as requested by the overwriting policy " "because this file is a hard link pointing to an already restored inode" msgstr "" "EA for %S har ej nollställt enligt begäran frÃ¥n överskrivnngspolicyn " "eftersom denna fil är en hÃ¥rd länk pekande pÃ¥ en redan Ã¥terställd inod" #: src/libdar/filesystem.cpp:1966 msgid "Clearing file's EA (requested by overwriting policy): " msgstr "Nollställning av fils EA (begärd av överskrivninsgpolicy): " #: src/libdar/filesystem.cpp:1979 #, c-format msgid "EA for %S are about to be merged, OK?" msgstr "EA för %S skall till att slÃ¥s ihop, OK?" #: src/libdar/filesystem.cpp:2005 #, c-format msgid "" "%S: Overwriting policy (EA) is undefined for that file, do not know whether " "overwriting is allowed or not!" msgstr "" "%S: Överskrivningspolicyn (EA) är obestämd för denna fil, vet ej huruvida " "överskrivning är tillÃ¥ten eller ej!" #: src/libdar/filesystem.cpp:2057 src/libdar/filesystem.cpp:2103 #, fuzzy, c-format msgid "FSA for %S are about to be overwritten, OK?" msgstr "NÃ¥gra EA för %S skall till att skrivas över, OK?" #: src/libdar/filesystem.cpp:2072 #, fuzzy, c-format msgid "" "FSA for %S have not been overwritten because this file is a hard link " "pointing to an already restored inode" msgstr "" "EA för %S har ej skrivits över eftersom denna fil är en hÃ¥rd länk pekande pÃ¥ " "en redan Ã¥terskapad inode." #: src/libdar/filesystem.cpp:2129 #, fuzzy, c-format msgid "" "%S: Overwriting policy (FSA) is undefined for that file, do not know whether " "overwriting is allowed or not!" msgstr "" "%S: Överskrivningspolicyn (EA) är obestämd för denna fil, vet ej huruvida " "överskrivning är tillÃ¥ten eller ej!" #: src/libdar/filesystem.cpp:2189 msgid "Cannot get inode information about file to remove " msgstr "Kan ej fÃ¥r inodsinformation om den fil som skall tas bort " #: src/libdar/filesystem.cpp:2202 msgid "Cannot remove directory " msgstr "Kan ej ta bort mapp " #: src/libdar/filesystem.cpp:2206 msgid "Cannot remove file " msgstr "Kan ej ta bort fil " #: src/libdar/filesystem.cpp:2255 msgid "" "uid value is too high for this system for libdar be able to restore it " "properly" msgstr "" "uid-värde för högt för detta system för 'libdar' att kunna Ã¥terställa den " "säkert" #: src/libdar/filesystem.cpp:2259 msgid "" "gid value is too high for this system for libdar be able to restore it " "properly" msgstr "" "gid-värde för högt för detta system för 'libdar' att kunna Ã¥terställa den " "säkert" #: src/libdar/filesystem.cpp:2263 src/libdar/filesystem.cpp:2267 msgid "Could not restore original file ownership: " msgstr "Kunde inte Ã¥terställa ursprunglig ägare till fil: " #: src/libdar/filesystem.cpp:2281 #, c-format msgid "Cannot restore permissions of %s : %s" msgstr "Kan ej Ã¥terställe behörigheter för %s : %s" #: src/libdar/filesystem.cpp:2367 #, c-format msgid "Failed to open %S while checking for nodump flag: %s" msgstr "Misslyckades att öppna %S medan kontroll av nodump-flagga gjordes: %s" #: src/libdar/filesystem.cpp:2381 #, c-format msgid "Cannot get ext2 attributes (and nodump flag value) for %S : %s" msgstr "Kan ej fÃ¥ ext2-attribut (och nodump-flaggvärde) för %S : %s" #: src/libdar/filesystem.cpp:2414 #, c-format msgid "Cannot get inode information for %s : %s" msgstr "Kan ej fÃ¥ inodinformation för %s : %s" #: src/libdar/filesystem.cpp:2443 #, c-format msgid "" "Replacing %s in the -R option by the directory pointed to by this symbolic " "link: " msgstr "" "Ã…terställer %s i -R alternativet genom den mapp, pekad pÃ¥ frÃ¥n denna " "symboliska länk: " #: src/libdar/filesystem.cpp:2446 #, c-format msgid "" "The given path %s must be a directory (or symbolic link to an existing " "directory)" msgstr "" "Den uppgivna sökvägen %s mÃ¥ste vara en mapp (eller en symbolisk länk till en " "befintlig mapp)" #: src/libdar/tronc.cpp:256 src/libdar/tronc.cpp:298 msgid "Cannot skip to the current position in \"tronc\"" msgstr "Kan ej hoppa till aktuell position i \"tronc\"" #: src/libdar/tronc.cpp:310 msgid "Tried to write out of size limited file" msgstr "Försökte skriva 'out of size' begränsad fil" #: src/libdar/cat_file.cpp:394 msgid "cannot provide data from a \"not saved\" file object" msgstr "kan inte förse data frÃ¥n en \"not saved\"-filobjekt" #: src/libdar/cat_file.cpp:397 msgid "data has been cleaned, object is now empty" msgstr "data har rensats, objekt är nu tomt" #: src/libdar/cat_file.cpp:656 msgid "can't read data CRC: No escape mark found for that file" msgstr "kan ej läsa CRC: inget escape-märke hittat för denna fil" #: src/libdar/cat_file.cpp:704 #, c-format msgid "not same size: %i <--> %i" msgstr "inte samma storlek: %i <--> %i" #: src/libdar/cat_file.cpp:753 #, c-format msgid "different file data, offset of first difference is: %i" msgstr "" #: src/libdar/cat_file.cpp:761 msgid "" "Same data but CRC value could not be verified because we did not guessed " "properly its width (sequential read restriction)" msgstr "" "Samma data men CRC-värdet kunde inte verifieras, ty vi gissade inte korrekt " "dess bredd (sekvensiell läsbegränsning)" #: src/libdar/cat_file.cpp:763 msgid "Same data but stored CRC does not match the data!?!" msgstr "Samma data men lagrat CRC matchar inte data!?!" #: src/libdar/cat_file.cpp:815 msgid "" "CRC difference concerning file's data (comparing with an isolated catalogue)" msgstr "" #: src/libdar/crypto_asym.cpp:86 src/libdar/crypto_asym.cpp:139 #: src/libdar/crypto_asym.cpp:175 src/libdar/crypto_asym.cpp:233 #: src/libdar/crypto_asym.cpp:292 msgid "Unexpected error reported by GPGME: " msgstr "" #: src/libdar/crypto_asym.cpp:137 msgid "Key found but users are not all trusted" msgstr "" #: src/libdar/crypto_asym.cpp:169 msgid "No data to decrypt" msgstr "" #: src/libdar/crypto_asym.cpp:171 #, fuzzy msgid "Invalid Cipher text" msgstr "Ogiltigt arkivnummer: " #: src/libdar/crypto_asym.cpp:173 msgid "Failed retreiving passphrase" msgstr "" #: src/libdar/crypto_asym.cpp:188 #, fuzzy msgid "Failed creating GPGME context: " msgstr "Misslyckades med att notera hash: " #: src/libdar/crypto_asym.cpp:192 msgid "Failed setting GPGME context with OpenPGP protocol: " msgstr "" #: src/libdar/crypto_asym.cpp:306 #, c-format msgid "No valid signing key could be find for %S" msgstr "" #: src/libdar/crypto_asym.cpp:308 #, c-format msgid "No valid encryption key could be find for %S" msgstr "" #: src/libdar/crypto_asym.cpp:319 msgid "No signatory remain with a valid key, signing is impossible, aborting" msgstr "" #: src/libdar/crypto_asym.cpp:321 msgid "" "No recipient remain with a valid key, encryption is impossible, aborting" msgstr "" #: src/libdar/crypto_asym.cpp:394 #, c-format msgid "Passphrase required for key %s :" msgstr "" #: src/libdar/crypto_asym.cpp:415 msgid "Error, invalid passphrase given, try again:" msgstr "" #: src/libdar/crypto_asym.cpp:423 #, fuzzy msgid "Error, while sending the passphrase to GPGME:" msgstr "Fel vid öppnande av referensarkivet: " #: src/libdar/crypto_asym.cpp:425 msgid "Failed sending the totality of the passphrase to GPGME" msgstr "" #: src/libdar/crypto_asym.cpp:432 msgid "Failed sending CR after the passphrase" msgstr "" #: src/libdar/crypto_sym.cpp:74 msgid "" "Current implementation of blowfish encryption is not compatible with old " "(weak) implementation, use dar-2.3.x software (or other software based on " "libdar-4.4.x) to read this archive" msgstr "" "Aktuell implementering av blowfish-kryptering är ej kompatibel med den gamla " "(svaga) implementeringen. Använd dar-2.3.x programvara (eller annan " "programvara grundad pÃ¥ libdar-4.4.x) för att läsa detta arkiv." #: src/libdar/crypto_sym.cpp:85 src/libdar/crypto_sym.cpp:147 #, c-format msgid "Cyphering algorithm not available in libgcrypt: %s/%s" msgstr "Cyphering-algoritm inte tillgänglig i libgcrypt: %s/%s" #: src/libdar/crypto_sym.cpp:91 src/libdar/crypto_sym.cpp:582 #, c-format msgid "" "Failed retrieving from libgcrypt the block size used by the cyphering " "algorithm: %s/%s" msgstr "" "Misslyckades med att hämta frÃ¥n libgcrypt den blockstorlek använd vid " "cyphering algoritmen: %s/%s" #: src/libdar/crypto_sym.cpp:108 #, c-format msgid "Error while opening libgcrypt key handle: %s/%s" msgstr "Fel vid öppnande av 'libgcrypt key handle': %s/%s" #: src/libdar/crypto_sym.cpp:116 #, c-format msgid "Error while assigning key to libgcrypt key handle: %s/%s" msgstr "Fel vid tilldelning av nyckel till libgcrypts nyckelhanterare: %s/%s" #: src/libdar/crypto_sym.cpp:133 msgid "Missing strong encryption support (libgcrypt)" msgstr "Saknar stöd för stark kryptering (libgcrypt)" #: src/libdar/crypto_sym.cpp:152 #, fuzzy msgid "Failed retrieving from libgcrypt the maximum key length" msgstr "" "Misslyckades med att hämta frÃ¥n libgcrypt den använda nyckellängden: %s/%s" #: src/libdar/crypto_sym.cpp:185 #, fuzzy, c-format msgid "" "Error while opening libgcrypt key handle to check password strength: %s/%s" msgstr "Fel vid öppnande av 'libgcrypt key handle': %s/%s" #: src/libdar/crypto_sym.cpp:197 #, fuzzy, c-format msgid "" "Error while assigning key to libgcrypt key handle to check password " "strength: %s/%s" msgstr "Fel vid tilldelning av nyckel till libgcrypt key handle (essiv): %s/%s" #: src/libdar/crypto_sym.cpp:267 #, c-format msgid "Error while resetting encryption key for a new block: %s/%s" msgstr "Fel vid Ã¥terställning av krypteringsnyckel för ett nytt block: %s/%s" #: src/libdar/crypto_sym.cpp:271 src/libdar/crypto_sym.cpp:295 #, c-format msgid "Error while setting IV for current block: %s/%s" msgstr "Fel vid inställning av IV för aktuellt block: %s/%s" #: src/libdar/crypto_sym.cpp:274 #, c-format msgid "Error while cyphering data: %s/%s" msgstr "Fel vid kodning av data: %s/%s" #: src/libdar/crypto_sym.cpp:280 src/libdar/crypto_sym.cpp:304 msgid "blowfish strong encryption support" msgstr "stöd för 'blowfish' stark kryptering" #: src/libdar/crypto_sym.cpp:298 #, c-format msgid "Error while decyphering data: %s/%s" msgstr "Fel vid dechiffrering av data: %s/%s" #: src/libdar/crypto_sym.cpp:339 #, c-format msgid "Error while generating IV: %s/%s" msgstr "Fel vi skapande av IV: %s/%s" #: src/libdar/crypto_sym.cpp:380 #, c-format msgid "Error! SHA1 not available in libgcrypt: %s/%s" msgstr "Fel SHA1 ej tillgängligt i 'libgcrypt': %s/%s" #: src/libdar/crypto_sym.cpp:386 #, c-format msgid "Error while derivating key from password (HMAC open): %s/%s" msgstr "Fel vid härledning av nyckel frÃ¥n lösenord (HMAC öppnat): %s/%s" #: src/libdar/crypto_sym.cpp:392 #, c-format msgid "Error while derivating key from password (HMAC set key): %s/%s" msgstr "Fel vid härledning av key frÃ¥n lösenord (HMAC set key): %s/%s" #: src/libdar/crypto_sym.cpp:534 #, c-format msgid "Error while creating ESSIV handle: %s/%s" msgstr "Fel vid skapande av ESSIV handle: %s/%s" #: src/libdar/crypto_sym.cpp:542 #, fuzzy, c-format msgid "" "Failed retrieving from libgcrypt the key length to use (essiv key): %s/%s" msgstr "" "Misslyckades med att hämta frÃ¥n libgcrypt den använda nyckellängden: %s/%s" #: src/libdar/crypto_sym.cpp:563 #, c-format msgid "Error while assigning key to libgcrypt key handle (essiv): %s/%s" msgstr "Fel vid tilldelning av nyckel till libgcrypt key handle (essiv): %s/%s" #: src/libdar/crypto_sym.cpp:572 #, fuzzy, c-format msgid "" "Failed retrieving from libgcrypt the block size used by the cyphering " "algorithm (essiv): %s/%s" msgstr "" "Misslyckades med att hämta frÃ¥n libgcrypt den blockstorlek använd vid " "cyphering algoritmen: %s/%s" #: src/libdar/crypto_sym.cpp:627 src/libdar/crypto_sym.cpp:633 #: src/libdar/crypto_sym.cpp:642 src/libdar/crypto_sym.cpp:650 #: src/libdar/crypto_sym.cpp:683 msgid "Library used for blowfish encryption does not respect RFC 3962" msgstr "Bibliotek, som används för blowfish-kryptering respekterar ej RFC 3962" #: src/libdar/wrapperlib.cpp:156 src/libdar/wrapperlib.cpp:161 msgid "Cannot copy a wrapperlib object (NOT IMPLEMENTED)" msgstr "Kan ej kopiera ett 'wrapperlib'-objekt (EJ IMPLEMENTERAT)" #: src/libdar/wrapperlib.cpp:476 msgid "compressReset called but compressInit never called before" msgstr "'compressReset' anropad men 'compressInit' anropades inte först" #: src/libdar/mask_list.cpp:95 #, c-format msgid "Cannot allocate memory for buffer while reading %S" msgstr "Kan ej tilldela buffertminne under läsning av %S" #: src/libdar/mask_list.cpp:121 msgid "Found '" msgstr "Fann '" #: src/libdar/mask_list.cpp:170 msgid "" "Mask_list's prefix must be an absolute path or start with \"\" string " "for archive merging" msgstr "" "Mask_lists prefix mÃ¥ste vara en absolut sökväg eller börja med \"\"-" "sträng vid arkivhopslagning" #: src/libdar/mask_list.cpp:192 #, c-format msgid "" "Error met while reading line\n" "\t%S\n" " from file %S: %S" msgstr "" "Fel pÃ¥träffat vid läsning av rad\n" "\t%S\n" " frÃ¥n fil %S: %S" #: src/libdar/mask_list.cpp:209 #, c-format msgid "Too much line in file %S (integer overflow)" msgstr "För mycket rad i fil %S (heltalsspill)" #: src/libdar/generic_file_overlay_for_gpgme.cpp:55 #, fuzzy, c-format msgid "Error creating data buffer overlay for GPGME: %s" msgstr "Fel vid läsning av databas %S : " #: src/libdar/generic_file_overlay_for_gpgme.cpp:107 msgid "File offset too large to be stored in off_t type" msgstr "" #: src/libdar/capabilities.cpp:90 #, fuzzy, c-format msgid "Error met while checking for capability %S: %s" msgstr "" "Fel pÃ¥träffat vid läsning av rad\n" "\t%S\n" " frÃ¥n fil %S: %S" #: src/libdar/cat_directory.cpp:133 msgid "" "LAX MODE: Error met building a catalogue entry, skipping this entry and " "continuing. Skipped error is: " msgstr "" "LAX MODE: fel vid skapnde av mapp, hoppar över detta data och fortsätter. " "Överhoppat fel var: " #: src/libdar/cat_directory.cpp:176 #, fuzzy msgid "missing data to build a cat_directory" msgstr "data saknas till att bygga en mapp" #: src/libdar/cat_directory.cpp:425 #, c-format msgid "Cannot remove nonexistent entry %S from catalogue" msgstr "Kan ej flytta obefintligt data %S frÃ¥n katalog" #: src/libdar/cat_directory.cpp:586 msgid "listing() method must be given" msgstr "list()-metod mÃ¥ste anges" #: src/libdar/cat_directory.cpp:593 msgid "argument must be a relative path" msgstr "argumentet mÃ¥ste vara en relativ sökväg" #: src/libdar/crc.cpp:211 src/libdar/crc.cpp:312 msgid "Invalid size for CRC width" msgstr "Ogiltig storlek för CRC-bredd" #: src/libdar/mask.hpp:273 msgid "No mask in the list of mask to operate on" msgstr "Ingen mask i masklistan att jobba med" #: src/libdar/mask.hpp:306 #, fuzzy msgid "No mask to operate on in the list of mask" msgstr "Ingen mask i masklistan att jobba med" #: src/libdar/user_interaction.cpp:116 msgid "Continue? " msgstr "Fortsätta? " #: src/libdar/user_interaction.cpp:217 #, fuzzy msgid "nullptr given as argument of user_interaction_callback()" msgstr "Tomt givet som argument för 'user_interaction_callback'" #: src/libdar/user_interaction.cpp:254 src/libdar/user_interaction.cpp:259 #: src/libdar/user_interaction.cpp:276 src/libdar/user_interaction.cpp:280 #: src/libdar/user_interaction.cpp:297 src/libdar/user_interaction.cpp:301 #: src/libdar/user_interaction.cpp:322 src/libdar/user_interaction.cpp:326 #: src/libdar/user_interaction.cpp:349 src/libdar/user_interaction.cpp:353 #: src/libdar/user_interaction.cpp:370 src/libdar/user_interaction.cpp:374 #: src/libdar/user_interaction.cpp:391 src/libdar/user_interaction.cpp:395 #: src/libdar/user_interaction.cpp:414 src/libdar/user_interaction.cpp:418 #: src/libdar/user_interaction.cpp:437 src/libdar/user_interaction.cpp:441 msgid "No exception allowed from libdar callbacks" msgstr "Inget avbrott tillÃ¥tet frÃ¥n libdar 'callbacks'" #: src/libdar/int_tools.cpp:65 msgid "a binary digit is either 0 or 1" msgstr "en binär siffra är antingen 0 eller 1" #: src/libdar/archive_options.cpp:155 msgid "Cannot get catalogue of reference as it has not been provided" msgstr "Kan ej fÃ¥ referenskatalog dÃ¥ den ej har lämnats" #: src/libdar/archive_options.cpp:173 msgid "Error, catalogue of reference has not been provided" msgstr "Fel, referenskatalog har aj lämnats" #: src/libdar/archive_options.cpp:1182 src/libdar/archive_options.cpp:1189 msgid "No mask available" msgstr "" #: src/libdar/header.cpp:103 src/libdar/header.cpp:111 #: src/libdar/header.cpp:114 src/libdar/header.cpp:116 msgid "Reached end of file while reading slice header" msgstr "NÃ¥tt filslut vid läsning av delsäkerhetskopiehuvud" #: src/libdar/header.cpp:130 src/libdar/header.cpp:152 msgid "" "LAX MODE: slice size is not possible to read, (lack of virtual memory?), " "continuing anyway..." msgstr "" "Lax MODE: delsäkerhetskopiestorlek ej möjlig att läsa, (brist pÃ¥ virtuellt " "minne?); fortsätter hur som helst..." #: src/libdar/header.cpp:167 msgid "" "LAX MODE: first slice size is not possible to read, (lack of virtual " "memory?), continuing anyway..." msgstr "" "LAX MODE: första delsäkerhetskopiestorlek är ej möjlig att läsa, (brist pÃ¥ " "virtuellt minne?), fortsätter hur som helst..." #: src/libdar/header.cpp:180 msgid "" "Archive format older than \"08\" (release 2.4.0) cannot be read through a " "single pipe. It only can be read using dar_slave or normal plain file (slice)" msgstr "" "Arkivformat äldre än \"08\" (utgÃ¥va 2.4.0) kan ej läsas genom ett ensamt " "rör. Det kana bara läsas genom dar_slave eller normal planfilsmetod" #: src/libdar/header.cpp:182 msgid "" "LAX MODE: first slice size is not possible to read, continuing anyway..." msgstr "" "LAX MODE: första delsäkerhetskopiestorlek är ej möjlig att läsa, fortsätter " "hur som helst..." #: src/libdar/header.cpp:197 msgid "Badly formatted SAR header (unknown TLV type in slice header)" msgstr "" "Felaktigt formaterad SAR-huvud (okänd TLV-typ i delsäkerhetskopiehuvud)" #: src/libdar/header.cpp:200 msgid "LAX MODE: Unknown data in slice header, ignoring and continuing" msgstr "" "LAX MODE: Okänt data i delsäkerhetskopiehuvud, ignorerar och fortsätter" #: src/libdar/header.cpp:368 msgid "incomplete data set name found in a slice header" msgstr "ej komplett datamängdsnamn hittat i ett delsäkerhetskopiehuvud" #: src/libdar/header.cpp:372 #, c-format msgid "" "Unknown entry found in slice header (type = %d), option not supported. The " "archive you are reading may have been generated by a more recent version of " "libdar, ignore this entry and continue anyway?" msgstr "" "Okänd post hittad i delsäkerhetskopiehuvud (typ= = %d), alternativ ej stött. " "Arkivet du läser kan ha skapats av en senare version av 'libdar', ignorera " "denna post och fortsätta hur som helst?" #: src/libdar/hash_fichier.cpp:96 #, c-format msgid "" "Error while initializing hash: Hash algorithm not available in libgcrypt: %s/" "%s" msgstr "" "Fel vid initiering av hash: Hash algoritm ej tillgänglig i libgcrypt: %s/%s" #: src/libdar/hash_fichier.cpp:100 #, c-format msgid "Error while creating hash handle: %s/%s" msgstr "Fel vid skapande av hash handle: %s/%s" #: src/libdar/hash_fichier.cpp:102 src/libdar/hash_fichier.cpp:138 #: src/libdar/hash_fichier.cpp:153 msgid "" "Missing hashing algorithms support (which is part of strong encryption " "support, using libgcrypt)" msgstr "" "Saknar stöd för 'hashing'-algoritm (vilket är en del av stödet för stark " "kryptering genom 'libgcrypt'" #: src/libdar/hash_fichier.cpp:186 msgid "Failed writing down the hash: " msgstr "Misslyckades med att notera hash: " #: src/libdar/cat_device.cpp:94 src/libdar/cat_device.cpp:97 msgid "missing data to build a special device" msgstr "data saknas till att skapa en specialenhet" #: src/libdar/cat_device.cpp:145 #, c-format msgid "devices have not the same major number: %d <--> %d" msgstr "enheter har inte samma 'major'-tal: %d <--> %d" #: src/libdar/cat_device.cpp:147 #, fuzzy, c-format msgid "devices have not the same minor number: %d <--> %d" msgstr "enheter har inte samma 'minor'-tal: %d <--> %d" #: src/libdar/sar.cpp:165 #, c-format msgid "" "Error met while opening the last slice: %S. Trying to open the archive using " "the first slice..." msgstr "" "Fel vid öppning av sista delsäkerhetskopia: %S. Försöker öppna arkivet genom " "att använda första delsäkerhetskopia..." #: src/libdar/sar.cpp:215 msgid "File size too small" msgstr "Filstorlek för liten" #: src/libdar/sar.cpp:219 msgid "First file size too small" msgstr "Första filens storlek för liten" #: src/libdar/sar.cpp:709 msgid "LAX MODE: Caught exception: " msgstr "LAX MODE: fÃ¥ngade avbrott: " #: src/libdar/sar.cpp:710 #, fuzzy, c-format msgid "" "LAX MODE: %S is missing, You have the possibility to create a zero byte " "length file under the name of this slice, to replace this missing file. This " "will of course generate error messages about the information that is missing " "in this slice, but at least libdar will be able to continue. Can we continue " "now?" msgstr "" "LAX MODE: %s saknas. Du har möjlighet att skapa en fil med längden 0 byte " "med namn pÃ¥ denna delsäkerhetskopia för att ersätta den saknade filen. Detta " "kommer naturligtvis att skapa felmeddelanden om den information, som saknas " "i denna delsäkerhetskopia, men Ã¥tminstone 'libdar' kommer att kunna " "fortsätta. Kan vi fortsätta nu?" #: src/libdar/sar.cpp:722 #, fuzzy, c-format msgid "%S is required for further operation, please provide the file." msgstr "%s krävs för ytterligare Ã¥tgärd, vänligen förse med filen." #: src/libdar/sar.cpp:724 #, fuzzy, c-format msgid "" "%S is required for further operation, please provide the file if you have it." msgstr "%s krävs för ytterligare Ã¥tgärd, vänligen förse med filen." #: src/libdar/sar.cpp:729 #, fuzzy, c-format msgid "Failed reading slice %S: " msgstr "Fel vid läsning frÃ¥n fil: " #: src/libdar/sar.cpp:766 #, fuzzy, c-format msgid "%S has a bad or corrupted header, please provide the correct file." msgstr "%s har ett felaktigt huvud, ge den korrekta filen." #: src/libdar/sar.cpp:770 #, fuzzy, c-format msgid "" "LAX MODE: %S has a bad or corrupted header, trying to guess original values " "and continuing if possible" msgstr "" "LAX MODE: %s har felaktigt eller förstört huvud, försöker att gissa " "ursprungliga värden och fortsätter om möjligt" #: src/libdar/sar.cpp:780 #, fuzzy, c-format msgid "" "%S is not a valid file (wrong magic number), please provide the good file." msgstr "" "%s är inte en giltig fil (felaktigt magiskt tal), förse med den rätta filen." #: src/libdar/sar.cpp:784 #, fuzzy, c-format msgid "" "LAX MODE: In spite of its name, %S does not appear to be a dar slice, " "assuming a data corruption took place and continuing" msgstr "" "LAX MODE: Trots sitt namn, sÃ¥ verkar inte %s vara en dar-delsäkerhetskopia, " "antar data förstört och fortsätter" #: src/libdar/sar.cpp:788 msgid "" "This is an old archive, it can only be opened starting by the first slice" msgstr "" "Detta är ett gammalt arkiv, det kan bara öppnas genom att börja med den " "första delsäkerhetskopian" #: src/libdar/sar.cpp:815 msgid "" "LAX MODE: Due to probable data corruption, dar could not determine the " "correct size of slices in this archive. For recent archive, this information " "is duplicated in each slice, do you want to try opening another slice to get " "this value if present?" msgstr "" "LAX MODE: PÃ¥ grund av trolig dataförstörelse, kan 'dar' inte avgöra det " "rätta storleken pÃ¥ delsäkerhetskopian i detta arkiv. För senare arkiv är " "denna information dubblerad i varje delsäkerhetskopia, vill du försöka att " "öppna en annan delsäkerhetskopia för att fÃ¥ tag pÃ¥ detta värde om det finns?" #: src/libdar/sar.cpp:819 msgid "LAX MODE: Please provide the slice number to read: " msgstr "LAX MODE: Skriv in numret pÃ¥ den delsäkerhetskopia som skall läsas: " #: src/libdar/sar.cpp:827 msgid "LAX MODE: Please provide an strictly positive integer number" msgstr "LAX MODE: Skriv in ett positivt heltal" #: src/libdar/sar.cpp:833 #, c-format msgid "LAX MODE: opening slice %i to read its slice header" msgstr "" "LAX MODE: öppnar delsäkerhetskopia %i för att läsa dess " "delsäkerhetskopiehuvud" #: src/libdar/sar.cpp:835 #, c-format msgid "LAX MODE: closing slice %i, header properly fetched" msgstr "LAX MODE: stänger delsäkerhetskopia %i, huvud hämtat korrekt" #: src/libdar/sar.cpp:841 msgid "" "LAX MODE: In spite of a the absence of a known slice size, continuing anyway" msgstr "" "LAX MODE: Trots frÃ¥nvaron av en känd delsäkerhetskopiestorlek, fortsätter " "hur som helst" #: src/libdar/sar.cpp:848 msgid "Incoherent slice header: First slice size too small" msgstr "" "Felaktig delsäkerhetskopiehuvud: första delsäkerhetskopiestorlek för liten" #: src/libdar/sar.cpp:850 msgid "incoherent slice header: Slice size too small" msgstr "Felaktig delsäkerhetskopiehuvud: delsäkerhetskopiestorlek för liten" #: src/libdar/sar.cpp:856 #, fuzzy, c-format msgid "Error opening %S : " msgstr "Fel vid öppning av %s : " #: src/libdar/sar.cpp:856 msgid " . Retry ?" msgstr " : Försöka igen ?" #: src/libdar/sar.cpp:867 msgid " is a slice from another backup, please provide the correct slice." msgstr " är en del frÃ¥n en annan säkerhetskopia, hämta den rätta delen." #: src/libdar/sar.cpp:872 msgid "" "LAX MODE: internal name of the slice leads dar to consider it is not member " "of the same archive. Assuming data corruption occurred and relying on the " "filename of this slice as proof of its membership to the archive" msgstr "" "LAX MODE: det interna namnet pÃ¥ delsäkerhetskopian leder 'dar' till att " "besluta att den inte är frÃ¥n samma arkiv. Anar dataförstörelse och litande " "pÃ¥ filnamnet pÃ¥ denna delsäkerhetskopia som bevis pÃ¥ dess medlemskap i " "arkivet" #: src/libdar/sar.cpp:897 msgid "" "Data corruption met at end of slice, forbidden flag found at this position" msgstr "" "Data förstört vid slutet pÃ¥ delsäkerhetskopian, förbjuden flagga hittad i " "denna position" #: src/libdar/sar.cpp:903 msgid "Data corruption met at end of slice, unknown flag found" msgstr "" "Data förstört vid slutet pÃ¥ delsäkerhetskopian, förbjuden flagga hittad" #: src/libdar/sar.cpp:918 #, c-format msgid "" "Two different slices (%i and %i) are marked as the last slice of the backup!" msgstr "" "TvÃ¥ olika delsäkerhetskopior (%i och %i) är markerade som den sista " "delsäkerhetskopian i denna säkerhetskopia!" #: src/libdar/sar.cpp:921 #, c-format msgid "" "LAX MODE: slices %i and %i are both recorded as last slice of the archive, " "keeping the higher number as the real last slice" msgstr "" "LAX MODE: delsäkerhetskopior %i och %i är bägge noterade som den sista " "delsäkerhetskopian, behÃ¥ller det högre talet som den verkligt sista " "delsäkerhetskopian" #: src/libdar/sar.cpp:944 #, fuzzy, c-format msgid "Slice %S has an unknown flag (neither terminal nor non_terminal file)." msgstr "" "Delsäkerhetskopia %s har en okänd flagga (varken terminal eller icke-" "terminal fil)." #: src/libdar/sar.cpp:954 #, fuzzy, c-format msgid "" "Due to data corruption, it is not possible to know if slice %S is the last " "slice of the archive or not. I need your help to figure out this. At the " "following prompt please answer either one of the following words: \"last\" " "or \"notlast\" according to the nature of this slice (you can also answer " "with \"abort\" to abort the program immediately): " msgstr "" "PÃ¥ grind av dataförstörelse, är det omöjligt att veta om delsäkerhetskopia " "%s är den sista i arkivet eller ej. behöver hjälp för att ta reda pÃ¥ detta. " "Vid följande frÃ¥ga svara med ett av följande ord: \"last\" eller \"notlast\" " "enligt egenskapen för denna delsäkerhetskopia. Du kan även svara \"abort\" " "för att avsluta programmet direkt: " #: src/libdar/sar.cpp:956 src/libdar/sar.cpp:960 msgid "last" msgstr "sista" #: src/libdar/sar.cpp:956 msgid "notlast" msgstr "ej sista" #: src/libdar/sar.cpp:956 src/libdar/sar.cpp:958 msgid "abort" msgstr "avbryt" #: src/libdar/sar.cpp:972 msgid "" "LAX MODE: Slice flag corrupted, but a slice of higher number has been seen, " "thus the header flag was surely not indicating this slice as the last of the " "archive. Continuing" msgstr "" "LAX MODE: delsäkerhetskopieflagga förstörd, men en delsäkerhetskopia med " "högre nummer har setts, sÃ¥lunda indikerade denna delsäkerhetskopieflagga " "inte denna delsäkerhetskopia som den sista i arkivet. Fortsätter" #: src/libdar/sar.cpp:1016 #, c-format msgid "failed openning slice %S: %S. Will try to erase it first, if allowed" msgstr "" #: src/libdar/sar.cpp:1102 msgid "file exists, and DONT_ERASE option is set." msgstr "fil finns, och 'DONT_ERASE'-alternativ är inställt." #: src/libdar/sar.cpp:1107 msgid " is about to be overwritten." msgstr " skall till att skrivas över." #: src/libdar/sar.cpp:1185 msgid "" "First slice size is too small to even just be able to drop the slice header" msgstr "" "Första delsäkerhetskopiestorlek är för liten för att till och med kunna pÃ¥ " "plats med delsäkerhetskopiehuvudet" #: src/libdar/sar.cpp:1187 msgid "Slice size is too small to even just be able to drop the slice header" msgstr "" "Delsäkerhetskopiestorlek är för liten för att till och med kunna pÃ¥ plats " "med delsäkerhetskopiehuvudet" #: src/libdar/sar.cpp:1250 msgid "Finished writing to file " msgstr "Klar med skrivning till fil " #: src/libdar/sar.cpp:1250 msgid ", ready to continue ? " msgstr ", beredd att fortsätta ? " #: src/libdar/sar.cpp:1255 msgid "" "If you really want to abort the archive creation hit CTRL-C, then press " "enter." msgstr "Om du verkligen vill stoppa dar, tryck CTLR-C och sedan vagnretur " #: src/libdar/sar.cpp:1287 msgid "file not open" msgstr "fil ej öppen" #: src/libdar/sar.cpp:1321 msgid "The last file of the set is not present in " msgstr "Den sista filen i omgÃ¥ngen finns inte i " #: src/libdar/sar.cpp:1321 msgid " , please provide it." msgstr " . hämta den." #: src/libdar/sar.cpp:1335 #, c-format msgid "" "No backup file is present in %S for archive %S, please provide the last file " "of the set." msgstr "" "Ingen säkerhetskopiefil finns i %S för arkiv %S, ge de n sista filen i " "mängden" #: src/libdar/escape_catalogue.cpp:89 msgid "" "incoherent data after escape sequence, cannot read internal data set label" msgstr "" "ej översenstämmande data efter escape-sekvens, kan ej läsa intern " "datamängsetikett" #: src/libdar/escape_catalogue.cpp:99 #, fuzzy msgid "Could not find tape mark for the internal catalogue" msgstr "kunde inte hitta den interna datamängdsetikettens escape-sekvens " #: src/libdar/escape_catalogue.cpp:429 msgid "" "Escape sequences used for reading lead the archive to place some files out " "of the specified root. To overcome this problem, try reading the archive in " "direct mode (not using sequential reading), try repairing the archive using " "Parchive if redundancy data has been created or in last resort try using the " "lax mode" msgstr "" "Escape-sekvens använd för läsning leder till att arkivet placerar vissa " "filer utanför den specificerade roten. För att klara detta problem, försök " "att läsa arkivet i direkt mode (använd ej sekvensiell läsning), försök " "reaparera arkivet med hlälp av Parchive om redundanta data har skapats eller " "som sista utväg försök använda lax mode" #: src/libdar/escape_catalogue.cpp:432 msgid "" "LAX MODE: Archive directory structure is corrupted, it would lead to place " "some files out of the specified root directory. Restoring different " "directory contents at the root not out of it, which will put files of " "different directories in the specified root directory" msgstr "" "LAX MODE: mappstrukturen i arkivet är förstört, det skulle leda till vissa " "filer placeras utanför den angivna rotmappen. Ã…terställning av andra mappars " "innehÃ¥ll vid roten, ej utanför den, vilket kommer att lägga filer frÃ¥n andra " "mappar i den angivna rotmappen." #: src/libdar/escape_catalogue.cpp:447 msgid "" "LAX MODE: found unknown catalogue entry, assuming data corruption occurred. " "Skipping to the next entry, this may lead to improper directory structure " "being restored, if the corrupted data was a directory" msgstr "" "LAX MODE: hittat okänd katalogpost antar data förstört. Hoppar över till " "nästa post, detta kan leda till att felaktig mappstruktur Ã¥terställs om " "förstört data var en mapp" #: src/libdar/escape_catalogue.cpp:454 msgid "Corrupted entry following an escape mark in the archive" msgstr "Förstörd post följande ett escape-märke i arkivet" #: src/libdar/escape_catalogue.cpp:483 msgid "" "Uncompleted archive! Assuming it has been interrupted during the backup " "process. If an error has been reported just above, simply ignore it, this is " "about the file that was saved at the time of the interruption." msgstr "" "Ej komplett arkiv! Antar det har blivit avbrutet vid säkerhetskopieringen. " "Om ett fel har precis rapporterats ovan, strunta i det helt enkelt, detta är " "om den fil, som sparades vid tidpunkten för avbrottet." #: src/libdar/escape_catalogue.cpp:518 msgid "Cannot extract from the internal catalogue the list of files to remove" msgstr "" "Kan ej extrahera frÃ¥n den interna katalogen lista med filer, som skall tas " "bort " #: src/libdar/escape_catalogue.cpp:591 msgid "" "Archive internal catalogue is properly signed but its content does not match " "the tape marks used so far for sequentially reading. Possible data " "corruption or archive compromission occurred! if data extracted in " "sequential read mode does not match the data extracted in direct access " "mode, consider the sequential data has been been modified after the archive " "has been generated" msgstr "" #: src/libdar/escape_catalogue.cpp:729 msgid "" "Resetting the sequential reading process of the archive contents while it is " "not finished, will make all data unread so far becoming inaccessible" msgstr "" "Nollställning av den sekvensiella läsprocessen av arkivinnehÃ¥llet medan den " "inte är avslutad, kommer att göra alla data oläsbara och sÃ¥ lÃ¥ngt oÃ¥tkomliga" #: src/libdar/statistics.cpp:81 #, fuzzy msgid "Error while initializing \"mutex\" for class \"statistics\": " msgstr "Fel vid initialisering \"mutex\" för klass-statistik: " #: src/libdar/real_infinint.cpp:69 src/libdar/limitint.hpp:269 msgid "Reached end of file before all data could be read" msgstr "Kommit till filslut innan alla data kunnat läsas" #: src/libdar/real_infinint.cpp:82 src/libdar/limitint.hpp:282 msgid "Badly formed \"infinint\" or not supported format" msgstr "Felaktigt format 'infinint' eller ej understött format" #: src/libdar/real_infinint.cpp:246 src/libdar/limitint.hpp:420 msgid "" "Subtracting an \"infinint\" greater than the first, \"infinint\" cannot be " "negative" msgstr "" "Subtraktion av en 'infinint' större än det första, 'infinint' kan ej vara " "negativt" #: src/libdar/real_infinint.cpp:839 src/libdar/limitint.hpp:461 #: src/libdar/limitint.hpp:470 msgid "Division by zero" msgstr "Division med noll" #: src/libdar/integers.cpp:36 #, c-format msgid "%s type length is not %d byte(s) but %d" msgstr "%s typlängd är ej %d byte(s) men %d" #: src/libdar/integers.cpp:44 #, c-format msgid "%s type is not a signed type as expected" msgstr "%s type är ej ett tal med tecken som förväntat" #: src/libdar/integers.cpp:46 #, c-format msgid "%s type is not an unsigned type as expected" msgstr "%s typ är ej tal utan tecken som förväntat" #: src/libdar/integers.cpp:101 #, c-format msgid "" "type %s is neither big nor little endian! Do not know how to handle integer " "in a portable manner on this host, aborting" msgstr "" "typ %s är varken big eller little endian! FörstÃ¥r ej hantera heltal pÃ¥ ett " "flyttbart sätt pÃ¥ denna värd, avbryter" #: src/libdar/integers.cpp:154 msgid "incoherent endian between U_16 and U_32" msgstr "osammanhängande endian mellan U_16 och U_32" #: src/libdar/integers.cpp:156 msgid "incoherent endian between U_16 and U_64" msgstr "osammanhängande endian mellan U_16 och U_64" #: src/libdar/integers.cpp:158 msgid "incoherent endian between U_16 and U_I" msgstr "osammanhängande endian mellan U_16 och U_I" #: src/libdar/filesystem_specific_attribute.hpp:243 msgid "true" msgstr "" #: src/libdar/filesystem_specific_attribute.hpp:243 msgid "false" msgstr "" #: src/libdar/archive.hpp:146 msgid "Archive copy constructor is not implemented" msgstr "\"Archive copy constructor\" är ej implementerad" #: src/libdar/archive.hpp:147 msgid "Archive assignment operator is not implemented" msgstr "\"Archive assignment operator\" är ej implementerad" #: src/libdar/database_header.cpp:87 msgid "Cannot create database, file exists" msgstr "Kan ej skapa databas, fil finns" #: src/libdar/database_header.cpp:128 #, c-format msgid "Error reading database %S : " msgstr "Fel vid läsning av databas %S : " #: src/libdar/database_header.cpp:135 msgid "" "The format version of this database is too high for that software version, " "use a more recent software to read or modify this database" msgstr "" "Formatversionen för denna databas är för hög för denna programvaruversion, " "använd en senare programvara för att läsa eller ändra denna databas" #: src/libdar/database_header.cpp:138 msgid "Unknown header option in database, aborting\n" msgstr "Okänt alternativ i databashuvud, avbryter\n" #: src/libdar/cat_etoile.cpp:44 msgid "Hard links of directories are not supported" msgstr "HÃ¥rda länkar för mappar stöds ej" #: src/libdar/path.cpp:61 src/libdar/path.cpp:83 msgid "Empty string is not a valid path" msgstr "En tom sträng är ej en giltig sökväg" #: src/libdar/path.cpp:91 #, c-format msgid "%S is an not a valid path: %S" msgstr "%S är ej en giltig sökväg: %S" #: src/libdar/path.cpp:195 #, fuzzy msgid "Cannot add an absolute path" msgstr "Kan ej lägga till en etikett till en tom stack" #: src/libdar/path.cpp:328 msgid "Empty string as subdirectory does not make a valid path" msgstr "En tom sträng som undermapp utgör inte en giltig sökväg" #: src/libdar/storage.cpp:85 msgid "Not enough data to initialize storage field" msgstr "Inte tillräckligt med data för att initiera lagringsfält" #: src/libdar/storage.cpp:110 msgid "Asking for an element out of array" msgstr "Begäran om ett element utanför en tabell" #: src/libdar/storage.cpp:162 msgid "The iterator is not indexing the object it has been asked to write to" msgstr "" "'Iteratorn' indexerar inte det objekt den har blivit ombedd att skriva till" #: src/libdar/storage.cpp:196 msgid "The iterator is not indexing the object it has been asked to read from" msgstr "" "'Iteratorn' indexerar inte det objekt den har blivit ombedd att läsa frÃ¥n" #: src/libdar/storage.cpp:509 msgid "The iterator is not indexing the object it has been defined for" msgstr "'Iteratorn' indexerar inte det objekt som den har definierats för" #: src/libdar/storage.cpp:763 src/libdar/storage.cpp:828 msgid "Iterator does not point to data" msgstr "'Iteratorn' pekar inte pÃ¥ data" #: src/libdar/storage.cpp:822 msgid "Reference storage of the iterator is empty or non existent" msgstr "Referenslager hos iteratorn är tomt eller finns ej" #: src/libdar/storage.cpp:839 msgid "The iterator position is not inside the storage of reference" msgstr "Iteratorns position är ej innanför referensens lagringsutrymme" #: src/libdar/entrepot.hpp:79 #, fuzzy msgid "root's entrepot must be an absolute path: " msgstr "argumentet mÃ¥ste vara en relativ sökväg" #: src/libdar/database.cpp:114 msgid "Badly formatted database" msgstr "DÃ¥ligt formaterad databas" #: src/libdar/database.cpp:162 #, fuzzy msgid "Cannot write down a read-only database" msgstr "Kan ej synka skrivning med en skrivskyddad allmän fil." #: src/libdar/database.cpp:210 msgid "Empty string is an invalid archive basename" msgstr "Tom sträng är ett ogiltigt arkivabasnamn" #: src/libdar/database.cpp:212 msgid "Cannot add another archive, database is full" msgstr "Kan ej lägga till ytterligare arkiv, databasen full" #: src/libdar/database.cpp:238 src/libdar/database.cpp:240 msgid "Incorrect archive range in database" msgstr "Felaktigt arkivomrÃ¥de i databasen" #: src/libdar/database.cpp:267 src/libdar/database.cpp:286 #: src/libdar/database.cpp:403 msgid "Non existent archive in database" msgstr "Icke existerande arkiv i databasen" #: src/libdar/database.cpp:306 src/libdar/database.cpp:308 msgid "Invalid archive number: " msgstr "Ogiltigt arkivnummer: " #: src/libdar/database.cpp:363 #, fuzzy, c-format msgid "dar path : %S\n" msgstr "" "\n" "dar sökväg : %S\n" #: src/libdar/database.cpp:364 #, fuzzy, c-format msgid "dar options : %S\n" msgstr "" "dar-alternativ : %S\n" "\n" #: src/libdar/database.cpp:365 #, fuzzy, c-format msgid "database version: %d\n" msgstr "Nytt databasnamn: " #: src/libdar/database.cpp:367 #, c-format msgid "archive # | path | basename\n" msgstr "arkiv # | sökväg | basnamn\n" #: src/libdar/database.cpp:377 msgid "" msgstr "" #: src/libdar/database.cpp:427 msgid "Invalid path, path must be relative" msgstr "Ogiltig sökväg, sökväg mÃ¥ste vara relativ" #: src/libdar/database.cpp:433 src/libdar/database.cpp:438 #: src/libdar/database.cpp:442 msgid "Non existent file in database" msgstr "Icke existerande fil i databas" #: src/libdar/database.cpp:469 #, c-format msgid " archive # | most recent/total data | most recent/total EA\n" msgstr " arkiv # | senaste/total data | senaste/total EA\n" #: src/libdar/database.cpp:470 #, c-format msgid "--------------+-------------------------+-----------------------\n" msgstr "--------------+-------------------------+-----------------------\n" #: src/libdar/database.cpp:503 msgid "Checking chronological ordering of files between the archives..." msgstr "Kontrollerar datumordning hos filer mellan arkiv..." #: src/libdar/database.cpp:526 msgid "File recorded as removed at this date in database: " msgstr "Fil noterad som borttagen vid detta datum i databasen: " #: src/libdar/database.cpp:530 msgid "File not found in database: " msgstr "Fil ej funnen i databas: " #: src/libdar/database.cpp:534 #, fuzzy msgid "" "File found in database but impossible to restore (only found \"unchanged\" " "in differential backups): " msgstr "" "Fil hittad i databasen, men omöjlig att Ã¥terställe (bara hittad som " "\"oförändrad\" i differentiella säkerhetskopior)" #: src/libdar/database.cpp:556 #, fuzzy msgid "" "Extended Attribute of file found in database but impossible to restore (only " "found \"unchanged\" in differential backups): " msgstr "" "Extended Attribute för fil hittad i databasen, men omöjlig att Ã¥terställe " "(bara hittad som \"oförändrad\" i differentiella säkerhetskopior)" #: src/libdar/database.cpp:578 #, c-format msgid "%S did not exist before specified date and cannot be restored" msgstr "%S fanns ej före specificerat datum och kan ej Ã¥terställas" #: src/libdar/database.cpp:600 #, fuzzy, c-format msgid "" "Either archives in database are not properly tidied, or file last " "modification date has been artificially set to an more ancient date. This " "may lead improper Extended Attribute restoration for inode %S" msgstr "" "Antingen är arkiven i databasen inte ordentligt vÃ¥rdade eller sÃ¥ har filens " "senaste ändringsdatum satt pÃ¥ konstgjord väg till ett äldre datum. Detta kan " "leda till att Ã¥terställning av Extended Attribute blir felaktig" #: src/libdar/database.cpp:620 #, c-format msgid "Cannot restore file %S : non existent file in database" msgstr "Kan ej Ã¥terställa fil %S : icke existerande fil i databasen" #: src/libdar/database.cpp:676 msgid "Error while restoring the following files: " msgstr "Fel vid Ã¥terställande av följande filer: " #: src/libdar/database.cpp:685 msgid "Cannot restore any file, nothing done" msgstr "Kan ej Ã¥terställa nÃ¥gon fil, inget utfört" #: src/libdar/database.cpp:698 src/libdar/database.cpp:706 #, fuzzy, c-format msgid "Invalid archive number: %d" msgstr "Ogiltigt arkivnummer: " #: src/libdar/ea_filesystem.cpp:183 #, fuzzy, c-format msgid "Error while adding EA %s : %s" msgstr "Fel vi skapande av IV: %s/%s" #: src/libdar/ea_filesystem.cpp:214 #, fuzzy, c-format msgid "Error while removing %s : %s" msgstr "Fel vid filöppning %s : %s" #: src/libdar/ea_filesystem.cpp:246 src/libdar/ea_filesystem.cpp:274 #, c-format msgid "Error reading attribute %s of file %s : %s" msgstr "Fel vid läsning av attribut %s hos fil %s : %s" #: src/libdar/ea_filesystem.cpp:330 src/libdar/ea_filesystem.cpp:348 #, c-format msgid "Error retrieving EA list for %s : %s" msgstr "Fel vid räddning av EA-lista för %s : %s" #: src/libdar/terminateur.cpp:133 msgid "Badly formatted terminator, cannot extract catalogue location: " msgstr "Fel utformat avslutning, kan ej extrahera katalogplats: " #: src/dar_suite/line_tools.cpp:90 src/dar_suite/line_tools.cpp:108 msgid "Index out of range" msgstr "Index utanför giltigt omrÃ¥de" #: src/dar_suite/line_tools.cpp:237 msgid "Syntax error in --retry-on-change argument: " msgstr "Syntaxfel i --retry-on-change argument: " #: src/dar_suite/line_tools.cpp:252 msgid "Unknown TLV record type" msgstr "Okänd TLV-posttyp" #: src/dar_suite/line_tools.cpp:293 src/dar_suite/line_tools.cpp:323 msgid "Unbalanced parenthesis in expression: " msgstr "Obalanserade parenteser i uttryck: " #: src/dar_suite/line_tools.cpp:391 #, c-format msgid "Unknown macro %%%d in user comment" msgstr "Okänt makro %%%d i användarkommentar" #: src/dar_suite/line_tools.cpp:583 #, c-format msgid "Invalid number in string: %S" msgstr "Ogiltigt tal i sträng: %S" #: src/dar_suite/line_tools.cpp:819 msgid "unknown cryptographic algorithm: " msgstr "okänd krypteringsalgoritm" #: src/dar_suite/line_tools.cpp:839 #, c-format msgid "" "| Signature Status| Key Status | Finger Print " "| Signature Date |" msgstr "" #: src/dar_suite/hide_file.cpp:33 msgid "hide_file cannot be initialized with write-only file" msgstr "'hide_file' kan ej initieras med 'write-only'-fil" #: src/dar_suite/dar_cp.cpp:131 #, c-format msgid "usage : %s \n" msgstr "användning ; %s \n" #: src/dar_suite/dar_cp.cpp:143 src/dar_suite/dar_slave.cpp:286 #: src/dar_suite/dar_xform.cpp:581 src/dar_suite/dar_manager.cpp:912 #: src/dar_suite/command_line.cpp:2170 #, c-format msgid " compiled the %s with %s version %s\n" msgstr " kompilerad den %s med %s version %s\n" #: src/dar_suite/dar_cp.cpp:144 src/dar_suite/dar_slave.cpp:287 #: src/dar_suite/dar_xform.cpp:582 src/dar_suite/dar_manager.cpp:913 #: src/dar_suite/command_line.cpp:2171 #, c-format msgid " %s is part of the Disk ARchive suite (Release %s)\n" msgstr " %s är en del av Disk ARchieve sviten (UtgÃ¥va %s)\n" #: src/dar_suite/dar_cp.cpp:145 #, c-format msgid " %s comes with ABSOLUTELY NO WARRANTY; for details type `dar -W'." msgstr " %s medför ABSOLUT INGA GARANTIER; för detaljer skriv 'dar -W'." #: src/dar_suite/dar_cp.cpp:146 msgid " This is free software, and you are welcome to redistribute it under" msgstr "" " Detta är fri programvara, och du är välkommen att Ã¥terdistribuera den under" #: src/dar_suite/dar_cp.cpp:147 msgid "" " certain conditions; type `dar -L | more' for details.\n" "\n" msgstr " vissa villkor; skriv 'dar -L | more' för detaljer.\n" #: src/dar_suite/dar_cp.cpp:151 msgid "Unexpected exception from libdar" msgstr "Oväntat avbrott frÃ¥n libdar" #: src/dar_suite/dar_cp.cpp:168 #, c-format msgid "Memory allocation failed : %s" msgstr "Minnestilldelning misslyckades : %s" #: src/dar_suite/dar_cp.cpp:184 #, c-format msgid "Cannot open source file : %s" msgstr "Kan ej öppna källfil : %s" #: src/dar_suite/dar_cp.cpp:195 #, c-format msgid "Cannot open destination file : %s" msgstr "Kan ej öppna mÃ¥lfil : %s" #: src/dar_suite/dar_cp.cpp:220 #, fuzzy, c-format msgid "Starting the copy of %u byte(s)" msgstr "Börjar kopiering av %d byte" #: src/dar_suite/dar_cp.cpp:230 #, c-format msgid "" "Error reading source file (we are at %.2f %% of data copied), trying to read " "further: %s\n" msgstr "" "Fel vid läsning av källfil ( vi är vid %.2f %% av kopierade data), försöker " "att läsa vidare: %s\n" #: src/dar_suite/dar_cp.cpp:234 #, c-format msgid "" "Skipping done (missing %.0f byte(s)), found correct data to read, continuing " "the copy...\n" msgstr "" "Överhoppning gjord (missade %.0f byte), fann riktiga data för läsning, " "fortsätter kopieringen...\n" #: src/dar_suite/dar_cp.cpp:240 msgid "" "Reached End of File, no correct data could be found after the last error\n" msgstr "" "NÃ¥tt filslut, inga korrekta data kunde Ã¥terfinnas efter senaste felet\n" #: src/dar_suite/dar_cp.cpp:248 #, c-format msgid "Copy finished. Missing %.0f byte(s) of data\n" msgstr "Kopiering avslutad. Saknar %.0f byte data\n" #: src/dar_suite/dar_cp.cpp:249 #, c-format msgid "Which is %.2f %% of the total amount of data\n" msgstr "Vilket är %.2f %% av det totala mängden data)\n" #: src/dar_suite/dar_cp.cpp:258 msgid "Cannot seek back one char" msgstr "Kan ej leta bakÃ¥t ett tecken" #: src/dar_suite/dar_cp.cpp:269 src/dar_suite/dar_cp.cpp:354 msgid "Cannot write to destination, aborting" msgstr "Kan ej skriva till mÃ¥l, avbryter" #: src/dar_suite/dar_cp.cpp:313 msgid "Cannot seek in file" msgstr "Kan ej leta i fil" #: src/dar_suite/dar_cp.cpp:357 #, c-format msgid "Non fatal error while writing to destination file, retrying\n" msgstr "Icke fatalt fel vid skrivning till mÃ¥lfil, gör om\n" #: src/dar_suite/dar_suite.cpp:147 #, c-format msgid "" "We have linked with an incompatible version of libdar. Expecting version %d." "%d.x but having linked with version %d.%d.%d" msgstr "" "Vi har länkats med en inkompatibel version av libdar. Förväntad version %d." "%d.x men blev länkad med version %d.%d.%d" #: src/dar_suite/dar_suite.cpp:159 msgid "NOT YET IMPLEMENTED FEATURE has been used: " msgstr "EN INTE IMPLEMENTERAD FUNKTION har använts: " #: src/dar_suite/dar_suite.cpp:160 msgid "Please check documentation or upgrade your software if available" msgstr "" "Kontrollera dokumentationen eller uppgradera din programvara om tillgänglig" #: src/dar_suite/dar_suite.cpp:165 msgid "SEEMS TO BE A HARDWARE PROBLEM: " msgstr "VERKAR VARA ETT HÃ…RDVARUPROBLEM: " #: src/dar_suite/dar_suite.cpp:166 msgid "Please check your hardware" msgstr "Kontrollera din hÃ¥rdvara" #: src/dar_suite/dar_suite.cpp:171 msgid "Lack of SECURED memory to achieve the operation, aborting operation" msgstr "Brist pÃ¥ SÄKERT minne för att utföra Ã¥tgärden, avbryter densamma" #: src/dar_suite/dar_suite.cpp:176 src/dar_suite/dar_suite.cpp:181 msgid "Lack of memory to achieve the operation, aborting operation" msgstr "Minnesbrist för att utföra Ã¥tgärden, avbryter densamma" #: src/dar_suite/dar_suite.cpp:186 src/dar_suite/dar_suite.cpp:232 msgid "FATAL error, aborting operation" msgstr "FATALT fel, avbryter Ã¥tgärd" #: src/dar_suite/dar_suite.cpp:192 msgid "Aborting program. User refused to continue while asking: " msgstr "Avbryter program. Användare vägrade fortsätta vid förfrÃ¥gan: " #: src/dar_suite/dar_suite.cpp:197 msgid "Program has been aborted for the following reason: " msgstr "Progarmmet har avslutats av följande orsak: " #: src/dar_suite/dar_suite.cpp:207 msgid "Aborting program. An error occurred concerning user command execution: " msgstr "" "Avbryter program. Ett fel inträffade angÃ¥ende utförande av användarkommando: " #: src/dar_suite/dar_suite.cpp:212 msgid "Aborting program. An error occurred while calling libdar: " msgstr "Avbryter program. Ett fel inträffade vid anrop av libdar: " #: src/dar_suite/dar_suite.cpp:217 src/dar_suite/dar_suite.cpp:222 msgid "Aborting program. " msgstr "Avbryter program. " #: src/dar_suite/dar_suite.cpp:227 msgid "" "Aborting program. The requested operation needs a feature that has been " "disabled at compilation time: " msgstr "" "Avbryter program. Den begärda Ã¥tgärden behöver funktioner, som har " "avaktiverats vid kompileringstillfället: " #: src/dar_suite/dar_suite.cpp:239 src/dar_suite/dar_suite.cpp:259 msgid "INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINER" msgstr "INTERNT FEL, RAPPORTERA FÖREGÃ…ENDE UTDATA TILL PROGRAMUNDERHÃ…LLAREN" #: src/dar_suite/dar_suite.cpp:258 msgid "CAUGHT A NON (LIB)DAR EXCEPTION" msgstr "FÃ…NGADE ETT ICKE- (LIB)DAR-AVBROTT" #: src/dar_suite/dar_suite.cpp:266 msgid "" "SANITY CHECK: AT LEAST ONE THREAD_CANCELLATION OBJECT HAS NOT BEEN DESTROYED " "AND REMAINS IN MEMORY WHILE THE PROGRAM REACHED ITS END" msgstr "" "SUNDHETSKONTROLL: Ã…TMINSTONE ETT TRÃ…DAT AVBROTTSOBJEKT HAR INTE FÖRSTÖRTS " "OCH FINNS KVAR I MINNE MEDAN PROGRAMMET NÃ…DDE SITT SLUT" #: src/dar_suite/dar_suite.cpp:292 #, c-format msgid "Long options support : %s\n" msgstr "Stöd för lÃ¥nga alternativ : %s\n" #: src/dar_suite/dar_suite.cpp:308 #, c-format msgid "Received signal: %s" msgstr "Mottagen signal: %s" #: src/dar_suite/dar_suite.cpp:310 #, c-format msgid "Received signal: %d" msgstr "Mottagen signal: %d" #: src/dar_suite/dar_suite.cpp:316 msgid "Archive fast termination engaged" msgstr "Snabb avslutning pÃ¥ arkiv inkopplat" #: src/dar_suite/dar_suite.cpp:320 msgid "Archive delayed termination engaged" msgstr "Fördröjd avslutning pÃ¥ arkiv inkopplat" #: src/dar_suite/dar_suite.cpp:324 #, fuzzy msgid "" "Disabling signal handler, the next time this signal is received the program " "will abort immediately" msgstr "" "Kopplar bort signalhanterare, nästa gÃ¥ng denna signal mottages kommer " "programmet att avslutas omedelbart" #: src/dar_suite/dar_suite.cpp:328 msgid "" "Cannot cleanly abort the operation, thread-safe support is missing, will " "thus abruptly stop the program, generated archive may be unusable" msgstr "" "Kan inte avbryta uppdraget rent, 'thread-safe'-stöd saknas, kommer att " "stoppa programmet abrupt, skapat arkiv kan vara oanvändbart" #: src/dar_suite/dar_slave.cpp:175 msgid "Cannot read arguments on command line, aborting" msgstr "Kan ej läsa argument pÃ¥ kommandorad, avbryter" #: src/dar_suite/dar_slave.cpp:185 msgid "Missing argument to -i option" msgstr "Saknar argument till -i alternativ" #: src/dar_suite/dar_slave.cpp:193 msgid "Missing argument to -o option" msgstr "Saknar argument till -o alternativ" #: src/dar_suite/dar_slave.cpp:207 msgid "Missing argument to -E option" msgstr "Saknar argument till -E alternativ" #: src/dar_suite/dar_slave.cpp:217 src/dar_suite/dar_xform.cpp:470 #: src/dar_suite/command_line.cpp:1611 msgid "Missing argument to --min-digits" msgstr "Saknar argument till --min-digits" #: src/dar_suite/dar_slave.cpp:225 src/dar_suite/dar_xform.cpp:478 #, c-format msgid "Missing parameter to option -%c" msgstr "Saknar parameter till alternativ -%c" #: src/dar_suite/dar_slave.cpp:227 src/dar_suite/dar_slave.cpp:230 #: src/dar_suite/dar_xform.cpp:480 src/dar_suite/dar_manager.cpp:495 #: src/dar_suite/dar_manager.cpp:498 src/dar_suite/command_line.cpp:1692 #: src/dar_suite/command_line.cpp:1695 #, c-format msgid "Ignoring unknown option -%c" msgstr "Ignorerar okänt alternativ -%c" #: src/dar_suite/dar_slave.cpp:236 msgid "Missing archive basename, see -h option for help" msgstr "Saknar arkivbasnamn, se -h alternativ för hjälp" #: src/dar_suite/dar_slave.cpp:242 src/dar_suite/dar_xform.cpp:495 msgid "Too many argument on command line, see -h option for help" msgstr "För mÃ¥nga argument pÃ¥ kommandorad, se -h alternativ för hjälp" #: src/dar_suite/dar_slave.cpp:262 src/dar_suite/dar_slave.cpp:267 #: src/dar_suite/dar_xform.cpp:542 src/dar_suite/dar_xform.cpp:544 #: src/dar_suite/dar_xform.cpp:546 src/dar_suite/dar_xform.cpp:561 #: src/dar_suite/dar_manager.cpp:866 src/dar_suite/dar_manager.cpp:889 #: src/dar_suite/dar_manager.cpp:892 src/dar_suite/command_line.cpp:1711 #: src/dar_suite/command_line.cpp:1720 src/dar_suite/command_line.cpp:1723 #: src/dar_suite/command_line.cpp:1761 src/dar_suite/command_line.cpp:1786 #: src/dar_suite/command_line.cpp:1791 src/dar_suite/command_line.cpp:1795 #, c-format msgid "\n" msgstr "\n" #: src/dar_suite/dar_slave.cpp:263 src/dar_suite/dar_xform.cpp:547 #: src/dar_suite/command_line.cpp:1724 #, c-format msgid "Common options:\n" msgstr "Allmänna alternativ:\n" #: src/dar_suite/dar_slave.cpp:264 #, c-format msgid "" " -i pipe to use instead of std input to read orders from dar\n" msgstr "" " -i rör som änvänds i stället för 'std input' till att läsa " "beordringar frÃ¥n dar\n" #: src/dar_suite/dar_slave.cpp:265 #, c-format msgid "" " -o pipe to use instead of std output to write data to dar\n" msgstr "" " -i rör som används i stället för 'std output' till att " "skriva data till dar\n" #: src/dar_suite/dar_slave.cpp:266 #, c-format msgid "" " -E \t command line to execute between slices of the archive\n" msgstr "" " -E \t kommandorad, som skall utföras mellan delar i ett arkiv\n" #: src/dar_suite/dar_slave.cpp:268 src/dar_suite/dar_xform.cpp:562 #: src/dar_suite/dar_manager.cpp:893 #, fuzzy, c-format msgid "See man page for more options.\n" msgstr "Se 'man page' för mer detaljer.\n" #: src/dar_suite/dar_slave.cpp:281 src/dar_suite/dar_xform.cpp:576 #: src/dar_suite/dar_manager.cpp:907 #, c-format msgid " Using libdar %u.%u.%u built with compilation time options:\n" msgstr "" " Använder libdar %u.%u.%u byggd med alternativ vid kompileringstillfället:\n" #: src/dar_suite/dar_slave.cpp:283 src/dar_suite/dar_xform.cpp:578 #: src/dar_suite/dar_manager.cpp:909 #, c-format msgid " Using libdar %u.%u built with compilation time options:\n" msgstr "" " Använder libdar %u.%u byggd med alternativ vid kompileringstillfället:\n" #: src/dar_suite/dar_slave.cpp:288 #, c-format msgid " %s comes with ABSOLUTELY NO WARRANTY;" msgstr " %s kommer med ABSOLUT INGA GARANTIER;" #: src/dar_suite/dar_slave.cpp:289 msgid "" " for details\n" " type `dar -W'." msgstr "" " för detaljer\n" " skriv 'dar -W'." #: src/dar_suite/dar_slave.cpp:290 src/dar_suite/dar_xform.cpp:584 #: src/dar_suite/dar_manager.cpp:915 src/dar_suite/command_line.cpp:2173 msgid "" " This is free software, and you are welcome\n" " to redistribute it under certain conditions;" msgstr "" " Detta är fri programvara, och du är välkommen\n" " att Ã¥terdistribuera den under vissa villkor;" #: src/dar_suite/dar_slave.cpp:291 msgid "" " type `dar -L | more'\n" " for details.\n" "\n" msgstr "" " skriv 'dar -L | more'\n" " för detaljer.\n" "\n" #: src/dar_suite/crit_action_cmd_line.cpp:116 msgid "Missing } in conditional statement: " msgstr "Saknat } i villkorssats: " #: src/dar_suite/crit_action_cmd_line.cpp:120 msgid "Missing [ after } in conditional statement: " msgstr "Saknat [ efter } i villkorssats: " #: src/dar_suite/crit_action_cmd_line.cpp:123 msgid "Missing ] in conditional statement: " msgstr "Saknat ] i villkorssats: " #: src/dar_suite/crit_action_cmd_line.cpp:201 #, c-format msgid "Unknown policy for data '%c' in expression %S" msgstr "Okänd policy för data '%c' i uttrycket %S" #: src/dar_suite/crit_action_cmd_line.cpp:234 #, c-format msgid "Unknown policy for EA '%c' in expression %S" msgstr "Okönd policy för EA '%c' i uttrycket %S" #: src/dar_suite/crit_action_cmd_line.cpp:244 msgid "Unknown expression in overwriting policy: " msgstr "Okänt uttryck i överskrivningspolicy: " #: src/dar_suite/crit_action_cmd_line.cpp:427 msgid "Unknown atomic operator, or atomic not allowed with an argument: " msgstr "Okänd 'atomic' operator eller 'atomic' ej tillÃ¥ten med ett argument: " #: src/dar_suite/crit_action_cmd_line.cpp:506 msgid "Unknown character found while parsing conditional string: " msgstr "Okänt tecken hittat under kontroll av villkorssträng: " #: src/dar_suite/crit_action_cmd_line.cpp:515 msgid "Unknown expression found while parsing conditional string: " msgstr "Okänt uttryck hittat under kontroll av villkorssträng: " #: src/dar_suite/dar_xform.cpp:268 msgid "Error transforming the archive :" msgstr "Fel vid omvandling av arkivet :" #: src/dar_suite/dar_xform.cpp:351 src/dar_suite/command_line.cpp:968 msgid "Only one -s option is allowed" msgstr "Endast ett -s alternativ är tillÃ¥tet" #: src/dar_suite/dar_xform.cpp:353 msgid "Missing argument to -s" msgstr "Saknar argument till -s" #: src/dar_suite/dar_xform.cpp:364 msgid "Invalid size for option -s" msgstr "Ogiltig storlek för -s alternativ" #: src/dar_suite/dar_xform.cpp:371 msgid "Missing argument to -S" msgstr "Saknar argument till -S" #: src/dar_suite/dar_xform.cpp:376 src/dar_suite/dar_xform.cpp:394 #: src/dar_suite/command_line.cpp:993 src/dar_suite/command_line.cpp:1011 msgid "Only one -S option is allowed" msgstr "Endast ett -S alternativ är tillÃ¥tet" #: src/dar_suite/dar_xform.cpp:384 msgid "Giving -S option the same value as the one given to -s is useless" msgstr "" "Att ge -S alternativet samma värde som det som gavs till -s är oanvändbart" #: src/dar_suite/dar_xform.cpp:388 msgid "Invalid size for option -S" msgstr "Ogiltig storlek för -S alternativ" #: src/dar_suite/dar_xform.cpp:425 msgid "Missing argument to -E" msgstr "Saknar argument till -E" #: src/dar_suite/dar_xform.cpp:433 msgid "Missing argument to -F" msgstr "Saknar argument till -F" #: src/dar_suite/dar_xform.cpp:441 src/dar_suite/command_line.cpp:1327 msgid "-a option requires an argument" msgstr "-a alternativ kräver ett argument" #: src/dar_suite/dar_xform.cpp:448 msgid "Unknown parameter given to -a option: " msgstr "Okänd parameter givet till -a alternativ: " #: src/dar_suite/dar_xform.cpp:454 msgid "Missing argument to -^" msgstr "Saknar argument till -^" #: src/dar_suite/dar_xform.cpp:459 src/dar_suite/command_line.cpp:1597 msgid "Missing argument to --hash" msgstr "Saknar argument till --hash" #: src/dar_suite/dar_xform.cpp:466 src/dar_suite/command_line.cpp:1607 msgid "Unknown parameter given to --hash option: " msgstr "Okänd parameter givet till --hash alternativ: " #: src/dar_suite/dar_xform.cpp:490 msgid "" "Missing source or destination argument on command line, see -h option for " "help" msgstr "" "Saknar käll- eller mÃ¥l-argument pÃ¥ kommandorad, se -h alternativ för hjälp" #: src/dar_suite/dar_xform.cpp:505 msgid "Invalid argument as source archive" msgstr "Ogiltigt argument som källarkiv" #: src/dar_suite/dar_xform.cpp:512 msgid "Invalid argument as destination archive" msgstr "Ogiltigt argument som mÃ¥larkiv" #: src/dar_suite/dar_xform.cpp:518 msgid "Archive on stdout is not compatible with slicing (-s option)" msgstr "Arkiv pÃ¥ 'std output' är inte kompatibelt med delning (-s alternativ)" #: src/dar_suite/dar_xform.cpp:543 #, c-format msgid "\t\t the first non options argument is the archive to read\n" msgstr "" "\t\t det första icke alternativargumentet är det arkiv som skall läsas\n" #: src/dar_suite/dar_xform.cpp:545 #, c-format msgid "\t\t the second non option argument is the archive to create\n" msgstr "" "\t\t det andra icke alternativargumentet är det arkiv som skall skapas\n" #: src/dar_suite/dar_xform.cpp:548 src/dar_suite/dar_manager.cpp:887 #, c-format msgid " -h\t\t displays this help information\n" msgstr " -h\t\t visa denna hjälpinformation\n" #: src/dar_suite/dar_xform.cpp:549 #, c-format msgid " -V\t\t displays version information\n" msgstr " -V\t\t visar versionsinformation\n" #: src/dar_suite/dar_xform.cpp:550 src/dar_suite/command_line.cpp:1769 #, c-format msgid "" " -s split the archive in several files of size \n" msgstr " -s \t klyv arkivet i flera filer av storlek \n" #: src/dar_suite/dar_xform.cpp:551 #, c-format msgid " -S first file size\n" msgstr " -S första filens storlek\n" #: src/dar_suite/dar_xform.cpp:552 src/dar_suite/command_line.cpp:1773 #, c-format msgid " -p\t\t pauses before writing to a new file\n" msgstr " -p\t\t gör en paus innan skrivning till en ny fil\n" #: src/dar_suite/dar_xform.cpp:553 src/dar_suite/command_line.cpp:1735 #, c-format msgid " -n\t\t don't overwrite files\n" msgstr " -n\t\t skriv ej över filer\n" #: src/dar_suite/dar_xform.cpp:554 src/dar_suite/command_line.cpp:1736 #, c-format msgid " -w\t\t don't warn before overwriting files\n" msgstr " -w\t\t varna inte före överskrivning av filer\n" #: src/dar_suite/dar_xform.cpp:555 src/dar_suite/command_line.cpp:1738 #, c-format msgid " -b\t\t ring the terminal bell when user action is required\n" msgstr "" " -b\t\t ring pÃ¥ terminalens klocka när en användarÃ¥tgärd mÃ¥ste till\n" #: src/dar_suite/dar_xform.cpp:556 #, c-format msgid "" " -E \t command to execute between slices of destination archive\n" msgstr "" " -E \t kommando, som skall utföras mellan delar hos mÃ¥larkivet\n" #: src/dar_suite/dar_xform.cpp:557 #, c-format msgid " -F \t command to execute between slice of source archive\n" msgstr "" " -F \t kommando, som skall utföras mellan delar i källarkivet\n" #: src/dar_suite/dar_xform.cpp:558 src/dar_suite/command_line.cpp:1771 #, c-format msgid " -aSI \t slice size suffixes k, M, T, G, etc. are power of 10\n" msgstr " -aSI \t delstorlekssuffix k, M, T, G, etc. är tio-potenser\n" #: src/dar_suite/dar_xform.cpp:559 src/dar_suite/command_line.cpp:1772 #, c-format msgid " -abinary\t slice size suffixes k, M, T, G, etc. are power of 2\n" msgstr " -abinary\t delstorlekssuffix k, M, T, G, etc. är tvÃ¥-potenser\n" #: src/dar_suite/dar_xform.cpp:560 src/dar_suite/command_line.cpp:1785 #, c-format msgid " -^ \t permission[:user[:group]] of created slices\n" msgstr " -^ \t permission[:användare[:grupp]] för skapade bitar\n" #: src/dar_suite/dar_xform.cpp:583 src/dar_suite/dar_manager.cpp:914 #: src/dar_suite/command_line.cpp:2172 #, c-format msgid "" " %s comes with ABSOLUTELY NO WARRANTY; for details\n" " type `%s -W'." msgstr "" " %s kommer med ABSOLUT INGEN GARANTI, för detaljer\n" " skriv '%s -W'." #: src/dar_suite/dar_xform.cpp:585 src/dar_suite/dar_manager.cpp:916 #: src/dar_suite/command_line.cpp:2174 #, c-format msgid "" " type `%s -L | more'\n" " for details.\n" "\n" msgstr "" " skriv '%s -L | more'\n" " för detaljer.\n" "\n" #: src/dar_suite/dar.cpp:133 msgid "Considering the (first) archive of reference:" msgstr "Beaktar det (första) referensarkivet:" #: src/dar_suite/dar.cpp:155 src/dar_suite/dar.cpp:195 msgid "" "Using sequential reading mode for archive source is not possible for merging " "operation" msgstr "" "Att använda inställningen sekvensiell läsning för källarkiv är ej möjligt " "vid hopslagningsÃ¥tgärd" #: src/dar_suite/dar.cpp:172 #, fuzzy msgid "Considering the second (alias auxiliary) archive of reference:" msgstr "Beaktar det (andra alias hjälp) referensarkivet:" #: src/dar_suite/dar.cpp:239 src/dar_suite/dar.cpp:303 #: src/dar_suite/dar.cpp:397 src/dar_suite/dar.cpp:468 #, fuzzy msgid "Archive signature is only possible with gnupg encryption" msgstr "Arkiv pÃ¥ 'std output' är inte kompatibelt med delning (-s alternativ)" #: src/dar_suite/dar.cpp:340 msgid "" "Making room in memory (releasing memory used by archive of reference)..." msgstr "" #: src/dar_suite/dar.cpp:368 msgid "Now performing on-fly isolation..." msgstr "Nu genomförs 'i flykten'-isolation..." #: src/dar_suite/dar.cpp:590 msgid "All files asked could not be restored" msgstr "Alla efterfrÃ¥gade filer kunde ej Ã¥terställas" #: src/dar_suite/dar.cpp:669 msgid "Some file comparisons failed" msgstr "Vissa filjämförelser misslyckades" #: src/dar_suite/dar.cpp:740 msgid "" "Some files are corrupted in the archive and it will not be possible to " "restore them" msgstr "" "NÃ¥gra filer i arkivet är förstörda och det är ej möjligt att Ã¥terställa dem" #: src/dar_suite/dar.cpp:790 msgid "Continue listing archive contents?" msgstr "Fortsätta lista arkivinnehÃ¥ll?" #: src/dar_suite/dar.cpp:811 src/dar_suite/dar.cpp:832 msgid "Final memory cleanup..." msgstr "" #: src/dar_suite/dar.cpp:890 #, c-format msgid " %i inode(s) saved\n" msgstr " %i inod(er) sparade\n" #: src/dar_suite/dar.cpp:891 #, c-format msgid " including %i hard link(s) treated\n" msgstr " inkluderande %i hÃ¥rd(a) länk(ar) behandlade\n" #: src/dar_suite/dar.cpp:892 #, c-format msgid "" " %i inode(s) changed at the moment of the backup and could not be saved " "properly\n" msgstr "" " %i inode(er) ändrade vid säkerhetskopieringstillfället och kunde inte " "sparas\n" #: src/dar_suite/dar.cpp:893 #, c-format msgid " %i byte(s) have been wasted in the archive to resave changing files" msgstr " %i byte(s) har förbrukats i arkivet för att Ã¥terspara ändrande filer" #: src/dar_suite/dar.cpp:894 #, c-format msgid " %i inode(s) not saved (no inode/file change)\n" msgstr " %i inod(er) ej sparad(e) (ingen inode/fil ändrad)\n" #: src/dar_suite/dar.cpp:895 #, c-format msgid " %i inode(s) failed to be saved (filesystem error)\n" msgstr " %i nod(er) misslyckades att spara (filsystemfel)\n" #: src/dar_suite/dar.cpp:896 src/dar_suite/dar.cpp:926 #: src/dar_suite/dar.cpp:986 #, c-format msgid " %i inode(s) ignored (excluded by filters)\n" msgstr " %i inod(er) ignorerad(e) (uteslutna av filter)\n" #: src/dar_suite/dar.cpp:897 #, c-format msgid " %i inode(s) recorded as deleted from reference backup\n" msgstr "" " %i inoder(er) noterad(e) som borttagen/borttagna frÃ¥n " "referenssäkerhetskopian\n" #: src/dar_suite/dar.cpp:899 src/dar_suite/dar.cpp:930 #: src/dar_suite/dar.cpp:994 #, c-format msgid " Total number of inode(s) considered: %i\n" msgstr " Totalt antal övervägda inoder: %i\n" #: src/dar_suite/dar.cpp:902 src/dar_suite/dar.cpp:990 #, c-format msgid " EA saved for %i inode(s)\n" msgstr " EA sparat för %i inoder(er)\n" #: src/dar_suite/dar.cpp:904 src/dar_suite/dar.cpp:992 #, fuzzy, c-format msgid " FSA saved for %i inode(s)\n" msgstr " EA sparat för %i inoder(er)\n" #: src/dar_suite/dar.cpp:922 #, c-format msgid " %i inode(s) restored\n" msgstr " %i inod(er) Ã¥terställd(a)\n" #: src/dar_suite/dar.cpp:923 #, c-format msgid " including %i hard link(s)\n" msgstr " inkluderande %i hÃ¥rd länk(s)\n" #: src/dar_suite/dar.cpp:924 #, c-format msgid " %i inode(s) not restored (not saved in archive)\n" msgstr " %i inod(er) ej Ã¥terställd(a) (ej sparad(e) i arkiv)\n" #: src/dar_suite/dar.cpp:925 #, c-format msgid " %i inode(s) not restored (overwriting policy decision)\n" msgstr " %i inod(er) ej Ã¥terställd(a) (beslut enl. överskrivningspolicyn)\n" #: src/dar_suite/dar.cpp:927 #, c-format msgid " %i inode(s) failed to restore (filesystem error)\n" msgstr " %i inod(er) gick inte att Ã¥terställa (filsystemfel)\n" #: src/dar_suite/dar.cpp:928 #, c-format msgid " %i inode(s) deleted\n" msgstr " %i inod(er) borttagen/borttagna\n" #: src/dar_suite/dar.cpp:933 #, c-format msgid " EA restored for %i inode(s)\n" msgstr " EA Ã¥terställt för %i inod(er)\n" #: src/dar_suite/dar.cpp:935 #, fuzzy, c-format msgid " FSA restored for %i inode(s)\n" msgstr " EA Ã¥terställt för %i inod(er)\n" #: src/dar_suite/dar.cpp:947 src/dar_suite/dar.cpp:964 #, c-format msgid " %i item(s) treated\n" msgstr " %i företeelse(r) behandlad(e)\n" #: src/dar_suite/dar.cpp:948 #, c-format msgid " %i item(s) do not match those on filesystem\n" msgstr " %i inod(er) matchar ej motsvarande i filsystem\n" #: src/dar_suite/dar.cpp:949 src/dar_suite/dar.cpp:966 #, c-format msgid " %i item(s) ignored (excluded by filters)\n" msgstr " %i företeelse(r) ignorerad(e) (uteslutna av filter)\n" #: src/dar_suite/dar.cpp:951 src/dar_suite/dar.cpp:968 #, c-format msgid " Total number of items considered: %i\n" msgstr " Totalt antal övervägda poster: %i\n" #: src/dar_suite/dar.cpp:965 #, c-format msgid " %i item(s) with error\n" msgstr " %i företeelse(r) med fel\n" #: src/dar_suite/dar.cpp:984 #, c-format msgid " %i inode(s) added to archive\n" msgstr " %i inod(er) lagda till arkiv\n" #: src/dar_suite/dar.cpp:985 #, c-format msgid " with %i hard link(s) recorded\n" msgstr " med %i hÃ¥rd(a) länk(ar) noterad(e)\n" #: src/dar_suite/dar.cpp:987 #, c-format msgid " %i inode(s) recorded as deleted\n" msgstr " %i inod(er) noterade som borttagna\n" #: src/dar_suite/dar_manager.cpp:230 msgid "Decompressing and loading database header to memory..." msgstr "Dekomprimerar och laddar databashuvud in i minnet..." #: src/dar_suite/dar_manager.cpp:232 msgid "Decompressing and loading database to memory..." msgstr "Dekomprimerar och laddar databasen in i minnet..." #: src/dar_suite/dar_manager.cpp:244 msgid "Error met while processing operation: " msgstr "Fel uppstÃ¥tt vid bearbetande av Ã¥tgärd: " #: src/dar_suite/dar_manager.cpp:314 msgid "-B option cannot be given inside a batch file" msgstr "-B alternativ kan ej ges inuti en batch-fil" #: src/dar_suite/dar_manager.cpp:451 msgid "Running batch file from a batch file is not allowed" msgstr "Att köra en batch-fil frÃ¥n en batch-fil är ej tillÃ¥tet" #: src/dar_suite/dar_manager.cpp:467 #, fuzzy msgid "-9 option is only valid after -A option, ignoring it" msgstr "-; alternativ är användbart bara med -A alternativ, ignoreras" #: src/dar_suite/dar_manager.cpp:480 #, c-format msgid "invalid number give to -; option: %s" msgstr "Ogiltigt tal givet till -; alternativ: %s" #: src/dar_suite/dar_manager.cpp:523 msgid "-e option is only available when using -r option, aborting" msgstr "-e alternativ är bara tillgängligt när -r alternativ används, avbryter" #: src/dar_suite/dar_manager.cpp:530 msgid "No action specified, aborting" msgstr "Ingen Ã¥tgärd specificerad, avbryter" #: src/dar_suite/dar_manager.cpp:542 src/dar_suite/dar_manager.cpp:546 msgid "Ignoring extra arguments on command line" msgstr "Ignorerer extra argument pÃ¥ kommandorad" #: src/dar_suite/dar_manager.cpp:552 src/dar_suite/dar_manager.cpp:569 msgid "Missing argument to command line, aborting" msgstr "Saknar argument pÃ¥ kommandorad, avbryter" #: src/dar_suite/dar_manager.cpp:561 msgid "Arguments to -r must be relative path (never begin by '/')" msgstr "" "Argument till -r mÃ¥ste vara en relativ sökväg (fÃ¥r aldrig börja med '/')" #: src/dar_suite/dar_manager.cpp:583 msgid "No database specified, aborting" msgstr "Ingen databas specificerad, avbryter" #: src/dar_suite/dar_manager.cpp:589 msgid "Parse error on command line (or included files): " msgstr "Analysfel i kommandoraden (eller i inkluderade filer): " #: src/dar_suite/dar_manager.cpp:602 msgid "Creating file..." msgstr "Skapar fil..." #: src/dar_suite/dar_manager.cpp:603 msgid "Formatting file as an empty database..." msgstr "Formaterar fil som en tom databas..." #: src/dar_suite/dar_manager.cpp:607 msgid "Database has been successfully created empty." msgstr "Databasen har med lyckat resultat skapats tom." #: src/dar_suite/dar_manager.cpp:622 src/dar_suite/dar_manager.cpp:1091 msgid "Reading catalogue of the archive to add..." msgstr "Läsning av arkivkatalogen för att lägga till..." #: src/dar_suite/dar_manager.cpp:636 src/dar_suite/dar_manager.cpp:1100 msgid "Updating database with catalogue..." msgstr "Uppdaterar databas med katalog..." #: src/dar_suite/dar_manager.cpp:643 src/dar_suite/dar_manager.cpp:837 #: src/dar_suite/dar_manager.cpp:1103 src/dar_suite/dar_manager.cpp:1133 #: src/dar_suite/dar_manager.cpp:1227 #, fuzzy msgid "Checking date ordering of files between archives..." msgstr "Kontrollerar datumordning hos filer mellan arkiv..." #: src/dar_suite/dar_manager.cpp:657 src/dar_suite/dar_manager.cpp:841 #: src/dar_suite/dar_manager.cpp:1229 msgid "" "Some files do not follow chronological order when archive index increases " "withing the database, this can lead dar_manager to restored a wrong version " "of these files" msgstr "" "Vissa filer följer inte kronologisk ordning när arkivindex ökas inom " "databasen. Detta kan leda till att dar_manager Ã¥terhämtar fel version av " "dessa filer." #: src/dar_suite/dar_manager.cpp:684 src/dar_suite/dar_manager.cpp:1122 #, fuzzy msgid "Removing information from the database..." msgstr "Tar bort information frÃ¥n arkivet..." #: src/dar_suite/dar_manager.cpp:704 src/dar_suite/dar_manager.cpp:724 #: src/dar_suite/dar_manager.cpp:738 src/dar_suite/dar_manager.cpp:752 msgid "Changing database header information..." msgstr "Ändrar information i databashuvudet..." #: src/dar_suite/dar_manager.cpp:769 msgid "" "Looking in archives for requested files, classifying files archive by " "archive..." msgstr "" "Letar i arkiven för begärda filer, klassificerar filer arkiv för arkiv..." #: src/dar_suite/dar_manager.cpp:816 src/dar_suite/dar_manager.cpp:1152 msgid "Computing statistics..." msgstr "Beräknar statistik..." #: src/dar_suite/dar_manager.cpp:826 msgid "" "Negative number or zero not allowed when moving an archive inside a database" msgstr "" "Negativt tal eller noll är ej tillÃ¥tet vid flyttning av ett arkiv inom en " "databas" #: src/dar_suite/dar_manager.cpp:833 msgid "Changing database information..." msgstr "Ändrar databasinformation..." #: src/dar_suite/dar_manager.cpp:867 #, c-format msgid "Commands:\n" msgstr "Kommandon:\n" #: src/dar_suite/dar_manager.cpp:868 #, c-format msgid " -C creates an empty database\n" msgstr " -C skapar en tom databas\n" #: src/dar_suite/dar_manager.cpp:869 #, c-format msgid " -B specify the database to use (read or modify)\n" msgstr "" " -B specificerar använd databas (läsning eller modifiering)\n" #: src/dar_suite/dar_manager.cpp:870 #, c-format msgid " -A add an archive to the database\n" msgstr " -A lägg till ett arkiv till databasen\n" #: src/dar_suite/dar_manager.cpp:871 #, c-format msgid "" " -l\t\t gives information about the archive compiled in the database\n" msgstr " -l\t\t lämna information om det arkiv 'kompilerat' i databasen\n" #: src/dar_suite/dar_manager.cpp:872 #, c-format msgid " -D delete an archive from the database\n" msgstr " -D tag bort ett arkiv frÃ¥n databasen\n" #: src/dar_suite/dar_manager.cpp:873 #, c-format msgid "" " -b \t change the basename to use for the give archive number\n" msgstr "" " -b \t byt basnamnet att användas för det givna arkivnummret\n" #: src/dar_suite/dar_manager.cpp:874 #, c-format msgid "" " -p \t change the path to use for the given archive number\n" msgstr " -p \t byt sökvägen att användas för det givna arkivnummret\n" #: src/dar_suite/dar_manager.cpp:875 #, c-format msgid " -o specify a list of option to always pass to dar\n" msgstr "" " -o specificera en lista med alternativ som alltid skall " "lämnas till dar\n" #: src/dar_suite/dar_manager.cpp:876 #, c-format msgid " -d specify the path to dar\n" msgstr " -d specificera sökvägen till dar\n" #: src/dar_suite/dar_manager.cpp:877 #, c-format msgid " -r \t restores the given files\n" msgstr " -r \t Ã¥terställer de givna filerna\n" #: src/dar_suite/dar_manager.cpp:878 #, c-format msgid "" " -w \t only with -r, restores in state just before the given date\n" msgstr "" " -w \t endast med -r, Ã¥terställer status alldeles före det givna " "datumet\n" #: src/dar_suite/dar_manager.cpp:879 #, c-format msgid "" " -u \t list the most recent files contained in the given " "archive\n" msgstr "" " -u \t lista det senaste filerna innehÃ¥llna i det givna arkivet\n" #: src/dar_suite/dar_manager.cpp:880 #, c-format msgid " -f \t list the archives where the given file is present\n" msgstr " -f \t lista de arkiv där den givna filen finns\n" #: src/dar_suite/dar_manager.cpp:881 #, c-format msgid " -s\t\t shows the number of most recent file by archive\n" msgstr " -s\t\t visa antalet senaste filer mot arkiv\n" #: src/dar_suite/dar_manager.cpp:882 #, c-format msgid " -m \t move an archive within a given database.\n" msgstr " -m \t flytta ett arkiv inom en given databas.\n" #: src/dar_suite/dar_manager.cpp:883 #, c-format msgid " -i\t\t user interactive mode\n" msgstr " -i\t\t interaktiv användarmod\n" #: src/dar_suite/dar_manager.cpp:884 #, c-format msgid " -c\t\t check database for dates order\n" msgstr " -c\t\t kontrollera databasen med avseende pÃ¥ datumordning\n" #: src/dar_suite/dar_manager.cpp:885 #, c-format msgid "" " -L execute on a given database a batch of action as defined " "by\n" msgstr "" " -L utför pÃ¥ en given databas en serie Ã¥tgärder definierad " "av\n" #: src/dar_suite/dar_manager.cpp:886 #, c-format msgid "\t\t the provided file.\n" msgstr "\t\t den lämnade filen.\n" #: src/dar_suite/dar_manager.cpp:888 #, c-format msgid " -V\t\t displays software version\n" msgstr " -V\t\t visar programvaruversion\n" #: src/dar_suite/dar_manager.cpp:890 #, c-format msgid "Options:\n" msgstr "Alternativ:\n" #: src/dar_suite/dar_manager.cpp:891 #, c-format msgid " -v\t\t display more information about what is going on\n" msgstr " -v\t\t visar mer information om vad som pÃ¥gÃ¥r\n" #: src/dar_suite/dar_manager.cpp:973 msgid "Corrupted database :" msgstr "Förstörd databas :" #: src/dar_suite/dar_manager.cpp:1022 #, c-format msgid "" "\n" "\n" "\t Dar Manager Database used [%s] : %S\n" msgstr "" "\n" "\n" "\t Dar Manager Database använde [%s] : %S\n" #: src/dar_suite/dar_manager.cpp:1022 msgid "Saved" msgstr "Sparad" #: src/dar_suite/dar_manager.cpp:1022 msgid "Not Saved" msgstr "Ej sparad" #: src/dar_suite/dar_manager.cpp:1024 #, c-format msgid "" "\t Pause each %d line of output\n" "\n" msgstr "" "\t Gör en paus för var %d -te rad i utdata\n" "\n" #: src/dar_suite/dar_manager.cpp:1026 #, c-format msgid "" "\t No pause in output\n" "\n" msgstr "" "\t Ingen paus i utdata\n" "\n" #: src/dar_suite/dar_manager.cpp:1027 #, c-format msgid " l : list database contents \t A : Add an archive\n" msgstr " l : listar databasinnehÃ¥ll \t A : lägg till ett arkiv\n" #: src/dar_suite/dar_manager.cpp:1028 #, c-format msgid " u : list archive contents \t D : Remove an archive\n" msgstr " u : listar databasinnehÃ¥ll \t D : Tar bort ett arkiv\n" #: src/dar_suite/dar_manager.cpp:1029 #, c-format msgid " f : give file localization \t m : modify archive order\n" msgstr " f : ange filplats \t m : modifiera arkiveringsordning\n" #: src/dar_suite/dar_manager.cpp:1030 #, c-format msgid " p : modify path of archives \t b : modify basename of archives\n" msgstr "" " p : modifiera sökväg för arkiven \t b : modifiera basnamn för arkiven\n" #: src/dar_suite/dar_manager.cpp:1031 #, c-format msgid " d : path to dar \t o : options to dar\n" msgstr " d : sökväg till dar \t o : alternativ hos dar\n" #: src/dar_suite/dar_manager.cpp:1032 #, c-format msgid " w : write changes to file \t s : database statistics\n" msgstr " w : skriv ändringar till fil \t s : databasstatistik\n" #: src/dar_suite/dar_manager.cpp:1033 #, c-format msgid "" " a : Save as \t n : pause each 'n' line (zero for no pause)\n" msgstr "" " a : Spara som \t n : gör paus var n-te rad (noll ger ingen " "paus)\n" #: src/dar_suite/dar_manager.cpp:1034 #, c-format msgid "" " c : check date order\n" "\n" msgstr "" " c : kontrollera datumordning\n" "\n" #: src/dar_suite/dar_manager.cpp:1035 #, c-format msgid "" " q : quit\n" "\n" msgstr "" " q : avsluta\n" "\n" #: src/dar_suite/dar_manager.cpp:1036 #, c-format msgid " Choice: " msgstr " Val: " #: src/dar_suite/dar_manager.cpp:1053 msgid "Archive number: " msgstr "Arkivnummer: " #: src/dar_suite/dar_manager.cpp:1060 msgid "File to look for: " msgstr "Fil att leta efter: " #: src/dar_suite/dar_manager.cpp:1064 msgid "Archive number to modify: " msgstr "Arkivnummer, som skall ändras: " #: src/dar_suite/dar_manager.cpp:1068 #, c-format msgid "New basename for archive number %d: " msgstr "Nytt basnamn för arkiv nummer %d: " #: src/dar_suite/dar_manager.cpp:1073 msgid "Path to dar (empty string to use the default from PATH variable): " msgstr "Sökväg till dar (vid tom sträng används standard frÃ¥n PATH-variabel): " #: src/dar_suite/dar_manager.cpp:1078 src/dar_suite/dar_manager.cpp:1084 #: src/dar_suite/dar_manager.cpp:1354 msgid "Compressing and writing back database to file..." msgstr "Komprimerar och skriver tillbaka databas till fil..." #: src/dar_suite/dar_manager.cpp:1083 msgid "New database name: " msgstr "Nytt databasnamn: " #: src/dar_suite/dar_manager.cpp:1090 msgid "Archive basename (or extracted catalogue basename) to add: " msgstr "Arkivbasnamn (eller extraherat katalogbasnamn) att lägga till: " #: src/dar_suite/dar_manager.cpp:1117 msgid "Archive number to remove: " msgstr "Arkivnummer, som skall tas bort: " #: src/dar_suite/dar_manager.cpp:1121 #, c-format msgid "Are you sure to remove archive number %d ?" msgstr "Är du säker pÃ¥ att du vill ta bort arkiv nummer %d" #: src/dar_suite/dar_manager.cpp:1127 msgid "Archive number to move: " msgstr "Arkivnummer, som skall flyttas: " #: src/dar_suite/dar_manager.cpp:1129 msgid "In which position to insert this archive: " msgstr "PÃ¥ vilkenplats skall detta arkiv läggas in: " #: src/dar_suite/dar_manager.cpp:1138 msgid "Archive number who's path to modify: " msgstr "Arkivnummer, vars sökväg skall ändras: " #: src/dar_suite/dar_manager.cpp:1142 #, c-format msgid "New path to give to archive number %d: " msgstr "Ny sökväg att ge till arkif nummer %d: " #: src/dar_suite/dar_manager.cpp:1156 msgid "How much line to display at once: " msgstr "Hur mycket rad, som skall visas genast: " #: src/dar_suite/dar_manager.cpp:1160 msgid "Checking file's dates ordering..." msgstr "Kontrollerar filers datumordning..." #: src/dar_suite/dar_manager.cpp:1168 src/dar_suite/dar_manager.cpp:1189 msgid "Database not saved, Do you really want to quit ?" msgstr "Databas ej sparad. Vill du verkligen avsluta?" #: src/dar_suite/dar_manager.cpp:1169 src/dar_suite/dar_manager.cpp:1190 #, c-format msgid "Continuing the action under process which is to exit... so we exit!" msgstr "Fortsätter aktuell process,vilket är att avsluta... sÃ¥ vi avslutar!" #: src/dar_suite/dar_manager.cpp:1178 #, c-format msgid "Unknown choice\n" msgstr "Okänt val\n" #: src/dar_suite/dar_manager.cpp:1204 #, c-format msgid "re-enabling all signal handlers and continuing\n" msgstr "Ã¥terställer alla signalhanterare och fortsätter\n" #: src/dar_suite/dar_manager.cpp:1211 #, c-format msgid "Error performing the requested action: %S" msgstr "Fel vid genomförande av den begärda Ã¥tgärden: %S" #: src/dar_suite/dar_manager.cpp:1231 msgid "No problem found" msgstr "Inga problem hittade" #: src/dar_suite/dar_manager.cpp:1260 msgid "Opening and reading the batch file..." msgstr "Öppnar och läser batch-fil..." #: src/dar_suite/dar_manager.cpp:1284 #, c-format msgid "" "\n" "\tExecuting batch file line: %S\n" " " msgstr "" "\n" "\tUtför batch-fil rad: %S\n" " " #: src/dar_suite/dar_manager.cpp:1293 #, c-format msgid "Syntax error in batch file: %S" msgstr "Syntaxfel i batch-fil: %S" #: src/dar_suite/dar_manager.cpp:1296 msgid "Syntax error in batch file: -C option not allowed" msgstr "Syntaxfel i batch-fil: -C alternativ ej tillÃ¥tet" #: src/dar_suite/dar_manager.cpp:1299 msgid "Syntax error in batch file: -i option not allowed" msgstr "Syntaxfel i batch-fil: -i alternativ ej tillÃ¥tet" #: src/dar_suite/dar_manager.cpp:1307 msgid "Aborting batch operation: " msgstr "Avbryter batch-Ã¥tgärd: " #: src/dar_suite/dar_manager.cpp:1318 #, c-format msgid "Enter each argument line by line, press return at the end\n" msgstr "Mata in varje argument rad för rad, tryck vagnretur vid slutet\n" #: src/dar_suite/dar_manager.cpp:1319 #, c-format msgid "To terminate enter an empty line\n" msgstr "Avsluta genom att mata in en tom rad\n" #: src/dar_suite/dar_manager.cpp:1446 #, c-format msgid "Absolute value too high for an archive number: %d" msgstr "Absolutvärdet för stort för arkiv nummer: %d" #: src/dar_suite/shell_interaction.cpp:174 msgid "" "No terminal found for user interaction. All questions will be assumed a " "negative answer (less destructive choice), which most of the time will abort " "the program." msgstr "" "Ingen terminal hittad för användarinteraktion. Alla frÃ¥gor kommer att anses " "negativt besvarade (minst skadliga val), vilket i det flesta fall kommer att " "avbryta programmet." #: src/dar_suite/shell_interaction.cpp:234 msgid "Error reading character: " msgstr "Fel vid läsning av tecken: " #: src/dar_suite/shell_interaction.cpp:259 msgid "Error while changing user terminal properties: " msgstr "Fel vid ändring av användarterminalens egenskaper: " #: src/dar_suite/shell_interaction.cpp:297 msgid " [return = YES | Esc = NO]" msgstr " [vagnretur = JA | Esc = NEJ]" #: src/dar_suite/shell_interaction.cpp:316 msgid "Error while reading user answer from terminal: " msgstr "Fel vid läsning av användarsvar frÃ¥n terminal: " #: src/dar_suite/shell_interaction.cpp:321 msgid "Continuing..." msgstr "Fortsätter..." #: src/dar_suite/shell_interaction.cpp:323 msgid "Escaping..." msgstr "Avbryter..." #: src/dar_suite/shell_interaction.cpp:409 msgid "Secured string can only be read from a terminal" msgstr "" #: src/dar_suite/shell_interaction.cpp:434 msgid "provided password is too long for the allocated memory" msgstr "lämnat lösenord är för lÃ¥ngt för det tilldelade minnet" #: src/dar_suite/command_line.cpp:361 #, fuzzy msgid "User target found on command line or included file(s):" msgstr "Analysfel i kommandoraden (eller i inkluderade filer): " #: src/dar_suite/command_line.cpp:370 msgid "No user target found on command line" msgstr "Inget användarmÃ¥l funnet pÃ¥ kommandorad" #: src/dar_suite/command_line.cpp:388 #, c-format msgid "Given user target(s) could not be found: %S" msgstr "" #: src/dar_suite/command_line.cpp:392 #, c-format msgid "Missing -c -x -d -t -l -C -+ option, see `%S -h' for help" msgstr "Saknar -c -x -d -t -l -C -+ alternativ, se %S -h för hjälp" #: src/dar_suite/command_line.cpp:394 msgid "" "Slicing (-s option), is not compatible with archive on standard output (\"-" "\" as filename)" msgstr "" "Delning (-s alternativ), är inte kompatibelt med arkiv pÃ¥ 'standard " "output' (\"-\" som filnamn)" #: src/dar_suite/command_line.cpp:415 msgid "-af option is only available with -c" msgstr "-af alternativ är endast tillgängligt med -c" #: src/dar_suite/command_line.cpp:417 msgid "-A option is not available with -l" msgstr "-A alternativ är ej tillgängligt med -l" #: src/dar_suite/command_line.cpp:419 msgid "with -C option, -A option is mandatory" msgstr "med -c alternativ är -A alternativ obligatorisk" #: src/dar_suite/command_line.cpp:421 msgid "with -+ option, -A option is mandatory" msgstr "med -+ alternativ är -A alternativ obligatorisk" #: src/dar_suite/command_line.cpp:423 msgid "-wa is only useful with -x option" msgstr "-wa alternativ är användbart bara med alternativet -x" #: src/dar_suite/command_line.cpp:426 msgid "-o is mandatory when using \"-A -\" with \"-c -\" \"-C -\" or \"-+ -\"" msgstr "" "-o är obligatorisk tillsammans med \"-A -\" with \"-c -\" \"-C -\" or \"-+ -" "\"" #: src/dar_suite/command_line.cpp:436 #, fuzzy msgid "-z option needs only to be used with -c -C or -+ options" msgstr "-z eller -y behöver bara användas med -c -C eller -+" #: src/dar_suite/command_line.cpp:438 msgid "-S option requires the use of -s" msgstr "-S alternativ kräver användning av -s" #: src/dar_suite/command_line.cpp:440 msgid "ignoring -O option, as it is useless in this situation" msgstr "ignorerar -O alternativ, dÃ¥ det är värdelöst i denna situation" #: src/dar_suite/command_line.cpp:447 #, fuzzy, c-format msgid "" "File ownership will not be restored as %s has not the CHOWN capability nor " "is running as root. to avoid this message use -O option" msgstr "" "Filägarskap kommer ej att Ã¥terställas dÃ¥ %s inte körs som rot. För att " "undvika detta meddelande använd -O alternativ" #: src/dar_suite/command_line.cpp:455 #, fuzzy, c-format msgid "" "Furtive read mode has been disabled as %s has not the FOWNER capability nor " "is running as root" msgstr "Läsning i smyg har kopplats bort dÃ¥ dar inte körs som root" #: src/dar_suite/command_line.cpp:460 msgid "-F is only useful with -A option, for the archive of reference" msgstr "-F är endast användbart med -A alternativ, för referensarkivet" #: src/dar_suite/command_line.cpp:463 msgid "-J is only useful with -A option, for the archive of reference" msgstr "-J är endast användbart med -A alternativ, för referensarkivet" #: src/dar_suite/command_line.cpp:466 msgid "-f in only available with -x option, ignoring" msgstr "-f är endast tillgängligt med -x alternativ, ignorerar" #: src/dar_suite/command_line.cpp:468 msgid "-m is only useful with -c" msgstr "-m är bara användbart med -c" #: src/dar_suite/command_line.cpp:474 msgid "-H is only useful with -A option when making a backup" msgstr "-H är endast användbart med -A alternativ dÃ¥ en säkerhetskopia görs" #: src/dar_suite/command_line.cpp:480 msgid "-H is only useful with -r option when extracting" msgstr "-H är endast användbart med -r alternativ dÃ¥ extrahering görs" #: src/dar_suite/command_line.cpp:484 msgid "-H is only useful with -c, -d or -x" msgstr "-H är endast användbart med -c, -d eller -x" #: src/dar_suite/command_line.cpp:488 msgid "-as is only available with -l, ignoring -as option" msgstr "-as är endast tillgängligt med -l, ignorerar -as alternativ" #: src/dar_suite/command_line.cpp:490 msgid "-e is only useful with -x, -c or -+ options" msgstr "-e alternativ är användbart bara med -x, -c eller -+ alternativ" #: src/dar_suite/command_line.cpp:492 msgid "-ac is only useful with -c or -d" msgstr "-ac är endast användbart med -c eller -d" #: src/dar_suite/command_line.cpp:494 msgid "-M is only useful with -c" msgstr "-M är endast användbart med -c" #: src/dar_suite/command_line.cpp:496 msgid "The snapshot backup (-A +) is only available with -c option, ignoring" msgstr "Snabb-backup (-A +) är bara tillgängligt med -c aalternativ, ignorerar" #: src/dar_suite/command_line.cpp:498 msgid "" "The Cache Directory Tagging Standard is only useful while performing a " "backup, ignoring it here" msgstr "" "\"Cache Directory Tagging Standard\" är bara användbart medan en " "säkerhetskopiering görs, tar ej hänsyn till det här" #: src/dar_suite/command_line.cpp:501 msgid "-@ is only available with -+ and -c options" msgstr "-@ är bara tillgängligt med -+ och -c alternativ" #: src/dar_suite/command_line.cpp:503 msgid "-$ is only available with -+ option and -c options" msgstr "-$ är bara tillgängligt med -+ och -c alternativ" #: src/dar_suite/command_line.cpp:505 #, fuzzy msgid "-~ is only available with -+ and -c options" msgstr "-@ är bara tillgängligt med -+ och -c alternativ" #: src/dar_suite/command_line.cpp:507 #, c-format msgid "-%% is only available with -+ option" msgstr "-%% är bara tillgängligt med -+ alternativ" #: src/dar_suite/command_line.cpp:510 msgid "" "-$ is only useful with -@ option, for the auxiliary archive of reference" msgstr "" "-$ är bara nyttigt med -@ alternativ, för det hjälpande referensarkivet" #: src/dar_suite/command_line.cpp:512 #, c-format msgid "" "-%% is only useful with -@ option, for the auxiliary archive of reference" msgstr "" "-%% är bara nyttigt med -@ alternativ, för det hjälpande referensarkivet" #: src/dar_suite/command_line.cpp:514 msgid "" "-~ is only useful with -@ option, for the auxiliary archive of reference" msgstr "" "-~ is är bara nyttig med -@ alternativ, för det hjälpande referensarkivet" #: src/dar_suite/command_line.cpp:517 msgid "-ak is only available while merging (operation -+), ignoring -ak" msgstr "" "-ak är bara tillgängligt under sammanfogning (operation -+), ignorerar -ak" #: src/dar_suite/command_line.cpp:522 #, fuzzy msgid "" "Compression option (-z option) is useless and ignored when using -ak option" msgstr "" "Kompressionsalternativ (-z eller -y) är oanvändbart och ignoreras när -ak " "alternativ används" #: src/dar_suite/command_line.cpp:529 msgid "" "--sparse-file-min-size only available while saving or merging archives, " "ignoring" msgstr "" "--sparse-file-min-size är bara tillgängligt under arkivs sparande eller " "ihopslagning. " #: src/dar_suite/command_line.cpp:532 msgid "" "To use --sparse-file-min-size while merging archive, you need to use -ah " "option too, please check man page for details" msgstr "" "För att utnyttja --sparse-file-min-size under arkivihopslaygnin, mÃ¥ste du " "använda -ah valet ocksÃ¥se man page för detaljer" #: src/dar_suite/command_line.cpp:538 msgid "-k option is only useful with -x option" msgstr "-k alternativ är användbart bara med alternativet -x" #: src/dar_suite/command_line.cpp:541 msgid "-konly and -kignore cannot be used at the same time" msgstr "\"-konly\" och \"-kignore\" kan ej användas samtidigt" #: src/dar_suite/command_line.cpp:544 msgid "-p and -Q options are mutually exclusives" msgstr "" #: src/dar_suite/command_line.cpp:547 #, fuzzy msgid "-vf is only useful with -c option" msgstr "-wa alternativ är användbart bara med alternativet -x" #: src/dar_suite/command_line.cpp:589 #, fuzzy msgid "" "-Y and -Z are only useful with compression (-z option), ignoring any -Y and -" "Z option" msgstr "" "-Y och -Z är endast användbara med komprimering (-z eller -y till exempel), " "ignorerar alla -Y och -Z alternativ" #: src/dar_suite/command_line.cpp:591 #, fuzzy msgid "-m is only useful with compression (-z option), ignoring -m" msgstr "" "-m är endast användbart med komprimering (-z eller -y alternativ), ignorerar " "-m" #: src/dar_suite/command_line.cpp:641 msgid "" "-= option is valid only while saving files, thus in conjunction with -c " "option, ignoring" msgstr "" "-= alternativ är bara giltigt option under sparande av filer, sÃ¥lunda i " "samband med -c alternativ, ignorerar" #: src/dar_suite/command_line.cpp:643 msgid "" "-= option will be ignored as it is useless if you do not specify to which " "files or directories this backup hook is to be applied, thanks to -< and -> " "options. See man page for more details." msgstr "" "-= valet kommer att ignoreras dÃ¥ det är oanvändbart om du inte specificerar " "till vilka filer eller mappar denna koppling skall tillämpas, tack vare -< " "och -> valen. Se man page för ytterligare detaljer." #: src/dar_suite/command_line.cpp:649 msgid "" "backup hook feature (-<, -> or -= options) is only available when saving " "files, ignoring" msgstr "" "'backup hook' funktion (-<, -> or -= options) är bara tillgänglig vid " "sparande av filer when saving, ignorerar" #: src/dar_suite/command_line.cpp:698 msgid "-/ option is only useful with -+ option, ignoring" msgstr "-/ alternativ är användbart bara med -+ alternativ, ignoreras" #: src/dar_suite/command_line.cpp:709 msgid "" "-. option is only useful when merging, creating or isolating an archive, " "ignoring" msgstr "" "-. alternativ är endast användbart vid sammanslagning, skapande eller " "isolering av arkiv, ignorerar" #: src/dar_suite/command_line.cpp:714 #, c-format msgid "" "The following user comment will be placed in clear text in the archive: %S" msgstr "" "Följande användarkommentar kommer att placeras i klartext i arkivet: %S" #: src/dar_suite/command_line.cpp:729 msgid "Parse error: " msgstr "Analysfel: " #: src/dar_suite/command_line.cpp:772 msgid " Only one option of -c -d -t -l -C -x or -+ is allowed" msgstr " Endast ett alternativ av -c -d -t -l -C -x eller -+ är tillÃ¥tet" #: src/dar_suite/command_line.cpp:806 msgid "Only one -A option is allowed" msgstr "Endast ett -A alternativ är tillÃ¥tet" #: src/dar_suite/command_line.cpp:833 msgid "Error while parsing -A argument as a date: " msgstr "Fel vid analys av -A-argument som ett datum: " #: src/dar_suite/command_line.cpp:898 msgid "Choose only one compression algorithm" msgstr "Välj bara en komprimeringsalgoritm" #: src/dar_suite/command_line.cpp:904 msgid "-w option is useless with -n" msgstr "-w alternativ är oanvändbart med -n" #: src/dar_suite/command_line.cpp:916 msgid "Unknown argument given to -w: " msgstr "Okänt argument givet till -w: " #: src/dar_suite/command_line.cpp:936 src/dar_suite/command_line.cpp:943 #: src/dar_suite/command_line.cpp:950 msgid "\"-k\" (or \"-kignore\") and \"-konly\" are not compatible" msgstr "\"-k\" (eller \"-kignore\") och \"-konly\" är ej kompatibla" #: src/dar_suite/command_line.cpp:954 #, c-format msgid "Unknown argument given to -k : %s" msgstr "Okänt argument givet till -k : %s" #: src/dar_suite/command_line.cpp:958 msgid "Only one -R option is allowed" msgstr "Endast ett -R alternativ är tillÃ¥tet" #: src/dar_suite/command_line.cpp:1001 msgid "" "Giving to -S option the same value as the one given to -s option is useless" msgstr "" "Om man ger till -S alternativet samma värde, som det som man ger till -s " "alternativet, är det oanvändbart" #: src/dar_suite/command_line.cpp:1076 msgid "-r is useless with -n" msgstr "-r är oanvändbart med -n" #: src/dar_suite/command_line.cpp:1205 #, c-format msgid "" "File inclusion loop detected. The file %s includes itself directly or " "through other files (-B option)" msgstr "" "Slinga i filinkludering har upptäckts. Filen %s inkluderar sig själv direkt " "eller genom andra filer (-B alternativ)" #: src/dar_suite/command_line.cpp:1222 #, fuzzy, c-format msgid "Error reading included file (%s): " msgstr "I ingÃ¥ende filer %S: " #: src/dar_suite/command_line.cpp:1227 #, fuzzy, c-format msgid "Error in included file (%s): " msgstr "I ingÃ¥ende filer %S: " #: src/dar_suite/command_line.cpp:1245 src/dar_suite/command_line.cpp:2476 #: src/dar_suite/command_line.cpp:2553 #, c-format msgid "In included file %S: " msgstr "I ingÃ¥ende filer %S: " #: src/dar_suite/command_line.cpp:1288 #, c-format msgid "" "%d is the default value for -m, no need to specify it on command line, " "ignoring" msgstr "" "%d är standardvärdet för -m, inget behov att specificera det pÃ¥ " "kommandoraden, ignorerar" #: src/dar_suite/command_line.cpp:1305 msgid "" "--nodump feature has not been activated at compilation time, it is thus not " "available" msgstr "" "--nodump-funktionen har ej aktiverats vid kompileringstillfället, sÃ¥lunda är " "den ej tillgängligt" #: src/dar_suite/command_line.cpp:1321 msgid "Argument given to -H is not a positive integer number" msgstr "Det argument, som ges till -H, är inte ett positivt heltal" #: src/dar_suite/command_line.cpp:1374 msgid "" "-ak option need not be specified more than once, ignoring extra -ak options" msgstr "" "-ak alternativ behöver inte specificeras mer än en gÃ¥ng, ignorer extra ak " "alternativ" #: src/dar_suite/command_line.cpp:1380 msgid "-af must be present before -A option not after!" msgstr "-af mÃ¥ste finnas före -A alternativ inte efter!" #: src/dar_suite/command_line.cpp:1382 msgid "" "-af option need not be specified more than once, ignoring extra -af options" msgstr "" "-af alternativ behöver inte specificeras mer än en gÃ¥ng, ignorer extra af " "alternativ" #: src/dar_suite/command_line.cpp:1406 #, c-format msgid "Unknown argument given to -a : %s" msgstr "Okänt argument givet till -a : %s" #: src/dar_suite/command_line.cpp:1421 msgid "" "Warning: -G option is an experimental and unsupported feature, read man page " "about -G option for more information" msgstr "" #: src/dar_suite/command_line.cpp:1450 msgid "Only one -@ option is allowed" msgstr "Endast ett -@ alternativ är tillÃ¥tet" #: src/dar_suite/command_line.cpp:1506 msgid "Syntax error in overwriting policy: " msgstr "Syntaxfel i överskrivningspolicy: " #: src/dar_suite/command_line.cpp:1539 #, c-format msgid "" "%d is the default value for --sparse-file-min-size, no need to specify it on " "command line, ignoring" msgstr "" "%d är standardvärdet för --sparse-file-min-size, inget behov att specificera " "det pÃ¥ kommandoraden, ignorerar" #: src/dar_suite/command_line.cpp:1560 #, c-format msgid "Unknown argument given to -2 : %s" msgstr "Okänt argument givet till -2 : %s" #: src/dar_suite/command_line.cpp:1620 msgid "Error while parsing --min-digits option: " msgstr "Fel vid analys av --min-digits alternativ: " #: src/dar_suite/command_line.cpp:1626 msgid "Missing argument to --backup-hook-execute" msgstr "Saknar argument till --backup-hook-execute" #: src/dar_suite/command_line.cpp:1708 #, c-format msgid "" "usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] " "[options...]\n" msgstr "" "Användning: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] " "[alternativ...]\n" #: src/dar_suite/command_line.cpp:1712 #, c-format msgid "Commands are:\n" msgstr "Kommandona är:\n" #: src/dar_suite/command_line.cpp:1713 #, c-format msgid " -c creates an archive\n" msgstr " -c skapar ett arkiv\n" #: src/dar_suite/command_line.cpp:1714 #, c-format msgid " -x extracts files from the archive\n" msgstr " -x extraherar filer frÃ¥n arkivet\n" #: src/dar_suite/command_line.cpp:1715 #, c-format msgid " -d compares the archive with the existing filesystem\n" msgstr " -d jämför arkivet med existerande filsystem\n" #: src/dar_suite/command_line.cpp:1716 #, c-format msgid " -t tests the archive integrity\n" msgstr " -t testar arkivets integritet\n" #: src/dar_suite/command_line.cpp:1717 #, c-format msgid " -l lists the contents of the archive\n" msgstr " -l listar innehÃ¥llet i arkivet\n" #: src/dar_suite/command_line.cpp:1718 #, c-format msgid " -C isolates the catalogue from an archive\n" msgstr " -C isolerar katalogen frÃ¥n ett arkiv\n" #: src/dar_suite/command_line.cpp:1719 #, c-format msgid " -+ merge two archives / create a sub archive\n" msgstr " -+ sammanfoga tvÃ¥ arkiv / skapa ett underarkiv\n" #: src/dar_suite/command_line.cpp:1721 #, c-format msgid " -h displays this help information\n" msgstr " -h visar denna hjälpinformation\n" #: src/dar_suite/command_line.cpp:1722 #, c-format msgid " -V displays version information\n" msgstr " -V visar versionsinformation\n" #: src/dar_suite/command_line.cpp:1725 #, c-format msgid " -v\t\t verbose output\n" msgstr " -v\t\t detaljerade utdata\n" #: src/dar_suite/command_line.cpp:1726 #, c-format msgid " -q\t\t suppress final statistics report\n" msgstr " -q\t\t undertryck slutgiltig statistikrapport\n" #: src/dar_suite/command_line.cpp:1727 #, c-format msgid " -vs\t\t display skipped files\n" msgstr " -vs\t\t visa överhoppade filer\n" #: src/dar_suite/command_line.cpp:1728 #, c-format msgid " -R \t filesystem root directory (current dir by default)\n" msgstr " -R \t filsystemets rotmapp (gällande mapp som standard)\n" #: src/dar_suite/command_line.cpp:1729 #, c-format msgid "" " -X \t files to exclude from the operation (none by default)\n" msgstr "" " -X \t filer som skall uteslutas frÃ¥n Ã¥tgärden (inga som " "standard)\n" #: src/dar_suite/command_line.cpp:1730 #, c-format msgid " -I \t files to include in the operation (all by default)\n" msgstr "" " -I \t filer som skall inkluderas i Ã¥tgärden (alla som standard)\n" #: src/dar_suite/command_line.cpp:1731 #, c-format msgid " -P \t subdirectory to exclude from the operation\n" msgstr " -P \t mapp som skall utelutas i Ã¥tgärden\n" #: src/dar_suite/command_line.cpp:1732 #, c-format msgid " -g \t subdirectory to include in the operation\n" msgstr " -g \t mapp som skall inkluderas i Ã¥tgärden\n" #: src/dar_suite/command_line.cpp:1733 #, c-format msgid " -[ filename contains a list of files to include\n" msgstr "" " -[ \t filnamn innehÃ¥ller en lista pÃ¥ filer som skall tas med\n" #: src/dar_suite/command_line.cpp:1734 #, c-format msgid " -] \t filename contains a list of files to exclude\n" msgstr "" " -] \t filnamn innehÃ¥ller en lista pÃ¥ filer som skall " "uteslutas\n" #: src/dar_suite/command_line.cpp:1737 #, c-format msgid " -wa\t\t don't warn before overwriting and removing files\n" msgstr " -wa\t\t varna inte vid överskrivning och borttagande av filer\n" #: src/dar_suite/command_line.cpp:1739 #, c-format msgid "" " -O[ignore-owner | mtime | inode-type] do not consider user and group\n" msgstr "" " -O[ignorera-ägare | mtime | inode-typ] beakta inte ägare och grupp\n" #: src/dar_suite/command_line.cpp:1740 #, c-format msgid "\t\t ownership\n" msgstr "\t\t ägarskap\n" #: src/dar_suite/command_line.cpp:1741 #, c-format msgid " -H [N]\t ignore shift in dates of an exact number of hours\n" msgstr " -H [N]\t ignorera datumbyte pÃ¥ en fixt antal timmar\n" #: src/dar_suite/command_line.cpp:1742 #, c-format msgid " -E \t command to execute between slices\n" msgstr " -E \t kommadon som skall utföras mellan delar\n" #: src/dar_suite/command_line.cpp:1743 #, c-format msgid " -F \t same as -E but for the archive of reference\n" msgstr " -F \t spara som -E men för referensarkivet\n" #: src/dar_suite/command_line.cpp:1744 #, c-format msgid " -u \t mask to ignore certain EA\n" msgstr " -u \t mask för att ignorera viss EA\n" #: src/dar_suite/command_line.cpp:1745 #, c-format msgid " -U \t mask to allow certain EA\n" msgstr " -U \t mask för att tillÃ¥ta viss EA\n" #: src/dar_suite/command_line.cpp:1746 #, c-format msgid " -K \t use as key to encrypt/decrypt\n" msgstr "" " -K \t använd som nyckel för att kryptera/dekryptera\n" #: src/dar_suite/command_line.cpp:1747 #, c-format msgid "" " -J \t same as -K but it does concern the archive of reference\n" msgstr " -J \t samma som -K men det avser referensarkivet\n" #: src/dar_suite/command_line.cpp:1748 #, c-format msgid " -# encryption block size\n" msgstr " -# \t krypteringsblockstorlek\n" #: src/dar_suite/command_line.cpp:1749 #, c-format msgid " -* same as -# but for archive of reference\n" msgstr " -* \t samma som -# men för referensarkivet\n" #: src/dar_suite/command_line.cpp:1750 #, c-format msgid " -B read options from given file\n" msgstr " -B \t läs alternativ frÃ¥n angiven fil\n" #: src/dar_suite/command_line.cpp:1751 #, c-format msgid " -N\t\t do not read ~/.darrc nor /etc/darrc configuration file\n" msgstr "" " -N\t\t läs inte ~/.darrc eller /etc/darrc inställningsparameterfil\n" #: src/dar_suite/command_line.cpp:1752 #, c-format msgid " -e\t\t dry run, fake execution, nothing is produced\n" msgstr " -e\t\t torrsim, fejkad exekvering, inget är producerat\n" #: src/dar_suite/command_line.cpp:1753 #, c-format msgid " -Q\t\t suppress the initial warning when not launched from a tty\n" msgstr " -Q\t\t undertyck begynnelsevarningen om ej startad frÃ¥n en tty\n" #: src/dar_suite/command_line.cpp:1754 #, c-format msgid " -aa\t\t do not try to preserve atime of file open for reading.\n" msgstr " -aa\t\t bevara inte 'atime' hos en läsöppnad fil.\n" #: src/dar_suite/command_line.cpp:1755 #, c-format msgid " -ac\t\t do not try to preserve ctime (default behavior).\n" msgstr " -ac\t\t bevara inte 'ctime' (standarduppträdande).\n" #: src/dar_suite/command_line.cpp:1756 #, c-format msgid " -am\t\t set ordered mode for all filters\n" msgstr " -am\t\t ställ in 'ordered mode' för alla filter\n" #: src/dar_suite/command_line.cpp:1757 #, c-format msgid " -an\t\t the masks that follow are now case insensitive\n" msgstr "" " -an\t\t efterföljande masker är okänsliga för liten/stor bokstav\n" #: src/dar_suite/command_line.cpp:1758 #, c-format msgid " -acase\t the masks that follow are now case sensitive\n" msgstr "" " -acase\t efterföljande masker är känsliga för liten/stor bokstav\n" #: src/dar_suite/command_line.cpp:1759 #, c-format msgid " -ar\t\t set the following masks to be regex expressions\n" msgstr " -ar\t\t ställ in följande masker att vara reguljära uttryck\n" #: src/dar_suite/command_line.cpp:1760 #, c-format msgid " -ag\t\t set the following masks to be glob expressions\n" msgstr " -ag\t\t ställ in följande masker att vara 'glob expressions'\n" #: src/dar_suite/command_line.cpp:1762 #, c-format msgid "Saving / Isolation / merging options (to use with -c, -C or -+):\n" msgstr "" "Sparande- / Isolations- / sammanfogningsalternativ (att användas med -c, -C " "eller -+):\n" #: src/dar_suite/command_line.cpp:1763 #, c-format msgid " -A [path/] archive to take as reference\n" msgstr " -A [sökväg/] arkiv att ta som referens\n" #: src/dar_suite/command_line.cpp:1764 #, c-format msgid " -@ [path/] auxiliary archive of reference for merging\n" msgstr " -@ [sökväg/] referenshjälparkiv för sammanslagning\n" #: src/dar_suite/command_line.cpp:1765 #, c-format msgid " -$ \t encryption key for auxiliary archive\n" msgstr " -$ \t krypteringsnyckel för hjälparkiv\n" #: src/dar_suite/command_line.cpp:1766 #, c-format msgid " -~ \t command between slices of the auxiliary archive\n" msgstr " -~ \t kommando mellan avsnitt hos hjälparkivet\n" #: src/dar_suite/command_line.cpp:1767 #, fuzzy, c-format msgid " -z [[algo:]level]\t compress data in archive. -z = -z9 = -zgzip:9\n" msgstr " -z [nivÃ¥]\t komprimera data i ett arkiv med gzip-algoritm\n" #: src/dar_suite/command_line.cpp:1768 #, c-format msgid "" " Available algo: gzip,bzip2,lzo,xz. Exemples: -zlzo -zxz:5 -z1 -z\n" msgstr "" #: src/dar_suite/command_line.cpp:1770 #, c-format msgid " -S first file size (if different from following ones)\n" msgstr "" " -S \t första filens storlek (om skild frÃ¥n de efterföljandes)\n" #: src/dar_suite/command_line.cpp:1774 #, c-format msgid " -D\t\t excluded directories are stored as empty directories\n" msgstr " -D\t\t uteslutna mappar lagras som tomma mappar\n" #: src/dar_suite/command_line.cpp:1775 #, c-format msgid " -Z \t do not compress the matching filenames\n" msgstr " -Z \t komprimera inte de matchande filnamnen\n" #: src/dar_suite/command_line.cpp:1776 #, c-format msgid " -Y \t do only compress the matching filenames\n" msgstr " -Y \t komprimera endast de matchande filnamnen\n" #: src/dar_suite/command_line.cpp:1777 #, c-format msgid " -m \t do not compress file smaller than \n" msgstr " -m \t komprimera inte filer mindre än \n" #: src/dar_suite/command_line.cpp:1778 #, c-format msgid " --nodump\t do not backup, files having the nodump 'd' flag set\n" msgstr " --nodump\t tag ej med filer med 'nodump'-flaggan 'd' satt\n" #: src/dar_suite/command_line.cpp:1779 #, c-format msgid "" " -@ [path/] Do on-fly catalogue isolation of the resulting " "archive\n" msgstr "" " -@ [sökväg/] Gör katalogisolation av det resulterande arkivet " "i flykten\n" #: src/dar_suite/command_line.cpp:1780 #, c-format msgid " -M\t\t stay in the same filesystem while scanning directories\n" msgstr " -M\t\t stanna i samma filsysytem medan mappar avsöks\n" #: src/dar_suite/command_line.cpp:1781 #, c-format msgid " -,\t\t ignore directories that follow the Directory Tagging\n" msgstr " -,\t\t ignorera mappar som följer \"Directory Tagging\"\n" #: src/dar_suite/command_line.cpp:1782 #, c-format msgid "\t\t Standard\n" msgstr "\t\t Standard\n" #: src/dar_suite/command_line.cpp:1783 #, c-format msgid "" " -/ \t which way dar can overwrite files at archive merging or\n" msgstr "" " -/ \t pÃ¥ vilket sätt dar kan skriva över filer vid ihopslagning " "av arkiv eller\n" #: src/dar_suite/command_line.cpp:1784 #, c-format msgid "\t\t extraction time\n" msgstr "\t\t uthämtningstillfälle\n" #: src/dar_suite/command_line.cpp:1787 #, c-format msgid "Restoring options (to use with -x) :\n" msgstr "Ã…terställningsalternativ (att användas vid -x) :\n" #: src/dar_suite/command_line.cpp:1788 #, c-format msgid " -k\t\t do not remove files destroyed since the reference backup\n" msgstr "" " -k\t\t tag ej bort filer, förstörda sedan referenssäkerhetskopian\n" #: src/dar_suite/command_line.cpp:1789 #, c-format msgid " -r\t\t do not restore file older than those on filesystem\n" msgstr " -r\t\t Ã¥terställ ej filer som är äldre än de i filsystemet\n" #: src/dar_suite/command_line.cpp:1790 #, c-format msgid " -f\t\t do not restore directory structure\n" msgstr " -f\t\t Ã¥terställ ej mappstrukturen\n" #: src/dar_suite/command_line.cpp:1792 #, c-format msgid "Reading options (to use with -x, -d, -t, -l, -A)\n" msgstr "Läsalternativ (att användas vid -x, -d, -t, -l, -A)\n" #: src/dar_suite/command_line.cpp:1793 #, c-format msgid "" " -i pipe to use instead of std input to read data from " "dar_slave\n" msgstr "" " -i rör som används i stället för 'std input' till att " "läsa data frÃ¥n 'dar_slave'\n" #: src/dar_suite/command_line.cpp:1794 #, c-format msgid "" " -o pipe to use instead of std output to orders dar_slave\n" msgstr "" " -o rör som används i stället för 'std output' till att " "berordra 'dar_slave'\n" #: src/dar_suite/command_line.cpp:1796 #, c-format msgid "Listing options (to use with -l):\n" msgstr "Listalternativ (att användas vid -l):\n" #: src/dar_suite/command_line.cpp:1797 #, c-format msgid " -T\t\t tree output format\n" msgstr " -T\t\t trädformat pÃ¥ utmatning\n" #: src/dar_suite/command_line.cpp:1798 #, c-format msgid " -as\t\t only list files saved in the archive\n" msgstr " -as\t\t lista bara filer som sparats i arkivet\n" #: src/dar_suite/command_line.cpp:1799 #, c-format msgid "" "\n" "\n" msgstr "" "\n" "\n" #: src/dar_suite/command_line.cpp:1800 #, fuzzy, c-format msgid "" "Type \"man dar\" for more details and for all other available options.\n" msgstr "" "Skriv \"man dar\" för ytterligare detaljer och för alla tillgängliga " "alternativ.\n" #: src/dar_suite/command_line.cpp:2166 #, c-format msgid " Using libdar %u.%u.%u built with compilation time options:" msgstr "" " Använder libdar med %u.%u.%u byggt med kompileringstillfällets alternativ:" #: src/dar_suite/command_line.cpp:2167 #, c-format msgid " Using libdar %u.%u built with compilation time options:" msgstr "" " Använder libdar med %u.%u byggt med kompileringstillfällets alternativ:" #: src/dar_suite/command_line.cpp:2378 #, c-format msgid "Arguments read from %S :" msgstr "Argument läses frÃ¥n %S :" #: src/dar_suite/command_line.cpp:2871 #, c-format msgid "" "%s does not name a compression \"[algorithm][:][level]\" , like for examples " "\"gzip\", \"lzo\", \"bzip2\", \"lzo:3\", \"gzip:2\", \"8\" or \"1\". Please " "review the man page about -z option" msgstr "" "%s namnger inte en kompression \"[algoritm][:][nivÃ¥]\" , sÃ¥som t. ex. \"gzip" "\", \"lzo\", \"bzip2\", \"lzo:3\", \"gzip:2\", \"8\" eller \"1\". Titta pÃ¥ " "man page om -z alternativ" #: src/dar_suite/command_line.cpp:2890 msgid "Compression level must be between 1 and 9, included" msgstr "KomprimeringsnivÃ¥n mÃ¥ste ligga mellan 1 och 9 inklusive" #: src/dar_suite/command_line.cpp:2918 msgid "unknown FSA family: " msgstr "" #: src/dar_suite/command_line.cpp:2950 #, c-format msgid "" "User target named \"%s\" is not allowed (reserved word for conditional " "syntax)" msgstr "" "AnvändarmÃ¥l kallat \"%s\" är ej tillÃ¥tet (reseverat ord för villkorssyntax)" #: src/check/all_features.cpp:54 msgid "-" msgstr "" #, fuzzy #~ msgid "Error met while feeding data to librsync: " #~ msgstr "Fel uppstÃ¥tt vid bearbetande av Ã¥tgärd: " #, fuzzy #~ msgid "Error releasing librsync job: " #~ msgstr "Fel vid läsning av EA för " #, fuzzy #~ msgid "nullptr argument given to \"sauv_path\"" #~ msgstr "Tomt argument give till \"sauv_path\"" #, fuzzy #~ msgid "nullptr argument given to \"filename\"" #~ msgstr "Tomt argument givet till \"filename\"" #, fuzzy #~ msgid "nullptr argument given to \"extension\"" #~ msgstr "Tomt argument givet till \"extension\"" #~ msgid "Strong encryption support" #~ msgstr "Stöd för stark kryptering" #~ msgid " -j\t\t ask user what to do when memory is exhausted\n" #~ msgstr "" #~ " -j\t\t frÃ¥ga användaren vad som skall göras dÃ¥ minnet är slut\n" #, fuzzy #~ msgid "" #~ "------------------+----------------" #~ "+----------------------------------------+-------------------------+" #~ msgstr "--------------+-------------------------+-----------------------\n" #, fuzzy #~ msgid "" #~ "---------------+------+-------+-------+-------------------------------" #~ "+------------------------------+-----------\n" #~ msgstr "--------------+-------------------------+-----------------------\n" #, fuzzy #~ msgid "" #~ "-----------------------------+------------+-------+-------+-------" #~ "+-------------------------------+------------\n" #~ msgstr "--------------+-------------------------+-----------------------\n" #, fuzzy #~ msgid "" #~ "+-----------------+----------------" #~ "+----------------------------------------+-------------------------+" #~ msgstr "--------------+-------------------------+-----------------------\n" #~ msgid "Preparing the archive contents for isolation..." #~ msgstr "Förbereder arkivinnehÃ¥llet för isolering..." #~ msgid "Current implementation does not support this (new) crypto algorithm" #~ msgstr "Aktuell implementering stödjer ej denna (nya) krypteringsalgoritm" #~ msgid "Not supported flag or archive corruption" #~ msgstr "Ej understödd flagga eller förstört arkiv" #~ msgid "" #~ "too low value (< 10) given as observation_read_number argument while " #~ "initializing cache" #~ msgstr "" #~ "för litet värde (< 10) givet som observation_read_number- argument medan " #~ "cache initieras" #~ msgid "" #~ "too low value (< 10) given as observation_write_number argument while " #~ "initializing cache" #~ msgstr "" #~ "för litet värde (< 10) givet som observation_write_number- argument " #~ "medan cache initieras" #~ msgid "" #~ "too high value (> 50) given as unused_read_ratio argument, while " #~ "initializing cache" #~ msgstr "" #~ "för stort värde (> 50) angivet som argumentet 'unused_read_ratio', medan " #~ "cachen initieras" #~ msgid "" #~ "unused_write_ratio must be less than max_size_hit_write_ratio, while " #~ "initializing cache" #~ msgstr "" #~ "'unused_write_ratio' mÃ¥ste vara mindre än 'max_size_hit_write_ratio', " #~ "medan cachen initieras" #, fuzzy #~ msgid "" #~ "max_size must be greater or equal to initial_size, while initializing " #~ "cache" #~ msgstr "" #~ "fel värde givet till argumentet initial_size medan cachen initialiseras" #~ msgid "incompatible Zlib version" #~ msgstr "ej kompatibel Zlib-version" #~ msgid "" #~ "Could not find archive information at the end of the last slice, assuming " #~ "an old archive and trying to read at the beginning of the first slice..." #~ msgstr "" #~ "Kunde inte finna arkivinformationen i slutet an den sista delen. Antar " #~ "ett gammalt arkiv och försöker läsa frÃ¥n början av den första delen..." #~ msgid "" #~ "LAX MODE: Failed to read the archive header, I will need your help to " #~ "know what is the missing information." #~ msgstr "" #~ "LAX MODE: Misslyckades med att läsa arkivhuvudet. Behöver din hjälp för " #~ "att fÃ¥ veta vilken information, som saknas." #~ msgid "" #~ "LAX MODE: Archive format revision found is [%s] but the higher version " #~ "this binary can handle is [%s]. Thus, assuming the archive version is " #~ "corrupted and falling back to the higher version this binary can support " #~ "(%s)" #~ msgstr "" #~ "LAX MODE: Arkivets formatrevision hittat är [%s] men den högsta version " #~ "detta program kan hantera är [%s]. SÃ¥lunda antar att arkivversion är " #~ "förstörd och Ã¥tergÃ¥r till den högsta version detta program kan stödja " #~ "(%s)." #~ msgid "LAX MODE: Archive format revision found is [version %s]" #~ msgstr "LAX MODE: Hittad arkivformatsrevision är [version %s]" #~ msgid "LAX MODE: is it correct, seen the table at the following URL: %s ?" #~ msgstr "LAX MODE: är det korrekt, sett tabellen vid följande: %s ?" #, fuzzy #~ msgid "Cannot determine the permission to use for hash files: " #~ msgstr "Kan ej Ã¥terställe behörigheter för %s : %s" #~ msgid "Error opening file " #~ msgstr "Fel vid filöppning " #~ msgid "Error opening file %s : %s" #~ msgstr "Fel vid filöppning %s : %s" #~ msgid "Position out of range" #~ msgstr "Position utan för omrÃ¥de" #~ msgid "Read-write mode not supported for \"trivial_sar\"" #~ msgstr "Läs-skriv-läge ej understött för \"trivial_sar\"" #~ msgid "Cannot create database %S : %s" #~ msgstr "Kan ej skapa databas %S : %s" #~ msgid "" #~ "Thread-safe not initialized for libdar, read manual or contact maintainer " #~ "of the application that uses libdar" #~ msgstr "" #~ "'thread'safe' inte initierat för libdar, läs manualen eller kontakta den " #~ "som underhÃ¥ller libdar-tillämpningen" #~ msgid "Cannot initialize mutex: " #~ msgstr "Kan ej initiera 'mutex': " #~ msgid "Aborting operations for the EA of %S : error while adding EA %s : %s" #~ msgstr "Avbryter Ã¥tgärder för EA till %S : fel vid tillägg av EA %s : %s" #~ msgid "Aborting operations for the EAs of %S : error while removing %s : %s" #~ msgstr "Avbryter Ã¥tgärder för EA till %S : fel vid bortagande av EA %s : %s" #~ msgid "" #~ " -z [bzip2[:level]] compress data in archive using bzip2 algorithm.\n" #~ msgstr "" #~ " -z [bzip2[:level]] komprimera data i ett arkiv med bzip2-algoritm\n" #~ msgid "" #~ "No more (virtual) memory available, you have the opportunity to stop un-" #~ "necessary applications to free up some memory. Can we continue now ?" #~ msgstr "" #~ "Inget ytterligare (virtuellt) minne tillgängligt. du har möjligheter att " #~ "stoppa onödvändiga tillämpningar sÃ¥ att minne kan frigöras. Kan vi " #~ "fortsätta nu?" #~ msgid "Cannot open file %S : %s" #~ msgstr "Kan ej öppna fil %S : %s" #~ msgid "User target found on command line:" #~ msgstr "AnvändarmÃ¥l funnet pÃ¥ kommandorad:" #~ msgid "" #~ "Note that -y option is deprecated it will be removed in future release, " #~ "please use -z option instead (read man page for details)" #~ msgstr "" #~ "Märk att -y alternativet är ersatt och kommer att tas bort i framtida " #~ "utgÃ¥vor." #~ msgid "Choose either -z or -y not both" #~ msgstr "Välj antingen -z eller -y ej bägge" #~ msgid "" #~ "-G option is obsolete, use -@ option instead, see man page for details" #~ msgstr "" #~ "-G alternativet är utgÃ¥nget, använd -@ alternativet i stället, se man " #~ "page för detaljer" #~ msgid "NULL given as argument" #~ msgstr "Tomt givet som argument" #~ msgid "NULL argument given to \"fs_root\"" #~ msgstr "Tomt argument givet till \"fs_root\"" #~ msgid "NULL argument given to \"selection\"" #~ msgstr "Tomt argument givet till \"selection\"" #~ msgid "NULL argument given to \"subtree\"" #~ msgstr "Tomt argument givet till \"subtree\"" #~ msgid "NULL argument given to \"execute\"" #~ msgstr "Tomt argument givet till\"utför\"" #~ msgid "NULL argument given to \"compr_mask\"" #~ msgstr "Tomt argument givet till \"compr_mask\"" #~ msgid "NULL argument given to \"min_compr_size\"" #~ msgstr "Tomt argument givet till \"min_compr_mask\"" #~ msgid "NULL argument given to \"ea_mask\"" #~ msgstr "Tomt argument givet till \"ea_mask\"" #~ msgid "Cannot determine location of the end of cyphered data: " #~ msgstr "Kan ej bestämma slutet pÃ¥ chiffrerade data: " #~ msgid "Argument given to \"major\" is a NULL pointer" #~ msgstr "Argument givet till \"major\" är en NULL-pekare" #~ msgid "Argument given to \"minor\" is a NULL pointer" #~ msgstr "Argument givet till \"minor\" är en NULL-pekare" #~ msgid "Argument given to \"medium\" is a NULL pointer" #~ msgstr "Argument givet till \"medium\" är en NULL-pekare" #~ msgid "argument given to \"minor\" is a NULL pointer" #~ msgstr "argument givet till \"minor\" är en NULL-pekare" #~ msgid "invalid NULL argument given as mask option" #~ msgstr "ogiltigt NULL-argument givet som maskalternativ" #~ msgid "invalid NULL argument given as crit_action option" #~ msgstr "ogiltigt NULL-argument givet som crit_cation alternativ" #~ msgid "-~ is only available with -+ option and -c options" #~ msgstr "-~ är bara tillgängligt med -+ och -c alternativ" #~ msgid "End of file reached while skipping to the begin of a word" #~ msgstr "Filslut uppnÃ¥tt vid överhoppande till början av ett ord" #, fuzzy #~ msgid "Reached end of file while reading a word" #~ msgstr "NÃ¥tt filslut vid läsning av delsäkerhetskopiehuvud" #~ msgid "different file data" #~ msgstr "olika fildata" #~ msgid "" #~ "Archive format older than \"08\" (release 2.4.0) cannot be read through a " #~ "single pipe, only using dar_slave or normal plain file (slice) method" #~ msgstr "" #~ "Arkivformat äldre än \"08\" (utgÃ¥va 2.4.0) kan ej läsas genom ett ensamt " #~ "rör, bara genom dar_slave eller normal planfilsmetod" #~ msgid "unary operator" #~ msgstr "unary operator" #~ msgid "Corrupted database, empty entry found" #~ msgstr "Förstörd databas, tom post funnen" #~ msgid "Reached End of File while reading CRC data" #~ msgstr "NÃ¥tt filslut vid läsning av CRC-data" #~ msgid "Error checking for presence of file " #~ msgstr "Fel vid kontroll av filbefintlighet " #~ msgid "Extended Attribute of file not found in database: " #~ msgstr "Extended Attribute för fil ej hittad i databas: " #~ msgid "" #~ "Could not create caching layer to improve performance while writing down " #~ "the archive contents, using the defaut slow method" #~ msgstr "" #~ "Kunde inte skapa ett 'caching'-lager för att förbättra prestanda under " #~ "skrivning av arkivinnehÃ¥llet, använder den lÃ¥ngsamma standardmetoden" #~ msgid "\"-k\" and \"-konly\" are not compatible" #~ msgstr "\"-k\" och \"-konly\" är ej kompatibla" #~ msgid "Reading config file: " #~ msgstr "Läser inställningsfil: " #~ msgid " Total number of item(s) considered: %i\n" #~ msgstr " Total antal övervägda företeelse(r): %i\n" #~ msgid "Unknown TLV type" #~ msgstr "Okänd TLV-typ" #~ msgid "different owner" #~ msgstr "annan ägare" #~ msgid " Extended Attribute: [" #~ msgstr " Extended Attribut: [" #~ msgid "LAX MODE: Failed to read the catalogue (zero byte length archive)" #~ msgstr "" #~ "LAX MODE: Misslyckades med att läsa katalogen (arkiv med längden 0 byte)" #~ msgid "Empty string is an invalid label, cannot clear it" #~ msgstr "Tom sträng är en ogiltigt etikett, kan ej rensa den" #~ msgid "An empty string is an invalid label, cannot add it" #~ msgstr "En tom sträng är en ogiltigt etikett, kan ej lägga till" #~ msgid "Label already used in stack, cannot add it" #~ msgstr "Etikett redan använd i stack, kan ej lägga till" #~ msgid "Bad file descriptor given" #~ msgstr "Felaktig fildeskriptor erhÃ¥llen" #~ msgid "%s cannot be restricted to %s" #~ msgstr "%s kan ej begränsas till %s" #~ msgid "Adding hard link to archive: " #~ msgstr "Lägger till hÃ¥rd länk till arkiv: " #~ msgid "can't read CRC data" #~ msgstr "kan inte läsa CRC-data" #~ msgid "" #~ "The iterator is not indexing the object it has been asked to insert byte " #~ "into" #~ msgstr "" #~ "'Iteratorn' indexerar inte det objekt den har blivit ombedd att sätta in " #~ "byte i" #~ msgid "zip compression not implemented" #~ msgstr "zip-komprimering inte implementerad" #~ msgid "Not overwritten dar_manager_show_version() method has been called!" #~ msgstr "" #~ "Ingen överskriven \"dar_manager_show_version()\"-metod har anropats!" #~ msgid "" #~ "Not overwritten listing() method called with: (%S, %S, %S, %S, %S, %S, " #~ "%S, %s, %s)" #~ msgstr "" #~ "Ingen överskriven listing()-metod anropad med: (%S, %S, %S, %S, %S, %S, " #~ "%S, %s, %s)" #~ msgid "Not overwritten dar_manager_show_files() method has been called!" #~ msgstr "Ingen överskriven \"dar_manager_show_files()\"-metod har anropats!" #~ msgid "Not overwritten dar_manager_contents() method has been called!" #~ msgstr "Ingen överskriven \"dar_manager_contents()\"-metod har anropats!" #~ msgid "Not overwritten dar_manager_statistics() method has been called!" #~ msgstr "Ingen överskriven \"dar_manager_statistics()\"-metod har anropats!" #~ msgid "%%%c is not implemented in tools_printf format argument" #~ msgstr "%%%c är inte implementerat i 'tools_printf'-s formatargument" #~ msgid "ERROR removing file %s : %s" #~ msgstr "FEL vid borttagande av fil %s : %s" #~ msgid "Cannot get inode information for: " #~ msgstr "Kan ej fÃ¥ inodinformation för : " #~ msgid "Reached EOF while reading a word" #~ msgstr "NÃ¥tt EOF vid läsning av ett ord" #, fuzzy #~ msgid "Invalid archive numnber" #~ msgstr "Ogiltigt arkivnummer: " #~ msgid "No backup file is present in " #~ msgstr "Ingen säkerhetskopiefil finns i " #, fuzzy #~ msgid "Error while activating secure memory for libgcrypt: %s/%s" #~ msgstr "Fel vid läsning av användarsvar frÃ¥n terminal: " #~ msgid "-G option is only available with -c or -+ options" #~ msgstr "-G alternativ är endast tillgängligt med -c or -+ alternativ" #~ msgid "\"-\" not allowed with -G option" #~ msgstr "\"-\" ej tillÃ¥tet med alternativ -G" #~ msgid "NULL argument given to \"pass\"" #~ msgstr "Tomt argument givet till \"pass\"" #~ msgid "Cannot convert the string to integer, overflow" #~ msgstr "Kan inte omvandla sträng till heltal, spill" #~ msgid "Some file could not be saved" #~ msgstr "NÃ¥gon fil kunde inte sparas" #, fuzzy #~ msgid "" #~ " with %i hard link(s) treated (including those excluded by filters)\n" #~ msgstr " %i inod(er) ignorerad(e) (uteslutna av filter)\n" #~ msgid " total number of hard links : %i\n" #~ msgstr " antal hÃ¥rda länkar : %i\n" #~ msgid "" #~ "SSL returned Message Authentication Code (MAC) has an incoherent size " #~ "with provided parameters" #~ msgstr "" #~ "SSL svarade \"Message Authentication Code (MAC)\" har en icke passande " #~ "storlek jämfört med lämnade parametrar" #~ msgid "New blowfish implementation support" #~ msgstr "Nytt stöd för 'blowfish" #~ msgid "libssl call failed: EVP_DigestInit_ex failed" #~ msgstr "libssl-anrop misslyckades: EVP_DigestInit_ex failed" #~ msgid " New Blowfish implementation: %s\n" #~ msgstr " Ny Blowfish-implementering: %s\n" #~ msgid "" #~ "Warning, the following options -[ , -], -P and -g are not used with -l " #~ "(listing) operation" #~ msgstr "" #~ "Varning, följande alternativ -[ , -], -P och -g används ej med -l " #~ "(listnings) operation" #~ msgid "Unknown argument : %s" #~ msgstr "Okänt argument : %s" #~ msgid "Cannot open file %s : %s" #~ msgstr "Kan ej öppna fil %s : %s" #~ msgid " %i inode(s) less recent than the one on filesystem\n" #~ msgstr " %i inod(er) mindre nya än den/de i filsystem\n" #~ msgid "All EA for %S are about to be erased before restoration, continue ?" #~ msgstr "" #~ "Alla EA för %S skall till att raderas före Ã¥terställande, fortsätta ?" #~ msgid "EA for %S will not be restored (overwriting not allowed)" #~ msgstr "EA för %S kommer inte att Ã¥terställas, (överskrivning ej tillÃ¥ten)" #~ msgid "%S will not be remove from filesystem, overwriting not allowed" #~ msgstr "" #~ "%S kommer ej att flyttas frÃ¥n filsystemet, överskrivning ej tillÃ¥ten" #~ msgid "%S has not been overwritten (action not allowed)" #~ msgstr "%S har ej skrivits över (Ã¥tgärden ej tillÃ¥ten)" #~ msgid "%S is about to be removed and replaced by a directory, OK ?" #~ msgstr "%S skall till att tas bort och ersättas med en mapp, OK ?" #~ msgid "" #~ "%S could not be restored, because a file of that name exists and " #~ "overwrite is not allowed" #~ msgstr "" #~ "%S kunde ej Ã¥terställas, ty en fil med samma namn finns och överskrivning " #~ "är ej tillÃ¥ten" #, fuzzy #~ msgid "Cannot temporary change permissions of %S : " #~ msgstr "Kan ej temporärt ändra behörigheter för %S : " #~ msgid "[ REMOVED ]" #~ msgstr "[ FLYTTAD ]" #~ msgid "cannot dump CRC data to file" #~ msgstr "kan inte skriva CRC-data till fil" #~ msgid "Removing file: " #~ msgstr "Tar bort fil: " #~ msgid "Error while restoring EA for " #~ msgstr "Fel vid Ã¥terställande av EA för " #~ msgid "Badly formatted SAR header" #~ msgstr "Felaktigt formaterat SAR-huvud" #~ msgid "Cannot write data to file" #~ msgstr "Kan ej skriva data till fil" #~ msgid "Cannot open file %s: %s" #~ msgstr "Kan ej öppna fil %s : %s" #~ msgid "Cannot read file %s : %s" #~ msgstr "Kan ej läsa fil %s : %s" #~ msgid "" #~ "Both arguments are not NULL, please choose one or the other, not both" #~ msgstr "" #~ "Bägge argumenten är inte tomma, välj det ena eller det andra, ej bägge" #~ msgid "Cannot read from file, both arguments are NULL" #~ msgstr "Kan ej läsa frÃ¥n fil, bägge argumenten är NULL" #~ msgid "Error reading data: " #~ msgstr "Fel vid läsning av data: " #~ msgid "Cannot write any byte to file, filesystem is full? Please check!" #~ msgstr "Kan ej skriva nÃ¥gon byte till fil, fullt filsystem?, Kontrollera!" #~ msgid "" #~ "Position out of range, must call \"skip\" method from trivial_sar object " #~ "not from its \"reference\"" #~ msgstr "" #~ "Position är utanför gränser, mÃ¥ste anropa \"skip\"-metod frÃ¥n trivial_sar-" #~ "objekt inte frÃ¥n dess \"referens\"" #~ msgid "Error while calling execvp:" #~ msgstr "Fel vid anrop av execvp:" #~ msgid "Extracting contents of the archive..." #~ msgstr "Extraherar innehÃ¥llet i arkivet..." #, fuzzy #~ msgid "Cannot skip in an (anonymous) pipe" #~ msgstr "Kan ej hoppa över vid filslut" #, fuzzy #~ msgid "Error while writing data to anonymous pipe: " #~ msgstr "Fel vid skrivning av data till ett rör: " #~ msgid "" #~ "-E is not possible (and useless) without slicing (-s option), -E will be " #~ "ignored" #~ msgstr "" #~ "-E är ej möjligt (och oanvändbart) utan delning (-s alternativ), -E " #~ "ignoreras" #~ msgid "Compressing and writing back database header to file..." #~ msgstr "Komprimerar och skriver tillbaka databas till fil..." #~ msgid "NULL argument given to \"hourshift\"" #~ msgstr "Tomt argument givet till \"hourshift\"" #~ msgid "Archive contents size in archive : %i bytes\n" #~ msgstr "Arkivets totala storlek är : %i byte\n" #~ msgid "root has no parent directory, cannot change to it" #~ msgstr "rot har inte nÃ¥gon föräldramapp, kan ej byta till den" #~ msgid "Archive number | Data | EA\n" #~ msgstr "Arkiv nummer | Data | EA\n" #~ msgid "" #~ "Concerning file %S : archive #%d contains the most recent data and some " #~ "old EA while archive #%d contains the most recent EA only." #~ msgstr "" #~ "AngÃ¥ende fil %S : arkiv #%d innehÃ¥ller de senaste data och nÃ¥gra gamla " #~ "EA medan arkiv #%d innehÃ¥ller det senaste EA enbart." #~ msgid "" #~ "Dar manager will always restore files from the archives in the order they " #~ "have been added in database, thus, for this file, last EA version, will " #~ "be overwritten by the older version associated with saved data." #~ msgstr "" #~ "Dar kommer alltid att Ã¥terställa filer frÃ¥n arkiven i den ordning de " #~ "lades till i databasen, sÃ¥lunda för denna fil kommer senaste EA version " #~ "att skrivas över av den äldre versionen sammakopplad med sparade data." #~ msgid "" #~ "To avoid such type of problem, reorder the archive in the database to " #~ "have the most recent ones having the higher index number" #~ msgstr "" #~ "För att undvika dylika problem bör arkiven i databasen sorteras om sÃ¥ att " #~ "det senaste har det högsta indextalet" #~ msgid "CALLING DAR: " #~ msgstr "ANROPAR DAR: " #~ msgid "Removing references to saved data from catalogue..." #~ msgstr "Tar bort referenser till sparade data frÃ¥n katalog..." #~ msgid " File already present in archive" #~ msgstr "Fil finns redan i arkiv" #~ msgid "A problem occurred while opening header of file %s: %S. Try again?" #~ msgstr "" #~ "Ett problem uppstod bid öppning filhuvud till filen %s: %S, Försöka igen?" #~ msgid " . Ignore it and continue ?" #~ msgstr " . Ignorera detta och fortsätta ?" #~ msgid "unknown substitution string at end of string: %" #~ msgstr "okänd utbytessträng vid strängslut: %" dar-2.5.3/install-sh0000755000175000000000000003325611777117217011223 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: dar-2.5.3/src/0000755000175000017520000000000012642474572010076 500000000000000dar-2.5.3/src/examples/0000755000175000017520000000000012642474572011714 500000000000000dar-2.5.3/src/examples/formula.cpp0000644000175000017430000000664312641772777014025 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include #include "infinint.hpp" #include "deci.hpp" #include "integers.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "../dar_suite/shell_interaction.hpp" #include "../dar_suite/dar_suite.hpp" #include "../dar_suite/crit_action_cmd_line.hpp" #include "../dar_suite/line_tools.hpp" using namespace libdar; using namespace std; int little_main(shell_interaction & ui, S_I argc, char * const argv[], const char **env); static infinint calculus(const string & formula); // recusive call int main(S_I argc, char * const argv[], const char **env) { return dar_suite_global(argc, argv, env, "", nullptr, '\0', &little_main); } int little_main(shell_interaction & ui, S_I argc, char * const argv[], const char **env) { if(argc != 2) { cout << "usage: " << argv[0] << " \"arithmetical formula with only positive intergers, the following binary operators +, -, /, *, %, &, ^, | and parenthesis\"" << endl; return EXIT_SYNTAX; } else { string formula = crit_action_canonize_string(argv[1]); libdar::deci tmp = calculus(formula); cout << tmp.human() << endl; return EXIT_OK; } } static infinint calculus(const string & formula) { string::const_iterator it; string s1, s2; const string operators = "+-/*%&^|"; string::const_iterator op = operators.begin(); while(op != operators.end() && (it = line_tools_find_last_char_out_of_parenth(formula, *op)) == formula.end()) ++op; if(it != formula.end()) { if(formula.size() < 3) throw Erange("calculus", tools_printf("Unknown meaning for string: %S", &formula)); s1 = string(formula.begin(), it); s2 = string(it + 1, formula.end()); switch(*op) { case '+': return calculus(s1) + calculus(s2); case '-': return calculus(s1) - calculus(s2); case '/': return calculus(s1) / calculus(s2); case '*': return calculus(s1) * calculus(s2); case '%': return calculus(s1) % calculus(s2); case '&': return calculus(s1) & calculus(s2); case '^': return calculus(s1) ^ calculus(s2); case '|': return calculus(s1) | calculus(s2); default: throw SRC_BUG; } } if(*(formula.begin()) == '(' && *(formula.end() - 1) == ')') return calculus(string(formula.begin() + 1, formula.end() - 1)); else // assuming an integer { libdar::deci tmp = formula; return tmp.computer(); } } dar-2.5.3/src/examples/Makefile.am0000644000175000017430000000254412641772777013704 00000000000000localedir = @localedir@ if BUILD_MODE32 MYLIB=dar32 AM_CPPFLAGS=-DLIBDAR_MODE=32 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) else if BUILD_MODE64 MYLIB=dar64 AM_CPPFLAGS=-DLIBDAR_MODE=64 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) else MYLIB=dar AM_CPPFLAGS=-I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) endif endif noinst_PROGRAMS = factoriel prime formula dist_noinst_DATA = README LDADD = -L../libdar -l$(MYLIB) $(GPGME_LIBS) AM_LDFLAGS = @LTLIBINTL@ factoriel_SOURCES = factoriel.cpp factoriel_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/line_tools.o $(LDADD) factoriel_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../dar_suite/shell_interaction.cpp ../dar_suite/dar_suite.cpp prime_SOURCES = prime.cpp prime_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/line_tools.o $(LDADD) prime_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../dar_suite/shell_interaction.cpp ../dar_suite/dar_suite.cpp formula_SOURCES = formula.cpp formula_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/crit_action_cmd_line.o ../dar_suite/line_tools.o $(LDADD) formula_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../dar_suite/line_tools.cpp ../dar_suite/shell_interaction.cpp ../dar_suite/crit_action_cmd_line.cpp ../dar_suite/dar_suite.cpp dar-2.5.3/src/examples/Makefile.in0000644000175000017520000004362512642474520013704 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = factoriel$(EXEEXT) prime$(EXEEXT) formula$(EXEEXT) subdir = src/examples DIST_COMMON = README $(dist_noinst_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_factoriel_OBJECTS = factoriel.$(OBJEXT) factoriel_OBJECTS = $(am_factoriel_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am_formula_OBJECTS = formula.$(OBJEXT) formula_OBJECTS = $(am_formula_OBJECTS) am_prime_OBJECTS = prime.$(OBJEXT) prime_OBJECTS = $(am_prime_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(factoriel_SOURCES) $(formula_SOURCES) $(prime_SOURCES) DIST_SOURCES = $(factoriel_SOURCES) $(formula_SOURCES) \ $(prime_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(dist_noinst_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXSTDFLAGS = @CXXSTDFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PROG = @DOXYGEN_PROG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPX_PROG = @UPX_PROG@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen = @doxygen@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ groff = @groff@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmp = @tmp@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ upx = @upx@ @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@MYLIB = dar @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@MYLIB = dar64 @BUILD_MODE32_TRUE@MYLIB = dar32 @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@AM_CPPFLAGS = -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=64 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) @BUILD_MODE32_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=32 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) dist_noinst_DATA = README LDADD = -L../libdar -l$(MYLIB) $(GPGME_LIBS) AM_LDFLAGS = @LTLIBINTL@ factoriel_SOURCES = factoriel.cpp factoriel_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/line_tools.o $(LDADD) factoriel_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../dar_suite/shell_interaction.cpp ../dar_suite/dar_suite.cpp prime_SOURCES = prime.cpp prime_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/line_tools.o $(LDADD) prime_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../dar_suite/shell_interaction.cpp ../dar_suite/dar_suite.cpp formula_SOURCES = formula.cpp formula_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/crit_action_cmd_line.o ../dar_suite/line_tools.o $(LDADD) formula_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../dar_suite/line_tools.cpp ../dar_suite/shell_interaction.cpp ../dar_suite/crit_action_cmd_line.cpp ../dar_suite/dar_suite.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list factoriel$(EXEEXT): $(factoriel_OBJECTS) $(factoriel_DEPENDENCIES) $(EXTRA_factoriel_DEPENDENCIES) @rm -f factoriel$(EXEEXT) $(CXXLINK) $(factoriel_OBJECTS) $(factoriel_LDADD) $(LIBS) formula$(EXEEXT): $(formula_OBJECTS) $(formula_DEPENDENCIES) $(EXTRA_formula_DEPENDENCIES) @rm -f formula$(EXEEXT) $(CXXLINK) $(formula_OBJECTS) $(formula_LDADD) $(LIBS) prime$(EXEEXT): $(prime_OBJECTS) $(prime_DEPENDENCIES) $(EXTRA_prime_DEPENDENCIES) @rm -f prime$(EXEEXT) $(CXXLINK) $(prime_OBJECTS) $(prime_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factoriel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/formula.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prime.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/src/examples/prime.cpp0000644000175000017430000000437612641772777013475 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDLIB_H #include #endif } #include #include "infinint.hpp" #include "deci.hpp" #include "integers.hpp" #include "../dar_suite/shell_interaction.hpp" #include "../dar_suite/dar_suite.hpp" using namespace libdar; using namespace std; int little_main(shell_interaction & ui, S_I argc, char * const argv[], const char **env); int main(S_I argc, char * const argv[], const char **env) { return dar_suite_global(argc, argv, env, "", nullptr, '\0', &little_main); } int little_main(shell_interaction & ui, S_I argc, char * const argv[], const char **env) { if(argc != 2) { cout << "usage : " << argv[0] << " " << endl; exit(1); } libdar::deci x = string(argv[1]); cout << "converting string to infinint... " << endl; infinint num = x.computer(); cout << "checking whether the number is a prime factor... " << endl; infinint max = (num / 2) + 1; infinint i = 2; while(i < max) if(num%i == 0) break; else ++i; if(i < max) cout << argv[1] << " is NOT prime" << endl; else cout << argv[1] << " is PRIME" << endl; return EXIT_OK; } dar-2.5.3/src/examples/factoriel.cpp0000644000175000017430000000535712641772777014331 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPE_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STDLIB_H #include #endif } // end extern "C" #include #include #include "infinint.hpp" #include "deci.hpp" #include "erreurs.hpp" #include "generic_file.hpp" #include "integers.hpp" #include "cygwin_adapt.hpp" #include "fichier_local.hpp" #include "../dar_suite/shell_interaction.hpp" #include "../dar_suite/dar_suite.hpp" using namespace libdar; using namespace std; static int little_main(shell_interaction & ui, int argc, char * const argv[], const char **env); int main(S_I argc, char * const argv[], const char **env) { return dar_suite_global(argc, argv, env, "", nullptr, '\0', &little_main); } static int little_main(shell_interaction & ui, int argc, char * const argv[], const char **env) { if(argc != 2 && argc != 3) exit(1); string s = argv[1]; libdar::deci f = s; infinint max = f.computer(); infinint i = 2; infinint p = 1; while(i <= max) { p *= i; ++i; } ui.warning("calcul finished, now computing the decimal representation ... "); f = libdar::deci(p); ui.warning(f.human()); if(argc == 3) { fichier_local fic = fichier_local(ui, argv[2], gf_read_write, 0666, false, true, false); infinint cp; p.dump(fic); fic.skip(0); cp = infinint(fic); ui.warning(string("read from file: ") + libdar::deci(cp).human()); } return EXIT_OK; } dar-2.5.3/src/examples/README0000644000175000017430000000126712610404647012511 00000000000000In this directory you will find some example programs. what do they do ? factoriel At the beginning it was a test program for infinint. It computes the factorial of the given integer. If compiled without --enable-mode=... option given to configure, it will always (should at least), return the decimal representation of the asked decimal. The problem is more the time it will take to compute it. And using --enable-mode=... you may get a message reporting that an integer overflow has occurred. prime tests if the given number is a prime factor. It relies on infinint. (also a test program at the beginning). formula calculate a simple arythmetic expression given as argument dar-2.5.3/src/gettext.h0000644000175000017430000000635612610405012011637 00000000000000/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ #if HAVE_GETTEXT #if HAVE_LIBINTL_H #include #endif #endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) // this is a DAR addition to workaround // standard C++ header files (Redhat distro) that include /usr/include/libintl.h // in any case. This should let this inclusion ineffective #define _LIBINTL_H #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String #endif /* _LIBGETTEXT_H */ dar-2.5.3/src/Makefile.am0000644000175000017430000000025112610404647012037 00000000000000if MAKE_ALL_DIR OPT_SUBDIR = examples testing endif SUBDIRS = libdar dar_suite check $(OPT_SUBDIR) noinst_HEADERS = my_config.h dist_noinst_DATA = README gettext.h dar-2.5.3/src/Makefile.in0000644000175000017520000004426412642474520012066 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = README $(dist_noinst_DATA) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(dist_noinst_DATA) HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = libdar dar_suite check examples testing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXSTDFLAGS = @CXXSTDFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PROG = @DOXYGEN_PROG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPX_PROG = @UPX_PROG@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen = @doxygen@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ groff = @groff@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmp = @tmp@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ upx = @upx@ @MAKE_ALL_DIR_TRUE@OPT_SUBDIR = examples testing SUBDIRS = libdar dar_suite check $(OPT_SUBDIR) noinst_HEADERS = my_config.h dist_noinst_DATA = README gettext.h all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/src/libdar/0000755000175000017520000000000012642474572011333 500000000000000dar-2.5.3/src/libdar/defile.cpp0000644000175000017430000000400712641772777013217 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "defile.hpp" #include "cat_all_entrees.hpp" using namespace std; namespace libdar { void defile::enfile(const cat_entree *e) { const cat_eod *fin = dynamic_cast(e); const cat_directory *dir = dynamic_cast(e); const cat_nomme *nom = dynamic_cast(e); string s; if(! init) // we must remove previous entry brought by a previous call to this method { if(! chemin.pop(s)) throw SRC_BUG; // no more cat_directory to pop! } else // nothing to be removed init = false; if(fin == nullptr) // not cat_eod { if(nom == nullptr) // not a cat_nomme throw SRC_BUG; // neither cat_eod nor cat_nomme else // a cat_nomme { chemin += nom->get_name(); if(dir != nullptr) init = true; } } cache = chemin.display(); } } // end of namespace dar-2.5.3/src/libdar/real_infinint.hpp0000644000175000017430000002577612641772777014635 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file real_infinint.hpp /// \brief the original infinint class implementation /// \ingroup Private /// /// the infinint class implementation defined in this module can /// handle arbitrary large positive integer numbers #ifndef REAL_INFININT_HPP #define REAL_INFININT_HPP #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif } // end extern "C" #include #include "storage.hpp" #include "integers.hpp" #include "int_tools.hpp" #include "on_pool.hpp" #define ZEROED_SIZE 50 namespace libdar { class generic_file; class user_interaction; /// the arbitrary large positive integer class /// can only handle positive integer numbers /// \ingroup Private class infinint : public on_pool { public : #if SIZEOF_OFF_T > SIZEOF_TIME_T #if SIZEOF_OFF_T > SIZEOF_SIZE_T infinint(off_t a = 0) { infinint_from(a); }; #else infinint(size_t a = 0) { infinint_from(a); }; #endif #else #if SIZEOF_TIME_T > SIZEOF_SIZE_T infinint(time_t a = 0) { infinint_from(a); }; #else infinint(size_t a = 0) { infinint_from(a); }; #endif #endif infinint(const infinint & ref) { copy_from(ref); } // read an infinint from a file infinint(generic_file & x); ~infinint() throw(Ebug) { detruit(); }; const infinint & operator = (const infinint & ref) { detruit(); copy_from(ref); return *this; }; void dump(generic_file &x) const; // write byte sequence to file void read(generic_file &f) { detruit(); build_from_file(f); }; infinint & operator += (const infinint & ref); infinint & operator -= (const infinint & ref); infinint & operator *= (unsigned char arg); infinint & operator *= (const infinint & ref); template infinint power(const T & exponent) const; inline infinint & operator /= (const infinint & ref); inline infinint & operator %= (const infinint & ref); infinint & operator &= (const infinint & ref); infinint & operator |= (const infinint & ref); infinint & operator ^= (const infinint & ref); infinint & operator >>= (U_32 bit); infinint & operator >>= (infinint bit); infinint & operator <<= (U_32 bit); infinint & operator <<= (infinint bit); infinint operator ++(int a) { infinint ret = *this; ++(*this); return ret; }; infinint operator --(int a) { infinint ret = *this; --(*this); return ret; }; infinint & operator ++() { return *this += 1; }; infinint & operator --() { return *this -= 1; }; U_32 operator % (U_32 arg) const { return modulo(arg); }; // increment the argument up to a legal value for its storage type and decrement the object in consequence // note that the initial value of the argument is not ignored ! // when the object is null the value of the argument is unchanged template void unstack(T &v) { infinint_unstack_to(v); } infinint get_storage_size() const { return field->size(); }; // it returns number of byte of information necessary to store the integer unsigned char operator [] (const infinint & position) const; // return in little endian order the information byte storing the integer bool is_zero() const; friend bool operator < (const infinint &, const infinint &); friend bool operator == (const infinint &, const infinint &); friend bool operator > (const infinint &, const infinint &); friend bool operator <= (const infinint &, const infinint &); friend bool operator != (const infinint &, const infinint &); friend bool operator >= (const infinint &, const infinint &); friend void euclide(infinint a, const infinint &b, infinint &q, infinint &r); static bool is_system_big_endian(); private : static const int TG = 4; enum endian { big_endian, little_endian, not_initialized }; typedef unsigned char group[TG]; storage *field; bool is_valid() const; void build_from_file(generic_file & x); void reduce(); // put the object in canonical form : no leading byte equal to zero void copy_from(const infinint & ref); void detruit(); void make_at_least_as_wider_as(const infinint & ref); template void infinint_from(T a); template T max_val_of(T x); template void infinint_unstack_to(T &a); template T modulo(T arg) const; signed int difference(const infinint & b) const; // gives the sign of (*this - arg) but only the sign ! ///////////////////////// // static statments // static endian used_endian; static U_8 zeroed_field[ZEROED_SIZE]; static void setup_endian(); }; #define OPERATOR(OP) inline bool operator OP (const infinint &a, const infinint &b) \ { \ return a.difference(b) OP 0; \ } OPERATOR(<) OPERATOR(>) OPERATOR(<=) OPERATOR(>=) OPERATOR(==) OPERATOR(!=) infinint operator + (const infinint &, const infinint &); infinint operator - (const infinint &, const infinint &); infinint operator * (const infinint &, const infinint &); infinint operator * (const infinint &, const unsigned char); infinint operator * (const unsigned char, const infinint &); infinint operator / (const infinint &, const infinint &); infinint operator % (const infinint &, const infinint &); infinint operator & (const infinint & a, const infinint & bit); infinint operator | (const infinint & a, const infinint & bit); infinint operator ^ (const infinint & a, const infinint & bit); infinint operator >> (const infinint & a, U_32 bit); infinint operator >> (const infinint & a, const infinint & bit); infinint operator << (const infinint & a, U_32 bit); infinint operator << (const infinint & a, const infinint & bit); void euclide(infinint a, const infinint &b, infinint &q, infinint &r); template inline void euclide(T a, T b, T & q, T &r) { q = a/b; r = a%b; } inline infinint & infinint::operator /= (const infinint & ref) { *this = *this / ref; return *this; } inline infinint & infinint::operator %= (const infinint & ref) { *this = *this % ref; return *this; } ///////////////////////////////////////////////////// ///////////////// TEMPLATE BODIES /////////////////// ///////////////////////////////////////////////////// template infinint infinint::power(const T & exponent) const { infinint ret = 1; for(T count = 0; count < exponent; ++count) ret *= *this; return ret; } template T infinint::modulo(T arg) const { infinint tmp = *this % infinint(arg); T ret = 0; unsigned char *debut = (unsigned char *)(&ret); unsigned char *ptr = debut + sizeof(T) - 1; storage::iterator it = tmp.field->rbegin(); while(it != tmp.field->rend() && ptr >= debut) { *ptr = *it; --ptr; --it; } // checking for overflow (should never occur, but for sanity, we check it anyway) while(it != tmp.field->rend()) // field may not be reduced (some zeros are leading) { if(*it != 0) throw SRC_BUG; // could not put all the data in the returned value ! --it; } if(used_endian == little_endian) int_tools_swap_bytes(debut, sizeof(T)); return ret; } template void infinint::infinint_from(T a) { U_I size = sizeof(a); S_I direction = +1; unsigned char *ptr, *fin; if(used_endian == not_initialized) setup_endian(); if(used_endian == little_endian) { direction = -1; ptr = (unsigned char *)(&a) + (size - 1); fin = (unsigned char *)(&a) - 1; } else { direction = +1; ptr = (unsigned char *)(&a); fin = (unsigned char *)(&a) + size; } while(ptr != fin && *ptr == 0) { ptr += direction; --size; } if(size == 0) { size = 1; ptr -= direction; } field = new (std::nothrow) storage(size); if(field != nullptr) { storage::iterator it = field->begin(); while(ptr != fin) { *it = *ptr; ++it; ptr += direction; } if(it != field->end()) throw SRC_BUG; // size mismatch in this algorithm } else throw Ememory("template infinint::infinint_from"); } template T infinint::max_val_of(T x) { x = 0; x = ~x; if(x <= 0) // T is a signed integer type. Note that it should be "x < 0" but to avoid compiler warning when T is unsigned it does not hurt having "x <= 0" here { x = 1; x = int_tools_rotate_right_one_bit(x); x = ~x; } return x; } template void infinint::infinint_unstack_to(T &a) { // T is supposed to be an unsigned "integer" // (ie.: sizeof() returns the width of the storage bit field and no sign bit is present) // Note : static here avoids the recalculation of max_T at each call static const T max_T = max_val_of(a); infinint step = max_T - a; if(*this < step) { T transfert = 0; unsigned char *debut = (unsigned char *)&transfert; unsigned char *ptr = debut + sizeof(transfert) - 1; storage::iterator it = field->rbegin(); while(ptr >= debut && it != field->rend()) { *ptr = *it; --ptr; --it; } if(used_endian == little_endian) int_tools_swap_bytes(debut, sizeof(transfert)); a += transfert; *this -= *this; } else { *this -= step; a = max_T; } } } // end of namespace #endif dar-2.5.3/src/libdar/mask.cpp0000644000175000017430000001265712641772777012734 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_FNMATCH_H #include #endif } // end extern "C" #include "mask.hpp" #include "tools.hpp" #include "erreurs.hpp" using namespace std; namespace libdar { simple_mask::simple_mask(const string & wilde_card_expression, bool case_sensit) : case_s(case_sensit) { if(!case_s) tools_to_upper(wilde_card_expression, the_mask); else the_mask = wilde_card_expression; } const simple_mask & simple_mask::operator = (const simple_mask & m) { const mask *src = & m; mask *dst = this; *dst = *src; // explicitely invoke the inherited "mask" class's operator = copy_from(m); return *this; } bool simple_mask::is_covered(const string &expression) const { if(!case_s) { string upper; tools_to_upper(expression, upper); return fnmatch(the_mask.c_str(), upper.c_str(), FNM_PERIOD) == 0; } else return fnmatch(the_mask.c_str(), expression.c_str(), FNM_PERIOD) == 0; } void simple_mask::copy_from(const simple_mask & m) { the_mask = m.the_mask; case_s = m.case_s; } regular_mask::regular_mask(const string & wilde_card_expression, bool x_case_sensit) { mask_exp = wilde_card_expression; case_sensit = x_case_sensit; set_preg(mask_exp, case_sensit); } regular_mask::regular_mask(const regular_mask & ref) : mask(ref) { mask_exp = ref.mask_exp; case_sensit = ref.case_sensit; set_preg(mask_exp, case_sensit); } regular_mask & regular_mask::operator= (const regular_mask & ref) { const mask *ref_ptr = &ref; mask *me = this; *me = *ref_ptr; // initializing the inherited mask part of the object mask_exp = ref.mask_exp; case_sensit = ref.case_sensit; regfree(&preg); set_preg(mask_exp, case_sensit); return *this; } bool regular_mask::is_covered(const string & expression) const { return regexec(&preg, expression.c_str(), 0, nullptr, 0) != REG_NOMATCH; } void regular_mask::set_preg(const string & wilde_card_expression, bool x_case_sensit) { S_I ret; if((ret = regcomp(&preg, wilde_card_expression.c_str(), REG_NOSUB|(x_case_sensit ? 0 : REG_ICASE)|REG_EXTENDED)) != 0) { const S_I msg_size = 1024; char msg[msg_size]; regerror(ret, &preg, msg, msg_size); throw Erange("regular_mask::regular_mask", msg); } } const not_mask & not_mask::operator = (const not_mask & m) { const mask *src = &m; mask *dst = this; *dst = *src; // explicitely invoke the inherited "mask" class's operator = detruit(); copy_from(m); return *this; } void not_mask::copy_from(const not_mask &m) { ref = m.ref->clone(); if(ref == nullptr) throw Ememory("not_mask::copy_from(not_mask)"); } void not_mask::copy_from(const mask &m) { ref = m.clone(); if(ref == nullptr) throw Ememory("not_mask::copy_from(mask)"); } void not_mask::detruit() { if(ref != nullptr) { delete ref; ref = nullptr; } } const et_mask & et_mask::operator = (const et_mask &m) { const mask *src = &m; mask *dst = this; *dst = *src; // explicitely invoke the inherited "mask" class's operator = detruit(); copy_from(m); return *this; } void et_mask::add_mask(const mask& toadd) { mask *t = toadd.clone(); if(t != nullptr) lst.push_back(t); else throw Ememory("et_mask::et_mask"); } void et_mask::copy_from(const et_mask &m) { vector::const_iterator it = m.lst.begin(); mask *tmp; while(it != m.lst.end() && (tmp = (*it)->clone()) != nullptr) { lst.push_back(tmp); ++it; } if(it != m.lst.end()) { detruit(); throw Ememory("et_mask::copy_from"); } } void et_mask::detruit() { vector::iterator it = lst.begin(); while(it != lst.end()) { delete *it; *it = nullptr; ++it; } lst.clear(); } bool simple_path_mask::is_covered(const path &ch) const { return ch.is_subdir_of(chemin, case_s) || chemin.is_subdir_of(ch, case_s); } bool same_path_mask::is_covered(const std::string &ch) const { if(case_s) return ch == chemin; else return tools_is_case_insensitive_equal(ch, chemin); } } // end of namespace dar-2.5.3/src/libdar/escape.hpp0000644000175000017430000002541212642474445013227 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file escape.hpp /// \brief class escape definition, used for sequential reading of archives /// \ingroup Private /// /// The class escape is used to insert escape sequences before each new file's /// data in an archive. The normal file's data is also rewritten if it contains /// such an escape sequence for it does not collide with real escape sequences /// At reading time, this class revert backs modification done to file's data /// containing escape sequences for they contain the original data. This class /// also provides the feature to skip to the next (real) escape sequence. /// This class inherits of generic files and its objects are to be used in a /// stack of generic file's objects. The object below contains modified data /// and escape sequences, the file over gets the normal file data and does /// never see escape sequences. Expected implementation is to have a compressor /// above an escape object and a sar or scrambler/blowfish/... object above it. #ifndef ESCAPE_HPP #define ESCAPE_HPP #include "../my_config.h" extern "C" { #if HAVE_LIMITS_H #include #endif } #include #include "generic_file.hpp" #define ESCAPE_FIXED_SEQUENCE_NORMAL 0xAD #define ESCAPE_FIXED_SEQUENCE_SPARSE_FILE 0xAE #define MAX_BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < MAX_BUFFER_SIZE #undef MAX_BUFFER_SIZE #define MAX_BUFFER_SIZE SSIZE_MAX #endif #endif namespace libdar { /// \addtogroup Private /// @{ class escape : public generic_file { public: enum sequence_type { seqt_undefined, //< not enough data to define the type of the escape sequence seqt_not_a_sequence, //< to escape data corresponding to an escape sequence's fixed byte sequence seqt_file, //< placed before inode information, eventually followed by file data seqt_ea, //< placed before EA data seqt_catalogue, //< placed before the archive's internal catalogue seqt_data_name, //< placed before the archive data_name (at the beginning of the archive) seqt_file_crc, //< placed before the CRC of file's data seqt_ea_crc, //< placed before the CRC of file's EA seqt_changed, //< placed before new copy of file's data if file's data changed while reading it for backup seqt_dirty, //< placed after data CRC if file is dirty seqt_failed_backup, //< placed after inode information if the file could not be openned at backup time seqt_fsa, //< placed before FSA data seqt_fsa_crc //< place before the CRC of file's FSA }; // the archive layout of marks is for each entry: // #seqt_file# [ [#seqt_changed# [...] ] #seqt_file_crc# [#seqt_dirty#]] [#seqt_ea# #seqt_ea_crc# ] // this previous sequence that we will call is repeated for each file, then on the overall archive we have : // #seqt_data_name# ... #seqt_catalogue# // the provided "below" object must exist during the whole live of the escape object, // the escape object does not own this "below" object // it must be destroyed by the caller/creator of the escape object. // constructors & destructors escape(generic_file *below, //< "Below" is the generic file that holds the escaped data const std::set & x_unjumpable); //< a set of marks that can never been jumped over when skipping for the next mark of a any given type. escape(const escape & ref) : generic_file(ref) { copy_from(ref); }; const escape & operator = (const escape & ref); ~escape(); // escape specific routines void add_mark_at_current_position(sequence_type t); /// skip forward to the next mark of given type /// \param[in] t type of mark to skip to /// \param[in] jump if set to false, do not jump over *any* mark, even those not set as unjumpable mark, /// set it to true, to allow jumping on mark except those defined as unjumpable marks /// \return true of could skip to mark of type t bool skip_to_next_mark(sequence_type t, bool jump); bool next_to_read_is_mark(sequence_type t); bool next_to_read_is_which_mark(sequence_type & t); void add_unjumpable_mark(sequence_type t) { if(is_terminated()) throw SRC_BUG; unjumpable.insert(t); }; void remove_unjumpable_mark(sequence_type t); bool is_unjumpable_mark(sequence_type t) const { return unjumpable.find(t) != unjumpable.end(); }; void clear_all_unjumpable_marks() { unjumpable.clear(); }; // generic_file inherited routines // NOTA: Nothing is done to prevent skip* operation to put the read cursor in the middle of an escape sequence and // thus incorrectly consider it as normal data. Such event should only occure upon archive corruption and will be detected // by checksum mechanisms. bool skippable(skippability direction, const infinint & amount); bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const; protected: void inherited_read_ahead(const infinint & amount); U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() { flush_write(); }; void inherited_flush_read() { flush_write(); clean_read(); }; void inherited_terminate() { flush_or_clean(); }; void change_fixed_escape_sequence(unsigned char value) { fixed_sequence[0] = value; }; bool has_escaped_data_since_last_skip() const { return escaped_data_count_since_last_skip > 0; }; private: //-- constants /// total lenght of the escape sequence static const U_I ESCAPE_SEQUENCE_LENGTH = 6; static const U_I WRITE_BUFFER_SIZE = 2*ESCAPE_SEQUENCE_LENGTH; static const U_I READ_BUFFER_SIZE = MAX_BUFFER_SIZE; static const infinint READ_BUFFER_SIZE_INFININT; /// escape sequence value /// an escape sequence starts by this sequence of characters. The last one is replaced by the /// type of sequence. The first one is fixed but may be set to another value using the protected method /// change_escape_sequence(). This opens the possibility to have several nested escape objects /// without having the bottom one escaping the escape sequence of the one above it. /// this constant table is defined in escape.cpp static const unsigned char usual_fixed_sequence[ESCAPE_SEQUENCE_LENGTH]; //-- variables generic_file *x_below; //< the generic_file in which we read/write escaped data from/to the object is not owned by "this" U_I write_buffer_size; //< amount of data in write transit not yet written to "below" (may have to be escaped) char write_buffer[WRITE_BUFFER_SIZE]; //< data in write transit, all data is unescaped, up to the first real mark, after it, data is raw (may be escaped) //< the first real mark is pointed to by escape_seq_offset_in_buffer U_I read_buffer_size; //< amount of data in transit, read from below, but possibly not yet unescaped and returned to the upper layer U_I already_read; //< data in buffer that has already been returned to the upper layer bool read_eof; //< whether we reached a escape sequence while reading data U_I escape_seq_offset_in_buffer; //< location of the first escape sequence which is not a data sequence char read_buffer[READ_BUFFER_SIZE]; //< data in read transit std::set unjumpable; //< list of mark that cannot be jumped over when searching for the next mark unsigned char fixed_sequence[ESCAPE_SEQUENCE_LENGTH]; //< the preambule of an escape sequence to use/search for infinint escaped_data_count_since_last_skip; infinint below_position; //< remember the position of object pointed to by x_below //-- routines void set_fixed_sequence_for(sequence_type t) { fixed_sequence[ESCAPE_SEQUENCE_LENGTH - 1] = type2char(t); }; void check_below() const { if(x_below == nullptr) throw SRC_BUG; }; void clean_read(); //< drops all in-transit data void flush_write(); //< write down to "below" all in-transit data void flush_or_clean() { switch(get_mode()) { case gf_read_only: clean_read(); break; case gf_write_only: case gf_read_write: flush_write(); break; default: throw SRC_BUG; } }; void copy_from(const escape & ref); bool mini_read_buffer(); //< returns true if it could end having at least ESCAPE_SEQUENCE_LENGTH bytes in read_buffer, false else (EOF reached). //-- static routine(s) // some convertion routines static char type2char(sequence_type x); static sequence_type char2type(char x); /// unescape data from data marks, up to the first real escape sequence found /// find the next start of escape sequence in the given buffer /// \return the offset of the first start of escape sequence (ESCAPE_SEQUENCE_LENGTH - 1), /// or partial if found at the end, returns size if none could be found static U_I trouve_amorce(const char *a, U_I size, const unsigned char escape_sequence[ESCAPE_SEQUENCE_LENGTH]); /// unescape data from data marks, up to the first real escape sequence found /// \param[in] a buffer to read data from /// \param[in] size the amount of data in "a" /// \param[out] delta the number of byte / the number of data escape sequence removed /// \param[in] escape_sequence the escape sequence start to look for /// return the offset of the real sequence and updates the size of the buffer /// if some data mark have been removed (size gets smaller) static U_I remove_data_marks_and_stop_at_first_real_mark(char *a, U_I size, U_I & delta, const unsigned char escape_sequence[ESCAPE_SEQUENCE_LENGTH]); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/scrambler.hpp0000644000175000017430000000547012641772777013753 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file scrambler.hpp /// \brief contains the definition of the scrambler class, a very weak encryption scheme /// \ingroup Private #ifndef SCRAMBLER_HPP #define SCRAMBLER_HPP #include "../my_config.h" #include #include "infinint.hpp" #include "generic_file.hpp" #include "erreurs.hpp" #include "infinint.hpp" #include "secu_string.hpp" namespace libdar { /// \brief scrambler is a very weak encryption scheme /// \ingroup Private class scrambler : public generic_file { public: scrambler(const secu_string & pass, generic_file & hidden_side); scrambler(const scrambler & ref) : generic_file(ref) { throw SRC_BUG; }; ~scrambler() { if(buffer != nullptr) meta_delete(buffer); }; const scrambler & operator = (const scrambler & ref) { throw SRC_BUG; }; bool skippable(skippability direction, const infinint & amount) { return ref->skippable(direction, amount); }; bool skip(const infinint & pos) { if(ref == nullptr) throw SRC_BUG; return ref->skip(pos); }; bool skip_to_eof() { if(ref==nullptr) throw SRC_BUG; return ref->skip_to_eof(); }; bool skip_relative(S_I x) { if(ref == nullptr) throw SRC_BUG; return ref->skip_relative(x); }; infinint get_position() const { if(ref == nullptr) throw SRC_BUG; return ref->get_position(); }; protected: void inherited_read_ahead(const infinint & amount) { ref->read_ahead(amount); }; U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() {}; // nothing to do void inherited_flush_read() {}; // nothing to do void inherited_terminate() {}; // nothing to do private: secu_string key; U_I len; generic_file *ref; unsigned char *buffer; U_I buf_size; }; } // end of namespace #endif dar-2.5.3/src/libdar/archive_options.hpp0000644000175000017430000017714512642474445015176 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file archive_options.hpp /// \brief this file contains a set of classes used to transmit options to archive operation /// \ingroup API #ifndef ARCHIVE_OPTIONS_HPP #define ARCHIVE_OPTIONS_HPP #include "../my_config.h" #include "crypto.hpp" #include "integers.hpp" #include "mask.hpp" #include "compressor.hpp" #include "catalogue.hpp" #include "criterium.hpp" #include "hash_fichier.hpp" #include "secu_string.hpp" #include "nls_swap.hpp" #include "entrepot.hpp" #include "fsa_family.hpp" #include "on_pool.hpp" #include namespace libdar { class archive; // needed to be able to use pointer on archive object. ///////////////////////////////////////////////////////// ////////////// OPTIONS FOR OPENNING AN ARCHIVE ////////// ///////////////////////////////////////////////////////// /// \addtogroup API /// @{ /// class holding optional parameters used to read an existing archive class archive_options_read : public on_pool { public: /// build an object and set options to their default values archive_options_read(); /// the copy constructor, assignment operator and destructor archive_options_read(const archive_options_read & ref) : x_ref_chem(ref.x_ref_chem) { copy_from(ref); }; const archive_options_read & operator = (const archive_options_read & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_read() { destroy(); }; ///////////////////////////////////////////////////////////////////// // set back to default (this is the state just after the object is constructed // this method is to be used to reuse a given object /// reset all the options to their default values void clear(); ///////////////////////////////////////////////////////////////////// // setting methods /// defines the the crypto cypher to use to read the archive (default is crypto_none) /// \note since release 2.5.0 you may and should provide crypto_none in any case (the default value) /// for libdar uses the algorithm stored in the archive. However you way override this /// (in case of corruption for example) by explicitely specifying a crypto algorithm /// in that case the value of the crypto algorithm stored in the archive is ignored /// and the algorithm used to decipher is the one specified here. void set_crypto_algo(crypto_algo val) { x_crypto = val; }; /// defines the password or passphrase to decrypt (unused if encryption is not set) void set_crypto_pass(const secu_string & pass) { x_pass = pass; }; /// the encryption block size to use to decrypt void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; }; /// set the encryption block size to the default value void set_default_crypto_size(); /// set the name of the input pipe to read data from (when basename is set to "-") /// if input_pipe is set to "" (empty string) the information from dar_slave are expected /// in standard input else the given string void set_input_pipe(const std::string & input_pipe) { x_input_pipe = input_pipe; }; /// set the name of the output pipe to send orders to (when basenale is set to "-") /// if output_pipe is set to "" the orders sent to dar_slave will exit by the standard output else the given string /// must be the path to a named pipe which will relay the orders to dar_slave void set_output_pipe(const std::string & output_pipe) { x_output_pipe = output_pipe; }; /// set the command to execute before reading each slice (empty string for no script) /// several macros are available: /// - %%n : the slice number to be read /// - %%b : the archive basename /// - %%p : the slices path /// - %%e : the archive extension (usually "dar") /// - %%% : substitued by %% /// . void set_execute(const std::string & execute) { x_execute = execute; }; /// defines whether the user needs detailed output of the operation void set_info_details(bool info_details) { x_info_details = info_details; }; /// defines whether any archive coherence error, system error or media error lead to the abortion of the operation /// lax mode is false by default. /// setting it to true, may allow more data to be restored, but may lead the user to get corrupted data /// the user will be warned and asked upon what to do if such case arrives. void set_lax(bool val) { x_lax = val; }; /// defines whether to try reading the archive sequentially (ala tar) or using the final catalogue /// the sequential reading must not has been disabled at creation time and the archive must be of minimum format "08" for the operation not to fail void set_sequential_read(bool val) { x_sequential_read = val; }; /// defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as necessary to respect this void set_slice_min_digits(infinint val) { x_slice_min_digits = val; }; /// defines the protocol to use to retrieve slices void set_entrepot(const entrepot & entr) { if(x_entrepot != nullptr) delete x_entrepot; x_entrepot = entr.clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_read::set_entrepot"); }; /// whether to warn (true) or ignore (false) signature failure (default is true) void set_ignore_signature_check_failure(bool val) { x_ignore_signature_check_failure = val; }; /// whether libdar is allowed to create several thread to work possilbiy faster on multicore CPU (need libthreadar to be effective) void set_multi_threaded(bool val) { x_multi_threaded = val; }; //////// what follows concerne the use of an external catalogue instead of the archive's internal one /// defines whether or not to use the catalogue from an extracted catalogue (instead of the one embedded in the archive) and which one to use void set_external_catalogue(const path & ref_chem, const std::string & ref_basename) { x_ref_chem = ref_chem, x_ref_basename = ref_basename; external_cat = true; }; /// clear any reference to an external catalogue void unset_external_catalogue(); /// defines the crypto algo for the reference catalogue void set_ref_crypto_algo(crypto_algo ref_crypto) { x_ref_crypto = ref_crypto; }; /// defines the pass for the reference catalogue void set_ref_crypto_pass(const secu_string & ref_pass) { x_ref_pass = ref_pass; }; /// defines the crypto size for the reference catalogue void set_ref_crypto_size(U_32 ref_crypto_size) { x_ref_crypto_size = ref_crypto_size; }; /// set the command to execute before reading each slice of the reference catalogue /// several macros are available: /// - %%n : the slice number to be read /// - %%b : the archive basename /// - %%p : the slices path /// - %%e : the archive extension (usually "dar") /// - %%% : substitued by %% /// . void set_ref_execute(const std::string & ref_execute) { x_ref_execute = ref_execute; }; /// defines the minim digit for slice number of the archive of reference (where the external catalogue is read from) void set_ref_slice_min_digits(infinint val) { x_ref_slice_min_digits = val; }; /// defines the protocol to use to retrieve slices of the reference archive (where the external catalogue resides) void set_ref_entrepot(const entrepot & entr) { if(x_ref_entrepot != nullptr) delete x_ref_entrepot; x_ref_entrepot = entr.clone(); if(x_ref_entrepot == nullptr) throw Ememory("archive_options_read::set_entrepot"); }; ///////////////////////////////////////////////////////////////////// // getting methods (mainly used inside libdar, but kept public and part of the API in the case it is needed) crypto_algo get_crypto_algo() const { return x_crypto; }; const secu_string & get_crypto_pass() const { return x_pass; }; U_32 get_crypto_size() const { return x_crypto_size; }; const std::string & get_input_pipe() const { return x_input_pipe; }; const std::string & get_output_pipe() const { return x_output_pipe; }; const std::string & get_execute() const { return x_execute; }; bool get_info_details() const { return x_info_details; }; bool get_lax() const { return x_lax; }; bool get_sequential_read() const { return x_sequential_read; }; infinint get_slice_min_digits() const { return x_slice_min_digits; }; const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; }; bool get_ignore_signature_check_failure() const { return x_ignore_signature_check_failure; }; bool get_multi_threaded() const { return x_multi_threaded; }; // All methods that follow concern the archive where to fetch the (isolated) catalogue from bool is_external_catalogue_set() const { return external_cat; }; const path & get_ref_path() const; const std::string & get_ref_basename() const; crypto_algo get_ref_crypto_algo() const { return x_ref_crypto; }; const secu_string & get_ref_crypto_pass() const { return x_ref_pass; }; U_32 get_ref_crypto_size() const { return x_ref_crypto_size; }; const std::string & get_ref_execute() const { return x_ref_execute; }; infinint get_ref_slice_min_digits() const { return x_ref_slice_min_digits; }; const entrepot & get_ref_entrepot() const { if(x_ref_entrepot == nullptr) throw SRC_BUG; return *x_ref_entrepot; }; private: crypto_algo x_crypto; secu_string x_pass; U_32 x_crypto_size; std::string x_input_pipe; std::string x_output_pipe; std::string x_execute; bool x_info_details; bool x_lax; bool x_sequential_read; infinint x_slice_min_digits; entrepot *x_entrepot; bool x_ignore_signature_check_failure; bool x_multi_threaded; // external catalogue relative fields bool external_cat; path x_ref_chem; std::string x_ref_basename; crypto_algo x_ref_crypto; secu_string x_ref_pass; U_32 x_ref_crypto_size; std::string x_ref_execute; infinint x_ref_slice_min_digits; entrepot *x_ref_entrepot; void copy_from(const archive_options_read & ref); void destroy(); }; ///////////////////////////////////////////////////////// ///////// OPTIONS FOR CREATING AN ARCHIVE /////////////// ///////////////////////////////////////////////////////// /// class holding optional parameters used to create an archive class archive_options_create : public on_pool { public: // default constructors and destructor. archive_options_create(); archive_options_create(const archive_options_create & ref); const archive_options_create & operator = (const archive_options_create & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_create() { destroy(); }; ///////////////////////////////////////////////////////////////////// // set back to default (this is the state just after the object is constructed // this method is to be used to reuse a given object /// reset all the options to their default values void clear(); ///////////////////////////////////////////////////////////////////// // setting methods /// set the archive to take as reference (nullptr for a full backup) void set_reference(archive *ref_arch) { x_ref_arch = ref_arch; }; /// defines the filenames to only save (except directory) as those that match the given mask void set_selection(const mask & selection); /// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded) void set_subtree(const mask & subtree); /// defines whether overwritting is allowed or not void set_allow_over(bool allow_over) { x_allow_over = allow_over; }; /// defines whether a warning shall be issued before overwriting void set_warn_over(bool warn_over) { x_warn_over = warn_over; }; /// defines whether the user needs detailed output of the operation /// /// \note in API 5.5.x and before this switch drove the displaying /// of processing messages and treated files. now it only drives the /// display of processing messages, use set_display_treated to define /// whether files under treatement should be display or not void set_info_details(bool info_details) { x_info_details = info_details; }; /// defines whether to show treated files /// /// \param[in] display_treated true to display processed inodes /// \param[in] only_dir only display the current directory under process, not its individual files void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; }; /// whether to display files that have been excluded by filters void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; }; /// whether to display a summary for each completed directory with total saved data and compression ratio void set_display_finished(bool display_finished) { x_display_finished = display_finished; }; /// set a pause beteween slices. Set to zero does not pause at all, set to 1 makes libdar pauses each slice, set to 2 makes libdar pause each 2 slices and so on. void set_pause(const infinint & pause) { x_pause = pause; }; /// defines whether we need to store ignored directories as empty void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; }; /// set the compression algorithm to be used void set_compression(compression compr_algo) { x_compr_algo = compr_algo; }; /// set the compression level (from 1 to 9) void set_compression_level(U_I compression_level) { x_compression_level = compression_level; }; /// define the archive slicing /// \param[in] file_size set the slice size in byte (0 for a single slice whatever its size is) /// \param[in] first_file_size set the first file size /// \note if not specified or set to zero, first_file_size is considered equal to file_size void set_slicing(const infinint & file_size, const infinint & first_file_size = 0) { x_file_size = file_size; if(first_file_size.is_zero()) x_first_file_size = file_size; else x_first_file_size = first_file_size; }; /// defines which Extended Attributes to save void set_ea_mask(const mask & ea_mask); /// set the command to execute after each slice creation void set_execute(const std::string & execute) { x_execute = execute; }; /// set the cypher to use void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; }; /// set the pass the password / passphrase to use. Giving an empty string makes the password asked /// interactively through the dialog argument if encryption has been set. void set_crypto_pass(const secu_string & pass) { x_pass = pass; }; /// set the size of the encryption by block to use void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; }; /// set the list of recipients that will be able to read the archive /// \note this is based on GnuPG keyring and assumes the user running libdar has its keyring /// containing for each recipient a valid public key. If a list of recipient is given the crypto_pass /// (see above) is not used, but the crypto_algo stays used to encrypt the archive using a randomly generated key /// which is encrypted using the public keys of the recipients and dropped that way encrypted inside the archive. /// \note if crypto_algo is not set while a list of recipient is given, the crypto algo will default to blowfish void set_gnupg_recipients(const std::vector & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; }; /// the private keys matching the email of the provided list are used to sign the archive random key void set_gnupg_signatories(const std::vector & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; }; /// defines files to compress void set_compr_mask(const mask & compr_mask); /// defines file size under which to never compress void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; }; /// defines whether to ignore files with the nodump flag set void set_nodump(bool nodump) { x_nodump = nodump; }; /// defines whether to ignore files having a given EA /// \note if ea_name is set to "" the default ea_name "user.libdar_no_backup" is used. void set_exclude_by_ea(const std::string & ea_name) { exclude_by_ea = (ea_name == "" ? "user.libdar_no_backup" : ea_name); }; /// set the fields to consider when comparing inodes with reference archive (see cat_inode::comparison_fields enumeration in catalogue.hpp) void set_what_to_check(cat_inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; }; /// ignore differences of at most this integer number of hours while looking for changes in dates void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; }; /// whether to make a dry-run operation void set_empty(bool empty) { x_empty = empty; }; /// whether to alter atime or ctime in the filesystem when reading files to save /// \param[in] alter_atime whether to change atime (true) or ctime (false) /// \note this parameter is used only when furtive_read_mode() is not activated void set_alter_atime(bool alter_atime) { if(x_furtive_read) x_old_alter_atime = alter_atime; else x_alter_atime = alter_atime; }; /// whether to use furtive read mode (if activated, alter_atime() has no meaning/use) void set_furtive_read_mode(bool furtive_read) { NLS_SWAP_IN; try { #if FURTIVE_READ_MODE_AVAILABLE x_furtive_read = furtive_read; if(furtive_read) { x_old_alter_atime = x_alter_atime; x_alter_atime = true; // this is required to avoid libdar manipulating ctime of inodes } else x_alter_atime = x_old_alter_atime; #else if(furtive_read) throw Ecompilation(gettext("Furtive read mode")); x_furtive_read = false; #endif } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; }; /// whether to limit the backup to files located on the same filesystem as the directory taken as root of the backup void set_same_fs(bool same_fs) { x_same_fs = same_fs; }; /// whether to make an emtpy archive only referencing the current state of files in the filesystem void set_snapshot(bool snapshot) { x_snapshot = snapshot; }; /// whether to consider the Cache Directory Tagging Standard void set_cache_directory_tagging(bool cache_directory_tagging) { x_cache_directory_tagging = cache_directory_tagging; }; /// whether to ignore any archive of reference and only save file which modification is more recent that the given "fixed_date". To not use this feature set fixed_date value of zero (which is the value by default) void set_fixed_date(const infinint & fixed_date) { x_fixed_date = fixed_date; }; /// if not an empty string set the slice permission according to the octal value given. void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; }; /// if not an empty string set the user ownership of slices accordingly void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; }; /// if not an empty string set the group ownership of slices accordingly void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; }; /// how much time to retry saving a file if it changed while being read void set_retry_on_change(const infinint & count_max_per_file, const infinint & global_max_byte_overhead = 0) { x_repeat_count = count_max_per_file; x_repeat_byte = global_max_byte_overhead; }; /// whether to add escape sequence aka tape marks to allow sequential reading of the archive void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; }; /// whether to try to detect sparse files void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; }; /// whether to check for ctime changes since with the archive of reference void set_security_check(bool check) { x_security_check = check; }; /// specify a user comment in the archive (always in clear text!) void set_user_comment(const std::string & comment) { x_user_comment = comment; }; /// specify whether to produce a hash file of the slice and which hash algo to use /// \note the libdar::hash_algo data type is defined in hash_fichier.hpp, valid values /// are for examle libdar::hash_none, libdar::hash_md5, libdar::hash_sha1, libdar::hash_sha512... void set_hash_algo(hash_algo hash) { x_hash = hash; }; /// defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as necessary to respect this void set_slice_min_digits(infinint val) { x_slice_min_digits = val; }; /// defines the backup hook for files void set_backup_hook(const std::string & execute, const mask & which_files); /// whether to ignore unknown inode types instead of issuing a warning void set_ignore_unknown_inode_type(bool val) { x_ignore_unknown = val; }; /// defines the protocol to use for slices void set_entrepot(const entrepot & entr); /// defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA activated at compilation time are considered) void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; }; /// whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (requires libthreadar) void set_multi_threaded(bool val) { x_multi_threaded = val; }; ///////////////////////////////////////////////////////////////////// // getting methods archive *get_reference() const { return x_ref_arch; }; const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; }; const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; }; bool get_allow_over() const { return x_allow_over; }; bool get_warn_over() const { return x_warn_over; }; bool get_info_details() const { return x_info_details; }; bool get_display_treated() const { return x_display_treated; }; bool get_display_treated_only_dir() const { return x_display_treated_only_dir; }; bool get_display_skipped() const { return x_display_skipped; }; bool get_display_finished() const { return x_display_finished; }; const infinint & get_pause() const { return x_pause; }; bool get_empty_dir() const { return x_empty_dir; }; compression get_compression() const { return x_compr_algo; }; U_I get_compression_level() const { return x_compression_level; }; const infinint & get_slice_size() const { return x_file_size; }; const infinint & get_first_slice_size() const { return x_first_file_size; }; const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; }; const std::string & get_execute() const { return x_execute; }; crypto_algo get_crypto_algo() const { return x_crypto; }; const secu_string & get_crypto_pass() const { return x_pass; }; U_32 get_crypto_size() const { return x_crypto_size; }; const std::vector & get_gnupg_recipients() const { return x_gnupg_recipients; }; const std::vector & get_gnupg_signatories() const { return x_gnupg_signatories; }; const mask & get_compr_mask() const { if(x_compr_mask == nullptr) throw SRC_BUG; return *x_compr_mask; }; const infinint & get_min_compr_size() const { return x_min_compr_size; }; bool get_nodump() const { return x_nodump; }; const std::string & get_exclude_by_ea() const { return exclude_by_ea; }; cat_inode::comparison_fields get_comparison_fields() const { return x_what_to_check; }; const infinint & get_hourshift() const { return x_hourshift; }; bool get_empty() const { return x_empty; }; bool get_alter_atime() const { return x_alter_atime; }; bool get_furtive_read_mode() const { return x_furtive_read; }; bool get_same_fs() const { return x_same_fs; }; bool get_snapshot() const { return x_snapshot; }; bool get_cache_directory_tagging() const { return x_cache_directory_tagging; }; const infinint & get_fixed_date() const { return x_fixed_date; }; const std::string & get_slice_permission() const { return x_slice_permission; }; const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; }; const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; }; const infinint & get_repeat_count() const { return x_repeat_count; }; const infinint & get_repeat_byte() const { return x_repeat_byte; }; bool get_sequential_marks() const { return x_sequential_marks; }; infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; }; bool get_security_check() const { return x_security_check; }; const std::string & get_user_comment() const { return x_user_comment; }; hash_algo get_hash_algo() const { return x_hash; }; infinint get_slice_min_digits() const { return x_slice_min_digits; }; const std::string & get_backup_hook_file_execute() const { return x_backup_hook_file_execute; }; const mask & get_backup_hook_file_mask() const { return *x_backup_hook_file_mask; }; bool get_ignore_unknown_inode_type() const { return x_ignore_unknown; }; const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; }; const fsa_scope & get_fsa_scope() const { return x_scope; }; bool get_multi_threaded() const { return x_multi_threaded; }; private: archive *x_ref_arch; //< just contains the address of an existing object, no local copy of object is done here mask * x_selection; //< points to a local copy of mask (must be allocated / releases by the archive_option_create object) mask * x_subtree; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects) bool x_allow_over; bool x_warn_over; bool x_info_details; bool x_display_treated; bool x_display_treated_only_dir; bool x_display_skipped; bool x_display_finished; infinint x_pause; bool x_empty_dir; compression x_compr_algo; U_I x_compression_level; infinint x_file_size; infinint x_first_file_size; mask * x_ea_mask; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects) std::string x_execute; crypto_algo x_crypto; secu_string x_pass; U_32 x_crypto_size; std::vector x_gnupg_recipients; std::vector x_gnupg_signatories; mask * x_compr_mask; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects) infinint x_min_compr_size; bool x_nodump; std::string exclude_by_ea; cat_inode::comparison_fields x_what_to_check; infinint x_hourshift; bool x_empty; bool x_alter_atime; bool x_old_alter_atime; //< used to backup origina alter_atime value when activating furtive read mode bool x_furtive_read; bool x_same_fs; bool x_snapshot; bool x_cache_directory_tagging; infinint x_fixed_date; std::string x_slice_permission; std::string x_slice_user_ownership; std::string x_slice_group_ownership; infinint x_repeat_count; infinint x_repeat_byte; bool x_sequential_marks; infinint x_sparse_file_min_size; bool x_security_check; std::string x_user_comment; hash_algo x_hash; infinint x_slice_min_digits; mask * x_backup_hook_file_mask; std::string x_backup_hook_file_execute; bool x_ignore_unknown; entrepot *x_entrepot; fsa_scope x_scope; bool x_multi_threaded; void destroy(); void copy_from(const archive_options_create & ref); void destroy_mask(mask * & ptr); void clean_mask(mask * & ptr); void check_mask(const mask & m); }; ///////////////////////////////////////////////////////// //////////// OPTIONS FOR ISOLATING A CATALOGUE ////////// ///////////////////////////////////////////////////////// /// class holding optional parameters used to isolate an existing archive class archive_options_isolate : public on_pool { public: archive_options_isolate() { x_entrepot = nullptr; clear(); }; archive_options_isolate(const archive_options_isolate & ref) { x_entrepot = nullptr; copy_from(ref); }; const archive_options_isolate & operator = (const archive_options_isolate & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_isolate() { destroy(); }; void clear(); ///////////////////////////////////////////////////////////////////// // setting methods /// whether overwritting is allowed void set_allow_over(bool allow_over) { x_allow_over = allow_over; }; /// whether a warning shall be issued before overwriting void set_warn_over(bool warn_over) { x_warn_over = warn_over; }; /// whether the user needs detailed output of the operation void set_info_details(bool info_details) { x_info_details = info_details; }; /// Pause beteween slices. Set to zero does not pause at all, set to 1 makes libdar pauses each slice, set to 2 makes libdar pause each 2 slices and so on. void set_pause(const infinint & pause) { x_pause = pause; }; /// the compression algorithm used void set_compression(compression algo) { x_algo = algo; }; /// the compression level (from 1 to 9) void set_compression_level(U_I compression_level) { x_compression_level = compression_level; }; /// define the archive slicing /// \param[in] file_size set the slice size in byte (0 for a single slice whatever its size is) /// \param[in] first_file_size set the first file size /// \note if not specified or set to zero, first_file_size is considered equal to file_size void set_slicing(const infinint & file_size, const infinint & first_file_size = 0) { x_file_size = file_size; if(first_file_size.is_zero()) x_first_file_size = file_size; else x_first_file_size = first_file_size; }; /// command to execute after each slice creation void set_execute(const std::string & execute) { x_execute = execute; }; /// cypher to use void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; }; /// password / passphrase to encrypt the data with (empty string for interactive question) void set_crypto_pass(const secu_string & pass) { x_pass = pass; }; /// size of the encryption by block to use void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; }; /// set the list of recipients that will be able to read the archive /// \note more details for the same option of archive_options_create void set_gnupg_recipients(const std::vector & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; }; /// the private keys matching the email of the provided list are used to sign the archive random key void set_gnupg_signatories(const std::vector & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; }; /// whether to make a dry-run operation void set_empty(bool empty) { x_empty = empty; }; /// if not an empty string set the slice permission according to the octal value given. void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; }; /// if not an empty string set the user ownership of slices accordingly void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; }; /// if not an empty string set the group ownership of slices accordingly void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; }; /// specify a user comment in the archive (always in clear text!) void set_user_comment(const std::string & comment) { x_user_comment = comment; }; /// specify whether to produce a hash file of the slice and which hash algo to use void set_hash_algo(hash_algo hash) { x_hash = hash; }; /// defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as necessary to respect this void set_slice_min_digits(infinint val) { x_slice_min_digits = val; }; /// whether to add escape sequence aka tape marks to allow sequential reading of the archive void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; }; /// defines the protocol to use for slices void set_entrepot(const entrepot & entr); /// whether libdar is allowed to created several thread to work possibily faster on multicore CPU (require libthreadar) void set_multi_threaded(bool val) { x_multi_threaded = val; }; ///////////////////////////////////////////////////////////////////// // getting methods bool get_allow_over() const { return x_allow_over; }; bool get_warn_over() const { return x_warn_over; }; bool get_info_details() const { return x_info_details; }; const infinint & get_pause() const { return x_pause; }; compression get_compression() const { return x_algo; }; U_I get_compression_level() const { return x_compression_level; }; const infinint & get_slice_size() const { return x_file_size; }; const infinint & get_first_slice_size() const { return x_first_file_size; }; const std::string & get_execute() const { return x_execute; }; crypto_algo get_crypto_algo() const { return x_crypto; }; const secu_string & get_crypto_pass() const { return x_pass; }; U_32 get_crypto_size() const { return x_crypto_size; }; const std::vector & get_gnupg_recipients() const { return x_gnupg_recipients; }; const std::vector & get_gnupg_signatories() const { return x_gnupg_signatories; }; bool get_empty() const { return x_empty; }; const std::string & get_slice_permission() const { return x_slice_permission; }; const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; }; const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; }; const std::string & get_user_comment() const { return x_user_comment; }; hash_algo get_hash_algo() const { return x_hash; }; infinint get_slice_min_digits() const { return x_slice_min_digits; }; bool get_sequential_marks() const { return x_sequential_marks; }; const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; }; bool get_multi_threaded() const { return x_multi_threaded; }; private: bool x_allow_over; bool x_warn_over; bool x_info_details; infinint x_pause; compression x_algo; U_I x_compression_level; infinint x_file_size; infinint x_first_file_size; std::string x_execute; crypto_algo x_crypto; secu_string x_pass; U_32 x_crypto_size; std::vector x_gnupg_recipients; std::vector x_gnupg_signatories; bool x_empty; std::string x_slice_permission; std::string x_slice_user_ownership; std::string x_slice_group_ownership; std::string x_user_comment; hash_algo x_hash; infinint x_slice_min_digits; bool x_sequential_marks; entrepot *x_entrepot; bool x_multi_threaded; void copy_from(const archive_options_isolate & ref); void destroy(); }; ///////////////////////////////////////////////////////// ////////// OPTONS FOR MERGING ARCHIVES ////////////////// ///////////////////////////////////////////////////////// /// class holding optional parameters used to proceed to the merge operation class archive_options_merge : public on_pool { public: archive_options_merge() { x_selection = x_subtree = x_ea_mask = x_compr_mask = nullptr; x_overwrite = nullptr; x_entrepot = nullptr; clear(); }; archive_options_merge(const archive_options_merge & ref) { copy_from(ref); }; const archive_options_merge & operator = (const archive_options_merge & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_merge() { destroy(); }; void clear(); ///////////////////////////////////////////////////////////////////// // setting methods void set_auxilliary_ref(archive *ref) { x_ref = ref; }; /// defines the filenames to only save (except directory) as those that match the given mask void set_selection(const mask & selection); /// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded) void set_subtree(const mask & subtree); /// defines whether overwritting is allowed or not void set_allow_over(bool allow_over) { x_allow_over = allow_over; }; /// defines whether a warning shall be issued before overwriting void set_warn_over(bool warn_over) { x_warn_over = warn_over; }; /// policy to solve merging conflict void set_overwriting_rules(const crit_action & overwrite); /// defines whether the user needs detailed output of the operation /// /// \note in API 5.5.x and before this switch drove the displaying /// of processing messages and treated files. now it only drives the /// display of processing messages, use set_display_treated to define /// whether files under treatement should be display or not void set_info_details(bool info_details) { x_info_details = info_details; }; /// defines whether to show treated files /// /// \param[in] display_treated true to display processed inodes /// \param[in] only_dir only display the current directory under processing, not its individual files void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; }; /// whether to display files that have been excluded by filters void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; }; /// set a pause beteween slices. Set to zero does not pause at all, set to 1 makes libdar pauses each slice, set to 2 makes libdar pause each 2 slices and so on. void set_pause(const infinint & pause) { x_pause = pause; }; /// defines whether we need to store ignored directories as empty void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; }; /// set the compression algorithm to be used void set_compression(compression compr_algo) { x_compr_algo = compr_algo; }; /// set the compression level (from 1 to 9) void set_compression_level(U_I compression_level) { x_compression_level = compression_level; }; /// define the archive slicing /// \param[in] file_size set the slice size in byte (0 for a single slice whatever its size is) /// \param[in] first_file_size set the first file size /// \note if not specified or set to zero, first_file_size is considered equal to file_size void set_slicing(const infinint & file_size, const infinint & first_file_size = 0) { x_file_size = file_size; if(first_file_size.is_zero()) x_first_file_size = file_size; else x_first_file_size = first_file_size; }; /// defines which Extended Attributes to save void set_ea_mask(const mask & ea_mask); /// set the command to execute after each slice creation void set_execute(const std::string & execute) { x_execute = execute; }; /// set the cypher to use void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; }; /// set the pass the password / passphrase to use. Giving an empty string makes the password asked /// interactively through the dialog argument if encryption has been set. void set_crypto_pass(const secu_string & pass) { x_pass = pass; }; /// set the size of the encryption by block to use void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; }; /// set the list of recipients that will be able to read the archive /// \note more details for the same option of archive_options_create void set_gnupg_recipients(const std::vector & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; }; /// the private keys matching the email of the provided list are used to sign the archive random key void set_gnupg_signatories(const std::vector & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; }; /// defines files to compress void set_compr_mask(const mask & compr_mask); /// defines file size under which to never compress void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; }; /// defines whether we do a dry-run execution void set_empty(bool empty) { x_empty = empty; }; /// make dar ignore the 'algo' argument and do not uncompress / compress files that are selected for merging void set_keep_compressed(bool keep_compressed) { x_keep_compressed = keep_compressed; }; /// if not an empty string set the slice permission according to the octal value given. void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; }; /// if not an empty string set the user ownership of slices accordingly void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; }; /// if not an empty string set the group ownership of slices accordingly void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; }; /// if set to true use a merging mode suitable to build a decremental backup from two full backups (see Notes) void set_decremental_mode(bool mode) { x_decremental = mode; }; /// whether to activate escape sequence aka tape marks to allow sequential reading of the archive void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; }; /// whether to try to detect sparse files void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; }; /// specify a user comment in the archive (always in clear text!) void set_user_comment(const std::string & comment) { x_user_comment = comment; }; /// specify whether to produce a hash file of the slice and which hash algo to use void set_hash_algo(hash_algo hash) { x_hash = hash; }; /// defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as necessary to respect this void set_slice_min_digits(infinint val) { x_slice_min_digits = val; }; /// defines the protocol to use for slices void set_entrepot(const entrepot & entr); /// defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA are considered) void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; }; /// whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (requires libthreadar) void set_multi_threaded(bool val) { x_multi_threaded = val; }; ///////////////////////////////////////////////////////////////////// // getting methods archive * get_auxilliary_ref() const { return x_ref; }; const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; }; const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; }; bool get_allow_over() const { return x_allow_over; }; bool get_warn_over() const { return x_warn_over; }; const crit_action & get_overwriting_rules() const { if(x_overwrite == nullptr) throw SRC_BUG; return *x_overwrite; }; bool get_info_details() const { return x_info_details; }; bool get_display_treated() const { return x_display_treated; }; bool get_display_treated_only_dir() const { return x_display_treated_only_dir; }; bool get_display_skipped() const { return x_display_skipped; }; const infinint & get_pause() const { return x_pause; }; bool get_empty_dir() const { return x_empty_dir; }; compression get_compression() const { return x_compr_algo; }; U_I get_compression_level() const { return x_compression_level; }; const infinint & get_slice_size() const { return x_file_size; }; const infinint & get_first_slice_size() const { return x_first_file_size; }; const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; }; const std::string & get_execute() const { return x_execute; }; crypto_algo get_crypto_algo() const { return x_crypto; }; const secu_string & get_crypto_pass() const { return x_pass; }; U_32 get_crypto_size() const { return x_crypto_size; }; const std::vector & get_gnupg_recipients() const { return x_gnupg_recipients; }; const std::vector & get_gnupg_signatories() const { return x_gnupg_signatories; }; const mask & get_compr_mask() const { if(x_compr_mask == nullptr) throw SRC_BUG; return *x_compr_mask; }; const infinint & get_min_compr_size() const { return x_min_compr_size; }; bool get_empty() const { return x_empty; }; bool get_keep_compressed() const { return x_keep_compressed; }; const std::string & get_slice_permission() const { return x_slice_permission; }; const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; }; const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; }; bool get_decremental_mode() const { return x_decremental; }; bool get_sequential_marks() const { return x_sequential_marks; }; infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; }; const std::string & get_user_comment() const { return x_user_comment; }; hash_algo get_hash_algo() const { return x_hash; }; infinint get_slice_min_digits() const { return x_slice_min_digits; }; const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; }; const fsa_scope & get_fsa_scope() const { return x_scope; }; bool get_multi_threaded() const { return x_multi_threaded; }; private: archive * x_ref; //< points to an external existing object, must never be deleted by "this" mask * x_selection; mask * x_subtree; bool x_allow_over; bool x_warn_over; crit_action * x_overwrite; bool x_info_details; bool x_display_treated; bool x_display_treated_only_dir; bool x_display_skipped; infinint x_pause; bool x_empty_dir; compression x_compr_algo; U_I x_compression_level; infinint x_file_size; infinint x_first_file_size; mask * x_ea_mask; std::string x_execute; crypto_algo x_crypto; secu_string x_pass; U_32 x_crypto_size; std::vector x_gnupg_recipients; std::vector x_gnupg_signatories; mask * x_compr_mask; infinint x_min_compr_size; bool x_empty; bool x_keep_compressed; std::string x_slice_permission; std::string x_slice_user_ownership; std::string x_slice_group_ownership; bool x_decremental; bool x_sequential_marks; infinint x_sparse_file_min_size; std::string x_user_comment; hash_algo x_hash; infinint x_slice_min_digits; entrepot *x_entrepot; fsa_scope x_scope; bool x_multi_threaded; void destroy(); void copy_from(const archive_options_merge & ref); }; ///////////////////////////////////////////////////////// ////////// OPTONS FOR EXTRACTING FILES FROM ARCHIVE ///// ///////////////////////////////////////////////////////// /// class holding optional parameters used to extract files from an existing archive class archive_options_extract : public on_pool { public: enum t_dirty { dirty_ignore, dirty_warn, dirty_ok }; archive_options_extract() { x_selection = x_subtree = x_ea_mask = nullptr; x_overwrite = nullptr; clear(); }; archive_options_extract(const archive_options_extract & ref) { copy_from(ref); }; const archive_options_extract & operator = (const archive_options_extract & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_extract() { destroy(); }; void clear(); ///////////////////////////////////////////////////////////////////// // setting methods /// defines the filenames to only save (except directory) as those that match the given mask void set_selection(const mask & selection); /// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded) void set_subtree(const mask & subtree); /// defines whether a warning shall be issued before overwriting void set_warn_over(bool warn_over) { x_warn_over = warn_over; }; /// defines whether the user needs detailed output of the operation /// /// \note in API 5.5.x and before this switch drove the displaying /// of processing messages and treated files. now it only drives the /// display of processing messages, use set_display_treated to define /// whether files under treatement should be display or not void set_info_details(bool info_details) { x_info_details = info_details; }; /// defines whether to show treated files /// \param[in] display_treated true to display processed inodes /// \param[in] only_dir only display the current directory under processing, not its individual files void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; }; /// whether to display files that have been excluded by filters void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; }; /// defines which Extended Attributes to save void set_ea_mask(const mask & ea_mask); /// whether to ignore directory structure and restore all files in the same directory void set_flat(bool flat) { x_flat = flat; }; /// fields to consider when comparing inodes with those on filesystem to determine if it is more recent (see cat_inode::comparison_fields enumeration), also defines whether mtime has to be restored (cf_mtime) whether permission have to be too (cf_ignore_owner) whether ownership has to be restored too (cf_all) void set_what_to_check(cat_inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; }; /// whether a warning must be issue if a file to remove does not match the expected type of file void set_warn_remove_no_match(bool warn_remove_no_match) { x_warn_remove_no_match = warn_remove_no_match; }; /// defines whether we need to store ignored directories as empty void set_empty(bool empty) { x_empty = empty; }; /// whether to restore directories where no file has been triggered for backup (no file/inode change, excluded files,...) void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; }; /// whether to restore dirty files (those that changed during backup), warn before restoring or ignoring them ///\param[in] ignore if set to true, dirty files are not restored at all ///\param[in] warn useless if ignored is false. If warn is true, a warning is issued before restoring each dirty file (default behavior) void set_dirty_behavior(bool ignore, bool warn) { x_dirty = ignore ? dirty_ignore : (warn ? dirty_warn : dirty_ok); }; /// alternative method to modify dirty behavior void set_dirty_behavior(t_dirty val) { x_dirty = val; }; /// overwriting policy void set_overwriting_rules(const crit_action & over); /// only consider deleted files (if set, no data get restored) /// \note setting both set_only_deleted() and set_ignore_deleted() will not restore anything, almost equivalent to a dry-run execution void set_only_deleted(bool val) { x_only_deleted = val; }; /// do not consider deleted files (if set, no inode will be removed) /// \note setting both set_only_deleted() and set_ignore_deleted() will not restore anything, almost equivalent to a dry-run execution void set_ignore_deleted(bool val) { x_ignore_deleted = val; }; /// defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA activated at compilation time are considered) void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; }; ///////////////////////////////////////////////////////////////////// // getting methods const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; }; const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; }; bool get_warn_over() const { return x_warn_over; }; bool get_info_details() const { return x_info_details; }; bool get_display_treated() const { return x_display_treated; }; bool get_display_treated_only_dir() const { return x_display_treated_only_dir; }; bool get_display_skipped() const { return x_display_skipped; }; const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; }; bool get_flat() const { return x_flat; }; cat_inode::comparison_fields get_what_to_check() const { return x_what_to_check; }; bool get_warn_remove_no_match() const { return x_warn_remove_no_match; }; bool get_empty() const { return x_empty; }; bool get_empty_dir() const { return x_empty_dir; }; t_dirty get_dirty_behavior() const { return x_dirty; } const crit_action & get_overwriting_rules() const { if(x_overwrite == nullptr) throw SRC_BUG; return *x_overwrite; }; bool get_only_deleted() const { return x_only_deleted; }; bool get_ignore_deleted() const { return x_ignore_deleted; }; const fsa_scope & get_fsa_scope() const { return x_scope; }; private: mask * x_selection; mask * x_subtree; bool x_warn_over; bool x_info_details; bool x_display_treated; bool x_display_treated_only_dir; bool x_display_skipped; mask * x_ea_mask; bool x_flat; cat_inode::comparison_fields x_what_to_check; bool x_warn_remove_no_match; bool x_empty; bool x_empty_dir; t_dirty x_dirty; crit_action *x_overwrite; bool x_only_deleted; bool x_ignore_deleted; fsa_scope x_scope; void destroy(); void copy_from(const archive_options_extract & ref); }; ///////////////////////////////////////////////////////// ////////// OPTIONS FOR LISTING AN ARCHIVE /////////////// ///////////////////////////////////////////////////////// /// class holding optional parameters used to list the contents of an existing archive class archive_options_listing : public on_pool { public: archive_options_listing() { x_selection = x_subtree = nullptr; x_slicing_first = x_slicing_others = nullptr; clear(); }; archive_options_listing(const archive_options_listing & ref) { copy_from(ref); }; const archive_options_listing & operator = (const archive_options_listing & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_listing() { destroy(); }; void clear(); /// defines the way archive listing is done: enum listformat { normal, //< the tar-like listing (this is the default) tree, //< the original dar's tree listing (for those that like forest) xml, //< the xml catalogue output slicing //< the slicing output (give info about where files are located) }; ///////////////////////////////////////////////////////////////////// // setting methods void set_info_details(bool info_details) { x_info_details = info_details; }; void set_list_mode(listformat list_mode) { x_list_mode = list_mode; }; void set_selection(const mask & selection); void set_subtree(const mask & subtree); void set_filter_unsaved(bool filter_unsaved) { x_filter_unsaved = filter_unsaved; }; void set_display_ea(bool display_ea) { x_display_ea = display_ea; }; void set_user_slicing(const infinint & slicing_first, const infinint & slicing_others); ///////////////////////////////////////////////////////////////////// // getting methods bool get_info_details() const { return x_info_details; }; listformat get_list_mode() const { return x_list_mode; }; const mask & get_selection() const; const mask & get_subtree() const; bool get_filter_unsaved() const { return x_filter_unsaved; }; bool get_display_ea() const { return x_display_ea; }; bool get_user_slicing(infinint & slicing_first, infinint & slicing_others) const; private: bool x_info_details; listformat x_list_mode; mask * x_selection; mask * x_subtree; bool x_filter_unsaved; bool x_display_ea; infinint *x_slicing_first; infinint *x_slicing_others; void destroy(); void copy_from(const archive_options_listing & ref); }; ///////////////////////////////////////////////////////// ////////// OPTONS FOR DIFFING AN ARCHIVE //////////////// ///////////////////////////////////////////////////////// class archive_options_diff : public on_pool { public: archive_options_diff() { x_selection = x_subtree = x_ea_mask = nullptr; clear(); }; archive_options_diff(const archive_options_diff & ref) { copy_from(ref); }; const archive_options_diff & operator = (const archive_options_diff & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_diff() { destroy(); }; void clear(); ///////////////////////////////////////////////////////////////////// // setting methods /// list of filenames to consider (directory not concerned by this fiter) void set_selection(const mask & selection); /// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded) void set_subtree(const mask & subtree); /// whether the user needs detailed output of the operation /// /// \note in API 5.5.x and before this switch drove the displaying /// of processing messages and treated files. now it only drives the /// display of processing messages, use set_display_treated to define /// whether files under treatement should be display or not void set_info_details(bool info_details) { x_info_details = info_details; }; /// defines whether to show treated files /// \param[in] display_treated true to display processed inodes /// \param[in] only_dir only display the current directory under processing, not its individual files void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; }; /// whether to display files that have been excluded by filters void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; }; /// defines the Extended Attributes to compare void set_ea_mask(const mask & ea_mask); /// fields to consider wien comparing inodes with those on filesystem (see cat_inode::comparison_fields enumeration in catalogue.hpp) void set_what_to_check(cat_inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; }; /// whether to alter atime or ctime in the filesystem when reading files to compare /// \param[in] alter_atime whether to change atime (true) or ctime (false) /// \note this parameter is used only when furtive_read_mode() is not activated void set_alter_atime(bool alter_atime) { if(x_furtive_read) x_old_alter_atime = alter_atime; else x_alter_atime = alter_atime; }; /// whether to use furtive read mode (if activated, alter_atime() has no meaning/use) void set_furtive_read_mode(bool furtive_read); /// ignore differences of at most this integer number of hours while looking for changes in dates void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; }; /// whether to compare symlink mtime (symlink mtime) void set_compare_symlink_date(bool compare_symlink_date) { x_compare_symlink_date = compare_symlink_date; }; /// defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA activated at compilation time are considered) void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; }; ///////////////////////////////////////////////////////////////////// // getting methods const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; }; const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; }; bool get_info_details() const { return x_info_details; }; bool get_display_treated() const { return x_display_treated; }; bool get_display_treated_only_dir() const { return x_display_treated_only_dir; }; bool get_display_skipped() const { return x_display_skipped; }; const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; }; cat_inode::comparison_fields get_what_to_check() const { return x_what_to_check; }; bool get_alter_atime() const { return x_alter_atime; }; bool get_furtive_read_mode() const { return x_furtive_read; }; const infinint & get_hourshift() const { return x_hourshift; }; bool get_compare_symlink_date() const { return x_compare_symlink_date; }; const fsa_scope & get_fsa_scope() const { return x_scope; }; private: mask * x_selection; mask * x_subtree; bool x_info_details; bool x_display_treated; bool x_display_treated_only_dir; bool x_display_skipped; mask * x_ea_mask; cat_inode::comparison_fields x_what_to_check; bool x_alter_atime; bool x_old_alter_atime; bool x_furtive_read; infinint x_hourshift; bool x_compare_symlink_date; fsa_scope x_scope; void destroy(); void copy_from(const archive_options_diff & ref); }; ///////////////////////////////////////////////////////// ////////// OPTONS FOR TESTING AN ARCHIVE //////////////// ///////////////////////////////////////////////////////// /// class holding optional parameters used to test the structure coherence of an existing archive class archive_options_test : public on_pool { public: archive_options_test() { x_selection = x_subtree = nullptr; clear(); }; archive_options_test(const archive_options_test & ref) { copy_from(ref); }; const archive_options_test & operator = (const archive_options_test & ref) { destroy(); copy_from(ref); return *this; }; ~archive_options_test() { destroy(); }; void clear(); ///////////////////////////////////////////////////////////////////// // setting methods /// list of filenames to consider (directory not concerned by this fiter) void set_selection(const mask & selection); /// defines the directory and files to consider (this mask will be applied to the absolute path of files being proceeded) void set_subtree(const mask & subtree); /// whether the user needs detailed output of the operation /// /// \note in API 5.5.x and before this switch drove the displaying /// of processing messages and treated files. now it only drives the /// display of processing messages, use set_display_treated to define /// whether files under treatement should be display or not void set_info_details(bool info_details) { x_info_details = info_details; }; /// whether to display files that have been excluded by filters void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; }; /// defines whether to show treated files /// \param[in] display_treated true to display processed inodes /// \param[in] only_dir only display the current directory under processing, not its individual files void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; }; /// dry-run exectution if set to true void set_empty(bool empty) { x_empty = empty; }; ///////////////////////////////////////////////////////////////////// // getting methods const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; }; const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; }; bool get_info_details() const { return x_info_details; }; bool get_display_treated() const { return x_display_treated; }; bool get_display_treated_only_dir() const { return x_display_treated_only_dir; }; bool get_display_skipped() const { return x_display_skipped; }; bool get_empty() const { return x_empty; }; private: mask * x_selection; mask * x_subtree; bool x_info_details; bool x_display_treated; bool x_display_treated_only_dir; bool x_display_skipped; bool x_empty; void destroy(); void copy_from(const archive_options_test & ref); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/etage.hpp0000644000175000017430000000447412641772777013071 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file etage.hpp /// \brief definition of the etage structure is done here /// \ingroup Private #ifndef ETAGE_HPP #define ETAGE_HPP #include "../my_config.h" #include #include #include "infinint.hpp" #include "on_pool.hpp" #include "datetime.hpp" namespace libdar { /// the etage structure keep trace of directory contents /// it relies on the [fd]opendir() system call family than /// cannot be used recursively. Thus each etage structure /// contains the contents of a directory, and can then be stored beside /// other etage structures corresponding to subdirectories /// \ingroup Private struct etage : public on_pool { etage() { fichier.clear(); last_mod = datetime(0); last_acc = datetime(0); }; // required to fake an empty dir when one is impossible to open etage(user_interaction & ui, const char *dirname, const datetime & x_last_acc, const datetime & x_last_mod, bool cache_directory_tagging, bool furtive_read_mode); bool read(std::string & ref); std::list fichier; //< holds the list of entry in the directory datetime last_mod; //< the last_lod of the directory itself datetime last_acc; //< the last_acc of the directory itself }; } // end of namespace #endif dar-2.5.3/src/libdar/cat_blockdev.hpp0000644000175000017430000000502212642457363014402 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_blockdev.hpp /// \brief class used to record block special devices in a catalogue /// \ingroup Private #ifndef CAT_BLOCKDEV_HPP #define CAT_BLOCKDEV_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_device.hpp" #include "cat_tools.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the block device class class cat_blockdev : public cat_device { public: cat_blockdev(const infinint & uid, const infinint & gid, U_16 perm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & name, U_16 major, U_16 minor, const infinint & fs_device) : cat_device(uid, gid, perm, last_access, last_modif, last_change, name, major, minor, fs_device) {}; cat_blockdev(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small) : cat_device(dialog, pdesc, reading_ver, saved, small) {}; bool operator == (const cat_entree & ref) const; // using dump from cat_device class // using method is_more_recent_than() from cat_device class // using method has_changed_since() from cat_device class unsigned char signature() const { return mk_signature('b', get_saved_status()); }; cat_entree *clone() const { return new (get_pool()) cat_blockdev(*this); }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/messaging.hpp0000644000175000017430000001540312641772777013753 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file messaging.hpp /// \brief messaging_decode and messaging_encode are used to insert messages in a flow if data blocks /// \ingroup Private /// #ifndef MESSAGING_HPP #define MESSAGING_HPP #include "../my_config.h" #include #include "label.hpp" #include "infinint.hpp" #include "memory_file.hpp" #include "infinint.hpp" namespace libdar { enum class msg_type { unset, //< no argument: message type is not set (error) order_read_ahead, //< + infinint : messge is an info that the given amount of data is about to be read order_read_ahead_begin, //< + infinint : message continues with the next block order_read, //< + U_I : message is a read order (with expected size to be read ahead) order_sync_write, //< no argument: order to flush all pending writes answr_sync_write_done, //< no argument: answer from the slave that all data have been sync written order_skip, //< + infinint : message is an order to seek at given position order_skip_begin, //< + infinint : message is an order to seek but the seek info continues in the next message order_skip_to_eof, //< no argument: message requesting slave to skip to end of file order_skip_fwd, //< + U_I : order to skip foward order_skip_bkd, //< + U_I : order to skip backward answr_skip_done, //< + bool : answer for all kind of skip orders order_skippable_fwd, //< + infinint : message from master containing a skippable forward request info order_skippable_fwd_begin,//< + infinint : message continues on the next block order_skippable_bkd, //< + infinint : message from master containing a skippable backward request info order_skippable_bkd_begin,//< + infinint : message continues on the next block answr_skippable, //< + bool : answer from slace to a skippable forward/backward request order_get_position, //< no argument: order to get the current position in file answr_position, //< + infinint : answer with the current position answr_position_begin, //< + infinint : message continues with the next block answr_exception, //< no argument: last operation generated an exception for at slave side, slave has probably died after that order_end_of_xmit, //< no argument: message is the last message and implies freedom of the slave order_stop_readahead, //< no argument: order to stop possibly running read_ahead answr_readahead_stopped, //< no argument: answer that the readahead has ended or no read ahead was running order_wakeup, //< no argument: order to continue reading/writing loop (reading suspendend because of pipe full, writing because of pipe was empty) data_partial, //< + data : beside data in input/output data pipes data_completed //< + data : beside data in output data pipe when EOF has been reached }; extern bool msg_equivalent(msg_type arg1, msg_type arg2); extern bool msg_continues(msg_type msg); extern char msg_type2char(msg_type x); extern msg_type char2msg_type(char x); extern msg_type msg_continuation_of(msg_type x); class messaging_decode : public on_pool { public: messaging_decode() {msgt = msg_type::unset; }; /// reset the object to its initial state void clear(); /// add a block of data to be decoded /// /// \param[in] x_input is the address of the message to add /// \param[in] x_size is the size of the message to add /// \return true if the message is complet, false if a new block /// need to be added with this call in order to decode the message bool add_block(const char *x_input, U_I x_size); /// get the type of message pointed to at construction time msg_type get_type() const { return msgt; }; /// for messages of type order_skip, answr_filesize, order_read_ahead, answr_filesize, infinint get_infinint() const; /// for messages of type order_read U_I get_U_I() const; /// for messages of type order_set_context std::string get_string() const; /// for messages of type anwsr_oldarchive bool get_bool() const; /// for messages of type answr_get_dataname, label get_label() const; private: msg_type msgt; memory_file buffer; }; class messaging_encode : public on_pool { public: /// constructor messaging_encode() { msgt = msg_type::unset; }; /// reset the object to its initial state void clear(); /// define the type of the message to generate void set_type(msg_type val) { msgt = val; }; /// add infininit attribute void set_infinint(const infinint & val); /// add U_I attribute void set_U_I(U_I val); /// add string attribute void set_string(const std::string & val); /// set boolean attribute void set_bool(bool val); /// set label attribute void set_label(const label & val); /// set the read block pointer to the first block void reset_get_block(); /// read the next block /// /// \param[in] ptr is the address where to write the next block of the message /// \param[in,out] size is the maximum amount of byte that can be written to ptr /// and is modified by this call to the effective number of byte written to ptr /// \return true if the whole message could be written to block, else false /// is returned an a new call to get_block is necessary to write down the rest of /// the message up to the time get_block() returns true /// \note for data encoding, the message is a single byte length. /// this byte has been placed before the data before in the same block bool get_block(char * ptr, unsigned int & size); private: msg_type msgt; memory_file buffer; }; } // end of namespace #endif dar-2.5.3/src/libdar/entrepot_local.hpp0000644000175000017430000000723312641772777015012 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ // $Id: entrepot.hpp,v 1.1 2012/04/27 11:24:30 edrusb Exp $ // /*********************************************************************/ /// \file entrepot_local.hpp /// \brief defines the implementation for local filesystem entrepot /// The entrepot_local is the only implementation of an entrepot class present /// in libdar. It correspond to local filesystems. The reason of existence of the /// entrepot stuff is to allow external application like webdar to drop/read slices over /// the network using FTP protocol for example. External applications only have to define /// Their own implementation of the entrepot interface and file-like objects they /// generates (inherited from class fichier_global), libdar uses them throught the /// generic interface. This avoids having network related stuff inside libdar, which /// for security reason and functions/roles separation would not be a good idea /// \ingroup Private #ifndef ENTREPOT_LOCAL_HPP #define ENTREPOT_LOCAL_HPP #include "../my_config.h" #include #include "infinint.hpp" #include "generic_file.hpp" #include "user_interaction.hpp" #include "entrepot.hpp" #include "fichier_global.hpp" #include "hash_fichier.hpp" #include "etage.hpp" #include "path.hpp" namespace libdar { /// \addtogroup Private /// @{ /// implementation for entrepot to access to local filesystem /// /// entrepot_local generates objects of class "fichier_local" inherited class of fichier_global class entrepot_local : public entrepot { public: entrepot_local(const std::string & user, const std::string & group, bool x_furtive_mode); entrepot_local(const entrepot_local & ref): entrepot(ref) { copy_from(ref); }; entrepot_local & operator = (const entrepot_local & ref); ~entrepot_local() { detruit(); }; std::string get_url() const { return std::string("file://") + get_full_path().display(); }; void read_dir_reset(); bool read_dir_next(std::string & filename); entrepot *clone() const { return new (get_pool()) entrepot_local(*this); }; protected: fichier_global *inherited_open(user_interaction & dialog, const std::string & filename, gf_mode mode, bool force_permission, U_I permission, bool fail_if_exists, bool erase) const; void inherited_unlink(const std::string & filename) const; void read_dir_flush() { detruit(); }; private: bool furtive_mode; etage *contents; void copy_from(const entrepot_local & ref) { furtive_mode = ref.furtive_mode; contents = nullptr; }; void detruit() { if(contents != nullptr) { delete contents; contents = nullptr; } }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_ignored_dir.cpp0000644000175000017430000000341012641772777015100 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_ignored_dir.hpp" using namespace std; namespace libdar { bool cat_ignored_dir::operator == (const cat_entree & ref) const { const cat_ignored_dir *ref_ignored_dir = dynamic_cast(&ref); if(ref_ignored_dir == nullptr) return false; else return cat_inode::operator == (ref); } void cat_ignored_dir::inherited_dump(const pile_descriptor & pdesc, bool small) const { cat_directory tmp = cat_directory(get_uid(), get_gid(), get_perm(), get_last_access(), get_last_modif(), get_last_change(), get_name(), 0); tmp.set_saved_status(get_saved_status()); tmp.specific_dump(pdesc, small); // dump an empty directory } } // end of namespace dar-2.5.3/src/libdar/secu_string.hpp0000644000175000017430000001643012641773000014300 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file secu_string.hpp /// \brief this file contains the definition of secu_string class, a std::string like class but allocated in secure memory /// \ingroup Private /// /// secure memory is a allocated memory that is never swapped out (wrote to disk) /// the implementation relies on gcrypt_malloc_secure() call (libgcrypt) /// rather than relying on mlock()/munlock() posix system call. /// as the need for secure string is for strong encryption, there is no much /// interest in re-inventing the wheel as the need is dependent on gcrypt availability #ifndef SECU_STRING_HPP #define SECU_STRING_HPP #include "../my_config.h" #include #include "integers.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ /// class secu_string /// it manages the allocation/release of a given size block of memory /// and let the user feed it from a filedescriptor /// and access to it under with a char* pointer. /// if more constructor are needed (espetially toward API), tell me, but /// this is a non-sens to build a secure string from another data structure which is /// not yet secured, where from the read() method that fetches data directly from a /// filedescriptor (read() low-level system call) which might be a tty for example class secu_string : public on_pool { public: /// to know if secure memory is available /// /// it is advised that the user program of class secu_string uses this call before using objects of that class /// and if returned false, advise the user that the necessary support for secure memory /// is not present, that any sensitive data may be swapped out under heavy memory load and thus /// may lead secure password to be wrote to disk in clear. static bool is_string_secured(); /// constructor 1 /// /// create the allocated string in secure memory /// \param[in] storage_size is the amount of secured memory to obtain when creating the object secu_string(U_I storage_size = 0) { init(storage_size); }; /// constructor 2 /// /// create the string from a pointer to a (secure) string or from a portion of it secu_string(const char *ptr, U_I size) { init(size); append_at(0, ptr, size); }; /// the copy constructor secu_string(const secu_string & ref) { copy_from(ref); }; /// the assignment operator secu_string & operator = (const secu_string & ref) { clean_and_destroy(); copy_from(ref); return *this; }; bool operator != (const std::string & ref) const { return ! (*this == ref); }; bool operator != (const secu_string & ref) const { return ! (*this == ref); }; bool operator == (const std::string &ref) const { return compare_with(ref.c_str(),(U_I)(ref.size())); }; bool operator == (const secu_string &ref) const { return compare_with(ref.mem, *(ref.string_size)); }; /// the destructor (set memory to zero before releasing it) ~secu_string() throw(Ebug) { clean_and_destroy(); }; /// fill the object with data /// /// set at most size bytes of data directly from the filedescriptor, /// \param[in] fd the filedescriptor to read data from /// \param[in] size is the maximum number of byte read /// \note if current storage size is not larg enough to hold size bytes, /// allocated secure memory is released and larger allocation of secure memory is done. void set(int fd, U_I size); /// append some data to the string at a given offset /// /// \param[in] offset defines at which offset in the secu_string will be placed the string to append /// \param[in] ptr is the address of the string to append /// \param[in] size is the number of byte to append /// \note this call does not change the allocation size, (unlike read()), it adds the data pointed by the arguments /// to the object while there is enough place to do so. /// resize() must be used first to define enough secure memory to append the expected amount of data /// in one or several call to append. void append_at(U_I offset, const char *ptr, U_I size); /// append some data to the string void append_at(U_I offset, int fd, U_I size); /// append some data at the end of the string void append(const char *ptr, U_I size) { append_at(*string_size, ptr, size); }; /// append some data at the end of the string void append(int fd, U_I size) { append_at(*string_size, fd, size); }; /// shorten the string (do not change the allocated size) /// /// \param[in] pos is the length of the string to set, it must be smaller or equal to the current size void reduce_string_size_to(U_I pos); /// clear the string (set to an empty string) void clear() { *string_size = 0; }; /// clear and resize the string to the defined allocated size /// /// \param[in] size is the amount of secure memory to allocated void resize(U_I size) { clean_and_destroy(); init(size); }; /// set the string to randomize string of given size /// /// \note the given size must be less than allocated size void randomize(U_I size); /// get access to the secure string /// \return the address of the first byte of the string /// \note check the "size" method to know how much bytes can be read const char*c_str() const { return mem == nullptr ? throw SRC_BUG : mem; }; /// get access to the secure string by index /// /// \note index must be in the range [ 0 - size() [ to avoid throwing an exception char & operator[] (U_I index); char operator[](U_I index) const { return (const_cast(this))->operator[](index); }; /// get the size of the string U_I get_size() const { if(string_size == nullptr) throw SRC_BUG; return *string_size; }; // returns the size of the string /// get the size of the allocated secure space U_I get_allocated_size() const { return *allocated_size - 1; }; private: U_I *allocated_size; char *mem; U_I *string_size; void init(U_I size); //< to be used at creation time or after clean_and_destroy() only void copy_from(const secu_string & ref); //< to be used at creation time or after clean_and_destroy() only bool compare_with(const char *ptr, U_I size) const; // return true if given sequence is the same as the one stored in "this" void clean_and_destroy(); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/nls_swap.hpp0000644000175000017430000000340212641772777013620 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file nls_swap.hpp /// \brief provides a set of macro to change the NLS from user application domaine to libdar domain and viceversa /// \ingroup Private #ifndef NLS_SWAP_HPP #define NLS_SWAP_HPP #include "../my_config.h" #include #include "tools.hpp" #ifdef ENABLE_NLS /// \addtogroup Private /// @{ #define NLS_SWAP_IN \ std::string nls_swap_tmp; \ if(textdomain(nullptr) != nullptr) \ { \ nls_swap_tmp = textdomain(nullptr); \ textdomain(PACKAGE); \ } \ else \ nls_swap_tmp = "" #define NLS_SWAP_OUT \ if(nls_swap_tmp != "") \ textdomain(nls_swap_tmp.c_str()) #else #define NLS_SWAP_IN // #define NLS_SWAP_OUT // #endif /// @} #endif dar-2.5.3/src/libdar/zapette.cpp0000644000175000017430000004031212641773000013416 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // to allow compilation under Cygwin we need // else Cygwin's lack __int16_t symbol !?! #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif } // end extern "C" #include #include #include "zapette.hpp" #include "infinint.hpp" #include "tools.hpp" #define ANSWER_TYPE_DATA 'D' #define ANSWER_TYPE_INFININT 'I' #define REQUEST_SIZE_SPECIAL_ORDER 0 #define REQUEST_OFFSET_END_TRANSMIT 0 #define REQUEST_OFFSET_GET_FILESIZE 1 #define REQUEST_OFFSET_CHANGE_CONTEXT_STATUS 2 #define REQUEST_IS_OLD_START_END_ARCHIVE 3 #define REQUEST_GET_DATA_NAME 4 using namespace std; namespace libdar { struct request { char serial_num; U_16 size; // size or REQUEST_SIZE_SPECIAL_ORDER infinint offset; // offset or REQUEST_OFFSET_END_TRANSMIT or REQUEST_OFFSET_GET_FILESIZE, REQUEST_OFFSET_* ... string info; // new contextual_status void write(generic_file *f); // master side void read(generic_file *f); // slave side }; struct answer { char serial_num; char type; U_16 size; infinint arg; void write(generic_file *f, char *data); // slave side void read(generic_file *f, char *data, U_16 max); // master side }; void request::write(generic_file *f) { U_16 tmp = htons(size); f->write(&serial_num, 1); offset.dump(*f); f->write((char *)&tmp, sizeof(tmp)); if(size == REQUEST_SIZE_SPECIAL_ORDER && offset == REQUEST_OFFSET_CHANGE_CONTEXT_STATUS) tools_write_string(*f, info); } void request::read(generic_file *f) { U_16 tmp; U_16 pas; if(f->read(&serial_num, 1) == 0) throw Erange("request::read", gettext("Partial request received, aborting\n")); if(f == nullptr) throw SRC_BUG; offset = infinint(*f); pas = 0; while(pas < sizeof(tmp)) pas += f->read((char *)&tmp+pas, sizeof(tmp)-pas); size = ntohs(tmp); if(size == REQUEST_SIZE_SPECIAL_ORDER && offset == REQUEST_OFFSET_CHANGE_CONTEXT_STATUS) tools_read_string(*f, info); else info = ""; } void answer::write(generic_file *f, char *data) { U_16 tmp = htons(size); f->write(&serial_num, 1); f->write(&type, 1); switch(type) { case ANSWER_TYPE_DATA: f->write((char *)&tmp, sizeof(tmp)); if(data != nullptr) f->write(data, size); else if(size != 0) throw SRC_BUG; break; case ANSWER_TYPE_INFININT: arg.dump(*f); break; default: throw SRC_BUG; } } void answer::read(generic_file *f, char *data, U_16 max) { U_16 tmp; U_16 pas; f->read(&serial_num, 1); f->read(&type, 1); switch(type) { case ANSWER_TYPE_DATA: pas = 0; while(pas < sizeof(tmp)) pas += f->read((char *)&tmp+pas, sizeof(tmp)-pas); size = ntohs(tmp); pas = 0; while(pas < size) pas += f->read(data+pas, size-pas); if(size > max) // need to drop the remaining data { char black_hole; for(tmp = max; tmp < size; ++tmp) f->read(&black_hole, 1); // might not be very performant code } arg = 0; break; case ANSWER_TYPE_INFININT: if(f == nullptr) throw SRC_BUG; arg = infinint(*f); size = 0; break; default: throw Erange("answer::read", gettext("Corrupted data read on pipe")); } } slave_zapette::slave_zapette(generic_file *input, generic_file *output, generic_file *data) { if(input == nullptr) throw SRC_BUG; if(output == nullptr) throw SRC_BUG; if(data == nullptr) throw SRC_BUG; if(input->get_mode() == gf_write_only) throw Erange("slave_zapette::slave_zapette", gettext("Input cannot be read")); if(output->get_mode() == gf_read_only) throw Erange("slave_zapette::slave_zapette", gettext("Cannot write to output")); if(data->get_mode() != gf_read_only) throw Erange("slave_zapette::slave_zapette", gettext("Data should be read-only")); in = input; out = output; src = data; src_ctxt = dynamic_cast(data); if(src_ctxt == nullptr) throw Erange("slave_zapette::slave_zapette", "Object given to data must inherit from contextual class"); } slave_zapette::~slave_zapette() { if(in != nullptr) delete in; if(out != nullptr) delete out; if(src != nullptr) delete src; } void slave_zapette::action() { request req; answer ans; char *buffer = nullptr; U_16 buf_size = 1024; meta_new(buffer, buf_size); if(buffer == nullptr) throw Ememory("slave_zapette::action"); try { do { req.read(in); ans.serial_num = req.serial_num; if(req.size != REQUEST_SIZE_SPECIAL_ORDER) { ans.type = ANSWER_TYPE_DATA; if(src->skip(req.offset)) { // enlarge buffer if necessary if(req.size > buf_size) { if(buffer != nullptr) meta_delete(buffer); meta_new(buffer, req.size); if(buffer == nullptr) throw Ememory("slave_zapette::action"); else buf_size = req.size; } ans.size = src->read(buffer, req.size); ans.write(out, buffer); } else // bad position { ans.size = 0; ans.write(out, nullptr); } } else // special orders { if(req.offset == REQUEST_OFFSET_END_TRANSMIT) // stop communication { ans.type = ANSWER_TYPE_DATA; ans.size = 0; ans.write(out, nullptr); } else if(req.offset == REQUEST_OFFSET_GET_FILESIZE) // return file size { ans.type = ANSWER_TYPE_INFININT; if(!src->skip_to_eof()) throw Erange("slave_zapette::action", gettext("Cannot skip at end of file")); ans.arg = src->get_position(); ans.write(out, nullptr); } else if(req.offset == REQUEST_OFFSET_CHANGE_CONTEXT_STATUS) // contextual status change requested { ans.type = ANSWER_TYPE_INFININT; ans.arg = 1; src_ctxt->set_info_status(req.info); ans.write(out, nullptr); } else if(req.offset == REQUEST_IS_OLD_START_END_ARCHIVE) // return whether the underlying archive has an old slice header or not { ans.type = ANSWER_TYPE_INFININT; ans.arg = src_ctxt->is_an_old_start_end_archive() ? 1 : 0; ans.write(out, nullptr); } else if(req.offset == REQUEST_GET_DATA_NAME) // return the data_name of the underlying sar { ans.type = ANSWER_TYPE_DATA; ans.arg = 0; ans.size = src_ctxt->get_data_name().size(); ans.write(out, (char *)(src_ctxt->get_data_name().data())); } else throw Erange("zapette::action", gettext("Received unknown special order")); } } while(req.size != REQUEST_SIZE_SPECIAL_ORDER || req.offset != REQUEST_OFFSET_END_TRANSMIT); } catch(...) { if(buffer != nullptr) meta_delete(buffer); throw; } if(buffer != nullptr) meta_delete(buffer); } zapette::zapette(const user_interaction & dialog, generic_file *input, generic_file *output, bool by_the_end) : generic_file(gf_read_only), mem_ui(dialog) { if(input == nullptr) throw SRC_BUG; if(output == nullptr) throw SRC_BUG; if(input->get_mode() == gf_write_only) throw Erange("zapette::zapette", gettext("Cannot read on input")); if(output->get_mode() == gf_read_only) throw Erange("zapette::zapette", gettext("Cannot write on output")); in = input; out = output; position = 0; serial_counter = 0; contextual::set_info_status(CONTEXT_INIT); ////////////////////////////// // retreiving the file size // S_I tmp = 0; make_transfert(REQUEST_SIZE_SPECIAL_ORDER, REQUEST_OFFSET_GET_FILESIZE, nullptr, "", tmp, file_size); ////////////////////////////// // positionning cursor for next read // depending on the by_the_end value // try { if(by_the_end) { try { skip_to_eof(); } catch(Erange & e) { string tmp = e.get_message(); get_ui().printf(gettext("Failed driving dar_slave to the end of archive: %S. Trying to open the archive from the first bytes"), &tmp); skip(0); } } else skip(0); } catch(...) { terminate(); throw; } } zapette::~zapette() { try { terminate(); } catch(...) { // ignore all exceptions } delete in; delete out; } void zapette::inherited_terminate() { S_I tmp = 0; make_transfert(REQUEST_SIZE_SPECIAL_ORDER, REQUEST_OFFSET_END_TRANSMIT, nullptr, "", tmp, file_size); } bool zapette::skip(const infinint & pos) { if(is_terminated()) throw SRC_BUG; if(pos >= file_size) { position = file_size; return false; } else { position = pos; return true; } } bool zapette::skip_relative(S_I x) { if(is_terminated()) throw SRC_BUG; if(x >= 0) { position += x; if(position > file_size) { position = file_size; return false; } else return true; } else if(infinint(-x) > position) { position = 0; return false; } else { position -= (-x); // implicit conversion of "-x" to infinint (positive) return true; } } void zapette::set_info_status(const std::string & s) { infinint val; S_I tmp = 0; if(is_terminated()) throw SRC_BUG; make_transfert(REQUEST_SIZE_SPECIAL_ORDER, REQUEST_OFFSET_CHANGE_CONTEXT_STATUS, nullptr, s, tmp, val); contextual::set_info_status(s); } bool zapette::is_an_old_start_end_archive() const { infinint val; S_I tmp = 0; if(is_terminated()) throw SRC_BUG; make_transfert(REQUEST_SIZE_SPECIAL_ORDER, REQUEST_IS_OLD_START_END_ARCHIVE, nullptr, "", tmp, val); return val == 1; } const label & zapette::get_data_name() const { static label data_name; infinint arg; S_I lu = data_name.size(); // used to specify the amount of space allocated for the answer if(is_terminated()) throw SRC_BUG; make_transfert(REQUEST_SIZE_SPECIAL_ORDER, REQUEST_GET_DATA_NAME, data_name.data(), "", lu, arg); if(lu != (S_I)data_name.size()) throw Erange("zapette::get_data_name", gettext("Uncomplete answer received from peer")); return data_name; } U_I zapette::inherited_read(char *a, U_I size) { static const U_16 max_short = ~0; U_I lu = 0; if(size > 0) { infinint not_used; U_16 pas; S_I ret; do { if(size - lu > max_short) pas = max_short; else pas = size - lu; make_transfert(pas, position, a+lu, "", ret, not_used); position += ret; lu += ret; } while(lu < size && ret != 0); } return lu; } void zapette::inherited_write(const char *a, U_I size) { throw SRC_BUG; // zapette is read-only } void zapette::make_transfert(U_16 size, const infinint &offset, char *data, const string & info, S_I & lu, infinint & arg) const { request req; answer ans; // building the request req.serial_num = const_cast(serial_counter)++; // may loopback to 0 req.offset = offset; req.size = size; req.info = info; req.write(out); if(req.size == REQUEST_SIZE_SPECIAL_ORDER) size = lu; // reading the answer do { ans.read(in, data, size); if(ans.serial_num != req.serial_num) get_ui().pause(gettext("Communication problem with peer, retry ?")); } while(ans.serial_num != req.serial_num); // argument affectation switch(ans.type) { case ANSWER_TYPE_DATA: lu = ans.size; arg = 0; break; case ANSWER_TYPE_INFININT: lu = 0; arg = ans.arg; break; default: // might be a transmission error do to weak transport layer throw Erange("zapette::make_transfert", gettext("Incoherent answer from peer")); } // sanity checks if(req.size == REQUEST_SIZE_SPECIAL_ORDER) { if(req.offset == REQUEST_OFFSET_END_TRANSMIT) { if(ans.size != 0 && ans.type != ANSWER_TYPE_DATA) get_ui().warning(gettext("Bad answer from peer, while closing connection")); } else if(req.offset == REQUEST_OFFSET_GET_FILESIZE) { if(ans.size != 0 && ans.type != ANSWER_TYPE_INFININT) throw Erange("zapette::make_transfert", gettext("Incoherent answer from peer")); } else if(req.offset == REQUEST_OFFSET_CHANGE_CONTEXT_STATUS) { if(ans.arg != 1) throw Erange("zapette::make_transfert", gettext("Unexpected answer from slave, communication problem or bug may hang the operation")); } else if(req.offset == REQUEST_IS_OLD_START_END_ARCHIVE) { if(ans.type != ANSWER_TYPE_INFININT || (ans.arg != 0 && ans.arg != 1) ) throw Erange("zapetee::make_transfert", gettext("Unexpected answer from slave, communication problem or bug may hang the operation")); } else if(req.offset == REQUEST_GET_DATA_NAME) { if(ans.type != ANSWER_TYPE_DATA && lu != (S_I)(label::common_size())) throw Erange("zapetee::make_transfert", gettext("Unexpected answer from slave, communication problem or bug may hang the operation")); } else throw Erange("zapette::make_transfert", gettext("Corrupted data read from pipe")); } } } // end of namespace dar-2.5.3/src/libdar/cat_eod.hpp0000644000175000017430000000350712641772777013376 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_eod.hpp /// \brief object exchanged with a catalogue (never stored in it) to signal the end of a directory /// \ingroup Private #ifndef CAT_EOD_HPP #define CAT_EOD_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_entree.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the End of Directory entry class class cat_eod : public cat_entree { public : cat_eod() {}; cat_eod(const pile_descriptor & pdesc, bool small): cat_entree(pdesc, small) {}; // dump defined by cat_entree virtual bool operator == (const cat_entree & ref) const { return true; }; unsigned char signature() const { return 'z'; }; cat_entree *clone() const { return new (get_pool()) cat_eod(); }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/Makefile.am0000644000175000017430000001741212642474445013313 00000000000000if BSD_SED SED_REGEX = -E else SED_REGEX = -r endif if PROFILING LD_PROF = -pg CPP_PROF = -pg clean-local: rm -f gmon.out rm -f libdar.pc else LD_PROF = CPP_PROF = clean-local: rm -f libdar.pc endif localedir = @localedir@ pkgconfigdir = @pkgconfigdir@ if BUILD_MODE32 MYLIB=libdar32.la AM_CPPFLAGS=-DLIBDAR_MODE=32 -DDAR_LOCALEDIR=\"$(localedir)\" $(CPP_PROF) $(GPGME_CFLAGS) VER_SRC=limitint.o LIBDAR_SUFFIX=32 LIBDAR_MODE=-DLIBDAR_MODE=32 else if BUILD_MODE64 MYLIB=libdar64.la AM_CPPFLAGS=-DLIBDAR_MODE=64 -DDAR_LOCALEDIR=\"$(localedir)\" $(CPP_PROF) $(GPGME_CFLAGS) VER_SRC=limitint.o LIBDAR_SUFFIX=64 LIBDAR_MODE=-DLIBDAR_MODE=64 else MYLIB=libdar.la AM_CPPFLAGS= -DDAR_LOCALEDIR=\"$(localedir)\" $(CPP_PROF) $(GPGME_CFLAGS) VER_SRC=real_infinint.o LIBDAR_SUFFIX= LIBDAR_MODE= endif endif if WITH_LIBTHREADAR LIBTHREADAR_DEP_MODULES=generic_thread.cpp slave_thread.cpp messaging.cpp else LIBTHREADAR_DEP_MODULES= endif AM_LDFLAGS = @LTLIBINTL@ $(LD_PROF) LDADD = $(GPGME_LIBS) lib_LTLIBRARIES = $(MYLIB) CXXSTDFLAGS = @CXXSTDFLAGS@ LIBDAR_MAJOR=`grep LIBDAR_COMPILE_TIME_MAJOR libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed -e 's% %%g'` LIBDAR_MEDIUM=`grep LIBDAR_COMPILE_TIME_MEDIUM libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed -e 's% %%g'` LIBDAR_MEDIUM_000=`grep LIBDAR_COMPILE_TIME_MEDIUM libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed $(SED_REGEX) -e 's% %%g' -e 's%([^0-9]|^)([0-9]{1})([^0-9]|$$)%0\2%' -e 's%([^0-9]|^)([0-9]{2})([^0-9]|$$)%0\2%'` LIBDAR_MINOR=`grep LIBDAR_COMPILE_TIME_MINOR libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed -e 's% %%g'` LIBDAR_LIBTOOL_CURRENT=$(LIBDAR_MAJOR)$(LIBDAR_MEDIUM_000) LIBDAR_LIBTOOL_REVISION=$(LIBDAR_MINOR) LIBDAR_LIBTOOL_AGE=$(LIBDAR_MEDIUM) LIBDAR_VERSION_IN=$(LIBDAR_LIBTOOL_CURRENT):$(LIBDAR_LIBTOOL_REVISION):$(LIBDAR_LIBTOOL_AGE) LIBDAR_VERSION_OUT=$(LIBDAR_MAJOR).$(LIBDAR_MEDIUM).$(LIBDAR_MINOR) # header files required by external applications and that must be installed (make install) dist_noinst_DATA = libdar.hpp path.hpp mask.hpp integers.hpp real_infinint.hpp statistics.hpp user_interaction.hpp erreurs.hpp deci.hpp limitint.hpp infinint.hpp compressor.hpp generic_file.hpp wrapperlib.hpp storage.hpp tuyau.hpp tools.hpp catalogue.hpp cat_entree.hpp cat_nomme.hpp cat_directory.hpp cat_inode.hpp scrambler.hpp archive.hpp header_version.hpp ea.hpp crypto.hpp int_tools.hpp thread_cancellation.hpp tronconneuse.hpp mask_list.hpp database.hpp data_tree.hpp criterium.hpp trontextual.hpp archive_options.hpp user_group_bases.hpp database_options.hpp label.hpp tlv_list.hpp tlv.hpp memory_file.hpp pile.hpp archive_version.hpp mem_ui.hpp fichier_global.hpp fichier_local.hpp erreurs_ext.hpp secu_string.hpp crc.hpp hash_fichier.hpp escape.hpp escape_catalogue.hpp compile_time_features.hpp nls_swap.hpp entrepot.hpp entrepot_local.hpp etage.hpp list_entry.hpp fsa_family.hpp capabilities.hpp on_pool.hpp mem_allocator.hpp memory_pool.hpp datetime.hpp crypto_asym.hpp generic_file_overlay_for_gpgme.hpp secu_memory_file.hpp crypto_sym.hpp mem_sized.hpp mem_cluster.hpp filesystem_specific_attribute.hpp range.hpp pile_descriptor.hpp slice_layout.hpp install-data-local: mkdir -p $(DESTDIR)$(pkgincludedir) cp ../../config.h $(DESTDIR)$(pkgincludedir)/libdar_config.h sed -e 's%../config.h%libdar_config.h%g' -e 's%HAVE_CONFIG_H%1%g' -e 's%MY_CONFIG_H%LIBDAR_MY_CONFIG_H%g' ../my_config.h > ./libdar_my_config.h cp ../gettext.h . for file in $(dist_noinst_DATA) gettext.h libdar_my_config.h ; do sed -e 's%#include \"../my_config.h\"%INC_MY_CONFIG_FILE_H%g' -e "s%#include \"%#include \"$(pkgincludedir)/%g" -e "s%INC_MY_CONFIG_FILE_H%#include \"$(pkgincludedir)/libdar_my_config.h\"%g" "$$file" > $(DESTDIR)$(pkgincludedir)/"$$file" ; done rm libdar_my_config.h gettext.h for file in $(DESTDIR)$(pkgincludedir)/* ; do sed -e 's%HAVE_%LIBDAR_HAS_%g' -e 's%PACKAGE%DAR_PACKAGE%g' -e 's%SIZEOF_%LIBDAR_SIZEOF_%g' -e 's%LSTAT_FOLLOWS_SLASHED_SYMLINK%LIBDAR_LSTAT_FOLLOWS_SLASHED_SYMLINK%g' -e 's%VERSION%LIBDAR_VERSION%g' -e 's%MUTEX_WORKS%LIBDAR_MUTEX_WORKS%g' -e 's%OS_BITS%LIBDAR_OS_BITS%g' -e 's%_AVAILABLE%_AVAILABLE_FOR_LIBDAR%g' -e 's%STDC_HEADERS%LIBDAR_STDC_HEADERS%g' -e 's%ENABLE_NLS%DAR_ENABLE_NLS%g' -e 's%HAVE_GETTEXT%DAR_HAS_GETTEXT%g' "$$file" > "$$file.tmp" && mv "$$file.tmp" "$$file" ; done egrep 'LIBDAR|DAR_' $(DESTDIR)$(pkgincludedir)/libdar_config.h | grep -v "#undef" > $(DESTDIR)$(pkgincludedir)/config.h.tmp mv $(DESTDIR)$(pkgincludedir)/config.h.tmp $(DESTDIR)$(pkgincludedir)/libdar_config.h chmod 0644 $(DESTDIR)$(pkgincludedir)/* $(INSTALL) -d $(DESTDIR)$(pkgconfigdir) $(INSTALL) -m 0644 libdar.pc $(DESTDIR)$(pkgconfigdir)/libdar$(LIBDAR_SUFFIX).pc uninstall-local: rm -rf $(DESTDIR)$(pkgincludedir) $(DESTDIR)$(pkgconfigdir)/libdar$(LIBDAR_SUFFIX).pc all-local : libdar.pc libdar.pc : libdar.pc.tmpl sed -e "s%#LIBDAR_VERSION#%$(LIBDAR_VERSION_OUT)%g" -e "s%#LIBDAR_SUFFIX#%$(LIBDAR_SUFFIX)%g" -e "s%#LIBDAR_MODE#%$(LIBDAR_MODE)%g" -e "s%#CXXFLAGS#%$(CXXFLAGS)%g" -e "s%#CXXSTDFLAGS#%$(CXXSTDFLAGS)%g" libdar.pc.tmpl > libdar.pc # header files that are internal to libdar and that must not be installed (make install) noinst_HEADERS = defile.hpp ea_filesystem.hpp filesystem.hpp filtre.hpp header.hpp macro_tools.hpp null_file.hpp sar.hpp trivial_sar.hpp sar_tools.hpp terminateur.hpp tronc.hpp zapette.hpp cygwin_adapt.hpp elastic.hpp database_header.hpp sparse_file.hpp semaphore.hpp memory_check.hpp messaging.hpp slave_thread.hpp generic_thread.hpp cat_blockdev.hpp cat_chardev.hpp cat_detruit.hpp cat_device.hpp cat_door.hpp cat_eod.hpp cat_file.hpp cat_ignored.hpp cat_ignored_dir.hpp cat_lien.hpp cat_mirage.hpp cat_prise.hpp cat_tube.hpp cat_etoile.hpp cat_all_entrees.hpp cat_tools.hpp generic_to_global_file.hpp ALL_SOURCES = catalogue.cpp catalogue.hpp compressor.cpp compressor.hpp deci.cpp deci.hpp defile.cpp defile.hpp ea.cpp ea.hpp ea_filesystem.cpp ea_filesystem.hpp erreurs.cpp erreurs.hpp etage.cpp etage.hpp filesystem.cpp filesystem.hpp filtre.cpp filtre.hpp generic_file.cpp generic_file.hpp header.cpp header_version.cpp libdar.cpp macro_tools.cpp mask.cpp path.cpp sar.cpp trivial_sar.cpp sar_tools.cpp scrambler.cpp storage.cpp terminateur.cpp tools.cpp tronc.cpp tuyau.cpp user_interaction.cpp wrapperlib.cpp zapette.cpp archive.cpp crypto.cpp cache.cpp cache.hpp int_tools.cpp tronconneuse.cpp elastic.cpp thread_cancellation.cpp mask_list.cpp database.cpp database_header.cpp data_tree.cpp statistics.cpp criterium.cpp memory_file.cpp tlv.cpp tlv_list.cpp label.cpp trontextual.cpp archive_options.cpp user_group_bases.cpp escape.cpp escape_catalogue.cpp pile.cpp sparse_file.cpp crc.cpp archive_version.cpp mem_ui.cpp fichier_global.cpp fichier_local.cpp hash_fichier.cpp secu_string.cpp semaphore.cpp integers.cpp compile_time_features.cpp memory_check.cpp entrepot.cpp entrepot_local.cpp list_entry.cpp filesystem_specific_attribute.cpp fsa_family.cpp capabilities.cpp on_pool.cpp mem_cluster.cpp mem_sized.cpp mem_allocator.cpp memory_pool.cpp datetime.cpp crypto_asym.cpp generic_file_overlay_for_gpgme.cpp secu_memory_file.cpp crypto_sym.cpp range.cpp slice_layout.cpp cat_detruit.cpp cat_device.cpp cat_directory.cpp cat_door.cpp cat_entree.cpp cat_etoile.cpp cat_file.cpp cat_ignored_dir.cpp cat_inode.cpp cat_lien.cpp cat_mirage.cpp cat_nomme.cpp cat_tools.cpp pile_descriptor.cpp cat_chardev.cpp cat_blockdev.cpp cat_tube.cpp cat_ignored.cpp cat_prise.cpp erreurs_ext.cpp libdar_la_LDFLAGS = -version-info $(LIBDAR_VERSION_IN) libdar_la_SOURCES = $(ALL_SOURCES) real_infinint.cpp $(LIBTHREADAR_DEP_MODULES) libdar32_la_LDFLAGS = -version-info $(LIBDAR_VERSION_IN) libdar32_la_SOURCES = $(ALL_SOURCES) limitint.cpp $(LIBTHREADAR_DEP_MODULES) libdar64_la_LDFLAGS = -version-info $(LIBDAR_VERSION_IN) libdar64_la_SOURCES = $(ALL_SOURCES) limitint.cpp $(LIBTHREADAR_DEP_MODULES) dar-2.5.3/src/libdar/erreurs_ext.cpp0000644000175000017430000000351512641772777014341 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "erreurs_ext.hpp" using namespace std; namespace libdar { Ethread_cancel_with_attr::Ethread_cancel_with_attr(bool now, U_64 x_flag, const infinint & attr) : Ethread_cancel(now, x_flag) { x_attr = new (nothrow) infinint(attr); if(x_attr == nullptr) throw Ememory("Ethread_cancel_with_attr::Ethread_cancel_with_attr"); } void Ethread_cancel_with_attr::detruit() { try { if(x_attr != nullptr) { delete x_attr; x_attr = nullptr; } } catch(...) { // do nothing } } void Ethread_cancel_with_attr::copy_from(const Ethread_cancel_with_attr & ref) { x_attr = new (nothrow) infinint(*ref.x_attr); if(x_attr == nullptr) throw Ememory("Ethread_cancel_with_attr::Ethread_cancel_with_attr"); } } // end of namespace dar-2.5.3/src/libdar/sparse_file.hpp0000644000175000017430000001775012641773000014255 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file sparse_file.hpp /// \brief class sparse_file definition, used to handle holes in files /// \ingroup Private /// /// this class is used to receive plain file's data to be written to the /// archive or to be read out from an archive. The class uses escape sequences /// to replace holes in files (long serie of zeros) by the number of zeros /// preceeded by a escape sequence mark. /// this class internally uses an escape object, with a modifed /// fixed escape sequence that optimizes the use of sparse_file objects with /// other escape objects. #ifndef SPARSE_FILE_HPP #define SPARSE_FILE_HPP #include "../my_config.h" extern "C" { #if HAVE_LIMITS_H #include #endif } #include "generic_file.hpp" #include "escape.hpp" /// \addtogroup Private /// @{ #define SPARSE_FIXED_ZEROED_BLOCK 40960 #ifdef SSIZE_MAX #if SSIZE_MAX < MAX_BUFFER_SIZE #undef MAX_BUFFER_SIZE #define SPARSE_FIXED_ZEROED_BLOCK SSIZE_MAX #endif #endif namespace libdar { class sparse_file : public escape { public: /// constructor ///\param[in] below object where to read or write data to or from ///\param[in] hole_size the size below which to ignore holes (zeroed bytes) // this parameter is only used if "below" is in write-only mode sparse_file(generic_file *below, const infinint & hole_size = 15); void write_as_escape(bool mode) { escape_write = mode; }; // if set to true, inherited_write() call will not make any lookup for holes, the written data will simply be escaped if it could collide with a mark used to signal the start of a hole void read_as_escape(bool mode) { escape_read = mode; }; // if set to true, the data will be unescaped or eof will be signaled to the first mark met, instead of interpreting the mark and what follows as a hole data structure. void copy_to_without_skip(bool mode) { copy_to_no_skip = mode; }; // if set to true, the copy_to() methods, write zeroed data in place of skipping over a hole to restore it into the target generic_file bool has_seen_hole() const { return seen_hole; }; bool has_escaped_data() const { return data_escaped; }; /// copies data of the current object using holes to the given generic_file, overwrites the generic_file method /// \note, this assumes the underlying generic_file (where the sparse_file object /// reads its data before writing it to "ref") uses a special /// datastructure (which relies on class escape). This datastructure /// is created by sparse_file in write_only mode (thus when one is writing /// data to a sparse_file object, the underlying generic_file get a mix of /// normal data and hole (number of zeroed bytes to skip to reach next normal data) /// leading to only restore the data not equal to zero (passed a certain /// amount of contiguous zeroed bytes). void copy_to(generic_file & ref) { crc *tmp = nullptr; copy_to(ref, 0, tmp); if(tmp != nullptr) throw SRC_BUG; }; /// same as sparse_file::copy_to(generic_file) just above but here with crc, this also overwrite the corresponding class generic_file method, as we need a specific implementation here void copy_to(generic_file & ref, const infinint & crc_size, crc * & value); // indirectly inherited from generic_file bool skippable(skippability direction, const infinint & amount) { return false; }; bool skip(const infinint & pos) { if(pos != offset) throw Efeature("skip in sparse_file"); else return true; }; bool skip_to_eof() { throw Efeature("skip in sparse_file"); }; bool skip_relative(S_I x) { if(x != 0) throw Efeature("skip in sparse_file"); return true; }; infinint get_position() const; protected: // methods from the escape class we hide from the (public) class interface void add_mark_at_current_position(sequence_type t) { escape::add_mark_at_current_position(t); }; bool skip_to_next_mark(sequence_type t, bool jump) { return escape::skip_to_next_mark(t, jump); }; bool next_to_read_is_mark(sequence_type t) { return escape::next_to_read_is_mark(t); }; void add_unjumpable_mark(sequence_type t) { escape::add_unjumpable_mark(t); }; // methods from generic_file redefined as protected U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write(); // inherited_flush_read() kept as is from the escape class // inherited_terminate() kept as is from the escape class private: static bool initialized; //< whether static field "zeroed_field" has been initialized static unsigned char zeroed_field[SPARSE_FIXED_ZEROED_BLOCK]; //< read-only, used when the sequence of zeros is too short for a hole enum { normal, hole } mode; //< wether we are currently reading/writing a hole or normal data infinint zero_count; //< number of zeroed byte pending in the current hole infinint offset; //< current offset in file (as if it was a plain file). infinint min_hole_size; //< minimum size of hole to consider U_I UI_min_hole_size; //< if possible store min_hole_size as U_I, if not this field is set to zero which disables the hole lookup inside buffers while writing data bool escape_write; //< whether to behave like an escape object when writing down data bool escape_read; //< whether to behave like an escape object when reading out data bool copy_to_no_skip; //< whether to hide holes by zeored bytes in the copy_to() methods bool seen_hole; //< whether a hole has been seen or this is a plain file so far bool data_escaped; //< whether some data has been escaped to not collide with a mark (may occur even when no hole is met) /// write down the amount of byte zero not yet written. /// which may be normal zeros or hole depending on their amount void dump_pending_zeros(); /// write a hole datastructure void write_hole(const infinint & length); /// reset the sparse_file detection as if "this" object was just created /// /// \note may lead the offset to be backward it previous position void reset(); /// analyse a buffer for a hole ///\param[in] a pointer to the buffer area ///\param[in] size size of the buffer to inspect ///\param[in] min_hole_size minimum size of hole to consider, if set to zero only consider hole at end of buffer ///\param[out] offset in "a" where starts the found hole ///\param[out] length length of the hole in byte ///\return true if a hole has been found, false else ///\note if the buffer ends by zeros, start points to the first zero, and length may be less than min_hole_size static bool look_for_hole(const char *a, U_I size, U_I min_hole_size, U_I & start, U_I & length); /// count the number of zeroed byte starting at the provided buffer /// \param[in] a a pointer to the buffer area /// \param[in] size the size of the buffer to inspect /// \return the number of zeroed bytes found at the beginning of the buffer static U_I count_initial_zeros(const char *a, U_I size); }; } // end of namespace /// @} #endif dar-2.5.3/src/libdar/cat_detruit.cpp0000644000175000017430000000434212641772777014300 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_detruit.hpp" using namespace std; namespace libdar { cat_detruit::cat_detruit(const pile_descriptor & pdesc, const archive_version & reading_ver, bool small) : cat_nomme(pdesc, small) { generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; if(ptr->read((char *)&signe, 1) != 1) throw Erange("cat_detruit::cat_detruit", gettext("missing data to build")); if(reading_ver > 7) del_date.read(*ptr, reading_ver); else del_date = datetime(0); } bool cat_detruit::operator == (const cat_entree & ref) const { const cat_detruit *ref_det = dynamic_cast(&ref); if(ref_det == nullptr) return false; else return signe == ref_det->signe && del_date == ref_det->del_date && cat_nomme::operator == (ref); } void cat_detruit::inherited_dump(const pile_descriptor & pdesc, bool small) const { generic_file * ptr = nullptr; cat_nomme::inherited_dump(pdesc, small); pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; ptr->write((char *)&signe, 1); del_date.dump(*ptr); } } // end of namespace dar-2.5.3/src/libdar/Makefile.in0000644000175000017520000012721112642474521013316 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/libdar DIST_COMMON = $(dist_noinst_DATA) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/libdar.pc.tmpl.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = libdar.pc.tmpl CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libdar_la_LIBADD = am__libdar_la_SOURCES_DIST = catalogue.cpp catalogue.hpp \ compressor.cpp compressor.hpp deci.cpp deci.hpp defile.cpp \ defile.hpp ea.cpp ea.hpp ea_filesystem.cpp ea_filesystem.hpp \ erreurs.cpp erreurs.hpp etage.cpp etage.hpp filesystem.cpp \ filesystem.hpp filtre.cpp filtre.hpp generic_file.cpp \ generic_file.hpp header.cpp header_version.cpp libdar.cpp \ macro_tools.cpp mask.cpp path.cpp sar.cpp trivial_sar.cpp \ sar_tools.cpp scrambler.cpp storage.cpp terminateur.cpp \ tools.cpp tronc.cpp tuyau.cpp user_interaction.cpp \ wrapperlib.cpp zapette.cpp archive.cpp crypto.cpp cache.cpp \ cache.hpp int_tools.cpp tronconneuse.cpp elastic.cpp \ thread_cancellation.cpp mask_list.cpp database.cpp \ database_header.cpp data_tree.cpp statistics.cpp criterium.cpp \ memory_file.cpp tlv.cpp tlv_list.cpp label.cpp trontextual.cpp \ archive_options.cpp user_group_bases.cpp escape.cpp \ escape_catalogue.cpp pile.cpp sparse_file.cpp crc.cpp \ archive_version.cpp mem_ui.cpp fichier_global.cpp \ fichier_local.cpp hash_fichier.cpp secu_string.cpp \ semaphore.cpp integers.cpp compile_time_features.cpp \ memory_check.cpp entrepot.cpp entrepot_local.cpp \ list_entry.cpp filesystem_specific_attribute.cpp \ fsa_family.cpp capabilities.cpp on_pool.cpp mem_cluster.cpp \ mem_sized.cpp mem_allocator.cpp memory_pool.cpp datetime.cpp \ crypto_asym.cpp generic_file_overlay_for_gpgme.cpp \ secu_memory_file.cpp crypto_sym.cpp range.cpp slice_layout.cpp \ cat_detruit.cpp cat_device.cpp cat_directory.cpp cat_door.cpp \ cat_entree.cpp cat_etoile.cpp cat_file.cpp cat_ignored_dir.cpp \ cat_inode.cpp cat_lien.cpp cat_mirage.cpp cat_nomme.cpp \ cat_tools.cpp pile_descriptor.cpp cat_chardev.cpp \ cat_blockdev.cpp cat_tube.cpp cat_ignored.cpp cat_prise.cpp \ erreurs_ext.cpp real_infinint.cpp generic_thread.cpp \ slave_thread.cpp messaging.cpp am__objects_1 = catalogue.lo compressor.lo deci.lo defile.lo ea.lo \ ea_filesystem.lo erreurs.lo etage.lo filesystem.lo filtre.lo \ generic_file.lo header.lo header_version.lo libdar.lo \ macro_tools.lo mask.lo path.lo sar.lo trivial_sar.lo \ sar_tools.lo scrambler.lo storage.lo terminateur.lo tools.lo \ tronc.lo tuyau.lo user_interaction.lo wrapperlib.lo zapette.lo \ archive.lo crypto.lo cache.lo int_tools.lo tronconneuse.lo \ elastic.lo thread_cancellation.lo mask_list.lo database.lo \ database_header.lo data_tree.lo statistics.lo criterium.lo \ memory_file.lo tlv.lo tlv_list.lo label.lo trontextual.lo \ archive_options.lo user_group_bases.lo escape.lo \ escape_catalogue.lo pile.lo sparse_file.lo crc.lo \ archive_version.lo mem_ui.lo fichier_global.lo \ fichier_local.lo hash_fichier.lo secu_string.lo semaphore.lo \ integers.lo compile_time_features.lo memory_check.lo \ entrepot.lo entrepot_local.lo list_entry.lo \ filesystem_specific_attribute.lo fsa_family.lo capabilities.lo \ on_pool.lo mem_cluster.lo mem_sized.lo mem_allocator.lo \ memory_pool.lo datetime.lo crypto_asym.lo \ generic_file_overlay_for_gpgme.lo secu_memory_file.lo \ crypto_sym.lo range.lo slice_layout.lo cat_detruit.lo \ cat_device.lo cat_directory.lo cat_door.lo cat_entree.lo \ cat_etoile.lo cat_file.lo cat_ignored_dir.lo cat_inode.lo \ cat_lien.lo cat_mirage.lo cat_nomme.lo cat_tools.lo \ pile_descriptor.lo cat_chardev.lo cat_blockdev.lo cat_tube.lo \ cat_ignored.lo cat_prise.lo erreurs_ext.lo @WITH_LIBTHREADAR_TRUE@am__objects_2 = generic_thread.lo \ @WITH_LIBTHREADAR_TRUE@ slave_thread.lo messaging.lo am_libdar_la_OBJECTS = $(am__objects_1) real_infinint.lo \ $(am__objects_2) libdar_la_OBJECTS = $(am_libdar_la_OBJECTS) libdar_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libdar_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@am_libdar_la_rpath = -rpath \ @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@ $(libdir) libdar32_la_LIBADD = am__libdar32_la_SOURCES_DIST = catalogue.cpp catalogue.hpp \ compressor.cpp compressor.hpp deci.cpp deci.hpp defile.cpp \ defile.hpp ea.cpp ea.hpp ea_filesystem.cpp ea_filesystem.hpp \ erreurs.cpp erreurs.hpp etage.cpp etage.hpp filesystem.cpp \ filesystem.hpp filtre.cpp filtre.hpp generic_file.cpp \ generic_file.hpp header.cpp header_version.cpp libdar.cpp \ macro_tools.cpp mask.cpp path.cpp sar.cpp trivial_sar.cpp \ sar_tools.cpp scrambler.cpp storage.cpp terminateur.cpp \ tools.cpp tronc.cpp tuyau.cpp user_interaction.cpp \ wrapperlib.cpp zapette.cpp archive.cpp crypto.cpp cache.cpp \ cache.hpp int_tools.cpp tronconneuse.cpp elastic.cpp \ thread_cancellation.cpp mask_list.cpp database.cpp \ database_header.cpp data_tree.cpp statistics.cpp criterium.cpp \ memory_file.cpp tlv.cpp tlv_list.cpp label.cpp trontextual.cpp \ archive_options.cpp user_group_bases.cpp escape.cpp \ escape_catalogue.cpp pile.cpp sparse_file.cpp crc.cpp \ archive_version.cpp mem_ui.cpp fichier_global.cpp \ fichier_local.cpp hash_fichier.cpp secu_string.cpp \ semaphore.cpp integers.cpp compile_time_features.cpp \ memory_check.cpp entrepot.cpp entrepot_local.cpp \ list_entry.cpp filesystem_specific_attribute.cpp \ fsa_family.cpp capabilities.cpp on_pool.cpp mem_cluster.cpp \ mem_sized.cpp mem_allocator.cpp memory_pool.cpp datetime.cpp \ crypto_asym.cpp generic_file_overlay_for_gpgme.cpp \ secu_memory_file.cpp crypto_sym.cpp range.cpp slice_layout.cpp \ cat_detruit.cpp cat_device.cpp cat_directory.cpp cat_door.cpp \ cat_entree.cpp cat_etoile.cpp cat_file.cpp cat_ignored_dir.cpp \ cat_inode.cpp cat_lien.cpp cat_mirage.cpp cat_nomme.cpp \ cat_tools.cpp pile_descriptor.cpp cat_chardev.cpp \ cat_blockdev.cpp cat_tube.cpp cat_ignored.cpp cat_prise.cpp \ erreurs_ext.cpp limitint.cpp generic_thread.cpp \ slave_thread.cpp messaging.cpp am_libdar32_la_OBJECTS = $(am__objects_1) limitint.lo $(am__objects_2) libdar32_la_OBJECTS = $(am_libdar32_la_OBJECTS) libdar32_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libdar32_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_MODE32_TRUE@am_libdar32_la_rpath = -rpath $(libdir) libdar64_la_LIBADD = am__libdar64_la_SOURCES_DIST = catalogue.cpp catalogue.hpp \ compressor.cpp compressor.hpp deci.cpp deci.hpp defile.cpp \ defile.hpp ea.cpp ea.hpp ea_filesystem.cpp ea_filesystem.hpp \ erreurs.cpp erreurs.hpp etage.cpp etage.hpp filesystem.cpp \ filesystem.hpp filtre.cpp filtre.hpp generic_file.cpp \ generic_file.hpp header.cpp header_version.cpp libdar.cpp \ macro_tools.cpp mask.cpp path.cpp sar.cpp trivial_sar.cpp \ sar_tools.cpp scrambler.cpp storage.cpp terminateur.cpp \ tools.cpp tronc.cpp tuyau.cpp user_interaction.cpp \ wrapperlib.cpp zapette.cpp archive.cpp crypto.cpp cache.cpp \ cache.hpp int_tools.cpp tronconneuse.cpp elastic.cpp \ thread_cancellation.cpp mask_list.cpp database.cpp \ database_header.cpp data_tree.cpp statistics.cpp criterium.cpp \ memory_file.cpp tlv.cpp tlv_list.cpp label.cpp trontextual.cpp \ archive_options.cpp user_group_bases.cpp escape.cpp \ escape_catalogue.cpp pile.cpp sparse_file.cpp crc.cpp \ archive_version.cpp mem_ui.cpp fichier_global.cpp \ fichier_local.cpp hash_fichier.cpp secu_string.cpp \ semaphore.cpp integers.cpp compile_time_features.cpp \ memory_check.cpp entrepot.cpp entrepot_local.cpp \ list_entry.cpp filesystem_specific_attribute.cpp \ fsa_family.cpp capabilities.cpp on_pool.cpp mem_cluster.cpp \ mem_sized.cpp mem_allocator.cpp memory_pool.cpp datetime.cpp \ crypto_asym.cpp generic_file_overlay_for_gpgme.cpp \ secu_memory_file.cpp crypto_sym.cpp range.cpp slice_layout.cpp \ cat_detruit.cpp cat_device.cpp cat_directory.cpp cat_door.cpp \ cat_entree.cpp cat_etoile.cpp cat_file.cpp cat_ignored_dir.cpp \ cat_inode.cpp cat_lien.cpp cat_mirage.cpp cat_nomme.cpp \ cat_tools.cpp pile_descriptor.cpp cat_chardev.cpp \ cat_blockdev.cpp cat_tube.cpp cat_ignored.cpp cat_prise.cpp \ erreurs_ext.cpp limitint.cpp generic_thread.cpp \ slave_thread.cpp messaging.cpp am_libdar64_la_OBJECTS = $(am__objects_1) limitint.lo $(am__objects_2) libdar64_la_OBJECTS = $(am_libdar64_la_OBJECTS) libdar64_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libdar64_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@am_libdar64_la_rpath = -rpath \ @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@ $(libdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdar_la_SOURCES) $(libdar32_la_SOURCES) \ $(libdar64_la_SOURCES) DIST_SOURCES = $(am__libdar_la_SOURCES_DIST) \ $(am__libdar32_la_SOURCES_DIST) \ $(am__libdar64_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(dist_noinst_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXSTDFLAGS = @CXXSTDFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PROG = @DOXYGEN_PROG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPX_PROG = @UPX_PROG@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen = @doxygen@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ groff = @groff@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmp = @tmp@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ upx = @upx@ @BSD_SED_FALSE@SED_REGEX = -r @BSD_SED_TRUE@SED_REGEX = -E @PROFILING_FALSE@LD_PROF = @PROFILING_TRUE@LD_PROF = -pg @PROFILING_FALSE@CPP_PROF = @PROFILING_TRUE@CPP_PROF = -pg @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@MYLIB = libdar.la @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@MYLIB = libdar64.la @BUILD_MODE32_TRUE@MYLIB = libdar32.la @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@AM_CPPFLAGS = -DDAR_LOCALEDIR=\"$(localedir)\" $(CPP_PROF) $(GPGME_CFLAGS) @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=64 -DDAR_LOCALEDIR=\"$(localedir)\" $(CPP_PROF) $(GPGME_CFLAGS) @BUILD_MODE32_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=32 -DDAR_LOCALEDIR=\"$(localedir)\" $(CPP_PROF) $(GPGME_CFLAGS) @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@VER_SRC = real_infinint.o @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@VER_SRC = limitint.o @BUILD_MODE32_TRUE@VER_SRC = limitint.o @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@LIBDAR_SUFFIX = @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@LIBDAR_SUFFIX = 64 @BUILD_MODE32_TRUE@LIBDAR_SUFFIX = 32 @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@LIBDAR_MODE = @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@LIBDAR_MODE = -DLIBDAR_MODE=64 @BUILD_MODE32_TRUE@LIBDAR_MODE = -DLIBDAR_MODE=32 @WITH_LIBTHREADAR_FALSE@LIBTHREADAR_DEP_MODULES = @WITH_LIBTHREADAR_TRUE@LIBTHREADAR_DEP_MODULES = generic_thread.cpp slave_thread.cpp messaging.cpp AM_LDFLAGS = @LTLIBINTL@ $(LD_PROF) LDADD = $(GPGME_LIBS) lib_LTLIBRARIES = $(MYLIB) LIBDAR_MAJOR = `grep LIBDAR_COMPILE_TIME_MAJOR libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed -e 's% %%g'` LIBDAR_MEDIUM = `grep LIBDAR_COMPILE_TIME_MEDIUM libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed -e 's% %%g'` LIBDAR_MEDIUM_000 = `grep LIBDAR_COMPILE_TIME_MEDIUM libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed $(SED_REGEX) -e 's% %%g' -e 's%([^0-9]|^)([0-9]{1})([^0-9]|$$)%0\2%' -e 's%([^0-9]|^)([0-9]{2})([^0-9]|$$)%0\2%'` LIBDAR_MINOR = `grep LIBDAR_COMPILE_TIME_MINOR libdar.hpp | cut -f 2 -d "=" | cut -f 1 -d ';' | sed -e 's% %%g'` LIBDAR_LIBTOOL_CURRENT = $(LIBDAR_MAJOR)$(LIBDAR_MEDIUM_000) LIBDAR_LIBTOOL_REVISION = $(LIBDAR_MINOR) LIBDAR_LIBTOOL_AGE = $(LIBDAR_MEDIUM) LIBDAR_VERSION_IN = $(LIBDAR_LIBTOOL_CURRENT):$(LIBDAR_LIBTOOL_REVISION):$(LIBDAR_LIBTOOL_AGE) LIBDAR_VERSION_OUT = $(LIBDAR_MAJOR).$(LIBDAR_MEDIUM).$(LIBDAR_MINOR) # header files required by external applications and that must be installed (make install) dist_noinst_DATA = libdar.hpp path.hpp mask.hpp integers.hpp \ real_infinint.hpp statistics.hpp user_interaction.hpp \ erreurs.hpp deci.hpp limitint.hpp infinint.hpp compressor.hpp \ generic_file.hpp wrapperlib.hpp storage.hpp tuyau.hpp \ tools.hpp catalogue.hpp cat_entree.hpp cat_nomme.hpp \ cat_directory.hpp cat_inode.hpp scrambler.hpp archive.hpp \ header_version.hpp ea.hpp crypto.hpp int_tools.hpp \ thread_cancellation.hpp tronconneuse.hpp mask_list.hpp \ database.hpp data_tree.hpp criterium.hpp trontextual.hpp \ archive_options.hpp user_group_bases.hpp database_options.hpp \ label.hpp tlv_list.hpp tlv.hpp memory_file.hpp pile.hpp \ archive_version.hpp mem_ui.hpp fichier_global.hpp \ fichier_local.hpp erreurs_ext.hpp secu_string.hpp crc.hpp \ hash_fichier.hpp escape.hpp escape_catalogue.hpp \ compile_time_features.hpp nls_swap.hpp entrepot.hpp \ entrepot_local.hpp etage.hpp list_entry.hpp fsa_family.hpp \ capabilities.hpp on_pool.hpp mem_allocator.hpp memory_pool.hpp \ datetime.hpp crypto_asym.hpp \ generic_file_overlay_for_gpgme.hpp secu_memory_file.hpp \ crypto_sym.hpp mem_sized.hpp mem_cluster.hpp \ filesystem_specific_attribute.hpp range.hpp \ pile_descriptor.hpp slice_layout.hpp # header files that are internal to libdar and that must not be installed (make install) noinst_HEADERS = defile.hpp ea_filesystem.hpp filesystem.hpp filtre.hpp header.hpp macro_tools.hpp null_file.hpp sar.hpp trivial_sar.hpp sar_tools.hpp terminateur.hpp tronc.hpp zapette.hpp cygwin_adapt.hpp elastic.hpp database_header.hpp sparse_file.hpp semaphore.hpp memory_check.hpp messaging.hpp slave_thread.hpp generic_thread.hpp cat_blockdev.hpp cat_chardev.hpp cat_detruit.hpp cat_device.hpp cat_door.hpp cat_eod.hpp cat_file.hpp cat_ignored.hpp cat_ignored_dir.hpp cat_lien.hpp cat_mirage.hpp cat_prise.hpp cat_tube.hpp cat_etoile.hpp cat_all_entrees.hpp cat_tools.hpp generic_to_global_file.hpp ALL_SOURCES = catalogue.cpp catalogue.hpp compressor.cpp \ compressor.hpp deci.cpp deci.hpp defile.cpp defile.hpp ea.cpp \ ea.hpp ea_filesystem.cpp ea_filesystem.hpp erreurs.cpp \ erreurs.hpp etage.cpp etage.hpp filesystem.cpp filesystem.hpp \ filtre.cpp filtre.hpp generic_file.cpp generic_file.hpp \ header.cpp header_version.cpp libdar.cpp macro_tools.cpp \ mask.cpp path.cpp sar.cpp trivial_sar.cpp sar_tools.cpp \ scrambler.cpp storage.cpp terminateur.cpp tools.cpp tronc.cpp \ tuyau.cpp user_interaction.cpp wrapperlib.cpp zapette.cpp \ archive.cpp crypto.cpp cache.cpp cache.hpp int_tools.cpp \ tronconneuse.cpp elastic.cpp thread_cancellation.cpp \ mask_list.cpp database.cpp database_header.cpp data_tree.cpp \ statistics.cpp criterium.cpp memory_file.cpp tlv.cpp \ tlv_list.cpp label.cpp trontextual.cpp archive_options.cpp \ user_group_bases.cpp escape.cpp escape_catalogue.cpp pile.cpp \ sparse_file.cpp crc.cpp archive_version.cpp mem_ui.cpp \ fichier_global.cpp fichier_local.cpp hash_fichier.cpp \ secu_string.cpp semaphore.cpp integers.cpp \ compile_time_features.cpp memory_check.cpp entrepot.cpp \ entrepot_local.cpp list_entry.cpp \ filesystem_specific_attribute.cpp fsa_family.cpp \ capabilities.cpp on_pool.cpp mem_cluster.cpp mem_sized.cpp \ mem_allocator.cpp memory_pool.cpp datetime.cpp crypto_asym.cpp \ generic_file_overlay_for_gpgme.cpp secu_memory_file.cpp \ crypto_sym.cpp range.cpp slice_layout.cpp cat_detruit.cpp \ cat_device.cpp cat_directory.cpp cat_door.cpp cat_entree.cpp \ cat_etoile.cpp cat_file.cpp cat_ignored_dir.cpp cat_inode.cpp \ cat_lien.cpp cat_mirage.cpp cat_nomme.cpp cat_tools.cpp \ pile_descriptor.cpp cat_chardev.cpp cat_blockdev.cpp \ cat_tube.cpp cat_ignored.cpp cat_prise.cpp erreurs_ext.cpp libdar_la_LDFLAGS = -version-info $(LIBDAR_VERSION_IN) libdar_la_SOURCES = $(ALL_SOURCES) real_infinint.cpp $(LIBTHREADAR_DEP_MODULES) libdar32_la_LDFLAGS = -version-info $(LIBDAR_VERSION_IN) libdar32_la_SOURCES = $(ALL_SOURCES) limitint.cpp $(LIBTHREADAR_DEP_MODULES) libdar64_la_LDFLAGS = -version-info $(LIBDAR_VERSION_IN) libdar64_la_SOURCES = $(ALL_SOURCES) limitint.cpp $(LIBTHREADAR_DEP_MODULES) all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libdar/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libdar/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libdar.pc.tmpl: $(top_builddir)/config.status $(srcdir)/libdar.pc.tmpl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdar.la: $(libdar_la_OBJECTS) $(libdar_la_DEPENDENCIES) $(EXTRA_libdar_la_DEPENDENCIES) $(libdar_la_LINK) $(am_libdar_la_rpath) $(libdar_la_OBJECTS) $(libdar_la_LIBADD) $(LIBS) libdar32.la: $(libdar32_la_OBJECTS) $(libdar32_la_DEPENDENCIES) $(EXTRA_libdar32_la_DEPENDENCIES) $(libdar32_la_LINK) $(am_libdar32_la_rpath) $(libdar32_la_OBJECTS) $(libdar32_la_LIBADD) $(LIBS) libdar64.la: $(libdar64_la_OBJECTS) $(libdar64_la_DEPENDENCIES) $(EXTRA_libdar64_la_DEPENDENCIES) $(libdar64_la_LINK) $(am_libdar64_la_rpath) $(libdar64_la_OBJECTS) $(libdar64_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/archive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/archive_options.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/archive_version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capabilities.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_blockdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_chardev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_detruit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_directory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_door.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_entree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_etoile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_ignored.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_ignored_dir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_inode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_lien.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_mirage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_nomme.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_prise.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_tools.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat_tube.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/catalogue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_time_features.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compressor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/criterium.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto_asym.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto_sym.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_header.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datetime.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deci.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ea.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ea_filesystem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elastic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entrepot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entrepot_local.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erreurs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erreurs_ext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape_catalogue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/etage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fichier_global.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fichier_local.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filesystem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filesystem_specific_attribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filtre.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsa_family.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic_file_overlay_for_gpgme.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic_thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash_fichier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/header.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/header_version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int_tools.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/integers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/label.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/limitint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_entry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macro_tools.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mask_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem_allocator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem_cluster.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem_sized.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem_ui.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory_check.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory_pool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/messaging.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/on_pool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pile_descriptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/range.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/real_infinint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sar_tools.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrambler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secu_memory_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secu_string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slave_thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slice_layout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sparse_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/terminateur.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread_cancellation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tlv_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tools.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trivial_sar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tronc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tronconneuse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trontextual.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tuyau.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user_group_bases.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user_interaction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrapperlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zapette.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) all-local installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-local .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLTLIBRARIES uninstall-local @PROFILING_TRUE@clean-local: @PROFILING_TRUE@ rm -f gmon.out @PROFILING_TRUE@ rm -f libdar.pc @PROFILING_FALSE@clean-local: @PROFILING_FALSE@ rm -f libdar.pc install-data-local: mkdir -p $(DESTDIR)$(pkgincludedir) cp ../../config.h $(DESTDIR)$(pkgincludedir)/libdar_config.h sed -e 's%../config.h%libdar_config.h%g' -e 's%HAVE_CONFIG_H%1%g' -e 's%MY_CONFIG_H%LIBDAR_MY_CONFIG_H%g' ../my_config.h > ./libdar_my_config.h cp ../gettext.h . for file in $(dist_noinst_DATA) gettext.h libdar_my_config.h ; do sed -e 's%#include \"../my_config.h\"%INC_MY_CONFIG_FILE_H%g' -e "s%#include \"%#include \"$(pkgincludedir)/%g" -e "s%INC_MY_CONFIG_FILE_H%#include \"$(pkgincludedir)/libdar_my_config.h\"%g" "$$file" > $(DESTDIR)$(pkgincludedir)/"$$file" ; done rm libdar_my_config.h gettext.h for file in $(DESTDIR)$(pkgincludedir)/* ; do sed -e 's%HAVE_%LIBDAR_HAS_%g' -e 's%PACKAGE%DAR_PACKAGE%g' -e 's%SIZEOF_%LIBDAR_SIZEOF_%g' -e 's%LSTAT_FOLLOWS_SLASHED_SYMLINK%LIBDAR_LSTAT_FOLLOWS_SLASHED_SYMLINK%g' -e 's%VERSION%LIBDAR_VERSION%g' -e 's%MUTEX_WORKS%LIBDAR_MUTEX_WORKS%g' -e 's%OS_BITS%LIBDAR_OS_BITS%g' -e 's%_AVAILABLE%_AVAILABLE_FOR_LIBDAR%g' -e 's%STDC_HEADERS%LIBDAR_STDC_HEADERS%g' -e 's%ENABLE_NLS%DAR_ENABLE_NLS%g' -e 's%HAVE_GETTEXT%DAR_HAS_GETTEXT%g' "$$file" > "$$file.tmp" && mv "$$file.tmp" "$$file" ; done egrep 'LIBDAR|DAR_' $(DESTDIR)$(pkgincludedir)/libdar_config.h | grep -v "#undef" > $(DESTDIR)$(pkgincludedir)/config.h.tmp mv $(DESTDIR)$(pkgincludedir)/config.h.tmp $(DESTDIR)$(pkgincludedir)/libdar_config.h chmod 0644 $(DESTDIR)$(pkgincludedir)/* $(INSTALL) -d $(DESTDIR)$(pkgconfigdir) $(INSTALL) -m 0644 libdar.pc $(DESTDIR)$(pkgconfigdir)/libdar$(LIBDAR_SUFFIX).pc uninstall-local: rm -rf $(DESTDIR)$(pkgincludedir) $(DESTDIR)$(pkgconfigdir)/libdar$(LIBDAR_SUFFIX).pc all-local : libdar.pc libdar.pc : libdar.pc.tmpl sed -e "s%#LIBDAR_VERSION#%$(LIBDAR_VERSION_OUT)%g" -e "s%#LIBDAR_SUFFIX#%$(LIBDAR_SUFFIX)%g" -e "s%#LIBDAR_MODE#%$(LIBDAR_MODE)%g" -e "s%#CXXFLAGS#%$(CXXFLAGS)%g" -e "s%#CXXSTDFLAGS#%$(CXXSTDFLAGS)%g" libdar.pc.tmpl > libdar.pc # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/src/libdar/compile_time_features.cpp0000644000175000017430000000710612642474445016326 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "integers.hpp" #include "infinint.hpp" #include "compile_time_features.hpp" namespace libdar { namespace compile_time { bool ea() { #ifdef EA_SUPPORT return true; #else return false; #endif } bool largefile() { #if defined( _FILE_OFFSET_BITS ) || defined( _LARGE_FILES ) return true; #else return sizeof(off_t) > 4; #endif } bool nodump() { return FSA_linux_extX(); } bool special_alloc() { #ifdef LIBDAR_SPECIAL_ALLOC return true; #else return false; #endif } U_I bits() { #ifdef LIBDAR_MODE return LIBDAR_MODE; #else return 0; // infinint #endif } bool thread_safe() { #if defined( MUTEX_WORKS ) && !defined ( MISSING_REENTRANT_LIBCALL ) return true; #else return false; #endif } bool libz() { #if LIBZ_AVAILABLE return true; #else return false; #endif } bool libbz2() { #if LIBBZ2_AVAILABLE return true; #else return false; #endif } bool liblzo() { #if LIBLZO2_AVAILABLE return true; #else return false; #endif } bool libxz() { #if LIBLZMA_AVAILABLE return true; #else return false; #endif } bool libgcrypt() { #if CRYPTO_AVAILABLE return true; #else return false; #endif } bool furtive_read() { #if FURTIVE_READ_MODE_AVAILABLE return true; #else return false; #endif } endian system_endian() { endian ret; try { ret = infinint::is_system_big_endian() ? big : little; } catch(...) { ret = error; } return ret; } bool posix_fadvise() { #if HAVE_POSIX_FADVISE return true; #else return false; #endif } bool fast_dir() { #if LIBDAR_FAST_DIR return true; #else return false; #endif } bool FSA_linux_extX() { #ifdef LIBDAR_NODUMP_FEATURE return true; #else return false; #endif } bool FSA_birthtime() { #ifdef LIBDAR_BIRTHTIME return true; #else return false; #endif } bool microsecond_read() { #ifdef LIBDAR_MICROSECOND_READ_ACCURACY return true; #else return false; #endif } bool microsecond_write() { #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY return true; #else return false; #endif } bool symlink_restore_dates() { #ifdef HAVE_LUTIMES return true; #else return false; #endif } bool public_key_cipher() { #ifdef GPGME_SUPPORT return true; #else return false; #endif } bool libthreadar() { #ifdef LIBTHREADAR_AVAILABLE return true; #else return false; #endif } } // end of compile_time nested namespace } // end of libdar namespace dar-2.5.3/src/libdar/range.hpp0000644000175000017430000000772312641772777013100 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file range.hpp /// \brief class than provide a way to manipulate and represent range of integer numbers (infinint) /// \ingroup Private #ifndef RANGE_HPP #define RANGE_HPP #include #include #include #include "../my_config.h" #include "infinint.hpp" #include "deci.hpp" namespace libdar { class range { public: range() { parts.clear(); }; range(const infinint & low, const infinint & high) { parts.push_back(segment(low, high)); }; void operator += (const range & ref); range operator + (const range & ref) const { range ret = *this; ret += ref; return ret; }; std::string display() const; /// provides a way to read range contents segment by segment /// /// \note reset_read() is to be called once then read_next_segment() /// will return true for each new segment giving in argument its low and high value /// when no more segment are available it returns false, reset_read() can be call at /// any time to reset the reading operation void reset_read() const; /// read the next available segment /// /// \param[out] low when read_next_segment() returns true, contains the low value of the next segment /// \param[out] high when read_next_segment() returns true, contains the high value of the next segment /// \return true and set the low and high value when a next segment is available in the range, returns /// false if all segment have been read low and high are not modified in that case. bool read_next_segment(infinint & low, infinint & high) const; private: class segment { public: segment(const infinint & x_low, const infinint & x_high) { low = x_low; high = x_high; }; const infinint & get_low() const { return low; }; const infinint & get_high() const { return high; }; bool overlaps_with(const segment & ref) const { return !(ref < *this) && !(ref > *this); }; void merge_with(const segment & ref); // only possible with a segment that overlaps with the current object // if two segment make < or > true they cannot be replaced by a single segment bool operator < (const segment & ref) const { return high + 1 < ref.low; }; bool operator > (const segment & ref) const { return ref < *this; }; bool operator == (const segment & ref) const { return ref.high == high && ref.low == low; }; bool operator != (const segment & ref) const { return ! (*this == ref); }; // if two segment make <= or >= true they can be replaced by a single (larger) segment bool operator <= (const segment & ref) const { return ref.low < low && low <= ref.high + 1 && ref.high < high; }; bool operator >= (const segment &ref) const { return ref <= *this; }; bool contains(const segment & ref) const { return low <= ref.low && ref.high <= high; }; std::string display() const; private: infinint low, high; }; std::list parts; std::list::const_iterator read_cursor; }; } // end of namespace #endif dar-2.5.3/src/libdar/deci.hpp0000644000175000017430000000611012641772777012675 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file deci.hpp /// \brief manages the decimal representation of infinint /// \ingroup Tools #ifndef DECI_HPP #define DECI_HPP #include "../my_config.h" #include #include "storage.hpp" #include "infinint.hpp" #include "on_pool.hpp" namespace libdar { /// \ingroup Tools /// @} /// decimal class, convert infinint from and to decimal represention /// the class contains the decimal representation of an integer /// and can produce a readable string to display the corresponding /// integer it can also produce a computer value corresponding to /// the decimal value. In the other side, objects of this class can /// be built from a integer as well as from a string representing /// the decimals of an integer. class deci : public on_pool { public : /// constructor to build a "deci" object from a string representing decimals /// \note may throw Edeci exception if the given string does not correspond to a /// positive integer in decimal notation deci(std::string s); /// constructor to build a "deci" from an infinint deci(const infinint & x); /// copy constructor deci(const deci & ref) { copy_from(ref); }; /// destructor ~deci() { detruit(); }; /// copy operator const deci & operator = (const deci & ref) { detruit(); copy_from(ref); return *this; }; /// this produce a infinint from the decimal stored in the current object infinint computer() const; /// this produce a string from the decimal stored in the current object std::string human() const; private : storage *decimales; void detruit(); void copy_from(const deci & ref); void reduce(); }; /// specific << operator to use infinint in std::ostream /// including "deci.hpp" let this operator available so you can /// display infinint with the << std::ostream operator as you can /// do for standard types. /// \ingroup Tools extern std::ostream & operator << (std::ostream & ref, const infinint & arg); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/pile.cpp0000644000175000017430000002134012642474445012707 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "pile.hpp" #include using namespace std; namespace libdar { void pile::push(generic_file *f, const string & label, bool extend_mode) { face to_add; if(is_terminated()) throw SRC_BUG; if(f == nullptr) throw SRC_BUG; if(look_for_label(label) != stack.end()) throw Erange("pile::push", "Label already used while pushing a generic_file on a stack"); if(stack.empty()) set_mode(f->get_mode()); if(f->get_mode() != get_mode() && (!extend_mode || f->get_mode() != gf_read_write)) throw Erange("pile::push", "Adding to the stack of generic_file an object using an incompatible read/write mode"); if(extend_mode) set_mode(f->get_mode()); to_add.ptr = f; to_add.labels.clear(); if(label != "") to_add.labels.push_back(label); stack.push_back(to_add); } generic_file *pile::pop() { face ret; if(stack.size() > 0) { ret = stack.back(); stack.pop_back(); } else ret.ptr = nullptr; return ret.ptr; // nullptr is returned if the stack is empty } generic_file *pile::get_below(const generic_file *ref) { vector::reverse_iterator it = stack.rbegin(); while(it != stack.rend() && it->ptr != ref) ++it; if(it != stack.rend()) { ++it; // getting the next object, that's it the one below as this is a reverse iterator if(it != stack.rend()) return it->ptr; else return nullptr; } else return nullptr; } generic_file *pile::get_above(const generic_file *ref) { vector::iterator it = stack.begin(); while(it != stack.end() && it->ptr != ref) ++it; if(it != stack.end()) { ++it; // getting the next object, that's it the one above if(it != stack.end()) return it->ptr; else return nullptr; } else return nullptr; } generic_file *pile::get_by_label(const std::string & label) { if(label == "") throw SRC_BUG; else { vector::iterator it = look_for_label(label); if(it == stack.end()) throw Erange("pile::get_by_label", "Label requested in generic_file stack is unknown"); if(it->ptr == nullptr) throw SRC_BUG; return it->ptr; } } void pile::clear_label(const string & label) { if(label == "") throw Erange("pile::clear_label", "Empty string is an invalid label, cannot clear it"); vector::iterator it = look_for_label(label); if(it != stack.end()) { list::iterator lab = find(it->labels.begin(), it->labels.end(), label); if(lab == it->labels.end()) throw SRC_BUG; it->labels.erase(lab); } } void pile::add_label(const string & label) { if(stack.empty()) throw Erange("pile::add_label", "Cannot add a label to an empty stack"); if(label == "") throw Erange("pile::add_label", "An empty string is an invalid label, cannot add it"); if(look_for_label(label) != stack.end()) throw Erange("pile::add_label", "Label already used in stack, cannot add it"); stack.back().labels.push_back(label); } bool pile::skippable(skippability direction, const infinint & amount) { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; return stack.back().ptr->skippable(direction, amount); } else throw Erange("pile::skip", "Error: skippable() on empty stack"); } bool pile::skip(const infinint & pos) { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; return stack.back().ptr->skip(pos); } else throw Erange("pile::skip", "Error: skip() on empty stack"); } bool pile::skip_to_eof() { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; return stack.back().ptr->skip_to_eof(); } else throw Erange("pile::skip_to_eof", "Error: skip_to_eof() on empty stack"); } bool pile::skip_relative(S_I x) { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; return stack.back().ptr->skip_relative(x); } else throw Erange("pile::skip_relative", "Error: skip_relative() on empty stack"); } infinint pile::get_position() const { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; return stack.back().ptr->get_position(); } else throw Erange("pile::get_position", "Error: get_position() on empty stack"); } void pile::copy_to(generic_file & ref) { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; stack.back().ptr->copy_to(ref); } else throw Erange("pile::copy_to", "Error: copy_to() from empty stack"); } void pile::copy_to(generic_file & ref, const infinint & crc_size, crc * & value) { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; stack.back().ptr->copy_to(ref, crc_size, value); } else throw Erange("pile::copy_to(crc)", "Error: copy_to(crc) from empty stack"); } void pile::inherited_read_ahead(const infinint & amount) { if(is_terminated()) throw SRC_BUG; if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; return stack.back().ptr->read_ahead(amount); } } U_I pile::inherited_read(char *a, U_I size) { if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; return stack.back().ptr->read(a, size); } else throw Erange("pile::skip", "Error: inherited_read() on empty stack"); } void pile::inherited_write(const char *a, U_I size) { if(stack.size() > 0) { if(stack.back().ptr == nullptr) throw SRC_BUG; stack.back().ptr->write(a, size); } else throw Erange("pile::skip", "Error: inherited_write() on empty stack"); } void pile::sync_write_above(generic_file *ptr) { vector::reverse_iterator it = stack.rbegin(); // we start from the top of the stack down to ptr while(it != stack.rend() && it->ptr != ptr) { it->ptr->sync_write(); ++it; } if(it->ptr != ptr) throw SRC_BUG; } void pile::flush_read_above(generic_file *ptr) { vector::reverse_iterator it = stack.rbegin(); // we start from the top of the stack down to ptr while(it != stack.rend() && it->ptr != ptr) { it->ptr->flush_read(); ++it; } if(it->ptr != ptr) throw SRC_BUG; } void pile::inherited_sync_write() { for(vector::reverse_iterator it = stack.rbegin() ; it != stack.rend() ; ++it) if(it->ptr != nullptr) it->ptr->sync_write(); else throw SRC_BUG; } void pile::inherited_flush_read() { for(vector::iterator it = stack.begin() ; it != stack.end() ; ++it) if(it->ptr != nullptr) it->ptr->flush_read(); else throw SRC_BUG; } void pile::inherited_terminate() { for(vector::reverse_iterator it = stack.rbegin() ; it != stack.rend() ; ++it) if(it->ptr != nullptr) it->ptr->terminate(); else throw SRC_BUG; } void pile::detruit() { for(vector::reverse_iterator it = stack.rbegin() ; it != stack.rend() ; ++it) { if(it->ptr != nullptr) { try { delete it->ptr; } catch(...) { // ignore all exceptions } it->ptr = nullptr; } } stack.clear(); } vector::iterator pile::look_for_label(const std::string & label) { vector::iterator it = stack.begin(); while(it != stack.end() && find(it->labels.begin(), it->labels.end(), label) == it->labels.end()) ++it; return it; } } // end of namespace dar-2.5.3/src/libdar/generic_file.hpp0000644000175000017430000003752112642474445014406 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file generic_file.hpp /// \brief class generic_file is defined here as well as class fichier /// \ingroup Private /// /// the generic_file interface is widely used in libdar /// it defines the standard way of transmitting data between different /// part of the library /// - compression engine /// - encryption engine /// - exchange through pipes /// - slicing /// - dry run operations /// - file access /// . /////////////////////////////////////////////////////////////////////// // IMPORTANT : THIS FILE MUST ALWAYS BE INCLUDE AFTER infinint.hpp // // (and infinint.hpp must be included too, always) // /////////////////////////////////////////////////////////////////////// #include "infinint.hpp" /////////////////////////////////////////////////////////////////////// #ifndef GENERIC_FILE_HPP #define GENERIC_FILE_HPP #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif } // end extern "C" #include "path.hpp" #include "integers.hpp" #include "thread_cancellation.hpp" #include "label.hpp" #include "crc.hpp" #include "user_interaction.hpp" #include "on_pool.hpp" #include namespace libdar { /// \addtogroup Private /// @{ /// generic_file openning modes enum gf_mode { gf_read_only, ///< read only access gf_write_only, ///< write only access gf_read_write ///< read and write access }; /// provides a human readable string defining the gf_mode given in argument extern const char * generic_file_get_name(gf_mode mode); /// this is the interface class from which all other data transfer classes inherit /// it provides mainly read and write operations, /// skip operations and few other functions. /// \note /// the read and write method are similar to the read and write system calls /// except that they never return negative values, but throw exception instead. /// returning zero means end of generic_file. The call is blocked if /// no data is available for reading. /// write returns the number of bytes written, and never make partial writtings. /// Thus, it is blocked until all bytes are written or occures an exception /// inconsequences the returned value is always the value of the argument /// "size". class generic_file : public on_pool { public : /// main constructor generic_file(gf_mode m) { rw = m; terminated = no_read_ahead = false; enable_crc(false); checksum = nullptr; }; /// copy constructor generic_file(const generic_file &ref) { copy_from(ref); }; /// virtual destructor, this let inherited destructor to be called even from a generic_file pointer to an inherited class virtual ~generic_file() throw(Ebug) { destroy(); }; /// destructor-like call, except that it is allowed to throw exceptions void terminate() const; /// assignment operator const generic_file & operator = (const generic_file & ref) { destroy(); copy_from(ref); return *this; }; /// retreive the openning mode for this object gf_mode get_mode() const { return rw; }; /// read ahead information /// /// \param[in] amount is the expected amount of data the caller will read, if zero is given the object shall prepare as much as possible data for reading until a skip request, write request or a new read_ahead request /// \note after sanity checks, the protected inherited_read_ahead() method is called virtual void read_ahead(const infinint & amount); /// ignore read ahead requests /// /// \param [in] mode if set to true read_ahead requests are ignored: inherited_read_ahead() of the inherited class /// is not called /// \note read_ahead is useful in multi-thread environement when a slave thread can work in advanced and asynchronously /// to provide read content to reader thread. However, read_ahead is a waste of CPU cycle for in a single threading model void ignore_read_ahead(bool mode) { no_read_ahead = mode; }; /// read data from the generic_file /// \param[in, out] a is where to put the data to read /// \param[in] size is how much data to read /// \return the exact number of byte read. /// \note read as much as requested data, unless EOF is met (only EOF can lead to reading less than requested data) /// \note EOF is met if read() returns less than size U_I read(char *a, U_I size); /// write data to the generic_file /// \note throws a exception if not all data could be written as expected void write(const char *a, U_I size); /// write a string to the generic_file /// \note throws a exception if not all data could be written as expected void write(const std::string & arg); /// skip back one char, read on char and skip back one char S_I read_back(char &a); /// read one char S_I read_forward(char &a) { if(terminated) throw SRC_BUG; return read(&a, 1); }; enum skippability { skip_backward, skip_forward }; /// whether the implementation is able to skip /// \note the capability to skip does not mean that skip_relative() or /// skip() will succeed, but rather that the inherited class implementation /// does not by construction forbid the requested skip (like inherited class /// providing a generic_file interface of an anonymous pipe for example) virtual bool skippable(skippability direction, const infinint & amount) = 0; /// skip at the absolute position /// /// \param[in] pos the offset in byte where next read/write operation must start /// \return true if operation was successfull and false if the requested position is not valid (after end of file) /// \note if requested position is not valid the reading/writing cursor must be set to the closest valid position virtual bool skip(const infinint & pos) = 0; /// skip to the end of file virtual bool skip_to_eof() = 0; /// skip relatively to the current position virtual bool skip_relative(S_I x) = 0; /// get the current read/write position virtual infinint get_position() const = 0; /// copy all data from current position to the object in argument virtual void copy_to(generic_file &ref); /// copy all data from the current position to the object in argument and computes a CRC value of the transmitted data /// \param[in] ref defines where to copy the data to /// \param[in] crc_size tell the width of the crc to compute on the copied data /// \param[out] value points to a newly allocated crc object containing the crc value /// \note value has to be deleted by the caller when no more needed virtual void copy_to(generic_file &ref, const infinint & crc_size, crc * & value); /// small copy (up to 4GB) with CRC calculation U_32 copy_to(generic_file &ref, U_32 size); // returns the number of byte effectively copied /// copy the given amount to the object in argument infinint copy_to(generic_file &ref, infinint size); // returns the number of byte effectively copied /// compares the contents with the object in argument /// \param[in] f is the file to compare the current object with /// \param[in] me_read_ahead is the amount of data to read ahead from "*this" (0 for no limit, up to end of eof) /// \param[in] you_read_ahead is the amount of data to read ahead from f (0 for no limit, up to end of file /// \param[in] crc_size is the width of the CRC to use for calculation /// \param[out] value is the computed checksum, its value can be used for additional /// testing if this method returns false (no difference between files). The given checksum /// has to be set to the expected width by the caller. /// \return true if arg differ from "this" /// \note value has to be deleted by the caller when no more needed bool diff(generic_file & f, const infinint & me_read_ahead, const infinint & you_read_ahead, const infinint & crc_size, crc * & value); /// compare the contents with the object in argument, also providing the offset of the first difference met /// \param[in] f is the file to compare the current object with /// \param[in] me_read_ahead is the amount of data to read ahead from "*this" (0 for no limit, up to end of eof) /// \param[in] you_read_ahead is the amount of data to read ahead from f (0 for no limit, up to end of file /// \param[in] crc_size is the width of the CRC to use for calculation /// \param[out] value is the computed checksum, its value can be used for additional /// \param[out] err_offset in case of difference, holds the offset of the first difference met /// testing if this method returns false (no difference between files). The given checksum /// has to be set to the expected width by the caller. /// \return true if arg differ from "this", else false is returned and err_offset is set /// \note value has to be deleted by the caller when no more needed bool diff(generic_file & f, const infinint & me_read_ahead, const infinint & you_read_ahead, const infinint & crc_size, crc * & value, infinint & err_offset); /// reset CRC on read or writen data /// \param[in] width is the width to use for the CRC void reset_crc(const infinint & width); /// to known whether CRC calculation is activated or not bool crc_status() const { return active_read == &generic_file::read_crc; }; /// get CRC of the transfered date since last reset /// \return a newly allocated crc object, that the caller has the responsibility to delete /// \note does also ends checksum calculation, which if needed again /// have to be re-enabled calling reset_crc() method crc *get_crc(); /// write any pending data void sync_write(); /// be ready to read at current position, reseting all pending data for reading, cached and in compression engine for example void flush_read(); protected : void set_mode(gf_mode x) { rw = x; }; /// tells the object that several calls to read() will follow to probably obtain at least the given amount of data /// /// \param[in] amount is the maximum expected amount of data that is known to be read /// \note this call may be implemented as a do-nothing call, its presence is only /// to allow optimization when possible, like in multi-threaded environment virtual void inherited_read_ahead(const infinint & amount) = 0; /// implementation of read() operation /// \param[in,out] a where to put the data to read /// \param[in] size says how much data to read /// \return the exact amount of data read and put into 'a' /// \note read as much byte as requested, up to end of file /// stays blocked if not enough data is available and EOF not /// yet met. May return less data than requested only if EOF as been reached. /// in other worlds, EOF is reached when returned data is stricly less than the requested data /// Any problem shall be reported by throwing an exception. virtual U_I inherited_read(char *a, U_I size) = 0; /// implementation of the write() operation /// \param[in] a what data to write /// \param[in] size amount of data to write /// \note must either write all data or report an error by throwing an exception virtual void inherited_write(const char *a, U_I size) = 0; /// write down any pending data /// \note called after sanity checks from generic_file::sync_write() /// this method's role is to write down any data pending for writing in the current object /// it has not to be propagated to other gneric_file object this object could rely on virtual void inherited_sync_write() = 0; /// reset internal engine, flush caches in order to read the data at current position /// /// \note when the object relies on external object or system object to fetch the data from for reading, /// when a call to (inherited_)flush_read() occurs, the current object must not assume that any previously read /// data is still valid if it has internal buffers or the like and it should flush them asap. This call must /// not propagate the flush_read to any other gneric_file object it could rely on virtual void inherited_flush_read() = 0; /// destructor-like call, except that it is allowed to throw exceptions /// \note this method must never be called directly but using terminate() instead, /// generic_file class manages it to never be called more than once virtual void inherited_terminate() = 0; /// is some specific call (skip() & Co.) need to be forbidden when the object /// has been terminated, one can use this call to check the terminated status bool is_terminated() const { return terminated; }; private : gf_mode rw; crc *checksum; bool terminated; bool no_read_ahead; U_I (generic_file::* active_read)(char *a, U_I size); void (generic_file::* active_write)(const char *a, U_I size); void enable_crc(bool mode); U_I read_crc(char *a, U_I size); void write_crc(const char *a, U_I size); void destroy(); void copy_from(const generic_file & ref); }; #define CONTEXT_INIT "init" #define CONTEXT_OP "operation" #define CONTEXT_LAST_SLICE "last_slice" /// the contextual class adds the information of phases in the generic_file /// several phases are defined like for example /// - INIT phase /// - OPERATIONAL phase /// - LAST SLICE phase /// . /// these are used to help the command launched between slices to /// decide the action to do depending on the context when reading an archive /// (first slice / last slice read, ...) /// the context must also be transfered to dar_slave through the pair of tuyau objects /// /// this class also support some additional informations common to all 'level1' layer of /// archive, such as: /// - the data_name information /// class label; class contextual { public : contextual() { status = ""; }; virtual ~contextual() throw(Ebug) {}; /// defines the new contextual value /// /// \note inherited class may redefine this call but /// but must call the parent method to set the value /// contextual:set_info_status() virtual void set_info_status(const std::string & s) { status = s; }; /// get the current contextual value virtual std::string get_info_status() const { return status; }; /// returns whether the archive is a old archive (format < 8) virtual bool is_an_old_start_end_archive() const = 0; /// obtain the data_name of the archive (label associated with the archive's data) /// /// \note label are conserved with dar_xform and archive isolation, but are /// not with archive merging or archive creation (full or differential backup) virtual const label & get_data_name() const = 0; private: std::string status; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/trivial_sar.hpp0000644000175000017430000001557112642256617014312 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file trivial_sar.hpp /// \brief the trivial_sar classes manages the slicing layer when single slice is used /// \ingroup Private #ifndef TRIVIAL_SAR_HPP #define TRIVIAL_SAR_HPP #include "../my_config.h" #include #include "infinint.hpp" #include "generic_file.hpp" #include "header.hpp" #include "path.hpp" #include "integers.hpp" #include "entrepot.hpp" #include "tools.hpp" #include "slice_layout.hpp" namespace libdar { // contextual is defined in generic_file module /// \addtogroup Private /// @{ /// "trivial sar" proposes the same interface a sar but does the work slightly differently using different constructors /// /// depending on the constructor used trivial sar can: /// - in write mode send the data to a arbitrary long slice (plain file) /// - in read mode let read a single slice from a named pipe /// - in write mode let write a single sliced archive to an anonymous pipe class trivial_sar : public generic_file , public contextual, protected mem_ui { public: /// constructor to build a new single sliced archive trivial_sar(const user_interaction & dialog, //< how to interact with the user gf_mode open_mode, //< read_write or write_only are the only acceptable values const std::string & base_name, //< archive basename to create const std::string & extension, //< archive extension const entrepot & where, //< where to store the archive const label & internal_nale, //< tag common to all slices of the archive const label & data_name, //< tag that follows the data when archive is dar_xform'ed const std::string & execute, //< command line to execute at end of slice creation bool allow_over, //< whether to allow overwriting bool warn_over, //< whether to warn before overwriting bool force_permission, //< whether to enforce slice permission or not U_I permission, //< value of permission to use if permission enforcement is used hash_algo x_hash, //< whether to build a hash of the slice, and which algo to use for that const infinint & min_digits, //< is the minimum number of digits the slices number is stored with in the filename bool format_07_compatible); //< build a slice header backward compatible with 2.3.x /// constructor to read a (single sliced) archive from a pipe trivial_sar(const user_interaction & dialog, //< how to interact with the user const std::string & pipename, //< if set to '-' the data are read from standard input, else the given file is expected to be named pipe to read data from bool lax); //< whether to be laxist or follow the normal and strict controlled procedure /// constructor to write a (single sliced) archive to a anonymous pipe trivial_sar(const user_interaction & dialog, generic_file * f, //< in case of exception the generic_file "f" is not released, this is the duty of the caller to do so, else (success), the object becomes owned by the trivial_sar and must not be released by the caller. const label & internal_name, const label & data_name, bool format_07_compatible, const std::string & execute); /// copy constructor (disabled) trivial_sar(const trivial_sar & ref) : generic_file(ref), mem_ui(ref) { throw SRC_BUG; }; /// destructor ~trivial_sar(); const trivial_sar & operator = (const trivial_sar & ref) { throw SRC_BUG; }; bool skippable(skippability direction, const infinint & amount) { return reference->skippable(direction, amount); }; bool skip(const infinint & pos); bool skip_to_eof() { if(is_terminated()) throw SRC_BUG; return reference->skip_to_eof(); }; bool skip_relative(S_I x); infinint get_position() const { return cur_pos; }; // contextual inherited method bool is_an_old_start_end_archive() const { return old_sar; }; const label & get_data_name() const { return of_data_name; }; protected: void inherited_read_ahead(const infinint & amount) { reference->read_ahead(amount); }; U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate(); private: generic_file *reference; //< points to the underlying data, owned by "this" infinint offset; //< offset to apply to get the first byte of data out of SAR headers infinint cur_pos; //< current position as returned by get_position() infinint end_of_slice; //< when end of slice/archive is met, there is an offset by 1 compared to the offset of reference. end_of_slice is set to 1 in that situation, else it is always equal to zero std::string hook; //< command to execute after slice writing (not used in read-only mode) std::string base; //< basename of the archive (used for string susbstitution in hook) std::string ext; //< extension of the archive (used for string substitution in hook) label of_data_name; //< archive's data name bool old_sar; //< true if the read sar has an old header (format <= "07") or the to be written is must keep a version 07 format. infinint min_digits; //< minimum number of digits in slice name std::string hook_where; //< what value to use for %p subsitution in hook void init(const label & internal_name); //< write the slice header and set the offset field (write mode), or (read-mode), reads the slice header an set offset field void where_am_i(); }; /// return the name of a slice given the base_name, slice number and extension extern std::string sar_make_filename(const std::string & base_name, const infinint & num, const infinint & min_digits, const std::string & ext); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/database_options.hpp0000644000175000017520000002030012610415372015262 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file database_options.hpp /// \brief this file holds the options for database operations /// \ingroup API #ifndef DATABASE_OPTIONS_HPP #define DATABASE_OPTIONS_HPP #include "../my_config.h" #include #include namespace libdar { /// \ingroup API /// @} /// options to open a database class database_open_options { public: database_open_options() { clear(); }; void clear() { x_partial = false; x_partial_read_only = false; x_warn_order = true; }; // setings /// partial option /// \param[in] value set to true to only load an manipulate database header /// \note if value is set to true, the database loading is quick but only some database methods are available (see the database class documentation) void set_partial(bool value) { x_partial = value; }; /// partial and read only option /// \param[in] value when set, the database is in partial mode *and* in read-only. It cannot be dumped or modified. /// \note if value is set to true, all restriction found for partial mode apply, and in addition, the database cannot be dumped (written back to file) /// \note partial_read_only implies partial, but partial does not imply partial_readonly (it can be dumped but modification /// can only take place in the archive header) void set_partial_read_only(bool value) { x_partial_read_only = value; if(value) x_partial = value; }; /// warning about file ordering in database /// \param[in] value whether to warn when file chronological ordering does not respect the order of archives void set_warn_order(bool value) { x_warn_order = value; }; // gettings bool get_partial() const { return x_partial; }; bool get_partial_read_only() const { return x_partial_read_only; }; bool get_warn_order() const { return x_warn_order; }; private: bool x_partial; bool x_partial_read_only; bool x_warn_order; }; /// options to write a database to file class database_dump_options { public: database_dump_options() { clear(); }; void clear() { x_overwrite = false; }; // settings /// overwrite option /// \param[in] value whether we can overwrite the file if it already exists /// void set_overwrite(bool value) { x_overwrite = value; }; // gettings bool get_overwrite() const { return x_overwrite; }; private: bool x_overwrite; }; /// options to add an archive to base class database_add_options { public: database_add_options() { clear(); }; void clear() {}; }; /// options to remove an archive from the base class database_remove_options { public: database_remove_options() { clear(); }; void clear() { x_revert_archive_numbering = false; }; /// defines whether the archive number is counted from the beginning or from the end of the database void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; }; bool get_revert_archive_numbering() const { return x_revert_archive_numbering; }; private: bool x_revert_archive_numbering; }; /// options for changing a given archive's basename class database_change_basename_options { public: database_change_basename_options() { clear(); }; void clear() { x_revert_archive_numbering = false; }; /// defines whether the archive number is counted from the beginning or from the end of the database void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; }; bool get_revert_archive_numbering() const { return x_revert_archive_numbering; }; private: bool x_revert_archive_numbering; }; /// options for changing a given archive's path class database_change_path_options { public: database_change_path_options() { clear(); }; void clear() { x_revert_archive_numbering = false; }; /// defines whether the archive number is counted from the beginning or from the end of the database void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; }; bool get_revert_archive_numbering() const { return x_revert_archive_numbering; }; private: bool x_revert_archive_numbering; }; /// options for restoration from database class database_restore_options { public: database_restore_options() { clear(); }; void clear() { x_early_release = x_info_details = x_ignore_dar_options_in_database = x_even_when_removed = false; x_date = 0; x_extra_options_for_dar.clear(); }; // settings /// early_release option /// if early_release is set to true, some memory is released before calling dar /// \note if early_release is true, this will free almost all memory allocated by the database before calling dar. /// drawback is that no more action is possible after this call (except destruction) void set_early_release(bool value) { x_early_release = value; }; /// info_details option /// if set to true, more detailed informations is displayed void set_info_details(bool value) { x_info_details = value; }; /// extra options to dar /// this option is a mean to provide some extra options to dar from dar_manager void set_extra_options_for_dar(const std::vector & value) { x_extra_options_for_dar = value; }; /// ignore options to dar embedded in the database void set_ignore_dar_options_in_database(bool mode) { x_ignore_dar_options_in_database = mode; }; /// date option /// informations about files more recent than the given date are ignored. So you can restore file in the most recent state before a certain "date". /// \note if set to zero, the most recent state available is looked for (this is the default value). void set_date(const infinint & value) { x_date = value; }; /// find data or EA if they have been removed at the requested data /// in the case a file has was removed at the request date, the data or EA /// that will be restored will be the one of it had just before being removed void set_even_when_removed(bool value) { x_even_when_removed = value; }; // gettings bool get_early_release() const { return x_early_release; }; bool get_info_details() const { return x_info_details; }; const std::vector & get_extra_options_for_dar() const { return x_extra_options_for_dar; }; const infinint & get_date() const { return x_date; }; bool get_ignore_dar_options_in_database() const { return x_ignore_dar_options_in_database; }; bool get_even_when_removed() const { return x_even_when_removed; }; private: bool x_early_release; bool x_info_details; std::vector x_extra_options_for_dar; infinint x_date; bool x_ignore_dar_options_in_database; bool x_even_when_removed; }; /// options for file "used" in archive class database_used_options { public: database_used_options() { clear(); }; void clear() { x_revert_archive_numbering = false; }; /// defines whether the archive number is counted from the beginning or from the end of the database void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; }; bool get_revert_archive_numbering() const { return x_revert_archive_numbering; }; private: bool x_revert_archive_numbering; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/erreurs.hpp0000644000175000017430000002541112641772777013465 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file erreurs.hpp /// \brief contains all the excetion class thrown by libdar /// \ingroup API #ifndef ERREURS_HPP #define ERREURS_HPP #include "../my_config.h" #include #include #include "integers.hpp" #include "erreurs.hpp" namespace libdar { /// \addtogroup API /// @{ /// a routine to change NLS domaine forth and back for inline routines extern const char *dar_gettext(const char *); /// this is the parent class of all exception classes. /// this is a pure virtual class that provide some simple /// mechanisme to carry the information about the cause of the exception, /// as well as some a complex mechanim which not used often in libdar /// that keep trace, for each exception throwing process, of the different /// calls by which the current exception has been exiting. class Egeneric { public : /// the constructor Egeneric(const std::string &source, const std::string &message); /// the destructor virtual ~Egeneric() {}; /// add more detailed couple of information to the exception virtual void stack(const std::string & passage, const std::string & message = "") { pile.push_back(niveau(passage, message)); }; /// get the message explaing the nature of the exception /// This is probably the only method you will use for all the /// the exception, as you will not have to create such objects /// and will only need to get the error message thanks to this /// method const std::string & get_message() const { return pile.front().objet; }; /// get the call function which has thrown this exception const std::string & get_source() const { return pile.front().lieu; }; /// retrieve the objet (object) associated to a given "lieu" (location) from the stack /// \param[in] location key to look for the value of /// \return returns an empty string if key is not found in the stack const std::string & find_object(const std::string & location) const; /// prepend error message by the given string void prepend_message(const std::string & context); /// dump all information of the exception to the standard error /// /// \note deprecated call, replaced by dump_str() void dump() const; /// return a string result of the exception information dump std::string dump_str() const; protected : virtual std::string exceptionID() const = 0; private : struct niveau { niveau(const std::string &ou, const std::string &quoi) { lieu = ou; objet = quoi; }; std::string lieu, objet; }; std::list pile; static const std::string empty_string; }; /// exception used when memory has been exhausted /// the inherited get_message() method is probably /// the only one you will need to use class Ememory : public Egeneric { public: Ememory(const std::string &source) : Egeneric(source, dar_gettext("Lack of Memory")) {}; protected: Ememory(const std::string &source, const std::string & message) : Egeneric(source, message) {}; std::string exceptionID() const { return "MEMORY"; }; }; /// exception used when secure memory has been exhausted class Esecu_memory : public Ememory { public: Esecu_memory(const std::string &source) : Ememory(source, dar_gettext("Lack of Secured Memory")) {}; protected: std::string exceptionID() const { return "SECU_MEMORY"; }; }; #define SRC_BUG Ebug(__FILE__, __LINE__) // #define XMT_BUG(exception, call) exception.stack(call, __FILE__, __LINE__) /// exception used to signal a bug. A bug is triggered when reaching some code that should never be reached class Ebug : public Egeneric { public : Ebug(const std::string & file, S_I line); using Egeneric::stack; // to avoid warning with clang void stack(const std::string & passage, const std::string & file, const std::string & line); protected : std::string exceptionID() const { return "BUG"; }; }; /// exception used when arithmetic error is detected when operating on infinint /// the inherited get_message() method is probably /// the only one you will need to use class Einfinint : public Egeneric { public : Einfinint(const std::string & source, const std::string & message) : Egeneric(source, message) {}; protected : std::string exceptionID() const { return "INFININT"; }; }; /// exception used when a limitint overflow is detected, the maximum value of the limitint has been exceeded /// the inherited get_message() method is probably /// the only one you will need to use class Elimitint : public Egeneric { public : Elimitint() : Egeneric("", dar_gettext("Cannot handle such a too large integer. Use a full version of libdar (compiled to rely on the \"infinint\" integer type) to solve this problem")) {}; protected : std::string exceptionID() const { return "LIMITINT"; }; }; /// exception used to signal range error /// the inherited get_message() method is probably /// the only one you will need to use class Erange : public Egeneric { public : Erange(const std::string & source, const std::string & message) : Egeneric(source, message) {}; protected : std::string exceptionID() const { return "RANGE"; }; }; /// exception used to signal convertion problem between infinint and string (decimal representation) /// the inherited get_message() method is probably /// the only one you will need to use /// see also the class deci class Edeci : public Egeneric { public : Edeci(const std::string & source, const std::string & message) : Egeneric(source, message) {}; protected : std::string exceptionID() const { return "DECI"; }; }; /// exception used when a requested feature is not (yet) implemented /// the inherited get_message() method is probably /// the only one you will need to use class Efeature : public Egeneric { public : Efeature(const std::string & message) : Egeneric("", message) {}; protected : std::string exceptionID() const { return "UNIMPLEMENTED FEATURE"; }; }; /// exception used when hardware problem is found /// the inherited get_message() method is probably /// the only one you will need to use class Ehardware : public Egeneric { public : Ehardware(const std::string & source, const std::string & message) : Egeneric(source, message) {}; protected : std::string exceptionID() const { return "HARDWARE ERROR"; }; }; /// exception used to signal that the user has aborted the operation /// the inherited get_message() method is probably /// the only one you will need to use class Euser_abort : public Egeneric { public : Euser_abort(const std::string & msg) : Egeneric("",msg) {}; protected : std::string exceptionID() const { return "USER ABORTED OPERATION"; }; }; /// exception used when an error concerning the treated data has been met /// the inherited get_message() method is probably /// the only one you will need to use class Edata : public Egeneric { public : Edata(const std::string & msg) : Egeneric("", msg) {}; protected : std::string exceptionID() const { return "ERROR IN TREATED DATA"; }; }; /// exception used when error the inter-slice user command returned an error code /// the inherited get_message() method is probably /// the only one you will need to use class Escript : public Egeneric { public : Escript(const std::string & source, const std::string & msg) : Egeneric(source ,msg) {}; protected : std::string exceptionID() const { return "USER ABORTED OPERATION"; }; }; /// exception used to signal an error in the argument given to libdar call of the API /// the inherited get_message() method is probably /// the only one you will need to use class Elibcall : public Egeneric { public : Elibcall(const std::string & source, const std::string & msg) : Egeneric(source ,msg) {}; protected : std::string exceptionID() const { return "USER ABORTED OPERATION"; }; }; /// exception used when a requested fearture has not beed activated at compilation time /// the inherited get_message() method is probably /// the only one you will need to use class Ecompilation : public Egeneric { public : Ecompilation(const std::string & msg) : Egeneric("" ,msg) {}; protected : std::string exceptionID() const { return "FEATURE DISABLED AT COMPILATION TIME"; }; }; /// exception used when the thread libdar is running in is asked to stop class Ethread_cancel : public Egeneric { public: Ethread_cancel(bool now, U_64 x_flag) : Egeneric("", now ? dar_gettext("Thread cancellation requested, aborting as soon as possible") : dar_gettext("Thread cancellation requested, aborting as properly as possible")) { immediate = now; flag = x_flag; }; bool immediate_cancel() const { return immediate; }; U_64 get_flag() const { return flag; }; protected: std::string exceptionID() const { return "THREAD CANCELLATION REQUESTED, ABORTING"; }; private: bool immediate; U_64 flag; }; /// exception used to carry system error class Esystem : public Egeneric { public: enum io_error { io_exist, //< file already exists (write mode) io_absent, //< file does not exist (read mode) io_access //< permission denied (any mode) }; Esystem(const std::string & source, const std::string & message, io_error code); io_error get_code() const { return x_code; }; protected: virtual std::string exceptionID() const { return "SYSTEM ERROR MET"; }; private: io_error x_code; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/secu_memory_file.hpp0000644000175000017430000000556012641773000015303 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file secu_memory_file.hpp /// \brief secu_memory_file is a generic_file class that only uses secured memory (not swappable and zeroed after use) /// \ingroup Private #ifndef SECU_MEMORY_FILE_HPP #define SECU_MEMORY_FILE_HPP #include "generic_file.hpp" #include "storage.hpp" namespace libdar { /// \addtogroup Private /// @{ class secu_memory_file : public generic_file { public: /// Constructors & Destructor secu_memory_file(U_I storage_size) : generic_file(gf_read_write), data(storage_size) { position = 0; }; // memory_storage specific methods /// reset the storage size and empty object content void reset(U_I size) { if(is_terminated()) throw SRC_BUG; position = 0; data.resize(size); }; /// the size of the data in the object infinint get_size() const { return data.get_size(); }; /// the allocated size of the object infinint get_allocated_size() const { return data.get_allocated_size(); }; /// set the content to a random string of size bytes void randomize(U_I size) { if(size > data.get_allocated_size()) reset(size); data.randomize(size); }; // virtual method inherited from generic_file bool skippable(skippability direction, const infinint & amount) { return true; }; bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const { if(is_terminated()) throw SRC_BUG; return position; }; const secu_string & get_contents() const { return data; }; protected: // virtual method inherited from generic_file void inherited_read_ahead(const infinint & amount) {}; U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate() {}; private: secu_string data; U_I position; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/filtre.cpp0000644000175000017430000034117712642474445013260 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_CTYPE_H #include #endif } // end extern "C" #include #include "filtre.hpp" #include "user_interaction.hpp" #include "erreurs_ext.hpp" #include "filesystem.hpp" #include "ea.hpp" #include "defile.hpp" #include "null_file.hpp" #include "thread_cancellation.hpp" #include "compressor.hpp" #include "sparse_file.hpp" #include "semaphore.hpp" #include "deci.hpp" #include "cat_all_entrees.hpp" using namespace std; #define SKIPPED "Skipping file: " #define SQUEEZED "Ignoring empty directory: " namespace libdar { // returns false if file has changed during backup (inode is saved however, but the saved data may be invalid) // return true if file has not change, false if file need not resaving or does not add wasted bytes in archive // throw exceptions in case of error static bool save_inode(user_interaction & dialog,//< how to report to user memory_pool *pool, //< set to nullptr or points to the memory_pool to use const string &info_quoi, //< full path name of the file to save (including its name) cat_entree * & e, //< cat_entree to save to archive const pile_descriptor & pdesc,//< where to write to bool info_details, //< verbose output to user bool display_treated, //< add an information line before treating a file bool alter_atime, //< whether to set back atime of filesystem bool check_change, //< whether to check file change during backup bool compute_crc, //< whether to recompute the CRC cat_file::get_data_mode keep_mode, //< whether to copy compressed data (same compression algo), uncompress but keep hole structure (change compression algo) or uncompress and fill data holes (redetect holes in file) const catalogue & cat, //< catalogue to update for escape sequence mark const infinint & repeat_count, //< how much time to retry saving the file if it has changed during the backup const infinint & repeat_byte, //< how much byte remains to waste for saving again a changing file const infinint & hole_size, //< the threshold for hole detection, set to zero completely disable the sparse file detection mechanism semaphore * sem, infinint & new_wasted_bytes); //< new amount of wasted bytes to return to the caller. static bool save_ea(user_interaction & dialog, const string & info_quoi, cat_inode * & ino, const pile_descriptor & pdesc, bool display_treated); static void restore_atime(const string & chemin, const cat_inode * & ptr); static bool save_fsa(user_interaction & dialog, const string & info_quoi, cat_inode * & ino, const pile_descriptor & pdesc, bool display_treated); /// merge two sets of EA /// \param[in] ref1 is the first EA set /// \param[in] ref2 is the second EA set /// \param[in,out] res is the EA set result of the merging operation /// \note result is the set of EA of ref1 to which those of ref2 are added if not already present in ref1 static void merge_ea(const ea_attributs & ref1, const ea_attributs & ref2, ea_attributs &res); /// to clone an "cat_entree" taking hard links into account /// \param[in] ref is the named entry to be cloned /// \param[in,out] hard_link_base is the datastructure that gather/maps hard_links information /// \param[in] etiquette_offset is the offset to apply to etiquette (to not mix several hard-link sets using the same etiquette number in different archives) /// \return a pointer to the new allocated clone object (to be deleted by the delete operator by the caller) static cat_entree *make_clone(const cat_nomme *ref, memory_pool *pool, map & hard_link_base, const infinint & etiquette_offset); /// remove an entry hardlink from a given hard_link database /// \param[in] mir is a pointer to the cat_mirage object to delete /// \param[in,out] hard_link_base is the datastructure used to gather/map hard_links information /// \note if the cat_mirage object is the last one pointing to a given "cat_etoile" object /// deleting this cat_mirage will delete the "cat_etoile" object automatically (see destructor implementation of these classes). /// However, one need to remove from the database the reference to this "cat_etoile *" that is about to me removed by the caller static void clean_hard_link_base_from(const cat_mirage *mir, map & hard_link_base); /// transfer EA from one cat_inode to another as defined by the given action /// \param[in] dialog for user interaction /// \param[in] action is the action to perform with EA and FSA /// \param[in,out] in_place is the "in place" cat_inode, the resulting EA/FSA operation is placed as EA/FSA of this object, argument may be nullptr /// \param[in] to_add is the "to be added" cat_inode /// \note actions set to EA_preserve EA_preserve_mark_already_saved and EA_clear are left intentionnaly unimplemented! /// \note the nullptr given as argument means that the object is not an cat_inode static void do_EFSA_transfert(user_interaction &dialog, memory_pool *pool, over_action_ea action, cat_inode *in_place, const cat_inode *to_add); /// overwriting policy when only restoring detruit objects static const crit_action *make_overwriting_for_only_deleted(memory_pool *pool); void filtre_restore(user_interaction & dialog, memory_pool *pool, const mask & filtre, const mask & subtree, const catalogue & cat, const path & fs_racine, bool fs_warn_overwrite, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics & st, const mask & ea_mask, bool flat, cat_inode::comparison_fields what_to_check, bool warn_remove_no_match, bool empty, bool empty_dir, const crit_action & x_overwrite, archive_options_extract::t_dirty dirty, bool only_deleted, bool not_deleted, const fsa_scope & scope) { defile juillet = fs_racine; // 'juillet' is in reference to 14th of July ;-) when takes place the "defile'" on the Champs-Elysees. const cat_eod tmp_eod; const cat_entree *e; thread_cancellation thr_cancel; const crit_action * when_only_deleted = only_deleted ? make_overwriting_for_only_deleted(pool) : nullptr; const crit_action & overwrite = only_deleted ? *when_only_deleted : x_overwrite; if(display_treated_only_dir && display_treated) display_treated = false; // avoid having filesystem to report action performed for each entry // specific code in this function will show instead the current directory // under which file are processed else display_treated_only_dir = false; // avoid incoherence try { filesystem_restore fs = filesystem_restore(dialog, fs_racine, fs_warn_overwrite, display_treated, ea_mask, what_to_check, warn_remove_no_match, empty, &overwrite, only_deleted, scope); // if only_deleted, we set the filesystem to only overwrite mode (no creatation if not existing) // we also filter to only restore directories and detruit objects. st.clear(); cat.reset_read(); if(!empty_dir) cat.launch_recursive_has_changed_update(); while(cat.read(e)) { const cat_nomme *e_nom = dynamic_cast(e); const cat_directory *e_dir = dynamic_cast(e); const cat_mirage *e_mir = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_file *e_file = dynamic_cast(e); const cat_detruit *e_det = dynamic_cast(e); if(e_mir != nullptr) { e_ino = const_cast(e_mir->get_inode()); if(e_ino == nullptr) throw SRC_BUG; // !?! how is this possible ? e_mir->get_inode()->change_name(e_mir->get_name()); // temporarily changing the inode name to the one of the cat_mirage e_file = dynamic_cast(e_ino); } if(e_det != nullptr && not_deleted) continue; // skip this cat_detruit object juillet.enfile(e); thr_cancel.check_self_cancellation(); if(display_treated_only_dir) { if(e_dir != nullptr) dialog.warning(string(gettext("Inspecting directory ")) + juillet.get_string()); } if(e_nom != nullptr) { try { bool path_covered = subtree.is_covered(juillet.get_path()); // is current entry covered by filters (path) bool name_covered = e_dir != nullptr || filtre.is_covered(e_nom->get_name()); // is current entry's filename covered (not applied to directories) bool dirty_covered = e_file == nullptr || !e_file->is_dirty() || dirty != archive_options_extract::dirty_ignore; // checking against dirty files bool empty_dir_covered = e_dir == nullptr || empty_dir || e_dir->get_recursive_has_changed(); // checking whether this is not a directory without any file to restore in it bool flat_covered = e_dir == nullptr || !flat; // we do not restore directories in flat mode bool only_deleted_covered = !only_deleted || e_dir != nullptr || e_det != nullptr; // we do not restore other thing that directories and cat_detruits when in "only_deleted" mode if(path_covered && name_covered && dirty_covered && empty_dir_covered && flat_covered && only_deleted_covered) { filesystem_restore::action_done_for_data data_restored = filesystem_restore::done_no_change_no_data; // will be true if file's data have been restored (depending on overwriting policy) bool ea_restored = false; // will be true if file's EA have been restored (depending on overwriting policy) bool hard_link = false; // will be true if data_restored is true and only lead to a hard link creation or file replacement by a hard link to an already existing inode bool fsa_restored = false; // will be true if file's FSA have been restored (depending on overwriting policy) bool first_time = true; // if quite dirty file (saved several time), need to record in sequential reading whether this is the first time we restore it (not used in direct access reading). bool created_retry; // when restoring several dirty copies (in sequential read), we not forget whether the file // has been created or not the first time (which is kept in "created"), for each try, we thus use created_retry // to carry the info whether the file has been created at each try struct cached_Erange { bool active; string source; string message; cached_Erange() { active = false; }; } tmp_exc; // used to hold exception information, when restoring in sequential reading in the hope another copy is available for the file if(dirty == archive_options_extract::dirty_warn && e_file != nullptr && e_file->is_dirty()) { string tmp = juillet.get_string(); dialog.pause(tools_printf(gettext("File %S has changed during backup and is probably not saved in a valid state (\"dirty file\"), do you want to consider it for restoration anyway?"), &tmp)); } do { if(!first_time) // a second time only occures in sequential read mode { const cat_file *e_file = dynamic_cast(e_ino); if(info_details) dialog.warning(string(gettext("File had changed during backup and had been copied another time, restoring the next copy of file: ")) + juillet.get_string()); // we must let the filesystem object forget that // this hard linked inode has already been seen if(e_mir != nullptr) fs.clear_corres_if_pointing_to(e_mir->get_etiquette(), juillet.get_string()); if(e_file != nullptr) { cat_file *me_file = const_cast(e_file); if(me_file == nullptr) throw SRC_BUG; me_file->drop_crc(); me_file->set_storage_size(0); if(cat.get_escape_layer() == nullptr) throw SRC_BUG; me_file->set_offset(cat.get_escape_layer()->get_position()); } fs.ignore_overwrite_restrictions_for_next_write(); } try { fs.write(e, data_restored, ea_restored, created_retry, hard_link, fsa_restored); // e and not e_ino, it may be a hard link if(tmp_exc.active) { // restoration succeeded so we drop any pending exception tmp_exc.active = false; } } catch(Erange & e) { // we do not throw the exception right now, but // we let a chance to read a new copy (retry upon change) // of that file. Only if there is no more copy available // we will throw this exception (which we cannot not // at this time if following sequential reading mode. tmp_exc.active = true; tmp_exc.source = e.get_source(); tmp_exc.message = e.get_message(); } if(first_time) first_time = false; // Now checking whether there is not a second copy // of the file to use instead, due to file change // while being read for backup. The last copy is the one // to use for restoration. } while(cat.get_escape_layer() != nullptr && cat.get_escape_layer()->skip_to_next_mark(escape::seqt_changed, false) && data_restored == filesystem_restore::done_data_restored); if(tmp_exc.active) throw Erange(tmp_exc.source, tmp_exc.message); if(cat.get_escape_layer() != nullptr && cat.get_escape_layer()->skip_to_next_mark(escape::seqt_dirty, false)) { string tmp = juillet.get_string(); // file is dirty and we are reading archive sequentially, thus this is only now once we have restored the file that // we can inform the user about the dirtyness of the file. if(e_nom == nullptr) throw SRC_BUG; cat_detruit killer = *e_nom; bool tmp_ea_restored, tmp_created_retry, tmp_hard_link, tmp_fsa_restored; filesystem_restore::action_done_for_data tmp_data_restored; switch(dirty) { case archive_options_extract::dirty_warn: dialog.pause(tools_printf(gettext("The just restored file %S has been marked as dirty (sequential reading can only detect the dirty status after restoration), do we remove this just restored dirty file?"), &tmp)); // NO BREAK HERE !!! This is intended. case archive_options_extract::dirty_ignore: // we must remove the file if(info_details) { if(dirty == archive_options_extract::dirty_ignore) dialog.warning(tools_printf(gettext("The just restored file %S has been marked as dirty (sequential reading can only detect the dirty status after restoration), removing the just restored dirty file as it is asked to ignore this type of file"), &tmp)); else dialog.warning(tools_printf(gettext("Removing the dirty file %S"), &tmp)); } fs.ignore_overwrite_restrictions_for_next_write(); fs.write(&killer, tmp_data_restored, tmp_ea_restored, tmp_created_retry, tmp_hard_link, tmp_fsa_restored); break; case archive_options_extract::dirty_ok: break; default: throw SRC_BUG; } } // Now updating the statistics counters if(hard_link) st.incr_hard_links(); switch(data_restored) { case filesystem_restore::done_data_restored: if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_treated(); break; case filesystem_restore::done_no_change_no_data: st.incr_skipped(); break; case filesystem_restore::done_no_change_policy: st.incr_tooold(); break; case filesystem_restore::done_data_removed: st.incr_deleted(); break; default: throw SRC_BUG; } if(ea_restored) st.incr_ea_treated(); if(fsa_restored) st.incr_fsa_treated(); } else // oject not covered by filters { if(display_skipped) { if(!path_covered || !name_covered || !dirty_covered) dialog.warning(string(gettext(SKIPPED)) + juillet.get_string()); else dialog.warning(string(gettext(SQUEEZED)) + juillet.get_string()); } if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_ignored(); if(e_dir != nullptr) { if(!path_covered || !empty_dir_covered) { // this directory has been excluded by path_covered // or empty_dir_covered. We must not recurse in it // (this is not a flat restoration for example) cat.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } } } } catch(Ebug & e) { throw; } catch(Euser_abort & e) { dialog.warning(juillet.get_string() + gettext(" not restored (user choice)")); if(e_dir != nullptr && !flat) { dialog.warning(gettext("No file in this directory will be restored.")); cat.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_ignored(); } catch(Ethread_cancel & e) { throw; } catch(Escript & e) { throw; } catch(Egeneric & e) { if(!only_deleted || e_dir == nullptr) dialog.warning(string(gettext("Error while restoring ")) + juillet.get_string() + " : " + e.get_message()); if(e_dir != nullptr && !flat) { if(!only_deleted) dialog.warning(string(gettext("Warning! No file in that directory will be restored: ")) + juillet.get_string()); cat.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } if(e_dir == nullptr || !cat.read_second_time_dir()) if(!only_deleted) st.incr_errored(); } } else // e_nom == nullptr : this should be a CAT_EOD { const cat_eod *e_eod = dynamic_cast(e); if(e_eod == nullptr) throw SRC_BUG; // not an class cat_eod object, nor a class cat_nomme object ??? if(!flat) { bool notusedhere; filesystem_restore::action_done_for_data tmp; fs.write(e, tmp, notusedhere, notusedhere, notusedhere, notusedhere); // cat_eod; don't care returned value } } } } catch(...) { if(when_only_deleted != nullptr) delete when_only_deleted; throw; } if(when_only_deleted != nullptr) delete when_only_deleted; } void filtre_sauvegarde(user_interaction & dialog, memory_pool *pool, const mask &filtre, const mask &subtree, const pile_descriptor & pdesc, catalogue & cat, const catalogue & ref, const path & fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, statistics & st, bool make_empty_dir, const mask & ea_mask, const mask &compr_mask, const infinint & min_compr_size, bool nodump, const infinint & hourshift, bool alter_atime, bool furtive_read_mode, bool same_fs, cat_inode::comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, bool security_check, const infinint & repeat_count, const infinint & repeat_byte, const infinint & fixed_date, const infinint & sparse_file_min_size, const string & backup_hook_file_execute, const mask & backup_hook_file_mask, bool ignore_unknown, const fsa_scope & scope, const string & exclude_by_ea) { cat_entree *e = nullptr; const cat_entree *f = nullptr; defile juillet = fs_racine; const cat_eod tmp_eod; compression stock_algo; semaphore sem = semaphore(dialog, backup_hook_file_execute, backup_hook_file_mask); if(display_treated_only_dir && display_treated) display_treated = false; // avoid having save_inode/save_ea to report action performed for each entry // specific code in this function will show instead the current directory // under which file are processed else display_treated_only_dir = false; // avoid incoherence stock_algo = pdesc.compr->get_algo(); infinint root_fs_device; filesystem_backup fs = filesystem_backup(dialog, fs_racine, info_details, ea_mask, nodump, alter_atime, furtive_read_mode, cache_directory_tagging, root_fs_device, ignore_unknown, scope); thread_cancellation thr_cancel; infinint skipped_dump, fs_errors; infinint wasted_bytes = 0; st.clear(); cat.reset_add(); ref.reset_compare(); try { try { while(fs.read(e, fs_errors, skipped_dump)) { cat_nomme *nom = dynamic_cast(e); cat_directory *dir = dynamic_cast(e); cat_inode *e_ino = dynamic_cast(e); cat_file *e_file = dynamic_cast(e); cat_mirage *e_mir = dynamic_cast(e); bool known_hard_link = false; st.add_to_ignored(skipped_dump); st.add_to_errored(fs_errors); juillet.enfile(e); thr_cancel.check_self_cancellation(); if(display_treated_only_dir) { if(dir != nullptr) dialog.warning(string(gettext("Inspecting directory ")) + juillet.get_string()); } if(e_mir != nullptr) { known_hard_link = e_mir->is_inode_wrote(); if(!known_hard_link) { e_ino = dynamic_cast(e_mir->get_inode()); e_file = dynamic_cast(e_mir->get_inode()); if(e_ino == nullptr) throw SRC_BUG; e_ino->change_name(e_mir->get_name()); } } if(nom != nullptr) { try { string tmp_val; if(subtree.is_covered(juillet.get_path()) && (dir != nullptr || filtre.is_covered(nom->get_name())) && (! same_fs || e_ino == nullptr || e_ino->get_device() == root_fs_device) && (e_ino == nullptr || exclude_by_ea == "" || e_ino->ea_get_saved_status() != cat_inode::ea_full || e_ino->get_ea() == nullptr || !e_ino->get_ea()->find(exclude_by_ea, tmp_val))) { if(known_hard_link) { // no need to update the semaphore here as no data is read and no directory is expected here cat.pre_add(e); // if cat is a escape_catalogue, this adds an escape sequence and entry info in the archive cat.add(e); e = nullptr; st.incr_hard_links(); st.incr_treated(); if(e_mir != nullptr) { if(e_mir->get_inode()->get_saved_status() == s_saved || e_mir->get_inode()->ea_get_saved_status() == cat_inode::ea_full) if(display_treated) dialog.warning(string(gettext("Recording hard link into the archive: "))+juillet.get_string()); } else throw SRC_BUG; // known_hard_link is true and e_mir == nullptr !??? } else // not a hard link or known hard linked inode { const cat_inode *f_ino = nullptr; const cat_file *f_file = nullptr; const cat_mirage *f_mir = nullptr; if(e_ino == nullptr) throw SRC_BUG; // if not a known hard link, e_ino should still either point to a real cat_inode // or to the hard linked new cat_inode. if(fixed_date.is_zero()) { bool conflict = ref.compare(e, f); if(!conflict) { f = nullptr; f_ino = nullptr; f_mir = nullptr; } else // inode was already present in filesystem at the time the archive of reference was made { f_ino = dynamic_cast(f); f_file = dynamic_cast(f); f_mir = dynamic_cast(f); if(f_mir != nullptr) { f_ino = f_mir->get_inode(); f_file = dynamic_cast(f_ino); } // Now checking for filesystem dissimulated modifications if(security_check) { if(f_ino != nullptr && e_ino != nullptr) { // both are inodes if(compatible_signature(f_ino->signature(), e_ino->signature()) // both are of the same type of inode && f_file != nullptr) // both are plain files (no warning issued for other inode types) { // both are plain file or hard-linked plain files if(f_ino->get_uid() == e_ino->get_uid() && f_ino->get_gid() == e_ino->get_gid() && f_ino->get_perm() == e_ino->get_perm() && f_ino->get_last_modif() == e_ino->get_last_modif()) { // same inode information if(f_ino->has_last_change() && e_ino->has_last_change()) { // both inode ctime has been recorded if(f_ino->get_last_change() != e_ino->get_last_change()) { string tmp = juillet.get_string(); dialog.printf(gettext("SECURITY WARNING! SUSPICIOUS FILE %S: ctime changed since archive of reference was done, while no other inode information changed"), &tmp); } } } } } } } } else f = nullptr; try { f_ino = snapshot ? nullptr : f_ino; f_file = snapshot ? nullptr : f_file; // EVALUATING THE ACTION TO PERFORM bool change_to_remove_ea = e_ino != nullptr && e_ino->ea_get_saved_status() == cat_inode::ea_none // current inode to backup does not have any EA && f_ino != nullptr && f_ino->ea_get_saved_status() != cat_inode::ea_none && f_ino->ea_get_saved_status() != cat_inode::ea_removed; // and reference was an inode with EA bool avoid_saving_inode = snapshot // don't backup if doing a snapshot || (!fixed_date.is_zero() && e_ino != nullptr && e_ino->get_last_modif() < fixed_date) // don't backup if older than given date (if reference date given) || (fixed_date.is_zero() && e_ino != nullptr && f_ino != nullptr && !e_ino->has_changed_since(*f_ino, hourshift, what_to_check) && (f_file == nullptr || !f_file->is_dirty())) // don't backup if doing differential backup and entry is the same as the one in the archive of reference // and if the reference is a plain file, it was not saved as dirty ; bool avoid_saving_ea = snapshot // don't backup if doing a snapshot || (!fixed_date.is_zero() && e_ino != nullptr && e_ino->ea_get_saved_status() != cat_inode::ea_none && e_ino->get_last_change() < fixed_date) // don't backup if older than given date (if reference date given) || (fixed_date.is_zero() && e_ino != nullptr && e_ino->ea_get_saved_status() == cat_inode::ea_full && f_ino != nullptr && f_ino->ea_get_saved_status() != cat_inode::ea_none && e_ino->get_last_change() <= f_ino->get_last_change()) // don't backup if doing differential backup and entry is the same as the one in the archive of reference ; bool avoid_saving_fsa = snapshot // don't backup if doing a snapshot || (!fixed_date.is_zero() && e_ino != nullptr && e_ino->fsa_get_saved_status() != cat_inode::fsa_none && e_ino->get_last_change() < fixed_date) // don't backup if older than given date (if reference date given) || (fixed_date.is_zero() && e_ino != nullptr && e_ino->fsa_get_saved_status() == cat_inode::fsa_full && f_ino != nullptr && f_ino->fsa_get_saved_status() != cat_inode::fsa_none && e_ino->get_last_change() <= f_ino->get_last_change()) // don't backup if doing differential backup and entry is the same as the one in the archive of reference ; bool sparse_file_detection = e_file != nullptr && e_file->get_size() > sparse_file_min_size && !sparse_file_min_size.is_zero(); // MODIFIYING INODE IF NECESSARY if(e_ino->get_saved_status() != s_saved) throw SRC_BUG; // filsystem should always provide "saved" "cat_entree" if(avoid_saving_inode) { e_ino->set_saved_status(s_not_saved); st.incr_skipped(); } if(avoid_saving_ea) { if(e_ino->ea_get_saved_status() == cat_inode::ea_full) e_ino->ea_set_saved_status(cat_inode::ea_partial); } if(avoid_saving_fsa) { if(e_ino->fsa_get_saved_status() == cat_inode::fsa_full) e_ino->fsa_set_saved_status(cat_inode::fsa_partial); } if(change_to_remove_ea) e_ino->ea_set_saved_status(cat_inode::ea_removed); if(e_file != nullptr) e_file->set_sparse_file_detection_write(sparse_file_detection); // DECIDING WHETHER FILE DATA WILL BE COMPRESSED OR NOT if(e_file != nullptr) { if(compr_mask.is_covered(nom->get_name()) && e_file->get_size() >= min_compr_size) // e_nom not e_file because "e" // may be a hard link, in which case its name is not carried by e_ino nor e_file e_file->change_compression_algo_write(stock_algo); else e_file->change_compression_algo_write(none); } // PERFORMING ACTION FOR ENTRY (cat_entree dump, eventually data dump) if(!save_inode(dialog, pool, juillet.get_string(), e, pdesc, info_details, display_treated, alter_atime, true, // check_change true, // compute_crc cat_file::normal, // keep_mode cat, repeat_count, repeat_byte, sparse_file_min_size, &sem, wasted_bytes)) st.incr_tooold(); // counting a new dirty file in archive st.set_byte_amount(wasted_bytes); if(!avoid_saving_inode) st.incr_treated(); // PERFORMING ACTION FOR EA if(e_ino->ea_get_saved_status() != cat_inode::ea_removed) { if(e_ino->ea_get_saved_status() == cat_inode::ea_full) cat.pre_add_ea(e); if(save_ea(dialog, juillet.get_string(), e_ino, pdesc, display_treated)) st.incr_ea_treated(); cat.pre_add_ea_crc(e); } // PERFORMING ACTION FOR FSA if(e_ino->fsa_get_saved_status() == cat_inode::fsa_full) { cat.pre_add_fsa(e); if(save_fsa(dialog, juillet.get_string(), e_ino, pdesc, display_treated)) st.incr_fsa_treated(); cat.pre_add_fsa_crc(e); } // CLEANING UP MEMORY FOR PLAIN FILES if(e_file != nullptr) e_file->clean_data(); // UPDATING HARD LINKS if(e_mir != nullptr) e_mir->set_inode_wrote(true); // record that this inode has been saved (it is a "known_hard_link" now) // ADDING ENTRY TO CATALOGUE cat.add(e); e = nullptr; } catch(...) { if(dir != nullptr && fixed_date.is_zero()) ref.compare(&tmp_eod, f); throw; } } } else // inode not covered { cat_nomme *ig = nullptr; cat_inode *ignode = nullptr; sem.raise(juillet.get_string(), e, false); if(display_skipped) dialog.warning(string(gettext(SKIPPED)) + juillet.get_string()); if(dir != nullptr && make_empty_dir) ig = ignode = new (pool) cat_ignored_dir(*dir); else ig = new (pool) cat_ignored(nom->get_name()); // necessary to not record deleted files at comparison // time in case files are just not covered by filters st.incr_ignored(); if(ig == nullptr) throw Ememory("filtre_sauvegarde"); else cat.add(ig); if(dir != nullptr) { if(make_empty_dir) { bool known; if(fixed_date.is_zero()) known = ref.compare(dir, f); else known = false; try { const cat_inode *f_ino = known ? dynamic_cast(f) : nullptr; bool tosave = false; if(known) if(f_ino != nullptr) tosave = dir->has_changed_since(*f_ino, hourshift, what_to_check); else throw SRC_BUG; // catalogue::compare() with a directory should return false or give a directory as // second argument or here f is not an inode (f_ino == nullptr) ! // and known == true else tosave = true; ignode->set_saved_status(tosave && !snapshot ? s_saved : s_not_saved); } catch(...) { if(fixed_date.is_zero()) ref.compare(&tmp_eod, f); throw; } if(fixed_date.is_zero()) ref.compare(&tmp_eod, f); } fs.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } delete e; // we don't keep this object in the catalogue so we must destroy it e = nullptr; } } catch(Ebug & e) { throw; } catch(Euser_abort & e) { throw; } catch(Escript & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Elimitint & e) { throw; } catch(Egeneric & ex) { const string & how = ex.find_object("generic_file::copy_to"); if(how != "write") // error did not occured while adding data to the archive { cat_nomme *tmp = new (pool) cat_ignored(nom->get_name()); dialog.warning(string(gettext("Error while saving ")) + juillet.get_string() + ": " + ex.get_message()); st.incr_errored(); // now we can destroy the object delete e; e = nullptr; if(tmp == nullptr) throw Ememory("fitre_sauvegarde"); cat.add(tmp); if(dir != nullptr) { fs.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); dialog.warning(gettext("NO FILE IN THAT DIRECTORY CAN BE SAVED.")); } } else { ex.prepend_message(gettext("Cannot write down the archive: ")); throw; // error occured while adding data to the archive, archive cannot be generated properly } } } else // cat_eod { sem.raise(juillet.get_string(), e, true); sem.lower(); if(fixed_date.is_zero()) ref.compare(e, f); // makes the comparison in the reference catalogue go to parent directory cat.pre_add(e); // adding a mark and dropping CAT_EOD entry in the archive if cat is an escape_catalogue object (else, does nothing) if(display_finished) { const cat_directory & cur = cat.get_current_add_dir(); string what = juillet.get_string(); string size = tools_display_integer_in_metric_system(cur.get_size(), "o", true); string ratio = gettext(", compression ratio "); if(!cur.get_storage_size().is_zero()) ratio += tools_get_compression_ratio(cur.get_storage_size(), cur.get_size(), true); else ratio = ""; dialog.printf(gettext("Finished Inspecting directory %S , saved %S%S"), &what, &size, &ratio); } cat.add(e); } } } catch(Ethread_cancel & e) { if(!e.immediate_cancel()) { if(pdesc.compr->is_compression_suspended()) { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->resume_compression(); } } throw Ethread_cancel_with_attr(e.immediate_cancel(), e.get_flag(), fs.get_last_etoile_ref()); } } catch(...) { if(e != nullptr) delete e; throw; } if(pdesc.compr->is_compression_suspended()) { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->resume_compression(); } } void filtre_difference(user_interaction & dialog, memory_pool *pool, const mask &filtre, const mask &subtree, const catalogue & cat, const path & fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics & st, const mask & ea_mask, bool alter_atime, bool furtive_read_mode, cat_inode::comparison_fields what_to_check, const infinint & hourshift, bool compare_symlink_date, const fsa_scope & scope, bool isolated_mode) { const cat_entree *e; defile juillet = fs_racine; const cat_eod tmp_eod; filesystem_diff fs = filesystem_diff(dialog, fs_racine, info_details, ea_mask, alter_atime, furtive_read_mode, scope); thread_cancellation thr_cancel; if(display_treated_only_dir && display_treated) display_treated = false; // avoiding the report of action performed for each entry // specific code in this function will show instead the current directory // under which file are processed else display_treated_only_dir = false; // avoid incoherence st.clear(); cat.reset_read(); while(cat.read(e)) { const cat_directory *e_dir = dynamic_cast(e); const cat_nomme *e_nom = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_mirage *e_mir = dynamic_cast(e); if(e_mir != nullptr) { const cat_file *e_file = dynamic_cast(e_mir->get_inode()); if(e_file == nullptr || e_mir->get_etoile_ref_count() == 1 || cat.get_escape_layer() == nullptr) { e_ino = e_mir->get_inode(); e_mir->get_inode()->change_name(e_mir->get_name()); } else dialog.warning(gettext("SKIPPED (hard link in sequential read mode): ") + e_mir->get_name()); } juillet.enfile(e); thr_cancel.check_self_cancellation(); if(display_treated_only_dir) { if(e_dir != nullptr) dialog.warning(string(gettext("Inspecting directory ")) + juillet.get_string()); } try { if(e_nom != nullptr) { if(subtree.is_covered(juillet.get_path()) && (e_dir != nullptr || filtre.is_covered(e_nom->get_name()))) { cat_nomme *exists_nom = nullptr; if(e_ino != nullptr) { if(e_nom == nullptr) throw SRC_BUG; if(fs.read_filename(e_nom->get_name(), exists_nom)) { try { cat_inode *exists = dynamic_cast(exists_nom); cat_directory *exists_dir = dynamic_cast(exists_nom); if(exists != nullptr) { try { e_ino->compare(*exists, ea_mask, what_to_check, hourshift, compare_symlink_date, scope, isolated_mode); if(display_treated) dialog.warning(string(gettext("OK "))+juillet.get_string()); if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_treated(); if(!alter_atime) { const cat_inode * tmp_exists = const_cast(exists); restore_atime(juillet.get_string(), tmp_exists); } } catch(Erange & e) { dialog.warning(string(gettext("DIFF "))+juillet.get_string()+": "+ e.get_message()); if(e_dir == nullptr && exists_dir != nullptr) fs.skip_read_filename_in_parent_dir(); if(e_dir != nullptr && exists_dir == nullptr) { cat.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_errored(); if(!alter_atime) { const cat_inode * tmp_exists = const_cast(exists); restore_atime(juillet.get_string(), tmp_exists); } } } else // existing file is not an inode throw SRC_BUG; // filesystem, should always return inode with read_filename() } catch(...) { delete exists_nom; exists_nom = nullptr; throw; } delete exists_nom; exists_nom = nullptr; } else // can't compare, nothing of that name in filesystem { dialog.warning(string(gettext("DIFF "))+ juillet.get_string() + gettext(": file not present in filesystem")); if(e_dir != nullptr) { cat.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_errored(); } } else // not an inode (for example a cat_detruit, hard_link etc...), nothing to do st.incr_treated(); } else // not covered by filters { if(display_skipped) dialog.warning(string(gettext(SKIPPED)) + juillet.get_string()); if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_ignored(); if(e_dir != nullptr) { cat.skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } } } else // cat_eod ? if(dynamic_cast(e) != nullptr) // yes cat_eod fs.skip_read_filename_in_parent_dir(); else // no ?!? throw SRC_BUG; // not cat_nomme neither cat_eod ! what's that ? } catch(Euser_abort &e) { throw; } catch(Ebug &e) { throw; } catch(Escript & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { dialog.warning(string(gettext("ERR ")) + juillet.get_string() + " : " + e.get_message()); if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_errored(); } } fs.skip_read_filename_in_parent_dir(); // this call here only to restore dates of the root (-R option) directory } void filtre_test(user_interaction & dialog, memory_pool *pool, const mask &filtre, const mask &subtree, const catalogue & cat, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool empty, statistics & st) { const cat_entree *e; defile juillet = FAKE_ROOT; null_file black_hole = null_file(gf_write_only); infinint offset; const cat_eod tmp_eod; thread_cancellation thr_cancel; string perimeter; if(display_treated_only_dir && display_treated) display_treated = false; // avoid having save_inode/save_ea to report action performed for each entry // specific code in this function will show instead the current directory // under which file are processed else display_treated_only_dir = false; // avoid incoherence st.clear(); cat.reset_read(); while(cat.read(e)) { const cat_file *e_file = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_directory *e_dir = dynamic_cast(e); const cat_nomme *e_nom = dynamic_cast(e); const cat_mirage *e_mir = dynamic_cast(e); juillet.enfile(e); thr_cancel.check_self_cancellation(); if(display_treated_only_dir) { if(e_dir != nullptr) dialog.warning(string(gettext("Inspecting directory ")) + juillet.get_string()); } perimeter = ""; try { if(e_mir != nullptr) { if(!e_mir->is_inode_wrote()) { e_file = dynamic_cast(e_mir->get_inode()); e_ino = e_mir->get_inode(); } } if(e_nom != nullptr) { if(subtree.is_covered(juillet.get_path()) && (e_dir != nullptr || filtre.is_covered(e_nom->get_name()))) { // checking data file if any if(e_file != nullptr && e_file->get_saved_status() == s_saved) { perimeter = gettext("Data"); if(!empty) { bool dirty_file; do { generic_file *dat = e_file->get_data(cat_file::normal); if(dat == nullptr) throw Erange("filtre_test", gettext("Can't read saved data.")); dirty_file = false; try { infinint crc_size; crc *check = nullptr; const crc *original = nullptr; if(!e_file->get_crc_size(crc_size)) crc_size = tools_file_size_to_crc_size(e_file->get_size()); dat->skip(0); // in sequential read mode, storage_size is zero // which leads to ask an endless read_ahead (up to eof) // thus the read_ahaead will be bounded by the escape // layer up to the next tape mark, as expected dat->read_ahead(e_file->get_storage_size()); try { dat->copy_to(black_hole, crc_size, check); } catch(...) { // in sequential read mode we must // try to read the CRC for the object // be completed and not generating an // error due to absence of CRC later on e_file->get_crc(original); throw; } if(check == nullptr) throw SRC_BUG; try { // due to possible sequential reading mode, the CRC // must not be fetched before the data has been copied if(e_file->get_crc(original)) { if(original == nullptr) throw SRC_BUG; if(typeid(*check) != typeid(*original)) throw SRC_BUG; if(*check != *original) throw Erange("fitre_test", gettext("CRC error: data corruption.")); } } catch(...) { delete check; throw; } delete check; } catch(...) { delete dat; throw; } delete dat; if(cat.get_escape_layer() != nullptr && cat.get_escape_layer()->skip_to_next_mark(escape::seqt_changed, false)) { dirty_file = true; cat_file *modif_e_file = const_cast(e_file); if(modif_e_file == nullptr) throw SRC_BUG; modif_e_file->drop_crc(); modif_e_file->set_storage_size(0); modif_e_file->set_offset(cat.get_escape_layer()->get_position()); } } while(dirty_file); } } // checking inode EA if any if(e_ino != nullptr && e_ino->ea_get_saved_status() == cat_inode::ea_full) { if(perimeter == "") perimeter = "EA"; else perimeter += " + EA"; if(!empty) { ea_attributs tmp = *(e_ino->get_ea()); perimeter += "(" + deci(tmp.size()).human() +")"; e_ino->ea_detach(); } } // checking FSA if any if(e_ino != nullptr && e_ino->fsa_get_saved_status() == cat_inode::fsa_full) { if(perimeter == "") perimeter = "FSA"; else perimeter += " + FSA"; if(!empty) { const filesystem_specific_attribute_list *tmp = e_ino->get_fsa(); if(tmp == nullptr) throw SRC_BUG; perimeter += "(" + deci(tmp->size()).human() + ")"; e_ino->fsa_detach(); } } if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_treated(); if(e_mir != nullptr) e_mir->set_inode_wrote(true); // still no exception raised, this all is fine if(display_treated) dialog.warning(string(gettext("OK ")) + juillet.get_string() + " " + perimeter); } else // excluded by filter { if(display_skipped) dialog.warning(string(gettext(SKIPPED)) + juillet.get_string()); if(e_dir != nullptr) { juillet.enfile(&tmp_eod); cat.skip_read_to_parent_dir(); } if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_skipped(); } } } catch(Euser_abort & e) { throw; } catch(Ebug & e) { throw; } catch(Escript & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { dialog.warning(string(gettext("ERR ")) + juillet.get_string() + " : " + e.get_message()); if(e_dir == nullptr || !cat.read_second_time_dir()) st.incr_errored(); } } } void filtre_merge(user_interaction & dialog, memory_pool *pool, const mask & filtre, const mask & subtree, const pile_descriptor & pdesc, catalogue & cat, const catalogue * ref1, const catalogue * ref2, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics & st, bool make_empty_dir, const mask & ea_mask, const mask & compr_mask, const infinint & min_compr_size, bool keep_compressed, const crit_action & over_action, bool warn_overwrite, bool decremental_mode, const infinint & sparse_file_min_size, const fsa_scope & scope) { compression stock_algo; if(display_treated_only_dir && display_treated) display_treated = false; // avoiding the report of action performed for each entry // specific code in this function will show instead the current directory // under which file are processed else display_treated_only_dir = false; // avoid incoherence stock_algo = pdesc.compr->get_algo(); thread_cancellation thr_cancel; const cat_eod tmp_eod; const catalogue *ref_tab[] = { ref1, ref2, nullptr }; infinint etiquette_offset = 0; map corres_copy; const cat_entree *e = nullptr; U_I index = 0; defile juillet = FAKE_ROOT; infinint fake_repeat = 0; bool abort = false; crit_action *decr = nullptr; // will point to a locally allocated crit_action // for decremental backup (argument overwrite is ignored) const crit_action *overwrite = &over_action; // may point to &decr if // decremental backup is asked // STEP 0: Getting ready st.clear(); if(decremental_mode) { if(ref1 == nullptr || ref2 == nullptr) { dialog.pause(gettext("Decremental mode is useless when merging is not applied to both an archive of reference and an auxiliary archive of reference. Ignore decremental mode and continue?")); decremental_mode = false; } else { // allocating decr to "{T&R&~R&(A|!H)}[S*] P* ; {(e&~e&r&~r)|(!e&!~e)}[*s] *p" // // which means to record just data presence (S*) when: // both entries are of the same type (T) // and both have the same modification date (R&~R) // and this is the first time we meet this hard linked inode, or this is not a hard linked inode (A|!H) // else data is taken as is (P*) from the "in place" archive // EA and FSA are recorded as present when: // both entries have EA/FSA present (e&~e) // and both EA/FSA set have the same date (r&~r) // OR // none entry has EA/FSA present // else the EA/FSA (or the absence of EA/FSA) is taken from the "in place" archive try { crit_chain *decr_crit_chain = new (pool) crit_chain(); if(decr_crit_chain == nullptr) throw Ememory("filtre_merge"); decr = decr_crit_chain; crit_and c_and = crit_and(); crit_or c_or = crit_or(); c_and.clear(); c_or.clear(); c_and.add_crit(crit_same_type()); c_and.add_crit(crit_in_place_data_more_recent()); c_and.add_crit(crit_invert(crit_in_place_data_more_recent())); c_or.add_crit(crit_in_place_is_new_hardlinked_inode()); c_or.add_crit(crit_not(crit_in_place_is_hardlinked_inode())); c_and.add_crit(c_or); decr_crit_chain->add(testing( c_and, crit_constant_action(data_preserve_mark_already_saved, EA_undefined), crit_constant_action(data_preserve, EA_undefined) )); c_and.clear(); c_or.clear(); c_and.add_crit(crit_in_place_EA_present()); c_and.add_crit(crit_invert(crit_in_place_EA_present())); c_and.add_crit(crit_in_place_EA_more_recent()); c_and.add_crit(crit_invert(crit_in_place_EA_more_recent())); c_or.add_crit(c_and); c_and.clear(); c_and.add_crit(crit_not(crit_in_place_EA_present())); c_and.add_crit(crit_not(crit_invert(crit_in_place_EA_present()))); c_or.add_crit(c_and); decr_crit_chain->add(testing( c_or, crit_constant_action(data_undefined, EA_preserve_mark_already_saved), crit_constant_action(data_undefined, EA_preserve) )); } catch(...) { if(decr != nullptr) { delete decr; decr = nullptr; } throw; } overwrite = decr; } } /// End of Step 0 try { if(overwrite == nullptr) throw SRC_BUG; // STEP 1: // we merge catalogues (pointed to by ref_tab[]) of each archive and produce a resulting catalogue 'cat' // the merging resolves overwriting conflicts following the "criterium" rule // each object of the catalogue is cloned and stored in 'cat', these clones get dump to archive at step 2 try { while(ref_tab[index] != nullptr) // for each catalogue of reference (ref. and eventually auxiliary ref.) do: { juillet = FAKE_ROOT; cat.reset_add(); cat.reset_read(); ref_tab[index]->reset_read(); if(info_details) { const char *ptr; switch(index) { case 0: ptr = gettext("first"); break; case 1: ptr = gettext("second"); break; default: ptr = gettext("next"); // not yet used, but room is made for future evolutions break; } dialog.printf(gettext("Merging/filtering files from the %s archive..."), ptr); } while(ref_tab[index]->read(e)) // examining the content of the current archive of reference, each entry one by one { const cat_nomme *e_nom = dynamic_cast(e); const cat_mirage *e_mir = dynamic_cast(e); const cat_directory *e_dir = dynamic_cast(e); const cat_detruit *e_detruit = dynamic_cast(e); juillet.enfile(e); thr_cancel.check_self_cancellation(); if(e_nom != nullptr) { try { if(subtree.is_covered(juillet.get_path()) && (e_dir != nullptr || filtre.is_covered(e_nom->get_name()))) { cat_entree *dolly = make_clone(e_nom, pool, corres_copy, etiquette_offset); // now that we have a clone object we must add the copied object to the catalogue, respecting the overwriting constaints try { string the_name = e_nom->get_name(); const cat_nomme *already_here = nullptr; // may receive an address when an object of that name already exists in the resultant catalogue // some different types of pointer to the "dolly" object cat_nomme *dolly_nom = dynamic_cast(dolly); cat_directory *dolly_dir = dynamic_cast(dolly); cat_mirage *dolly_mir = dynamic_cast(dolly); cat_inode *dolly_ino = dynamic_cast(dolly); if(dolly_mir != nullptr) dolly_ino = dolly_mir->get_inode(); if(cat.read_if_present(& the_name, already_here)) // An entry of that name already exists in the resulting catalogue { // some different types of pointer to the "already_here" object (aka 'inplace" object) const cat_mirage *al_mir = dynamic_cast(already_here); const cat_detruit *al_det = dynamic_cast(already_here); const cat_ignored *al_ign = dynamic_cast(already_here); const cat_ignored_dir *al_igndir = dynamic_cast(already_here); const cat_inode *al_ino = dynamic_cast(already_here); const cat_directory *al_dir = dynamic_cast(already_here); const string full_name = juillet.get_string(); over_action_data act_data; over_action_ea act_ea; if(al_mir != nullptr) al_ino = al_mir->get_inode(); if(dolly_nom == nullptr) throw SRC_BUG; // dolly should be the clone of a cat_nomme object which is not the case here // evaluating the overwriting policy overwrite->get_action(*already_here, *dolly_nom, act_data, act_ea); if(act_data == data_ask) act_data = crit_ask_user_for_data_action(dialog, full_name, already_here, dolly); // possibly modifying the resulting action when warning is requested if(warn_overwrite) { switch(act_data) { case data_overwrite: case data_overwrite_mark_already_saved: case data_remove: case data_preserve_mark_already_saved: try { string action; switch(act_data) { case data_overwrite: action = gettext("overwritten"); break; case data_overwrite_mark_already_saved: case data_preserve_mark_already_saved: action = gettext("dropped from the archive and marked as already saved"); break; case data_remove: action = gettext("removed"); break; default: throw SRC_BUG; } dialog.pause(tools_printf(gettext("Data of file %S is about to be %S, proceed?"), &full_name, &action)); } catch(Euser_abort & e) { act_data = data_preserve; } break; case data_preserve: case data_undefined: case data_ask: break; default: throw SRC_BUG; } switch(act_ea) { case EA_overwrite: case EA_clear: case EA_preserve_mark_already_saved: case EA_overwrite_mark_already_saved: case EA_merge_overwrite: try { string action; switch(act_ea) { case EA_overwrite: action = gettext("replaced"); break; case EA_clear: action = gettext("removed from the archive"); break; case EA_preserve_mark_already_saved: case EA_overwrite_mark_already_saved: action = gettext("dropped from the archive and marked as already saved"); break; case EA_merge_overwrite: action = gettext("merged with possible overwriting"); break; default: throw SRC_BUG; } dialog.pause(tools_printf(gettext("EA and FSA of file %S are about to be %S, proceed?"), &full_name, &action)); } catch(Euser_abort & e) { act_data = data_preserve; } break; case EA_preserve: case EA_merge_preserve: case EA_ask: case EA_undefined: break; default: throw SRC_BUG; } } switch(act_data) { /////////////////////////// FIRST ACTIONS CATEGORY for DATA ///// case data_preserve: case data_preserve_mark_already_saved: case data_undefined: // remaining data_undefined at the end of the evaluation defaults to data_preserve // drop data if necessary if(act_data == data_preserve_mark_already_saved && al_ino != nullptr) { cat_inode *tmp = const_cast(al_ino); if(tmp->get_saved_status() == s_saved) tmp->set_saved_status(s_not_saved); // dropping data } // EA consideration if(act_ea == EA_ask) { if(dolly_ino != nullptr && al_ino != nullptr && (dolly_ino->ea_get_saved_status() != cat_inode::ea_none || al_ino->ea_get_saved_status() != cat_inode::ea_none || dolly_ino->fsa_get_saved_status() != cat_inode::fsa_none || al_ino->fsa_get_saved_status() != cat_inode::fsa_none) ) act_ea = crit_ask_user_for_EA_action(dialog, full_name, already_here, dolly); else act_ea = EA_preserve; // whatever what we want is, as no EA exist for both inplace and to be added objects, there is just no need to ask for that. } switch(act_ea) { case EA_preserve: case EA_undefined: // remaining ea_undefined at the end of the evaluation defaults to ea_preserve // nothing to do break; case EA_overwrite: case EA_overwrite_mark_already_saved: case EA_merge_preserve: case EA_merge_overwrite: if(display_treated) dialog.warning(tools_printf(gettext("EA and FSA of file %S from first archive have been updated with those of same named file of the auxiliary archive"), &full_name)); do_EFSA_transfert(dialog, pool, act_ea, const_cast(al_ino), dolly_ino); break; case EA_preserve_mark_already_saved: if(al_ino != nullptr && al_ino->ea_get_saved_status() == cat_inode::ea_full) { const_cast(al_ino)->ea_set_saved_status(cat_inode::ea_partial); if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S from first archive have been dropped and marked as already saved"), &full_name)); } if(al_ino != nullptr && al_ino->fsa_get_saved_status() == cat_inode::fsa_full) { const_cast(al_ino)->fsa_set_saved_status(cat_inode::fsa_partial); if(display_treated) dialog.warning(tools_printf(gettext("FSA of file %S from first archive have been dropped and marked as already saved"), &full_name)); } break; case EA_clear: if(al_ino != nullptr && al_ino->ea_get_saved_status() != cat_inode::ea_none) { if(al_ino->ea_get_saved_status() == cat_inode::ea_full) st.decr_ea_treated(); if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S from first archive have been removed"), &full_name)); const_cast(al_ino)->ea_set_saved_status(cat_inode::ea_none); } if(al_ino != nullptr && al_ino->fsa_get_saved_status() != cat_inode::fsa_none) { if(al_ino->fsa_get_saved_status() == cat_inode::fsa_full) st.decr_fsa_treated(); if(display_treated) dialog.warning(tools_printf(gettext("FSA of file %S from first archive have been removed"), &full_name)); const_cast(al_ino)->fsa_set_saved_status(cat_inode::fsa_none); } break; default: throw SRC_BUG; } // we must keep the existing entry in the catalogue if(display_skipped && (dolly_dir == nullptr || al_dir == nullptr)) dialog.warning(tools_printf(gettext("Data of file %S from first archive has been preserved from overwriting"), &full_name)); if(al_dir != nullptr && dolly_dir != nullptr) { // we can recurse in the directory in both ref and current catalogue because both entries are directories try { cat.re_add_in(al_dir->get_name()); // trying to update the add cursor of cat } catch(Erange & e) { ref_tab[index]->skip_read_to_parent_dir(); // updates back the read cursor of catalogue of reference juillet.enfile(&tmp_eod); // updates back the read cursor of juillet cat.skip_read_to_parent_dir(); // updates back the read cursor of cat throw; } } else // there is not the possibility to recurse in directory in both reference catalogue and catalogue under construction { if(al_dir != nullptr) cat.skip_read_to_parent_dir(); if(dolly_dir != nullptr) { ref_tab[index]->skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } } // we may need to clean the corres_copy map if(dolly_mir != nullptr) clean_hard_link_base_from(dolly_mir, corres_copy); // now we can safely destroy the clone object delete dolly; dolly = nullptr; break; /////////////////////////// SECOND ACTIONS CATEGORY for DATA ///// case data_overwrite: case data_overwrite_mark_already_saved: case data_remove: // drop data if necessary if(display_treated) { switch(act_data) { case data_remove: dialog.warning(tools_printf(gettext("Data of file %S taken from the first archive of reference has been removed"), &full_name)); break; default: dialog.warning(tools_printf(gettext("Data of file %S taken from the first archive of reference has been overwritten"), &full_name)); } } if(act_data == data_overwrite_mark_already_saved && dolly_ino != nullptr) { if(dolly_ino->get_saved_status() == s_saved) dolly_ino->set_saved_status(s_not_saved); // dropping data } // EA consideration if(act_ea == EA_ask && act_data != data_remove) { if(dolly_ino != nullptr && al_ino != nullptr && (dolly_ino->ea_get_saved_status() != cat_inode::ea_none || al_ino->ea_get_saved_status() != cat_inode::ea_none || dolly_ino->fsa_get_saved_status() != cat_inode::fsa_none || al_ino->fsa_get_saved_status() != cat_inode::fsa_none)) act_ea = crit_ask_user_for_EA_action(dialog, full_name, already_here, dolly); else act_ea = EA_overwrite; // no need to ask here neither as both entries have no EA. } if(act_data != data_remove) { switch(act_ea) { case EA_preserve: case EA_undefined: // remaining ea_undefined at the end of the evaluation defaults to ea_preserve do_EFSA_transfert(dialog, pool, EA_overwrite, dolly_ino, al_ino); break; case EA_overwrite: if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S has been overwritten"), &full_name)); break; // nothing to do case EA_overwrite_mark_already_saved: if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S has been overwritten and marked as already saved"), &full_name)); if(dolly_ino != nullptr && dolly_ino->ea_get_saved_status() == cat_inode::ea_full) dolly_ino->ea_set_saved_status(cat_inode::ea_partial); break; case EA_merge_preserve: if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S from first archive have been updated with those of the same named file of the auxiliary archive"), &full_name)); do_EFSA_transfert(dialog, pool, EA_merge_overwrite, dolly_ino, al_ino); break; case EA_merge_overwrite: if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S from first archive have been updated with those of the same named file of the auxiliary archive"), &full_name)); do_EFSA_transfert(dialog, pool, EA_merge_preserve, dolly_ino, al_ino); break; case EA_preserve_mark_already_saved: if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S has been overwritten and marked as already saved"), &full_name)); do_EFSA_transfert(dialog, pool, EA_overwrite_mark_already_saved, dolly_ino, al_ino); break; case EA_clear: if(al_ino->ea_get_saved_status() != cat_inode::ea_none) { if(display_treated) dialog.warning(tools_printf(gettext("EA of file %S from first archive have been removed"), &full_name)); dolly_ino->ea_set_saved_status(cat_inode::ea_none); } break; default: throw SRC_BUG; } } else // data_remove { // we remove both objects in overwriting conflict: here for now the dolly clone of the to be added if(dolly_mir != nullptr) clean_hard_link_base_from(dolly_mir, corres_copy); if(dolly_dir != nullptr) { juillet.enfile(&tmp_eod); ref_tab[index]->skip_read_to_parent_dir(); dolly_dir = nullptr; } // now we can safely destroy the clone object delete dolly; dolly = nullptr; } // we must remove the existing entry present in the catalogue to make room for the new entry to be added if(dolly_dir == nullptr || al_dir == nullptr || act_data == data_remove) // one or both are not directory we effectively must remove the entry from the catalogue { cat_ignored_dir *if_removed = nullptr; // to known which counter to decrement st.decr_treated(); if(al_ino != nullptr) if(al_ino->ea_get_saved_status() == cat_inode::ea_full) st.decr_ea_treated(); // hard link specific actions if(al_mir != nullptr) { // update back hard link counter st.decr_hard_links(); // updating counter from pointed to inode const cat_inode*al_ptr_ino = al_mir->get_inode(); if(al_ptr_ino == nullptr) throw SRC_BUG; else if(al_ptr_ino->ea_get_saved_status() == cat_inode::ea_full) st.decr_ea_treated(); // cleaning the corres_copy map from the pointed to cat_etoile object reference if necessary clean_hard_link_base_from(al_mir, corres_copy); } if(al_det != nullptr) st.decr_deleted(); if(al_ign != nullptr || al_igndir != nullptr) st.decr_ignored(); if(act_data == data_remove) st.incr_ignored(); // remove the current entry from the catalogue if(al_dir != nullptr) { infinint tree_size = al_dir->get_tree_size(); map tiquettes; map::iterator ut; st.add_to_ignored(tree_size); st.sub_from_treated(tree_size); st.sub_from_ea_treated(al_dir->get_tree_ea_num()); st.sub_from_hard_links(al_dir->get_tree_mirage_num()); cat.skip_read_to_parent_dir(); // updating corres_copy with hard_link that will be destroyed due to directory deletion tiquettes.clear(); al_dir->get_etiquettes_found_in_tree(tiquettes); ut = tiquettes.begin(); while(ut != tiquettes.end()) { map::iterator it = corres_copy.find(ut->first); if(it == corres_copy.end()) throw SRC_BUG; // unknown etiquettes found in directory tree if(it->second->get_ref_count() < ut->second) throw SRC_BUG; // more reference found in directory tree toward this cat_etoile than // this cat_etoile is aware of ! if(it->second->get_ref_count() == ut->second) // this cat_etoile will disapear because all its reference are located // in the directory tree we are about to remove, we must clean this // entry from corres_copy corres_copy.erase(it); ++ut; } if(make_empty_dir) { if_removed = new (pool) cat_ignored_dir(*al_dir); if(if_removed == nullptr) throw Ememory("filtre_merge"); } } try { // we can now remove the entry from the catalogue cat.remove_read_entry(the_name); // now that the ancient directory has been removed we can replace it by an cat_ignored_dir entry if required if(if_removed != nullptr) cat.add(if_removed); } catch(...) { if(if_removed != nullptr) { delete if_removed; if_removed = nullptr; } throw; } } else // both existing and the one to add are directories we can proceed to the merging of their contents { cat.re_add_in_replace(*dolly_dir); delete dolly; dolly = nullptr; } break; default: /////////////////////////// THIRD ACTIONS CATEGORY for DATA ///// throw SRC_BUG; // unknown data action ! } } // end of overwiting considerations else if(index >= 1 && decremental_mode) { unsigned char firm; // this entry only exists in the auxilliary archive of reference, we must thus replace it by a "cat_detruit // because it will have to be removed when restoring the decremental backup. // we may need to clean the corres_copy map if(dolly_mir != nullptr) { clean_hard_link_base_from(dolly_mir, corres_copy); dolly_mir = nullptr; } // then taking care or directory hierarchy if(dolly_dir != nullptr) { juillet.enfile(&tmp_eod); ref_tab[index]->skip_read_to_parent_dir(); dolly_dir = nullptr; } if(dolly != nullptr) { delete dolly; dolly = nullptr; } else throw SRC_BUG; dolly_ino = nullptr; if(e_mir != nullptr) firm = e_mir->get_inode()->signature(); else firm = e->signature(); dolly = new (pool) cat_detruit(the_name, firm, ref_tab[index]->get_current_reading_dir().get_last_modif()); if(dolly == nullptr) throw Ememory("filtre_merge"); dolly_nom = dynamic_cast(dolly); } if(dolly != nullptr) { const cat_inode *e_ino = dynamic_cast(e); cat.add(dolly); st.incr_treated(); if(e_mir != nullptr) { st.incr_hard_links(); e_ino = e_mir->get_inode(); } if(e_detruit != nullptr) st.incr_deleted(); if(e_ino != nullptr) { if(e_ino->ea_get_saved_status() == cat_inode::ea_full) st.incr_ea_treated(); if(e_ino->fsa_get_saved_status() == cat_inode::fsa_full) st.incr_fsa_treated(); } if(e_dir != nullptr) // we must chdir also for the *reading* method of this catalogue object { if(!cat.read_if_present(&the_name, already_here)) throw SRC_BUG; } } } catch(...) { if(dolly != nullptr) { delete dolly; dolly = nullptr; } throw; } } else // excluded by filters { if(e_dir != nullptr && make_empty_dir) { cat_ignored_dir *igndir = new (pool) cat_ignored_dir(*e_dir); if(igndir == nullptr) throw Ememory("filtre_merge"); else cat.add(igndir); } if(display_skipped) dialog.warning(string(gettext(SKIPPED)) + juillet.get_string()); st.incr_ignored(); if(e_dir != nullptr) { ref_tab[index]->skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } } } catch(Ebug & e) { throw; } catch(Euser_abort & e) { dialog.warning(juillet.get_string() + gettext(" not merged (user choice)")); if(e_dir != nullptr) { dialog.warning(gettext("No file in this directory will be considered for merging.")); ref_tab[index]->skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } st.incr_errored(); } catch(Ethread_cancel & e) { throw; } catch(Escript & e) { throw; } catch(Elimitint & e) { throw; } catch(Egeneric & e) { dialog.warning(string(gettext("Error while considering file ")) + juillet.get_string() + " : " + e.get_message()); if(e_dir != nullptr) { dialog.warning(string(gettext("Warning! No file in this directory will be considered for merging: ")) + juillet.get_string()); ref_tab[index]->skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } st.incr_errored(); } } else // cat_entree is not a cat_nomme object (this is a "cat_eod") { cat_entree *tmp = e->clone(); try { const cat_nomme *already = nullptr; if(tmp == nullptr) throw Ememory("filtre_merge"); if(dynamic_cast(tmp) == nullptr) throw SRC_BUG; cat.add(tmp); // add cat_eod to catalogue (add cursor) cat.read_if_present(nullptr, already); // equivalent to cat_eod for the reading methods } catch(...) { if(tmp != nullptr) delete tmp; throw; } } } index++; // next archive etiquette_offset = corres_copy.size(); } } catch(Ethread_cancel & e) { abort = true; dialog.warning(gettext("File selection has been aborted. Now building the resulting archive with the already selected files")); if(e.immediate_cancel()) throw; } } catch(...) { if(decr != nullptr) { delete decr; decr = nullptr; overwrite = nullptr; } throw; } if(decr != nullptr) { delete decr; decr = nullptr; overwrite = nullptr; } // STEP 2: // 'cat' is now completed // we must copy the file's data, EA and FSA to the archive if(info_details) dialog.warning("Copying filtered files to the resulting archive..."); cat.reset_read(); juillet = FAKE_ROOT; try { thr_cancel.block_delayed_cancellation(true); while(cat.read(e)) { cat_entree *e_var = const_cast(e); cat_nomme *e_nom = dynamic_cast(e_var); cat_inode *e_ino = dynamic_cast(e_var); cat_file *e_file = dynamic_cast(e_var); cat_mirage *e_mir = dynamic_cast(e_var); cat_directory *e_dir = dynamic_cast(e_var); if(e_var == nullptr) throw SRC_BUG; cat_file::get_data_mode keep_mode = keep_compressed ? cat_file::keep_compressed : cat_file::keep_hole; if(e_mir != nullptr) if(!e_mir->is_inode_wrote()) // we store only once the inode pointed by a set of hard links { e_ino = e_mir->get_inode(); e_file = dynamic_cast(e_ino); } juillet.enfile(e); thr_cancel.check_self_cancellation(); if(display_treated_only_dir) { if(e_dir != nullptr) dialog.warning(string(gettext("Inspecting directory ")) + juillet.get_string()); } if(e_ino != nullptr) // inode { bool compute_file_crc = false; if(e_file != nullptr) { const crc *val = nullptr; if(!e_file->get_crc(val)) // this can occur when reading an old archive format compute_file_crc = true; } // deciding whether the file will be compressed or not if(e_file != nullptr) { if(keep_mode != cat_file::keep_compressed) if(compr_mask.is_covered(e_nom->get_name()) && e_file->get_size() >= min_compr_size) e_file->change_compression_algo_write(stock_algo); else e_file->change_compression_algo_write(none); else // keep compressed: e_file->change_compression_algo_write(e_file->get_compression_algo_read()); } // deciding whether the sparse file detection mechanism will be enabled or not // the sparse file detection mechanism is faked active in keep_compressed mode // because we need to record that sparse file datastructure is used as compressed data if(e_file != nullptr) { if(!sparse_file_min_size.is_zero() && keep_mode != cat_file::keep_compressed) // sparse_file detection is activated { if(e_file->get_size() > sparse_file_min_size) { e_file->set_sparse_file_detection_write(true); keep_mode = cat_file::normal; } else if(e_file->get_sparse_file_detection_read()) { e_file->set_sparse_file_detection_write(false); keep_mode = cat_file::normal; } } else // sparse file layer or absence of layer is unchanged e_file->set_sparse_file_detection_write(e_file->get_sparse_file_detection_read()); } // saving inode's data if(!save_inode(dialog, pool, juillet.get_string(), e_var, pdesc, info_details, display_treated, true, // alter_atime false, // check_change compute_file_crc, keep_mode, cat, 0, // repeat_count 0, // repeat_byte sparse_file_min_size, nullptr, // semaphore fake_repeat)) throw SRC_BUG; else // succeeded saving { if(e_mir != nullptr) e_mir->set_inode_wrote(true); } // saving inode's EA if(e_ino->ea_get_saved_status() == cat_inode::ea_full) { cat.pre_add_ea(e); // ignoring the return value of save_ea, exceptions may still propagate (void)save_ea(dialog, juillet.get_string(), e_ino, pdesc, display_treated); cat.pre_add_ea_crc(e); } // saving inode's FSA if(e_ino->fsa_get_saved_status() == cat_inode::fsa_full) { cat.pre_add_fsa(e); // ignoring the return value of save_fsa, exceptions may still propagate (void)save_fsa(dialog, juillet.get_string(), e_ino, pdesc, display_treated); cat.pre_add_fsa_crc(e); } } else // not an inode { cat.pre_add(e); if(e_mir != nullptr && (e_mir->get_inode()->get_saved_status() == s_saved || e_mir->get_inode()->ea_get_saved_status() == cat_inode::ea_full)) if(display_treated) dialog.warning(string(gettext("Adding Hard link to archive: "))+juillet.get_string()); } // we can now check for interrution requests thr_cancel.block_delayed_cancellation(false); thr_cancel.block_delayed_cancellation(true); } } catch(Ethread_cancel & e) { cat.tail_catalogue_to_current_read(); cat.change_location(pdesc); if(pdesc.compr->is_compression_suspended()) { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->resume_compression(); } thr_cancel.block_delayed_cancellation(false); throw; } cat.change_location(pdesc); if(pdesc.compr->is_compression_suspended()) { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->resume_compression(); } thr_cancel.block_delayed_cancellation(false); if(abort) throw Ethread_cancel(false, 0); } void filtre_sequentially_read_all_catalogue(catalogue & cat, user_interaction & dialog, bool lax_read_mode) { const cat_entree *e; thread_cancellation thr_cancel; defile juillet = FAKE_ROOT; cat.reset_read(); try { while(cat.read(e)) { const cat_file *e_file = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_mirage *e_mir = dynamic_cast(e); const crc *check = nullptr; juillet.enfile(e); thr_cancel.check_self_cancellation(); if(e_mir != nullptr) { if(!e_mir->is_inode_dumped()) { e_file = dynamic_cast(e_mir->get_inode()); e_ino = e_mir->get_inode(); } } try { if(e_file != nullptr) (void)e_file->get_crc(check); } catch(Erange & e) { string msg = string(gettext("failed reading CRC from file: ")) + juillet.get_string(); if(lax_read_mode) dialog.warning(msg); else throw Edata(msg); } if(e_mir != nullptr && (e_ino != nullptr || e_file != nullptr)) e_mir->set_inode_dumped(true); try { if(e_ino != nullptr) { if(e_ino->ea_get_saved_status() == cat_inode::ea_full) { (void)e_ino->get_ea(); e_ino->ea_get_crc(check); } if(e_ino->fsa_get_saved_status() == cat_inode::fsa_full) { (void)e_ino->get_fsa(); e_ino->fsa_get_crc(check); } } } catch(Erange & e) { string msg = string(gettext("Failed reading CRC for EA: ")) + juillet.get_string(); if(lax_read_mode) dialog.warning(msg); else throw Edata(msg); } } } catch(Erange & e) { dialog.warning(string(gettext("Error met while reading next entry: ")) + juillet.get_string()); } } static bool save_inode(user_interaction & dialog, memory_pool *pool, const string & info_quoi, cat_entree * & e, const pile_descriptor & pdesc, bool info_details, bool display_treated, bool alter_atime, bool check_change, bool compute_crc, cat_file::get_data_mode keep_mode, const catalogue & cat, const infinint & repeat_count, const infinint & repeat_byte, const infinint & hole_size, semaphore *sem, infinint & current_wasted_bytes) { bool ret = true; infinint current_repeat_count = 0; infinint storage_size; bool loop; cat_mirage *mir = dynamic_cast(e); cat_inode *ino = dynamic_cast(e); bool resave_uncompressed = false; infinint rewinder = pdesc.stack->get_position(); // we skip back here if data must be saved uncompressed if(mir != nullptr) { ino = mir->get_inode(); if(ino == nullptr) throw SRC_BUG; } do // loop if resave_uncompressed is set, this is the OUTER LOOP { // PRE RECORDING THE INODE (for sequential reading) cat.pre_add(e); // TREATING SPECIAL CASES if(ino == nullptr) return true; if(pdesc.compr == nullptr) throw SRC_BUG; if(ino->get_saved_status() != s_saved) { if(sem != nullptr) sem->raise(info_quoi, ino, false); return ret; } if(compute_crc && (keep_mode != cat_file::normal && keep_mode != cat_file::plain)) throw SRC_BUG; // cannot compute crc if data is compressed or hole datastructure not interpreted // TREATNG INODE THAT NEED DATA SAVING if(display_treated) { if(resave_uncompressed) dialog.warning(string(gettext("Resaving file without compression: ")) + info_quoi); else { string i_type = entree_to_string(ino); dialog.warning(tools_printf(gettext("Adding %S to archive: %S"), &i_type, &info_quoi)); } } cat_file *fic = dynamic_cast(ino); if(fic != nullptr) { if(sem != nullptr) sem->raise(info_quoi, ino, true); try { do // while "loop" is true, this is the INNER LOOP { loop = false; infinint start; generic_file *source = nullptr; ////////////////////////////// // preparing the source try { switch(keep_mode) { case cat_file::keep_compressed: if(fic->get_compression_algo_read() != fic->get_compression_algo_write()) keep_mode = cat_file::keep_hole; source = fic->get_data(keep_mode); break; case cat_file::keep_hole: source = fic->get_data(keep_mode); break; case cat_file::normal: if(fic->get_sparse_file_detection_read()) // source file already holds a sparse_file structure source = fic->get_data(cat_file::plain); // we must hide the holes for it can be redetected else source = fic->get_data(cat_file::normal); break; case cat_file::plain: throw SRC_BUG; // save_inode must never be called with this value default: throw SRC_BUG; // unknown value for keep_mode } } catch(...) { cat.pre_add_failed_mark(); throw; } ////////////////////////////// // preparing the destination if(source != nullptr) { try { sparse_file *dst_hole = nullptr; infinint crc_size = tools_file_size_to_crc_size(fic->get_size()); crc * val = nullptr; const crc * original = nullptr; bool crc_available = false; source->skip(0); source->read_ahead(0); pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->sync_write(); // necessary in any case to reset the compression engine to be able at later time to decompress starting at that position if(keep_mode == cat_file::keep_compressed || fic->get_compression_algo_write() == none) pdesc.compr->suspend_compression(); else pdesc.compr->resume_compression(); // now that compression has reset we can fetch the location where the data will be dropped: start = pdesc.stack->get_position(); fic->set_offset(start); try { if(fic->get_sparse_file_detection_write() && keep_mode != cat_file::keep_compressed && keep_mode != cat_file::keep_hole) { // creating the sparse_file to copy data to destination dst_hole = new (pool) sparse_file(pdesc.stack->top(), hole_size); if(dst_hole == nullptr) throw Ememory("save_inode"); pdesc.stack->push(dst_hole); } ////////////////////////////// // proceeding to file's data backup if(!compute_crc) crc_available = fic->get_crc(original); else crc_available = false; source->copy_to(*pdesc.stack, crc_size, val); if(val == nullptr) throw SRC_BUG; ////////////////////////////// // checking crc value and storing it in catalogue if(compute_crc) fic->set_crc(*val); else { if(keep_mode == cat_file::normal && crc_available) { if(original == nullptr) throw SRC_BUG; if(typeid(*original) != typeid(*val)) throw SRC_BUG; if(*original != *val) throw Erange("save_inode", gettext("Copied data does not match CRC")); } } ////////////////////////////// // checking whether saved files used sparse_file datastructure if(dst_hole != nullptr) { pdesc.stack->sync_write_above(dst_hole); dst_hole->sync_write(); if(!dst_hole->has_seen_hole() && !dst_hole->has_escaped_data()) fic->set_sparse_file_detection_write(false); // here we drop the sparse_file datastructure as no hole // could be read. This will speed up extraction when used // normally (not with sequential reading, as the inode info // is already written to file and cannot be changed. // Reading as sparse_file datastructure a plain normal data // is possible while there is no data to escape, this is just // a bit more slower.). } fichier_global *s_fic = dynamic_cast(source); if(s_fic != nullptr) s_fic->fadvise(fichier_global::advise_dontneed); source->terminate(); } catch(...) { if(val != nullptr) { delete val; val = nullptr; } if(dst_hole != nullptr) { if(pdesc.stack->pop() != dst_hole) throw SRC_BUG; delete dst_hole; dst_hole = nullptr; } throw; } if(val != nullptr) { delete val; val = nullptr; } if(dst_hole != nullptr) { dst_hole->terminate(); if(pdesc.stack->pop() != dst_hole) throw SRC_BUG; delete dst_hole; dst_hole = nullptr; } if(pdesc.stack->get_position() >= start) { storage_size = pdesc.stack->get_position() - start; fic->set_storage_size(storage_size); } else throw SRC_BUG; } catch(...) { delete source; source = nullptr; // restore atime of source if(!alter_atime) tools_noexcept_make_date(info_quoi, false, ino->get_last_access(), ino->get_last_modif(), ino->get_last_modif()); throw; } delete source; source = nullptr; ////////////////////////////// // adding the data CRC if escape marks are used cat.pre_add_crc(ino); ////////////////////////////// // checking if compressed data is smaller than uncompressed one if(fic->get_size() <= storage_size && keep_mode != cat_file::keep_compressed && fic->get_compression_algo_write() != none) { infinint current_pos_tmp = pdesc.stack->get_position(); if(current_pos_tmp <= rewinder) throw SRC_BUG; // we are positionned before the start of the current inode dump! if(pdesc.stack->skippable(generic_file::skip_backward, current_pos_tmp - rewinder)) { try { if(!pdesc.stack->skip(rewinder)) throw SRC_BUG; if(!resave_uncompressed) resave_uncompressed = true; else throw SRC_BUG; // should only be tried once per inode fic->change_compression_algo_write(none); break; // stop the inner loop } catch(Ebug & e) { throw; } catch(...) { if(info_details) dialog.warning(info_quoi + gettext(" : Failed resaving uncompressed the inode data")); // ignoring the error and continuing resave_uncompressed = false; if(pdesc.stack->get_position() != current_pos_tmp) throw SRC_BUG; } } else { if(info_details) dialog.warning(info_quoi + gettext(" : Resaving uncompressed the inode data to gain space is not possible, keeping data compressed")); } } else resave_uncompressed = false; ////////////////////////////// // checking for last_modification date change if(check_change) { bool changed = false; try { changed = fic->get_last_modif() != tools_get_mtime(info_quoi); } catch(Erange & e) { dialog.warning(tools_printf(gettext("File has disappeared while we were reading it, cannot check whether it has changed during its backup: %S"), &info_quoi)); changed = false; } if(changed) { if(current_repeat_count < repeat_count) { current_repeat_count++; infinint current_pos_tmp = pdesc.stack->get_position(); try { if(pdesc.stack->skippable(generic_file::skip_backward, storage_size)) { if(!pdesc.stack->skip(start)) { if(!pdesc.stack->skip(current_repeat_count)) throw SRC_BUG; throw Erange("",""); // used locally } } else throw Erange("",""); // used locally, not propagated over this try / catch block } catch(...) { current_wasted_bytes += current_pos_tmp - start; if(pdesc.stack->get_position() != current_pos_tmp) throw SRC_BUG; } if(repeat_byte.is_zero() || (current_wasted_bytes < repeat_byte)) { if(info_details) dialog.warning(tools_printf(gettext("WARNING! File modified while reading it for backup. Performing retry %i of %i"), ¤t_repeat_count, &repeat_count)); if(pdesc.stack->get_position() != start) cat.pre_add_waste_mark(); loop = true; // updating the last modification date of file fic->set_last_modif(tools_get_mtime(info_quoi)); // updating the size of the file fic->change_size(tools_get_size(info_quoi)); } else { dialog.warning(string(gettext("WARNING! File modified while reading it for backup. No more retry for that file to not exceed the wasted byte limit. File is ")) + info_quoi); fic->set_dirty(true); ret = false; } } else { dialog.warning(string(gettext("WARNING! File modified while reading it for backup, but no more retry allowed: ")) + info_quoi); fic->set_dirty(true); cat.pre_add_dirty(); // when in sequential reading ret = false; } } } ////////////////////////////// // restore atime of source if(!alter_atime) tools_noexcept_make_date(info_quoi, false, ino->get_last_access(), ino->get_last_modif(), ino->get_last_modif()); } else throw SRC_BUG; // saved_status == s_saved, but no data available, and no exception raised; } while(loop); // INNER LOOP } catch(...) { if(sem != nullptr) sem->lower(); throw; } if(sem != nullptr) sem->lower(); } else // fic == nullptr if(sem != nullptr) { sem->raise(info_quoi, ino, true); sem->lower(); } } while(resave_uncompressed); // OUTER LOOP return ret; } static bool save_ea(user_interaction & dialog, const string & info_quoi, cat_inode * & ino, const pile_descriptor & pdesc, bool display_treated) { bool ret = false; try { switch(ino->ea_get_saved_status()) { case cat_inode::ea_full: // if there is something to save if(ino->get_ea() != nullptr) { crc * val = nullptr; try { if(display_treated) dialog.warning(string(gettext("Saving Extended Attributes for ")) + info_quoi); if(pdesc.compr->is_compression_suspended()) { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->resume_compression(); // always compress EA (no size or filename consideration) } else { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->sync_write(); // reset the compression engine to be able to decompress from that point later } ino->ea_set_offset(pdesc.stack->get_position()); pdesc.stack->reset_crc(tools_file_size_to_crc_size(ino->ea_get_size())); // start computing CRC for any read/write on stack try { ino->get_ea()->dump(*pdesc.stack); } catch(...) { val = pdesc.stack->get_crc(); // this keeps "stack" in a coherent status throw; } val = pdesc.stack->get_crc(); ino->ea_set_crc(*val); ino->ea_detach(); ret = true; } catch(...) { if(val != nullptr) delete val; throw; } if(val != nullptr) delete val; } else throw SRC_BUG; break; case cat_inode::ea_partial: case cat_inode::ea_none: break; case cat_inode::ea_fake: throw SRC_BUG; //filesystem, must not provide inode in such a status case cat_inode::ea_removed: throw SRC_BUG; //filesystem, must not provide inode in such a status default: throw SRC_BUG; } } catch(Ebug & e) { throw; } catch(Euser_abort & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { dialog.warning(string(gettext("Error saving Extended Attributes for ")) + info_quoi + ": " + e.get_message()); } return ret; } static void restore_atime(const string & chemin, const cat_inode * & ptr) { const cat_file * ptr_f = dynamic_cast(ptr); if(ptr_f != nullptr) tools_noexcept_make_date(chemin, false, ptr_f->get_last_access(), ptr_f->get_last_modif(), ptr_f->get_last_modif()); } static bool save_fsa(user_interaction & dialog, const string & info_quoi, cat_inode * & ino, const pile_descriptor & pdesc, bool display_treated) { bool ret = false; try { switch(ino->fsa_get_saved_status()) { case cat_inode::fsa_full: // if there is something to save if(ino->get_fsa() != nullptr) { crc * val = nullptr; try { if(display_treated) dialog.warning(string(gettext("Saving Filesystem Specific Attributes for ")) + info_quoi); if(pdesc.compr->get_algo() != none) { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->suspend_compression(); // never compress EA (no size or filename consideration) } ino->fsa_set_offset(pdesc.stack->get_position()); pdesc.stack->reset_crc(tools_file_size_to_crc_size(ino->fsa_get_size())); // start computing CRC for any read/write on stack try { ino->get_fsa()->write(*pdesc.stack); } catch(...) { val = pdesc.stack->get_crc(); // this keeps "" in a coherent status throw; } val = pdesc.stack->get_crc(); ino->fsa_set_crc(*val); ino->fsa_detach(); ret = true; // compression is left suspended, save_inode, save_ea, will change or catalogue dump will change it if necessary } catch(...) { if(val != nullptr) delete val; throw; } if(val != nullptr) delete val; } else throw SRC_BUG; break; case cat_inode::fsa_partial: case cat_inode::fsa_none: break; default: throw SRC_BUG; } } catch(Ebug & e) { throw; } catch(Euser_abort & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { dialog.warning(string(gettext("Error saving Filesystem Specific Attributes for ")) + info_quoi + ": " + e.get_message()); } return ret; } static void do_EFSA_transfert(user_interaction &dialog, memory_pool *pool, over_action_ea action, cat_inode *place_ino, const cat_inode *add_ino) { ea_attributs *tmp_ea = nullptr; filesystem_specific_attribute_list *tmp_fsa = nullptr; switch(action) { case EA_overwrite: case EA_overwrite_mark_already_saved: case EA_merge_preserve: case EA_merge_overwrite: break; case EA_preserve: case EA_preserve_mark_already_saved: case EA_clear: throw SRC_BUG; default: throw SRC_BUG; } if(add_ino == nullptr) // to_add is not an inode thus cannot have any EA return; // we do nothing in any case as there is not different EA set in conflict if(place_ino == nullptr) // in_place is not an inode thus cannot have any EA return; // nothing can be done neither here as the resulting object (in_place) cannot handle EA // in the following we know that both in_place and to_add are inode, //we manipulate them thanks to their cat_inode * pointers (place_ino and add_ino) switch(action) // action concerns both EA and FSA in spite of the name of its values { case EA_overwrite: // overwriting last change date if(add_ino->has_last_change()) place_ino->set_last_change(add_ino->get_last_change()); // EA Consideration (for overwriting) switch(add_ino->ea_get_saved_status()) { case cat_inode::ea_none: case cat_inode::ea_removed: place_ino->ea_set_saved_status(cat_inode::ea_none); break; case cat_inode::ea_partial: case cat_inode::ea_fake: place_ino->ea_set_saved_status(cat_inode::ea_partial); break; case cat_inode::ea_full: tmp_ea = new (pool) ea_attributs(*add_ino->get_ea()); // we clone the EA of add_ino if(tmp_ea == nullptr) throw Ememory("filtre::do_EFSA_transfert"); try { if(place_ino->ea_get_saved_status() == cat_inode::ea_full) // then we must drop the old EA: place_ino->ea_detach(); else place_ino->ea_set_saved_status(cat_inode::ea_full); place_ino->ea_attach(tmp_ea); tmp_ea = nullptr; } catch(...) { if(tmp_ea != nullptr) { delete tmp_ea; tmp_ea = nullptr; } throw; } break; default: throw SRC_BUG; } // FSA Considerations (for overwriting) switch(add_ino->fsa_get_saved_status()) { case cat_inode::fsa_none: place_ino->fsa_set_saved_status(cat_inode::fsa_none); break; case cat_inode::fsa_partial: place_ino->fsa_set_saved_status(cat_inode::fsa_partial); break; case cat_inode::fsa_full: tmp_fsa = new (pool) filesystem_specific_attribute_list(*add_ino->get_fsa()); // we clone the FSA of add_ino if(tmp_fsa == nullptr) throw Ememory("filtre::do_EFSA_transfer"); try { if(place_ino->fsa_get_saved_status() == cat_inode::fsa_full) // we must drop the old FSA place_ino->fsa_detach(); else place_ino->fsa_set_saved_status(cat_inode::fsa_full); place_ino->fsa_attach(tmp_fsa); tmp_fsa = nullptr; } catch(...) { if(tmp_fsa != nullptr) { delete tmp_fsa; tmp_fsa = nullptr; } throw; } break; default: throw SRC_BUG; } break; // end of case EA_FSA_overwrite for action case EA_overwrite_mark_already_saved: // Overwriting Date if(add_ino->has_last_change()) place_ino->set_last_change(add_ino->get_last_change()); // EA considerations place_ino->ea_set_saved_status(add_ino->ea_get_saved_status()); // at this step, ea_full may be set, it will be changed to ea_partial below. if(place_ino->ea_get_saved_status() == cat_inode::ea_full || place_ino->ea_get_saved_status() == cat_inode::ea_fake) place_ino->ea_set_saved_status(cat_inode::ea_partial); // FSA considerations place_ino->fsa_set_saved_status(add_ino->fsa_get_saved_status()); // at this step fsa_full may be set, will be changed to fsa_partial below if(place_ino->fsa_get_saved_status() == cat_inode::fsa_full) place_ino->fsa_set_saved_status(cat_inode::fsa_partial); break; case EA_merge_preserve: // no last change date modification (preserve context) // EA considerations if(place_ino->ea_get_saved_status() == cat_inode::ea_full && add_ino->ea_get_saved_status() == cat_inode::ea_full) // we have something to merge { tmp_ea = new (pool) ea_attributs(); if(tmp_ea == nullptr) throw Ememory("filtre.cpp:do_EFSA_transfert"); try { merge_ea(*place_ino->get_ea(), *add_ino->get_ea(), *tmp_ea); place_ino->ea_detach(); place_ino->ea_attach(tmp_ea); tmp_ea = nullptr; } catch(...) { if(tmp_ea != nullptr) { delete tmp_ea; tmp_ea = nullptr; } throw; } } else if(add_ino->ea_get_saved_status() == cat_inode::ea_full) { place_ino->ea_set_saved_status(cat_inode::ea_full); // it was not the case else we would have executed the above block tmp_ea = new (pool) ea_attributs(*add_ino->get_ea()); // we clone the EA set of to_add if(tmp_ea == nullptr) throw Ememory("filtre.cpp:do_EFSA_transfert"); try { place_ino->ea_attach(tmp_ea); tmp_ea = nullptr; } catch(...) { if(tmp_ea != nullptr) { delete tmp_ea; tmp_ea = nullptr; } throw; } } // else nothing is done: either res_ino has full EA but ref_ino has not // or res_ino has not full EA nor do has ref_ino and nothing can be done neither // FSA considerations if(place_ino->fsa_get_saved_status() == cat_inode::fsa_full && add_ino->fsa_get_saved_status() == cat_inode::fsa_full) // we have something to merge { tmp_fsa = new (pool) filesystem_specific_attribute_list(); if(tmp_fsa == nullptr) throw Ememory("filtre.cpp::do_EFSA_transfer"); try { *tmp_fsa = *add_ino->get_fsa() + *place_ino->get_fsa(); // overwriting add_ino with place_ino's FSA place_ino->fsa_detach(); place_ino->fsa_attach(tmp_fsa); tmp_fsa = nullptr; } catch(...) { if(tmp_fsa != nullptr) { delete tmp_fsa; tmp_fsa = nullptr; } throw; } } else { if(add_ino->fsa_get_saved_status() == cat_inode::fsa_full) { place_ino->fsa_set_saved_status(cat_inode::fsa_full); tmp_fsa = new (pool) filesystem_specific_attribute_list(*add_ino->get_fsa()); if(tmp_fsa == nullptr) throw Ememory("filtre.cpp:do_EFSA_transfert"); try { place_ino->fsa_attach(tmp_fsa); tmp_fsa = nullptr; } catch(...) { if(tmp_fsa != nullptr) { delete tmp_fsa; tmp_fsa = nullptr; } throw; } } // else nothing to be done (in_place eventually has FSA and add_ino does nothing to add) } break; case EA_merge_overwrite: // last change date transfert if(add_ino->has_last_change()) place_ino->set_last_change(add_ino->get_last_change()); // EA considerations if(place_ino->ea_get_saved_status() == cat_inode::ea_full && add_ino->ea_get_saved_status() == cat_inode::ea_full) { tmp_ea = new (pool) ea_attributs(); if(tmp_ea == nullptr) throw Ememory("filtre.cpp:do_EFSA_transfert"); try { merge_ea(*add_ino->get_ea(), *place_ino->get_ea(), *tmp_ea); place_ino->ea_detach(); place_ino->ea_attach(tmp_ea); tmp_ea = nullptr; } catch(...) { if(tmp_ea != nullptr) { delete tmp_ea; tmp_ea = nullptr; } throw; } } else if(add_ino->ea_get_saved_status() == cat_inode::ea_full) { place_ino->ea_set_saved_status(cat_inode::ea_full); // it was not the case else we would have executed the above block tmp_ea = new (pool) ea_attributs(*add_ino->get_ea()); if(tmp_ea == nullptr) throw Ememory("filtre.cpp:do_EFSA_transfert"); try { place_ino->ea_attach(tmp_ea); tmp_ea = nullptr; } catch(...) { if(tmp_ea != nullptr) { delete tmp_ea; tmp_ea = nullptr; } throw; } } // else nothing is done: either res_ino has full EA but ref_ino has not // or res_ino has not full EA nor do has ref_ino and nothing can be done neither // FSA considerations if(place_ino->fsa_get_saved_status() == cat_inode::fsa_full && add_ino->fsa_get_saved_status() == cat_inode::fsa_full) // we have something to merge { tmp_fsa = new (pool) filesystem_specific_attribute_list(); if(tmp_fsa == nullptr) throw Ememory("filtre.cpp::do_EFSA_transfer"); try { *tmp_fsa = *place_ino->get_fsa() + *add_ino->get_fsa(); // overwriting place_ino with add_ino's FSA place_ino->fsa_detach(); place_ino->fsa_attach(tmp_fsa); tmp_fsa = nullptr; } catch(...) { if(tmp_fsa != nullptr) { delete tmp_fsa; tmp_fsa = nullptr; } throw; } } else { if(add_ino->fsa_get_saved_status() == cat_inode::fsa_full) { place_ino->fsa_set_saved_status(cat_inode::fsa_full); tmp_fsa = new (pool) filesystem_specific_attribute_list(*add_ino->get_fsa()); if(tmp_fsa == nullptr) throw Ememory("filtre.cpp:do_EFSA_transfert"); try { place_ino->fsa_attach(tmp_fsa); tmp_fsa = nullptr; } catch(...) { if(tmp_fsa != nullptr) { delete tmp_fsa; tmp_fsa = nullptr; } throw; } } // else nothing to be done (in_place eventually has FSA and add_ino does nothing to add) } break; default: throw SRC_BUG; } } static void merge_ea(const ea_attributs & ref1, const ea_attributs & ref2, ea_attributs &res) { string ent_key, ent_val; string val; res = ref1; // assignment operator res.reset_read(); ref2.reset_read(); while(ref2.read(ent_key, ent_val)) if(!res.find(ent_key, val)) res.add(ent_key, ent_val); } static cat_entree *make_clone(const cat_nomme *ref, memory_pool *pool, map & hard_link_base, const infinint & etiquette_offset) { cat_entree *dolly = nullptr; // will be the address of the cloned object string the_name; const cat_mirage *ref_mir = dynamic_cast(ref); if(ref == nullptr) throw SRC_BUG; the_name = ref->get_name(); if(ref_mir != nullptr) // this is hard linked inode { // check whether this is the first time we see this file (in list of file covered by the file masks) map ::iterator it = hard_link_base.find(ref_mir->get_etiquette() + etiquette_offset); if(it == hard_link_base.end()) // this inode has not been yet recorded in the resulting archive { cat_etoile *filante = nullptr; dolly = ref_mir->get_inode()->clone(); // we must clone the attached inode try { cat_inode *dollinode = dynamic_cast(dolly); if(dollinode == nullptr) throw Ememory("filtre:make_clone"); infinint shift_etiquette = ref_mir->get_etiquette() + etiquette_offset; filante = new (pool) cat_etoile(dollinode, shift_etiquette); if(filante == nullptr) throw Ememory("make_clone"); try { dolly = nullptr; // the inode is now managed by filante dolly = new (pool) cat_mirage(the_name, filante); if(dolly == nullptr) throw Ememory("make_clone"); try { hard_link_base[shift_etiquette] = filante; // we now record this file_etiquette in the map of already enrolled hard_link sets } catch(...) { filante = nullptr; // now managed by the cat_mirage pointed to by dolly throw; } } catch(...) { if(filante != nullptr) { delete filante; filante = nullptr; } throw; } } catch(...) { if(dolly != nullptr) { delete dolly; dolly = nullptr; } throw; } } else // already added to archive dolly = new (pool) cat_mirage(the_name, it->second); // we make a new cat_mirage pointing to the cat_etoile already involved in the catalogue under construction } else // not a hard_link file dolly = ref->clone(); // we just clone the entry if(dolly == nullptr) throw Ememory("make_clone"); return dolly; } static void clean_hard_link_base_from(const cat_mirage *mir, map & hard_link_base) { if(mir->get_etoile_ref_count().is_zero()) throw SRC_BUG; // count should be >= 1 if(mir->get_etoile_ref_count() == 1) { map::iterator it = hard_link_base.find(mir->get_etiquette()); const cat_inode *al_ptr_ino = mir->get_inode(); if(al_ptr_ino == nullptr) throw SRC_BUG; if(it == hard_link_base.end()) throw SRC_BUG; // the cat_etoile object pointed to by dolly_mir should be known by corres_copy hard_link_base.erase(it); } } static const crit_action *make_overwriting_for_only_deleted(memory_pool *pool) { const crit_action *ret = new (pool) testing(crit_invert(crit_in_place_is_inode()), crit_constant_action(data_preserve, EA_preserve), crit_constant_action(data_overwrite, EA_overwrite)); if(ret == nullptr) throw Ememory("make_overwriting_fir_only_deleted"); return ret; } } // end of namespace dar-2.5.3/src/libdar/user_interaction.hpp0000644000175000017430000006034612641773000015335 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file user_interaction.hpp /// \brief defines the interaction between libdar and the user. /// \ingroup API /// /// Three classes are defined /// - user_interaction is the root class that you can use to make your own classes /// - user_interaction_callback is a specialized inherited class which is implements /// user interaction thanks to callback functions /// - user_interaction_blind provides fully usable objects that do not show anything /// and always assume a negative answer from the user /// . /////////////////////////////////////////////////////////////////////// // IMPORTANT : THIS FILE MUST ALWAYS BE INCLUDE AFTER infinint.hpp // // (and infinint.hpp must be included too, always) // /////////////////////////////////////////////////////////////////////// #include "infinint.hpp" /////////////////////////////////////////////////////////////////////// #ifndef USER_INTERACTION_HPP #define USER_INTERACTION_HPP #include "../my_config.h" #include #include "erreurs.hpp" #include "integers.hpp" #include "secu_string.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup API /// @{ /// This is a pure virtual class that is used by libdar when interaction with the user is required. //! You can base your own class on it using C++ inheritance //! or use the class user_interaction_callback which implements //! the interaction based on callback functions. //! The user_interaction class is used by libdar in the following circumpstances: //! - when is required a boolean answer to a question the pause() method is used //! - when a warning needs to be displayed to the user the warning() method is used //! - when a directory listing needs to be returned to the user the listing() method is used //! . //! the printf() method is built over the warning() methods to display a formated message //! it has not to be redefined in any inherited class. //! If you want to define you own class as inherited class of user_interaction //! you need to overwrite: //! - the clone() method. It is used to make local temporary copies of objets //! in libdar. It acts like the constructor copy but is virtual. //! - the pause() method //! - the warning() method //! - the listing() method (this is not mandatory). inherited classes *can* //! overwrite the listing() method, which will be used if the use_listing //! is set to true thanks to the set_use_listing() protected method. //! In that case the listing of archive contents is done thanks to this listing() //! method instead of the warning() method. //! - get_string() method //! - get_secu_string() method //! . //! WARNING ! //! if your own class has specific fields, you will probably //! need to redefine the copy constructor as well as operator = //! if you don't understand this and why, don't play trying making your //! own class, and/or read good C++ book about canonical form //! of a C++ class, as well as how to properly make an inherited class. //! And don't, complain if libdar segfault or core dumps. Libdar //! *needs* to make local copies of these objects, if the copy constructor //! is not properly defined in your inherited class this will crash the application. //! \ingroup API class user_interaction : public on_pool { public: /// class constructor. user_interaction(); virtual ~user_interaction() {}; /// method used to ask a boolean question to the user. //! \param[in] message is the message to be displayed, that is the question. //! \exception Euser_abort If the user answer "false" or "no" to the question the method //! must throw an exception of type "Euser_abort". virtual void pause(const std::string & message) { if(!pause2(message)) throw Euser_abort(message); }; /// alternative method to the pause() method //! \param[in] message The boolean question to ask to the user //! \return the answer of the user (true/yes or no/false) //! \note either pause2() or pause() *must* be overwritten, but not both. //! libdar always calls pause() which default implementation relies on pause2() where it converts negative //! return from pause2() by throwing the appropriated exception. As soon as you overwrite pause(), //! pause2() is no more used. virtual bool pause2(const std::string & message) { throw Elibcall("user_interaction::pause2", "user_interaction::pause() or pause2() must be overwritten !"); }; /// \brief method used to display a warning or a message to the user. /// /// \param[in] message is the message to display. /// \note since API 3.1.x this method must no more be ovewritten, instead /// the protected method inherited_warning() must be used. void warning(const std::string & message); /// method used to ask a question that needs an arbitrary answer. //! \param[in] message is the question to display to the user. //! \param[in] echo is set to false is the answer must not be shown while the user answers. //! \return the user's answer. virtual std::string get_string(const std::string & message, bool echo) = 0; /// same a get_string() but uses secu_string instead //! \param[in] message is the question to display to the user. //! \param[in] echo is set to false is the answer must not be shown while the user answers. //! \return the user's answer. virtual secu_string get_secu_string(const std::string & message, bool echo) = 0; /// optional method to use if you want file listing splitted in several fields. /// If you need to use this feature, you have then to supply an implementation for this method, /// in your inherited class which will be called by libdar in place of the warning method /// You then also have to call the set_use_listing() method with true as parameter /// from the constructor of your inherited class (for example) to tell libdar that the listing() method is /// to be used in place of the warning() method for archive listing. //! \param[in] flag is the given information about the EA, compression, presence of saved data. //! \param[in] perm is the access permission of the file. //! \param[in] uid User ID of the file. //! \param[in] gid Group ID of the file. //! \param[in] size file size. //! \param[in] date file modification date. //! \param[in] filename file name. //! \param[in] is_dir true if file is a directory. //! \param[in] has_children true if file is a directory which is not empty. //! \note This is not a pure virtual method, this is normal, //! so your inherited class is not obliged to overwrite it. virtual void listing(const std::string & flag, const std::string & perm, const std::string & uid, const std::string & gid, const std::string & size, const std::string & date, const std::string & filename, bool is_dir, bool has_children); /// optional method to use if you want dar_manager database contents listing split in several fields. /// if you want to use this feature, you have then to supply an implementation for this method /// in your inherited class, method that will be called by libdar in place of the warning method. /// You will also have to call the set_use_dar_manager_show_files() protected method with true as argument /// from the constructor of your inherited class to tell libdar to use the dar_manager_show_files() /// method in place of the warning() method. /// \param[in] filename name of the file /// \param[in] data_change whether the backup owns the most recent data for the file /// \param[in] ea_change whether the backup owns the most recent Extended Attributes for the file /// \note this method can be set for database::show_files() method to call it virtual void dar_manager_show_files(const std::string & filename, bool data_change, bool ea_change); /// optional method to use if you want dar_manager database archive listing split in several fields /// if you want to use this feature, you have then to supply an implementation for this method /// in your inherited class, method that will be called by libdar in place of the warning method. /// You will also have to call the set_use_dar_manager_contents() protected method with true as argument /// from the constructor of your inherited class to tell libdar to use the dar_manager_contents() /// method in place of the warning() method. /// \param[in] number is the number of the archive in the database /// \param[in] chemin recorded path where to find this archive /// \param[in] archive_name basename of this archive /// \note this method can be set for database::show_contents() to call it virtual void dar_manager_contents(U_I number, const std::string & chemin, const std::string & archive_name); /// optional method to use if you want dar_manager statistics listing split in several fields /// if you want to use this feature, you have then to supply an implementation for this method /// in your inherited class, method that will be called by libdar in place of the warning method. /// You will also have to call the set_use_dar_manager_statistics() protected method with true as argument /// from the constructor of your inherited class to tell libdar to use the dar_manager_statistics() /// method in place of the warning() method. /// \param[in] number archive number /// \param[in] data_count amount of file which last version is located in this archive /// \param[in] total_data total number of file covered in this database /// \param[in] ea_count amount of EA which last version is located in this archive /// \param[in] total_ea total number of file that have EA covered by this database /// \note this method can be set for database::show_most_recent_stats() method to call it virtual void dar_manager_statistics(U_I number, const infinint & data_count, const infinint & total_data, const infinint & ea_count, const infinint & total_ea); /// optional method to use if you want dar_manager statistics listing split in several fields /// if you want to use this feature, you have then to supply an implementation for this method /// in your inherited class, method that will be called by libdar in place of the warning method. /// You will also have to call the set_use_dar_manager_show_version() protected method with true as argument /// from the constructor of your inherited class to tell libdar to use the dar_manager_show_version() /// method in place of the warning() method. /// \param[in] number archive number /// \param[in] data_date is the last modification date of the requested file in thie archive whose number is "number" /// \param[in] data_presence is the nature of this modification, true if the data was saved, false if it was deleted /// \param[in] ea_date is the date of the EA for the requested file in the archive whose number is "number" /// \param[in] ea_presence is the nature of this modification, true if the EAs were saved, false if they were deleted /// \note this method can be set for database::show_version() method to call it virtual void dar_manager_show_version(U_I number, const std::string & data_date, const std::string & data_presence, const std::string & ea_date, const std::string & ea_presence); /// libdar uses this call to format output before send to warning() method. //! This is not a virtual method, it has not to be overwritten, it is //! just a sublayer over warning() //! Supported masks for the format string are: //! - \%s \%c \%d \%\% (normal behavior) //! - \%i (matches infinint *) //! - \%S (matches std::string *) //! . void printf(const char *format, ...); /// for libdar to know if it is interesting to use listing(), dar_manager_show_files(), /// dar_manager_contents(), dar_manager_statistics() or to keep reporting listing thanks /// to the warning() method, //! this is not a virtual method, it has not to be overwritten in inherited classes. bool get_use_listing() const { return use_listing; }; //! this is not a virtual method, it has not to be overwritten in inherited classes. bool get_use_dar_manager_show_files() const { return use_dar_manager_show_files; }; //! this is not a virtual method, it has not to be overwritten in inherited classes. bool get_use_dar_manager_contents() const { return use_dar_manager_contents; }; //! this is not a virtual method, it has not to be overwritten in inherited classes. bool get_use_dar_manager_statistics() const { return use_dar_manager_statistics; }; //! this is not a virtual method, it has not to be overwritten in inherited classes. bool get_use_dar_manager_show_version() const { return use_dar_manager_show_version; }; /// make a newly allocated object which has the same properties as "this". //! This *is* a virtual method, it *must* be overwritten in any inherited class //! copy constructor and = operator may have to be overwritten too if necessary //! Warning ! //! clone() must throw exception if necessary (Ememory), but never //! return a nullptr pointer ! virtual user_interaction *clone() const = 0; /// make a pause each N line of output when calling the warning method //! \param[in] num is the number of line to display at once, zero for unlimited display //! \note. Since API 3.1, the warning method is no more a pure virtual function //! you need to call the parent warning method in your method for this warning_with_more //! method works as expected. void warning_with_more(U_I num) { at_once = num; count = 0; }; protected: /// method to be called with true as argument if you have defined a listing() method. //! in the constructor of any inherited class that define a listing() method //! it is advisable to call set_use_listing() with true as argument for libdar //! knows that the listing() call has to be used in place of the warning() call //! for file listing. void set_use_listing(bool val) { use_listing = val; }; /// method to be called with true as argument if you have defined a dar_manager_show_files() method. void set_use_dar_manager_show_files(bool val) { use_dar_manager_show_files = val; }; /// method to be called with true as argument if you have defined a dar_manager_contents() method. void set_use_dar_manager_contents(bool val) { use_dar_manager_contents = val; }; /// method to be called with true as argument if you have defined a dar_manager_statistics() method. void set_use_dar_manager_statistics(bool val) { use_dar_manager_statistics = val; }; /// method to be called with true as argument if you have defined a dar_manager_show_version() method. void set_use_dar_manager_show_version(bool val) { use_dar_manager_show_version = val; }; /// need to be overwritten in place of the warning() method since API 3.1.x /// \param[in] message message to display /// virtual void inherited_warning(const std::string & message) = 0; private: bool use_listing; bool use_dar_manager_show_files; bool use_dar_manager_contents; bool use_dar_manager_statistics; bool use_dar_manager_show_version; U_I at_once, count; }; /// full implemented class for user_interaction based on callback functions. //! this class is an inherited class of user_interaction it is used by //! dar command line programs, but you can use it if you wish. //! \ingroup API class user_interaction_callback : public user_interaction { public: /// constructor which receive the callback functions. //! \param[in] x_warning_callback is used by warning() method //! \param[in] x_answer_callback is used by the pause() method //! \param[in] x_string_callback is used by get_string() method //! \param[in] x_secu_string_callback is used by get_secu_string() method //! \param[in] context_value will be passed as last argument of callbacks when //! called from this object. //! \note The context argument of each callback is set with the context_value given //! in the user_interaction_callback object constructor. The value can //! can be any arbitrary value (nullptr is valid), and can be used as you wish. //! Note that the listing callback is not defined here, but thanks to a specific method user_interaction_callback(void (*x_warning_callback)(const std::string &x, void *context), bool (*x_answer_callback)(const std::string &x, void *context), std::string (*x_string_callback)(const std::string &x, bool echo, void *context), secu_string (*x_secu_string_callback)(const std::string &x, bool echo, void *context), void *context_value); /// overwritting method from parent class. void pause(const std::string & message); /// overwritting method from parent class. std::string get_string(const std::string & message, bool echo); /// overwritting method from parent class. secu_string get_secu_string(const std::string & message, bool echo); /// overwritting method from parent class. void listing(const std::string & flag, const std::string & perm, const std::string & uid, const std::string & gid, const std::string & size, const std::string & date, const std::string & filename, bool is_dir, bool has_children); /// overwritting method from parent class void dar_manager_show_files(const std::string & filename, bool available_data, bool available_ea); /// overwritting method from parent class void dar_manager_contents(U_I number, const std::string & chemin, const std::string & archive_name); /// overwritting method from parent class void dar_manager_statistics(U_I number, const infinint & data_count, const infinint & total_data, const infinint & ea_count, const infinint & total_ea); /// overwritting method from parent class void dar_manager_show_version(U_I number, const std::string & data_date, const std::string & data_presence, const std::string & ea_date, const std::string & ea_presence); /// You can set a listing callback thanks to this method. //! If set, when file listing will this callback function will //! be used instead of the x_warning_callback given as argument //! of the constructor. void set_listing_callback(void (*callback)(const std::string & flag, const std::string & perm, const std::string & uid, const std::string & gid, const std::string & size, const std::string & date, const std::string & filename, bool is_dir, bool has_children, void *context)) { tar_listing_callback = callback; set_use_listing(true); // this is to inform libdar to use listing() }; // You can set a dar_manager_show_files callback thanks to this method void set_dar_manager_show_files_callback(void (*callback)(const std::string & filename, bool available_data, bool available_ea, void *context)) { dar_manager_show_files_callback = callback; set_use_dar_manager_show_files(true); // this is to inform libdar to use the dar_manager_show_files() method }; void set_dar_manager_contents_callback(void (*callback)(U_I number, const std::string & chemin, const std::string & archive_name, void *context)) { dar_manager_contents_callback = callback; set_use_dar_manager_contents(true); // this is to inform libdar to use the dar_manager_contents() method }; void set_dar_manager_statistics_callback(void (*callback)(U_I number, const infinint & data_count, const infinint & total_data, const infinint & ea_count, const infinint & total_ea, void *context)) { dar_manager_statistics_callback = callback; set_use_dar_manager_statistics(true); // this is to inform libdar to use the dar_manager_statistics() method }; void set_dar_manager_show_version_callback(void (*callback)(U_I number, const std::string & data_date, const std::string & data_presence, const std::string & ea_date, const std::string & ea_presence, void *context)) { dar_manager_show_version_callback = callback; set_use_dar_manager_show_version(true); // this is to inform libdar to use the dar_manager_show_version() method }; /// overwritting method from parent class. virtual user_interaction *clone() const; protected: /// change the context value of the object that will be given to callback functions void change_context_value(void *new_value) { context_val = new_value; }; /// overwritting method from parent class. void inherited_warning(const std::string & message); private: void (*warning_callback)(const std::string & x, void *context); // pointer to function bool (*answer_callback)(const std::string & x, void *context); // pointer to function std::string (*string_callback)(const std::string & x, bool echo, void *context); // pointer to function secu_string (*secu_string_callback)(const std::string & x, bool echo, void *context); // pointer to function void (*tar_listing_callback)(const std::string & flags, const std::string & perm, const std::string & uid, const std::string & gid, const std::string & size, const std::string & date, const std::string & filename, bool is_dir, bool has_children, void *context); void (*dar_manager_show_files_callback)(const std::string & filename, bool available_data, bool available_ea, void *context); void (*dar_manager_contents_callback)(U_I number, const std::string & chemin, const std::string & archive_name, void *context); void (*dar_manager_statistics_callback)(U_I number, const infinint & data_count, const infinint & total_data, const infinint & ea_count, const infinint & total_ea, void *context); void (*dar_manager_show_version_callback)(U_I number, const std::string & data_date, const std::string & data_presence, const std::string & ea_date, const std::string & ea_presence, void *context); void *context_val; }; /// full implementation class for user_interaction, which shows nothing and assumes answer "no" to any question class user_interaction_blind : public user_interaction { public: bool pause2(const std::string & message) { return false; }; std::string get_string(const std::string & message, bool echo) { return "user_interaction_blind, is blindly answering no"; }; secu_string get_secu_string(const std::string & message, bool echo) { return secu_string(); }; user_interaction *clone() const { user_interaction *ret = new (get_pool()) user_interaction_blind(); if(ret == nullptr) throw Ememory("user_interaction_blind::clone"); return ret; }; protected: void inherited_warning(const std::string & message) {}; // do not display any warning, this is "bind user_interaction" ! }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/infinint.hpp0000644000175000017520000000276712610405012013570 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file infinint.hpp /// \brief switch module to limitint (32 ou 64 bits integers) or infinint /// \ingroup Private #ifndef INFININT_HPP #define INFININT_HPP #ifndef LIBDAR_MODE #include "real_infinint.hpp" #else #if LIBDAR_MODE == 32 #define INFININT_BASE_TYPE U_32 #include "integers.hpp" #include "limitint.hpp" # else #if LIBDAR_MODE == 64 #define INFININT_BASE_TYPE U_64 #include "integers.hpp" #include "limitint.hpp" #else #include "real_infinint.hpp" #endif #endif #endif #endif dar-2.5.3/src/libdar/cat_prise.cpp0000644000175000017430000000260312641772777013740 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_prise.hpp" using namespace std; namespace libdar { bool cat_prise::operator == (const cat_entree & ref) const { const cat_prise *ref_prise = dynamic_cast(&ref); if(ref_prise == nullptr) return false; else return cat_inode::operator == (ref); } } // end of namespace dar-2.5.3/src/libdar/archive.cpp0000644000175000017430000022540312642474445013405 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif } // extern "C" #include "infinint.hpp" #include "generic_file.hpp" #include "archive.hpp" #include "sar.hpp" #include "macro_tools.hpp" #include "filtre.hpp" #include "sar.hpp" #include "trivial_sar.hpp" #include "tools.hpp" #include "header.hpp" #include "header_version.hpp" #include "scrambler.hpp" #include "null_file.hpp" #include "crypto.hpp" #include "elastic.hpp" #include "terminateur.hpp" #include "compressor.hpp" #include "nls_swap.hpp" #include "thread_cancellation.hpp" #include "erreurs_ext.hpp" #include "cache.hpp" #include "entrepot.hpp" #include "entrepot_local.hpp" #include "crypto_sym.hpp" #include "cat_all_entrees.hpp" #define ARCHIVE_NOT_EXPLOITABLE "Archive of reference given is not exploitable" using namespace std; namespace libdar { static void check_libgcrypt_hash_bug(user_interaction & dialog, hash_algo hash, const infinint & first_file_size, const infinint & file_size); // opens an already existing archive archive::archive(user_interaction & dialog, const path & chem, const std::string & basename, const std::string & extension, const archive_options_read & options) { NLS_SWAP_IN; try { entrepot *where = options.get_entrepot().clone(); bool info_details = options.get_info_details(); if(where == nullptr) throw Ememory("archive::archive"); pool = nullptr; cat = nullptr; freed_and_checked = false; try { infinint second_terminateur_offset = 0; infinint ref_second_terminateur_offset = 0; header_version ref_ver; pile_descriptor pdesc; list tmp1_signatories; list tmp2_signatories; lax_read_mode = options.get_lax(); sequential_read = options.get_sequential_read(); // updating the archive object's field where->set_location(chem); init_pool(); try { if(info_details) dialog.printf(gettext("Opening archive %s ..."), basename.c_str()); // we open the main archive to get the different layers (level1, scram and level2). macro_tools_open_archive(dialog, pool, *where, basename, options.get_slice_min_digits(), extension, options.get_crypto_algo(), options.get_crypto_pass(), options.get_crypto_size(), stack, ver, options.get_input_pipe(), options.get_output_pipe(), options.get_execute(), second_terminateur_offset, options.get_lax(), options.is_external_catalogue_set(), options.get_sequential_read(), options.get_info_details(), gnupg_signed, slices, options.get_multi_threaded()); pdesc = pile_descriptor(&stack); if(options.is_external_catalogue_set()) { pile ref_stack; entrepot *ref_where = options.get_ref_entrepot().clone(); if(ref_where == nullptr) throw Ememory("archive::archive"); if(info_details) dialog.printf(gettext("Opening the archive of reference %s to retreive the isolated catalog ... "), options.get_ref_basename().c_str()); try { ref_where->set_location(options.get_ref_path()); try { slice_layout ignored; if(options.get_ref_basename() == "-") throw Erange("archive::archive", gettext("Reading the archive of reference from pipe or standard input is not possible")); if(options.get_ref_basename() == "+") throw Erange("archive::archive", gettext("The basename '+' is reserved for special a purpose that has no meaning in this context")); // we open the archive of reference also to get its different layers (ref_stack) macro_tools_open_archive(dialog, pool, *ref_where, options.get_ref_basename(), options.get_ref_slice_min_digits(), extension, options.get_ref_crypto_algo(), options.get_ref_crypto_pass(), options.get_ref_crypto_size(), ref_stack, ref_ver, "", "", options.get_ref_execute(), ref_second_terminateur_offset, options.get_lax(), false, // has an external catalogue false, // sequential_read is never used to retreive the isolated catalogue (well, that's possible and easy to add this feature), see later ... options.get_info_details(), tmp1_signatories, ignored, options.get_multi_threaded()); // we do not comparing the signatories of the archive of reference with the current archive // for example the isolated catalogue might be unencrypted and thus not signed } catch(Euser_abort & e) { throw; } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { throw Erange("archive::archive", string(gettext("Error while opening the archive of reference: ")) + e.get_message()); } } catch(...) { if(ref_where != nullptr) delete ref_where; throw; } if(ref_where != nullptr) delete ref_where; // fetching the catalogue in the archive of reference, making it point on the main archive layers. ref_ver.set_compression_algo(ver.get_compression_algo()); // set the default encryption to use to the one of the main archive if(info_details) dialog.warning(gettext("Loading isolated catalogue in memory...")); cat = macro_tools_get_derivated_catalogue_from(dialog, pool, stack, ref_stack, ref_ver, options.get_info_details(), local_cat_size, ref_second_terminateur_offset, tmp2_signatories, false); // never relaxed checking for external catalogue if(!same_signatories(tmp1_signatories, tmp2_signatories)) dialog.pause(gettext("Archive of reference is not signed properly (no the same signatories for the archive and the internal catalogue), do we continue?")); if(cat == nullptr) throw SRC_BUG; // checking for compatibility of the archive of reference with this archive data_name if(get_layer1_data_name() != get_catalogue_data_name()) throw Erange("archive::archive", gettext("The archive and the isolated catalogue do not correspond to the same data, they are thus incompatible between them")); } else // no isolated archive to fetch the catalogue from { try { if(!options.get_sequential_read()) { if(info_details) dialog.warning(gettext("Loading catalogue into memory...")); cat = macro_tools_get_catalogue_from(dialog, pool, stack, ver, options.get_info_details(), local_cat_size, second_terminateur_offset, tmp1_signatories, options.get_lax()); if(!same_signatories(tmp1_signatories, gnupg_signed)) { string msg = gettext("Archive internal catalogue is not identically signed as the archive itself, this might be the sign the archive has been compromised"); if(lax_read_mode) dialog.pause(msg); else throw Edata(msg); } } else // sequentially reading { if(pdesc.esc != nullptr) // no escape layer is present { if(pdesc.esc->skip_to_next_mark(escape::seqt_catalogue, false)) { if(info_details) dialog.warning(gettext("No data found in that archive, sequentially reading the catalogue found at the end of the archive...")); pdesc.stack->flush_read_above(pdesc.esc); contextual *layer1 = nullptr; label lab = label_zero; stack.find_first_from_bottom(layer1); if(layer1 != nullptr) lab = layer1->get_data_name(); cat = macro_tools_read_catalogue(dialog, pool, ver, pdesc, 0, // cannot determine cat_size at this stage tmp1_signatories, options.get_lax(), lab, false); // only_detruits if(!same_signatories(tmp1_signatories, gnupg_signed)) { string msg = gettext("Archive internal catalogue is not identically signed as the archive itself, this might be the sign the archive has been compromised"); if(lax_read_mode) dialog.pause(msg); else throw Edata(msg); } } else { if(info_details) dialog.warning(gettext("The catalogue will be filled while sequentially reading the archive, preparing the data structure...")); cat = new (pool) escape_catalogue(dialog, pdesc, ver, gnupg_signed, options.get_lax()); } if(cat == nullptr) throw Ememory("archive::archive"); } else throw SRC_BUG; } } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Euser_abort & e) { throw; } catch(Ememory & e) { throw; } catch(...) { if(!options.get_lax()) throw; else // we have tried and failed to read the whole catalogue, now trying to workaround data corruption if possible { if(options.get_sequential_read()) throw; else // legacy extraction of the catalogue (not sequential mode) { dialog.printf(gettext("LAX MODE: The end of the archive is corrupted, cannot get the archive contents (the \"catalogue\")")); dialog.pause(gettext("LAX MODE: Do you want to bypass some sanity checks and try again reading the archive contents (this may take some time, this may also fail)?")); try { label tmp; tmp.clear(); // this way we do not modify the catalogue data name even in lax mode cat = macro_tools_lax_search_catalogue(dialog, pool, stack, ver.get_edition(), ver.get_compression_algo(), options.get_info_details(), false, // even partial tmp); } catch(Erange & e) { dialog.printf(gettext("LAX MODE: Could not find a whole catalogue in the archive. If you have an isolated catalogue, stop here and use it as backup of the internal catalogue, else continue but be advised that all data will not be able to be retrieved...")); dialog.pause(gettext("LAX MODE: Do you want to try finding portions of the original catalogue if some remain (this may take even more time and in any case, it will only permit to recover some files, at most)?")); cat = macro_tools_lax_search_catalogue(dialog, pool, stack, ver.get_edition(), ver.get_compression_algo(), options.get_info_details(), true, // even partial get_layer1_data_name()); } } } } } if(!options.get_ignore_signature_check_failure()) check_gnupg_signed(dialog); exploitable = true; } catch(...) { if(where != nullptr) delete where; throw; } if(where != nullptr) delete where; } catch(...) { free_all(); throw; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } // creates a new archive archive::archive(user_interaction & dialog, const path & fs_root, const path & sauv_path, const string & filename, const string & extension, const archive_options_create & options, statistics * progressive_report) { NLS_SWAP_IN; try { pool = nullptr; cat = nullptr; freed_and_checked = false; init_pool(); try { entrepot *sauv_path_t = options.get_entrepot().clone(); if(sauv_path_t == nullptr) throw Ememory("archive::archive"); sauv_path_t->set_user_ownership(options.get_slice_user_ownership()); sauv_path_t->set_group_ownership(options.get_slice_group_ownership()); sauv_path_t->set_location(sauv_path); try { sequential_read = false; // updating the archive field (void)op_create_in(dialog, oper_create, tools_relative2absolute_path(fs_root, tools_getcwd()), *sauv_path_t, options.get_reference(), options.get_selection(), options.get_subtree(), filename, extension, options.get_allow_over(), options.get_warn_over(), options.get_info_details(), options.get_display_treated(), options.get_display_treated_only_dir(), options.get_display_skipped(), options.get_display_finished(), options.get_pause(), options.get_empty_dir(), options.get_compression(), options.get_compression_level(), options.get_slice_size(), options.get_first_slice_size(), options.get_ea_mask(), options.get_execute(), options.get_crypto_algo(), options.get_crypto_pass(), options.get_crypto_size(), options.get_gnupg_recipients(), options.get_gnupg_signatories(), options.get_compr_mask(), options.get_min_compr_size(), options.get_nodump(), options.get_exclude_by_ea(), options.get_hourshift(), options.get_empty(), options.get_alter_atime(), options.get_furtive_read_mode(), options.get_same_fs(), options.get_comparison_fields(), options.get_snapshot(), options.get_cache_directory_tagging(), options.get_fixed_date(), options.get_slice_permission(), options.get_repeat_count(), options.get_repeat_byte(), options.get_sequential_marks(), options.get_security_check(), options.get_sparse_file_min_size(), options.get_user_comment(), options.get_hash_algo(), options.get_slice_min_digits(), options.get_backup_hook_file_execute(), options.get_backup_hook_file_mask(), options.get_ignore_unknown_inode_type(), options.get_fsa_scope(), options.get_multi_threaded(), progressive_report); exploitable = false; stack.terminate(); } catch(...) { if(sauv_path_t != nullptr) delete sauv_path_t; throw; } if(sauv_path_t != nullptr) delete sauv_path_t; } catch(...) { free_all(); throw; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } // DEPRECATED way to isolate an archive DO NOT USE IT unless you know what you are doing. // RATHER use op_isolate() on an existing archive object archive::archive(user_interaction & dialog, const path & sauv_path, archive *ref_arch, const std::string & filename, const std::string & extension, const archive_options_isolate & options) { pool = nullptr; cat = nullptr; local_cat_size = 0; exploitable = false; lax_read_mode = false; sequential_read = false; freed_and_checked = true; if(ref_arch == nullptr) throw Elibcall("deprecated isolate constructor", "nullptr argument given to \"ref_arch\""); ref_arch->op_isolate(dialog, sauv_path, filename, extension, options); } // merge constructor archive::archive(user_interaction & dialog, const path & sauv_path, archive *ref_arch1, const std::string & filename, const std::string & extension, const archive_options_merge & options, statistics * progressive_report) { statistics st = false; statistics *st_ptr = progressive_report == nullptr ? &st : progressive_report; catalogue *ref_cat1 = nullptr; catalogue *ref_cat2 = nullptr; archive *ref_arch2 = options.get_auxilliary_ref(); compression algo_kept = none; entrepot *sauv_path_t = options.get_entrepot().clone(); entrepot_local *sauv_path_t_local = dynamic_cast(sauv_path_t); freed_and_checked = false; NLS_SWAP_IN; try { pool = nullptr; cat = nullptr; init_pool(); try { if(sauv_path_t == nullptr) throw Ememory("archive::archive(merge)"); sauv_path_t->set_user_ownership(options.get_slice_user_ownership()); sauv_path_t->set_group_ownership(options.get_slice_group_ownership()); sauv_path_t->set_location(sauv_path); try { exploitable = false; sequential_read = false; // updating the archive field // sanity checks as much as possible to avoid libdar crashing due to bad arguments // useless arguments are not reported. if(options.get_compression_level() > 9 || options.get_compression_level() < 1) throw Elibcall("op_merge", gettext("Compression_level must be between 1 and 9 included")); if(options.get_slice_size().is_zero() && !options.get_first_slice_size().is_zero()) throw Elibcall("op_merge", gettext("\"first_file_size\" cannot be different from zero if \"file_size\" is equal to zero")); if(options.get_crypto_size() < 10 && options.get_crypto_algo() != crypto_none) throw Elibcall("op_merge", gettext("Crypto block size must be greater than 10 bytes")); check_libgcrypt_hash_bug(dialog, options.get_hash_algo(), options.get_first_slice_size(), options.get_slice_size()); if(ref_arch1 != nullptr) if(ref_arch1->only_contains_an_isolated_catalogue()) // convert all data to unsaved ref_arch1->set_to_unsaved_data_and_FSA(); if(ref_arch2 != nullptr) if(ref_arch2->only_contains_an_isolated_catalogue()) ref_arch2->set_to_unsaved_data_and_FSA(); // end of sanity checks sauv_path_t->set_location(sauv_path); if(!options.get_empty() && sauv_path_t_local != nullptr) tools_avoid_slice_overwriting_regex(dialog, sauv_path, string("^")+filename+"\\.[0-9]+\\."+extension+"(\\.(md5|sha1))?$", options.get_info_details(), options.get_allow_over(), options.get_warn_over(), options.get_empty()); if(ref_arch1 == nullptr) if(ref_arch2 == nullptr) throw Elibcall("archive::archive[merge]", string(gettext("Both reference archive are nullptr, cannot merge archive from nothing"))); else if(ref_arch2->cat == nullptr) throw SRC_BUG; // an archive should always have a catalogue available else if(ref_arch2->exploitable) ref_cat1 = ref_arch2->cat; else throw Elibcall("archive::archive[merge]", gettext(ARCHIVE_NOT_EXPLOITABLE)); else if(ref_arch2 == nullptr) if(ref_arch1->cat == nullptr) throw SRC_BUG; // an archive should always have a catalogue available else if(ref_arch1->exploitable) ref_cat1 = ref_arch1->cat; else throw Elibcall("archive::archive[merge]", gettext(ARCHIVE_NOT_EXPLOITABLE)); else // both catalogues available { if(!ref_arch1->exploitable || !ref_arch2->exploitable) throw Elibcall("archive::archive[merge]", gettext(ARCHIVE_NOT_EXPLOITABLE)); if(ref_arch1->cat == nullptr) throw SRC_BUG; if(ref_arch2->cat == nullptr) throw SRC_BUG; ref_cat1 = ref_arch1->cat; ref_cat2 = ref_arch2->cat; if(ref_arch1->ver.get_compression_algo() != ref_arch2->ver.get_compression_algo() && ref_arch1->ver.get_compression_algo() != none && ref_arch2->ver.get_compression_algo() != none && options.get_keep_compressed()) throw Efeature(gettext("the \"Keep file compressed\" feature is not possible when merging two archives using different compression algorithms (This is for a future version of dar). You can still merge these two archives but without keeping file compressed (thus you will probably like to use compression (-z or -y options) for the resulting archive")); } if(options.get_keep_compressed()) { if(ref_arch1 == nullptr) throw SRC_BUG; algo_kept = ref_arch1->ver.get_compression_algo(); if(algo_kept == none && ref_cat2 != nullptr) { if(ref_arch2 == nullptr) throw SRC_BUG; else algo_kept = ref_arch2->ver.get_compression_algo(); } } if(ref_cat1 == nullptr) throw SRC_BUG; // then we call op_create_in_sub which will call filter_merge operation to build the archive described by the catalogue op_create_in_sub(dialog, oper_merge, path(FAKE_ROOT), *sauv_path_t, ref_cat1, ref_cat2, false, // initial_pause options.get_selection(), options.get_subtree(), filename, extension, options.get_allow_over(), options.get_overwriting_rules(), options.get_warn_over(), options.get_info_details(), options.get_display_treated(), options.get_display_treated_only_dir(), options.get_display_skipped(), false, // display_finished options.get_pause(), options.get_empty_dir(), options.get_keep_compressed() ? algo_kept : options.get_compression(), options.get_compression_level(), options.get_slice_size(), options.get_first_slice_size(), options.get_ea_mask(), options.get_execute(), options.get_crypto_algo(), options.get_crypto_pass(), options.get_crypto_size(), options.get_gnupg_recipients(), options.get_gnupg_signatories(), options.get_compr_mask(), options.get_min_compr_size(), false, // nodump "", // exclude_by_ea 0, // hourshift options.get_empty(), true, // alter_atime false, // furtive_read_mode false, // same_fs cat_inode::cf_all, // what_to_check false, // snapshot false, // cache_directory_tagging options.get_keep_compressed(), 0, // fixed_date options.get_slice_permission(), 0, // repeat_count 0, // repeat_byte options.get_decremental_mode(), options.get_sequential_marks(), false, // security_check options.get_sparse_file_min_size(), options.get_user_comment(), options.get_hash_algo(), options.get_slice_min_digits(), "", // backup_hook_file_execute bool_mask(false), //backup_hook_file_mask false, options.get_fsa_scope(), options.get_multi_threaded(), st_ptr); exploitable = false; stack.terminate(); } catch(...) { if(sauv_path_t != nullptr) delete sauv_path_t; throw; } if(sauv_path_t != nullptr) delete sauv_path_t; sauv_path_t = nullptr; } catch(...) { free_all(); throw; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } statistics archive::op_extract(user_interaction & dialog, const path & fs_root, const archive_options_extract & options, statistics * progressive_report) { statistics st = false; // false => no lock for this internal object statistics *st_ptr = progressive_report == nullptr ? &st : progressive_report; NLS_SWAP_IN; try { // sanity checks if(freed_and_checked) throw Erange("catalogue::op_extract", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(!exploitable) throw Elibcall("op_extract", gettext("This archive is not exploitable, check documentation for more")); check_against_isolation(dialog, lax_read_mode); // this avoid to try extracting archive directly from an isolated catalogue // the isolated catalogue can be used to extract data (since format "08") but only // associated with the real plain archive, not alone. // end of sanity checks fs_root.explode_undisclosed(); enable_natural_destruction(); /// calculating and setting the " recursive_has_changed" fields of directories to their values if(options.get_empty_dir() == false) get_cat().launch_recursive_has_changed_update(); /// we can now use the cat_directory::get_recursive_has_changed() to avoid recursion in a directory where /// no file has been saved. try { filtre_restore(dialog, pool, options.get_selection(), options.get_subtree(), get_cat(), tools_relative2absolute_path(fs_root, tools_getcwd()), options.get_warn_over(), options.get_info_details(), options.get_display_treated(), options.get_display_treated_only_dir(), options.get_display_skipped(), *st_ptr, options.get_ea_mask(), options.get_flat(), options.get_what_to_check(), options.get_warn_remove_no_match(), options.get_empty(), options.get_empty_dir(), options.get_overwriting_rules(), options.get_dirty_behavior(), options.get_only_deleted(), options.get_ignore_deleted(), options.get_fsa_scope()); } catch(Euser_abort & e) { disable_natural_destruction(); throw; } catch(Ethread_cancel & e) { disable_natural_destruction(); throw; } catch(Erange &e) { string msg = string(gettext("Error while restoring data: ")) + e.get_message(); dialog.warning(msg); throw Edata(msg); } } catch(...) { NLS_SWAP_OUT; if(sequential_read) exploitable = false; throw; } NLS_SWAP_OUT; if(sequential_read) exploitable = false; return *st_ptr; } void archive::summary(user_interaction & dialog) { NLS_SWAP_IN; try { // sanity checks if(freed_and_checked) throw Erange("catalogue::summary", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(!exploitable) throw Elibcall("summary", gettext("This archive is not exploitable, check the archive class usage in the API documentation")); // end of sanity checks infinint sub_file_size; infinint first_file_size; infinint last_file_size, file_number; string algo = compression2string(get_header().get_compression_algo()); string sym = ver.get_edition() >= 9 ? crypto_algo_2_string(ver.get_sym_crypto_algo()) : (ver.is_ciphered() ? gettext("yes") : gettext("no")); string asym = ver.get_edition() >= 9 && (ver.get_crypted_key() != nullptr) ? "gnupg" : gettext("none"); string is_signed = ver.is_signed() ? gettext("yes") : gettext("no"); infinint cat_size = get_cat_size(); const header_version ver = get_header(); dialog.printf(gettext("Archive version format : %s\n"), ver.get_edition().display().c_str()); dialog.printf(gettext("Compression algorithm used : %S\n"), &algo); dialog.printf(gettext("Symmetric key encryption used : %S\n"), &sym); dialog.printf(gettext("Asymmetric key encryption used : %S\n"), &asym); dialog.printf(gettext("Archive is signed : %S\n"), &is_signed); dialog.printf(gettext("Sequential reading marks : %s\n"), (ver.get_tape_marks() ? gettext("present") : gettext("absent"))); if(!cat_size.is_zero()) dialog.printf(gettext("Catalogue size in archive : %i bytes\n"), &cat_size); else dialog.printf(gettext("Catalogue size in archive : N/A\n")); dialog.printf(gettext("User comment : %S\n\n"), &(get_header().get_command_line())); try { if(get_sar_param(sub_file_size, first_file_size, last_file_size, file_number)) { dialog.printf(gettext("Archive is composed of %i file(s)\n"), &file_number); if(file_number == 1) dialog.printf(gettext("File size: %i bytes\n"), &last_file_size); else { if(first_file_size != sub_file_size) dialog.printf(gettext("First file size : %i bytes\n"), &first_file_size); dialog.printf(gettext("File size : %i bytes\n"), &sub_file_size); dialog.printf(gettext("Last file size : %i bytes\n"), &last_file_size); } if(file_number > 1) { infinint total = first_file_size + (file_number-2)*sub_file_size + last_file_size; dialog.printf(gettext("Archive total size is : %i bytes\n"), &total); } } else // not reading from a sar { infinint arch_size = get_level2_size(); if(!arch_size.is_zero()) { dialog.printf(gettext("Archive size is: %i bytes\n"), &arch_size); dialog.printf(gettext("Previous archive size does not include headers present in each slice\n")); } else dialog.printf(gettext("Archive size is unknown (reading from a pipe)")); } } catch(Erange & e) { string msg = e.get_message(); dialog.printf("%S\n", &msg); } entree_stats stats = get_cat().get_stats(); if(get_cat().get_contenu() == nullptr) throw SRC_BUG; infinint g_storage_size = get_cat().get_contenu()->get_storage_size(); infinint g_size = get_cat().get_contenu()->get_size(); if(g_size < g_storage_size) { infinint delta = g_storage_size - g_size; dialog.printf(gettext("The overall archive size includes %i byte(s) wasted due to bad compression ratio"), &delta); } else dialog.warning(string(gettext("The global data compression ratio is: ")) + tools_get_compression_ratio(g_storage_size, g_size, true)); if(only_contains_an_isolated_catalogue()) dialog.printf(gettext("\nWARNING! This archive only contains the contents of another archive, it can only be used as reference for differential backup or as rescue in case of corruption of the original archive's content. You cannot restore any data from this archive alone\n")); stats.listing(dialog); } catch(...) { NLS_SWAP_OUT; if(sequential_read) exploitable = false; throw; } NLS_SWAP_OUT; if(sequential_read) exploitable = false; } void archive::op_listing(user_interaction & dialog, const archive_options_listing & options) { NLS_SWAP_IN; try { slice_layout used_layout = slices; // by default we use the slice layout of the current archive, // this is modified if the current archive is an isolated catalogue // in archive format 9 or greater, then we use the slice layout contained // in the archive header/trailer which is a copy of the one of the archive of reference // a warning is issued in that case if(freed_and_checked) throw Erange("catalogue::op_listing", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); enable_natural_destruction(); try { switch(options.get_list_mode()) { case archive_options_listing::normal: get_cat().tar_listing(only_contains_an_isolated_catalogue(), options.get_selection(), options.get_subtree(), options.get_filter_unsaved(), options.get_display_ea(), ""); break; case archive_options_listing::tree: get_cat().listing(only_contains_an_isolated_catalogue(), options.get_selection(), options.get_subtree(), options.get_filter_unsaved(), options.get_display_ea(), ""); break; case archive_options_listing::xml: get_cat().xml_listing(only_contains_an_isolated_catalogue(), options.get_selection(), options.get_subtree(), options.get_filter_unsaved(), options.get_display_ea(), ""); break; case archive_options_listing::slicing: if(only_contains_an_isolated_catalogue()) { if(ver.get_slice_layout() != nullptr) { used_layout = *ver.get_slice_layout(); if(options.get_user_slicing(used_layout.first_size, used_layout.other_size)) { if(options.get_info_details()) dialog.printf(gettext("Using user provided modified slicing (first slice = %i bytes, other slices = %i bytes)"), &used_layout.first_size, &used_layout.other_size); } else dialog.warning(gettext("Using the slice layout of the archive of reference recorded at the time this isolated catalogue was done\n Note: if this reference has been resliced this isolated catalogue has been created, the resulting slicing information given here will be wrong and will probably lead to an error. Check documentation to know hos to manually specify the slicing to use")); } else // no slicing of the archive of reference stored in this isolated catalogue's header/trailer { if(ver.get_edition() >= 9) throw SRC_BUG; // starting revision 9 isolated catalogue should always contain // the slicing of the archive of reference, even if that reference is using an archive format // older than version 9. if(options.get_user_slicing(used_layout.first_size, used_layout.other_size)) dialog.warning(gettext("Warning: No slice layout of the archive of reference has been recorded in this isolated catalogue. The additional slicing information you provided may still lead the operation to fail because the archive has an _unsupported_ (too old) format for this feature")); else throw Erange("archive::op_listing", gettext("No slice layout of the archive of reference for the current isolated catalogue is available, cannot provide slicing information, aborting")); } } get_cat().slice_listing(only_contains_an_isolated_catalogue(), options.get_selection(), options.get_subtree(), used_layout); break; default: throw SRC_BUG; } } catch(Euser_abort & e) { disable_natural_destruction(); throw; } catch(Erange & e) { string msg = string(gettext("Error while listing archive contents: ")) + e.get_message(); throw Edata(msg); } } catch(...) { NLS_SWAP_OUT; if(sequential_read) exploitable = false; throw; } NLS_SWAP_OUT; if(sequential_read) exploitable = false; } statistics archive::op_diff(user_interaction & dialog, const path & fs_root, const archive_options_diff & options, statistics * progressive_report) { statistics st = false; // false => no lock for this internal object statistics *st_ptr = progressive_report == nullptr ? &st : progressive_report; bool isolated_mode = false; NLS_SWAP_IN; try { // sanity checks if(freed_and_checked) throw Erange("catalogue::op_diff", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(!exploitable) throw Elibcall("op_diff", gettext("This archive is not exploitable, check documentation for more")); try { check_against_isolation(dialog, lax_read_mode); } catch(Erange & e) { dialog.warning("This archive contains an isolated catalogue, only meta data can be used for comparison, CRC will be used to compare data, but using CRC to compare EA or FSA could return false difference as for both, the CRC is global to the set of attributes and the resulting CRC is sensible to the order the operating system provides these attributes"); isolated_mode = true; } // end of sanity checks fs_root.explode_undisclosed(); enable_natural_destruction(); try { filtre_difference(dialog, pool, options.get_selection(), options.get_subtree(), get_cat(), tools_relative2absolute_path(fs_root, tools_getcwd()), options.get_info_details(), options.get_display_treated(), options.get_display_treated_only_dir(), options.get_display_skipped(), *st_ptr, options.get_ea_mask(), options.get_alter_atime(), options.get_furtive_read_mode(), options.get_what_to_check(), options.get_hourshift(), options.get_compare_symlink_date(), options.get_fsa_scope(), isolated_mode); } catch(Euser_abort & e) { disable_natural_destruction(); throw; } catch(Ethread_cancel & e) { disable_natural_destruction(); throw; } catch(Erange & e) { string msg = string(gettext("Error while comparing archive with filesystem: "))+e.get_message(); dialog.warning(msg); throw Edata(msg); } } catch(...) { NLS_SWAP_OUT; if(sequential_read) exploitable = false; throw; } NLS_SWAP_OUT; if(sequential_read) exploitable = false; return *st_ptr; } statistics archive::op_test(user_interaction & dialog, const archive_options_test & options, statistics * progressive_report) { statistics st = false; // false => no lock for this internal object statistics *st_ptr = progressive_report == nullptr ? &st : progressive_report; bool isolated = false; NLS_SWAP_IN; try { // sanity checks if(freed_and_checked) throw Erange("catalogue::op_test", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(!exploitable) throw Elibcall("op_test", gettext("This archive is not exploitable, check the archive class usage in the API documentation")); try { check_against_isolation(dialog, lax_read_mode); } catch(Erange & e) { // no data/EA are available in this archive, // we can return normally at this point // as the catalogue has already been read // thus all that could be tested has been tested dialog.warning(gettext("WARNING! This is an isolated catalogue, no data or EA is present in this archive, only the catalogue structure can be checked")); isolated = true; } // end of sanity checks enable_natural_destruction(); try { try { if(isolated) { const cat_entree *tmp; if(cat == nullptr) throw SRC_BUG; cat->read(tmp); // should be enough to have the whole catalogue being read if using sequential read mode cat->reset_read(); } else filtre_test(dialog, pool, options.get_selection(), options.get_subtree(), get_cat(), options.get_info_details(), options.get_display_treated(), options.get_display_treated_only_dir(), options.get_display_skipped(), options.get_empty(), *st_ptr); } catch(Erange & e) { dialog.warning(gettext("A problem occurred while reading this archive contents: ") + e.get_message()); } } catch(Euser_abort & e) { disable_natural_destruction(); throw; } catch(Ethread_cancel & e) { disable_natural_destruction(); throw; } catch(Erange & e) { string msg = string(gettext("Error while testing archive: "))+e.get_message(); dialog.warning(msg); throw Edata(msg); } } catch(...) { NLS_SWAP_OUT; if(sequential_read) exploitable = false; throw; } NLS_SWAP_OUT; if(sequential_read) exploitable = false; return *st_ptr; } void archive::op_isolate(user_interaction & dialog, const path &sauv_path, const string & filename, const string & extension, const archive_options_isolate & options) { NLS_SWAP_IN; try { entrepot *sauv_path_t = options.get_entrepot().clone(); if(sauv_path_t == nullptr) throw Ememory("archive::archive"); sauv_path_t->set_user_ownership(options.get_slice_user_ownership()); sauv_path_t->set_group_ownership(options.get_slice_group_ownership()); sauv_path_t->set_location(sauv_path); try { pile layers; header_version isol_ver; label isol_data_name; label internal_name; slice_layout isol_slices; do { isol_data_name.generate_internal_filename(); } while(isol_data_name == cat->get_data_name()); internal_name = isol_data_name; macro_tools_create_layers(dialog, layers, isol_ver, isol_slices, &slices, // giving our slice_layout as reference to be stored in the archive header/trailer get_pool(), *sauv_path_t, filename, extension, options.get_allow_over(), options.get_warn_over(), options.get_info_details(), options.get_pause(), options.get_compression(), options.get_compression_level(), options.get_slice_size(), options.get_first_slice_size(), options.get_execute(), options.get_crypto_algo(), options.get_crypto_pass(), options.get_crypto_size(), options.get_gnupg_recipients(), options.get_gnupg_signatories(), options.get_empty(), options.get_slice_permission(), options.get_sequential_marks(), options.get_user_comment(), options.get_hash_algo(), options.get_slice_min_digits(), internal_name, isol_data_name, options.get_multi_threaded()); if(cat == nullptr) throw SRC_BUG; if(isol_data_name == cat->get_data_name()) throw SRC_BUG; // data_name generated just above by slice layer // should never equal the data_name of the catalogue // when performing isolation macro_tools_close_layers(dialog, layers, isol_ver, *cat, options.get_info_details(), options.get_crypto_algo(), options.get_compression(), options.get_gnupg_recipients(), options.get_gnupg_signatories(), options.get_empty()); } catch(...) { if(sauv_path_t != nullptr) delete sauv_path_t; throw; } if(sauv_path_t != nullptr) delete sauv_path_t; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } bool archive::get_children_of(user_interaction & dialog, const string & dir) { bool ret; NLS_SWAP_IN; try { if(freed_and_checked) throw Erange("catalogue::get_children_of", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(exploitable && sequential_read) // the catalogue is not even yet read, so we must first read it entirely { if(only_contains_an_isolated_catalogue()) // this is easy... asking just an entry //from the catalogue makes its whole being read { const cat_entree *tmp; if(cat == nullptr) throw SRC_BUG; cat->read(tmp); // should be enough to have the whole catalogue being read cat->reset_read(); } else // here we have a plain archive, doing the test operation // is the simplest way to read the whole archive and thus get its contents // (i.e.: the catalogue) (void)op_test(dialog, archive_options_test(), nullptr); } // OK, now that we have the whole catalogue available in memory, let's rock! ret = get_cat().get_contenu()->callback_for_children_of(dialog, dir); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } const vector archive::get_children_in_table(const string & dir) const { vector ret; NLS_SWAP_IN; try { const cat_directory * parent = get_dir_object(dir); const cat_nomme *tmp_ptr = nullptr; if(freed_and_checked) throw Erange("catalogue::get_children_in_table", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(parent == nullptr) throw SRC_BUG; parent->reset_read_children(); while(parent->read_children(tmp_ptr)) { if(tmp_ptr == nullptr) throw SRC_BUG; list_entry ent; const cat_inode *tmp_inode = dynamic_cast(tmp_ptr); const cat_file *tmp_file = dynamic_cast(tmp_ptr); const cat_lien *tmp_lien = dynamic_cast(tmp_ptr); const cat_device *tmp_device = dynamic_cast(tmp_ptr); const cat_mirage *tmp_mir = dynamic_cast(tmp_ptr); ent.set_name(tmp_ptr->get_name()); if(tmp_mir == nullptr) { ent.set_hard_link(false); ent.set_type(get_base_signature(tmp_ptr->signature())); } else { ent.set_hard_link(true); ent.set_type(get_base_signature(tmp_mir->get_inode()->signature())); tmp_inode = tmp_mir->get_inode(); tmp_file = dynamic_cast(tmp_inode); tmp_lien = dynamic_cast(tmp_inode); tmp_device = dynamic_cast(tmp_inode); } if(tmp_inode != nullptr) { ent.set_uid(tmp_inode->get_uid()); ent.set_gid(tmp_inode->get_gid()); ent.set_perm(tmp_inode->get_perm()); ent.set_last_access(tmp_inode->get_last_access()); ent.set_last_modif(tmp_inode->get_last_modif()); ent.set_saved_status(tmp_inode->get_saved_status()); ent.set_ea_status(tmp_inode->ea_get_saved_status()); if(tmp_inode->has_last_change()) ent.set_last_change(tmp_inode->get_last_change()); ent.set_fsa_status(tmp_inode->fsa_get_saved_status()); } if(tmp_file != nullptr) { ent.set_file_size(tmp_file->get_size()); ent.set_storage_size(tmp_file->get_storage_size()); ent.set_is_sparse_file(tmp_file->get_sparse_file_detection_read()); ent.set_compression_algo(tmp_file->get_compression_algo_read()); ent.set_dirtiness(tmp_file->is_dirty()); } if(tmp_lien != nullptr && tmp_lien->get_saved_status() == s_saved) ent.set_link_target(tmp_lien->get_target()); if(tmp_device != nullptr) { ent.set_major(tmp_device->get_major()); ent.set_minor(tmp_device->get_minor()); } ent.set_slices(macro_tools_get_slices(tmp_ptr, slices)); // fill a new entry in the table ret.push_back(ent); } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } bool archive::has_subdirectory(const std::string & dir) const { bool ret = false; NLS_SWAP_IN; try { const cat_directory *parent = get_dir_object(dir); const cat_nomme *tmp_ptr = nullptr; if(freed_and_checked) throw Erange("catalogue::has_subdirectory", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); parent->reset_read_children(); while(parent->read_children(tmp_ptr) && !ret) { if(dynamic_cast(tmp_ptr) != nullptr) ret = true; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } void archive::init_catalogue(user_interaction & dialog) const { NLS_SWAP_IN; try { if(freed_and_checked) throw Erange("catalogue::init_catalogue", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(exploitable && sequential_read) // the catalogue is not even yet read, so we must first read it entirely { if(only_contains_an_isolated_catalogue()) // this is easy... asking just an entry //from the catalogue makes its whole being read { const cat_entree *tmp; if(cat == nullptr) throw SRC_BUG; cat->read(tmp); // should be enough to have the whole catalogue being read cat->reset_read(); } else { if(cat == nullptr) throw SRC_BUG; filtre_sequentially_read_all_catalogue(*cat, dialog, lax_read_mode); } } if(cat == nullptr) throw SRC_BUG; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } const catalogue & archive::get_catalogue() const { NLS_SWAP_IN; try { if(freed_and_checked) throw Erange("catalogue::get_catalogue", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(exploitable && sequential_read) throw Elibcall("archive::get_catalogue", "Reading the catalogue of an archive open in sequential read mode while it has not yet been read need passing a \"user_interaction\" object to the argument of archive::get_catalogue or call init_catalogue() first "); if(cat == nullptr) throw SRC_BUG; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return *cat; } const catalogue & archive::get_catalogue(user_interaction & dialog) const { init_catalogue(dialog); return get_catalogue(); } void archive::drop_all_filedescriptors() { NLS_SWAP_IN; try { if(freed_and_checked) throw Erange("catalogue::drop_all_filedescriptors", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(exploitable && sequential_read) throw Elibcall("archive::drop_all_filedescriptiors", "Dropping all filedescriptors for an archive in sequential read mode that has not yet been read need passing a \"user_interaction\" object to the argument of archive::drop_all_filedescriptors"); stack.clear(); exploitable = false; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive::drop_all_filedescriptors(user_interaction & dialog) { NLS_SWAP_IN; try { if(freed_and_checked) throw Erange("catalogue::drop_all_filedescriptors(user_interaction)", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(exploitable && sequential_read) { if(only_contains_an_isolated_catalogue()) { const cat_entree *tmp; if(cat == nullptr) throw SRC_BUG; cat->read(tmp); // should be enough to have the whole catalogue being read cat->reset_read(); } else (void)op_test(dialog, archive_options_test(), nullptr); } stack.clear(); exploitable = false; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } string archive::free_and_check_memory() const { string ret = ""; archive *me = const_cast(this); if(freed_and_checked) throw Erange("catalogue::free_and_check_memory", "catalogue::free_and_check_memory() method has been called, this object is no more usable"); if(me == nullptr) throw SRC_BUG; me->freed_and_checked = true; me->free_except_memory_pool(); if(pool != nullptr) { #ifdef LIBDAR_DEBUG_MEMORY ret += pool->max_percent_full(); #endif pool->garbage_collect(); if(!pool->is_empty()) ret += pool->dump(); } return ret; } //////////////////// // PRIVATE METHODS FOLLOW // statistics archive::op_create_in(user_interaction & dialog, operation op, const path & fs_root, const entrepot & sauv_path_t, archive *ref_arch, const mask & selection, const mask & subtree, const string & filename, const string & extension, bool allow_over, bool warn_over, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, const infinint & pause, bool empty_dir, compression algo, U_I compression_level, const infinint & file_size, const infinint & first_file_size, const mask & ea_mask, const string & execute, crypto_algo crypto, const secu_string & pass, U_32 crypto_size, const vector & gnupg_recipients, const vector & gnupg_signatories, const mask & compr_mask, const infinint & min_compr_size, bool nodump, const string & exclude_by_ea, const infinint & hourshift, bool empty, bool alter_atime, bool furtive_read_mode, bool same_fs, cat_inode::comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, const infinint & fixed_date, const string & slice_permission, const infinint & repeat_count, const infinint & repeat_byte, bool add_marks_for_sequential_reading, bool security_check, const infinint & sparse_file_min_size, const string & user_comment, hash_algo hash, const infinint & slice_min_digits, const string & backup_hook_file_execute, const mask & backup_hook_file_mask, bool ignore_unknown, const fsa_scope & scope, bool multi_threaded, statistics * progressive_report) { statistics st = false; // false => no lock for this internal object statistics *st_ptr = progressive_report == nullptr ? &st : progressive_report; // sanity checks as much as possible to avoid libdar crashing due to bad arguments // useless arguments are not reported. if(compression_level > 9 || compression_level < 1) throw Elibcall("op_create_in", gettext("Compression_level must be between 1 and 9 included")); if(file_size.is_zero() && !first_file_size.is_zero()) throw Elibcall("op_create_in", gettext("\"first_file_size\" cannot be different from zero if \"file_size\" is equal to zero")); if(crypto_size < 10 && crypto != crypto_none) throw Elibcall("op_create_in", gettext("Crypto block size must be greater than 10 bytes")); #ifndef LIBDAR_NODUMP_FEATURE if(nodump) throw Ecompilation(gettext("nodump flag feature has not been activated at compilation time, it is thus not available")); #endif check_libgcrypt_hash_bug(dialog, hash, first_file_size, file_size); // end of sanity checks fs_root.explode_undisclosed(); const catalogue *ref_cat = nullptr; bool initial_pause = false; path sauv_path_abs = sauv_path_t.get_location(); const entrepot_local *sauv_path_t_local = dynamic_cast(&sauv_path_t); path fs_root_abs = fs_root.is_relative() ? tools_relative2absolute_path(fs_root, tools_getcwd()) : fs_root; if(sauv_path_abs.is_relative()) sauv_path_abs = sauv_path_t.get_root() + sauv_path_abs; if(!empty && sauv_path_t_local != nullptr) tools_avoid_slice_overwriting_regex(dialog, sauv_path_abs, string("^")+filename+"\\.[0-9]+\\."+extension+"(\\.(md5|sha1))?$", info_details, allow_over, warn_over, empty); local_cat_size = 0; // unknown catalogue size (need to re-open the archive, once creation has completed) [object member variable] sauv_path_abs.explode_undisclosed(); // warning against saving the archive itself if(op == oper_create && sauv_path_t_local != nullptr // not using a remote storage && sauv_path_abs.is_subdir_of(fs_root_abs, true) && selection.is_covered(filename+".1."+extension) && subtree.is_covered(sauv_path_abs + string(filename+".1."+extension)) && filename!= "-") { bool cov = true; // whether the archive is covered by filter (this is saving itself) string drop; // will carry the removed part of the sauv_path_abs variable // checking for exclusion due to different filesystem if(same_fs && !tools_are_on_same_filesystem(sauv_path_abs.display(), fs_root.display())) cov = false; if(snapshot) // if we do a snapshot we dont create an archive this no risk to save ourselves cov = false; // checking for directory auto inclusion do { cov = cov && subtree.is_covered(sauv_path_abs); } while(cov && sauv_path_abs.pop(drop)); if(cov) dialog.pause(tools_printf(gettext("WARNING! The archive is located in the directory to backup, this may create an endless loop when the archive will try to save itself. You can either add -X \"%S.*.%S\" on the command line, or change the location of the archive (see -h for help). Do you really want to continue?"), &filename, &extension)); } // building the reference catalogue if(ref_arch != nullptr) // from a existing archive { const entrepot *ref_where = ref_arch->get_entrepot(); if(ref_where != nullptr) initial_pause = (*ref_where == sauv_path_t); ref_cat = & ref_arch->get_catalogue(); } op_create_in_sub(dialog, op, fs_root, sauv_path_t, ref_cat, nullptr, initial_pause, selection, subtree, filename, extension, allow_over, allow_over ? crit_constant_action(data_overwrite, EA_overwrite) : crit_constant_action(data_preserve, EA_preserve), // we do not have any overwriting policy in this environement (archive creation and isolation), so we create one on-fly warn_over, info_details, display_treated, display_treated_only_dir, display_skipped, display_finished, pause, empty_dir, algo, compression_level, file_size, first_file_size, ea_mask, execute, crypto, pass, crypto_size, gnupg_recipients, gnupg_signatories, compr_mask, min_compr_size, nodump, exclude_by_ea, hourshift, empty, alter_atime, furtive_read_mode, same_fs, what_to_check, snapshot, cache_directory_tagging, false, // keep_compressed fixed_date, slice_permission, repeat_count, repeat_byte, false, // decremental mode add_marks_for_sequential_reading, security_check, sparse_file_min_size, user_comment, hash, slice_min_digits, backup_hook_file_execute, backup_hook_file_mask, ignore_unknown, scope, multi_threaded, st_ptr); return *st_ptr; } void archive::op_create_in_sub(user_interaction & dialog, operation op, const path & fs_root, const entrepot & sauv_path_t, const catalogue *ref_cat1, const catalogue *ref_cat2, bool initial_pause, const mask & selection, const mask & subtree, const string & filename, const string & extension, bool allow_over, const crit_action & overwrite, bool warn_over, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, const infinint & pause, bool empty_dir, compression algo, U_I compression_level, const infinint & file_size, const infinint & first_file_size, const mask & ea_mask, const string & execute, crypto_algo crypto, const secu_string & pass, U_32 crypto_size, const vector & gnupg_recipients, const vector & gnupg_signatories, const mask & compr_mask, const infinint & min_compr_size, bool nodump, const string & exclude_by_ea, const infinint & hourshift, bool empty, bool alter_atime, bool furtive_read_mode, bool same_fs, cat_inode::comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, bool keep_compressed, const infinint & fixed_date, const string & slice_permission, const infinint & repeat_count, const infinint & repeat_byte, bool decremental, bool add_marks_for_sequential_reading, bool security_check, const infinint & sparse_file_min_size, const string & user_comment, hash_algo hash, const infinint & slice_min_digits, const string & backup_hook_file_execute, const mask & backup_hook_file_mask, bool ignore_unknown, const fsa_scope & scope, bool multi_threaded, statistics * st_ptr) { try { stack.clear(); // [object member variable] cat = nullptr; // [object member variable] bool aborting = false; infinint aborting_next_etoile = 0; U_64 flag = 0; // carries the sar option flag label internal_name; generic_file *tmp = nullptr; thread_cancellation thr_cancel; if(ref_cat1 == nullptr && op != oper_create) SRC_BUG; if(st_ptr == nullptr) throw SRC_BUG; secu_string real_pass = pass; internal_name.generate_internal_filename(); try { // pausing if saving in the same directory where is located the archive of reference if(!pause.is_zero() && initial_pause) dialog.pause(gettext("Ready to start writing down the archive?")); macro_tools_create_layers(dialog, stack, // this object field is set! ver, // this object field is set! slices,// this object field is set! nullptr, // no slicing reference stored in archive header/trailer pool, // this object field sauv_path_t, filename, extension, allow_over, warn_over, info_details, pause, algo, compression_level, file_size, first_file_size, execute, crypto, pass, crypto_size, gnupg_recipients, gnupg_signatories, empty, slice_permission, add_marks_for_sequential_reading, user_comment, hash, slice_min_digits, internal_name, internal_name, // data_name is equal to internal_name in the current situation multi_threaded); // ********** building the catalogue (empty for now) ************************* // datetime root_mtime; pile_descriptor pdesc(&stack); if(info_details) dialog.warning(gettext("Building the catalog object...")); try { if(fs_root.display() != "") root_mtime = tools_get_mtime(fs_root.display()); else // case of merging operation for example { datetime mtime1 = ref_cat1 != nullptr ? ref_cat1->get_root_mtime() : datetime(0); datetime mtime2 = ref_cat2 != nullptr ? ref_cat2->get_root_mtime() : datetime(0); root_mtime = mtime1 > mtime2 ? mtime1 : mtime2; } } catch(Erange & e) { string tmp = fs_root.display(); throw Erange("archive::op_create_in_sub", tools_printf(gettext("Error while fetching information for %S: "), &tmp) + e.get_message()); } if(op == oper_merge) if(add_marks_for_sequential_reading && !empty) cat = new (pool) escape_catalogue(dialog, pdesc, ref_cat1->get_root_dir_last_modif(), internal_name); else cat = new (pool) catalogue(dialog, ref_cat1->get_root_dir_last_modif(), internal_name); else // op == oper_create if(add_marks_for_sequential_reading && !empty) cat = new (pool) escape_catalogue(dialog, pdesc, root_mtime, internal_name); else cat = new (pool) catalogue(dialog, root_mtime, internal_name); if(cat == nullptr) throw Ememory("archive::op_create_in_sub"); // *********** now we can perform the data filtering operation (adding data to the archive) *************** // try { catalogue *void_cat = nullptr; const catalogue *ref_cat_ptr = ref_cat1; switch(op) { case oper_create: if(ref_cat1 == nullptr) { // using a empty catalogue as reference if no reference is given label data_name; data_name.clear(); void_cat = new (pool) catalogue(dialog, datetime(0), data_name); if(void_cat == nullptr) throw Ememory("archive::op_create_in_sub"); ref_cat_ptr = void_cat; } try { if(info_details) dialog.warning(gettext("Processing files for backup...")); filtre_sauvegarde(dialog, pool, selection, subtree, pdesc, *cat, *ref_cat_ptr, fs_root, info_details, display_treated, display_treated_only_dir, display_skipped, display_finished, *st_ptr, empty_dir, ea_mask, compr_mask, min_compr_size, nodump, hourshift, alter_atime, furtive_read_mode, same_fs, what_to_check, snapshot, cache_directory_tagging, security_check, repeat_count, repeat_byte, fixed_date, sparse_file_min_size, backup_hook_file_execute, backup_hook_file_mask, ignore_unknown, scope, exclude_by_ea); } catch(...) { if(void_cat != nullptr) { delete void_cat; void_cat = nullptr; } throw; } if(void_cat != nullptr) { delete void_cat; void_cat = nullptr; } break; case oper_merge: if(info_details) dialog.warning(gettext("Processing files for merging...")); filtre_merge(dialog, pool, selection, subtree, pdesc, *cat, ref_cat1, ref_cat2, info_details, display_treated, display_treated_only_dir, display_skipped, *st_ptr, empty_dir, ea_mask, compr_mask, min_compr_size, keep_compressed, overwrite, warn_over, decremental, sparse_file_min_size, scope); break; default: throw SRC_BUG; } thr_cancel.block_delayed_cancellation(true); // we must protect the following code against delayed cancellations } catch(Ethread_cancel & e) { disable_natural_destruction(); if(e.immediate_cancel()) throw; else { Ethread_cancel_with_attr *e_attr = dynamic_cast(&e); aborting = true; flag = e.get_flag(); if(e_attr != nullptr) aborting_next_etoile = e_attr->get_attr(); else aborting_next_etoile = 0; thr_cancel.block_delayed_cancellation(true); // we must protect the following code against delayed cancellations stack.top()->sync_write(); // flushing only the top of the stack (compressor) must not yet flush the below encryption layer!!! } } if(ref_cat1 != nullptr && op == oper_create) { if(info_details) dialog.warning(gettext("Adding reference to files that have been destroyed since reference backup...")); if(aborting) cat->update_absent_with(*ref_cat1, aborting_next_etoile); else st_ptr->add_to_deleted(cat->update_destroyed_with(*ref_cat1)); } macro_tools_close_layers(dialog, stack, ver, *cat, info_details, crypto, algo, gnupg_recipients, gnupg_signatories, empty); thr_cancel.block_delayed_cancellation(false); // release pending delayed cancellation (if any) if(aborting) throw Ethread_cancel(false, flag); } catch(...) { if(tmp != nullptr) { delete tmp; tmp = nullptr; } if(cat != nullptr) { delete cat; cat = nullptr; } throw; } } catch(Euser_abort & e) { disable_natural_destruction(); throw; } catch(Erange &e) { string msg = string(gettext("Error while saving data: ")) + e.get_message(); throw Edata(msg); } } void archive::free_except_memory_pool() { stack.clear(); gnupg_signed.clear(); slices.clear(); ver.clear_crypted_key(); if(cat != nullptr) { delete cat; cat = nullptr; } } void archive::free_all() { free_except_memory_pool(); if(pool != nullptr) { if(get_pool() == nullptr) { delete pool; pool = nullptr; } else { if(pool != get_pool()) throw SRC_BUG; pool = nullptr; } } } void archive::init_pool() { pool = nullptr; #ifdef LIBDAR_SPECIAL_ALLOC if(get_pool() == nullptr) { pool = new (nothrow) memory_pool(); if(pool == nullptr) throw Ememory("archive::archive (read) for memory_pool"); } else pool = get_pool(); #endif } void archive::check_gnupg_signed(user_interaction & dialog) const { list::const_iterator it = gnupg_signed.begin(); while(it != gnupg_signed.end() && it->result == signator::good) ++it; if(it != gnupg_signed.end()) dialog.pause(gettext("WARNING! Incorrect signature found for archive, continue anyway?")); } void archive::disable_natural_destruction() { sar *tmp = nullptr; stack.find_first_from_bottom(tmp); if(tmp != nullptr) tmp->disable_natural_destruction(); } void archive::enable_natural_destruction() { sar *tmp = nullptr; stack.find_first_from_bottom(tmp); if(tmp != nullptr) tmp->enable_natural_destruction(); } const label & archive::get_layer1_data_name() const { contextual *l1 = nullptr; archive *ceci = const_cast(this); ceci->stack.find_first_from_bottom(l1); if(l1 != nullptr) return l1->get_data_name(); else throw Erange("catalogue::get_data_name", gettext("Cannot get data name of the archive, this archive is not completely initialized")); } const label & archive::get_catalogue_data_name() const { if(cat != nullptr) return cat->get_data_name(); else throw SRC_BUG; } bool archive::only_contains_an_isolated_catalogue() const { return get_layer1_data_name() != get_catalogue_data_name() && ver.get_edition() >= 8; } void archive::check_against_isolation(user_interaction & dialog, bool lax) const { if(cat != nullptr) { try { if(only_contains_an_isolated_catalogue()) { if(!lax) throw Erange("archive::check_against_isolation", gettext("This archive contains an isolated catalogue, it cannot be used for this operation. It can only be used as reference for a incremental/differential backup or as backup of the original archive's catalogue")); // note1: that old archives do not have any data_name neither in the catalogue nor in the layer1 of the archive // both are faked equal to a zeroed label when reading them with recent dar version. Older archives than "08" would // thus pass this test successfully if no check was done against the archive version // note2: Old isolated catalogue do not carry any data, this is safe to try to restore them because any // pointer to data and/or EA has been removed during the isolation. else dialog.pause(gettext("LAX MODE: Archive seems to be only an isolated catalogue (no data in it), Can I assume data corruption occurred and consider the archive as being a real archive?")); } } catch(Erange & e) { throw Erange("archive::check_against_isolation", string(gettext("Error while fetching archive properties: ")) + e.get_message()); } } else throw SRC_BUG; // this method should be called once the archive object has been constructed // and this object should be totally exploitable, thus have an available catalogue } bool archive::get_sar_param(infinint & sub_file_size, infinint & first_file_size, infinint & last_file_size, infinint & total_file_number) { sar *real_decoupe = nullptr; stack.find_first_from_bottom(real_decoupe); if(real_decoupe != nullptr) { slice_layout tmp = real_decoupe->get_slicing(); sub_file_size = tmp.other_size; first_file_size = tmp.first_size; if(real_decoupe->get_total_file_number(total_file_number) && real_decoupe->get_last_file_size(last_file_size)) return true; else // could not read size parameters throw Erange("archive::get_sar_param", gettext("Sorry, file size is unknown at this step of the program.\n")); } else return false; } const entrepot *archive::get_entrepot() { const entrepot *ret = nullptr; sar *real_decoupe = nullptr; stack.find_first_from_bottom(real_decoupe); if(real_decoupe != nullptr) { ret = real_decoupe->get_entrepot(); if(ret == nullptr) throw SRC_BUG; } return ret; } infinint archive::get_level2_size() { generic_file *level1 = stack.get_by_label(LIBDAR_STACK_LABEL_LEVEL1); if(dynamic_cast(level1) == nullptr) { stack.skip_to_eof(); return stack.get_position(); } else return 0; } const cat_directory *archive::get_dir_object(const string & dir) const { const cat_directory *parent = nullptr; const cat_nomme *tmp_ptr = nullptr; parent = get_cat().get_contenu(); if(parent == nullptr) throw SRC_BUG; if(dir != "") { path search = dir; string tmp; bool loop = true; while(loop) { loop = search.pop_front(tmp); if(!loop) // failed because now, search is a one level path tmp = search.basename(); if(parent->search_children(tmp, tmp_ptr)) parent = dynamic_cast(tmp_ptr); else parent = nullptr; if(parent == nullptr) throw Erange("archive::get_children_in_table", tools_printf("%S entry does not exist", &dir)); } } // else returning the root of the archive return parent; } static void check_libgcrypt_hash_bug(user_interaction & dialog, hash_algo hash, const infinint & first_file_size, const infinint & file_size) { #if CRYPTO_AVAILABLE if(hash != hash_none && !crypto_min_ver_libgcrypt_no_bug()) { const infinint limit = tools_get_extended_size("256G", 1024); if(file_size >= limit || first_file_size >= limit) dialog.pause(tools_printf(gettext("libgcrypt version < %s. Ligcrypt used has a bug that leads md5 and sha1 hash results to be erroneous for files larger than 256 Gio (gibioctet), do you really want to spend CPU cycles calculating a useless hash?"), MIN_VERSION_GCRYPT_HASH_BUG)); } #endif } } // end of namespace dar-2.5.3/src/libdar/cat_door.hpp0000644000175000017430000000451312642474445013560 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_door.hpp /// \brief class used in a catalogue to store solaris door filesystem entries /// \ingroup Private #ifndef CAT_DOOR_HPP #define CAT_DOOR_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_file.hpp" #include "cat_tools.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the class for Door IPC (mainly for Solaris) class cat_door : public cat_file { public: cat_door(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & src, const path & che, const infinint & fs_device) : cat_file(xuid, xgid, xperm, last_access, last_modif, last_change, src, che, 0, fs_device, false) {}; cat_door(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, compression default_algo, bool small) : cat_file(dialog, pdesc, reading_ver, saved, default_algo, small) {}; bool operator == (const cat_entree & ref) const; unsigned char signature() const { return mk_signature('o', get_saved_status()); }; generic_file *get_data(get_data_mode mode) const; // inherited from class cat_file }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_inode.cpp0000644000175000017430000011135012642474445013704 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // to allow compilation under Cygwin we need // else Cygwin's lack __int16_t symbol !?! #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #ifdef STDC_HEADERS #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include "cat_inode.hpp" #include "cat_lien.hpp" #include "tools.hpp" #define INODE_FLAG_EA_MASK 0x07 #define INODE_FLAG_EA_FULL 0x01 #define INODE_FLAG_EA_PART 0x02 #define INODE_FLAG_EA_NONE 0x03 #define INODE_FLAG_EA_FAKE 0x04 #define INODE_FLAG_EA_REMO 0x05 #define INODE_FLAG_FSA_MASK 0x18 #define INODE_FLAG_FSA_NONE 0x00 #define INODE_FLAG_FSA_PART 0x08 #define INODE_FLAG_FSA_FULL 0x10 using namespace std; namespace libdar { const ea_attributs cat_inode::empty_ea; cat_inode::cat_inode(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const string & xname, const infinint & fs_device) : cat_nomme(xname) { nullifyptr(); uid = xuid; gid = xgid; perm = xperm; xsaved = s_not_saved; ea_saved = ea_none; fsa_saved = fsa_none; edit = 0; small_read = false; try { last_acc = last_access; last_mod = last_modif; last_cha = new (get_pool()) datetime(last_change); fs_dev = new (get_pool()) infinint(fs_device); if(last_cha == nullptr || fs_dev == nullptr) throw Ememory("cat_inode::cat_inode"); } catch(...) { destroy(); throw; } } cat_inode::cat_inode(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small) : cat_nomme(pdesc, small) { U_16 tmp; unsigned char flag; generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; nullifyptr(); try { xsaved = saved; edit = reading_ver; small_read = small; if(reading_ver > 1) { ptr->read((char *)(&flag), 1); unsigned char ea_flag = flag & INODE_FLAG_EA_MASK; switch(ea_flag) { case INODE_FLAG_EA_FULL: ea_saved = ea_full; break; case INODE_FLAG_EA_PART: ea_saved = ea_partial; break; case INODE_FLAG_EA_NONE: ea_saved = ea_none; break; case INODE_FLAG_EA_FAKE: ea_saved = ea_fake; break; case INODE_FLAG_EA_REMO: ea_saved = ea_removed; break; default: throw Erange("cat_inode::cat_inode", gettext("badly structured inode: unknown inode flag")); } } else ea_saved = ea_none; if(reading_ver <= 7) { // UID and GID were stored on 16 bits each if(ptr->read((char *)&tmp, sizeof(tmp)) != sizeof(tmp)) throw Erange("cat_inode::cat_inode", gettext("missing data to build an inode")); uid = ntohs(tmp); if(ptr->read((char *)&tmp, sizeof(tmp)) != sizeof(tmp)) throw Erange("cat_inode::cat_inode", gettext("missing data to build an inode")); gid = ntohs(tmp); } else // archive format >= "08" { uid = infinint(*ptr); gid = infinint(*ptr); } if(ptr->read((char *)&tmp, sizeof(tmp)) != sizeof(tmp)) throw Erange("cat_inode::cat_inode", gettext("missing data to build an inode")); perm = ntohs(tmp); last_acc.read(*ptr, reading_ver); last_mod.read(*ptr, reading_ver); if(reading_ver >= 8) { last_cha = new (get_pool()) datetime(*ptr, reading_ver); if(last_cha == nullptr) throw Ememory("cat_inode::cat_inode(file)"); if(ea_saved == ea_full) { ea_size = new (get_pool()) infinint(*ptr); if(ea_size == nullptr) throw Ememory("cat_inode::cat_inode(file)"); } } else // archive format <= 7 { // ea_size stays nullptr meaning EA size unknown (old format) } if(!small) // reading a full entry from catalogue { switch(ea_saved) { case ea_full: ea_offset = new (get_pool()) infinint(*ptr); if(ea_offset == nullptr) throw Ememory("cat_inode::cat_inode(file)"); if(reading_ver <= 7) { ea_crc = create_crc_from_file(*ptr, get_pool(), true); if(ea_crc == nullptr) throw SRC_BUG; last_cha = new (get_pool()) datetime(*ptr, reading_ver); if(last_cha == nullptr) throw Ememory("cat_inode::cat_inode(file)"); } else // archive format >= 8 { ea_crc = create_crc_from_file(*ptr, get_pool(), false); if(ea_crc == nullptr) throw SRC_BUG; } break; case ea_partial: case ea_fake: if(reading_ver <= 7) { last_cha = new (get_pool()) datetime(*ptr, reading_ver); if(last_cha == nullptr) throw Ememory("cat_inode::cat_inode(file)"); } break; case ea_none: case ea_removed: if(reading_ver <= 7) { last_cha = new (get_pool()) datetime(); if(last_cha == nullptr) throw Ememory("cat_inode::cat_inode(file)"); } break; default: throw SRC_BUG; } } else // reading a small dump using escape sequence marks { // header version is greater than or equal to "08" (small dump appeared at // this version of archive format) ea_offset is not used (sequential read mode) // while ea_CRC has been dumped a bit further in that case, we will fetch // its value upon request by get_ea() or ea_get_crc() // methods } ea = nullptr; // in any case if(reading_ver >= 9) { unsigned char fsa_flag = flag & INODE_FLAG_FSA_MASK; switch(fsa_flag) { case INODE_FLAG_FSA_NONE: fsa_saved = fsa_none; break; case INODE_FLAG_FSA_PART: fsa_saved = fsa_partial; break; case INODE_FLAG_FSA_FULL: fsa_saved = fsa_full; break; default: throw Erange("cat_inode::cat_inode", gettext("badly structured inode: unknown inode flag for FSA")); } if(fsa_saved != fsa_none) { fsa_families = new (get_pool()) infinint(*ptr); if(fsa_families == nullptr) throw Ememory("cat_inode::cat_inode(file)"); } if(fsa_saved == fsa_full) { fsa_size = new (get_pool()) infinint(*ptr); if(fsa_size == nullptr) throw Ememory("cat_inode::cat_inode(file)"); } if(!small) { switch(fsa_saved) { case fsa_full: fsa_offset = new (get_pool()) infinint(*ptr); fsa_crc = create_crc_from_file(*ptr, get_pool()); if(fsa_offset == nullptr || fsa_crc == nullptr) throw Ememory("cat_inode::cat_inode(file)"); break; case fsa_partial: case fsa_none: break; default: throw SRC_BUG; } } else // reading a small dump using escape sequence marks { // fsa_offset is not used and fsa_CRC have been dumped a bit // further in that case (sequential read mode), // and will be fetched by get_fsa() or ea_get_crc() // methods } } else // older archive than version 9 do not support FSA fsa_saved = fsa_none; } catch(...) { destroy(); throw; } } cat_inode::cat_inode(const cat_inode & ref) : cat_nomme(ref) { nullifyptr(); try { copy_from(ref); } catch(...) { destroy(); throw; } } const cat_inode & cat_inode::operator = (const cat_inode & ref) { cat_nomme *me = this; const cat_nomme *nref = &ref; *me = *nref; // copying the "cat_nomme" part of the object destroy(); copy_from(ref); return *this; } cat_inode::~cat_inode() throw(Ebug) { destroy(); } bool cat_inode::same_as(const cat_inode & ref) const { return cat_nomme::same_as(ref) && compatible_signature(ref.signature(), signature()); } bool cat_inode::is_more_recent_than(const cat_inode & ref, const infinint & hourshift) const { return ref.last_mod < last_mod && !tools_is_equal_with_hourshift(hourshift, ref.last_mod, last_mod); } bool cat_inode::has_changed_since(const cat_inode & ref, const infinint & hourshift, comparison_fields what_to_check) const { return (what_to_check != cf_inode_type && (!hourshift.is_zero() ? !tools_is_equal_with_hourshift(hourshift, ref.last_mod, last_mod) : ref.last_mod != last_mod)) || (what_to_check == cf_all && uid != ref.uid) || (what_to_check == cf_all && gid != ref.gid) || (what_to_check != cf_mtime && what_to_check != cf_inode_type && perm != ref.perm); } void cat_inode::compare(const cat_inode &other, const mask & ea_mask, comparison_fields what_to_check, const infinint & hourshift, bool symlink_date, const fsa_scope & scope, bool isolated_mode) const { bool do_mtime_test = dynamic_cast(&other) == nullptr || symlink_date; if(!same_as(other)) throw Erange("cat_inode::compare",gettext("different file type")); if(what_to_check == cf_all && get_uid() != other.get_uid()) { infinint u1 = get_uid(); infinint u2 = other.get_uid(); throw Erange("cat_inode.compare", tools_printf(gettext("different owner (uid): %i <--> %i"), &u1, &u2)); } if(what_to_check == cf_all && get_gid() != other.get_gid()) { infinint g1 = get_gid(); infinint g2 = other.get_gid(); throw Erange("cat_inode.compare", tools_printf(gettext("different owner group (gid): %i <--> %i"), &g1, &g2)); } if((what_to_check == cf_all || what_to_check == cf_ignore_owner) && get_perm() != other.get_perm()) { string p1 = tools_int2octal(get_perm()); string p2 = tools_int2octal(other.get_perm()); throw Erange("cat_inode.compare", tools_printf(gettext("different permission: %S <--> %S"), &p1, &p2)); } if(do_mtime_test && (what_to_check == cf_all || what_to_check == cf_ignore_owner || what_to_check == cf_mtime) && !tools_is_equal_with_hourshift(hourshift, get_last_modif(), other.get_last_modif())) { string s1 = tools_display_date(get_last_modif()); string s2 = tools_display_date(other.get_last_modif()); throw Erange("cat_inode.compare", tools_printf(gettext("difference of last modification date: %S <--> %S"), &s1, &s2)); } sub_compare(other, isolated_mode); switch(ea_get_saved_status()) { case ea_full: if(other.ea_get_saved_status() == ea_full) { if(!isolated_mode) { const ea_attributs *me = get_ea(); // this pointer must not be freed const ea_attributs *you = other.get_ea(); // this pointer must not be freed neither if(me->diff(*you, ea_mask)) throw Erange("cat_inode::compare", gettext("different Extended Attributes")); } } else { #ifdef EA_SUPPORT throw Erange("cat_inode::compare", gettext("no Extended Attribute to compare with")); #else throw Ecompilation(gettext("Cannot compare EA: EA support has not been activated at compilation time")); #endif } // else we ignore the EA present in the argument, // this is not a symetrical comparison // we check that all data in current object are the same in the argument // but additional data can reside in the argument break; case ea_partial: case ea_fake: if(other.ea_get_saved_status() != ea_none && other.ea_get_saved_status() != ea_removed) { if(!tools_is_equal_with_hourshift(hourshift, get_last_change(), other.get_last_change()) && get_last_change() < other.get_last_change()) throw Erange("cat_inode::compare", gettext("inode last change date (ctime) greater, EA might be different")); } else { #ifdef EA_SUPPORT throw Erange("cat_inode::compare", gettext("no Extended Attributes to compare with")); #else throw Ecompilation(gettext("Cannot compare EA: EA support has not been activated at compilation time")); #endif } break; case ea_none: case ea_removed: break; default: throw SRC_BUG; } switch(fsa_get_saved_status()) { case fsa_full: if(other.fsa_get_saved_status() == fsa_full) { if(!isolated_mode) { const filesystem_specific_attribute_list *me = get_fsa(); const filesystem_specific_attribute_list *you = other.get_fsa(); if(me == nullptr) throw SRC_BUG; if(you == nullptr) throw SRC_BUG; if(!me->is_included_in(*you, scope)) throw Erange("cat_inode::compare", gettext("different Filesystem Specific Attributes")); } } else { if(scope.size() > 0) throw Erange("cat_inode::compare", gettext("No Filesystem Specific Attribute to compare with")); } break; case fsa_partial: if(other.fsa_get_saved_status() != fsa_none) { if(!tools_is_equal_with_hourshift(hourshift, get_last_change(), other.get_last_change()) && get_last_change() < other.get_last_change()) throw Erange("cat_inode::compare", gettext("inode last change date (ctime) greater, FSA might be different")); } else throw Erange("cat_inode::compare", gettext("Filesystem Specific Attribute are missing")); break; case fsa_none: break; // nothing to check default: throw SRC_BUG; } } void cat_inode::inherited_dump(const pile_descriptor & pdesc, bool small) const { U_16 tmp; unsigned char flag = 0; generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; // setting up the flag field switch(ea_saved) { case ea_none: flag |= INODE_FLAG_EA_NONE; break; case ea_partial: flag |= INODE_FLAG_EA_PART; break; case ea_fake: flag |= INODE_FLAG_EA_FAKE; break; case ea_full: flag |= INODE_FLAG_EA_FULL; break; case ea_removed: flag |= INODE_FLAG_EA_REMO; break; default: throw SRC_BUG; // unknown value for ea_saved } switch(fsa_saved) { case fsa_none: flag |= INODE_FLAG_FSA_NONE; break; case fsa_partial: flag |= INODE_FLAG_FSA_PART; break; case fsa_full: flag |= INODE_FLAG_FSA_FULL; break; default: throw SRC_BUG; // unknown value for fsa_saved } // saving parent class data cat_nomme::inherited_dump(pdesc, small); // saving unix inode specific part ptr->write((char *)(&flag), 1); uid.dump(*ptr); gid.dump(*ptr); tmp = htons(perm); ptr->write((char *)&tmp, sizeof(tmp)); last_acc.dump(*ptr); last_mod.dump(*ptr); if(last_cha == nullptr) throw SRC_BUG; last_cha->dump(*ptr); // EA part if(ea_saved == ea_full) ea_get_size().dump(*ptr); if(!small) { switch(ea_saved) { case ea_full: if(ea_offset == nullptr) throw SRC_BUG; ea_offset->dump(*ptr); if(ea_crc == nullptr) throw SRC_BUG; ea_crc->dump(*ptr); break; case ea_partial: case ea_fake: case ea_none: case ea_removed: break; default: throw SRC_BUG; } } // FSA part if(fsa_saved != fsa_none) { if(fsa_families == nullptr) throw SRC_BUG; fsa_families->dump(*ptr); } if(fsa_saved == fsa_full) { if(fsa_size == nullptr) throw SRC_BUG; fsa_size->dump(*ptr); } if(!small) { switch(fsa_saved) { case fsa_full: if(fsa_offset == nullptr) throw SRC_BUG; fsa_offset->dump(*ptr); if(fsa_crc == nullptr) throw SRC_BUG; fsa_crc->dump(*ptr); break; case fsa_partial: case fsa_none: break; default: throw SRC_BUG; } } } void cat_inode::ea_set_saved_status(ea_status status) { if(status == ea_saved) return; switch(status) { case ea_none: case ea_removed: case ea_partial: case ea_fake: if(ea != nullptr) { delete ea; ea = nullptr; } if(ea_offset != nullptr) { delete ea_offset; ea_offset = nullptr; } break; case ea_full: if(ea != nullptr) throw SRC_BUG; if(ea_offset != nullptr) throw SRC_BUG; break; default: throw SRC_BUG; } ea_saved = status; } void cat_inode::ea_attach(ea_attributs *ref) { if(ea_saved != ea_full) throw SRC_BUG; if(ref != nullptr && ea == nullptr) { if(ea_size != nullptr) { delete ea_size; ea_size = nullptr; } ea_size = new (get_pool()) infinint(ref->space_used()); if(ea_size == nullptr) throw Ememory("cat_inode::ea_attach"); ea = ref; } else throw SRC_BUG; } const ea_attributs *cat_inode::get_ea() const { switch(ea_saved) { case ea_full: if(ea != nullptr) return ea; else if(get_pile() != nullptr) // reading from archive { crc *val = nullptr; const crc *my_crc = nullptr; try { if(!small_read) // direct read mode { if(ea_offset == nullptr) throw SRC_BUG; get_pile()->flush_read_above(get_compressor_layer()); get_compressor_layer()->resume_compression(); get_pile()->skip(*ea_offset); } else // sequential read mode { if(get_escape_layer() == nullptr) throw SRC_BUG; // warning this section calls *esc directly while it may be managed by another thread // we are reading from the stack the possible thread is not in read_ahead operation // so it is pending for read request or other orders if(!get_escape_layer()->skip_to_next_mark(escape::seqt_ea, false)) throw Erange("cat_inode::get_ea", string("Error while fetching EA from archive: No escape mark found for that file")); // resuming compression (EA are always stored compressed) get_pile()->flush_read_above(get_compressor_layer()); get_compressor_layer()->resume_compression(); // we shall reset layers above esc for they do not assume nothing has changed below them get_pile()->flush_read_above(get_escape_layer()); // now we can continue normally using get_pile() const_cast(this)->ea_set_offset(get_pile()->get_position()); } if(ea_get_size().is_zero()) get_pile()->reset_crc(crc::OLD_CRC_SIZE); else { get_pile()->reset_crc(tools_file_size_to_crc_size(ea_get_size())); get_pile()->read_ahead(ea_get_size()); } try { try { if(edit <= 1) throw SRC_BUG; // EA do not exist in that archive format const_cast(ea) = new (get_pool()) ea_attributs(*get_pile(), edit); if(ea == nullptr) throw Ememory("cat_inode::get_ea"); } catch(Euser_abort & e) { throw; } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { throw Erange("cat_inode::get_ea", string("Error while reading EA from archive: ") + e.get_message()); } } catch(...) { val = get_pile()->get_crc(); // keeps storage in coherent status throw; } val = get_pile()->get_crc(); if(val == nullptr) throw SRC_BUG; ea_get_crc(my_crc); // ea_get_crc() will eventually fetch the CRC for EA from the archive (sequential reading) if(my_crc == nullptr) throw SRC_BUG; if(typeid(*val) != typeid(*my_crc) || *val != *my_crc) throw Erange("cat_inode::get_ea", gettext("CRC error detected while reading EA")); } catch(...) { if(val != nullptr) delete val; throw; } if(val != nullptr) delete val; return ea; } else throw SRC_BUG; // no need of break here throw SRC_BUG; // but ... instead of break we use some more radical precaution. case ea_removed: return &empty_ea; // no need of break here default: throw SRC_BUG; } } void cat_inode::ea_detach() const { if(ea != nullptr) { delete ea; const_cast(ea) = nullptr; } } infinint cat_inode::ea_get_size() const { if(ea_saved == ea_full) { if(ea_size == nullptr) // reading an old archive { if(ea != nullptr) { const_cast(this)->ea_size = new (get_pool()) infinint (ea->space_used()); if(ea_size == nullptr) throw Ememory("cat_inode::ea_get_size"); } else // else we stick with value 0, meaning that we read an old archive return 0; } return *ea_size; } else throw SRC_BUG; } void cat_inode::ea_set_offset(const infinint & pos) { if(ea_offset == nullptr) { ea_offset = new (get_pool()) infinint(pos); if(ea_offset == nullptr) throw Ememory("cat_inode::ea_set_offset"); } else *ea_offset = pos; } bool cat_inode::ea_get_offset(infinint & val) const { if(ea_offset != nullptr) { val = *ea_offset; return true; } else return false; } void cat_inode::ea_set_crc(const crc & val) { if(ea_crc != nullptr) { delete ea_crc; ea_crc = nullptr; } ea_crc = val.clone(); if(ea_crc == nullptr) throw Ememory("cat_inode::ea_set_crc"); } void cat_inode::ea_get_crc(const crc * & ptr) const { if(ea_get_saved_status() != ea_full) throw SRC_BUG; if(small_read && ea_crc == nullptr) { if(get_escape_layer() == nullptr) throw SRC_BUG; if(get_escape_layer()->skip_to_next_mark(escape::seqt_ea_crc, false)) { crc *tmp = nullptr; try { if(edit >= 8) tmp = create_crc_from_file(*get_escape_layer(), get_pool(), false); else // archive format <= 7 tmp = create_crc_from_file(*get_escape_layer(), get_pool(), true); if(tmp == nullptr) throw SRC_BUG; const_cast(this)->ea_crc = tmp; tmp = nullptr; // the object is now owned by "this" } catch(...) { get_pile()->flush_read_above(get_escape_layer()); if(tmp != nullptr) delete tmp; throw; } get_pile()->flush_read_above(get_escape_layer()); } else // skip failed on the escape layer { crc *tmp = new (get_pool()) crc_n(1); // creating a default CRC if(tmp == nullptr) throw Ememory("cat_inode::ea_get_crc"); get_pile()->flush_read_above(get_escape_layer()); try { tmp->clear(); const_cast(this)->ea_crc = tmp; // this is to avoid trying to fetch the CRC a new time if decision // has been taken to continue the operation after the exception // thrown below has been caught. tmp = nullptr; // the object is now owned by "this" } catch(...) { delete tmp; throw; } throw Erange("cat_inode::ea_get_crc", gettext("Error while reading CRC for EA from the archive: No escape mark found for that file")); } } if(ea_crc == nullptr) throw SRC_BUG; else ptr = ea_crc; } bool cat_inode::ea_get_crc_size(infinint & val) const { if(ea_crc != nullptr) { val = ea_crc->get_size(); return true; } else return false; } datetime cat_inode::get_last_change() const { if(last_cha == nullptr) throw SRC_BUG; else return *last_cha; } void cat_inode::set_last_change(const datetime & x_time) { if(last_cha == nullptr) throw SRC_BUG; else *last_cha = x_time; } void cat_inode::fsa_set_saved_status(fsa_status status) { if(status == fsa_saved) return; switch(status) { case fsa_none: case fsa_partial: if(fsal != nullptr) { delete fsal; fsal = nullptr; } if(fsa_offset != nullptr) { delete fsa_offset; fsa_offset = nullptr; } break; case fsa_full: if(fsal != nullptr) throw SRC_BUG; if(fsa_offset != nullptr) throw SRC_BUG; break; default: throw SRC_BUG; } fsa_saved = status; } void cat_inode::fsa_attach(filesystem_specific_attribute_list *ref) { if(fsa_saved != fsa_full) throw SRC_BUG; if(ref != nullptr && fsal == nullptr) { if(fsa_size != nullptr) { delete fsa_size; fsa_size = nullptr; } if(fsa_families != nullptr) { delete fsa_families; fsa_families = nullptr; } try { fsa_size = new (get_pool()) infinint (ref->storage_size()); fsa_families = new(get_pool()) infinint(fsa_scope_to_infinint(ref->get_fsa_families())); if(fsa_size == nullptr || fsa_families == nullptr) throw Ememory("cat_inode::fsa_attach"); } catch(...) { if(fsa_size != nullptr) { delete fsa_size; fsa_size = nullptr; } if(fsa_families != nullptr) { delete fsa_families; fsa_families = nullptr; } throw; } fsal = ref; } else throw SRC_BUG; } void cat_inode::fsa_detach() const { if(fsal != nullptr) { delete fsal; const_cast(this)->fsal = nullptr; } } const filesystem_specific_attribute_list *cat_inode::get_fsa() const { switch(fsa_saved) { case fsa_full: if(fsal != nullptr) return fsal; else if(get_pile() != nullptr) // reading from archive { crc *val = nullptr; const crc *my_crc = nullptr; try { generic_file *reader = nullptr; if(get_escape_layer() == nullptr) reader = get_compressor_layer(); else reader = get_escape_layer(); if(reader == nullptr) throw SRC_BUG; // we shall reset layers above reader get_pile()->flush_read_above(reader); if(!small_read) // direct reading mode { if(fsa_offset == nullptr) throw SRC_BUG; reader->skip(*fsa_offset); } else { if(get_escape_layer() == nullptr) throw SRC_BUG; // warning this section calls *get_escape_layer() directly while it may be managed by another thread // we are reading from the get_pile() the possible thread is not in read_ahead operation // so it is pending for read request or other orders if(!get_escape_layer()->skip_to_next_mark(escape::seqt_fsa, false)) throw Erange("cat_inode::get_fsa", string("Error while fetching FSA from archive: No escape mark found for that file")); const_cast(this)->fsa_set_offset(get_escape_layer()->get_position()); } if(get_escape_layer() == nullptr) { // FSA is never stored compressed, we must change the compression algo // but only if necessary if(get_compressor_layer()->get_algo() != none) get_compressor_layer()->suspend_compression(); } reader->reset_crc(tools_file_size_to_crc_size(fsa_get_size())); try { try { const_cast(this)->fsal = new (get_pool()) filesystem_specific_attribute_list(); if(fsal == nullptr) throw Ememory("cat_inode::get_fsa"); try { reader->read_ahead(fsa_get_size()); const_cast(this)->fsal->read(*reader, edit); } catch(...) { delete fsal; const_cast(this)->fsal = nullptr; throw; } } catch(Euser_abort & e) { throw; } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { throw Erange("cat_inode::get_fda", string("Error while reading FSA from archive: ") + e.get_message()); } } catch(...) { val = reader->get_crc(); // keeps storage in coherent status throw; } val = reader->get_crc(); if(val == nullptr) throw SRC_BUG; fsa_get_crc(my_crc); // fsa_get_crc() will eventually fetch the CRC for FSA from the archive (sequential reading) if(my_crc == nullptr) throw SRC_BUG; if(typeid(*val) != typeid(*my_crc) || *val != *my_crc) throw Erange("cat_inode::get_fsa", gettext("CRC error detected while reading FSA")); } catch(...) { if(val != nullptr) delete val; throw; } if(val != nullptr) delete val; return fsal; } else throw SRC_BUG; // no need of break here throw SRC_BUG; // but ... instead of break we use some more radical precaution. default: throw SRC_BUG; } } infinint cat_inode::fsa_get_size() const { if(fsa_saved == fsa_full) if(fsa_size != nullptr) return *fsa_size; else throw SRC_BUG; else throw SRC_BUG; } void cat_inode::fsa_set_offset(const infinint & pos) { if(fsa_offset == nullptr) { fsa_offset = new (get_pool()) infinint(pos); if(fsa_offset == nullptr) throw Ememory("cat_inode::fsa_set_offset"); } else *fsa_offset = pos; } bool cat_inode::fsa_get_offset(infinint & pos) const { if(fsa_offset != nullptr) { pos = *fsa_offset; return true; } else return false; } void cat_inode::fsa_set_crc(const crc & val) { if(fsa_crc != nullptr) { delete fsa_crc; fsa_crc = nullptr; } fsa_crc = val.clone(); if(fsa_crc == nullptr) throw Ememory("cat_inode::fsa_set_crc"); } void cat_inode::fsa_get_crc(const crc * & ptr) const { if(fsa_get_saved_status() != fsa_full) throw SRC_BUG; if(small_read && fsa_crc == nullptr) { if(get_escape_layer() == nullptr) throw SRC_BUG; if(get_pile() == nullptr) throw SRC_BUG; if(get_escape_layer()->skip_to_next_mark(escape::seqt_fsa_crc, false)) { crc *tmp = nullptr; try { tmp = create_crc_from_file(*get_escape_layer(), get_pool(), false); if(tmp == nullptr) throw SRC_BUG; const_cast(this)->fsa_crc = tmp; tmp = nullptr; // the object is now owned by "this" } catch(...) { get_pile()->flush_read_above(get_escape_layer()); if(tmp != nullptr) delete tmp; throw; } get_pile()->flush_read_above(get_escape_layer()); } else // fsa_crc mark not found { crc *tmp = new (get_pool()) crc_n(1); // creating a default CRC if(tmp == nullptr) throw Ememory("cat_inode::fsa_get_crc"); get_pile()->flush_read_above(get_escape_layer()); try { tmp->clear(); const_cast(this)->fsa_crc = tmp; // this is to avoid trying to fetch the CRC a new time if decision // has been taken to continue the operation after the exception // thrown below has been caught. tmp = nullptr; // the object is now owned by "this" } catch(...) { delete tmp; throw; } throw Erange("cat_inode::fsa_get_crc", gettext("Error while reading CRC for FSA from the archive: No escape mark found for that file")); } } if(fsa_crc == nullptr) throw SRC_BUG; else ptr = fsa_crc; } bool cat_inode::fsa_get_crc_size(infinint & val) const { if(fsa_crc != nullptr) { val = fsa_crc->get_size(); return true; } else return false; } void cat_inode::nullifyptr() { last_cha = nullptr; ea_offset = nullptr; ea = nullptr; ea_size = nullptr; ea_crc = nullptr; fsa_families = nullptr; fsa_offset = nullptr; fsal = nullptr; fsa_size = nullptr; fsa_crc = nullptr; fs_dev = nullptr; } void cat_inode::destroy() { if(last_cha != nullptr) { delete last_cha; last_cha = nullptr; } if(ea_offset != nullptr) { delete ea_offset; ea_offset = nullptr; } if(ea != nullptr) { delete ea; ea = nullptr; } if(ea_size != nullptr) { delete ea_size; ea_size = nullptr; } if(ea_crc != nullptr) { delete ea_crc; ea_crc = nullptr; } if(fsa_families != nullptr) { delete fsa_families; fsa_families = nullptr; } if(fsa_offset != nullptr) { delete fsa_offset; fsa_offset = nullptr; } if(fsal != nullptr) { delete fsal; fsal = nullptr; } if(fsa_size != nullptr) { delete fsa_size; fsa_size = nullptr; } if(fsa_crc != nullptr) { delete fsa_crc; fsa_crc = nullptr; } if(fs_dev != nullptr) { delete fs_dev; fs_dev = nullptr; } } template void copy_ptr(const T *src, T * & dst, memory_pool *p) { if(src == nullptr) dst = nullptr; else { dst = new (p) T(*src); if(dst == nullptr) throw Ememory("copy_ptr template"); } } void cat_inode::copy_from(const cat_inode & ref) { try { uid = ref.uid; gid = ref.gid; perm = ref.perm; last_acc = ref.last_acc; last_mod = ref.last_mod; copy_ptr(ref.last_cha, last_cha, get_pool()); xsaved = ref.xsaved; ea_saved = ref.ea_saved; fsa_saved = ref.fsa_saved; small_read = ref.small_read; copy_ptr(ref.ea_offset, ea_offset, get_pool()); copy_ptr(ref.ea, ea, get_pool()); copy_ptr(ref.ea_size, ea_size, get_pool()); if(ref.ea_crc != nullptr) { ea_crc = (ref.ea_crc)->clone(); if(ea_crc == nullptr) throw Ememory("cat_inode::copy_from"); } else ea_crc = nullptr; copy_ptr(ref.fsa_families, fsa_families, get_pool()); copy_ptr(ref.fsa_offset, fsa_offset, get_pool()); copy_ptr(ref.fsal, fsal, get_pool()); copy_ptr(ref.fsa_size, fsa_size, get_pool()); if(ref.fsa_crc != nullptr) { fsa_crc = (ref.fsa_crc)->clone(); if(fsa_crc == nullptr) throw Ememory("cat_inode::copy_from"); } else fsa_crc = nullptr; copy_ptr(ref.fs_dev, fs_dev, get_pool()); edit = ref.edit; } catch(...) { destroy(); throw; } } } // end of namespace dar-2.5.3/src/libdar/scrambler.cpp0000644000175000017430000000542112641772777013742 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "scrambler.hpp" using namespace std; namespace libdar { scrambler::scrambler(const secu_string & pass, generic_file & hidden_side) : generic_file(hidden_side.get_mode()) { if(pass.get_size() == 0) throw Erange("scrambler::scrambler", gettext("Key cannot be an empty string")); key = pass; len = key.get_size(); ref = & hidden_side; buffer = nullptr; buf_size = 0; } U_I scrambler::inherited_read(char *a, U_I size) { if(ref == nullptr) throw SRC_BUG; unsigned char *ptr = (unsigned char *)a; U_32 index = ref->get_position() % len; U_I ret = ref->read(a, size); for(U_I i = 0; i < ret; ++i) { ptr[i] = ((S_I)(ptr[i]) - (unsigned char)(key[index])) % 256; index = (index + 1)%len; } return ret; } void scrambler::inherited_write(const char *a, U_I size) { const unsigned char *ptr = (const unsigned char *)a; if(ref == nullptr) throw SRC_BUG; U_32 index = ref->get_position() % len; if(size > buf_size) { if(buffer != nullptr) { meta_delete(buffer); buffer = nullptr; } meta_new(buffer, size); if(buffer != nullptr) buf_size = size; else { buf_size = 0; throw Ememory("scramble::inherited_write"); } } for(U_I i = 0; i < size; ++i) { buffer[i] = (ptr[i] + (unsigned char)(key[index])) % 256; index = (index + 1)%len; } ref->write((char *)buffer, size); } } // end of namespace dar-2.5.3/src/libdar/tools.cpp0000644000175000017430000026143512642474445013131 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_WAIT_H # include #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #ifndef WIFSTOPPED #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) #endif #ifndef WIFSIGNALED # define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) #endif #ifndef WTERMSIG #define WTERMSIG(status) ((status) & 0x7f) #endif #if HAVE_ERRNO_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SIGNAL_H #include #endif #if HAVE_SYS_TYPE_H #include #endif #if HAVE_UTIME_H #include #endif #if HAVE_SYS_TIME_H #include #endif #if HAVE_CTYPE_H #include #endif #if HAVE_PWD_H #include #endif #if HAVE_GRP_H #include #endif #if HAVE_STDLIB_H #include #endif #if HAVE_SYS_UTSNAME_H #include #endif #if HAVE_WCHAR_H #include #endif #if HAVE_WCTYPE_H #include #endif #if HAVE_STDDEF_H #include #endif #if HAVE_DIRENT_H #include #endif } // end extern "C" #include #include #include #include "nls_swap.hpp" #include "tools.hpp" #include "erreurs.hpp" #include "deci.hpp" #include "user_interaction.hpp" #include "integers.hpp" #include "mask.hpp" #include "etage.hpp" #include "elastic.hpp" #ifdef __DYNAMIC__ #include "user_group_bases.hpp" #endif #include "compile_time_features.hpp" #include "memory_file.hpp" #define YES_NO(x) (x ? gettext("YES") : gettext("NO")) using namespace std; namespace libdar { #ifdef __DYNAMIC__ // Yes, this is a static variable, // it contains the necessary mutex to keep libdar thread-safe static const user_group_bases *user_group = nullptr; #endif // the following variable is static this breaks the threadsafe support // while it also concerns the signaling which is out process related static void runson(user_interaction & dialog, char * const argv[]); static void ignore_deadson(S_I sig); static void abort_on_deadson(S_I sig); static bool is_a_slice_available(user_interaction & ui, const string & base, const string & extension, memory_pool *pool); static string retreive_basename(const string & base, const string & extension); static void tools_localtime(const time_t & timep, struct tm *result); void tools_init() { #ifdef __DYNAMIC__ if(user_group == nullptr) { user_group = new (nothrow) user_group_bases(); if(user_group == nullptr) throw Ememory("tools_init"); } #endif } void tools_end() { #ifdef __DYNAMIC__ if(user_group != nullptr) { delete user_group; user_group = nullptr; } #endif } char *tools_str2charptr(const string &x) { U_I size = x.size(); char *ret = new (nothrow) char[size+1]; if(ret == nullptr) throw Ememory("tools_str2charptr"); (void)memcpy(ret, x.c_str(), size); ret[size] = '\0'; return ret; } void tools_write_string(generic_file & f, const string & s) { tools_write_string_all(f, s); f.write("", 1); // adding a '\0' at the end; } void tools_read_string(generic_file & f, string & s) { char a[2] = { 0, 0 }; S_I lu; s = ""; do { lu = f.read(a, 1); if(lu == 1 && a[0] != '\0') s += a; } while(lu == 1 && a[0] != '\0'); if(lu != 1 || a[0] != '\0') throw Erange("tools_read_string", dar_gettext("Not a zero terminated string in file")); } void tools_write_string_all(generic_file & f, const string & s) { f.write(s.c_str(), s.size()); } void tools_read_string_size(generic_file & f, string & s, infinint taille) { U_16 small_read = 0; U_I max_read = 0; S_I lu = 0; const U_I buf_size = 10240; char buffer[buf_size]; s = ""; do { if(small_read > 0) { max_read = small_read > buf_size ? buf_size : small_read; lu = f.read(buffer, max_read); small_read -= lu; s += string((char *)buffer, (char *)buffer+lu); } taille.unstack(small_read); } while(small_read > 0); } infinint tools_get_filesize(const path &p) { struct stat buf; if(lstat(p.display().c_str(), &buf) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools_get_filesize", tools_printf(dar_gettext("Cannot get file size: %s"), tmp.c_str())); } return (U_32)buf.st_size; } infinint tools_get_extended_size(string s, U_I base) { U_I len = s.size(); infinint factor = 1; if(len < 1) return false; switch(s[len-1]) { case 'K': case 'k': // kilobyte factor = base; break; case 'M': // megabyte factor = infinint(base).power((U_I)2); break; case 'G': // gigabyte factor = infinint(base).power((U_I)3); break; case 'T': // terabyte factor = infinint(base).power((U_I)4); break; case 'P': // petabyte factor = infinint(base).power((U_I)5); break; case 'E': // exabyte factor = infinint(base).power((U_I)6); break; case 'Z': // zettabyte factor = infinint(base).power((U_I)7); break; case 'Y': // yottabyte factor = infinint(base).power((U_I)8); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; default : throw Erange("command_line get_extended_size", tools_printf(dar_gettext("Unknown suffix [%c] in string %S"), s[len-1], &s)); } if(factor != 1) s = string(s.begin(), s.end()-1); deci tmp = s; factor *= tmp.computer(); return factor; } string tools_display_integer_in_metric_system(infinint number, const string & unit, bool binary) { string ret = ""; infinint multiple = binary ? 1024 : 1000; U_I power = 0; // 1 = 'k', 2 = 'M', 3 = 'G', 4 = 'T', 5 = 'P', 6 = 'E', 7 = 'Z', 8 = 'Y' while(number >= multiple && power < 8) { ++power; number /= multiple; } ret = deci(number).human(); if(unit.size() > 0) ret += " "; // a space is required by convention to separate the number from its unit switch(power) { case 0: if(!number.is_zero()) ret += unit; // not displaying unit for zero for clarity in particular when octets symbol is used // which would give "0 o" that is somehow not very easy to read/understand break; case 1: ret += (binary ? "ki" : "k") + unit; break; case 2: ret += (binary ? "Mi" : "M") + unit; break; case 3: ret += (binary ? "Gi" : "G") + unit; break; case 4: ret += (binary ? "Ti" : "T") + unit; break; case 5: ret += (binary ? "Pi" : "P") + unit; break; case 6: ret += (binary ? "Ei" : "E") + unit; break; case 7: ret += (binary ? "Zi" : "Z") + unit; break; default: ret += (binary ? "Yi" : "Y") + unit; break; } return ret; } void tools_extract_basename(const char *command_name, string &basename) { basename = path(command_name).basename(); } string::iterator tools_find_last_char_of(string &s, unsigned char v) { if(s.empty()) return s.end(); string::iterator back, it = s.begin(); bool valid = (it != s.end()) && (*it == v); while(it != s.end()) { back = it; it = find(it + 1, s.end(), v); } if(!valid && (back == s.begin())) // no char found at all (back has been sticked at the beginning and the first character is not the one we look for return s.end(); else return back; } string::iterator tools_find_first_char_of(string &s, unsigned char v) { string::iterator it = s.begin(); while(it != s.end() && *it != v) ++it; return it; } void tools_split_path_basename(const char *all, path * &chemin, string & base, memory_pool *pool) { chemin = nullptr; string src = all; string::iterator it = tools_find_last_char_of(src, '/'); if(it != src.end()) // path separator found (pointed to by "it") { it += 1; base = string(it, src.end()); chemin = new (pool) path(string(src.begin(), it), true); } else { base = src; chemin = new (pool) path("."); } if(chemin == nullptr) throw Ememory("tools_split_path_basename"); } void tools_split_path_basename(const string & all, string & chemin, string & base, memory_pool *pool) { path *tmp = nullptr; tools_split_path_basename(all.c_str(), tmp, base, pool); if(tmp == nullptr) throw SRC_BUG; chemin = tmp->display(); delete tmp; } void tools_open_pipes(user_interaction & dialog, const string &input, const string & output, tuyau *&in, tuyau *&out, memory_pool *pool) { in = out = nullptr; try { if(input != "") in = new (pool) tuyau(dialog, input, gf_read_only); else in = new (pool) tuyau(dialog, 0, gf_read_only); // stdin by default if(in == nullptr) throw Ememory("tools_open_pipes"); if(output != "") out = new (pool) tuyau(dialog, output, gf_write_only); else out = new (pool) tuyau(dialog, 1, gf_write_only); // stdout by default if(out == nullptr) throw Ememory("tools_open_pipes"); } catch(...) { if(in != nullptr) delete in; if(out != nullptr) delete out; throw; } } void tools_blocking_read(S_I fd, bool mode) { S_I flags = fcntl(fd, F_GETFL, 0); if(flags < 0) throw Erange("tools_blocking_read", string(dar_gettext("Cannot read \"fcntl\" file's flags : "))+tools_strerror_r(errno)); if(!mode) flags |= O_NONBLOCK; else flags &= ~O_NONBLOCK; if(fcntl(fd, F_SETFL, flags) < 0) throw Erange("tools_blocking_read", string(dar_gettext("Cannot set \"fcntl\" file's flags : "))+tools_strerror_r(errno)); } string tools_name_of_uid(const infinint & uid) { #ifndef __DYNAMIC__ string name = ""; #else string name; if(user_group != nullptr) name = user_group->get_username(uid); else throw SRC_BUG; #endif if(name.empty()) // uid not associated with a name { deci d = uid; return d.human(); } else return name; } string tools_name_of_gid(const infinint & gid) { #ifndef __DYNAMIC__ string name = ""; #else string name; if(user_group != nullptr) name = user_group->get_groupname(gid); else throw SRC_BUG; #endif if(name.empty()) // uid not associated with a name { deci d = gid; return d.human(); } else return name; } string tools_uword2str(U_16 x) { ostringstream tmp; tmp << x; return tmp.str(); } string tools_int2str(S_I x) { ostringstream tmp; tmp << x; return tmp.str(); } string tools_uint2str(U_I x) { ostringstream tmp; tmp << x; return tmp.str(); } U_I tools_str2int(const string & x) { stringstream tmp(x); U_I ret; string residu; if((tmp >> ret).fail()) throw Erange("tools_str2string", string(dar_gettext("Invalid number: ")) + x); tmp >> residu; for(U_I i = 0; i < residu.size(); ++i) if(residu[i] != ' ') throw Erange("tools_str2string", string(dar_gettext("Invalid number: ")) + x); return ret; } S_I tools_str2signed_int(const string & x) { stringstream tmp(x); S_I ret; string residu; if((tmp >> ret).fail()) throw Erange("tools_str2string", string(dar_gettext("Invalid number: ")) + x); tmp >> residu; for(U_I i = 0; i < residu.size(); ++i) if(residu[i] != ' ') throw Erange("tools_str2string", string(dar_gettext("Invalid number: ")) + x); return ret; } bool tools_my_atoi(const char *a, U_I & val) { try { val = tools_str2int(a); return true; } catch(Erange & e) { val = 0; return false; } } string tools_addspacebefore(string s, U_I expected_size) { return string(expected_size - s.size(), ' ') + s; } string tools_display_date(const datetime & date) { time_t pas = 0; time_t frac = 0; string ret; if(!date.get_value(pas, frac, datetime::tu_second)) // conversion to system type failed. Using a replacement string return deci(date.get_second_value()).human(); else { char *val = nullptr; #if HAVE_CTIME_R char *str = new (nothrow) char [50]; //< minimum required is 26 bytes if(str == nullptr) throw Ememory("tools_display_date"); try { val = ctime_r(&pas, str); #else val = ctime(&pas); #endif if(val == nullptr) // ctime() failed ret = tools_int2str(pas); else ret = val; #if HAVE_CTIME_R } catch(...) { delete [] str; throw; } delete [] str; #else ret = val; #endif } return string(ret.begin(), ret.end() - 1); // -1 to remove the ending '\n' } infinint tools_convert_date(const string & repres) { enum status { init, year, month, day, hour, min, sec, error, finish }; /// first we define a helper class class scan { public: scan(const tm & now) { etat = init; when = now; when.tm_sec = when.tm_min = when.tm_hour = 0; when.tm_wday = 0; // ignored by mktime when.tm_yday = 0; // ignored by mktime when.tm_isdst = 1; // provided time is local daylight saving time tmp = 0; }; status get_etat() const { return etat; }; tm get_struct() const { return when; }; void add_digit(char a) { if(a < 48 || a > 57) // ascii code for zero is 48, for nine is 57 throw SRC_BUG; tmp = tmp*10 + (a-48); }; void set_etat(const status & val) { switch(etat) { case year: if(tmp < 1970) throw Erange("tools_convert_date", dar_gettext("date before 1970 is not allowed")); when.tm_year = tmp - 1900; break; case month: if(tmp < 1 || tmp > 12) throw Erange("tools_convert_date", dar_gettext("Incorrect month")); when.tm_mon = tmp - 1; break; case day: if(tmp < 1 || tmp > 31) throw Erange("tools_convert_date", dar_gettext("Incorrect day of month")); when.tm_mday = tmp; break; case hour: if(tmp < 0 || tmp > 23) throw Erange("tools_convert_date", dar_gettext("Incorrect hour")); when.tm_hour = tmp; break; case min: if(tmp < 0 || tmp > 59) throw Erange("tools_convert_date", dar_gettext("Incorrect minute")); when.tm_min = tmp; break; case sec: if(tmp < 0 || tmp > 59) throw Erange("tools_convert_date", dar_gettext("Incorrect second")); when.tm_sec = tmp; break; case error: throw Erange("tools_convert_date", dar_gettext("Bad formatted date expression")); default: break; // nothing to do } tmp = 0; etat = val; }; private: struct tm when; status etat; S_I tmp; }; // then we define local variables time_t now = ::time(nullptr), when; struct tm result; tools_localtime(now, &result); scan scanner = scan(result); U_I c, size = repres.size(), ret; struct tm tmp; // now we parse the string to update the stucture tm "when" // first, determining initial state switch(tools_count_in_string(repres, '/')) { case 0: switch(tools_count_in_string(repres, '-')) { case 0: scanner.set_etat(hour); break; case 1: scanner.set_etat(day); break; default: scanner.set_etat(error); } break; case 1: scanner.set_etat(month); break; case 2: scanner.set_etat(year); break; default: scanner.set_etat(error); } // second, parsing the string for(c = 0; c < size && scanner.get_etat() != error; ++c) switch(repres[c]) { case '/': switch(scanner.get_etat()) { case year: scanner.set_etat(month); break; case month: scanner.set_etat(day); break; default: scanner.set_etat(error); } break; case ':': switch(scanner.get_etat()) { case hour: scanner.set_etat(min); break; case min: scanner.set_etat(sec); break; default: scanner.set_etat(error); } break; case '-': switch(scanner.get_etat()) { case day: scanner.set_etat(hour); break; default: scanner.set_etat(error); } break; case ' ': case '\t': case '\n': case '\r': break; // we ignore spaces, tabs, CR and LF case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': scanner.add_digit(repres[c]); break; default: scanner.set_etat(error); } scanner.set_etat(finish); tmp = scanner.get_struct(); when = mktime(&tmp); if(when > now) throw Erange("tools_convert_date", dar_gettext("Given date must be in the past")); ret = when; return ret; } void tools_system(user_interaction & dialog, const vector & argvector) { if(argvector.empty()) return; // nothing to do // ISO C++ forbids variable-size array char **argv = new (nothrow) char * [argvector.size()+1]; for(U_I i = 0; i <= argvector.size(); i++) argv[i] = nullptr; try { S_I status; bool loop; for(U_I i = 0; i < argvector.size(); i++) argv[i] = tools_str2charptr(argvector[i]); argv[argvector.size()] = nullptr; // this is already done above but that does not hurt doing it twice :-) do { ignore_deadson(0); loop = false; S_I pid = fork(); switch(pid) { case -1: throw Erange("tools_system", string(dar_gettext("Error while calling fork() to launch dar: ")) + tools_strerror_r(errno)); case 0: // fork has succeeded, we are the child process try { runson(dialog, argv); // function that never returns or throws exceptions throw SRC_BUG; // just in case the previous function returned } catch(...) { throw SRC_BUG; } default: if(wait(&status) <= 0) throw Erange("tools_system", string(dar_gettext("Unexpected error while waiting for dar to terminate: ")) + tools_strerror_r(errno)); else // checking the way dar has exit if(WIFSIGNALED(status)) // exited because of a signal { try { dialog.pause(string(dar_gettext("DAR terminated upon signal reception: ")) #if HAVE_DECL_SYS_SIGLIST + (WTERMSIG(status) < NSIG ? sys_siglist[WTERMSIG(status)] : tools_int2str(WTERMSIG(status))) #else + tools_int2str(WTERMSIG(status)) #endif + dar_gettext(" . Retry to launch dar as previously ?")); loop = true; } catch(Euser_abort & e) { dialog.pause(dar_gettext(" Continue anyway ?")); } } else // normal terminaison checking exit status code if(WEXITSTATUS(status) != 0) dialog.pause(string(dar_gettext("DAR sub-process has terminated with exit code ")) + tools_int2str(WEXITSTATUS(status)) + dar_gettext(" Continue anyway ?")); } } while(loop); } catch(...) { for(U_I i = 0; i <= argvector.size(); i++) if(argv[i] != nullptr) delete [] argv[i]; delete argv; throw; } for(U_I i = 0; i <= argvector.size(); i++) if(argv[i] != nullptr) delete [] argv[i]; delete argv; } void tools_system_with_pipe(user_interaction & dialog, const string & dar_cmd, const vector & argvpipe, memory_pool *pool) { const char *argv[] = { dar_cmd.c_str(), "--pipe-fd", nullptr, nullptr }; bool loop = false; do { tuyau *tube = nullptr; try { tube = new (pool) tuyau(dialog); if(tube == nullptr) throw Ememory("tools_system_with_pipe"); const string read_fd = tools_int2str(tube->get_read_fd()); tlv_list pipeargs; S_I status; argv[2] = read_fd.c_str(); signal(SIGCHLD, &abort_on_deadson); // do not accept child death loop = false; S_I pid = fork(); switch(pid) { case -1: throw Erange("tools_system_with_pipe", string(dar_gettext("Error while calling fork() to launch dar: ")) + tools_strerror_r(errno)); case 0: // fork has succeeded, we are the child process try { if(tube != nullptr) { tube->do_not_close_read_fd(); delete tube; // C++ object is destroyed but read filedescriptor has been kept open tube = nullptr; runson(dialog, const_cast(argv)); throw SRC_BUG; } else throw SRC_BUG; } catch(...) { throw SRC_BUG; } default: // fork has succeeded, we are the parent process tube->close_read_fd(); pipeargs = tools_string2tlv_list(dialog, 0, argvpipe); pipeargs.dump(*tube); ignore_deadson(0); // now we can ignore SIGCHLD signals just before destroying the pipe filedescriptor, which will trigger and EOF while reading on pipe // in the child process delete tube; tube = nullptr; if(wait(&status) <= 0) throw Erange("tools_system", string(dar_gettext("Unexpected error while waiting for dar to terminate: ")) + tools_strerror_r(errno)); else // checking the way dar has exit if(WIFSIGNALED(status)) // exited because of a signal { try { dialog.pause(string(dar_gettext("DAR terminated upon signal reception: ")) #if HAVE_DECL_SYS_SIGLIST + (WTERMSIG(status) < NSIG ? sys_siglist[WTERMSIG(status)] : tools_int2str(WTERMSIG(status))) #else + tools_int2str(WTERMSIG(status)) #endif + dar_gettext(" . Retry to launch dar as previously ?")); loop = true; } catch(Euser_abort & e) { dialog.pause(dar_gettext(" Continue anyway ?")); } } else // normal terminaison checking exit status code if(WEXITSTATUS(status) != 0) dialog.pause(string(dar_gettext("DAR sub-process has terminated with exit code ")) + tools_int2str(WEXITSTATUS(status)) + dar_gettext(" Continue anyway ?")); } } catch(...) { if(tube != nullptr) delete tube; throw; } if(tube != nullptr) delete tube; } while(loop); } void tools_write_vector(generic_file & f, const vector & x) { infinint tmp = x.size(); vector::const_iterator it = x.begin(); tmp.dump(f); while(it != x.end()) tools_write_string(f, *it++); } void tools_read_vector(generic_file & f, vector & x) { infinint tmp = infinint(f); string elem; x.clear(); while(!tmp.is_zero()) { tools_read_string(f, elem); x.push_back(elem); tmp--; } } string tools_concat_vector(const string & separator, const vector & x) { string ret = separator; vector::const_iterator it = x.begin(); while(it != x.end()) ret += *it++ + separator; return ret; } vector operator + (vector a, vector b) { vector::iterator it = b.begin(); while(it != b.end()) a.push_back(*it++); return a; } const char *tools_get_from_env(const char **env, const char *clef) { unsigned int index = 0; const char *ret = nullptr; if(env == nullptr || clef == nullptr) return nullptr; while(ret == nullptr && env[index] != nullptr) { unsigned int letter = 0; while(clef[letter] != '\0' && env[index][letter] != '\0' && env[index][letter] != '=' && clef[letter] == env[index][letter]) letter++; if(clef[letter] == '\0' && env[index][letter] == '=') ret = env[index]+letter+1; else index++; } return ret; } void tools_display_features(user_interaction & dialog) { NLS_SWAP_IN; try { const char *endy = nullptr; string time_accuracy = ""; dialog.printf(gettext(" Libz compression (gzip) : %s\n"), YES_NO(compile_time::libz())); dialog.printf(gettext(" Libbz2 compression (bzip2) : %s\n"), YES_NO(compile_time::libbz2())); dialog.printf(gettext(" Liblzo2 compression (lzo) : %s\n"), YES_NO(compile_time::liblzo())); dialog.printf(gettext(" Liblzma compression (xz) : %s\n"), YES_NO(compile_time::libxz())); dialog.printf(gettext(" Strong encryption (libgcrypt): %s\n"), YES_NO(compile_time::libgcrypt())); dialog.printf(gettext(" Public key ciphers (gpgme) : %s\n"), YES_NO(compile_time::public_key_cipher())); dialog.printf(gettext(" Extended Attributes support : %s\n"), YES_NO(compile_time::ea())); dialog.printf(gettext(" Large files support (> 2GB) : %s\n"), YES_NO(compile_time::largefile())); dialog.printf(gettext(" ext2fs NODUMP flag support : %s\n"), YES_NO(compile_time::nodump())); dialog.printf(gettext(" Special allocation scheme : %s\n"), YES_NO(compile_time::special_alloc())); if(compile_time::bits() == 0) dialog.printf(gettext(" Integer size used : unlimited\n")); else dialog.printf(gettext(" Integer size used : %d bits\n"), compile_time::bits()); dialog.printf(gettext(" Thread safe support : %s\n"), YES_NO(compile_time::thread_safe())); dialog.printf(gettext(" Furtive read mode support : %s\n"), YES_NO(compile_time::furtive_read())); dialog.printf(gettext(" Linux ext2/3/4 FSA support : %s\n"), YES_NO(compile_time::FSA_linux_extX())); dialog.printf(gettext(" Mac OS X HFS+ FSA support : %s\n"), YES_NO(compile_time::FSA_birthtime())); switch(compile_time::system_endian()) { case compile_time::big: endy = gettext("big"); break; case compile_time::little: endy = gettext("little"); break; case compile_time::error: endy = gettext("error!"); break; default: throw SRC_BUG; } dialog.printf(gettext(" Detected system/CPU endian : %s"), endy); dialog.printf(gettext(" Posix fadvise support : %s"), YES_NO(compile_time::posix_fadvise())); dialog.printf(gettext(" Large dir. speed optimi. : %s"), YES_NO(compile_time::fast_dir())); if(compile_time::microsecond_read()) time_accuracy = "1 microsecond"; else time_accuracy = "1 s"; dialog.printf(gettext(" Timestamp read accuracy : %S\n"), &time_accuracy); if(compile_time::microsecond_write()) time_accuracy = "1 microsecond"; else time_accuracy = "1 s"; dialog.printf(gettext(" Timestamp write accuracy : %S\n"), &time_accuracy); dialog.printf(gettext(" Restores dates of symlinks : %s\n"), YES_NO(compile_time::symlink_restore_dates())); if(compile_time::libthreadar()) dialog.printf(gettext(" Can uses multiple threads : %s\n"), YES_NO(compile_time::libthreadar())); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } bool tools_is_equal_with_hourshift(const infinint & hourshift, const datetime & date1, const datetime & date2) { infinint num, rest; datetime t_delta = date1 > date2 ? date1.loose_diff(date2) : date2.loose_diff(date1); infinint delta; if(!t_delta.is_integer_second()) return false; else delta = t_delta.get_second_value(); // delta = 3600*num + rest // with 0 <= rest < 3600 // (this is euclidian division) euclide(delta, 3600, num, rest); if(!rest.is_zero()) return false; else // rest == 0 return num <= hourshift; } void tools_check_basename(user_interaction & dialog, const path & loc, string & base, const string & extension, memory_pool *pool) { NLS_SWAP_IN; try { regular_mask suspect = regular_mask(string(".+\\.[1-9][0-9]*\\.")+extension, true); string old_path = (loc+base).display(); // is basename is suspect ? if(!suspect.is_covered(base)) return; // not a suspect basename // is there a slice available ? if(is_a_slice_available(dialog, old_path, extension, pool)) return; // yes, thus basename is not a mistake // removing the suspicious end (..extension) // and checking the avaibility of such a slice string new_base = retreive_basename(base, extension); string new_path = (loc+new_base).display(); if(is_a_slice_available(dialog, new_path, extension, pool)) { try { dialog.pause(tools_printf(gettext("Warning, %S seems more to be a slice name than a base name. Do you want to replace it by %S ?"), &base, &new_base)); base = new_base; } catch(Euser_abort & e) { dialog.warning(tools_printf(gettext("OK, keeping %S as basename"), &base)); } } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } string tools_getcwd() { const U_I step = 1024; U_I length = step; char *buffer = nullptr, *ret; string cwd; try { do { buffer = new (nothrow) char[length]; if(buffer == nullptr) throw Ememory("tools_getcwd()"); ret = getcwd(buffer, length-1); // length-1 to keep a place for ending '\0' if(ret == nullptr) // could not get the CWD { if(errno == ERANGE) // buffer too small { delete [] buffer; buffer = nullptr; length += step; } else // other error throw Erange("tools_getcwd", string(dar_gettext("Cannot get full path of current working directory: ")) + tools_strerror_r(errno)); } } while(ret == nullptr); buffer[length - 1] = '\0'; cwd = buffer; } catch(...) { if(buffer != nullptr) delete [] buffer; throw; } if(buffer != nullptr) delete [] buffer; return cwd; } string tools_readlink(const char *root) { U_I length = 10240; char *buffer = nullptr; S_I lu; string ret = ""; if(root == nullptr) throw Erange("tools_readlink", dar_gettext("nullptr argument given to tools_readlink()")); if(strcmp(root, "") == 0) throw Erange("tools_readlink", dar_gettext("Empty string given as argument to tools_readlink()")); try { do { buffer = new (nothrow) char[length]; if(buffer == nullptr) throw Ememory("tools_readlink"); lu = readlink(root, buffer, length-1); // length-1 to have room to add '\0' at the end if(lu < 0) // error occured with readlink { string tmp; switch(errno) { case EINVAL: // not a symbolic link (thus we return the given argument) ret = root; break; case ENAMETOOLONG: // too small buffer delete [] buffer; buffer = nullptr; length *= 2; break; default: // other error tmp = tools_strerror_r(errno); throw Erange("get_readlink", tools_printf(dar_gettext("Cannot read file information for %s : %s"), root, tmp.c_str())); } } else // got the correct real path of symlink if((U_I)(lu) < length) { buffer[lu] = '\0'; ret = buffer; } else // "lu" should not be greater than length: readlink system call error { // trying to workaround with a larger buffer delete [] buffer; buffer = nullptr; length *= 2; } } while(ret == ""); } catch(...) { if(buffer != nullptr) delete [] buffer; throw; } if(buffer != nullptr) delete [] buffer; return ret; } bool tools_look_for(const char *argument, S_I argc, char *const argv[]) { S_I count = 0; while(count < argc && strcmp(argv[count], argument) != 0) count++; return count < argc; } void tools_make_date(const std::string & chemin, bool symlink, const datetime & access, const datetime & modif, const datetime & birth) { #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY struct timeval temps[2]; #else struct utimbuf temps; #endif time_t tmp = 0; time_t usec = 0; int ret; if(!access.get_value(tmp, usec, datetime::tu_microsecond)) throw Erange("tools_make_date", "cannot set atime of file, value too high for the system integer type"); // the first time, setting modification time to the value of birth time // systems that supports birth time update birth time if the given mtime is older than the current birth time // so here we assume birth < modif (if not the birth time will be set to modif) // we run a second time the same call but with the real mtime, which should not change the birthtime if this // one is as expected older than mtime. else { #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY temps[0].tv_sec = tmp; temps[0].tv_usec = usec; #else temps.actime = tmp; #endif } if(birth != modif) { if(!birth.get_value(tmp, usec, datetime::tu_microsecond)) throw Erange("tools_make_date", "cannot set birth time of file, value too high for the system integer type"); else { #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY temps[1].tv_sec = tmp; temps[1].tv_usec = usec; #else temps.modtime = tmp; #endif } #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY #ifdef HAVE_LUTIMES ret = lutimes(chemin.c_str(), temps); #else if(symlink) return; // not able to restore dates of symlinks ret = utimes(chemin.c_str(), temps); #endif #else if(symlink) return; // not able to restore dates of symlinks ret = utime(chemin.c_str() , &temps); #endif if(ret < 0) Erange("tools_make_date", string(dar_gettext("Cannot set birth time: ")) + tools_strerror_r(errno)); } // we set atime and mtime here if(!modif.get_value(tmp, usec, datetime::tu_microsecond)) throw Erange("tools_make_date", "cannot set last modification time of file, value too high for the system integer type"); else { #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY temps[1].tv_sec = tmp; temps[1].tv_usec = usec; #else temps.modtime = tmp; #endif } #ifdef LIBDAR_MICROSECOND_WRITE_ACCURACY #ifdef HAVE_LUTIMES ret = lutimes(chemin.c_str(), temps); #else if(symlink) return; // not able to restore dates of symlinks ret = utimes(chemin.c_str(), temps); #endif #else if(symlink) return; // not able to restore dates of symlinks ret = utime(chemin.c_str() , &temps); #endif if(ret < 0) Erange("tools_make_date", string(dar_gettext("Cannot set last access and last modification time: ")) + tools_strerror_r(errno)); } void tools_noexcept_make_date(const string & chem, bool symlink, const datetime & last_acc, const datetime & last_mod, const datetime & birth) { try { if(!last_acc.is_null() || !last_mod.is_null()) tools_make_date(chem, symlink, last_acc, last_mod, birth); // else the directory could not be openned properly // and time could not be retrieved, so we don't try // to restore them } catch(Erange & e) { // cannot restore dates, ignoring } } bool tools_is_case_insensitive_equal(const string & a, const string & b) { U_I curs = 0; if(a.size() != b.size()) return false; while(curs < a.size() && tolower(a[curs]) == tolower(b[curs])) curs++; return curs >= a.size(); } void tools_to_upper(const string & r, string & uppered) { #if HAVE_WCTYPE_H && HAVE_WCHAR_H try { wstring tmp = tools_string_to_wstring(r); tools_to_wupper(tmp); uppered = tools_wstring_to_string(tmp); } catch(Erange & e) { U_I taille = r.size(); uppered = r; for(U_I x = 0; x < taille; ++x) uppered[x] = toupper(uppered[x]); } #else U_I taille = r.size(); uppered = r; for(U_I x = 0; x < taille; ++x) uppered[x] = toupper(uppered[x]); #endif } #if HAVE_WCTYPE_H void tools_to_wupper(wstring & r) { wstring::iterator it = r.begin(); while(it != r.end()) { *it = towupper(*it); ++it; } } #endif void tools_remove_last_char_if_equal_to(char c, string & s) { if(s[s.size()-1] == c) s = string(s.begin(), s.begin()+(s.size() - 1)); } static void ignore_deadson(S_I sig) { signal(SIGCHLD, &ignore_deadson); } static void abort_on_deadson(S_I sig) { // we cannot throw exception in a handler (it would not be caught) we have no other way to report to standard error cerr << dar_gettext("Aborting program: child process died unexpectedly") << endl; } static void runson(user_interaction & dialog, char * const argv[]) { if(execvp(argv[0], argv) < 0) { string tmp = tools_strerror_r(errno); dialog.warning(tools_printf(dar_gettext("Error trying to run %s: %s"), argv[0], tmp.c_str())); } else dialog.warning(string(dar_gettext("execvp() failed but did not returned error code"))); #ifndef EXIT_ERROR #define EXIT_ERROR 2 exit(EXIT_ERROR); // we need the appropriate dar exit status // but we are in libdar thus cannot include dar_suite.hpp header // we thus copy #undef EXIT_ERROR #else exit(EXIT_ERROR); #endif } static bool is_a_slice_available(user_interaction & ui, const string & base, const string & extension, memory_pool *pool) { path *chem = nullptr; bool ret = false; try { string rest; tools_split_path_basename(base.c_str(), chem, rest, pool); try { etage contents = etage(ui, chem->display().c_str(), datetime(0), datetime(0), false, false); // we don't care the dates here so we set them to zero regular_mask slice = regular_mask(rest + "\\.[1-9][0-9]*\\."+ extension, true); while(!ret && contents.read(rest)) ret = slice.is_covered(rest); } catch(Erange & e) { ret = false; } } catch(...) { if(chem != nullptr) delete chem; throw; } if(chem != nullptr) delete chem; return ret; } static string retreive_basename(const string & base, const string & extension) { string new_base = base; S_I index; if(new_base.size() < 2+1+extension.size()) throw SRC_BUG; // must be a slice filename index = new_base.find_last_not_of(string(".")+extension); new_base = string(new_base.begin(), new_base.begin()+index); index = new_base.find_last_not_of("0123456789"); new_base = string(new_base.begin(), new_base.begin()+index); return new_base; } static void tools_localtime(const time_t & timep, struct tm *result) { #if HAVE_LOCALTIME_R struct tm *ret = localtime_r(&timep, result); if(ret == nullptr) { string err = tools_strerror_r(errno); throw Erange("tools_localtime", tools_printf(gettext("Error met while retrieving current time: %S"), &err)); } #else struct tm *ret = localtime(&timep); if(ret == nullptr) { string err = tools_strerror_r(errno); throw Erange("tools_localtime", tools_printf(gettext("Error met while retrieving current time: %S"), &err)); } *result = *ret; #endif } void tools_read_range(const string & s, S_I & min, U_I & max) { string::const_iterator it = s.begin(); while(it < s.end() && *it != '-') it++; try { if(it < s.end()) { min = tools_str2int(string(s.begin(), it)); max = tools_str2int(string(++it, s.end())); } else min = max = tools_str2int(s); } catch(Erange & e) { min = tools_str2signed_int(s); max = 0; } } string tools_printf(const char *format, ...) { va_list ap; va_start(ap, format); string output = ""; try { output = tools_vprintf(format, ap); } catch(...) { va_end(ap); throw; } va_end(ap); return output; } string tools_vprintf(const char *format, va_list ap) { bool end; U_32 taille = strlen(format)+1; char *copie; string output = ""; U_I test; copie = new (nothrow) char[taille]; if(copie == nullptr) throw Ememory("tools_printf"); try { char *ptr = copie, *start = copie; strcpy(copie, format); copie[taille-1] = '\0'; do { while(*ptr != '%' && *ptr != '\0') ++ptr; if(*ptr == '%') { *ptr = '\0'; end = false; } else end = true; output += start; if(!end) { ++ptr; switch(*ptr) { case '%': output += "%"; break; case 'd': output += tools_int2str(va_arg(ap, S_I)); break; case 'u': test = va_arg(ap, U_I); output += deci(test).human(); break; case 'x': test = va_arg(ap, U_I); output += tools_string_to_hexa(deci(test).human()); break; case 's': output += va_arg(ap, char *); break; case 'c': output += static_cast(va_arg(ap, S_I)); break; case 'i': output += deci(*(va_arg(ap, infinint *))).human(); break; case 'S': output += *(va_arg(ap, string *)); break; default: throw Efeature(tools_printf("%%%c is not implemented in tools_printf format argument", *ptr)); } ++ptr; start = ptr; } } while(!end); } catch(...) { delete [] copie; throw; } delete [] copie; return output; } void tools_unlink_file_mask_regex(user_interaction & dialog, const string & c_chemin, const string & file_mask, bool info_details) { regular_mask my_mask = regular_mask(file_mask, true); etage dir = etage(dialog, c_chemin.c_str(), datetime(0), datetime(0), false, false); path chemin = path(c_chemin); string entry; while(dir.read(entry)) if(my_mask.is_covered(entry)) { const string c_entry = (chemin + entry).display(); if(info_details) dialog.warning(tools_printf(dar_gettext("Removing file %s"), c_entry.c_str())); if(unlink(c_entry.c_str()) != 0) { string tmp = tools_strerror_r(errno); dialog.warning(tools_printf(dar_gettext("Error removing file %s: %s"), c_entry.c_str(), tmp.c_str())); } } } bool tools_do_some_files_match_mask_regex(user_interaction & ui, const string & c_chemin, const string & file_mask) { regular_mask my_mask = regular_mask(file_mask, true); etage dir = etage(ui, c_chemin.c_str(), datetime(0), datetime(0), false, false); string entry; bool ret = false; while(!ret && dir.read(entry)) if(my_mask.is_covered(entry)) ret = true; return ret; } void tools_avoid_slice_overwriting_regex(user_interaction & dialog, const path & chemin, const string & file_mask, bool info_details, bool allow_overwriting, bool warn_overwriting, bool dry_run) { const string c_chemin = chemin.display(); if(tools_do_some_files_match_mask_regex(dialog, c_chemin, file_mask)) { if(!allow_overwriting) throw Erange("tools_avoid_slice_overwriting", tools_printf(dar_gettext("Overwriting not allowed while a slice of a previous archive with the same basename has been found in the %s directory, Operation aborted"), c_chemin.c_str())); else { try { if(warn_overwriting) dialog.pause(tools_printf(dar_gettext("At least one slice of an old archive with the same name remains in the directory %s. It is advised to remove all the old archive's slices before creating an archive of same name. Can I remove these old slices?"), c_chemin.c_str())); if(!dry_run) tools_unlink_file_mask_regex(dialog, c_chemin, file_mask, info_details); } catch(Euser_abort & e) { // nothing to do, just continue } } } } void tools_add_elastic_buffer(generic_file & f, U_32 max_size, U_32 modulo, U_32 offset) { U_32 size = tools_pseudo_random(max_size-1) + 1; // range from 1 to max_size; if(modulo > 0) { U_32 shift = modulo - (offset % modulo); size = (size/modulo)*modulo + shift; } elastic tic = size; char *buffer = new (nothrow) char[tic.get_size()]; if(buffer == nullptr) throw Ememory("tools_add_elastic_buffer"); try { tic.dump((unsigned char *)buffer, tic.get_size()); f.write(buffer, tic.get_size()); } catch(...) { delete [] buffer; throw; } delete [] buffer; } bool tools_are_on_same_filesystem(const string & file1, const string & file2) { dev_t id; struct stat sstat; if(stat(file1.c_str(), &sstat) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools:tools_are_on_same_filesystem", tools_printf(dar_gettext("Cannot get inode information for %s: %s"), file1.c_str(), tmp.c_str())); } id = sstat.st_dev; if(stat(file2.c_str(), &sstat) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools:tools_are_on_same_filesystem", tools_printf(dar_gettext("Cannot get inode information for %s: %s"), file2.c_str(), tmp.c_str())); } return id == sstat.st_dev; } path tools_relative2absolute_path(const path & src, const path & cwd) { if(src.is_relative()) if(cwd.is_relative()) throw Erange("tools_relative2absolute_path", dar_gettext("Current Working Directory cannot be a relative path")); else return cwd + src; else return src; } void tools_block_all_signals(sigset_t &old_mask) { sigset_t all; sigfillset(&all); #if HAVE_LIBPTHREAD if(pthread_sigmask(SIG_BLOCK, &all, &old_mask) != 0) #else if(sigprocmask(SIG_BLOCK, &all, &old_mask) != 0) #endif throw Erange("tools_block_all_signals", string(dar_gettext("Cannot block signals: "))+tools_strerror_r(errno)); } void tools_set_back_blocked_signals(sigset_t old_mask) { #if HAVE_LIBPTHREAD if(pthread_sigmask(SIG_SETMASK, &old_mask, nullptr)) #else if(sigprocmask(SIG_SETMASK, &old_mask, nullptr)) #endif throw Erange("tools_set_back_block_all_signals", string(dar_gettext("Cannot unblock signals: "))+tools_strerror_r(errno)); } U_I tools_count_in_string(const string & s, const char a) { U_I ret = 0, c, size = s.size(); for(c = 0; c < size; ++c) if(s[c] == a) ++ret; return ret; } datetime tools_get_mtime(const std::string & s) { struct stat buf; if(lstat(s.c_str(), &buf) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools_get_mtime", tools_printf(dar_gettext("Cannot get last modification date: %s"), tmp.c_str())); } #ifdef LIBDAR_MICROSECOND_READ_ACCURACY datetime val = datetime(buf.st_mtim.tv_sec, buf.st_mtim.tv_nsec, datetime::tu_nanosecond); if(val.is_null()) // assuming an error avoids getting time that way val = datetime(buf.st_mtime, 0, datetime::tu_second); #else datetime val = datetime(buf.st_mtime, 0, datetime::tu_second); #endif return val; } infinint tools_get_size(const std::string & s) { struct stat buf; if(lstat(s.c_str(), &buf) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools_get_size", tools_printf(dar_gettext("Cannot get last modification date: %s"), tmp.c_str())); } if(!S_ISREG(buf.st_mode)) throw Erange("tools_get_size", tools_printf(dar_gettext("Cannot get size of %S: not a plain file"), &s)); return buf.st_size; } datetime tools_get_ctime(const std::string & s) { struct stat buf; if(lstat(s.c_str(), &buf) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools_get_mtime", tools_printf(dar_gettext("Cannot get mtime: %s"), tmp.c_str())); } #ifdef LIBDAR_MICROSECOND_READ_ACCURACY datetime ret = datetime(buf.st_ctim.tv_sec, buf.st_ctim.tv_nsec, datetime::tu_nanosecond); if(ret.is_null()) // assuming an error avoids getting time that way ret = datetime(buf.st_ctime, 0, datetime::tu_second); #else datetime ret = datetime(buf.st_ctime, 0, datetime::tu_second); #endif return ret; } vector tools_split_in_words(generic_file & f) { vector mots; vector quotes; string current = ""; char a; bool loop = true; bool escaped = false; while(loop) { if(f.read(&a, 1) != 1) // reached end of file { loop = false; a = ' '; // to close the last word } if(escaped) { current += a; // added without consideration of quoting of any sort escaped = false; continue; // continuing at beginning of the while loop } else { if(a == '\\') { escaped = true; continue; // continuing at beginning of the while loop } } if(quotes.empty()) // outside a word switch(a) { case ' ': case '\t': case '\n': case '\r': break; case '"': case '\'': case '`': quotes.push_back(a); break; default: quotes.push_back(' '); // the quote space means no quote current += a; // a new argument is starting break; } else // inside a word switch(a) { case '\t': if(quotes.back() != ' ') { // this is the end of the wor(l)d ;-) // ...once again... 1000, 1999, 2012, and the next ones to come... break; } // no break ! case '\n': case '\r': a = ' '; // replace carriage return inside quoted string by a space // no break ! case ' ': case '"': case '\'': case '`': if(a == quotes.back()) // "a" is an ending quote { quotes.pop_back(); if(quotes.empty()) // reached end of word { mots.push_back(current); current = ""; } else current += a; } else // "a" is a nested starting quote { if(a != ' ') // quote ' ' does not have ending quote quotes.push_back(a); current += a; } break; default: current += a; } } if(!quotes.empty()) throw Erange("make_args_from_file", tools_printf(dar_gettext("Parse error: Unmatched `%c'"), quotes.back())); return mots; } std::vector tools_split_in_words(const std::string & arg) { memory_file mem; mem.write(arg.c_str(), arg.size()); mem.skip(0); return tools_split_in_words(mem); } bool tools_find_next_char_out_of_parenthesis(const string & data, const char what, U_32 start, U_32 & found) { U_32 nested_parenth = 0; while(start < data.size() && (nested_parenth != 0 || data[start] != what)) { if(data[start] == '(') nested_parenth++; if(data[start] == ')' && nested_parenth > 0) nested_parenth--; start++; } if(start < data.size() && nested_parenth == 0 && data[start] == what) { found = start; return true; } else return false; } string tools_substitute(const string & hook, const map & corres) { string ret = ""; string::iterator it = const_cast(hook).begin(); while(it != hook.end()) { if(*it == '%') { it++; if(it != hook.end()) { map::const_iterator mptr = corres.find(*it); if(mptr == corres.end()) throw Escript("tools_substitute", string(dar_gettext("Unknown substitution string: %")) + *it); else ret += mptr->second; it++; } else // reached end of "hook" string { throw Escript("tools_hook_substitute", dar_gettext("last char of user command-line to execute is '%', (use '%%' instead to avoid this message)")); } } else { ret += *it; it++; } } return ret; } string tools_hook_substitute(const string & hook, const string & path, const string & basename, const string & num, const string & padded_num, const string & ext, const string & context) { map corres; corres['%'] = "%"; corres['p'] = path; corres['b'] = basename; corres['n'] = num; corres['N'] = padded_num; corres['e'] = ext; corres['c'] = context; return tools_substitute(hook, corres); } void tools_hook_execute(user_interaction & ui, const string & cmd_line) { NLS_SWAP_IN; try { const char *ptr = cmd_line.c_str(); bool loop = false; do { try { S_I code = system(ptr); switch(code) { case 0: loop = false; break; // All is fine, script did not report error case 127: throw Erange("tools_hook_execute", gettext("execve() failed. (process table is full ?)")); case -1: throw Erange("tools_hook_execute", string(gettext("system() call failed: ")) + tools_strerror_r(errno)); default: throw Erange("tools_hook_execute", tools_printf(gettext("execution of [ %S ] returned error code: %d"), &cmd_line, code)); } } catch(Erange & e) { try { ui.pause(string(gettext("Error during user command line execution: ")) + e.get_message() + gettext(" . Retry command-line ?")); loop = true; } catch(Euser_abort & f) { ui.pause(gettext("Ignore previous error on user command line and continue ?")); loop = false; } } } while(loop); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } extern void tools_hook_substitute_and_execute(user_interaction & ui, const string & hook, const string & path, const string & basename, const string & num, const string & padded_num, const string & ext, const string & context) { string cmd_line; cmd_line = tools_hook_substitute(hook, path, basename, num, padded_num, ext, context); try { tools_hook_execute(ui, cmd_line); } catch(Euser_abort & g) { throw Escript("sar::hook_execute", string(dar_gettext("Fatal error on user command line: ")) + g.get_message()); } } /*************************************************************/ string tools_build_regex_for_exclude_mask(const string & prefix, const string & relative_part) { string result = "^"; string::const_iterator it = prefix.begin(); // prepending any non alpha numeric char of the root by a anti-slash for( ; it != prefix.end() ; ++it) { if(isalnum(*it) || *it == '/' || *it == ' ') result += *it; else { result += '\\'; result += *it; } } // adding a trailing / if necessary string::reverse_iterator tr = result.rbegin(); if(tr == result.rend() || *tr != '/') result += '/'; // adapting and adding the relative_part it = relative_part.begin(); if(it != relative_part.end() && *it == '^') it++; // skipping leading ^ else result += ".*"; // prepending wilde card sub-expression for( ; it != relative_part.end() && *it != '$' ; ++it) result += *it; result += "(/.+)?$"; return result; } string tools_output2xml(const string & src) { string ret = ""; U_I cur = 0, size = src.size(); while(cur < size) { switch(src[cur]) { case '<': ret += "<"; break; case '>': ret += ">"; break; case '&': ret += "&"; break; case '\'': ret += "'"; break; case'\"': ret += """; break; default: ret += src[cur]; } ++cur; } return ret; } U_I tools_octal2int(const std::string & perm) { U_I len = perm.size(); U_I ret = 0; enum { init , octal , trail, error } etat = init; if(perm == "") return 0666; // permission used by default (compatible with dar's previous behavior) for(U_I i = 0; i < len ; i++) switch(etat) { case init: switch(perm[i]) { case ' ': case '\t': case '\n': case '\r': break; case '0': etat = octal; break; default: etat = error; break; } break; case octal: if(perm[i] == ' ') etat = trail; else if(perm[i] >= '0' && perm[i] <= '7') ret = ret*8 + perm[i] - '0'; else etat = error; break; case trail: if(perm[i] != ' ') etat = error; break; case error: throw Erange("tools_octal2int", dar_gettext("Badly formated octal number")); default: throw SRC_BUG; } if(etat == error || etat == init) throw Erange("tools_octal2int", dar_gettext("Badly formated octal number")); return ret; } string tools_int2octal(const U_I & perm) { vector digits = tools_number_base_decomposition_in_big_endian(perm, (U_I)8); vector::iterator it = digits.begin(); string ret = ""; while(it != digits.end()) { string tmp; tmp += '0' + (*it); ret = tmp + ret; ++it; } return string("0") + ret; // leading zero for octal format indication } string tools_get_permission_string(char type, U_32 perm, bool hard) { string ret = hard ? "*" : " "; if(type == 'f') // plain files type = '-'; if(type == 'o') // door "files" type = 'D'; ret += type; if((perm & 0400) != 0) ret += 'r'; else ret += '-'; if((perm & 0200) != 0) ret += 'w'; else ret += '-'; if((perm & 0100) != 0) if((perm & 04000) != 0) ret += 's'; else ret += 'x'; else if((perm & 04000) != 0) ret += 'S'; else ret += '-'; if((perm & 040) != 0) ret += 'r'; else ret += '-'; if((perm & 020) != 0) ret += 'w'; else ret += '-'; if((perm & 010) != 0) if((perm & 02000) != 0) ret += 's'; else ret += 'x'; else if((perm & 02000) != 0) ret += 'S'; else ret += '-'; if((perm & 04) != 0) ret += 'r'; else ret += '-'; if((perm & 02) != 0) ret += 'w'; else ret += '-'; if((perm & 01) != 0) if((perm & 01000) != 0) ret += 't'; else ret += 'x'; else if((perm & 01000) != 0) ret += 'T'; else ret += '-'; return ret; } U_I tools_get_permission(S_I fd) { struct stat buf; int err = fstat(fd, &buf); if(err < 0) throw Erange("tools_get_permission", string(gettext("Cannot get effective permission given a file descriptor: ")) + tools_strerror_r(errno)); return buf.st_mode & ~(S_IFMT); } void tools_set_permission(S_I fd, U_I perm) { NLS_SWAP_IN; try { if(fd < 0) throw SRC_BUG; if(fchmod(fd, (mode_t) perm) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools_set_permission", tools_printf(gettext("Error while setting file permission: %s"), tmp.c_str())); } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } uid_t tools_ownership2uid(const string & user) { uid_t ret = -1; NLS_SWAP_IN; try { bool direct_uid_set = false; if(user.empty()) throw Erange("tools_ownership2uid", gettext("An empty string is not a valid user name")); try { ret = tools_str2int(user); direct_uid_set = true; } catch(Erange & e) { // the given user is not an uid } if(!direct_uid_set) { #ifdef __DYNAMIC__ const char *c_user = user.c_str(); #if HAVE_GETPWNAM_R struct passwd puser; struct passwd *result; S_I size = sysconf(_SC_GETPW_R_SIZE_MAX); char *buf = nullptr; if(size == -1) size = 16384; try { buf = new (nothrow) char[size]; if(buf == nullptr) throw Ememory("tools_ownership2uid"); int val = getpwnam_r(c_user, &puser, buf, size, &result); if(val != 0 || result == nullptr) { string err = val == 0 ? gettext("Unknown user") : tools_strerror_r(errno); throw Erange("tools_ownership2uid", tools_printf(gettext("Error found while looking for UID of user %s: %S"), c_user, &err)); } ret = result->pw_uid; } catch(...) { if(buf != nullptr) delete [] buf; throw; } if(buf != nullptr) delete [] buf; #else errno = 0; struct passwd *puser = getpwnam(c_user); if(puser == nullptr) { string err = (errno == 0) ? gettext("Unknown user") : tools_strerror_r(errno); throw Erange("tools_ownership2uid", tools_printf(gettext("Error found while looking for UID of user %s: %S"), c_user, &err)); } ret = puser->pw_uid; #endif #else throw Erange("tools_ownership2uid", dar_gettext("Cannot convert username to uid in statically linked binary, either directly provide the UID or run libdar from a dynamically linked executable")); #endif } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } gid_t tools_ownership2gid(const string & group) { gid_t ret = -1; NLS_SWAP_IN; try { bool direct_gid_set = false; if(group.empty()) throw Erange("tools_ownership2gid", gettext("An empty string is not a valid group name")); try { ret = tools_str2int(group); direct_gid_set = true; } catch(Erange & e) { // the given group is not an gid } if(!direct_gid_set) { #ifdef __DYNAMIC__ const char *c_group = group.c_str(); #if HAVE_GETGRNAM_R struct group pgroup; struct group *result; U_I size = sysconf(_SC_GETGR_R_SIZE_MAX); char *buf = nullptr; try { buf = new (nothrow) char[size]; if(buf == nullptr) throw Ememory("tools_ownsership2gid"); S_I val = getgrnam_r(c_group, &pgroup, buf, size, &result); if(val != 0 || result == nullptr) { string err = (val == 0) ? gettext("Unknown group") : tools_strerror_r(errno); throw Erange("tools_ownership2gid", tools_printf(gettext("Error found while looking fo GID of group %s: %S"), c_group, &err)); } ret = result->gr_gid; } catch(...) { if(buf != nullptr) delete [] buf; throw; } if(buf != nullptr) delete [] buf; #else errno = 0; struct group *pgroup = getgrnam(c_group); if(pgroup == nullptr) { string err = (errno == 0) ? gettext("Unknown group") : tools_strerror_r(errno); throw Erange("tools_ownership2gid", tools_printf(gettext("Error found while looking for GID of group %s: %S"), c_group, &err)); } ret = pgroup->gr_gid; #endif #else throw Erange("tools_ownership2gid", dar_gettext("Cannot convert username to uid in statically linked binary, either directly provide the UID or run libdar from a dynamically linked executable")); #endif } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } void tools_set_ownership(int filedesc, const std::string & user, const std::string & group) { uid_t uid = -1; uid_t gid = -1; if(user != "") uid = tools_ownership2uid(user); if(group != "") gid = tools_ownership2gid(group); if(uid != (uid_t)(-1) || gid != (gid_t)(-1)) { if(fchown(filedesc, uid, gid) < 0) { string tmp = tools_strerror_r(errno); throw Erange("tools_set_ownership", tools_printf(gettext("Error while setting file user ownership: %s"), tmp.c_str())); } } } void tools_memxor(void *dest, const void *src, U_I n) { unsigned char *d = (unsigned char *) dest; const unsigned char *s = (const unsigned char *) src; for(U_I i = 0; i < n; i++) *d++ ^= *s++; } tlv_list tools_string2tlv_list(user_interaction & dialog, const U_16 & type, const vector & data) { vector::const_iterator it = data.begin(); tlv tmp; tlv_list ret; tmp.set_type(type); while(it != data.end()) { tmp.reset(); tmp.write(it->c_str(), it->size()); ret.add(tmp); it++; } return ret; } U_I tools_pseudo_random(U_I max) { return (U_I)(max*((float)(rand())/RAND_MAX)); } void tools_read_from_pipe(user_interaction & dialog, S_I fd, tlv_list & result) { tuyau tube = tuyau(dialog, fd); result.read(tube); } string tools_unsigned_char_to_hexa(unsigned char x) { string ret; vector digit = tools_number_base_decomposition_in_big_endian(x, (U_I)(16)); vector::reverse_iterator itr = digit.rbegin(); switch(digit.size()) { case 0: ret = "00"; break; case 1: ret = "0"; break; case 2: break; default: throw SRC_BUG; } while(itr != digit.rend()) { U_I t = *itr; if(t > 9) ret += ('a' + (t - 10)); else ret += ('0' + t); ++itr; } return ret; } string tools_string_to_hexa(const string & input) { string::const_iterator it = input.begin(); string ret; while(it != input.end()) { ret += tools_unsigned_char_to_hexa((unsigned char)(*it)); ++it; } return ret; } infinint tools_file_size_to_crc_size(const infinint & size) { const infinint ratio = tools_get_extended_size("1G",1024); infinint r; infinint crc_size; if(!size.is_zero()) { euclide(size, ratio, crc_size, r); if(!r.is_zero()) ++crc_size; crc_size *= 4; // smallest value is 4 bytes, 4 bytes more per each additional 1 Gbyte of data } else crc_size = 1; // minimal value for no data to protect by checksum return crc_size; } string tools_get_euid() { string ret; uid_t uid = geteuid(); deci conv = infinint(uid); ret += tools_name_of_uid(uid) + "("+ conv.human() + ")"; return ret; } string tools_get_egid() { string ret; uid_t gid = getegid(); deci conv = infinint(gid); ret += tools_name_of_gid(gid) + "("+ conv.human() + ")"; return ret; } string tools_get_hostname() { string ret; struct utsname uts; if(uname(&uts) < 0) throw Erange("tools_get_hostname", string(dar_gettext("Error while fetching hostname: ")) + tools_strerror_r(errno)); ret = string(uts.nodename); return ret; } string tools_get_date_utc() { string ret; datetime now = datetime(::time(nullptr), 0, datetime::tu_second); ret = tools_display_date(now); return ret; } string tools_get_compression_ratio(const infinint & storage_size, const infinint & file_size, bool compressed) { static const char * not_compressed = " "; if(!compressed) return not_compressed; else if(file_size >= storage_size) if(!file_size.is_zero()) return tools_addspacebefore(deci(((file_size - storage_size)*100)/file_size).human(), 4) +"%"; else return not_compressed; else return gettext("Worse"); } #define MSGSIZE 200 string tools_strerror_r(int errnum) { char buffer[MSGSIZE]; string ret; #ifdef HAVE_STRERROR_R #ifdef HAVE_STRERROR_R_CHAR_PTR char *val = strerror_r(errnum, buffer, MSGSIZE); if(val != buffer) strncpy(buffer, val, MSGSIZE); #else // we expect the XSI-compliant strerror_r int val = strerror_r(errnum, buffer, MSGSIZE); if(val != 0) { string tmp = tools_printf(gettext("Error code %d to message conversion failed"), errnum); strncpy(buffer, tmp.c_str(), tools_min((size_t)(tmp.size()+1), (size_t)(MSGSIZE))); } #endif #else char *tmp = strerror(errnum); (void)strncpy(buffer, tmp, MSGSIZE); #endif buffer[MSGSIZE-1] = '\0'; ret = buffer; return ret; } #ifdef GPGME_SUPPORT string tools_gpgme_strerror_r(gpgme_error_t err) { char buffer[MSGSIZE]; string ret; switch(gpgme_strerror_r(err, buffer, MSGSIZE)) { case 0: break; case ERANGE: strncpy(buffer, "Lack of memory to display gpgme error message", MSGSIZE); break; default: throw SRC_BUG; } buffer[MSGSIZE-1] = '\0'; ret = buffer; return ret; } #endif #if HAVE_WCHAR_H wstring tools_string_to_wstring(const string & val) { wstring ret; wchar_t *dst = new (nothrow) wchar_t[val.size() + 1]; if(dst == nullptr) throw Ememory("tools_string_to_wcs"); try { mbstate_t state_wc; const char *src = val.c_str(); size_t len; memset(&state_wc, '\0', sizeof(state_wc)); // initializing the shift structure len = mbsrtowcs(dst, &src, val.size(), &state_wc); if(len == (size_t)-1) throw Erange("tools_string_to_wcs", string(gettext("Invalid wide-char found in string: ")) + tools_strerror_r(errno)); dst[len] = '\0'; // converting dst to wstring ret = dst; } catch(...) { if(dst != nullptr) delete dst; throw; } if(dst != nullptr) delete dst; return ret; } string tools_wstring_to_string(const wstring & val) { string ret; const wchar_t *src = val.c_str(); mbstate_t state_wc; size_t len; memset(&state_wc, '\0', sizeof(state_wc)); // initializing the shift structure len = wcsrtombs(nullptr, &src, 0, &state_wc); if(len == (size_t)-1) throw SRC_BUG; // all components of wstring should be valid char *dst = new (nothrow) char[len + 1]; if(dst == nullptr) throw Ememory("tools_wstring_to_string"); try { size_t len2; memset(&state_wc, '\0', sizeof(state_wc)); // initializing the shift structure src = val.c_str(); len2 = wcsrtombs(dst, &src, len, &state_wc); if(len != len2) throw SRC_BUG; if(len2 == (size_t)-1) throw SRC_BUG; // problem should have already raised above dst[len2] = '\0'; // converting dst to string ret = dst; } catch(...) { if(dst != nullptr) delete dst; throw; } if(dst != nullptr) delete dst; return ret; } #endif void tools_merge_to_vector(vector & a, const vector & b) { vector::const_iterator ptrb = b.begin(); while(ptrb != b.end()) { vector::const_iterator ptra = a.begin(); while(ptra != a.end() && *ptra != *ptrb) ++ptra; if(ptra == a.end()) a.push_back(*ptrb); ++ptrb; } } vector tools_substract_from_vector(const vector & a, const vector & b) { vector ret; vector::const_iterator ptra = a.begin(); while(ptra != a.end()) { vector::const_iterator ptrb = b.begin(); while(ptrb != b.end() && *ptra != *ptrb) ++ptrb; if(ptrb == b.end()) ret.push_back(*ptra); ++ptra; } return ret; } struct dirent *tools_allocate_struct_dirent(const std::string & path_name, memory_pool *pool) { struct dirent *ret; S_I name_max = pathconf(path_name.c_str(), _PC_NAME_MAX); U_I len; if(name_max == -1) name_max = NAME_MAX; if(name_max < NAME_MAX) name_max = NAME_MAX; len = offsetof(struct dirent, d_name) + name_max + 1; if(pool == nullptr) ret = (struct dirent *) new (nothrow) char[len]; else ret = (struct dirent *) new (pool) char[len]; if(ret == nullptr) throw Ememory("tools_allocate_struc_dirent"); return ret; } void tools_release_struct_dirent(struct dirent *ptr) { if(ptr != nullptr) delete [] ((char *)(ptr)); } void tools_secu_string_show(user_interaction & dialog, const string & msg, const secu_string & key) { string res = msg + tools_printf(" (size=%d) [", key.get_size()); U_I max = key.get_size() - 1; for(U_I index = 0; index < max; ++index) res += tools_printf(" %d |", key[index]); res += tools_printf(" %d ]", key[max]); dialog.warning(res); } } // end of namespace dar-2.5.3/src/libdar/crypto_sym.hpp0000644000175000017430000001230712641772777014206 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file crypto.hpp /// \brief the crypto algoritm definition /// \ingroup Private #ifndef CRYPTO_SYM_HPP #define CRYPTO_SYM_HPP extern "C" { #if HAVE_GCRYPT_H #ifndef GCRYPT_NO_DEPRECATED #define GCRYPT_NO_DEPRECATED #endif #include #endif } #include "../my_config.h" #include #include "tronconneuse.hpp" #include "secu_string.hpp" #include "crypto.hpp" namespace libdar { /// \ingroup Private /// @} inline bool crypto_min_ver_libgcrypt_no_bug() { #if CRYPTO_AVAILABLE return gcry_check_version(MIN_VERSION_GCRYPT_HASH_BUG); #else return true; #endif } /// inherited class from tronconneuse class /// \ingroup Private class crypto_sym : public tronconneuse { public: crypto_sym(U_32 block_size, const secu_string & password, generic_file & encrypted_side, bool no_initial_shift, const archive_version & reading_ver, crypto_algo algo, bool use_pkcs5); //< must be set to true when password is human defined, false when password is randomly generated by pseudo-random generator and has the maximum length for the given algorithm ~crypto_sym() { detruit(); }; /// returns the max key length in octets for the given algorithm static size_t max_key_len(crypto_algo algo); /// returns the max key length in octets to use to compute a key from a user provided password static size_t max_key_len_libdar(crypto_algo algo); /// check whether the given password is reported as strong in regard to the given cipher static bool is_a_strong_password(crypto_algo algo, const secu_string & password); protected: U_32 encrypted_block_size_for(U_32 clear_block_size); U_32 clear_block_allocated_size_for(U_32 clear_block_size); U_32 encrypt_data(const infinint & block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size); U_32 decrypt_data(const infinint & block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size); private: #if CRYPTO_AVAILABLE gcry_cipher_hd_t clef; //< used to encrypt/decrypt the data gcry_cipher_hd_t essiv_clef; //< used to build the Initialization Vector #endif size_t algo_block_size; //< the block size of the algorithm (main key) unsigned char *ivec; //< algo_block_size allocated in secure memory to be used as Initial Vector U_I algo_id; //< algo ID in libgcrypt void detruit(); /// creates a blowfish key using as key a SHA1 of the given string (no IV assigned) /// /// \note such key is intended to be used to generate IV for the main key #if CRYPTO_AVAILABLE static void dar_set_essiv(const secu_string & key, //< the key to base the essiv on gcry_cipher_hd_t & IVkey, //< assign essiv from the given (hash) string const archive_version & ver, //< archive format we read or write crypto_algo main_cipher); //< the choice of the algo for essiv depends on the cipher used for the main key /// Fills up a new initial vector based on a reference and and a encryption key /// /// \param[in] ref is the reference to base the IV on /// \param[in] ivec is the address where to drop down the new IV /// \param[in] size is the amount of data allocated at ivec address /// \param[in] IVkey is the key used to generate the IV data /// \note the IV is created by encrypting a hash of ref with IVkey static void make_ivec(const infinint & ref, unsigned char *ivec, U_I size, const gcry_cipher_hd_t & IVkey); /// Create a hash string of requested length from a given password and interation cout static secu_string pkcs5_pass2key(const secu_string & password, //< human provided password const std::string & salt, //< salt string U_I iteration_count, //< number of time to shake the melange U_I output_length); //< length of the string to return /// converts libdar crypto algo designation to index used by libgcrypt static U_I get_algo_id(crypto_algo algo); #endif #ifdef LIBDAR_NO_OPTIMIZATION static void self_test(void); #endif }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/tlv_list.hpp0000644000175000017430000000366512641773000013621 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file tlv_list.hpp /// \brief List of Generic Type Length Value data structures /// \ingroup Private #ifndef TLV_LIST_HPP #define TLV_LIST_HPP #include "tlv.hpp" #include "generic_file.hpp" #include "on_pool.hpp" #include namespace libdar { /// \addtogroup Private /// @{ class tlv_list : public on_pool { public: tlv_list() {}; //< builds an empty list tlv_list(generic_file & f) { init(f); }; //< builds a list from a file void dump(generic_file & f) const; //< dump tlv_list to file void read(generic_file & f) { init(f); }; //< erase and read a list from a file U_I size() const { return contents.size(); }; tlv & operator[] (U_I item) const; void clear() { contents.clear(); }; void add(const tlv & next) { contents.push_back(next); }; private: std::vector contents; void init(generic_file & f); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/database.hpp0000644000175000017430000002414312641772777013543 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file database.hpp /// \brief this file holds the database class definition /// \ingroup API #ifndef DATABASE_HPP #define DATABASE_HPP #include "../my_config.h" #include #include "archive.hpp" #include "generic_file.hpp" #include "data_tree.hpp" #include "storage.hpp" #include "database_options.hpp" #include "on_pool.hpp" namespace libdar { /// the database class defines the dar_manager database /// all operations for a dar_manager database are defines through the /// use of this class interface. This class also defines internally /// the data structure of the database. /// \ingroup API class database : public on_pool { public: /// this constructor build an empty database database(); /// this constructor reads database from a file /// \param[in] dialog for user interaction /// \param[in] base database filename /// \param[in] opt extendable list of options to use for this operation database(user_interaction & dialog, const std::string & base, const database_open_options & opt); /// database destructor (no implicit file saving) ~database(); /// write the database to a file (see database_header first) /// \param[in] dialog for user interaction /// \param[in] filename name of file to save database to /// \param[in] opt extendable list of options to use for this operation /// \note this method is not available with partially extracted databases. void dump(user_interaction & dialog, const std::string & filename, const database_dump_options & opt) const; // SETTINGS /// add an archive to the database /// \param[in] arch is the archive to add to the database (may be a partial archive) /// \param[in] chemin is the path to this archive to record in the database /// \param[in] basename is the archive's basename to record in the database /// \param[in] opt extendable list of options to use for this operation /// \note this method is not available with partially extracted databases. void add_archive(const archive & arch, const std::string & chemin, const std::string & basename, const database_add_options & opt); /// remove an archive from a database /// \param[in] min first archive index to remove /// \param[in] max last archive index to remove /// \param[in] opt extendable list of options to use for this operation /// \note the archives which indexes are in the range [min-max] are /// removed. If you want to remove only one archive choose min equal to max. /// \note this method is not available with partially extracted databases. void remove_archive(archive_num min, archive_num max, const database_remove_options & opt); /// change order of archive within the database /// \param[in] src archive index to move /// \param[in] dst archive index to move to /// \note this method is not available with partially extracted databases. void set_permutation(archive_num src, archive_num dst); /// change one's archive basename recorded in the database /// \param[in] num is the archive index to rename /// \param[in] basename is the new basename to give to that archive /// \param[in] opt optional parameters for this operation /// \note this method *is* available with partially extracted databases, but with partial_read_only ones void change_name(archive_num num, const std::string & basename, const database_change_basename_options &opt); /// change one's archive path recorded in the database /// \param[in] num is the archive index who's path to change /// \param[in] chemin is the new path to give to that archive /// \param[in] opt optional parameters for this operation /// \note this method *is* available with partially extracted databases, but with partial_read_only ones void set_path(archive_num num, const std::string & chemin, const database_change_path_options & opt); /// change the default options given to dar when performing restoration /// \param[in] opt is a vector a arguments. /// \note Each element of the vector must match a single argument of the command line /// like for example "-R". Any leading or trailing space will make a different argument /// than the one without spaces (" -R" is different than "-R" for example). /// \note this method *is* available with partially extracted databases, but with partial_read_only ones void set_options(const std::vector &opt) { options_to_dar = opt; }; /// change the path to dar command /// \param[in] chemin is the full path to dar (including dar filename) to use for restoration /// \note if set to an empty string the dar command found from the PATH will be used (if any) /// \note this method *is* available with partially extracted databases, but with partial_read_only ones void set_dar_path(const std::string & chemin) { dar_path = chemin; }; // "GETTINGS" /// show the list of archive used to build the database /// \param[in,out] dialog is the user_interaction to use to report the listing void show_contents(user_interaction & dialog) const; // displays all archive information /// return the options used with dar for restoration std::vector get_options() const { return options_to_dar; }; // show option passed to dar /// return the path for dar /// \return the path to dar used when restoring files /// \note empty string means that dar is taken from the PATH variable std::string get_dar_path() const { return dar_path; }; // show path to dar command /// list files which are present in a given archive /// \param[in,out] dialog where to display listing to /// \param[in] num is the archive number to look at /// \param[in] opt optional parameters for this operation /// \note if "num" is set to zero all archive contents is listed /// \note this method is not available with partially extracted databases. void show_files(user_interaction & dialog, archive_num num, const database_used_options & opt) const; /// list the archive where a give file is present /// \param[in,out] dialog where to display the listing to /// \param[in] chemin path to the file to look for /// \note this method is not available with partially extracted databases. void show_version(user_interaction & dialog, path chemin) const; /// compute some statistics about the location of most recent file versions /// \param[in] dialog where to display the listing to /// \note this method is not available with partially extracted databases. void show_most_recent_stats(user_interaction & dialog) const; // "ACTIONS" (not available with partially extracted databases) /// restore files calling dar on the appropriated archive /// \param[in,out] dialog where to have user interaction /// \param[in] filename list of filename to restore /// \param[in] opt extendable list of options to use for this operation /// \note this method is not available with partially extracted databases. void restore(user_interaction & dialog, const std::vector & filename, const database_restore_options & opt); /// check that all files's Data and EA are more recent when archive number grows within the database, only warn the user /// \param[in,out] dialog for user interaction /// \return true if check succeeded, false if warning have been issued /// \note this method is not available with partially extracted databases. bool check_order(user_interaction & dialog) const { bool initial_warn = true; if(files == nullptr) throw SRC_BUG; if(check_order_asked) return files->check_order(dialog, ".", initial_warn) && initial_warn; else return true; } private: /// holds the archive used to create the database struct archive_data { std::string chemin; //< path to the archive std::string basename; //< basename of the archive datetime root_last_mod; //< last modification date of the root directory }; std::vector coordinate; //< list of archive used to build the database std::vector options_to_dar; //< options to use when calling dar for restoration std::string dar_path; //< path to dar data_dir *files; //< structure containing files and their status in the set of archive used for that database (is set to nullptr in partial mode) storage *data_files; //< when reading archive in partial mode, this is where is located the "not readed" part of the archive (is set to nullptr in partial-read-only mode) bool check_order_asked; //< whether order check has been asked unsigned char cur_db_version; //< current db version (for informational purposes) void build(user_interaction & dialog, generic_file & f, bool partial, bool read_only, unsigned char db_version); //< used by constructors archive_num get_real_archive_num(archive_num num, bool revert) const; const datetime & get_root_last_mod(const archive_num & num) const; }; } // end of namespace #endif dar-2.5.3/src/libdar/deci.cpp0000644000175000017430000001635012641772777012677 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "deci.hpp" #include "erreurs.hpp" #include "integers.hpp" #include "nls_swap.hpp" using namespace std; namespace libdar { typedef unsigned char chiffre; static const U_I PAS = 5; static inline chiffre get_left(unsigned char a) { return (a & 0xF0) >> 4; } static inline chiffre get_right(unsigned char a) { return a & 0x0F; } static inline void set_left(unsigned char & a, chiffre val) { val <<= 4; a &= 0x0F; a |= val; } static inline void set_right(unsigned char & a, chiffre val) { val &= 0x0F; a &= 0xF0; a |= val; } static inline chiffre digit_htoc(unsigned char c) { if(c < '0' || c > '9') throw Edeci("deci.cpp : digit_htoc", gettext("invalid decimal digit")); return chiffre(c - '0'); } static inline unsigned char digit_ctoh(chiffre c) { if(c > 9) throw SRC_BUG; return '0' + c; } template void decicoupe(storage * &decimales, T x, memory_pool *p) { NLS_SWAP_IN; decimales = nullptr; try { chiffre r; const T d_t = 10; T r_t; storage::iterator it; bool recule = false; unsigned char tmp = 0; decimales = new (p) storage(PAS); if(decimales == nullptr) throw Ememory("template deci::decicoupe"); decimales->clear(0xFF); it = decimales->rbegin(); while(x > 0 || recule) { if(x > 0) { euclide(x,d_t,x,r_t); r = 0; r_t.unstack(r); } else r = 0xF; // not significative information if(recule) { set_left(tmp, chiffre(r)); if(it == decimales->rend()) { decimales->insert_const_bytes_at_iterator(decimales->begin(), 0xFF, PAS); it = decimales->begin() + PAS - 1; } *(it--) = tmp; } else set_right(tmp, chiffre(r)); recule = ! recule; } } catch(...) { if(decimales != nullptr) { delete decimales; decimales = nullptr; } NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } deci::deci(string s) { NLS_SWAP_IN; decimales = nullptr; try { string::reverse_iterator it = s.rbegin(); storage::iterator ut; bool recule = false; unsigned char tmp = 0xFF; U_I size = s.size() / 2; if(s.size() % 2 != 0) size++; if(size == 0) // empty string throw Erange("deci::deci(string s)", gettext("an empty string is an invalid argument")); decimales = new (get_pool()) storage(size); if(decimales == nullptr) throw Ememory("deci::deci(string s)"); decimales->clear(0xFF); // FF is not a valid couple of decimal digit ut = decimales->rbegin(); while(it != s.rend() || recule) { if(recule) { if(it != s.rend()) set_left(tmp, digit_htoc(*it)); else set_left(tmp, 0xF); if(ut == decimales->rend()) throw SRC_BUG; *(ut--) = tmp; } else set_right(tmp, digit_htoc(*it)); recule = ! recule; if(it != s.rend()) it++; // it is a reverse iterator thus ++ for going backward } reduce(); } catch(...) { if(decimales != nullptr) delete decimales; NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } deci::deci(const infinint & x) { try { decicoupe(decimales, x, get_pool()); reduce(); } catch(...) { if(decimales != nullptr) delete decimales; throw; } } void deci::copy_from(const deci & ref) { if(decimales != nullptr) throw SRC_BUG; decimales = new (get_pool()) storage(*ref.decimales); if(decimales == nullptr) throw SRC_BUG; } void deci::detruit() { if(decimales != nullptr) { delete decimales; decimales = nullptr; } } void deci::reduce() { bool avance = false, leading_zero = true; chiffre tmp; infinint justif_size = 0; if(decimales == nullptr) throw SRC_BUG; storage::iterator it = decimales->begin(); while(it != decimales->end() && leading_zero) { if(avance) tmp = get_right(*it); else tmp = get_left(*it); if(tmp == 0 && leading_zero) { if(avance) set_right(*it, 0xF); else set_left(*it, 0xF); tmp = 0xF; } if(tmp == 0xF) { if(leading_zero) { if(avance) ++justif_size; } else throw SRC_BUG; } if(tmp != 0 && tmp != 0xF) leading_zero = false; if(avance) ++it; avance = ! avance; } if(justif_size == decimales->size()) { --justif_size; it = decimales->rbegin(); *it = 0xF0; // need at least one digit } if(justif_size > 0) decimales->remove_bytes_at_iterator(decimales->begin(), justif_size); } string deci::human() const { string s = ""; storage::iterator it = decimales->begin(), fin = decimales->end(); bool avance = false; chiffre c; while(it != fin) { if(avance) { c = get_right(*it); ++it; } else c = get_left(*it); if(c != 0xF) s = s + string(1, digit_ctoh(c)); avance = ! avance; } return s; } infinint deci::computer() const { infinint r = 0; storage::iterator it = decimales->begin(), fin = decimales->end(); bool avance = false; chiffre c; while(it != fin) { if(avance) { c = get_right(*it); ++it; } else c = get_left(*it); if(c != 0xF) { r *= 10; r += c; } avance = ! avance; } return r; } ostream & operator << (ostream & ref, const infinint & arg) { deci tmp = arg; ref << tmp.human(); return ref; } } // end of namespace dar-2.5.3/src/libdar/defile.hpp0000644000175000017430000000444112641772777013226 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file defile.hpp /// \brief here is defined the defile class /// \ingroup Private #ifndef DEFILE_HPP #define DEFILE_HPP #include "../my_config.h" #include "path.hpp" #include "cat_entree.hpp" #include "on_pool.hpp" namespace libdar { /// \ingroup Private /// @} /// the defile class keep trace of the real path of files while the flow in the filter routines /// the filter routines manipulates flow of inode, where their relative order /// represent the directory structure. To be able to know what is the real path /// of the current inode, all previously passed inode must be known. /// this class is used to display the progression of the filtering routing, /// and the file on which the filtering routine operates /// \ingroup Private class defile : public on_pool { public : defile(const path &racine) : chemin(racine) { init = true; }; void enfile(const cat_entree *e); const path & get_path() const { return chemin; }; const std::string & get_string() const { return cache; }; private : path chemin; //< current path bool init; //< true if reached the "root" (all pushed arguments have been poped) std::string cache; //< cache of "chemin" converted into string }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/elastic.cpp0000644000175000017430000002115512641772777013416 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDLIB_H #include #endif #if HAVE_TIME_H #include #endif #if HAVE_UNISTD_H #include #endif } #include "elastic.hpp" #include "infinint.hpp" #include "header_version.hpp" #include "tools.hpp" #define SINGLE_MARK 'X' //// elastic buffer structure //// // // .......LOOOOH..... // // where '.' are random bytes and // 'L' and 'H' are LOW marks and HIGH mark respectively // OOOOO is a byte field giving the size in byte of the total // elastic buffer (big endian), written in base 254 (values corresponding to LOW and HIGH marks cannot be used here) // // before archive format "07" the size was written in base 256 which sometimes // lead this field to containe a low or high mark. At reading time it was not // possible to determin the effective size of the elastic buffer due to confusion // with this mark value inside the size field. // // some trivial elastic buffer is 'X' for a buffer of size 1 (where 'X' // is the "single mark") // and 'LH' for an elastic buffer of size 2 //////////////////////////////////// using namespace std; namespace libdar { elastic::elastic(U_32 size) { if(size == 0) throw Erange("elastic::elastic", gettext("Zero is not a valid size for an elastic buffer")); if(size > max_length()) throw Erange("elastic::elastic", gettext("Size too large for an elastic buffer")); taille = size; } elastic::elastic(const unsigned char *buffer, U_32 size, elastic_direction dir, const archive_version & reading_ver) { U_32 pos = (dir == elastic_forward ? 0 : size - 1); const U_32 first_pos = pos; S_I step = (dir == elastic_forward ? +1 : -1); unsigned char first_mark = (dir == elastic_forward ? get_low_mark(reading_ver) : get_high_mark(reading_ver)); unsigned char last_mark = (dir == elastic_forward ? get_high_mark(reading_ver) : get_low_mark(reading_ver)); while(pos < size && buffer[pos] != SINGLE_MARK && buffer[pos] != first_mark) pos += step; if(pos >= size) throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); if(buffer[pos] == SINGLE_MARK) if(first_pos == pos) taille = 1; else throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); else // elastic buffer size is greater than one { U_32 power_base = 1; U_I base = base_from_version(reading_ver); const U_32 int_width = sizeof(U_32); U_32 byte_counter = 0; // now reading total size pos += step; taille = 0; while(pos < size && buffer[pos] != last_mark) { if(dir != elastic_forward) { taille *= base; taille += buffer[pos]; } else { taille += power_base * buffer[pos]; power_base *= base; } pos += step; if(++byte_counter > int_width) throw Erange("elastic::elastic", gettext("too large elastic buffer or elastic buffer incoherent structure")); } if(pos >= size) throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); if(taille == 0 && byte_counter == 0) taille = 2; // this is the trivial buffer of size 2 else if(taille < 3) throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); } } elastic::elastic(generic_file &f, elastic_direction dir, const archive_version & reading_ver) { U_32 count = 0; S_I (generic_file::*lecture)(char &a) = (dir == elastic_forward ? &generic_file::read_forward : &generic_file::read_back); unsigned char first_mark = (dir == elastic_forward ? get_low_mark(reading_ver) : get_high_mark(reading_ver)); unsigned char last_mark = (dir == elastic_forward ? get_high_mark(reading_ver) : get_low_mark(reading_ver)); unsigned char a; while((f.*lecture)((char &)a) && a != SINGLE_MARK && a != first_mark) ++count; if(a != SINGLE_MARK && a != first_mark) throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); else ++count; if(a == SINGLE_MARK) if(count == 1) taille = 1; else throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); else // elastic buffer size is greater than one { U_32 power_base = 1; U_I base = base_from_version(reading_ver); const U_32 int_width = sizeof(U_32); U_32 byte_counter = 0; // now reading total size taille = 0; while((f.*lecture)((char &)a) && a != last_mark) { if(dir != elastic_forward) { taille *= base; taille += a; } else { taille += power_base * a; power_base *= base; } count++; if(++byte_counter > int_width) throw Erange("elastic::elastic", gettext("too large elastic buffer or elastic buffer incoherent structure")); } if(a != last_mark) throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); else count++; if(taille == 0 && byte_counter == 0) taille = 2; // this is the trivial buffer of size 2 else if(taille < 3) throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); // now skipping to the "end" of the elastic buffer if(count < taille) if(dir == elastic_forward) f.skip_relative(taille - count); else f.skip_relative(count - taille); else if(count > taille) throw Erange("elastic::elastic", gettext("elastic buffer incoherent structure")); } } U_32 elastic::dump(unsigned char *buffer, U_32 size) const { if(size < taille) throw Erange("elastic::dump", gettext("not enough space provided to dump the elastic buffer")); if(taille > 2) { U_32 pos; U_32 cur; U_32 len; static const unsigned char base = 254; vector digits = tools_number_base_decomposition_in_big_endian(taille, (unsigned char)(base)); // let's randomize a little more srand(::time(nullptr)+getpid()); //// // choosing the location of the first marks and following informations len = digits.size(); // len is the number of byte taken by the size information to encode if(len + 2 > taille) // +2 marks throw SRC_BUG; // a value takes more bytes to be stored as its own value !!! // (is only true for zero, which is an invalid "taille"). if(len + 2 < taille) cur = rand() % (taille - (len + 2)); // cur is the position of the first mark else // len + 2 == taille cur = 0; // filling non information bytes with random values for(pos = 0; pos < cur; ++pos) randomize(buffer+pos); buffer[cur++] = get_low_mark(); pos = 0; while(pos < len) buffer[cur++] = digits[pos++]; buffer[cur++] = get_high_mark(); // filling the rest of the non information byte with random values for(pos = cur; pos < taille; ++pos) randomize(buffer+pos); } else if(taille == 1) buffer[0] = SINGLE_MARK; else if(taille == 2) { buffer[0] = get_low_mark(); buffer[1] = get_high_mark(); } else throw SRC_BUG; // 'taille' is equal to zero (?) return taille; } void elastic::randomize(unsigned char *a) const { do { *a = (unsigned char)(rand() % 256); } while(*a == SINGLE_MARK || *a == get_low_mark() || *a == get_high_mark()); } U_I elastic::base_from_version(const archive_version & reading_ver) const { if(reading_ver > 6) return 254; else return 256; } unsigned char elastic::get_low_mark(const archive_version & reading_ver) const { if(reading_ver > 6) return get_low_mark(); else return '>'; } unsigned char elastic::get_high_mark(const archive_version & reading_ver) const { if(reading_ver > 6) return get_high_mark(); else return '<'; } } // end of namespace dar-2.5.3/src/libdar/secu_memory_file.cpp0000644000175000017430000000474512641772777015326 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "secu_memory_file.hpp" using namespace std; namespace libdar { bool secu_memory_file::skip(const infinint & pos) { infinint tmp = pos; if(is_terminated()) throw SRC_BUG; if(tmp >= data.get_size()) { position = data.get_size(); return false; } else { position = 0; tmp.unstack(position); if(!tmp.is_zero()) throw SRC_BUG; // pos < data.size(), which is typed U_I as well as position return true; } } bool secu_memory_file::skip_to_eof() { if(is_terminated()) throw SRC_BUG; position = data.get_size(); return true; } bool secu_memory_file::skip_relative(S_I x) { bool ret = false; if(is_terminated()) throw SRC_BUG; if(x < 0) { U_I tx = -x; if(position < tx) { position = 0; ret = false; } else { position -= tx; ret = true; } } else { position += x; if(position > data.get_size()) { position = data.get_size(); ret = false; } else ret = true; } return ret; } U_I secu_memory_file::inherited_read(char *a, U_I size) { U_I lu = 0; const char *deb = data.c_str() + position; while(lu < size && position + lu < data.get_size()) { *a = *deb; ++lu; ++a; ++deb; } position += lu; return lu; } void secu_memory_file::inherited_write(const char *a, U_I size) { data.append_at(position, a, size); position += size; } } // end of namespace dar-2.5.3/src/libdar/mem_allocator.hpp0000644000175000017430000000501412641772777014611 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file mem_allocator.hpp /// \brief this is the base class of object that can provide dynamically allocated memory blocks /// \ingroup Private #ifndef MEM_ALLOCATOR_HPP #define MEM_ALLOCATOR_HPP #include "../my_config.h" #include "erreurs.hpp" namespace libdar { /// \addtogroup Private /// @{ /// forward declaration class mem_manager; /// generic interface of objects that need to be informed that a memory block they manage has been released class mem_allocator { public: mem_allocator(mem_manager *ptr) { if(ptr == nullptr) throw SRC_BUG; manager = ptr; }; mem_allocator(const mem_allocator & ref) { throw SRC_BUG; }; const mem_allocator & operator = (const mem_allocator & ref) { throw SRC_BUG; }; virtual ~mem_allocator() {}; /// this is the interface to use to release a memory block owned by this mem_allocator virtual void release(void *ptr) = 0; /// returns the maximum occupation reached for that object (used for debugging purposes) virtual U_I max_percent_full() const = 0; protected: mem_manager & get_manager() { return *manager; }; private: mem_manager *manager; }; /// generic interface of memory managers that create and delete mem_allocator objects depending on requests class mem_manager { public: virtual ~mem_manager() {}; /// this is for the mem_allocator to inform its mem_manager that it has all its block released virtual void push_to_release_list(mem_allocator *ref) = 0; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_mirage.cpp0000644000175000017430000002345612641772777014073 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include #include "cat_mirage.hpp" #include "cat_file.hpp" #include "cat_directory.hpp" #define MIRAGE_ALONE 'X' #define MIRAGE_WITH_INODE '>' using namespace std; namespace libdar { cat_mirage::cat_mirage(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, mirage_format fmt, bool lax, bool small) : cat_nomme(pdesc, small) { init(dialog, pdesc, reading_ver, saved, stats, corres, default_algo, fmt, lax, small); } cat_mirage::cat_mirage(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, bool lax, bool small) : cat_nomme("TEMP") { init(dialog, pdesc, reading_ver, saved, stats, corres, default_algo, fmt_file_etiquette, lax, small); } void cat_mirage::init(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, mirage_format fmt, bool lax, bool small) { infinint tmp_tiquette; char tmp_flag; map::iterator etl; cat_inode *ino_ptr = nullptr; cat_entree *entree_ptr = nullptr; entree_stats fake_stats; // the call to cat_entree::read will increment counters with the inode we will read // but this inode will also be counted from the cat_entree::read we are called from. // thus we must not increment the real entree_stats structure here and we use a local variable generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; if(fmt != fmt_file_etiquette) tmp_tiquette = infinint(*ptr); switch(fmt) { case fmt_mirage: ptr->read(&tmp_flag, 1); break; case fmt_hard_link: tmp_flag = MIRAGE_ALONE; break; case fmt_file_etiquette: tmp_flag = MIRAGE_WITH_INODE; break; default: throw SRC_BUG; } switch(tmp_flag) { case MIRAGE_ALONE: // we must link with the already existing cat_etoile etl = corres.find(tmp_tiquette); if(etl == corres.end()) throw Erange("cat_mirage::cat_mirage", gettext("Incoherent catalogue structure: hard linked inode's data not found")); else { if(etl->second == nullptr) throw SRC_BUG; star_ref = etl->second; star_ref->add_ref(this); } break; case MIRAGE_WITH_INODE: // we first read the attached inode if(fmt == fmt_file_etiquette) { cat_nomme *tmp_ptr = new (get_pool()) cat_file(dialog, pdesc, reading_ver, saved, default_algo, small); entree_ptr = tmp_ptr; if(tmp_ptr != nullptr) { change_name(tmp_ptr->get_name()); tmp_ptr->change_name(""); tmp_tiquette = infinint(*ptr); } else throw Ememory("cat_mirage::init"); } else entree_ptr = cat_entree::read(dialog, get_pool(), pdesc, reading_ver, fake_stats, corres, default_algo, lax, false, small); ino_ptr = dynamic_cast(entree_ptr); if(ino_ptr == nullptr || dynamic_cast(entree_ptr) != nullptr) { if(entree_ptr != nullptr) { delete entree_ptr; entree_ptr = nullptr; } throw Erange("cat_mirage::cat_mirage", gettext("Incoherent catalogue structure: hard linked data is not an inode")); } // then we can bind the inode to the next to be create cat_etoile object try { // we must check that an already exiting cat_etoile is not present etl = corres.find(tmp_tiquette); if(etl == corres.end()) { // we can now create the cat_etoile and add it in the corres map; star_ref = new (get_pool()) cat_etoile(ino_ptr, tmp_tiquette); try { if(star_ref == nullptr) throw Ememory("cat_mirage::cat_mirage"); ino_ptr = nullptr; // the object pointed to by ino_ptr is now managed by star_ref star_ref->add_ref(this); corres[tmp_tiquette] = star_ref; } catch(...) { if(star_ref != nullptr) { delete star_ref; star_ref = nullptr; } etl = corres.find(tmp_tiquette); if(etl != corres.end()) corres.erase(etl); throw; } } else throw Erange("cat_mirage::cat_mirage", gettext("Incoherent catalogue structure: duplicated hard linked inode's data")); } catch(...) { if(ino_ptr != nullptr) { delete ino_ptr; ino_ptr = nullptr; } throw; } break; default: throw Erange("cat_mirage::cat_mirage", gettext("Incoherent catalogue structure: unknown status flag for hard linked inode")); } } const cat_mirage & cat_mirage::operator = (const cat_mirage & ref) { cat_etoile *tmp_ref; const cat_nomme * ref_nom = & ref; cat_nomme * this_nom = this; *this_nom = *ref_nom; // copying the cat_nomme part of these objects if(ref.star_ref == nullptr) throw SRC_BUG; tmp_ref = star_ref; star_ref = ref.star_ref; star_ref->add_ref(this); tmp_ref->drop_ref(this); return *this; } void cat_mirage::post_constructor(const pile_descriptor & pdesc) { cat_nomme::post_constructor(pdesc); if(star_ref == nullptr) throw SRC_BUG; if(star_ref->get_ref_count() == 1) // first time this inode is seen star_ref->get_inode()->post_constructor(pdesc); } bool cat_mirage::operator == (const cat_entree & ref) const { const cat_mirage *ref_mirage = dynamic_cast(&ref); if(ref_mirage == nullptr) return false; else { cat_inode *me = get_inode(); cat_inode *you = ref_mirage->get_inode(); if(me == nullptr || you == nullptr) throw SRC_BUG; me->change_name(get_name()); you->change_name(get_name()); return *me == *you && cat_nomme::operator == (ref); } } void cat_mirage::inherited_dump(const pile_descriptor & pdesc, bool small) const { generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; if(star_ref->get_ref_count() > 1) { char buffer[] = { MIRAGE_ALONE, MIRAGE_WITH_INODE }; cat_nomme::inherited_dump(pdesc, small); star_ref->get_etiquette().dump(*ptr); if((small && !is_inode_wrote()) || (!small && !is_inode_dumped())) { ptr->write(buffer+1, 1); // writing one char MIRAGE_WITH_INODE star_ref->get_inode()->specific_dump(pdesc, small); if(!small) set_inode_dumped(true); } else ptr->write(buffer, 1); // writing one char MIRAGE_ALONE } else // no need to record this inode with the hard link overhead { cat_inode *real = star_ref->get_inode(); real->change_name(get_name()); // set the name of the cat_mirage object to the inode real->specific_dump(pdesc, small); } } } // end of namespace dar-2.5.3/src/libdar/secu_string.cpp0000644000175000017430000001560112641773000014272 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_GCRYPT_H #ifndef GCRYPT_NO_DEPRECATED #define GCRYPT_NO_DEPRECATED #endif #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_UNISTD_H #include #endif } #include "erreurs.hpp" #include "secu_string.hpp" #include "tools.hpp" using namespace std; namespace libdar { bool secu_string::is_string_secured() { #if CRYPTO_AVAILABLE return true; #else return false; #endif } void secu_string::set(int fd, U_I size) { U_I offset = 0; S_I lu; if(size < get_allocated_size()) { clean_and_destroy(); init(size); } else clear(); do { lu = ::read(fd, mem + offset, *allocated_size - 1 - offset); if(lu < 0) { *string_size = offset; mem[offset] = '\0'; throw Erange("secu_string::read", string(gettext("Error while reading data for a secure memory:" )) + tools_strerror_r(errno)); } else offset += lu; } while(lu > 0 && offset < size); *string_size = offset; if(*string_size >= *allocated_size) throw SRC_BUG; else mem[*string_size] = '\0'; } void secu_string::append_at(U_I offset, const char *ptr, U_I size) { if(offset > *string_size) throw Erange("secu_string::append", gettext("appending data over secure_memory its end")); if(size + offset >= *allocated_size) throw Esecu_memory("secu_string::append"); (void)memcpy(mem + offset, ptr, size); offset += size; *string_size = offset; mem[*string_size] = '\0'; } void secu_string::append_at(U_I offset, int fd, U_I size) { if(offset > *string_size) throw Erange("secu_string::append", gettext("appending data after the end of a secure_memory")); if(size + offset >= *allocated_size) throw Erange("secu_string::append", gettext("Cannot receive that much data in regard to the allocated memory")); S_I lu = ::read(fd, mem + offset, size); if(lu < 0) { mem[*string_size] = '\0'; throw Erange("secu_string::read", string(gettext("Error while reading data for a secure memory:" )) + tools_strerror_r(errno)); } if(lu + offset >= *allocated_size) throw SRC_BUG; offset += lu; if(*string_size < offset) *string_size = offset; mem[*string_size] = '\0'; } void secu_string::reduce_string_size_to(U_I pos) { if(pos > *string_size) throw Erange("secu_string::reduce_string_size_to", gettext("Cannot reduce the string to a size that is larger than its current size")); *string_size = pos; mem[*string_size] = '\0'; } void secu_string::randomize(U_I size) { #if CRYPTO_AVAILABLE if(size > get_allocated_size()) throw Erange("secu_string::randomize", gettext("secu_string randomization requested exceeds storage capacity")); *string_size = size; gcry_randomize(mem, *string_size, GCRY_STRONG_RANDOM); #else throw Efeature("string randomization lacks libgcrypt"); #endif } char & secu_string::operator[] (U_I index) { if(index < get_size()) return mem[index]; else throw Erange("secu_string::operator[]", gettext("Out of range index requested for a secu_string")); } void secu_string::init(U_I size) { allocated_size = nullptr; mem = nullptr; string_size = nullptr; try { #if CRYPTO_AVAILABLE allocated_size = (U_I *)gcry_malloc_secure(sizeof(U_I)); if(allocated_size == nullptr) throw Esecu_memory("secu_string::secus_string"); #else meta_new(allocated_size, 1); if(allocated_size == nullptr) throw Ememory("secu_string::secus_string"); #endif *allocated_size = size + 1; #if CRYPTO_AVAILABLE mem = (char *)gcry_malloc_secure(*allocated_size); if(mem == nullptr) throw Esecu_memory("secu_string::secus_string"); #else meta_new(mem, *allocated_size); if(mem == nullptr) throw Ememory("secu_string::secus_string"); #endif #if CRYPTO_AVAILABLE string_size = (U_I *)gcry_malloc_secure(sizeof(U_I)); if(string_size == nullptr) throw Esecu_memory("secu_string::secus_string"); #else meta_new(string_size, 1); if(string_size == nullptr) throw Ememory("secu_string::secus_string"); #endif *string_size = 0; mem[0] = '\0'; } catch(...) { clean_and_destroy(); throw; } } void secu_string::copy_from(const secu_string & ref) { if(ref.allocated_size == nullptr) throw SRC_BUG; if(*(ref.allocated_size) == 0) throw SRC_BUG; if(ref.mem == nullptr) throw SRC_BUG; if(ref.string_size == nullptr) throw SRC_BUG; init(*(ref.allocated_size) - 1); (void)memcpy(mem, ref.mem, *(ref.string_size) + 1); // +1 to copy the ending '\0' *string_size = *(ref.string_size); } bool secu_string::compare_with(const char *ptr, U_I size) const { if(size != *string_size) return false; else { U_I cur = 0; while(cur < size && ptr[cur] == mem[cur]) ++cur; return cur == size; } } void secu_string::clean_and_destroy() { if(string_size != nullptr) { (void)memset(string_size, 0, sizeof(U_I)); #if CRYPTO_AVAILABLE gcry_free(string_size); #else meta_delete(string_size); #endif string_size = nullptr; } if(mem != nullptr) { if(allocated_size == nullptr) throw SRC_BUG; (void)memset(mem, 0, *allocated_size); #if CRYPTO_AVAILABLE gcry_free(mem); #else meta_delete(mem); #endif mem = nullptr; } if(allocated_size != nullptr) { (void)memset(allocated_size, 0, sizeof(U_I)); #if CRYPTO_AVAILABLE gcry_free(allocated_size); #else meta_delete(allocated_size); #endif allocated_size = nullptr; } } } // end of namespace dar-2.5.3/src/libdar/libdar.hpp0000644000175000017430000003730712642474041013222 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ // NOTE : The following comments are used by doxygen to generate the documentation of reference /// \mainpage /// You will find here the reference documentation for the dar and libdar source code, split in several "modules". /// - API module: contains all information for using libdar within your program /// - Tools module: contains some routines you may like to have a look at (but using them with caution) /// - Private module: contains all libdar internal documentation, it is not necessary to read it to be able to use libdar /// - CMDLINE module: contains the documentation for command-line tools, you might want to have a look for illustration of library usage. /// . /// CMDLINE module is out of any namespace as it is not inteded to be used by external application. All other symbols are part of the libdar namespace. /// /// Please not that an API tutorial is also available for a higher view of this library. /// \defgroup API API /// \brief APlication Interface /// /// This gathers all symbols that may be accessed from an external /// program. Other symbols are not as much documented, and /// may change or be removed without any warning or backward /// compatibility support. So only use the function, macro, types, /// classes... defined as member of the API module in you external programs. /// \defgroup Private Private /// \brief Symbols that are not to be used by external software. /// /// never use threses symboles (function, macro, variables, types, etc.) /// they are not intended to be used by external programs /// and may change or disapear without any warning or backward /// compatibility. Some are however documented for libdar development ease. /// \file libdar.hpp /// \brief the main file of the libdar API definitions /// \ingroup API #ifndef LIBDAR_HPP #define LIBDAR_HPP #include "../my_config.h" extern "C" { #if MUTEX_WORKS #if HAVE_PTHREAD_H #include #endif #endif } #include #include "compressor.hpp" #include "path.hpp" #include "mask.hpp" #include "integers.hpp" #include "infinint.hpp" #include "statistics.hpp" #include "user_interaction.hpp" #include "deci.hpp" #include "archive.hpp" #include "crypto.hpp" #include "thread_cancellation.hpp" #include "compile_time_features.hpp" #include "capabilities.hpp" /// \addtogroup API /// @{ /// The following macro are used in the "exception" argument of the *_noexcept() functions #define LIBDAR_XXXXXXXX /// normal return no exception has been thrown #define LIBDAR_NOEXCEPT 0 /// memory has been exhausted #define LIBDAR_EMEMORY 1 /// internal bug error. #define LIBDAR_EBUG 2 /// division by zero or other arithmetic error #define LIBDAR_EINFININT 3 /// limitint overflow #define LIBDAR_ELIMITINT 4 /// range error #define LIBDAR_ERANGE 5 /// decimal representation error #define LIBDAR_EDECI 6 /// feature not (yet) implemented #define LIBDAR_EFEATURE 7 /// hardware failure #define LIBDAR_EHARDWARE 8 /// user has aborted the operation #define LIBDAR_EUSER_ABORT 9 /// data inconsistency, error concerning the treated data #define LIBDAR_EDATA 10 /// inter slice script failure #define LIBDAR_ESCRIPT 11 /// libdar invalid call (wrong argument given to call, etc.) #define LIBDAR_ELIBCALL 12 /// unknown error #define LIBDAR_UNKNOWN 13 /// feature not activated at compilation time #define LIBDAR_ECOMPILATION 14 /// thread cancellation has been requested #define LIBDAR_THREAD_CANCEL 15 /// @} /// libdar namespace encapsulate all libdar symbols namespace libdar { /// \addtogroup API /// @{ /// libdar Major version defined at compilation time const U_I LIBDAR_COMPILE_TIME_MAJOR = 5; /// libdar Medium version defined at compilation time const U_I LIBDAR_COMPILE_TIME_MEDIUM = 7; /// libdar Minor version defined at compilation time const U_I LIBDAR_COMPILE_TIME_MINOR = 3; //////////////////////////////////////////////////////////////////////// // LIBDAR INITIALIZATION METHODS // // // // A FUNCTION OF THE get_version*() FAMILY *MUST* BE CALLED // // BEFORE ANY OTHER FUNCTION OF THIS LIBRARY // // // // CLIENT PROGRAM MUST CHECK THAT THE MAJOR NUMBER RETURNED // // BY THIS CALL IS NOT GREATER THAN THE VERSION USED AT COMPILATION // // TIME. IF SO, THE PROGRAM MUST ABORT AND RETURN A WARNING TO THE // // USER TELLING THE DYNAMICALLY LINKED VERSION IS TOO RECENT AND NOT // // COMPATIBLE WITH THIS SOFTWARE. THE MESSAGE MUST INVITE THE USER // // TO UPGRADE HIS SOFTWARE WITH A MORE RECENT VERSION COMPATIBLE WITH // // THIS LIBDAR RELEASE. // //////////////////////////////////////////////////////////////////////// /// return the libdar version, and make libdar initialization (may throw Exceptions) /// It is mandatory to call this function (or another one of the get_version* family) /// \param[out] major the major number of the version /// \param[out] medium the medium number of the version /// \param[out] minor the minor number of the version /// \param[in] init_libgcrypt whether to initialize libgcrypt if not already done (not used if libcrypt is not linked with libdar) /// \note the calling application must match that the major function /// is the same as the libdar used at compilation time. See API tutorial for a /// sample code. extern void get_version(U_I & major, U_I & medium, U_I & minor, bool init_libgcrypt = true); /// return the libdar version, and make libdar initialization (does not throw exceptions) /// It is mandatory to call this function (or another one of the get_version* family) /// \param[out] major the major number of the version /// \param[out] medium the medium number of the version /// \param[out] minor the minor number of the version /// \param[out] exception is to be compared with the LIBDAR_* macro to know whether the call succeeded /// \param[out] except_msg in case exception is not equal to LIBDAR_NOEXCEPT this argument contains /// \param[in] init_libgcrypt whether to initialize libgcrypt if not already done (not used if libcrypt is not linked with libdar) /// a human readable explaination of the error met. /// \note the calling application must match that the major function /// is the same as the libdar used at compilation time. See API tutorial for a /// sample code. extern void get_version_noexcept(U_I & major, U_I & medium, U_I & minor, U_16 & exception, std::string & except_msg, bool init_libgcrypt = true); /////////////////////////////////////////////// // CLOSING/CLEANING LIBDAR // /////////////////////////////////////////////// // while libdar has only a single boolean as global variable // that defines whether the library is initialized or not // it must proceed to mutex, and dependent libraries initializations // (liblzo, libgcrypt, etc.), which is done during the get_version() call // Some library also need to clear some data so the following call // is provided in that aim and must be called when libdar will no more // be used by the application. extern void close_and_clean(); ////////// // WRAPPER FUNCTIONS AROUND archive class methods to trap exceptions and convert them in error code and message // these are intended for C program/programmers not enough confident with C++. // // FOR LIBDAR C++ APPLICATIONS, YOU WOULD RATHER USE THE archive C++ CLASS THAN THESE FOLLOWING WRAPPERS // ////////// /// this is a wrapper around the archive constructor known as the "read" constructor /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern archive* open_archive_noexcept(user_interaction & dialog, const path & chem, const std::string & basename, const std::string & extension, const archive_options_read & options, U_16 & exception, std::string & except_msg); /// this is a wrapper around the archive constructor known as the "create" constructor /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern archive *create_archive_noexcept(user_interaction & dialog, const path & fs_root, const path & sauv_path, const std::string & filename, const std::string & extension, const archive_options_create & options, statistics * progressive_report, U_16 & exception, std::string & except_msg); /// this is a wrapper around the archive constructor known as the "isolate" constructor /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern archive *isolate_archive_noexcept(user_interaction & dialog, archive *ptr, const path &sauv_path, const std::string & filename, const std::string & extension, const archive_options_isolate & options, U_16 & exception, std::string & except_msg); /// this is a wrapper around the archive constructor known as the "merging" constructor /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern archive *merge_archive_noexcept(user_interaction & dialog, const path & sauv_path, archive *ref_arch1, const std::string & filename, const std::string & extension, const archive_options_merge & options, statistics * progressive_report, U_16 & exception, std::string & except_msg); /// this is wrapper around the archive destructor /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern void close_archive_noexcept(archive *ptr, U_16 & exception, std::string & except_msg); /// this is wrapper around the op_extract method /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern statistics op_extract_noexcept(user_interaction & dialog, archive *ptr, const path &fs_root, const archive_options_extract & options, statistics * progressive_report, U_16 & exception, std::string & except_msg); /// this is wrapper around the op_listing method /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern void op_listing_noexcept(user_interaction & dialog, archive *ptr, const archive_options_listing & options, U_16 & exception, std::string & except_msg); /// this is wrapper around the op_diff method /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern statistics op_diff_noexcept(user_interaction & dialog, archive *ptr, const path & fs_root, const archive_options_diff & options, statistics * progressive_report, U_16 & exception, std::string & except_msg); /// this is wrapper around the op_test method /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern statistics op_test_noexcept(user_interaction & dialog, archive *ptr, const archive_options_test & options, statistics * progressive_report, U_16 & exception, std::string & except_msg); /// this is wrapper around the get_children_of method /// check the archive class for details /// for an explaination of the two extra arguments exception and except_msg check /// the get_version_noexcept function extern bool get_children_of_noexcept(user_interaction & dialog, archive *ptr, const std::string & dir, U_16 & exception, std::string & except_msg); /////////////////////////////////////////////// // TOOLS ROUTINES // /////////////////////////////////////////////// /// routine provided to convert std::string to char * /// \param[in] x the string to convert /// \param[out] exception the return status of the call /// \param[out] except_msg the message taken from the caught exception in case of error /// for an explaination of the two last arguments exception and except_msg check /// the get_version_noexcept function /// \return the address of a newly allocated memory /// which must be released calling the "delete []" /// operator when no more needed. /// \return nullptr in case of error extern char *libdar_str2charptr_noexcept(const std::string & x, U_16 & exception, std::string & except_msg); /////////////////////////////////////////////// // THREAD CANCELLATION ROUTINES // /////////////////////////////////////////////// #if MUTEX_WORKS /// thread cancellation activation /// ask that any libdar code running in the thread given as argument be cleanly aborted /// when the execution will reach the next libdar checkpoint /// \param[in] tid is the Thread ID to cancel libdar in /// \param[in] immediate whether to cancel thread immediately or just signal the request to the thread /// \param[in] flag an arbitrary value passed as-is through libdar inline extern void cancel_thread(pthread_t tid, bool immediate = true, U_64 flag = 0) { thread_cancellation::cancel(tid, immediate, flag); } /// consultation of the cancellation status of a given thread /// \param[in] tid is the tid of the thread to get status about /// \return false if no cancellation has been requested for the given thread inline extern bool cancel_status(pthread_t tid) { return thread_cancellation::cancel_status(tid); } /// thread cancellation deactivation /// abort the thread cancellation for the given thread /// \return false if no thread cancellation was under process for that thread /// or if there is no more pending cancellation (thread has already been canceled). inline extern bool cancel_clear(pthread_t tid) { return thread_cancellation::clear_pending_request(tid); } #endif /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_ignored.cpp0000644000175000017430000000261712641772777014252 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_ignored.hpp" using namespace std; namespace libdar { bool cat_ignored::operator == (const cat_entree & ref) const { const cat_ignored *ref_ignored = dynamic_cast(&ref); if(ref_ignored == nullptr) return false; else return cat_nomme::operator == (ref); } } // end of namespace dar-2.5.3/src/libdar/fichier_local.cpp0000644000175000017430000003053412641773016014541 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include "infinint.hpp" #include "generic_file.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "cygwin_adapt.hpp" #include "int_tools.hpp" #include "tools.hpp" #include "fichier_local.hpp" #include #include #define BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < BUFFER_SIZE #undef BUFFER_SIZE #define BUFFER_SIZE SSIZE_MAX #endif #endif using namespace std; namespace libdar { fichier_local::fichier_local(user_interaction & dialog, const string & chemin, gf_mode m, U_I permission, bool fail_if_exists, bool erase, bool furtive_mode) : fichier_global(dialog, m) { fichier_local::open(chemin, m, permission, fail_if_exists, erase, furtive_mode); } fichier_local::fichier_local(const string & chemin, bool furtive_mode) : fichier_global(user_interaction_blind(), gf_read_only) { // in read-only mode the user_interaction is not expected to be used fichier_local::open(chemin, gf_read_only, 0, false, false, furtive_mode); } void fichier_local::change_ownership(const std::string & user, const std::string & group) { if(is_terminated()) throw SRC_BUG; // this method cannot be inlined to avoid cyclic dependency in headers files // fichier_global.hpp would then needs tools.hpp, which need limitint.hpp which relies // back on fichier.hpp tools_set_ownership(filedesc, user, group); } void fichier_local::change_permission(U_I perm) { if(is_terminated()) throw SRC_BUG; // this method cannot be inlined to avoid cyclic dependency in headers files // fichier_global.hpp would then needs tools.hpp, which need limitint.hpp which relies // back on fichier.hpp tools_set_permission(filedesc, perm); } infinint fichier_local::get_size() const { struct stat dat; infinint filesize; if(is_terminated()) throw SRC_BUG; if(filedesc < 0) throw SRC_BUG; if(fstat(filedesc, &dat) < 0) throw Erange("fichier_local::get_size()", string(gettext("Error getting size of file: ")) + tools_strerror_r(errno)); else filesize = dat.st_size; return filesize; } void fichier_local::fadvise(advise adv) const { if(is_terminated()) throw SRC_BUG; #if HAVE_POSIX_FADVISE int ret = posix_fadvise(filedesc, 0, 0, advise_to_int(adv)); if(ret == EBADF) throw SRC_BUG; // filedesc not a valid file descriptor !?! if(ret != 0) throw Erange("fichier_local::fadvise", string("Set posix advise failed: ") + tools_strerror_r(errno)); #endif } void fichier_local::fsync() const { if(is_terminated()) throw SRC_BUG; #if HAVE_FDATASYNC S_I st = ::fdatasync(filedesc); #else S_I st = ::fsync(filedesc); #endif if(st < 0) throw Erange("fichier_local::fsync", string("Failed sync the slice (fdatasync): ") + tools_strerror_r(errno)); } bool fichier_local::skip(const infinint &q) { off_t delta; infinint pos = q; if(is_terminated()) throw SRC_BUG; if(lseek(filedesc, 0, SEEK_SET) < 0) return false; do { delta = 0; pos.unstack(delta); if(delta > 0) if(lseek(filedesc, delta, SEEK_CUR) < 0) return false; } while(delta > 0); return true; } bool fichier_local::skip_to_eof() { if(is_terminated()) throw SRC_BUG; return lseek(filedesc, 0, SEEK_END) >= 0; } bool fichier_local::skip_relative(S_I x) { if(is_terminated()) throw SRC_BUG; if(x > 0) { if(lseek(filedesc, x, SEEK_CUR) < 0) return false; else return true; } if(x < 0) { bool ret = true; off_t actu = lseek(filedesc, 0, SEEK_CUR); if(actu < -x) { actu = 0; ret = false; } else actu += x; // x is negative if(lseek(filedesc, actu, SEEK_SET) < 0) ret = false; return ret; } return true; } infinint fichier_local::get_position() const { if(is_terminated()) throw SRC_BUG; off_t ret = lseek(filedesc, 0, SEEK_CUR); if(ret == -1) throw Erange("fichier_local::get_position", string(gettext("Error getting file reading position: ")) + tools_strerror_r(errno)); return ret; } bool fichier_local::fichier_global_inherited_read(char *a, U_I size, U_I & read, string & message) { ssize_t ret = -1; read = 0; #ifdef MUTEX_WORKS check_self_cancellation(); #endif do { #ifdef SSIZE_MAX U_I to_read = size - read > SSIZE_MAX ? SSIZE_MAX : size - read; #else U_I to_read = size - read; #endif ret = ::read(filedesc, a+read, to_read); if(ret < 0) { switch(errno) { case EINTR: break; case EAGAIN: throw SRC_BUG; // "non blocking" read is not expected in this implementation case EIO: throw Ehardware("fichier_local::inherited_read", string(gettext("Error while reading from file: ")) + tools_strerror_r(errno)); default : throw Erange("fichier_local::inherited_read", string(gettext("Error while reading from file: ")) + tools_strerror_r(errno)); } } else read += ret; } while(read < size && ret != 0); if(adv == advise_dontneed) fadvise(adv); return true; // we never make partial reading, here } U_I fichier_local::fichier_global_inherited_write(const char *a, U_I size) { ssize_t ret; U_I total = 0; // due to posix inconsistence in write(2) // we cannot write more than SSIZE_MAX/2 byte // to be able to have a positive returned value // in case of success, a negative else. As the // returned type of write() is signed size_t, // which max positive value is SSIZE_MAX/2 (rounded // to the lower interger) #ifdef SSIZE_MAX static const U_I step = SSIZE_MAX/2; #else const U_I step = size; // which is no limit... #endif #ifdef MUTEX_WORKS check_self_cancellation(); #endif while(total < size) { if(size - total > step) ret = ::write(filedesc, a+total, step); else ret = ::write(filedesc, a+total, size - total); if(ret < 0) { switch(errno) { case EINTR: break; case EIO: throw Ehardware("fichier_local::inherited_write", string(gettext("Error while writing to file: ")) + tools_strerror_r(errno)); case ENOSPC: return total; // partial writing, we stop here returning the amount of data wrote so far // because there is no space left on device. The parent class manages the user interaction // to allow abortion or action that frees up some storage space. default : throw Erange("fichier_local::inherited_write", string(gettext("Error while writing to file: ")) + tools_strerror_r(errno)); } } else total += ret; } if(adv == advise_dontneed) // we should call fsync() here but we do not to to avoid blocking the process: // we assume the system has flushed some blocks of possibly previous writes // so we just inform the system to remove from cache blocks associated to this // file that have already been flushed. fadvise(adv); return total; } void fichier_local::open(const string & chemin, gf_mode m, U_I permission, bool fail_if_exists, bool erase, bool furtive_mode) { U_I o_mode = O_BINARY; const char *name = chemin.c_str(); adv = advise_normal; switch(m) { case gf_read_only : o_mode |= O_RDONLY; break; case gf_write_only : o_mode |= O_WRONLY; break; case gf_read_write : o_mode |= O_RDWR; break; default: throw SRC_BUG; } if(m != gf_read_only) { o_mode |= O_CREAT; if(fail_if_exists) o_mode |= O_EXCL; if(erase) o_mode |= O_TRUNC; } #if FURTIVE_READ_MODE_AVAILABLE if(furtive_mode) // only used for read-only, but available for write-only and read-write modes o_mode |= O_NOATIME; #else if(furtive_mode) throw Ecompilation(gettext("Furtive read mode")); #endif try { do { if(m != gf_read_only) filedesc = ::open(name, o_mode, permission); else filedesc = ::open(name, o_mode); if(filedesc < 0) { switch(errno) { case ENOSPC: if(get_mode() == gf_read_only) throw SRC_BUG; // in read_only mode we do not need to create a new inode !!! get_ui().pause(gettext("No space left for inode, you have the opportunity to make some room now. When done : can we continue ?")); break; case EEXIST: throw Esystem("fichier_local::open", tools_strerror_r(errno), Esystem::io_exist); case ENOENT: throw Esystem("fichier_local::open", tools_strerror_r(errno), Esystem::io_absent); case EACCES: throw Esystem("fichier_local::open", tools_strerror_r(errno), Esystem::io_access); default: throw Erange("fichier_local::open", string(gettext("Cannot open file : ")) + tools_strerror_r(errno)); } } } while(filedesc < 0 && errno == ENOSPC); } catch(...) { if(filedesc >= 0) { ::close(filedesc); filedesc = -1; } throw; } } void fichier_local::copy_from(const fichier_local & ref) { filedesc = dup(ref.filedesc); if(filedesc < 0) { string tmp = tools_strerror_r(errno); throw Erange("fichier_local::copy_from", tools_printf(gettext("Cannot dup() filedescriptor while copying \"fichier_local\" object: %s"), tmp.c_str())); } } void fichier_local::copy_parent_from(const fichier_local & ref) { fichier_global *me = this; const fichier_global *you = &ref; *me = *you; } int fichier_local::advise_to_int(advise arg) const { #if HAVE_POSIX_FADVISE switch(arg) { case advise_normal: return POSIX_FADV_NORMAL; case advise_sequential: return POSIX_FADV_SEQUENTIAL; case advise_random: return POSIX_FADV_RANDOM; case advise_noreuse: return POSIX_FADV_NOREUSE; case advise_willneed: return POSIX_FADV_WILLNEED; case advise_dontneed: return POSIX_FADV_DONTNEED; default: throw SRC_BUG; } #else return 0; #endif } } // end of namespace dar-2.5.3/src/libdar/sar_tools.hpp0000644000175000017430000000421712641772777014004 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file sar_tools.hpp /// \brief a set of tools aims to help Segmentation And Reassemblement (sar) class /// \ingroup Private #ifndef SAR_TOOLS_HPP #define SAR_TOOLS_HPP #include "../my_config.h" #include #include "integers.hpp" #include "infinint.hpp" #include "generic_file.hpp" #include "header.hpp" #include "sar.hpp" #include "memory_pool.hpp" #include "label.hpp" namespace libdar { extern std::string sar_tools_make_filename(const std::string & base_name, const infinint & num, const infinint & min_digits, const std::string & ext); extern bool sar_tools_extract_num(const std::string & filename, const std::string & base_name, const infinint & min_digits, const std::string & ext, infinint & ret); extern bool sar_tools_get_higher_number_in_dir(entrepot & entr, const std::string & base_name, const infinint & min_digits, const std::string & ext, infinint & ret); extern std::string sar_tools_make_padded_number(const std::string & num, const infinint & min_digits); } // end of namespace #endif dar-2.5.3/src/libdar/pile_descriptor.hpp0000644000175000017430000000367112641772777015171 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file pile_descriptor.hpp /// \brief optimization structure to quickly access some commonly used layers of a stack of generic_file /// \ingroup Private #ifndef CAT_PILE_DESCRIPTOR_HPP #define CAT_PILE_DESCRIPTOR_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "pile.hpp" #include "escape.hpp" #include "compressor.hpp" namespace libdar { /// \addtogroup Private /// @{ struct pile_descriptor { pile *stack; //< the stack to read from or write to (should never be equal to nullptr) escape *esc; //< an escape layer in stack (may be nullptr) compressor *compr; //< a compressor layer in stack (should never be equal to nullptr) pile_descriptor() { stack = nullptr; esc = nullptr; compr = nullptr; }; pile_descriptor(pile *ptr); void check(bool small) const; //< check structure coherence with expected read/write mode (small or normal) }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/generic_file.cpp0000644000175000017430000002420212642474445014371 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include "infinint.hpp" #include "generic_file.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "cygwin_adapt.hpp" #include "int_tools.hpp" #include "crc.hpp" #include #include #define BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < BUFFER_SIZE #undef BUFFER_SIZE #define BUFFER_SIZE SSIZE_MAX #endif #endif using namespace std; namespace libdar { void generic_file::terminate() const { generic_file *ceci = const_cast(this); try { if(!terminated) ceci->inherited_terminate(); } catch(...) { ceci->terminated = true; throw; } ceci->terminated = true; } void generic_file::read_ahead(const infinint & amount) { if(terminated) throw SRC_BUG; if(rw == gf_write_only) throw Erange("generic_file::read", gettext("Reading ahead a write only generic_file")); else if(no_read_ahead) return; else inherited_read_ahead(amount); } U_I generic_file::read(char *a, U_I size) { if(terminated) throw SRC_BUG; if(rw == gf_write_only) throw Erange("generic_file::read", gettext("Reading a write only generic_file")); else return (this->*active_read)(a, size); } void generic_file::write(const char *a, U_I size) { if(terminated) throw SRC_BUG; if(rw == gf_read_only) throw Erange("generic_file::write", gettext("Writing to a read only generic_file")); else (this->*active_write)(a, size); } void generic_file::write(const string & arg) { if(terminated) throw SRC_BUG; if(arg.size() > int_tools_maxof_agregate(U_I(0))) throw SRC_BUG; write(arg.c_str(), arg.size()); } S_I generic_file::read_back(char &a) { if(terminated) throw SRC_BUG; if(skip_relative(-1)) { U_I ret = read(&a,1); skip_relative(-1); return ret; } else return 0; } void generic_file::copy_to(generic_file & ref) { char buffer[BUFFER_SIZE]; U_I lu; if(terminated) throw SRC_BUG; do { try { lu = this->read(buffer, BUFFER_SIZE); } catch(Egeneric & e) { e.stack("generic_file::copy_to", "read"); throw; } if(lu > 0) { try { ref.write(buffer, lu); } catch(Egeneric & e) { e.stack("generic_file::copy_to", "write"); throw; } } } while(lu > 0); } void generic_file::copy_to(generic_file & ref, const infinint & crc_size, crc * & value) { if(terminated) throw SRC_BUG; reset_crc(crc_size); copy_to(ref); value = get_crc(); } U_32 generic_file::copy_to(generic_file & ref, U_32 size) { char buffer[BUFFER_SIZE]; S_I lu = 1, pas; U_32 wrote = 0; if(terminated) throw SRC_BUG; while(wrote < size && lu > 0) { pas = size > BUFFER_SIZE ? BUFFER_SIZE : size; try { lu = read(buffer, pas); } catch(Egeneric & e) { e.stack("generic_file::copy_to", "read"); throw; } if(lu > 0) { try { ref.write(buffer, lu); } catch(Egeneric & e) { e.stack("generic_file::copy_to", "write"); throw; } wrote += lu; } } return wrote; } infinint generic_file::copy_to(generic_file & ref, infinint size) { U_32 tmp = 0, delta; infinint wrote = 0; if(terminated) throw SRC_BUG; size.unstack(tmp); do { delta = copy_to(ref, tmp); wrote += delta; tmp -= delta; if(tmp == 0) size.unstack(tmp); } while(tmp > 0); return wrote; } bool generic_file::diff(generic_file & f, const infinint & me_read_ahead, const infinint & you_read_ahead, const infinint & crc_size, crc * & value) { infinint err_offset; return diff(f, me_read_ahead, you_read_ahead, crc_size, value, err_offset); } bool generic_file::diff(generic_file & f, const infinint & me_read_ahead, const infinint & you_read_ahead, const infinint & crc_size, crc * & value, infinint & err_offset) { char buffer1[BUFFER_SIZE]; char buffer2[BUFFER_SIZE]; U_I lu1 = 0, lu2 = 0; bool diff = false; err_offset = 0; if(terminated) throw SRC_BUG; if(get_mode() == gf_write_only || f.get_mode() == gf_write_only) throw Erange("generic_file::diff", gettext("Cannot compare files in write only mode")); skip(0); f.skip(0); read_ahead(me_read_ahead); f.read_ahead(you_read_ahead); value = create_crc_from_size(crc_size, get_pool()); if(value == nullptr) throw SRC_BUG; try { do { lu1 = read(buffer1, BUFFER_SIZE); lu2 = f.read(buffer2, BUFFER_SIZE); if(lu1 == lu2) { U_I i = 0; while(i < lu1 && buffer1[i] == buffer2[i]) ++i; if(i < lu1) { diff = true; err_offset += i; } else { err_offset += lu1; value->compute(buffer1, lu1); } } else { U_I min = lu1 > lu2 ? lu2 : lu1; diff = true; err_offset += min; } } while(!diff && lu1 > 0); } catch(...) { delete value; value = nullptr; throw; } return diff; } void generic_file::reset_crc(const infinint & width) { if(terminated) throw SRC_BUG; if(active_read == &generic_file::read_crc) throw SRC_BUG; // crc still active, previous CRC value never read if(checksum != nullptr) throw SRC_BUG; // checksum is only created when crc mode is activated checksum = create_crc_from_size(width, get_pool()); enable_crc(true); } crc *generic_file::get_crc() { crc *ret = nullptr; if(checksum == nullptr) throw SRC_BUG; else { ret = checksum; checksum = nullptr; // the CRC object is now under the responsibility of the caller } enable_crc(false); return ret; } void generic_file::sync_write() { if(terminated) throw SRC_BUG; if(rw == gf_write_only || rw == gf_read_write) inherited_sync_write(); else throw Erange("generic_file::sync_write", gettext("Cannot sync write on a read-only generic_file")); } void generic_file::flush_read() { if(terminated) throw SRC_BUG; if(rw == gf_read_only || rw == gf_read_write) inherited_flush_read(); else throw Erange("genercic_file::flush_read", gettext("Cannot flush read a write-only generic_file")); } void generic_file::enable_crc(bool mode) { if(terminated) throw SRC_BUG; if(mode) // routines with crc features { if(checksum == nullptr) throw SRC_BUG; active_read = &generic_file::read_crc; active_write = &generic_file::write_crc; } else { active_read = &generic_file::inherited_read; active_write = &generic_file::inherited_write; } } U_I generic_file::read_crc(char *a, U_I size) { if(terminated) throw SRC_BUG; else { S_I ret = inherited_read(a, size); if(checksum == nullptr) throw SRC_BUG; checksum->compute(a, ret); return ret; } } void generic_file::write_crc(const char *a, U_I size) { if(terminated) throw SRC_BUG; inherited_write(a, size); if(checksum == nullptr) throw SRC_BUG; checksum->compute(a, size); } void generic_file::destroy() { if(checksum != nullptr) { delete checksum; checksum = nullptr; } } void generic_file::copy_from(const generic_file & ref) { rw = ref.rw; if(ref.checksum != nullptr) checksum = ref.checksum->clone(); else checksum = nullptr; terminated = ref.terminated; no_read_ahead = ref.no_read_ahead; active_read = ref.active_read; active_write = ref.active_write; } const char * generic_file_get_name(gf_mode mode) { const char *ret = nullptr; switch(mode) { case gf_read_only: ret = gettext("read only"); break; case gf_write_only: ret = gettext("write only"); break; case gf_read_write: ret = gettext("read and write"); break; default: throw SRC_BUG; } return ret; } } // end of namespace dar-2.5.3/src/libdar/cache.hpp0000644000175000017430000001125612641772777013043 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cache.hpp /// \brief contains the cache class /// \ingroup Private #ifndef CACHE_HPP #define CACHE_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" namespace libdar { /// \ingroup Private /// @} /// the cache class implements a fixed length read/write caching mechanism /// /// it is intended to reduce context switches when no compression is used /// and when reading or writing catalogue through a pipe. The catalogue /// read and write is done by calling dump/constructor methods of the many /// objects that a catalogue contains. This makes a lot of small reads or /// writes, which make very poor performances when used over the network /// through a pipe to ssh. When compression is used, the problem disapears /// as the compression engine gather these many small reads or writes into /// much bigger ones. This in only when there is no compression or encryption /// that this class is useful (and used). /// Another target of class cache is to provide limited skippability when /// data is read of written to pipe (which do not have any skippability) class cache : public generic_file { public: cache(generic_file & hidden, //< is the file to cache, it is never deleted by the cache object, bool shift_mode, //< if true, when all cached data has been read, half of the data is flushed from the cache, the other half is shifted and new data take place to fill the cache. This is necessary for sequential reading, but has some CPU overhead. U_I size = 102400); //< is the (fixed) size of the cache cache(const cache & ref) : generic_file(ref.get_mode()) { throw SRC_BUG; }; const cache & operator = (const cache & ref) { throw SRC_BUG; }; ~cache(); void change_to_read_write() { if(get_mode() == gf_read_only) throw SRC_BUG; set_mode(gf_read_write); }; // inherited from generic_file bool skippable(skippability direction, const infinint & amount); bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const { return buffer_offset + next; }; protected: // inherited from generic_file void inherited_read_ahead(const infinint & amount) { ref->read_ahead(amount - available_in_cache(generic_file::skip_forward)); }; U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() { flush_write(); }; void inherited_flush_read() { flush_write(); clear_buffer(); }; void inherited_terminate() { flush_write(); }; private: generic_file *ref; //< underlying file, (not owned by "this', not to be delete by "this") char *buffer; //< data in transit U_I size; //< allocated size U_I next; //< next to read or next place to write to U_I last; //< last valid data in the cache. we have: next <= last < size U_I first_to_write; //< position of the first byte that need to be written. if greater than last, no byte need writing infinint buffer_offset; //< position of the first byte in buffer bool shifted_mode; //< whether to half flush and shift or totally flush data bool need_flush_write() const { return first_to_write < last; }; void alloc_buffer(size_t x_size); //< allocate x_size byte in buffer field and set size accordingly void release_buffer(); //< release memory set buffer to nullptr and size to zero void shift_by_half(); void clear_buffer(); void flush_write(); void fulfill_read(); U_I available_in_cache(skippability direction) const; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/sar.hpp0000644000175000017430000002744212641772777012571 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file sar.hpp /// \brief the sar and trivial_sar classes, they manage the slicing layer /// \ingroup Private #ifndef SAR_HPP #define SAR_HPP #include "../my_config.h" #include #include "infinint.hpp" #include "generic_file.hpp" #include "header.hpp" #include "path.hpp" #include "integers.hpp" #include "entrepot.hpp" #include "tools.hpp" #include "slice_layout.hpp" namespace libdar { // contextual is defined in generic_file module /// \addtogroup Private /// @{ /// Sar class stands for Segmentation And Reassembly class /// sar is used as a normal file but given some parameters at construction time /// the object will split the data in several files of given size (aka slices) /// sar uses a header to identify slices in a given set and tie slices of different sets /// At reading time sar transparently read data from the different slices. class sar : public generic_file, public contextual, protected mem_ui { public: /// this constructor reads data from a set of slices /// \param[in] dialog is for user interation (such a requesting a slice and pausing between slices) /// \param[in] base_name is the basename of all slices of the set (it will be added the "..extension" to form a filename /// \param[in] extension is the extension of slice's filenames /// \param[in] where defines where to store or where are stored slices /// \param[in] by_the_end if true dar will try to open the slice set starting from the last slice else it will try starting from the first /// \param[in] x_min_digits is the minimum number of digits the slices number is stored with in the filename /// \param[in] lax if set to true will try workaround problems that would otherwise lead the operation to fail /// \param[in] execute is the command to execute before trying to open each slice for reading /// \note if by_the_end is set to true, the last slice must have extended slice header that contain informations about /// the first slice size (used starting archive format "08"), Else, the slice size is not possible to open as the offset /// of the data cannot be determin. If slice header is too old the sar class will fallback openning the first slice and /// directly get the first slice. sar(const user_interaction & dialog, const std::string & base_name, const std::string & extension, const entrepot & where, bool by_the_end, const infinint & x_min_digits, bool lax = false, const std::string & execute = ""); /// this constructor creates a new set of slices /// \param[in,out] dialog is used for user interaction /// \param[in] open_mode read_write or write_only is accepted only /// \param[in] base_name is the slice set base name /// \param[in] extension is the slices extension /// \param[in] file_size is the size of slices (in byte) /// \param[in] first_file_size is the size of the first slice (in byte) or set it to zero if it has to be equal to other slice's size /// \param[in] x_warn_overwrite if set to true, a warning will be issued before overwriting a slice /// \param[in] x_allow_overwrite if set to false, no slice overwritting will be allowed /// \param[in] pause if set to zero no pause will be done between slice creation. If set to 1 a pause between each slice will be done. If set to N a pause each N slice will be done. Pauses must be acknoledged by user for the process to continue /// \param[in] where defines where to store the slices /// \param[in] internal_name is a tag common to all slice of the archive /// \param[in] data_name is a tag that has to be associated with the data. /// \param[in] force_permission if true slice permission will be forced to the value given in the next argument /// \param[in] permission value to use to set permission of slices /// \param[in] x_hash defines whether a hash file has to be generated for each slice, and wich hash algorithm to use /// \param[in] x_min_digits is the minimum number of digits the slices number is stored with in the filename /// \param[in] format_07_compatible when set to true, creates a slice header in the archive format of version 7 instead of the highest version known /// \param[in] execute is the command to execute after each slice creation (once it is completed) /// \note data_name should be equal to internal_name except when reslicing an archive as dar_xform does in which /// case internal_name is randomly, and data_name is kept from the source archive sar(const user_interaction & dialog, gf_mode open_mode, const std::string & base_name, const std::string & extension, const infinint & file_size, const infinint & first_file_size, bool x_warn_overwrite, bool x_allow_overwrite, const infinint & pause, const entrepot & where, const label & internal_name, const label & data_name, bool force_permission, U_I permission, hash_algo x_hash, const infinint & x_min_digits, bool format_07_compatible, const std::string & execute = ""); /// the destructor sar(const sar & ref) : generic_file(ref), mem_ui(ref) { throw Efeature("class sar's copy constructor is not implemented"); }; /// destructor ~sar(); // inherited from generic_file bool skippable(skippability direction, const infinint & amount); bool skip(const infinint &pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const; // informational routines const slice_layout & get_slicing() const { return slicing; }; bool get_total_file_number(infinint &num) const { num = of_last_file_num; return of_last_file_known; }; bool get_last_file_size(infinint &num) const { num = of_last_file_size; return of_last_file_known; }; // disable execution of user command when destroying the current object void disable_natural_destruction() { natural_destruction = false; }; // enable back execution of user command when destroying the current object void enable_natural_destruction() { natural_destruction = true; }; // true if sar's header is from an old archive format (<= "07") bool is_an_old_start_end_archive() const { return slicing.older_sar_than_v8; }; // return the internal_name used to link slices toghether const label & get_internal_name_used() const { return of_internal_name; }; // return the data_name used to link slices toghether const label & get_data_name() const { return of_data_name; }; const entrepot *get_entrepot() const { return entr; }; protected : void inherited_read_ahead(const infinint & amount); U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() {}; // nothing to do void inherited_flush_read() {}; // nothing to do void inherited_terminate(); private : entrepot *entr; //< where are stored slices std::string base; //< archive base name std::string ext; //< archive extension std::string hook; //< command line to execute between slices slice_layout slicing; //< slice layout infinint file_offset; //< current reading/writing position in the current slice (relative to the whole slice file, including headers) hash_algo hash; //< whether to build a hashing when creating slices, and if so, which algorithm to use infinint min_digits; //< minimum number of digits the slices number is stored with in the filename bool natural_destruction; //< whether to execute commands between slices on object destruction // these following variables are modified by open_file / open_file_init // else the are used only for reading infinint of_current; //< number of the open slice infinint size_of_current; //< size of the current slice (used in reading mode only) infinint of_max_seen; //< highest slice number seen so far bool of_last_file_known; //< whether the T terminal slice has been met infinint of_last_file_num; //< number of the last slice (if met) infinint of_last_file_size; //< size of the last slice (if met) label of_internal_name; //< internal name shared in all slice header label of_data_name; //< internal name linked to data (transparent to dar_xform and used by isolated catalogue as reference) bool force_perm; //< true if any future slice has its permission to be set explicitely U_I perm; //< if force_perm is true, value to use for slice permission fichier_global *of_fd; //< file object currently openned char of_flag; //< flags of the open file bool initial; //< do not launch hook command-line during sar initialization // these are the option flags bool opt_warn_overwrite; //< a warning must be issued before overwriting a slice bool opt_allow_overwrite; //< is slice overwriting allowed // infinint pause; //< do we pause between slices bool lax; //< whether to try to go further reading problems infinint to_read_ahead; //< amount of data to read ahead for next slices bool skip_forward(U_I x); //< skip forward in sar global contents bool skip_backward(U_I x); //< skip backward in sar global contents void close_file(bool terminal); //< close current openned file, adding (in write mode only) a terminal mark (last slice) or not void open_readonly(const std::string & fic, const infinint &num); //< open file of name "filename" for read only "num" is the slice number void open_writeonly(const std::string & fic, const infinint &num); //< open file of name "filename" for write only "num" is the slice number void open_file_init(); //< initialize some of_* fields void open_file(infinint num); //< close current slice and open the slice 'num' void set_offset(infinint offset); //< skip to current slice relative offset void open_last_file(); //< open the last slice, ask the user, test, until last slice available bool is_current_eof_a_normal_end_of_slice() const; //< return true if current reading position is at end of slice infinint bytes_still_to_read_in_slice() const; //< returns the number of bytes expected before the end of slice header make_write_header(const infinint &num, char flag); // function to lauch the eventually existing command to execute after/before each slice void hook_execute(const infinint &num); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/integers.hpp0000644000175000017430000000715612641772777013624 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file integers.hpp /// \brief are defined here basic integer types that tend to be portable /// \ingroup Private #ifndef INTEGERS_HPP #define INTEGERS_HPP #include "../my_config.h" #include /// \addtogroup Private /// @{ #ifndef OS_BITS #if HAVE_INTTYPES_H extern "C" { #if HAVE_INTTYPES_H #include #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" namespace libdar { typedef unsigned char U_8; typedef uint16_t U_16; typedef uint32_t U_32; typedef uint64_t U_64; typedef size_t U_I; // configure will define size_t as "unsigned int" if it not defined by system headers // thus using U_I we are sure we can compare buffer sizes with SSIZE_MAX typedef signed char S_8; typedef int16_t S_16; typedef int32_t S_32; typedef int64_t S_64; typedef signed int S_I; } #else // HAVE_INTTYPES_H #error "Cannot determine interger types, use --enable-os-bits=... with the 'configure' script according to your system's CPU register size" #endif // HAVE_INTTYPES_H #else // OS_BITS is defined #if OS_BITS == 32 namespace libdar { typedef unsigned char U_8; typedef unsigned short U_16; typedef unsigned long U_32; typedef unsigned long long U_64; typedef size_t U_I; typedef signed char S_8; typedef signed short S_16; typedef signed long S_32; typedef signed long long S_64; typedef signed int S_I; } #else // OS_BITS != 32 #if OS_BITS == 64 namespace libdar { typedef unsigned char U_8; typedef unsigned short U_16; typedef unsigned int U_32; typedef unsigned long long U_64; typedef size_t U_I; typedef signed char S_8; typedef signed short S_16; typedef signed int S_32; typedef signed long long S_64; typedef signed int S_I; } #else // OS_BITS != 32 and OS_BITS != 64 #error "unknown value given to --enable-os-bits=... check the 'configure' script arguments" // unknown OS_BITS value ! use --enable-os-bits=... option to configure script // // the previous line should not compile, this is the expected behaviour #endif // OS_BITS == 64 #endif // OS_BITS == 32 #endif // OS_BITS not defined namespace libdar { /// checks sign and width of integer types /// \note this call may throws an Ehardware exception void integer_check(); /// returns true if the system is big endian, false else /// \note this call may throw an Ehardware() exception if the /// system is not coherent for all integer types bool integers_system_is_big_endian(); } /// @} #endif // header file multiple inclusion protection dar-2.5.3/src/libdar/cat_directory.hpp0000644000175000017430000001512412642457363014621 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_directory.hpp /// \brief class used to organize objects in tree in catalogue as like directories in a filesystem /// \ingroup Private #ifndef CAT_DIRECTORY_HPP #define CAT_DIRECTORY_HPP #include "../my_config.h" extern "C" { } // end extern "C" #ifdef LIBDAR_FAST_DIR #include #endif #include #include "cat_inode.hpp" #include "cat_tools.hpp" namespace libdar { class cat_eod; /// \addtogroup Private /// @{ /// the cat_directory inode class class cat_directory : public cat_inode { public : cat_directory(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & xname, const infinint & device); cat_directory(const cat_directory &ref); // only the inode part is build, no children is duplicated (empty dir) const cat_directory & operator = (const cat_directory & ref); // set the inode part *only* no subdirectories/subfiles are copies or removed. cat_directory(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, bool lax, bool only_detruit, // objects of other class than detruit and cat_directory are not built in memory bool small); ~cat_directory() throw(Ebug); // detruit aussi tous les fils et se supprime de son 'parent' /// attention this compares only the directories themselves, not the list of their children bool operator == (const cat_entree & ref) const; void add_children(cat_nomme *r); // when r is a cat_directory, 'parent' is set to 'this' bool has_children() const { return !ordered_fils.empty(); }; void reset_read_children() const; void end_read() const; bool read_children(const cat_nomme * &r) const; // read the direct children of the cat_directory, returns false if no more is available // remove all entry not yet read by read_children void tail_to_read_children(); /// remove the given entry from the catalogue /// /// \note read_children() is taken into account by this operation, /// no need to call reset_read_children(), if the argument removed was the /// one about to be read by read_children() the one following the removed entry /// will be returned the next time read_children() is invoked. void remove(const std::string & name); cat_directory * get_parent() const { return parent; }; bool search_children(const std::string &name, const cat_nomme *&ref) const; bool callback_for_children_of(user_interaction & dialog, const std::string & sdir, bool isolated = false) const; // using is_more_recent_than() from cat_inode class // using method has_changed_since() from cat_inode class unsigned char signature() const { return mk_signature('d', get_saved_status()); }; /// detemine whether some data has changed since archive of reference in this cat_directory or subdirectories bool get_recursive_has_changed() const { return recursive_has_changed; }; /// ask recursive update for the recursive_has_changed field void recursive_has_changed_update() const; /// get then number of "cat_nomme" entry contained in this cat_directory and subdirectories (recursive call) infinint get_tree_size() const; /// get the number of entry having some EA set in the cat_directory tree (recursive call) infinint get_tree_ea_num() const; /// get the number of entry that are hard linked inode (aka mirage in dar implementation) (recursive call) infinint get_tree_mirage_num() const; // for each mirage found (hard link implementation) in the cat_directory tree, add its etiquette to the returned // list with the number of reference that has been found in the tree. (map[etiquette] = number of occurence) // from outside of class cat_directory, the given argument is expected to be an empty map. void get_etiquettes_found_in_tree(std::map & already_found) const; /// whether this cat_directory is empty or not bool is_empty() const { return ordered_fils.empty(); }; /// recursively remove all mirage entries void remove_all_mirages_and_reduce_dirs(); /// set the value of inode_dumped for all mirage (recusively) void set_all_mirage_s_inode_dumped_field_to(bool val); cat_entree *clone() const { return new (get_pool()) cat_directory(*this); }; const infinint & get_size() const { recursive_update_sizes(); return x_size; }; const infinint & get_storage_size() const { recursive_update_sizes(); return x_storage_size; }; void recursively_set_to_unsaved_data_and_FSA(); /// overwrite virtual method of cat_entree to propagate the action to all entries of the directory tree void change_location(const pile_descriptor & pdesc); protected: void inherited_dump(const pile_descriptor & pdesc, bool small) const; private: static const cat_eod fin; infinint x_size; infinint x_storage_size; bool updated_sizes; cat_directory *parent; #ifdef LIBDAR_FAST_DIR std::map fils; // used for fast lookup #endif std::list ordered_fils; std::list::iterator it; //< next to entry to be returned by read_children bool recursive_has_changed; void clear(); void recursive_update_sizes() const; void recursive_flag_size_to_update() const; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/header_version.cpp0000644000175000017430000002512412641772777014767 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif } // end of extern "C" #include "header_version.hpp" #include "integers.hpp" #define LIBDAR_URL_VERSION "http://dar.linux.free.fr/pre-release/doc/Notes.html#Dar_version_naming" using namespace std; namespace libdar { static const U_I HEADER_CRC_SIZE = 2; //< CRC width (deprecated, now only used when reading old archives) header_version::header_version() { algo_zip = none; cmd_line = ""; initial_offset = 0; sym = crypto_none; crypted_key = nullptr; ref_layout = nullptr; ciphered = false; arch_signed = false; } void header_version::read(generic_file & f, user_interaction & dialog, bool lax_mode) { crc *ctrl = nullptr; char tmp; U_I flag; f.reset_crc(HEADER_CRC_SIZE); try { edition.read(f); } catch(Egeneric & e) { if(lax_mode) { string answ; U_I equivalent; bool ok = false; dialog.warning(gettext("LAX MODE: Failed to read the archive header's format version.")); do { answ = dialog.get_string(tools_printf(gettext("LAX MODE: Please provide the archive format: You can use the table at %s to find the archive format depending on the release version, (for example if this archive has been created using dar release 2.3.4 to 2.3.7 answer \"6\" without the quotes here): "), LIBDAR_URL_VERSION), true); if(tools_my_atoi(answ.c_str(), equivalent)) edition = equivalent; else { dialog.pause(tools_printf(gettext("LAX MODE: \"%S\" is not a valid archive format"), &answ)); continue; } try { dialog.pause(tools_printf(gettext("LAX MODE: Using archive format \"%d\"?"), equivalent)); ok = true; } catch(Euser_abort & e) { ok = false; } } while(!ok); } else throw; } if(f.read(&tmp, 1) == 1) // compression algo { bool ok = false; do { try { algo_zip = char2compression(tmp); ok = true; } catch(Erange & e) { if(!lax_mode) throw; string answ = dialog.get_string(gettext("LAX MODE: Unknown compression algorithm used, assuming data corruption occurred. Please help me, answering with one of the following words \"none\", \"gzip\", \"bzip2\" or \"lzo\" at the next prompt:"), true); if(answ == gettext("none")) tmp = compression2char(none); else if(answ == gettext("gzip")) tmp = compression2char(gzip); else if(answ == gettext("bzip2")) tmp = compression2char(bzip2); else if(answ == gettext("lzo")) tmp = compression2char(lzo); } } while(!ok); } else throw Erange("header_version::read", gettext("Reached End of File while reading archive header_version data structure")); tools_read_string(f, cmd_line); if(edition > 1) { unsigned char tomp; if(f.read((char *)&tomp, 1) != 1) throw Erange("header_version::read", gettext("Reached End of File while reading archive header_version data structure")); // even in lax mode, because reading further is vain flag = tomp; } else flag = 0; // flag has been at edition 2 if((flag & FLAG_HAS_AN_EXTENDED_SIZE) != 0) { unsigned char tomp; if(f.read((char *)&tomp, 1) != 1) throw Erange("header_version::read", gettext("Reached End of File while reading archive header_version data structure")); flag <<= 8; flag += tomp; } if((flag & FLAG_INITIAL_OFFSET) != 0) { initial_offset.read(f); } else initial_offset = 0; if((flag & FLAG_SCRAMBLED) != 0) { ciphered = true; if(edition >= 9) { if(f.read(&tmp, sizeof(tmp)) != 1) throw Erange("header_version::read", gettext("Reached End of File while reading archive header_version data structure")); try { sym = char_2_crypto_algo(tmp); } catch(Erange & e) { if(!lax_mode) throw; dialog.printf("Unknown crypto algorithm used in archive, ignoring that field and simply assuming the archive has been encrypted, if not done you will need to specify the crypto algorithm to use in order to read this archive"); sym = crypto_none; } } else // unknown ciphering algorithm used (old archive format) or no encryption // not coherent with flag which has the FLAG_SCRAMBLED bit set // but that this way we record that the crypto algo has // to be provided by the user sym = crypto_none; } else { ciphered = false; sym = crypto_none; // no crypto used, coherent with flag } has_tape_marks = (flag & FLAG_SEQUENCE_MARK) != 0; if(edition < 8 && has_tape_marks) { if(lax_mode) has_tape_marks = false; // Escape sequence marks appeared at revision 08 else throw Erange("header_version::read", gettext("Corruption met while reading header_version data structure")); } if(crypted_key != nullptr) { delete crypted_key; crypted_key = nullptr; } if((flag & FLAG_HAS_CRYPTED_KEY) != 0) { infinint key_size = f; crypted_key = new (get_pool()) memory_file(); if(crypted_key == nullptr) throw Ememory("header_version::read"); if(f.copy_to(*crypted_key, key_size) != key_size) throw Erange("header_version::read", gettext("Missing data for encrypted symmetrical key")); } if((flag & FLAG_HAS_REF_SLICING) != 0) { try { if(ref_layout == nullptr) ref_layout = new (get_pool()) slice_layout(); if(ref_layout == nullptr) throw Ememory("header_version::read"); ref_layout->read(f); } catch(Egeneric & e) { if(lax_mode) { dialog.warning(gettext("Error met while reading archive of reference slicing layout, ignoring this field and continuing")); clear_slice_layout(); } else throw; } } else clear_slice_layout(); arch_signed = (flag & FLAG_ARCHIVE_IS_SIGNED) != 0; ctrl = f.get_crc(); if(ctrl == nullptr) throw SRC_BUG; try { if(edition == empty_archive_version()) { if(lax_mode) dialog.warning(gettext("Consistency check failed for archive header")); else throw Erange("header_version::read", gettext("Consistency check failed for archive header")); } if(edition > 7) { crc *coh = create_crc_from_file(f, get_pool()); if(coh == nullptr) throw SRC_BUG; try { if(typeid(*coh) != typeid(*ctrl)) { if(coh->get_size() != ctrl->get_size()) throw SRC_BUG; else throw SRC_BUG; // both case lead to a bug, but we need to know which one is met } if(*coh != *ctrl) { if(lax_mode) dialog.warning(gettext("Consistency check failed for archive header")); else throw Erange("header_version::read", gettext("Consistency check failed for archive header")); } } catch(...) { if(coh != nullptr) delete coh; throw; } if(coh != nullptr) delete coh; } if(initial_offset.is_zero()) initial_offset = f.get_position(); } catch(...) { if(ctrl != nullptr) delete ctrl; throw; } if(ctrl != nullptr) delete ctrl; } void header_version::write(generic_file &f) const { crc *ctrl = nullptr; char tmp; unsigned char flag[2]; // preparing the data flag[0] = 0; flag[1] = 0; if(!initial_offset.is_zero()) flag[0] |= FLAG_INITIAL_OFFSET; // adding it to the flag if(crypted_key != nullptr) flag[0] |= FLAG_HAS_CRYPTED_KEY; if(ref_layout != nullptr) flag[0] |= FLAG_HAS_REF_SLICING; if(has_tape_marks) flag[0] |= FLAG_SEQUENCE_MARK; if(sym != crypto_none) flag[0] |= FLAG_SCRAMBLED; // Note: we cannot set this flag (even if ciphered is true) if we do not know the crypto algo // as since version 9 the presence of this flag implies the existence // of the crypto algorithm in the header/trailer and we will always // write down a header/version of the latest known format (thus greater or // equal to 9). if(arch_signed) flag[1] |= (FLAG_ARCHIVE_IS_SIGNED >> 8); if(flag[1] > 0) flag[1] |= FLAG_HAS_AN_EXTENDED_SIZE; // and we will drop two bytes for the flag // writing down the data f.reset_crc(HEADER_CRC_SIZE); edition.dump(f); tmp = compression2char(algo_zip); f.write(&tmp, sizeof(tmp)); tools_write_string(f, cmd_line); if(flag[1] != 0) f.write((char *)&(flag[1]), sizeof(unsigned char)); f.write((char *)&(flag[0]), sizeof(unsigned char)); if(initial_offset != 0) initial_offset.dump(f); if(sym != crypto_none) { tmp = crypto_algo_2_char(sym); f.write(&tmp, sizeof(tmp)); } if(crypted_key != nullptr) { crypted_key->size().dump(f); crypted_key->skip(0); crypted_key->copy_to(f); } if(ref_layout != nullptr) ref_layout->write(f); ctrl = f.get_crc(); if(ctrl == nullptr) throw SRC_BUG; try { ctrl->dump(f); } catch(...) { if(ctrl != nullptr) delete ctrl; throw; } if(ctrl != nullptr) delete ctrl; } void header_version::detruit() { clear_crypted_key(); clear_slice_layout(); } void header_version::copy_from(const header_version & ref) { edition = ref.edition; algo_zip = ref.algo_zip; cmd_line = ref.cmd_line; initial_offset = ref.initial_offset; sym = ref.sym; if(ref.crypted_key != nullptr) { crypted_key = new (get_pool()) memory_file(*ref.crypted_key); if(crypted_key == nullptr) throw Ememory("header_version::copy_from"); } else crypted_key = nullptr; if(ref.ref_layout != nullptr) { ref_layout = new (get_pool()) slice_layout(*ref.ref_layout); if(ref_layout == nullptr) throw Ememory("header_version::copy_from"); } else ref_layout = nullptr; has_tape_marks = ref.has_tape_marks; ciphered = ref.ciphered; arch_signed = ref.arch_signed; } } // end of namespace dar-2.5.3/src/libdar/tronconneuse.cpp0000644000175000017430000004111312641773016014473 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } #include "tronconneuse.hpp" #include "tools.hpp" #include "memory_file.hpp" using namespace std; namespace libdar { tronconneuse::tronconneuse(U_32 block_size, generic_file & encrypted_side, bool no_initial_shift, const archive_version & x_reading_ver) : generic_file(encrypted_side.get_mode() == gf_read_only ? gf_read_only : gf_write_only) { if(block_size == 0) throw Erange("tronconneuse::tronconneuse", tools_printf(gettext("%d is not a valid block size"), block_size)); buf_offset = 0; buf_byte_data = 0; buf_size = 0; buf = nullptr; // cannot invoke pure virtual methods from constructor clear_block_size = block_size; current_position = 0; if(no_initial_shift) initial_shift = 0; else initial_shift = encrypted_side.get_position(); block_num = 0; encrypted = & encrypted_side; encrypted_buf = nullptr; // cannot invoke pure virtual methods from constructor encrypted_buf_data = 0; encrypted_buf_size = 0; extra_buf_size = 0; extra_buf_data = 0; extra_buf = nullptr; weof = false; reof = false; reading_ver = x_reading_ver; trailing_clear_data = nullptr; // buffers cannot be initialized here as they need result from pure virtual methods // the inherited class constructor part has not yet been initialized // for this reason C++ forbids us to call virtual methods (they may rely on data that // has not been initialized. } const tronconneuse & tronconneuse::operator = (const tronconneuse & ref) { generic_file *moi = this; const generic_file *toi = &ref; if(is_terminated()) throw SRC_BUG; detruit(); *moi = *toi; copy_from(ref); return *this; } bool tronconneuse::skippable(skippability direction, const infinint & amount) { if(is_terminated()) throw SRC_BUG; if(encrypted->get_mode() != gf_read_only) return false; else { if(current_position < buf_offset || buf_offset + infinint(buf_byte_data) <= current_position) return encrypted->skippable(direction, amount); else return true; } } bool tronconneuse::skip(const infinint & pos) { bool ret = true; if(is_terminated()) throw SRC_BUG; if(encrypted->get_mode() != gf_read_only) throw SRC_BUG; if(current_position != pos) { if(pos < buf_offset) reof = false; current_position = pos; ret = check_current_position(); if(!ret) skip_to_eof(); } else ret = true; return ret; } bool tronconneuse::skip_to_eof() { bool ret; if(is_terminated()) throw SRC_BUG; if(encrypted->get_mode() != gf_read_only) throw SRC_BUG; ret = encrypted->skip_to_eof(); if(ret) { infinint residu; init_buf(); // to be sure encrypted_buf_size is defined if(encrypted->get_position() < initial_shift) throw SRC_BUG; // eof is before the first encrypted byte euclide(encrypted->get_position() - initial_shift, encrypted_buf_size, block_num, residu); current_position = block_num * infinint(clear_block_size); reof = false; // must be set to true to have fill_buf filling the clear buffer (void)fill_buf(); reof = true; // now fill_buf has completed we can set it to the expected value current_position = buf_offset + infinint(buf_byte_data); // we are now at the eof ret = encrypted->skip_to_eof(); } return ret; } bool tronconneuse::skip_relative(S_I x) { bool ret; if(is_terminated()) throw SRC_BUG; if(encrypted->get_mode() != gf_read_only) throw SRC_BUG; if(x >= 0) ret = skip(current_position + x); else { x = -x; if(current_position >= x) ret = skip(current_position - infinint(x)); else { skip(0); ret = false; } } return ret; } void tronconneuse::inherited_read_ahead(const infinint & amount) { infinint new_amount = 0; U_32 interim = 0; infinint x_amount = amount; if(current_position > buf_offset) { // byte offset in the buffer where will take place the next read operation new_amount = current_position - buf_offset; if(new_amount < buf_byte_data) // some data remain to be read in buffer { // temporarily using new_amount // to store the amount of readable data in the buffer new_amount = infinint(buf_byte_data) - new_amount; if(x_amount <= new_amount) return; // nothing to do, the read_ahead is entirely contained in the buffer else x_amount -= new_amount; } new_amount = 0; } // else current position is before the buffer, ignoring data actually in the buffer while(!x_amount.is_zero()) { interim = 0; x_amount.unstack(interim); new_amount += encrypted_block_size_for(interim); } encrypted->read_ahead(new_amount); } U_I tronconneuse::inherited_read(char *a, U_I size) { U_I lu = 0; bool eof = false; U_32 pos_in_buf; while(lu < size && ! eof) { pos_in_buf = fill_buf(); if(pos_in_buf >= buf_byte_data) eof = true; else // some data can be read { while(pos_in_buf < buf_byte_data && lu < size) a[lu++] = buf[pos_in_buf++]; current_position = buf_offset + infinint(pos_in_buf); } } return lu; } void tronconneuse::inherited_write(const char *a, U_I size) { U_I lu = 0; bool thread_stop = false; Ethread_cancel caught = Ethread_cancel(false, 0); if(weof) throw SRC_BUG; // write_end_of_file has been called no further write is allowed init_buf(); while(lu < size) { U_I place = clear_block_size - buf_byte_data; // how much we are able to store before completing the current block U_I avail = size - lu; // how much data is available U_I min = avail > place ? place : avail; // the minimum(place, avail) (void)memcpy(buf + buf_byte_data, a + lu, min); buf_byte_data += min; lu += min; if(buf_byte_data >= clear_block_size) // we have a complete buffer to encrypt { try { flush(); } catch(Ethread_cancel & e) { thread_stop = true; caught = e; } block_num++; } } current_position += infinint(size); if(thread_stop) throw caught; } void tronconneuse::detruit() { if(buf != nullptr) { meta_delete(buf); buf = nullptr; } if(encrypted_buf != nullptr) { meta_delete(encrypted_buf); encrypted_buf = nullptr; } if(extra_buf != nullptr) { meta_delete(extra_buf); extra_buf = nullptr; } buf_size = 0; buf_byte_data = 0; encrypted_buf_size = 0; encrypted_buf_data = 0; extra_buf_size = 0; extra_buf_data = 0; } void tronconneuse::copy_from(const tronconneuse & ref) { buf = nullptr; encrypted_buf = nullptr; if(is_terminated()) throw SRC_BUG; try { initial_shift = ref.initial_shift; buf_offset = ref.buf_offset; buf_byte_data = ref.buf_byte_data; buf_size = ref.buf_size; meta_new(buf, buf_size); if(buf == nullptr) throw Ememory("tronconneuse::copy_from"); (void)memcpy(buf, ref.buf, buf_byte_data); clear_block_size = ref.clear_block_size; current_position = ref.current_position; block_num = ref.block_num; encrypted = ref.encrypted; // objets share the same generic_file reference encrypted_buf_size = ref.encrypted_buf_size; encrypted_buf_data = ref.encrypted_buf_data; meta_new(encrypted_buf, encrypted_buf_size); if(encrypted_buf == nullptr) throw Ememory("tronconneuse::copy_from"); (void)memcpy(encrypted_buf, ref.encrypted_buf, encrypted_buf_data); extra_buf_size = ref.extra_buf_size; extra_buf_data = ref.extra_buf_data; meta_new(extra_buf, extra_buf_size); if(extra_buf == nullptr) throw Ememory("tronconneuse::copy_from"); (void)memcpy(extra_buf, ref.extra_buf, extra_buf_data); weof = ref.weof; reof = ref.reof; reading_ver = ref.reading_ver; trailing_clear_data = ref.trailing_clear_data; } catch(...) { detruit(); throw; } } U_32 tronconneuse::fill_buf() { U_32 ret; infinint crypt_offset; infinint tmp_ret; if(current_position < buf_offset || ((buf_offset + infinint(buf_byte_data)) <= current_position && !reof)) // requested data not in current clear buffer { position_clear2crypt(current_position, crypt_offset, buf_offset, tmp_ret, block_num); if(!reof) { // if extra_buf contains the encrypted byte we need we move them to encrypted_buf if(crypt_offset >= extra_buf_offset && crypt_offset < extra_buf_offset + extra_buf_data) { memcpy(encrypted_buf, extra_buf, extra_buf_data); encrypted_buf_data = extra_buf_data; extra_buf_data = 0; } else // else we empty encrypted_buf and extra_buf { extra_buf_data = 0; encrypted_buf_data = 0; } // we skip at the beginning of the crypted block plus the already read bytes from extra_buf if(!encrypted->skip(crypt_offset + initial_shift + encrypted_buf_data)) buf_byte_data = 0; // we can now read the remaining data to complete the crypto block encrypted_buf_data += encrypted->read(encrypted_buf, encrypted_buf_size - encrypted_buf_data); if(encrypted_buf_data < encrypted_buf_size) { reof = true; remove_trailing_clear_data_from_encrypted_buf(crypt_offset); } try { buf_byte_data = decrypt_data(block_num, encrypted_buf, encrypted_buf_data, buf, clear_block_size); } catch(Erange & e) { if(!reof) { try { remove_trailing_clear_data_from_encrypted_buf(crypt_offset); // retrying but without trailing cleared data buf_byte_data = decrypt_data(block_num, encrypted_buf, encrypted_buf_data, buf, clear_block_size); } catch(Egeneric & f) { throw e; } } else // already tried to remove clear data at end of encrypted buffer throw; } if(buf_byte_data > buf_size) { buf_byte_data = clear_block_size; throw Erange("tronconneuse::fill_buff", gettext("Data corruption may have occurred, cannot decrypt data")); } } else buf_byte_data = 0; // no data could be read as the requested position could not be reached } else tmp_ret = current_position - buf_offset; ret = 0; tmp_ret.unstack(ret); if(!tmp_ret.is_zero()) throw SRC_BUG; // result is modulo clear_block_size which is U_32, thus it should fit in U_32 (=ret) return ret; } void tronconneuse::flush() { if(encrypted->get_mode() != gf_write_only) return; if(weof) return; if(buf_byte_data > 0) { init_buf(); encrypted_buf_data = encrypt_data(block_num, buf, buf_byte_data, buf_size, encrypted_buf, encrypted_buf_size); try { encrypted->write(encrypted_buf, encrypted_buf_data); buf_byte_data = 0; buf_offset += infinint(clear_block_size); } catch(Ethread_cancel & e) { // at this step, the pending encrypted data could not be wrote to disk // (Ethread_cancel exception has been thrown before). // But we have returned to the upper layer the position of the corresponding clear // data which may have already been recorded // in the catalogue above, thus we cannot just drop this pending encrypted data // as it would make reference to inexistant data in the catalogue. // By chance the thread_cancellation mechanism in clean termination is now carried // by the exception we just caugth here so we may retry to write the encrypted data // no new Ethread_cancel exception will be thrown this time. encrypted->write(encrypted_buf, encrypted_buf_data); buf_byte_data = 0; buf_offset += infinint(clear_block_size); // Now that we have cleanly completed the action at this level, // we can propagate the exception toward the caller throw; } } } void tronconneuse::init_buf() { if(encrypted_buf == nullptr) { encrypted_buf_data = 0; encrypted_buf_size = encrypted_block_size_for(clear_block_size); meta_new(encrypted_buf, encrypted_buf_size); if(encrypted_buf == nullptr) { encrypted_buf_size = 0; throw Ememory("tronconneuse::init_encrypte_buf_size"); } } if(buf == nullptr) { buf_byte_data = 0; buf_size = clear_block_allocated_size_for(clear_block_size); if(buf_size < clear_block_size) throw SRC_BUG; // buf_size must be larger than or equal to clear_block_size meta_new(buf, buf_size); if(buf == nullptr) { buf_size = 0; throw Ememory("tronconneuse::init_encrypte_buf_size"); } } if(extra_buf == nullptr) { extra_buf_data = 0; extra_buf_size = encrypted_buf_size; // using same size as encrypted_buf meta_new(extra_buf, extra_buf_size); if(extra_buf == nullptr) { extra_buf_size = 0; throw Ememory("tronconneuse::init_encrypte_buf_size"); } } } void tronconneuse::position_clear2crypt(const infinint & pos, infinint & file_buf_start, infinint & clear_buf_start, infinint & pos_in_buf, infinint & block_num) { euclide(pos, clear_block_size, block_num, pos_in_buf); init_buf(); // needs to be placed before the following line as encrypted_buf_size is defined by this call file_buf_start = block_num * infinint(encrypted_buf_size); clear_buf_start = block_num * infinint(clear_block_size); } void tronconneuse::position_crypt2clear(const infinint & pos, infinint & clear_pos) { infinint block, residu; init_buf(); // needs to be placed before the following line as encrypted_buf_size is defined by this call euclide(pos, encrypted_buf_size, block, residu); clear_pos = block * infinint(clear_block_size) + residu; } void tronconneuse::remove_trailing_clear_data_from_encrypted_buf(const infinint & crypt_offset) { if(encrypted == nullptr) throw SRC_BUG; if(trailing_clear_data != nullptr) { infinint clear_offset = 0; bool notfound = false; if(extra_buf_data > 0) throw SRC_BUG; if(!reof) { extra_buf_offset = encrypted->get_position(); extra_buf_data = encrypted->read(extra_buf, extra_buf_size); } try { memory_file tmp; tmp.write(encrypted_buf, encrypted_buf_data); if(extra_buf_data > 0) tmp.write(extra_buf, extra_buf_data); clear_offset = (*trailing_clear_data)(tmp, reading_ver); // this is the offset that is written in the archive // it is thus not relative to tmp but to the real // sub layer including the initial_shift bytes if(clear_offset >= initial_shift) clear_offset -= initial_shift; // now clear_offset can be compared to crypt_offset else notfound = true; } catch(Egeneric & e) { if(reof) { encrypted_buf_data = 0; extra_buf_data = 0; } notfound = true; } catch(...) { throw SRC_BUG; } if(notfound) return; if(crypt_offset >= clear_offset) // all data in encrypted_buf is clear data { encrypted_buf_data = 0; extra_buf_data = 0; reof = true; } else { U_I nouv_buf_data = 0; clear_offset -= crypt_offset; clear_offset.unstack(nouv_buf_data); if(!clear_offset.is_zero()) throw SRC_BUG; // cannot handle that integer as U_32 while this number should be less than encrypted_buf_size which is a U_32 if(nouv_buf_data <= encrypted_buf_data) { encrypted_buf_data = nouv_buf_data; extra_buf_data = 0; reof = true; } else throw SRC_BUG; // more encrypted data than could be read so far! } } // else, nothing can be done } } // end of namespace dar-2.5.3/src/libdar/cat_etoile.hpp0000644000175000017430000000725112641772777014110 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_etoile.hpp /// \brief class holding an cat_inode object that get pointed by multiple mirage objects (smart pointers) to record hard links in a catalogue /// \ingroup Private #ifndef CAT_ETOILE_HPP #define CAT_ETOILE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include #include "on_pool.hpp" #include "cat_inode.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the hard link implementation (etoile means star in French, seen a star as a point from which are thrown many ray of light) class cat_etoile : public on_pool { public: /// build an object ///\param[in] host is an inode, it must not be a directory (this would throw an Erange exception) ///\param[in] etiquette_number is the identifier of this multiply linked structure ///\note the given cat_inode is now managed by the cat_etoile object cat_etoile(cat_inode *host, const infinint & etiquette_number); cat_etoile(const cat_etoile & ref) { throw SRC_BUG; }; // copy constructor not allowed for this class const cat_etoile & operator = (const cat_etoile & ref) { throw SRC_BUG; }; // assignment not allowed for this class ~cat_etoile() { delete hosted; }; void add_ref(void *ref); void drop_ref(void *ref); infinint get_ref_count() const { return refs.size(); }; cat_inode *get_inode() const { return hosted; }; infinint get_etiquette() const { return etiquette; }; void change_etiquette(const infinint & new_val) { etiquette = new_val; }; bool is_counted() const { return tags.counted; }; bool is_wrote() const { return tags.wrote; }; bool is_dumped() const { return tags.dumped; }; void set_counted(bool val) { tags.counted = val ? 1 : 0; }; void set_wrote(bool val) { tags.wrote = val ? 1 : 0; }; void set_dumped(bool val) { tags.dumped = val ? 1 : 0; }; // return the address of the first mirage that triggered the creation of this mirage // if this object is destroyed afterward this call returns nullptr const void *get_first_ref() const { if(refs.size() == 0) throw SRC_BUG; return refs.front(); }; private: struct bool_tags { unsigned counted : 1; //< whether the inode has been counted unsigned wrote : 1; //< whether the inode has its data copied to archive unsigned dumped : 1; //< whether the inode information has been dumped in the catalogue unsigned : 5; //< padding to get byte boundary and reserved for future use. bool_tags() { counted = wrote = dumped = 0; }; }; std::list refs; //< list of pointers to the mirages objects, in the order of their creation cat_inode *hosted; infinint etiquette; bool_tags tags; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/data_tree.hpp0000644000175000017430000002347212641772777013733 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file data_tree.hpp /// \brief two classes used to store tree information in dar_manager databases /// \ingroup Private #ifndef DATA_TREE_HPP #define DATA_TREE_HPP #include "../my_config.h" #include #include #include #include "infinint.hpp" #include "generic_file.hpp" #include "infinint.hpp" #include "user_interaction.hpp" #include "path.hpp" #include "on_pool.hpp" #include "cat_directory.hpp" #include "cat_inode.hpp" #include "cat_detruit.hpp" namespace libdar { /// \ingroup Private /// @} typedef U_16 archive_num; #define ARCHIVE_NUM_MAX 65534 /// the data_tree class stores presence of a given file in a set of archives /// the data associated to a given file are the different modification dates /// that this file has been found in the archive the database has been feed by /// \ingroup Private class data_tree : public on_pool { public: enum lookup { found_present, found_removed, not_found, not_restorable }; enum etat { et_saved, //< data/EA present in the archive et_present, //< file/EA present in the archive but data not saved (differential backup) et_removed, //< file/EA stored as deleted since archive of reference of file/EA not present in the archive et_absent //< file not even mentionned in the archive, This entry is equivalent to et_removed, but is required to be able to properly re-order the archive when user asks to do so. The dates associated to this state are computed from neighbor archives in the database }; data_tree(const std::string &name); data_tree(generic_file &f, unsigned char db_version); virtual ~data_tree() {}; virtual void dump(generic_file & f) const; std::string get_name() const { return filename; }; void set_name(const std::string & name) { filename = name; }; /// return the archive where to find the data that was defined just before or at the given date lookup get_data(archive_num & archive, const datetime & date, bool even_when_removed) const; /// if EA has been saved alone later, returns in which version for the state of the file at the given date. lookup get_EA(archive_num & archive, const datetime & date, bool even_when_removed) const; /// return the date of file's last modification date within the give archive and whether the file has been saved or deleted bool read_data(archive_num num, datetime & val, etat & present) const; /// return the date of last inode change and whether the EA has been saved or deleted bool read_EA(archive_num num, datetime & val, etat & present) const; void set_data(const archive_num & archive, const datetime & date, etat present) { status sta = { date, present }; last_mod[archive] = sta; }; void set_EA(const archive_num & archive, const datetime & date, etat present) { status sta = { date, present }; last_change[archive] = sta; }; /// check date order between archives withing the database ; throw Erange if problem found with date order virtual bool check_order(user_interaction & dialog, const path & current_path, bool & initial_warn) const { return check_map_order(dialog, last_mod, current_path, "data", initial_warn) && check_map_order(dialog, last_change, current_path, "EA", initial_warn); }; /// add deleted entry if no object of the current archive exist and the entry of the previous archive is already present. /// \param[in] archive is the number of the archive to finalize /// \param[in] deleted_date date of deletion to use for inode removal when no /// information can be grabbed from the archive (this date is taken from the /// parent dir last modification date) /// \param[in] ignore_archive_greater_or_equal ignore archives which number /// is greater or equal than "ignore_archive_greater_or_equal" as if they were not /// present in the database. If set to zero, no archive is ignored. virtual void finalize(const archive_num & archive, const datetime & deleted_date, const archive_num & ignore_archive_greater_or_equal); /// return true if the corresponding file is no more located in any archive (thus, the object is no more usefull in the base) virtual bool remove_all_from(const archive_num & archive_to_remove, const archive_num & last_archive); /// list where is saved this file void listing(user_interaction & dialog) const; virtual void apply_permutation(archive_num src, archive_num dst); /// decrement archive numbers above num virtual void skip_out(archive_num num); virtual void compute_most_recent_stats(std::vector & data, std::vector & ea, std::vector & total_data, std::vector & total_ea) const; virtual char obj_signature() const { return signature(); }; static char signature() { return 't'; }; // fix corruption case that was brought by bug in release 2.4.0 to 2.4.9 virtual bool fix_corruption(); // return true whether corruption could be fixed (meaning this entry can be safely removed from base) private: struct status { datetime date; //< date of the event etat present; //< file's status in the archive void dump(generic_file & f) const; //< write the struct to file void read(generic_file &f, //< set the struct from file unsigned char db_version); }; std::string filename; std::map last_mod; //< key is archive number ; value is last_mod time std::map last_change; //< key is archive number ; value is last_change time // when false is returned, this means that the user wants to ignore subsequent error of the same type // else either no error yet met or user want to continue receiving the same type of error for other files // in that later case initial_warn is set to false (first warning has been shown). bool check_map_order(user_interaction & dialog, const std::map the_map, const path & current_path, const std::string & field_nature, bool & initial_warn) const; }; /// the data_dir class inherits from data_tree and holds the directory tree's parent relationship /// \ingroup Private class data_dir : public data_tree { public: data_dir(const std::string &name); data_dir(generic_file &f, unsigned char db_version); data_dir(const data_dir & ref); data_dir(const data_tree & ref); ~data_dir(); void dump(generic_file & f) const; void add(const cat_inode *entry, const archive_num & archive); void add(const cat_detruit *entry, const archive_num & archive); const data_tree *read_child(const std::string & name) const; void read_all_children(std::vector & fils) const; virtual void finalize_except_self(const archive_num & archive, const datetime & deleted_date, const archive_num & ignore_archives_greater_or_equal); // inherited methods bool check_order(user_interaction & dialog, const path & current_path, bool & initial_warn) const; void finalize(const archive_num & archive, const datetime & deleted_date, const archive_num & ignore_archives_greater_or_equal); bool remove_all_from(const archive_num & archive_to_remove, const archive_num & last_archive); /// list the most recent files owned by that archive (or by any archive if num == 0) void show(user_interaction & dialog, archive_num num, std::string marge = "") const; void apply_permutation(archive_num src, archive_num dst); void skip_out(archive_num num); void compute_most_recent_stats(std::vector & data, std::vector & ea, std::vector & total_data, std::vector & total_ea) const; char obj_signature() const { return signature(); }; static char signature() { return 'd'; }; virtual bool fix_corruption(); // inherited from data_tree private: std::list rejetons; //< subdir and subfiles of the current dir void add_child(data_tree *fils); //< "this" is now responsible of "fils" disalocation void remove_child(const std::string & name); data_tree *find_or_addition(const std::string & name, bool is_dir, const archive_num & archive); }; extern data_dir *data_tree_read(generic_file & f, unsigned char db_version, memory_pool *pool); /// lookup routine to find a pointer to the dat_dir object corresponding to the given path /// \param[in] chemin is the path to look for /// \param[in] racine is the database to look into /// \param[out] ptr is a pointer to the looked node if found /// \return true if a node could be found in the database extern bool data_tree_find(path chemin, const data_dir & racine, const data_tree *& ptr); extern void data_tree_update_with(const cat_directory *dir, archive_num archive, data_dir *racine); extern archive_num data_tree_permutation(archive_num src, archive_num dst, archive_num x); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/crypto.cpp0000644000175000017430000000541312641772777013311 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } #include "crypto.hpp" #include "erreurs.hpp" using namespace std; namespace libdar { string crypto_algo_2_string(crypto_algo algo) { switch(algo) { case crypto_none: return gettext("none"); case crypto_scrambling: return gettext("scrambling (weak encryption)"); case crypto_blowfish: return "blowfish"; case crypto_aes256: return "AES 256"; case crypto_twofish256: return "twofish 256"; case crypto_serpent256: return "serpent 256"; case crypto_camellia256: return "camellia 256"; default: throw SRC_BUG; } } char crypto_algo_2_char(crypto_algo a) { switch(a) { case crypto_none: return 'n'; case crypto_scrambling: return 's'; case crypto_blowfish: return 'b'; case crypto_aes256: return 'a'; case crypto_twofish256: return 't'; case crypto_serpent256: return 'p'; case crypto_camellia256: return 'c'; default: throw SRC_BUG; } } crypto_algo char_2_crypto_algo(char a) { switch(a) { case 'n': return crypto_none; case 's': return crypto_scrambling; case 'b': return crypto_blowfish; case 'a': return crypto_aes256; case 't': return crypto_twofish256; case 'p': return crypto_serpent256; case 'c': return crypto_camellia256; default: throw Erange("char_to_sym_crypto", gettext("Unknown crypto algorithm")); } } bool same_signatories(const std::list & a, const std::list & b) { list::const_iterator ita = a.begin(); list::const_iterator itb = b.begin(); while(ita != a.end() && itb != b.end() && *ita == *itb) { ++ita; ++itb; } return (ita == a.end() && itb == b.end()); } } // end of namespace dar-2.5.3/src/libdar/cat_door.cpp0000644000175000017430000000331612642474445013553 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_door.hpp" #include "null_file.hpp" using namespace std; namespace libdar { bool cat_door::operator == (const cat_entree & ref) const { const cat_door *ref_door = dynamic_cast(&ref); if(ref_door == nullptr) return false; else return cat_file::operator == (ref); } generic_file *cat_door::get_data(get_data_mode mode) const { generic_file *ret = nullptr; if(status == from_path) { ret = new (get_pool()) null_file(gf_read_only); if(ret == nullptr) throw Ememory("cat_door::get_data"); } else ret = cat_file::get_data(mode); return ret; } } // end of namespace dar-2.5.3/src/libdar/terminateur.hpp0000644000175000017520000000422112610405012014274 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file terminateur.hpp /// \brief the terminateur class which defines the position of the catalogue /// \ingroup Private /// /// the terminateur is a byte sequence present as the last bytes of an archive /// which indicates how much byte backward libdar must skip back to find the /// beginning of the catalogue. #ifndef TERMINATEUR_HPP #define TERMINATEUR_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "header_version.hpp" namespace libdar { /// terminateur class indicates the location of the beginning of the catalogue /// it is the last bytes sequence of an archive. /// \ingroup Private class terminateur { public : void set_catalogue_start(infinint xpos) { pos = xpos; }; void dump(generic_file &f); void read_catalogue(generic_file &f, bool with_elastic, const archive_version & reading_ver, const infinint & where_from = 0); infinint get_catalogue_start() const { return pos; }; infinint get_terminateur_start() const { return t_start; }; private : infinint pos; infinint t_start; }; } // end of namespace #endif dar-2.5.3/src/libdar/erreurs.cpp0000644000175000017430000001431412641772777013460 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDLIB_H #include #endif #if HAVE_EXECINFO_H #include #endif } // end extern "C" #include #include "erreurs.hpp" #include "infinint.hpp" #include "deci.hpp" #include "tools.hpp" #include "nls_swap.hpp" using namespace std; namespace libdar { static bool initialized = false; // does not avoid thread safe library. // if two thread act at the same time on this // value, this would have the same result // as if only one had acted on it. // subsequent action are read-only (once initialized is true). static void init(); static void inattendue(); static void notcatched(); const char *dar_gettext(const char *arg) { const char *ret = nullptr; NLS_SWAP_IN; try { ret = gettext(arg); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } const std::string Egeneric::empty_string = ""; Egeneric::Egeneric(const string &source, const string &message) { if(!initialized) init(); pile.push_front(niveau(source, message)); } const string & Egeneric::find_object(const string & location) const { list::const_iterator it = pile.begin(); while(it != pile.end() && it->lieu != location) it++; if(it == pile.end()) return empty_string; else return it->objet; } void Egeneric::prepend_message(const std::string & context) { if(pile.empty()) throw SRC_BUG; pile.front().objet = context + pile.front().objet; } void Egeneric::dump() const { cerr << dump_str(); } string Egeneric::dump_str() const { string ret; list & tmp = const_cast< list & >(pile); list::iterator it; it = tmp.begin(); ret += "---- exception type = [" + exceptionID() + "] ----------\n"; ret += "[source]\n"; while(it != tmp.end()) { ret += "\t" + it->lieu + " : " + it->objet + "\n"; it++; } ret += "[most outside call]\n"; ret += "-----------------------------------\n\n"; return ret; } Ebug::Ebug(const string & file, S_I line) : Egeneric(tools_printf(gettext("File %S line %d"), &file, line), gettext("it seems to be a bug here")) { // adding the current stack if possible #if BACKTRACE_AVAILABLE const int buf_size = 20; void *buffer[buf_size]; int size = backtrace(buffer, buf_size); char **symbols = backtrace_symbols(buffer, size); try { for(int i = 0; i < size; ++i) Egeneric::stack("stack dump", string(symbols[i])); } catch(...) { if(symbols != nullptr) free(symbols); throw; } if(symbols != nullptr) free(symbols); #else Egeneric::stack("stack dump", "backtrace() call absent, cannot dump the stack information at the time the exception was thrown"); #endif } void Ebug::stack(const string & passage, const string & file, const string & line) { Egeneric::stack(passage, tools_printf(gettext("in file %S line %S"), &file, &line)); } Esystem::Esystem(const string & source, const string & message, io_error code): Egeneric(source, message) { x_code = code; } static void init() { set_unexpected(inattendue); set_terminate(notcatched); initialized = true; } static void inattendue() { cerr << "###############################################" << endl; cerr << gettext("# UNEXPECTED EXCEPTION, #") << endl; cerr << gettext("# E X I T I N G ! #") << endl; cerr << "# #" << endl; cerr << "###############################################" << endl; cerr << tools_printf(gettext(" THANKS TO REPORT THE PREVIOUS OUTPUT TO MAINTAINER\n GIVING A DESCRIPTION OF THE CIRCUMSTANCES.")) << endl; cerr << tools_printf(gettext(" IF POSSIBLE TRY TO REPRODUCE THIS ERROR, A\n SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n IN SOLVING THIS PROBLEM. THANKS")) << endl; exit(3); // this was exit code for bugs at the time this code was part of dar // now it is part of libdar, while exit code stay defined in typical command line code (dar_suite software) } static void notcatched() { cerr << "###############################################" << endl; cerr << gettext("# NOT CAUGHT EXCEPTION, #") << endl; cerr << gettext("# E X I T I N G ! #") << endl; cerr << "# #" << endl; cerr << "###############################################" << endl; cerr << tools_printf(gettext(" THANKS TO REPORT THE PREVIOUS OUTPUT TO MAINTAINER\n GIVING A DESCRIPTION OF THE CIRCUMSTANCES.")) << endl; cerr << tools_printf(gettext(" IF POSSIBLE TRY TO PRODUCE THIS ERROR, A\n SCENARIO THAT CAN REPRODUCE IT WOULD HELP MUCH\n IN SOLVING THIS PROBLEM. THANKS")) < #include #include "../my_config.h" #include "infinint.hpp" #include "deci.hpp" #include "catalogue.hpp" #include "tools.hpp" #include "compressor.hpp" #include "integers.hpp" #include "on_pool.hpp" #include "datetime.hpp" #include "range.hpp" namespace libdar { /// the list_entry class provides mean to get information about a particular entry in the archive /// /// it provides methods for libdar to fill up such object and methods for API user /// to read the information. Each information uses its own method, thus it will require /// several call to different method to get the full description of the object. /// This has the advantage to let the possiblity to add new fields in the future /// without breaking anything in API, and in consequences in user programs. /// \ingroup API class list_entry : public on_pool { public: list_entry(); // methods for API users // field that are not set are returned as empty string const std::string & get_name() const { return my_name; }; unsigned char get_type() const { return type; }; bool is_dir() const { return type == 'd'; }; bool is_file() const { return type == 'f'; }; bool is_symlink() const { return type == 'l'; }; bool is_char_device() const { return type == 'c'; }; bool is_block_device() const { return type == 'b'; }; bool is_unix_socket() const { return type == 's'; }; bool is_named_pipe() const { return type == 'p'; }; bool is_hard_linked() const { return hard_link; }; bool is_removed_entry() const { return type == 'x'; }; bool is_door_inode() const { return type == 'o'; }; bool has_data_present_in_the_archive() const { return data_status == s_saved; }; bool has_EA() const { return ea_status != cat_inode::ea_none && ea_status != cat_inode::ea_removed; }; bool has_EA_saved_in_the_archive() const { return ea_status == cat_inode::ea_full; }; bool has_FSA() const { return fsa_status != cat_inode::fsa_none; }; bool has_FSA_saved_in_the_archive() const { return fsa_status == cat_inode::fsa_full; }; std::string get_uid() const { return deci(uid).human(); }; std::string get_gid() const { return deci(gid).human(); }; std::string get_perm() const { return tools_get_permission_string(type, perm, hard_link); }; std::string get_last_access() const { return last_access.is_null() ? "" : tools_display_date(last_access); }; std::string get_last_modif() const { return last_modif.is_null() ? "" : tools_display_date(last_modif); }; std::string get_last_change() const { return last_change.is_null() ? "" : tools_display_date(last_change); }; time_t get_last_access_s() const { return datetime2time_t(last_access); }; time_t get_last_modif_s() const { return datetime2time_t(last_modif); }; time_t get_last_change_s() const { return datetime2time_t(last_change); }; /// yet an alternative method to get last access time /// /// \param[in] tu time unit to be used to store fraction (libdar::datetime::tu_microsecond, libdar::datetime::tu_nanosecond,...) /// \param[out] second integer number of second /// \param[out] fraction remaining part of the time (expressed as tu unit) to be added to "second" to get the exact time void get_last_access(datetime::time_unit tu, time_t & second, time_t & fraction) const { last_access.get_value(second, fraction, tu); } /// yet an alternative method to get the last modification date (see get_last_access() for details) void get_last_modif(datetime::time_unit tu, time_t & second, time_t & fraction) const { last_modif.get_value(second, fraction, tu); } /// yet an alternative method to get the last change date (see get_last_access() for details) void get_last_change(datetime::time_unit tu, time_t & second, time_t & fraction) const { last_change.get_value(second, fraction, tu); } std::string get_file_size() const { return deci(file_size).human(); }; std::string get_compression_ratio() const { return tools_get_compression_ratio(storage_size, file_size, compression_algo != none); }; bool is_sparse() const { return sparse_file; }; std::string get_compression_algo() const { return compression2string(compression_algo); }; bool is_dirty() const { return dirty; }; std::string get_link_target() const { return target; }; std::string get_major() const { return tools_int2str(major); }; std::string get_minor() const { return tools_int2str(minor); }; const range & get_slices() const { return slices; }; // methods for libdar to setup the object void set_name(const std::string & val) { my_name = val; }; void set_type(unsigned char val) { type = val; }; void set_hard_link(bool val) { hard_link = val; }; void set_uid(const infinint & val) { uid = val; }; void set_gid(const infinint & val) { gid = val; }; void set_perm(U_16 val) { perm = val; }; void set_last_access(const datetime & val) { last_access = val; }; void set_last_modif(const datetime & val) { last_modif = val; }; void set_saved_status(saved_status val) { data_status = val; }; void set_ea_status(cat_inode::ea_status val) { ea_status = val; }; void set_last_change(const datetime & val) { last_change = val; }; void set_fsa_status(cat_inode::fsa_status val) { fsa_status = val; }; void set_file_size(const infinint & val) { file_size = val; }; void set_storage_size(const infinint & val) { storage_size = val; }; void set_is_sparse_file(bool val) { sparse_file = val; }; void set_compression_algo(compression val) { compression_algo = val; }; void set_dirtiness(bool val) { dirty = val; }; void set_link_target(const std::string & val) { target = val; }; void set_major(int val) { major = val; }; void set_minor(int val) { minor = val; }; void set_slices(const range & sl) { slices = sl; }; private: std::string my_name; bool hard_link; unsigned char type; infinint uid; infinint gid; U_16 perm; datetime last_access; datetime last_modif; saved_status data_status; cat_inode::ea_status ea_status; datetime last_change; cat_inode::fsa_status fsa_status; infinint file_size; infinint storage_size; bool sparse_file; compression compression_algo; bool dirty; std::string target; int major; int minor; range slices; static time_t datetime2time_t(const datetime & val); }; } // end of namespace #endif dar-2.5.3/src/libdar/cat_entree.cpp0000644000175000017430000003275612642474445014104 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_entree.hpp" #include "cat_all_entrees.hpp" #include "cat_tools.hpp" using namespace std; namespace libdar { const U_I cat_entree::ENTREE_CRC_SIZE = 2; void entree_stats::add(const cat_entree *ref) { if(dynamic_cast(ref) == nullptr // we ignore cat_eod && dynamic_cast(ref) == nullptr // as well we ignore "cat_ignored" && dynamic_cast(ref) == nullptr) // and "cat_ignored_dir" { const cat_inode *ino = dynamic_cast(ref); const cat_mirage *h = dynamic_cast(ref); const cat_detruit *x = dynamic_cast(ref); if(h != nullptr) // won't count twice the same inode if it is referenced with hard_link { ++num_hard_link_entries; if(!h->is_inode_counted()) { ++num_hard_linked_inodes; h->set_inode_counted(true); ino = h->get_inode(); } } if(ino != nullptr) { ++total; if(ino->get_saved_status() == s_saved) ++saved; } if(x != nullptr) ++num_x; else { const cat_directory *d = dynamic_cast(ino); if(d != nullptr) ++num_d; else { const cat_chardev *c = dynamic_cast(ino); if(c != nullptr) ++num_c; else { const cat_blockdev *b = dynamic_cast(ino); if(b != nullptr) ++num_b; else { const cat_tube *p = dynamic_cast(ino); if(p != nullptr) ++num_p; else { const cat_prise *s = dynamic_cast(ino); if(s != nullptr) ++num_s; else { const cat_lien *l = dynamic_cast(ino); if(l != nullptr) ++num_l; else { const cat_door *D = dynamic_cast(ino); if(D != nullptr) ++num_D; else { const cat_file *f = dynamic_cast(ino); if(f != nullptr) ++num_f; else if(h == nullptr) throw SRC_BUG; // unknown entry } } } } } } } } } } void entree_stats::listing(user_interaction & dialog) const { dialog.printf(gettext("\nCATALOGUE CONTENTS :\n\n")); dialog.printf(gettext("total number of inode : %i\n"), &total); dialog.printf(gettext("saved inode : %i\n"), &saved); dialog.printf(gettext("distribution of inode(s)\n")); dialog.printf(gettext(" - directories : %i\n"), &num_d); dialog.printf(gettext(" - plain files : %i\n"), &num_f); dialog.printf(gettext(" - symbolic links : %i\n"), &num_l); dialog.printf(gettext(" - named pipes : %i\n"), &num_p); dialog.printf(gettext(" - unix sockets : %i\n"), &num_s); dialog.printf(gettext(" - character devices : %i\n"), &num_c); dialog.printf(gettext(" - block devices : %i\n"), &num_b); dialog.printf(gettext(" - Door entries : %i\n"), &num_D); dialog.printf(gettext("hard links information\n")); dialog.printf(gettext(" - number of inode with hard link : %i\n"), &num_hard_linked_inodes); dialog.printf(gettext(" - number of reference to hard linked inodes: %i\n"), &num_hard_link_entries); dialog.printf(gettext("destroyed entries information\n")); dialog.printf(gettext(" %i file(s) have been record as destroyed since backup of reference\n\n"), &num_x); } cat_entree *cat_entree::read(user_interaction & dialog, memory_pool *pool, const pile_descriptor & pdesc, const archive_version & reading_ver, entree_stats & stats, std::map & corres, compression default_algo, bool lax, bool only_detruit, bool small) { char type; saved_status saved; cat_entree *ret = nullptr; map ::iterator it; infinint tmp; bool read_crc; generic_file *ptr = nullptr; pdesc.check(small); if(small) { ptr = pdesc.esc; pdesc.stack->flush_read_above(pdesc.esc); } else ptr = pdesc.stack; read_crc = small && !ptr->crc_status(); // crc may be activated when reading a hard link (mirage read, now reading the inode) if(read_crc) ptr->reset_crc(ENTREE_CRC_SIZE); try { S_I lu = ptr->read(&type, 1); if(lu == 0) type = ' '; // used to by-pass object construction and return nullptr as value of this method if(!extract_base_and_status((unsigned char)type, (unsigned char &)type, saved)) { if(!lax) throw Erange("cat_entree::read", gettext("corrupted file")); else type = ' '; // used to by-pass object construction and return nullptr as value of this method } switch(type) { case ' ': break; // returned value will be nullptr case 'f': ret = new (pool) cat_file(dialog, pdesc, reading_ver, saved, default_algo, small); break; case 'l': ret = new (pool) cat_lien(dialog, pdesc, reading_ver, saved, small); break; case 'c': ret = new (pool) cat_chardev(dialog, pdesc, reading_ver, saved, small); break; case 'b': ret = new (pool) cat_blockdev(dialog, pdesc, reading_ver, saved, small); break; case 'p': ret = new (pool) cat_tube(dialog, pdesc, reading_ver, saved, small); break; case 's': ret = new (pool) cat_prise(dialog, pdesc, reading_ver, saved, small); break; case 'd': ret = new (pool) cat_directory(dialog, pdesc, reading_ver, saved, stats, corres, default_algo, lax, only_detruit, small); break; case 'm': ret = new (pool) cat_mirage(dialog, pdesc, reading_ver, saved, stats, corres, default_algo, cat_mirage::fmt_mirage, lax, small); break; case 'h': // old hard-link object ret = new (pool) cat_mirage(dialog, pdesc, reading_ver, saved, stats, corres, default_algo, cat_mirage::fmt_hard_link, lax, small); break; case 'e': // old etiquette object ret = new (pool) cat_mirage(dialog, pdesc, reading_ver, saved, stats, corres, default_algo, lax, small); break; case 'z': if(saved != s_saved) { if(!lax) throw Erange("cat_entree::read", gettext("corrupted file")); else dialog.warning(gettext("LAX MODE: Unexpected saved status for end of directory entry, assuming data corruption occurred, ignoring and continuing")); } ret = new (pool) cat_eod(pdesc, small); break; case 'x': if(saved != s_saved) { if(!lax) throw Erange("cat_entree::read", gettext("corrupted file")); else dialog.warning(gettext("LAX MODE: Unexpected saved status for class \"cat_detruit\" object, assuming data corruption occurred, ignoring and continuing")); } ret = new (pool) cat_detruit(pdesc, reading_ver, small); break; case 'o': ret = new (pool) cat_door(dialog, pdesc, reading_ver, saved, default_algo, small); break; default : if(!lax) throw Erange("cat_entree::read", gettext("unknown type of data in catalogue")); else { dialog.warning(gettext("LAX MODE: found unknown catalogue entry, assuming data corruption occurred, cannot read further the catalogue as I do not know the length of this type of entry")); return ret; // nullptr } } if(ret == nullptr && type != ' ') throw Ememory("cat_entree::read"); } catch(...) { if(read_crc) { crc * tmp = ptr->get_crc(); // keep pdesc in a coherent status if(tmp != nullptr) delete tmp; } throw; } if(read_crc) { crc *crc_calc = ptr->get_crc(); if(crc_calc == nullptr) throw SRC_BUG; if(type == ' ') // corrupted data while in lax mode { delete crc_calc; return ret; // returning nullptr } try { crc *crc_read = create_crc_from_file(*ptr, pool); if(crc_read == nullptr) throw SRC_BUG; try { if(*crc_read != *crc_calc) { cat_nomme * ret_nom = dynamic_cast(ret); string nom = ret_nom != nullptr ? ret_nom->get_name() : ""; try { if(!lax) throw Erange("", "temporary exception"); else { if(nom == "") nom = gettext("unknown entry"); dialog.pause(tools_printf(gettext("Entry information CRC failure for %S. Ignore the failure?"), &nom)); } } catch(Egeneric & e) // we catch here the temporary exception and the Euser_abort thrown by dialog.pause() { if(nom != "") throw Erange("cat_entree::read", tools_printf(gettext("Entry information CRC failure for %S"), &nom)); else throw Erange("cat_entree::read", gettext(gettext("Entry information CRC failure"))); } } ret->post_constructor(pdesc); } catch(...) { if(crc_read != nullptr) delete crc_read; throw; } if(crc_read != nullptr) delete crc_read; } catch(...) { if(crc_calc != nullptr) delete crc_calc; throw; } if(crc_calc != nullptr) delete crc_calc; } stats.add(ret); return ret; } cat_entree::cat_entree(const pile_descriptor & x_pdesc, bool small) { if(small && x_pdesc.esc == nullptr) throw SRC_BUG; change_location(x_pdesc); } void cat_entree::change_location(const pile_descriptor & x_pdesc) { if(x_pdesc.stack == nullptr) throw SRC_BUG; if(x_pdesc.compr == nullptr) throw SRC_BUG; pdesc = x_pdesc; } void cat_entree::dump(const pile_descriptor & pdesc, bool small) const { pdesc.check(small); if(small) { crc *tmp = nullptr; try { pdesc.stack->sync_write_above(pdesc.esc); pdesc.esc->reset_crc(ENTREE_CRC_SIZE); try { inherited_dump(pdesc, small); } catch(...) { tmp = pdesc.esc->get_crc(); // keep f in a coherent status throw; } tmp = pdesc.esc->get_crc(); if(tmp == nullptr) throw SRC_BUG; tmp->dump(*pdesc.esc); } catch(...) { if(tmp != nullptr) delete tmp; throw; } if(tmp != nullptr) delete tmp; } else inherited_dump(pdesc, small); } void cat_entree::inherited_dump(const pile_descriptor & pdesc, bool small) const { char s = signature(); pdesc.check(small); if(small) pdesc.esc->write(&s, 1); else pdesc.stack->write(&s, 1); } generic_file *cat_entree::get_read_cat_layer(bool small) const { generic_file *ret = nullptr; pdesc.check(small); if(small) { pdesc.stack->flush_read_above(pdesc.esc); ret = pdesc.esc; } else ret = pdesc.stack; return ret; } } // end of namespace dar-2.5.3/src/libdar/crypto.hpp0000644000175000017430000000623112641772777013315 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file crypto.hpp /// \brief the crypto algoritm definition /// \ingroup API #ifndef CRYPTO_HPP #define CRYPTO_HPP extern "C" { } #include "../my_config.h" #include #include "datetime.hpp" #include namespace libdar { /// \ingroup Private /// @} /// the different cypher available for encryption (strong or weak) /// values to be used as argument of libdar API calls /// \ingroup API enum crypto_algo { crypto_none, ///< no encryption crypto_scrambling, ///< scrambling weak encryption crypto_blowfish, ///< blowfish strong encryption crypto_aes256, ///< AES 256 strong encryption crypto_twofish256, ///< twofish 256 strong encryption crypto_serpent256, ///< serpent 256 strong encryption crypto_camellia256 ///< camellia 256 strong encryption }; struct signator { enum { good, //< good signature bad, //< key correct bug signature tempered unknown_key, //< no key found to check the signature error //< signature failed to be checked for other error } result; //< status of the signing enum { valid, //< the key we have is neither expired nor revoked expired, //< the key we have has expired revoked //< the key we have has been revoked } key_validity; //< validity of the key used to verify the signature std::string fingerprint; //< fingerprint of the key datetime signing_date; //< date of signature datetime signature_expiration_date; //< date of expiration of this signature bool operator < (const signator & ref) const { return fingerprint < ref.fingerprint; }; bool operator == (const signator & ref) const { return result == ref.result && key_validity == ref.key_validity && fingerprint == ref.fingerprint && signature_expiration_date == ref.signature_expiration_date; }; }; extern std::string crypto_algo_2_string(crypto_algo algo); extern char crypto_algo_2_char(crypto_algo a); extern crypto_algo char_2_crypto_algo(char a); extern bool same_signatories(const std::list & a, const std::list & b); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/ea_filesystem.hpp0000644000175000017430000001013412641772777014623 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file ea_filesystem.hpp /// \brief filesystem dependent Extended Attributes operations /// \ingroup Private /// /// This file contains a set of routines used to manipulate /// (read, write or test the presence of) Extended Attributes #ifndef EA_FILESYSTEM_HPP #define EA_FILESYSTEM_HPP #include "../my_config.h" #include #include "ea.hpp" #include "mask.hpp" namespace libdar { /// \ingroup Private /// @} /// read EA associated to a given file /// \param[in] chemin is the path to the file to read attributes of /// \param[in] filter is a mask that defines which attributes names have to be considered only /// \param[in] p the memory pool to use for dynamic allocation of nullptr to not used any memory pool /// \return nullptr if no EA have been found under the specified mask, or returns a newly allocated object /// that the caller has the responsibility to delete when no more needed extern ea_attributs * ea_filesystem_read_ea(const std::string & chemin, const mask & filter, memory_pool *p); /// overwrite some attribute to a given file's attribute list /// \param[in] chemin is the path of the file to write attribute to /// \param[in] val is a list of attribute amoung which a subset will be added to file's attribute list /// \param[in] filter a mask that define which attribute's names will be written and which will be ignored from the given list /// \return true if some attribute could be set /// \note if an EA is already present, it is not modified unless the mask covers its name and a value /// is available for that attribute name in the given list. extern bool ea_filesystem_write_ea(const std::string & chemin, const ea_attributs & val, const mask & filter); /// remove all EA of a given file that match a given mask /// \param[in] name is the filename which EA must be altered /// \param[in] filter is a mask that defines which EA names have to be removed /// \param[in] p points to the memory pool to use or is to be set to nullptr for no pool utilisation /// \note unless the given mask is logically equivalent to bool_mask(true) some /// EA may remain associated to the file after the operation. extern void ea_filesystem_clear_ea(const std::string & name, const mask & filter, memory_pool *p); /// test the presence of EA for a given file /// \param[in] name is the filename which EA presence must be check against /// \param[in] p points to the memory pool to use or is to be set to nullptr for no pool utilisation /// \return true if at least one EA has been found extern bool ea_filesystem_has_ea(const std::string & name, memory_pool *p); /// test the presence of EA for a given file /// \param[in] name is the filename which EA presence must be check against /// \param[in] filter is a mask that defines which attributes names to only consider /// \param[in] p points to the memory pool to use or is to be set to nullptr for no pool utilisation /// \return true if at least one EA has been found extern bool ea_filesystem_has_ea(const std::string & name, const mask & filter, memory_pool *p); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_blockdev.cpp0000644000175000017430000000262612641772777014414 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_blockdev.hpp" using namespace std; namespace libdar { bool cat_blockdev::operator == (const cat_entree & ref) const { const cat_blockdev *ref_blockdev = dynamic_cast(&ref); if(ref_blockdev == nullptr) return false; else return cat_device::operator == (ref); } } // end of namespace dar-2.5.3/src/libdar/etage.cpp0000644000175000017430000001420412641772777013054 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // this was necessary to compile under Mac OS-X (boggus dirent.h) #if HAVE_STDINT_H #include #endif #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif } // end extern "C" #include "etage.hpp" #include "tools.hpp" #include "infinint.hpp" #include "generic_file.hpp" #include "cygwin_adapt.hpp" #include "user_interaction.hpp" #include "fichier_local.hpp" #define CACHE_DIR_TAG_FILENAME "CACHEDIR.TAG" #define CACHE_DIR_TAG_FILENAME_CONTENTS "Signature: 8a477f597d28d172789f06886806bc55" using namespace std; namespace libdar { // check if the given file is a tag tellig if the current directory is a cache directory static bool cache_directory_tagging_check(const char *cpath, const char *filename); etage::etage(user_interaction &ui, const char *dirname, const datetime & x_last_acc, const datetime & x_last_mod, bool cache_directory_tagging, bool furtive_read_mode) { struct dirent *ret; DIR *tmp = nullptr; #if FURTIVE_READ_MODE_AVAILABLE int fddir = -1; if(furtive_read_mode) { fddir = ::open(dirname, O_RDONLY|O_BINARY|O_NOATIME); if(fddir < 0) { if(errno != EPERM) throw Erange("etage::etage", string(gettext("Error opening directory in furtive read mode: ")) + dirname + " : " + tools_strerror_r(errno)); else // using back normal access mode { string tmp = tools_strerror_r(errno); ui.warning(tools_printf(gettext("Could not open directory %s in furtive read mode (%s), using normal mode"), dirname, tmp.c_str())); } } } #endif try { #if FURTIVE_READ_MODE_AVAILABLE if(furtive_read_mode && fddir >= 0) { tmp = fdopendir(fddir); if(tmp == nullptr) close(fddir); // else, tmp != nullptr: // fddir is now under control of the system // we must not close it. } else tmp = opendir(dirname); #else tmp = opendir(dirname); #endif bool is_cache_dir = false; if(tmp == nullptr) throw Erange("etage::etage" , string(gettext("Error opening directory: ")) + dirname + " : " + tools_strerror_r(errno)); fichier.clear(); #if HAVE_READDIR_R ret = tools_allocate_struct_dirent(dirname); struct dirent *dbldrt = nullptr; if(ret == nullptr) throw SRC_BUG; try { while(!is_cache_dir && (readdir_r(tmp, ret, &dbldrt) == 0) && dbldrt != nullptr) #else while(!is_cache_dir && (ret = readdir(tmp)) != nullptr) #endif if(strcmp(ret->d_name, ".") != 0 && strcmp(ret->d_name, "..") != 0) { if(cache_directory_tagging) is_cache_dir = cache_directory_tagging_check(dirname, ret->d_name); fichier.push_back(string(ret->d_name)); } #if HAVE_READDIR_R } catch(...) { if(ret != nullptr) tools_release_struct_dirent(ret); throw; } tools_release_struct_dirent(ret); ret = nullptr; #endif closedir(tmp); tmp = nullptr; if(is_cache_dir) { fichier.clear(); ui.warning(tools_printf(gettext("Detected Cache Directory Tagging Standard for %s, the contents of that directory will not be saved"), dirname)); // drop all the contents of the directory because it follows the Cache Directory Tagging Standard } last_mod = x_last_mod; last_acc = x_last_acc; } catch(...) { if(tmp != nullptr) closedir(tmp); throw; } } bool etage::read(string & ref) { if(fichier.empty()) return false; else { ref = fichier.front(); fichier.pop_front(); return true; } } /////////////////////////////////////////// ////////////// static functions /////////// /////////////////////////////////////////// static bool cache_directory_tagging_check(const char *cpath, const char *filename) { bool ret = false; if(strcmp(CACHE_DIR_TAG_FILENAME, filename) != 0) ret = false; else // we need to inspect the few first bytes of the file { try { path chem = path(cpath)+string(filename); fichier_local fic = fichier_local(chem.display(), false); U_I len = strlen(CACHE_DIR_TAG_FILENAME_CONTENTS); char *buffer = new (nothrow) char[len+1]; S_I lu; if(buffer == nullptr) throw Ememory("etage:cache_directory_tagging_check"); try { lu = fic.read(buffer, len); if(lu < 0 || (U_I)(lu) < len) ret = false; else ret = strncmp(buffer, CACHE_DIR_TAG_FILENAME_CONTENTS, len) == 0; } catch(...) { delete [] buffer; throw; } delete [] buffer; } catch(Ememory & e) { throw; } catch(Ebug & e) { throw; } catch(...) { ret = false; } } return ret; } } // end of namespace dar-2.5.3/src/libdar/cat_inode.hpp0000644000175000017430000002540612641772777013727 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_inode.hpp /// \brief base object for all inode types, managed EA and FSA, dates, permissions, ownership, ... /// \ingroup Private #ifndef CAT_INODE_HPP #define CAT_INODE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "infinint.hpp" #include "generic_file.hpp" #include "ea.hpp" #include "compressor.hpp" #include "integers.hpp" #include "mask.hpp" #include "user_interaction.hpp" #include "escape.hpp" #include "filesystem_specific_attribute.hpp" #include "datetime.hpp" #include "cat_nomme.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the root class for all cat_inode class cat_inode : public cat_nomme { public: /// flag used to only consider certain fields when comparing/restoring inodes enum comparison_fields { cf_all, //< consider any available field for comparing inodes cf_ignore_owner, //< consider any available field except ownership fields cf_mtime, //< consider any available field except ownership and permission fields cf_inode_type //< only consider the file type }; cat_inode(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & xname, const infinint & device); cat_inode(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small); cat_inode(const cat_inode & ref); const cat_inode & operator = (const cat_inode & ref); ~cat_inode() throw(Ebug); const infinint & get_uid() const { return uid; }; const infinint & get_gid() const { return gid; }; U_16 get_perm() const { return perm; }; datetime get_last_access() const { return last_acc; }; datetime get_last_modif() const { return last_mod; }; void set_last_access(const datetime & x_time) { last_acc = x_time; }; void set_last_modif(const datetime & x_time) { last_mod = x_time; }; saved_status get_saved_status() const { return xsaved; }; void set_saved_status(saved_status x) { xsaved = x; }; infinint get_device() const { if(fs_dev == nullptr) throw SRC_BUG; return *fs_dev; }; bool same_as(const cat_inode & ref) const; bool is_more_recent_than(const cat_inode & ref, const infinint & hourshift) const; // used for RESTORATION virtual bool has_changed_since(const cat_inode & ref, const infinint & hourshift, comparison_fields what_to_check) const; // signature() left as an abstract method // clone is abstract too // used for INCREMENTAL BACKUP void compare(const cat_inode &other, const mask & ea_mask, comparison_fields what_to_check, const infinint & hourshift, bool symlink_date, const fsa_scope & scope, bool isolated_mode) const; //< do not try to compare pointed to data, EA of FSA (suitable for isolated catalogue) // throw Erange exception if a difference has been detected // this is not a symetrical comparison, but all what is present // in the current object is compared against the argument // which may contain supplementary informations // used for DIFFERENCE ////////////////////////////////// // EXTENDED ATTRIBUTES Methods // enum ea_status { ea_none, ea_partial, ea_fake, ea_full, ea_removed }; // ea_none : no EA present for this inode in filesystem // ea_partial : EA present in filesystem but not stored (ctime used to check changes) // ea_fake : EA present in filesystem but not attached to this inode (isolation context) no more used in archive version "08" and above, ea_partial or ea_full stays a valid status in isolated catalogue because pointers to EA and data are no more removed during isolation process. // ea_full : EA present in filesystem and attached to this inode // ea_removed : EA were present in the reference version, but not present anymore // I : to know whether EA data is present or not for this object void ea_set_saved_status(ea_status status); ea_status ea_get_saved_status() const { return ea_saved; }; // II : to associate EA list to an cat_inode object (mainly for backup operation) #EA_FULL only# void ea_attach(ea_attributs *ref); const ea_attributs *get_ea() const; // #<-- EA_FULL *and* EA_REMOVED# for this call only void ea_detach() const; //discards any future call to get_ea() ! infinint ea_get_size() const; //returns the size of EA (still valid if ea have been detached) mainly used to define CRC width // III : to record where is dump the EA in the archive #EA_FULL only# void ea_set_offset(const infinint & pos); bool ea_get_offset(infinint & pos) const; void ea_set_crc(const crc & val); void ea_get_crc(const crc * & ptr) const; //< the argument is set to point to an allocated crc object owned by this "cat_inode" object, this reference stays valid while the "cat_inode" object exists and MUST NOT be deleted by the caller in any case bool ea_get_crc_size(infinint & val) const; //< returns true if crc is know and puts its width in argument // IV : to know/record if EA and FSA have been modified # any EA status# and FSA status # datetime get_last_change() const; void set_last_change(const datetime & x_time); bool has_last_change() const { return last_cha != nullptr; }; // old format did provide last_change only when EA were present, since archive // format 8, this field is always present even in absence of EA. Thus it is // still necessary to check if the cat_inode has a last_change() before // using get_last_change() (depends on the version of the archive read). ////////////////////////////////// // FILESYSTEM SPECIFIC ATTRIBUTES Methods // // there is not "remove status for FSA, either the cat_inode contains // full copy of FSA or only remembers the families of FSA found in the unchanged cat_inode // FSA none is used when the file has no FSA because: // - either the underlying filesystem has no known FSA // - or the underlying filesystem FSA support has not been activated at compilation time // - or the fsa_scope requested at execution time exclude the filesystem FSA families available here enum fsa_status { fsa_none, fsa_partial, fsa_full }; // I : which FSA are present void fsa_set_saved_status(fsa_status status); fsa_status fsa_get_saved_status() const { return fsa_saved; }; /// gives the set of FSA family recorded for that inode fsa_scope fsa_get_families() const { if(fsa_families == nullptr) throw SRC_BUG; return infinint_to_fsa_scope(*fsa_families); }; // II : add or drop FSA list to the cat_inode void fsa_attach(filesystem_specific_attribute_list *ref); const filesystem_specific_attribute_list *get_fsa() const; // #<-- FSA_FULL only void fsa_detach() const; // discard any future call to get_fsa() ! infinint fsa_get_size() const; // returns the size of FSA (still valid if fsal has been detached) / mainly used to define CRC size // III : to record where FSA are dumped in the archive (only if fsa_status not empty !) void fsa_set_offset(const infinint & pos); bool fsa_get_offset(infinint & pos) const; void fsa_set_crc(const crc & val); void fsa_get_crc(const crc * & ptr) const; bool fsa_get_crc_size(infinint & val) const; protected: virtual void sub_compare(const cat_inode & other, bool isolated_mode) const {}; bool get_small_read() const { return small_read; }; //< true if object has been created by sequential reading of an archive // inherited from cat_entree void inherited_dump(const pile_descriptor & pdesc, bool small) const; private : infinint uid; //< inode owner's user ID infinint gid; //< inode owner's group ID U_16 perm; //< inode's permission datetime last_acc; //< last access time (atime) datetime last_mod; //< last modification time (mtime) datetime *last_cha; //< last inode meta data change (ctime) saved_status xsaved; //< inode data status ea_status ea_saved; //< inode Extended Attribute status fsa_status fsa_saved; //< inode Filesystem Specific Attribute status bool small_read; //< whether we the object has been built with sequential-reading // the following is used only if ea_saved == full infinint *ea_offset; //< offset in archive where to find EA ea_attributs *ea; //< Extended Attributes read or to be written down infinint *ea_size; //< storage size required by EA // the following is used if ea_saved == full or ea_saved == partial or crc *ea_crc; //< CRC computed on EA infinint *fsa_families; //< list of FSA families present for that inode (set to nullptr in fsa_none mode) infinint *fsa_offset; //< offset in archive where to find FSA # always allocated (to be reviewed) filesystem_specific_attribute_list *fsal; //< Filesystem Specific Attributes read or to be written down # only allocated if fsa_saved if set to FULL infinint *fsa_size; //< storage size required for FSA crc *fsa_crc; //< CRC computed on FSA // infinint *fs_dev; //< filesystem ID on which resides the inode (only used when read from filesystem) archive_version edit; //< need to know EA and FSA format used in archive file void nullifyptr(); void destroy(); void copy_from(const cat_inode & ref); static const ea_attributs empty_ea; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/archive_version.hpp0000644000175000017430000000556412641772777015173 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file archive_version.hpp /// \brief class archive_version that rules which archive format to follow /// \ingroup Private #ifndef ARCHIVE_VERSION_HPP #define ARCHIVE_VERSION_HPP #include "../my_config.h" #include #include "integers.hpp" #include "infinint.hpp" #include "generic_file.hpp" namespace libdar { /// \ingroup Private /// @} /// class archive_version manages the version of the archive format class archive_version { public: /// archive_version constructor /// \param[in] x is the version number /// \param[in] fix is a decimal-like /// \note the fix argument must only be used when the current stable version need to be increased /// due to a bug fix. This let the concurrent development version to keep the same version (usually x+1) /// while having the stable version using a slightly different format to fix a bug. archive_version(U_16 x = 0, unsigned char fix = 0); bool operator < (const archive_version & ref) const { return value() < ref.value(); }; bool operator >= (const archive_version & ref) const { return value() >= ref.value(); }; bool operator == (const archive_version & ref) const { return value() == ref.value(); }; bool operator != (const archive_version & ref) const { return value() != ref.value(); }; bool operator > (const archive_version & ref) const { return value() > ref.value(); }; bool operator <= (const archive_version & ref) const { return value() <= ref.value(); }; void dump(generic_file & f) const; void read(generic_file & f); std::string display() const; private: U_16 version; unsigned char fix; U_I value() const { return (U_I)(version)*256 + fix; }; static unsigned char to_digit(unsigned char val); static unsigned char to_char(unsigned char val); }; extern const archive_version empty_archive_version(); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/entrepot_local.cpp0000644000175000017430000001013312641772777014776 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ // $Id: entrepot.cpp,v 1.1 2012/04/27 11:24:30 edrusb Exp $ // /*********************************************************************/ #include "../my_config.h" #include extern "C" { #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_UNISTD_H #include #endif } // end extern "C" #include "entrepot_local.hpp" #include "cygwin_adapt.hpp" #include "tools.hpp" #include "fichier_local.hpp" using namespace std; namespace libdar { entrepot_local::entrepot_local(const std::string & user, const std::string & group, bool x_furtive_mode) { furtive_mode = x_furtive_mode; contents = nullptr; set_user_ownership(user); set_group_ownership(group); set_root(tools_getcwd()); } entrepot_local & entrepot_local::operator = (const entrepot_local & ref) { entrepot *me = this; const entrepot *you = &ref; detruit(); *me = *you; // copying the entrepot part copy_from(ref); // copying the entrepot_local specific part return *this; } void entrepot_local::read_dir_reset() { detruit(); user_interaction_blind aveugle; contents = new (get_pool()) etage(aveugle, get_location().display().c_str(), datetime(0), datetime(0), false, furtive_mode); if(contents == nullptr) throw Ememory("entrepot_local::read_dir_reset"); } bool entrepot_local::read_dir_next(string & filename) { if(contents == nullptr) return false; if(contents->fichier.empty()) { delete contents; contents = nullptr; return false; } filename = contents->fichier.front(); contents->fichier.pop_front(); return true; } fichier_global *entrepot_local::inherited_open(user_interaction & dialog, const std::string & filename, gf_mode mode, bool force_permission, U_I permission, bool fail_if_exists, bool erase) const { fichier_global *ret = nullptr; string fullname = (get_full_path() + path(filename)).display(); U_I perm = force_permission ? permission : 0666; ret = new (get_pool()) fichier_local(dialog, fullname, mode, perm, fail_if_exists, erase, false); if(ret == nullptr) throw Ememory("entrepot_local::inherited_open"); try { if(force_permission) ret->change_permission(permission); // this is necessary if the file already exists if(get_user_ownership() != "" || get_group_ownership() != "") { try { ret->change_ownership(get_user_ownership(), get_group_ownership()); } catch(Ebug & e) { throw; } catch(Egeneric & e) { e.prepend_message("Failed setting user and/or group ownership: "); throw Edata(e.get_message()); } } } catch(...) { delete ret; ret = nullptr; throw; } return ret; } void entrepot_local::inherited_unlink(const string & filename) const { if(::unlink(filename.c_str()) != 0) { string tmp = tools_strerror_r(errno); throw Erange("entrepot_local::inherited_unlink", tools_printf(gettext("Cannot remove file %s: "), tmp.c_str())); } } } // end of namespace dar-2.5.3/src/libdar/limitint.cpp0000644000175000017520000000233512610405012013565 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "erreurs.hpp" #include "infinint.hpp" #include "generic_file.hpp" namespace libdar { // nothing more here, since pragma interface/implementation has been removed } // end of namespace dar-2.5.3/src/libdar/cat_tools.hpp0000644000175000017430000000621512642474445013756 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_tools.hpp /// \brief set of routines used by catalogue related classes /// \ingroup Private #ifndef CAT_TOOLS_HPP #define CAT_TOOLS_HPP #include "../my_config.h" #include #include "cat_inode.hpp" extern "C" { } // end extern "C" #define REMOVE_TAG gettext("[--- REMOVED ENTRY ----]") #define SAVED_FAKE_BIT 0x80 namespace libdar { /// \addtogroup Private /// @{ extern std::string local_perm(const cat_inode & ref, bool hard); extern std::string local_uid(const cat_inode & ref); extern std::string local_gid(const cat_inode & ref); extern std::string local_size(const cat_inode & ref); extern std::string local_storage_size(const cat_inode & ref); extern std::string local_date(const cat_inode & ref); extern std::string local_flag(const cat_inode & ref, bool isolated, bool dirty_seq); extern void xml_listing_attributes(user_interaction & dialog, //< for user interaction const std::string & beginning, //< character std::string to use as margin const std::string & data, //< ("saved" | "referenced" | "deleted") const std::string & metadata, //< ("saved" | "referenced" | "absent") const cat_entree * obj = nullptr, //< the object to display cat_inode information about bool list_ea = false); //< whether to list Extended Attributes extern bool extract_base_and_status(unsigned char signature, unsigned char & base, saved_status & saved); extern void local_display_ea(user_interaction & dialog, const cat_inode * ino, const std::string &prefix, const std::string &suffix, bool xml_output = false); extern unsigned char mk_signature(unsigned char base, saved_status state); extern void unmk_signature(unsigned char sig, unsigned char & base, saved_status & state, bool isolated); extern bool compatible_signature(unsigned char a, unsigned char b); extern unsigned char get_base_signature(unsigned char a); /// returns a string describing the object type /// /// \note argument must point to a valid object extern std::string entree_to_string(const cat_entree *obj); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/filtre.hpp0000644000175000017430000001601612642474445013254 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file filtre.hpp /// \brief here is all the core routines for the operations /// \ingroup Private #ifndef FILTRE_HPP #define FILTRE_HPP #include "../my_config.h" #include #include "mask.hpp" #include "pile.hpp" #include "catalogue.hpp" #include "path.hpp" #include "statistics.hpp" #include "criterium.hpp" #include "archive_options.hpp" namespace libdar { /// \ingroup Private /// @} extern void filtre_restore(user_interaction & dialog, //< for user interaction memory_pool *pool, //< set to nullptr or point to the memory pool to use for memory allocation const mask &filtre, //< which filename to restore const mask & subtree, //< which directory and paths to restore const catalogue & cat, //< table of content to extract information from const path & fs_racine, //< root path under which to restore directiry tree and files bool fs_warn_overwrite, //< whether to warn before overwriting (to be replaced by overwriting policy) bool info_details, //< whether to display processing messages bool display_treated, //< whether to display treated files bool display_treated_only_dir, //< whether to only display current directory of treated file bool display_skipped, //< whether to display skipped files statistics & st, //< statistics result about the operation const mask & ea_mask, //< defines EA to restore/not restore bool flat, //< if true, directories are not restores, all files are placed directly at in fs_racine directory cat_inode::comparison_fields what_to_check, //< which file properties to restore bool warn_remove_no_match, //< wether to warn for file to remove not matching the expected type bool empty, //< dry-run execution bool empty_dir, //< whether to restore directories that do contain any file to restore const crit_action & x_overwrite, //< how and whether to overwrite files archive_options_extract::t_dirty dirty, //< whether to restore dirty files bool only_deleted, //< whether to only consider deleted files bool not_deleted, //< wether to consider deleted files const fsa_scope & scope); //< scope of FSA to take into account extern void filtre_sauvegarde(user_interaction & dialog, memory_pool *pool, const mask &filtre, const mask &subtree, const pile_descriptor & pdesc, catalogue & cat, const catalogue & ref, const path & fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, statistics & st, bool make_empty_dir, const mask & ea_mask, const mask &compr_mask, const infinint & min_compr_size, bool nodump, const infinint & hourshift, bool alter_time, bool furtive_read_mode, bool same_fs, cat_inode::comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, bool security_check, const infinint & repeat_count, const infinint & repeat_byte, const infinint & fixed_date, const infinint & sparse_file_min_size, const std::string & backup_hook_file_execute, const mask & backup_hook_file_mask, bool ignore_unknown, const fsa_scope & scope, const std::string & exclude_by_ea); extern void filtre_difference(user_interaction & dialog, memory_pool *pool, const mask &filtre, const mask &subtree, const catalogue & cat, const path & fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics & st, const mask & ea_mask, bool alter_time, bool furtive_read_mode, cat_inode::comparison_fields what_to_check, const infinint & hourshift, bool compare_symlink_date, const fsa_scope & scope, bool isolated_mode); extern void filtre_test(user_interaction & dialog, memory_pool *pool, const mask &filtre, const mask &subtree, const catalogue & cat, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool empty, statistics & st); extern void filtre_merge(user_interaction & dialog, memory_pool *pool, const mask & filtre, const mask & subtree, const pile_descriptor & pdesc, catalogue & cat, const catalogue * ref1, const catalogue * ref2, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics & st, bool make_empty_dir, const mask & ea_mask, const mask & compr_mask, const infinint & min_compr_size, bool keep_compressed, const crit_action & overwrite, bool warn_overwrite, bool decremental_mode, const infinint & sparse_file_min_size, const fsa_scope & scope); void filtre_sequentially_read_all_catalogue(catalogue & cat, user_interaction & dialog, bool lax_read_mode); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/tools.hpp0000644000175000017430000011455112642474445013132 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \defgroup Tools Tools /// \brief a set of tool routine /// /// these routines are available from libdar for historical /// reason, but are not part of the API. /// They are shared and used by dar, dar_slave, dar_xform, /// and dar_manager command. You should avoid using them in /// external program as they may be removed or changed without /// backward compatibility support. /// \file tools.hpp /// \brief a set of general purpose routines /// \ingroup Tools #ifndef TOOLS_HPP #define TOOLS_HPP #include "../my_config.h" extern "C" { #if STDC_HEADERS #include #endif #if HAVE_SIGNAL_H #include #endif #if HAVE_GPGME_H #include #endif } #include #include #include #include "path.hpp" #include "infinint.hpp" #include "generic_file.hpp" #include "tuyau.hpp" #include "integers.hpp" #include "tlv_list.hpp" #include "memory_pool.hpp" #include "datetime.hpp" #define TOOLS_SI_SUFFIX 1000 #define TOOLS_BIN_SUFFIX 1024 namespace libdar { /// \addtogroup Tools /// @{ /// libdar internal use only: it is launched from get_version() and initializes tools internal variables extern void tools_init(); /// libdar internal use only: it is launched from close_and_clean() and releases tools internal variables extern void tools_end(); /// convert a string to a char * /// \param[in] x is the string to convert /// \return the address of newly allocated memory containing the equivalent string as the argument /// \exception Ememory is thrown if the memory allocation failed, this call never return nullptr /// \note Do not use this function, use std::string::c_str(). The allocated memory must be released by the caller thanks to the "delete []" operator extern char *tools_str2charptr(const std::string &x); /// write a string to a file with a '\\0' at then end /// \param[in] f the file to write to /// \param[in] s the string to write to file extern void tools_write_string(generic_file & f, const std::string & s); /// read a string from a file expecting it to terminate by '\\0' /// \param f the file to read from /// \param s the string to put the data to (except the ending '\\0') extern void tools_read_string(generic_file & f, std::string & s); /// write a string to a file, '\\0' has no special meaning nor is added at the end /// \param[in] f the file to write to /// \param[in] s the string to write to file extern void tools_write_string_all(generic_file & f, const std::string & s); /// read a string if given size from a file '\\0' has no special meaning /// \param[in] f is the file to read from /// \param[in] s is the string to put read data in /// \param[in] taille is the size in byte to read extern void tools_read_string_size(generic_file & f, std::string & s, infinint taille); /// retrieve the size in byte of a file /// \param[in] p is the path to the file which size is to get /// \return the size of the file in byte extern infinint tools_get_filesize(const path &p); /// convert the given string to infinint taking care of multiplication suffixes like k, M, T, etc. /// \param[in] s is the string to read /// \param[in] base is the multiplication factor (base = 1000 for SI, base = 1024 for computer science use) /// \return the value encoded in the given string extern infinint tools_get_extended_size(std::string s, U_I base); /// convert an integer to its decimal representation with the highest unit of metric system /// \param[in] number is the integer to convert /// \param[in] unit unit symbol (o for octet, m for meter, etc.) to apply metric system to, this may be nullptr /// \param[in] binary if set to true using the ki, Gi, Mi ... scale instead of the traditional k, G, M, ... prefixes /// \return the string representing the number in metric system (ex: "1 ko", "200 Mio", ...) extern std::string tools_display_integer_in_metric_system(infinint number, const std::string & unit, bool binary); /// extracts the basename of a file (removing path part) /// \param[in] command_name is the full path of the file /// \param[out] basename the basename of the file /// \exception Ememory can be thrown if memory allocation failed extern void tools_extract_basename(const char *command_name, std::string & basename); /// give a pointer to the last character of the given value in the given string /// \param[in] s is the given string /// \param[in] v is the given char value /// \return a interator on s, pointing on the last char of s equal to v or a pointing to s.end() if no such char could be found is "s" /// \note the arguments are not modified neither the data they are pointing to. However the const statement has not been used to /// be able to return a iterator on the string (and not a const_interator). There is probably other ways to do that (using const_cast) for example extern std::string::iterator tools_find_last_char_of(std::string &s, unsigned char v); /// give a pointer to the last character of the given value in the given string /// \param[in] s is the given string /// \param[in] v is the given char value /// \return a interator on s, pointing on the first char of s equal to v or a pointing to s.end() if no such char could be found is "s" /// \note the arguments are not modified neither the data they are pointing to. However the const statement has not been used to /// be able to return a iterator on the string (and not a const_interator). There is probably other ways to do that (using const_cast) for example extern std::string::iterator tools_find_first_char_of(std::string &s, unsigned char v); /// split a given full path in path part and basename part /// \param[in] all is the path to split /// \param[out] chemin is the resulting path part, it points to a newly allocated path object /// \param[out] base is the resulting basename /// \param[in] pool memory pool to use for allocation or nullptr for default memory allocation /// \note chemin argument must be release by the caller thanks to the "delete" operator. extern void tools_split_path_basename(const char *all, path * &chemin, std::string & base, memory_pool *pool = nullptr); /// split a given full path in path part and basename part /// \param[in] all is the path to split /// \param[out] chemin is the resulting path part, it points to a newly allocated path object /// \param[out] base is the resulting basename /// \param[in] pool memory pool to use for allocation or nullptr for default memory allocation /// \note chemin argument must be release by the caller thanks to the "delete" operator. extern void tools_split_path_basename(const std::string &all, std::string & chemin, std::string & base, memory_pool *pool = nullptr); /// open a pair of tuyau objects encapsulating two named pipes. /// \param[in,out] dialog for user interaction /// \param[in] input path to the input named pipe /// \param[in] output path to the output named pipe /// \param[out] in resulting tuyau object for input /// \param[out] out resulting tuyau object for output /// \param[in] pool memory pool to use for allocation or nullptr for default memory allocation /// \note in and out parameters must be released by the caller thanks to the "delete" operator extern void tools_open_pipes(user_interaction & dialog, const std::string &input, const std::string & output, tuyau *&in, tuyau *&out, memory_pool *pool = nullptr); /// set blocking/not blocking mode for reading on a file descriptor /// \param[in] fd file descriptor to read on /// \param[in] mode set to true for a blocking read and to false for non blocking read extern void tools_blocking_read(int fd, bool mode); /// convert uid to name in regards to the current system's configuration /// \param[in] uid the User ID number /// \return the name of the corresponding user or the uid if none corresponds extern std::string tools_name_of_uid(const infinint & uid); /// convert gid to name in regards of the current system's configuration /// \param[in] gid the Group ID number /// \return the name of the corresponding group or the gid if none corresponds extern std::string tools_name_of_gid(const infinint & gid); /// convert unsigned word to string /// \param[in] x the unsigned word to convert /// \return the decimal representation of the given integer extern std::string tools_uword2str(U_16 x); /// convert integer to string /// \param[in] x the integer to convert /// \return the decimal representation of the given integer extern std::string tools_int2str(S_I x); extern std::string tools_uint2str(U_I x); /// convert an integer written in decimal notation to the corresponding value /// \param[in] x the decimal representation of the integer /// \return the value corresponding to the decimal representation given extern U_I tools_str2int(const std::string & x); /// convert a signed integer written in decimal notation to the corresponding value /// \param[in] x the decimal representation of the integer /// \return the value corresponding to the decimal representation given extern S_I tools_str2signed_int(const std::string & x); /// ascii to integer conversion /// \param[in] a is the ascii string to convert /// \param[out] val is the resulting value /// \return true if the conversion could be done false if the given string does not /// correspond to the decimal representation of an unsigned integer /// \note this call is now a warapper around tools_str2int extern bool tools_my_atoi(const char *a, U_I & val); /// prepend spaces before the given string /// \param[in] s the string to append spaces to /// \param[in] expected_size the minimum size of the resulting string /// \return a string at least as much long as expected_size with prepended leading spaces if necessary extern std::string tools_addspacebefore(std::string s, U_I expected_size); /// convert a date in second to its human readable representation /// \param[in] date the date in second /// \return the human representation corresponding to the argument extern std::string tools_display_date(const datetime & date); /// convert a human readable date representation in number of second since the system reference date /// \param[in] repres the date's human representation /// \return the corresponding number of seconds (computer time) /// \note the string expected format is "[[[year/]month/]day-]hour:minute[:second]" extern infinint tools_convert_date(const std::string & repres); /// wrapper to the "system" system call. /// \param[in,out] dialog for user interaction /// \param[in] argvector the equivalent to the argv[] vector extern void tools_system(user_interaction & dialog, const std::vector & argvector); /// wrapper to the "system" system call using anonymous pipe to tranmit arguments to the child process /// \param[in,out] dialog for user interaction /// \param[in] dar_cmd the path to the executable to run /// \param[in] argvpipe the list of arguments to pass through anonymous pipe /// \param[in] pool memory pool to use or nullptr for default memory allocation /// \note the command to execute must understand the --pipe-fd option that /// gives the filedescriptor to read from the command-line options extern void tools_system_with_pipe(user_interaction & dialog, const std::string & dar_cmd, const std::vector & argvpipe, memory_pool *pool = nullptr); /// write a list of string to file /// \param[in] f the file to write to /// \param[in] x the list of string to write extern void tools_write_vector(generic_file & f, const std::vector & x); /// read a list of string from a file /// \param[in] f the file to read from /// \param[out] x the list to fill from file extern void tools_read_vector(generic_file & f, std::vector & x); /// concatenate a vectors of strings in a single string /// \param[in] separator string to insert between two elements /// \param[in] x the list string /// \return the result of the concatenation of the members of the list with separtor between two consecutive members extern std::string tools_concat_vector(const std::string & separator, const std::vector & x); /// concatenate two vectors /// \param[in] a the first vector /// \param[in] b the second vector /// \return a vector containing the elements of a and the element of b std::vector operator + (std::vector a, std::vector b); /// display the compilation time features of libdar /// \param[in,out] dialog for user interaction /// \note this call uses the compile_time:: routines, and will /// not change its interface upon new feature addition extern void tools_display_features(user_interaction & dialog); /// test if two dates are equal taking care of a integer hour of difference /// \param[in] hourshift is the number of integer hour more or less two date can be considered equal /// \param[in] date1 first date to compare /// \param[in] date2 second date to compare to /// \return whether dates are equal or not extern bool tools_is_equal_with_hourshift(const infinint & hourshift, const datetime & date1, const datetime & date2); /// template function to add two vectors template std::vector operator +=(std::vector & a, const std::vector & b) { a = a + b; return a; } /// isolate the value of a given variable from the environment vector /// \param[in] env the environment vector as retreived from the third argument of the main() function /// \param[in] clef the key or variable name too look for /// \return nullptr if the key could not be find or a pointer to the env data giving the value of the requested key /// \note the returned value must not be released by any mean as it is just a pointer to an system allocated memory (the env vector). extern const char *tools_get_from_env(const char **env, const char *clef); /// does sanity checks on a slice name, check presence and detect whether the given basename is not rather a filename /// \param[in,out] dialog for user interaction /// \param[in] loc the path where resides the slice /// \param[in,out] base the basename of the slice /// \param[in] extension the extension of dar's slices /// \param[in] pool memory pool to use of nullptr for default memory allocation /// \note if user accepted the change of slice name proposed by libdar through dialog the base argument is changed extern void tools_check_basename(user_interaction & dialog, const path & loc, std::string & base, const std::string & extension, memory_pool *pool = nullptr); /// get current working directory extern std::string tools_getcwd(); /// returns the file pointed to by a symbolic link (or transparent if the file is not a symlink). /// \param root the path to the file to read /// \return the file pointed to by the symlink or the value given in argument if it is not a symlink /// \note an exception can occur if lack of memory or invalid argument given (nullptr or empty string), system call error... extern std::string tools_readlink(const char *root); /// test the presence of an argument /// \param[in] argument is the command line argument to look for /// \param[in] argc is the number of argument on the command line /// \param[in] argv is the list of argument on the command line /// \return true if the argument is present in the list /// \note THIS ROUTINE IS DEPRECATED AND WILL BE REMOVED IN A FUTURE VERSION OF LIBDAR extern bool tools_look_for(const char *argument, S_I argc, char *const argv[]); /// set dates of a given file, no exception thrown /// \param[in] chem the path to the file to set /// \param[in] symlink true if the file is a symlink /// \param[in] last_acc last access date to use /// \param[in] last_mod last modification date to use /// \param[in] birth creation date of the file, if not known, use the value of last_mod for efficiency extern void tools_noexcept_make_date(const std::string & chem, bool symlink, const datetime & last_acc, const datetime & last_mod, const datetime & birth); /// set dates of a given file, may throw exception /// \param[in] chemin the path to the file to set /// \param[in] symlink true if the file is a symlink /// \param[in] access last access date to use /// \param[in] modif last modification date to use /// \param[in] birth time of creation of the file /// \note if birth time is not known, it should be set to the value of modif for efficiency extern void tools_make_date(const std::string & chemin, bool symlink, const datetime & access, const datetime & modif, const datetime & birth); /// compare two string in case insensitive manner /// \param[in] a first string to compare /// \param[in] b second string to compare /// \return whether the two string given in argument are equal in case insensitive comparison extern bool tools_is_case_insensitive_equal(const std::string & a, const std::string & b); /// \brief convert a string to upper case /// /// \param[in] r the string to convert /// \param[out] uppered resulting upper cased string /// \note in case of invalid wide char met in source string, the upper case convertion /// is done in ASCII mode (byte by byte) extern void tools_to_upper(const std::string & r, std::string & uppered); #if HAVE_WCTYPE_H /// \brief convert a wstring to upper case /// /// \param[in,out] r to convert /// \note wstring is a string of wchar_t (wide-char) type used to store /// on variable lenght of byte sequence the many characters defined with UTF /// like cirillic and greek letters. extern void tools_to_wupper(std::wstring & r); #endif /// remove last character of a string is it equal to a given value /// \param[in] c the given value to compare the last char with /// \param[in,out] s the string to modify extern void tools_remove_last_char_if_equal_to(char c, std::string & s); /// from a string with a range notation (min-max) extract the range values /// \param[in] s the string to parse /// \param[out] min the minimum value of the range /// \param[out] max the maximum value of the range /// \exception Erange is thrown is the string to parse is incorrect /// \note: either a single number (positive or negative) is returned in min /// (max is set to min if min is positive or to zero if min is negative) /// or a range of positive numbers. extern void tools_read_range(const std::string & s, S_I & min, U_I & max); /// make printf-like formating to a std::string /// \param[in] format the format string /// \param[in] ... list of argument to use against the format string /// \return the resulting string /// \note the supported masks for the format are: /// - \%s \%c \%d \%\% (usual behavior) /// - \%x display an integer under hexadecimal notation /// - \%i (matches infinint *) /// - \%S (matches std::string *) /// . extern std::string tools_printf(const char *format, ...); /// make printf-like formating to a std::string /// \param[in] format the format string /// \param[in] ap list of argument to use against the format string /// \return the resulting string /// \note the supported masks for the format are: /// - \%s \%c \%d \%\% (normal behavior) /// - \%i (matches infinint *) /// - \%S (matches std::string *) /// . extern std::string tools_vprintf(const char *format, va_list ap); /// test the presence of files corresponding to a given mask in a directory (regex mask) /// \param[in,out] ui for user interaction /// \param[in] c_chemin directory where file have to be looked for /// \param[in] file_mask regex expression which designates the files to look for /// \return true if some files have found matching the file_mask extern bool tools_do_some_files_match_mask_regex(user_interaction & ui, const std::string & c_chemin, const std::string & file_mask); /// remove files from a given directory /// \param[in,out] dialog for user interaction /// \param[in] c_chemin directory where files have to be removed /// \param[in] file_mask regex expression which designates the files to remove /// \param[in] info_details whether user must be displayed details of the operation /// \note This is equivalent to the 'rm' command with regex expression in place of glob one extern void tools_unlink_file_mask_regex(user_interaction & dialog, const std::string & c_chemin, const std::string & file_mask, bool info_details); /// prevents slice overwriting: check the presence of slice and if necessary ask the user if they can be removed /// \param[in,out] dialog for user interaction /// \param[in] chemin where slice is about to be created /// \param[in] x_file_mask mask corresponding to slices that will be generated (regex) /// \param[in] info_details whether user must be displayed details of the operation /// \param[in] allow_overwriting whether overwriting is allowed by the user /// \param[in] warn_overwriting whether a warning must be issued before overwriting (if allowed) /// \param[in] dry_run do a dry-run exection (no filesystem modification is performed) /// \note may thow exceptions. extern void tools_avoid_slice_overwriting_regex(user_interaction & dialog, const path & chemin, const std::string & x_file_mask, bool info_details, bool allow_overwriting, bool warn_overwriting, bool dry_run); /// append an elastic buffer of given size to the file /// \param[in,out] f file to append elastic buffer to /// \param[in] max_size size of the elastic buffer to add /// \param[in] modulo defines the size to choose (see note) /// \param[in] offset defines the offset to apply (see note) /// \note the size of the elastic buffer should not exceed max_size but /// should be chosen in order to reach a size which is zero modulo "modulo" /// assuming the offset we add the elastic buffer at is "offset". If modulo is zero /// this the elastic buffer is randomly chosen from 1 to max_size without any /// concern about being congruent to a given modulo. /// \example if module is 5 and offset is 2, the elastic buffer possible size /// can be 3 (2+3 is congruent to 0 modulo 5), 8 (2+8 is congruent to modulo 5), 12, etc. /// but not exceed max_size+modulo-1 /// \note this is to accomodate the case when encrypted data is followed by clear data /// at the end of an archive. There is no way to known when we read clear data, but we /// know the clear data size is very inferior to crypted block size, thus when reading /// a uncompleted block of data we can be sure we have reached and of file and that /// the data is clear without any encrypted part because else we would have read an entire /// block of data. extern void tools_add_elastic_buffer(generic_file & f, U_32 max_size, U_32 modulo, U_32 offset); /// tells whether two files are on the same mounted filesystem /// \param[in] file1 first file /// \param[in] file2 second file /// \return true if the two file are located under the same mounting point /// \note if one of the file is not present or if the filesystem information /// is not possible to be read an exception is throw (Erange) extern bool tools_are_on_same_filesystem(const std::string & file1, const std::string & file2); /// transform a relative path to an absolute one given the current directory value /// \param[in] src the relative path to transform /// \param[in] cwd the value to take for the current directory /// \return the corresponding absolute path extern path tools_relative2absolute_path(const path & src, const path & cwd); /// block all signals (based on POSIX sigprocmask) /// \param[out] old_mask is set to the old mask value (for later unmasking signals) /// \exception Erange is thrown if system call failed for some reason extern void tools_block_all_signals(sigset_t &old_mask); /// unblock signals according to given mask /// \param[in] old_mask value to set to blocked signal mask /// \exception Erange is thrown if system call failed for some reason extern void tools_set_back_blocked_signals(sigset_t old_mask); /// counts the number of a given char in a given string /// \param[in] s string to look inside of /// \param[in] a char to look for /// \return the number of char found extern U_I tools_count_in_string(const std::string & s, const char a); /// returns the last modification date of the given file /// \param[in] s path of the file to get the last mtime /// \return the mtime of the given file extern datetime tools_get_mtime(const std::string & s); /// returns the size of the given plain file /// \param[in] s path of the file to get the size /// \return the size if the file in byte extern infinint tools_get_size(const std::string & s); /// returns the last change date of the given file /// \param[in] s path of the file to get the last ctime /// \return the ctime of the given file extern datetime tools_get_ctime(const std::string & s); /// read a file and split its contents into words /// \param[in,out] f is the file to read /// \return the list of words found in this order in the file /// \note The different quotes are taken into account extern std::vector tools_split_in_words(generic_file & f); /// read a std::string and split its contents into words /// \param[in,out] arg is the string to read /// \return the list of words found in this order in the file /// \note The different quotes are taken into account extern std::vector tools_split_in_words(const std::string & arg); /// look next char in string out of parenthesis /// \param[in] data is the string to look into /// \param[in] what is the char to look for /// \param[in] start is the index in string to start from, assuming at given position we are out of parenthesis /// \param[out] found the position of the next char equal to what /// \return true if a char equal to 'what' has been found and set the 'found' argument to its position or returns false if /// no such character has been found out of parenthesis /// \note the 'found' argument is assigned only if the call returns true, its value is not to be used when false is returned from the call /// \note second point, the start data should point to a character that is out of any parenthesis, behavior is undefined else. extern bool tools_find_next_char_out_of_parenthesis(const std::string & data, const char what, U_32 start, U_32 & found); /// produce the string resulting from the substition of % macro defined in the map /// \param[in] hook is the user's expression in which to proceed to substitution /// \param[in] corres is a map telling which char following a % sign to replace by which string /// \return the resulting string of the substitution extern std::string tools_substitute(const std::string & hook, const std::map & corres); /// produces the string resulting from the substitution of %... macro /// \param[in] hook the string in which to substitute /// \param[in] path is by what %p will be replaced /// \param[in] basename is by what %b will be replaced /// \param[in] num is by what %n will be replaced /// \param[in] padded_num is by what %N will be replaced /// \param[in] ext is by what %e will be replaced /// \param[in] context is by what %c will be replaced /// \return the substitued resulting string /// \note it now relies on tools_substitue extern std::string tools_hook_substitute(const std::string & hook, const std::string & path, const std::string & basename, const std::string & num, const std::string & padded_num, const std::string & ext, const std::string & context); /// execute and retries at user will a given command line /// \param[in] ui which way to ask the user whether to continue upon command line error /// \param[in] cmd_line the command line to execute extern void tools_hook_execute(user_interaction & ui, const std::string & cmd_line); /// subsititue and execute command line /// \param[in,out] ui this is the way to contact the user /// \param[in] hook the string in which to substitute /// \param[in] path is by what %p will be replaced /// \param[in] basename is by what %b will be replaced /// \param[in] num is by what %n will be replaced /// \param[in] padded_num is by what %N will be replaced /// \param[in] ext is by what %e will be replaced /// \param[in] context is by what %c will be replaced extern void tools_hook_substitute_and_execute(user_interaction & ui, const std::string & hook, const std::string & path, const std::string & basename, const std::string & num, const std::string & padded_num, const std::string & ext, const std::string & context); /// builds a regex from root directory and user provided regex to be applied to the relative path /// \param[in] prefix is the root portion of the path /// \param[in] relative_part is the user provided regex to be applied to the relative path /// \return the corresponding regex to be applied to full absolute path extern std::string tools_build_regex_for_exclude_mask(const std::string & prefix, const std::string & relative_part); /// convert string for xml output /// \note any < > & quote and double quote are replaced by adequate sequence for unicode /// \note second point, nothing is done here to replace system native strings to unicode extern std::string tools_output2xml(const std::string & src); /// convert octal string to integer /// \param perm is a string representing a number in octal (string must have a leading zero) /// \return the corresponding value as an integer extern U_I tools_octal2int(const std::string & perm); /// convert a number to a string corresponding to its octal representation /// \param perm is the octal number /// \return the corresponding octal string extern std::string tools_int2octal(const U_I & perm); /// convert a permission number into its string representation (rwxrwxrwx) extern std::string tools_get_permission_string(char type, U_32 perm, bool hard); /// change the permission of the file which descriptor is given /// \param[in] fd file's descriptor /// \param[in] perm file permission to set the file to extern void tools_set_permission(S_I fd, U_I perm); /// obtain the permission of the file which descriptor is given /// \param[in] fd file's descriptor /// \return permission of the given file /// \note in case of error exception may be thrown extern U_I tools_get_permission(S_I fd); /// change ownership of the file which descriptor is given /// convert string user name or uid to numeric uid value /// \param[in] user string username /// \return uid value extern uid_t tools_ownership2uid(const std::string & user); /// convert string group name or gid to numeric gid value /// \param[in] group string username /// \return uid value extern uid_t tools_ownership2gid(const std::string & group); /// change ownership of the file which descriptor is given /// \param[in] filedesc file's descriptor /// \param[in] slice_user the user to set the file to. For empty string, no attempts to change the user ownership is done /// \param[in] slice_group the group to set the file to. For empty string, no attempts to change the group ownership is done /// \note this call may throw Erange exception upon system error extern void tools_set_ownership(S_I filedesc, const std::string & slice_user, const std::string & slice_group); /// Produces in "dest" the XORed value of "dest" and "src" /// \param[in,out] dest is the area where to write down the result /// \param[in] src points to vector or array of values to convert /// \param[in] n is the number of byte to convert from src to dest /// \note dest *must* be a valid pointer to an allocated memory area of at least n bytes extern void tools_memxor(void *dest, const void *src, U_I n); /// Produces a list of TLV from a constant type and a list of string /// \param[in,out] dialog for user interaction /// \param[in] type is the type each TLV will have /// \param[in] data is the list of string to convert into a list of TLV /// \return a tlv_list object. Each TLV in the list correspond to a string in the given list extern tlv_list tools_string2tlv_list(user_interaction & dialog, const U_16 & type, const std::vector & data); /// Extract from anonymous pipe a tlv_list /// \param[in,out] dialog for user interaction /// \param[in] fd the filedescriptor for the anonymous pipe's read extremity /// \param[out] result the resulting tlv_list extern void tools_read_from_pipe(user_interaction & dialog, S_I fd, tlv_list & result); /// Produces a pseudo random number x, where 0 <= x < max /// \param[in] max defines the range of the random number to return /// \return the returned value ranges from 0 (zero) up to max (= including max) extern U_I tools_pseudo_random(U_I max); /// Template for the decomposition of any number in any base (decimal, octal, hexa, etc.) /// \param[in] number is the number to decompose /// \param[in] base is the base to decompose the number into /// \return a vector of 'digit' int the specified base, the first beeing the less significative /// \note this template does not take care of the possibily existing optimized euclide division to speed up the operation /// like what exists for infinint. A specific overriden fonction for this type would be better. /// \note, the name "big_endian" is erroneous, it gives a little endian vector template std::vector tools_number_base_decomposition_in_big_endian(N number, const B & base) { std::vector ret; if(base <= 0) throw Erange("tools_number_decoupe_in_big_endian", "base must be strictly positive"); while(number != 0) { ret.push_back(number % base); number /= base; } return ret; } /// convert a unsigned char into its hexa decima representation /// \param[in] x is the byte to convert /// \return the string representing the value of x written in hexadecimal std::string tools_unsigned_char_to_hexa(unsigned char x); /// convert a string into its hexadecima representation /// \param[in] input input string to convert /// \return a string containing an hexadecimal number corresponding to the bytes of the input string std::string tools_string_to_hexa(const std::string & input); /// Defines the CRC size to use for a given filesize /// \param[in] size is the size of the file to protect by CRC /// \return crc_size is the size of the crc to use extern infinint tools_file_size_to_crc_size(const infinint & size); /// return a string containing the Effective UID extern std::string tools_get_euid(); /// return a string containing the Effective UID extern std::string tools_get_egid(); /// return a string containing the hostname of the current host extern std::string tools_get_hostname(); /// return a string containing the current time (UTC) extern std::string tools_get_date_utc(); /// return the string about compression ratio extern std::string tools_get_compression_ratio(const infinint & storage_size, const infinint & file_size, bool compressed); /// wrapper routine to strerror_r extern std::string tools_strerror_r(int errnum); #ifdef GPGME_SUPPORT /// wrapper routint to gpgme_strerror_r extern std::string tools_gpgme_strerror_r(gpgme_error_t err); #endif #if HAVE_WCHAR_H /// convert a std::string to std::wstring (wide-string, aka string of wchar_t) extern std::wstring tools_string_to_wstring(const std::string & val); /// convert a std::wstring to std::string extern std::string tools_wstring_to_string(const std::wstring & val); #endif /// add in 'a', element of 'b' not already found in 'a' extern void tools_merge_to_vector(std::vector & a, const std::vector & b); /// remove from 'a' elements found in 'b' and return the resulting vector extern std::vector tools_substract_from_vector(const std::vector & a, const std::vector & b); /// allocate a new dirent structure for use with readdir_r /// /// \param[in] path_name is the path of to the directory (and its underlying filesystem) /// where the resulting dirent will be used. Depending on fileystem, the size of the dirent /// structure may vary it is necessary to know the directory where the corresponding files /// resides /// \param[in] pool whether to allocate the structure on a memory_pool or out of memory_pool /// which succeeds when pool is set to nullptr /// \return a pointer to the newly allocated dirent structure struct dirent *tools_allocate_struct_dirent(const std::string & path_name, memory_pool *pool = nullptr); /// release a dirent structure as allocated by tools_allocate_struct_dirent /// /// \param[in] ptr is the address of the structure to release extern void tools_release_struct_dirent(struct dirent *ptr); /// display the content of a secu_string, this function is only for trouble shooting! extern void tools_secu_string_show(user_interaction & dialog, const std::string & msg, const secu_string & key); template T tools_max(T a, T b) { return a > b ? a : b; } template T tools_min(T a, T b) { return a > b ? b : a; } } /// end of namespace #endif dar-2.5.3/src/libdar/cat_nomme.hpp0000644000175000017430000000461012641772777013736 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_nomme.hpp /// \brief base class of all objects contained in a catalogue and that can be named /// \ingroup Private #ifndef CAT_NOMME_HPP #define CAT_NOMME_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include #include "cat_entree.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the base class for all entry that have a name class cat_nomme : public cat_entree { public: cat_nomme(const std::string & name) { xname = name; }; cat_nomme(const pile_descriptor & pdesc, bool small); bool operator == (const cat_entree & ref) const; virtual bool operator < (const cat_nomme & ref) const { return xname < ref.xname; }; virtual ~cat_nomme() throw(Ebug) {}; const std::string & get_name() const { return xname; }; void change_name(const std::string & x) { xname = x; }; /// compares two objects /// /// \note no need to have a virtual method, as signature will differ in inherited classes (argument type changes) bool same_as(const cat_nomme & ref) const { return xname == ref.xname; }; // signature() is kept as an abstract method // clone() is also ketp abstract protected: void inherited_dump(const pile_descriptor & pdesc, bool small) const; private: std::string xname; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/archive_version.cpp0000644000175000017430000000735512641772777015166 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "archive_version.hpp" #include "erreurs.hpp" #include "tools.hpp" using namespace std; // value read from file when the file is full of '\0' #define EMPTY_VALUE (48*256 + 48) #define ARCHIVE_VER_SIZE 4 #define OLD_ARCHIVE_VER_SIZE 3 namespace libdar { const archive_version empty_archive_version() { return archive_version(EMPTY_VALUE); } archive_version::archive_version(U_16 x, unsigned char x_fix) { if(x > EMPTY_VALUE) throw Efeature(gettext("Archive version too high, use a more recent version of libdar")); else { version = x; fix = x_fix; } } void archive_version::dump(generic_file & f) const { unsigned char tmp[ARCHIVE_VER_SIZE]; tmp[0] = version / 256; tmp[1] = version % 256; tmp[2] = fix; tmp[3] = '\0'; for(U_I i = 0; i < 3; ++i) tmp[i] = to_char(tmp[i]); (void)f.write((char *)tmp, sizeof(tmp)); } void archive_version::read(generic_file & f) { unsigned char tmp[OLD_ARCHIVE_VER_SIZE]; U_I lu = f.read((char *)tmp, sizeof(tmp)); if(lu < sizeof(tmp)) throw Erange("archive_version::read", gettext("Reached End of File while reading archive version")); for(U_I i = 0; i < 2; ++i) tmp[i] = to_digit(tmp[i]); version = tmp[0]*256+tmp[1]; // little endian used in file // sanity checks if(version < 8) { if(tmp[2] != '\0') throw Erange("archive_version::read", gettext("Unexpected value while reading archive version")); } else // version >= 8 { fix = to_digit(tmp[2]); lu = f.read((char *)tmp, 1); if(lu < 1) throw Erange("archive_version::read", gettext("Reached premature end of file while reading archive version")); if(tmp[0] != '\0') throw Erange("archive_version::read", gettext("Unexpected value while reading archive version")); } } string archive_version::display() const { string ret = tools_uword2str(version); if(ret.size() < 2) ret = string("0") + ret; if(fix > 0) { ret += "." + tools_uword2str((U_16)(fix)); // this is intentional that only few values may be supported, as the fix number // should not grow very much (fix < 10) between two major releases // so far it was needed only once for more 8 major released (well it did not // this feature did not exist at that time, thus I had to shift by one the // in development code some of the revision test, which took time and was error prone). // so, never again. } return ret; } unsigned char archive_version::to_digit(unsigned char val) { if(val < 48) return val + 208; else return val - 48; } unsigned char archive_version::to_char(unsigned char val) { if(val < 208) return val + 48; else return val - 208; } } // end of namespace dar-2.5.3/src/libdar/generic_to_global_file.hpp0000644000175000017430000000764712641772777016446 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file generic_to_global_file.hpp /// \brief this class provides an fichier_global interface for any type of generic_file object /// /// the main use is to be able to have hash_fichier working on other type of objects /// than fichier_global. The drawback is that all file specific operation is ignored /// (file ownership, permission...). The other point is the get_size() method which returns /// the current position of the read or write cursor, not the total available amount of data /// \ingroup Private #ifndef GENERIC_TO_GLOBAL_FILE_HPP #define GENERIC_TO_GLOBAL_FILE_HPP #include "fichier_global.hpp" #include "memory_file.hpp" #include "storage.hpp" namespace libdar { /// \addtogroup Private /// @{ class generic_to_global_file : public fichier_global { public: /// Constructors & Destructor /// /// \param[in] dialog for user interaction /// \param[in] d pointer to the generic_file object to provide a fichier_global interface to. /// \note the pointed to generic_file object must survive the whole live of the generic_to_gloabl_file. This generic_file is not owned nor deleted by the generic_to_global_file object that points to it. generic_to_global_file(user_interaction & dialog, generic_file *d, gf_mode mode): fichier_global(dialog, mode) { if(d == nullptr) throw SRC_BUG; if(d->get_mode() != gf_read_write && d->get_mode() != mode) throw SRC_BUG; data = d; }; // virtual method inherited from generic_file bool skippable(skippability direction, const infinint & amount) { return data->skippable(direction, amount); } bool skip(const infinint & pos) { return data->skip(pos); }; bool skip_to_eof() { return data->skip_to_eof(); }; bool skip_relative(S_I x) { return data->skip_relative(x); }; infinint get_position() const { return data->get_position(); }; // virtual method inherited from fichier_global void change_ownership(const std::string & user, const std::string & group) {}; void change_permission(U_I perm) {}; infinint get_size() const { return data->get_position(); }; //< yes, this is the drawback of this template class convertion, get_size() does not return the real size of the object void fadvise(advise adv) const {}; protected: // virtual method inherited from generic_file void inherited_read_ahead(const infinint & amount) {}; // no optimization can be done here, we rely on the OS here void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate() {}; // inherited from fichier_global U_I fichier_global_inherited_write(const char *a, U_I size) { data->write(a, size); return size; }; bool fichier_global_inherited_read(char *a, U_I size, U_I & read, std::string & message) { read = data->read(a, size); message = "THIS IS A BUG IN GENERIC_TO_GLOBAL_FILE, PLEASE REPORT TO THE MAINTAINER!"; return true; }; private: generic_file *data; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/ea.cpp0000644000175000017520000001146312610415372012335 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "ea.hpp" #include "tools.hpp" #include "integers.hpp" #include "infinint.hpp" // these MACRO are used only when dumping in file (obsolete since archive format "05") #define EA_ROOT 0x80 #define EA_DEL 0x40 #define EA_DEFAULT_USER_INSERT 0x00 using namespace std; namespace libdar { ///////////// STATIC FUNCTION DECLARATION /////////// static void read_pair_string(generic_file & f, const archive_version & edit, string & key, string & val); static void write_pair_key(generic_file & f, const string & key, const string & val); ///////////// EA_ATTRIBUTS IMPLEMENTATION ////////// ea_attributs::ea_attributs(generic_file & f, const archive_version & edit) { infinint tmp = infinint(f); // number of EA string key, val; U_32 tmp2 = 0; tmp.unstack(tmp2); do { while(tmp2 > 0) { read_pair_string(f, edit, key, val); attr[key] = val; tmp2--; } tmp.unstack(tmp2); } while(tmp2 > 0); alire = attr.begin(); } ea_attributs::ea_attributs(const ea_attributs & ref) { attr = ref.attr; alire = attr.begin(); } void ea_attributs::dump(generic_file & f) const { map::const_iterator it = attr.begin(); size().dump(f); while(it != attr.end()) { write_pair_key(f, it->first, it->second); it++; } } void ea_attributs::reset_read() const { ea_attributs *moi = const_cast(this); moi->alire = moi->attr.begin(); } bool ea_attributs::read(string & key, string & value) const { ea_attributs *moi = const_cast(this); if(alire != attr.end()) { key = alire->first; value = alire->second; ++(moi->alire); return true; } else return false; } bool ea_attributs::diff(const ea_attributs & other, const mask & filter) const { string key; string val; string value; bool diff = false; reset_read(); while(!diff && read(key, val)) if(filter.is_covered(key)) { if(!other.find(key, value) || value != val) // not found or different diff = true; } return diff; } bool ea_attributs::find(const string & key, string & found_value) const { map::const_iterator it = attr.find(key); if(it != attr.end()) { found_value = it->second; if(it->first != key) throw SRC_BUG; return true; } else return false; } infinint ea_attributs::space_used() const { map::const_iterator it = attr.begin(); infinint ret = 0; while(it != attr.end()) { ret += it->first.size() + it->second.size(); ++it; } return ret; } ea_attributs ea_attributs::operator + (const ea_attributs & arg) const { ea_attributs ret = *this; // copy constructor string key, value; arg.reset_read(); while(arg.read(key, value)) ret.add(key, value); return ret; } ///////////// STATIC FUNCTION IMPLEMENTATION /////// static void read_pair_string(generic_file & f, const archive_version & edit, string & key, string & val) { infinint tmp; unsigned char fl; string pre_key = ""; if(edit < 5) // old format { f.read((char *)(&fl), 1); if((fl & EA_ROOT) != 0) pre_key = "system."; else pre_key = "user."; } tools_read_string(f, key); key = pre_key + key; tmp = infinint(f); tools_read_string_size(f, val, tmp); } static void write_pair_key(generic_file & f, const string & key, const string & val) { infinint tmp = val.size(); tools_write_string(f, key); tmp.dump(f); tools_write_string_all(f, val); } } // end of namespace dar-2.5.3/src/libdar/criterium.hpp0000644000175000017430000005401512642474445013773 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file criterium.hpp /// \brief contains classes that let the user define the policy for overwriting files /// \ingroup API #ifndef CRITERIUM_HPP #define CRITERIUM_HPP #include "../my_config.h" #include "on_pool.hpp" #include "cat_nomme.hpp" #include "cat_inode.hpp" #include "cat_directory.hpp" namespace libdar { /// \addtogroup API /// @{ /// the possible actions for overwriting data enum over_action_data { data_preserve, //< do not overwrite (keep the 'in place' entry) data_overwrite, //< overwirte the 'in place' entry by the 'to be added' one data_preserve_mark_already_saved, //< keep the 'in place' but mark it as already saved in the archive of reference data_overwrite_mark_already_saved, //< overwrite the 'in place' but mark the 'to be added' as already saved in the archive of reference data_remove, //< remove the original data/EA (file is completely deleted) data_undefined, //< action still undefined at this step of the evaluation data_ask //< ask for user decision about file's data }; /// the possible action for overwriting EA enum over_action_ea //< define the action to apply to each EA entry (not to the EA set of a particular inode) { EA_preserve, //< keep the EA of the 'in place' entry EA_overwrite, //< keep the EA of the 'to be added' entry EA_clear, //< drop the EA for the elected entry EA_preserve_mark_already_saved, //< drop any EA but mark them as already saved in the archive of reference (ctime is the one of the 'in place' inode) EA_overwrite_mark_already_saved, //< drop any EA but mark them as already saved in the archive of reference (ctime is the one of the 'to be added' inode) EA_merge_preserve, //< merge EA but do not overwrite existing EA of 'in place' by one of the same name of 'to be added' inode EA_merge_overwrite, //< merge EA but if both inode share an EA with the same name, take keep the one of the 'to be added' inode EA_undefined, //< action still undefined at this step of the evaluation EA_ask //< ask for user decision about EA }; /// the global action for overwriting /// this class is a generic interface to handle what action to perform on both EA and Data /// based on two files to evaluate. class crit_action: public on_pool { public: /// the destructor virtual ~crit_action() {}; /// the action to take based on the files to compare /// \param[in] first is the 'in place' inode /// \param[in] second is the 'to be added' inode /// \param[out] data is the action to perform with file's data /// \param[out] ea is the action to perform with file's EA virtual void get_action(const cat_nomme & first, const cat_nomme & second, over_action_data & data, over_action_ea & ea) const = 0; /// clone construction method /// \return a new object of the same type, /// \note this method must be implemented in all the leaf classes of the /// action hierarchy class virtual crit_action *clone() const = 0; }; /// the basic constant action /// the resulting action is not dependant on the files to compare /// it always returns the action provided through its constructor class crit_constant_action : public crit_action { public: /// the constuctor /// \param[in] data the action to perform on data /// \param[in] ea the action to perform on EA crit_constant_action(over_action_data data, over_action_ea ea) { x_data = data; x_ea = ea; }; /// the inherited pure virtual methods from class action that must be implemented void get_action(const cat_nomme & first, const cat_nomme & second, over_action_data & data, over_action_ea & ea) const { data = x_data; ea = x_ea; }; crit_action *clone() const { return new (get_pool()) crit_constant_action(*this); }; private: over_action_data x_data; over_action_ea x_ea; }; /// the generic criterium class, parent of all criterium /// this is a pure virtual class that is used in API call /// it is used to federate under a single type all the /// criterium classes defined below. It defines a common /// interface for all of them. class criterium : public on_pool { public: virtual ~criterium() throw(Ebug) {}; /// criterum interface method /// \param[in] first entry to compare with the following (this is the original or 'in place' entry) /// \param[in] second the other entry to compare with the previous one (this is the new entry to add) /// \return the result of the criterium evaluation (true or false) virtual bool evaluate(const cat_nomme &first, const cat_nomme &second) const = 0; /// clone construction method /// \return a new object of the same type, /// \note this method must be implemented in all the leaf classes of the /// class hierarchy rooted at the criterium class virtual criterium *clone() const = 0; protected: static const cat_inode *get_inode(const cat_nomme * arg); }; /// the testing class binds criterium to actions /// a testing class is also an action that let the user build complex /// testing. It is thus possible to recursively use testing inside testing class testing : public crit_action { public: /// the constructor /// \param[in] input is the criterium to base the evaluation on /// \param[in] go_true is the action to use for evaluation if the criterium states true /// \param[in] go_false is the action to use for evaluation if the criterium states false testing(const criterium & input, const crit_action & go_true, const crit_action & go_false); testing(const testing & ref) : crit_action(ref) { copy_from(ref); if(!check()) throw Ememory("testing::testing(const testing &)"); }; const testing & operator = (const testing & ref) { free(); copy_from(ref); if(!check()) throw Ememory("testing::testing(const testing &)"); return *this; }; ~testing() { free(); }; /// the inherited pure virtual method from class action that must be gimplemented void get_action(const cat_nomme & first, const cat_nomme & second, over_action_data & data, over_action_ea & ea) const { if(x_input->evaluate(first, second)) x_go_true->get_action(first, second, data, ea); else x_go_false->get_action(first, second, data, ea); }; crit_action *clone() const { return new (get_pool()) testing(*this); }; private: criterium *x_input; crit_action *x_go_true; crit_action *x_go_false; void free(); void copy_from(const testing & ref); bool check() const; //< returns false if an field is nullptr }; /// the crit_chain class sequences crit_actions up to full definition of the action /// several expressions must be added. The first is evaluated, then the second, up to the last /// or up to the step the data_action and ea_action are both fully defined (no data_undefined nor ea_undefined) class crit_chain : public crit_action { public: crit_chain() { sequence.clear(); }; crit_chain(const crit_chain & ref) : crit_action(ref) { copy_from(ref); }; const crit_chain & operator = (const crit_chain & ref) { destroy(); copy_from(ref); return *this; }; ~crit_chain() { destroy(); }; void add(const crit_action & act); void clear() { destroy(); }; void gobe(crit_chain & to_be_voided); void get_action(const cat_nomme & first, const cat_nomme & second, over_action_data & data, over_action_ea & ea) const; crit_action *clone() const { return new (get_pool()) crit_chain(*this); }; private: std::vector sequence; void destroy(); void copy_from(const crit_chain & ref); }; //////////////////////////////////////////////////////////// //////////// a set of criterium classes follows //////////// //////////////////////////////////////////////////////////// /// returns true if the first entry is an inode (whatever is the second) /// \note the current only entry that can be found in an archive which is not an inode, is an entry /// signaling that a file has been destroyed since the archive of reference. class crit_in_place_is_inode : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_is_inode(*this); }; }; /// returns true if the first entry is a cat_directory (whatever is the second) class crit_in_place_is_dir : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const { return dynamic_cast(&first) != nullptr; }; criterium *clone() const { return new (get_pool()) crit_in_place_is_dir(*this); }; }; /// returns true if the first entry is a plain file (whatever is the second) class crit_in_place_is_file : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_is_file(*this); }; }; /// returns true if the first entry is a inode with several hard links (whatever is the second entry) /// it may be a plain file, a symlink a char device, a block device or a named pipe for example class crit_in_place_is_hardlinked_inode : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_is_hardlinked_inode(*this); }; }; /// returns true if the first entry is a inode with several hard links (whatever is the second entry) and also if this first entry is the first we meet that points to this hard linked inode class crit_in_place_is_new_hardlinked_inode : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_is_new_hardlinked_inode(*this); }; }; /// returns true if the data of the first entry is more recent or of the same date of the one of the second entry /// this class always returns false if both entry are not inode. Comparison is done on mtime class crit_in_place_data_more_recent : public criterium { public: crit_in_place_data_more_recent(const infinint & hourshift = 0) : x_hourshift(hourshift) {}; bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_data_more_recent(*this); }; private: infinint x_hourshift; }; /// returns true if the data of the first entry is more recent or of the same date as the fixed date given in argument to the constructor /// If the in_place entry is not an inode its date is considered equal to zero. Comparison is done on mtime class crit_in_place_data_more_recent_or_equal_to : public criterium { public: crit_in_place_data_more_recent_or_equal_to(const infinint & date, const infinint & hourshift = 0) : x_hourshift(hourshift), x_date(date) {}; bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_data_more_recent_or_equal_to(*this); }; private: infinint x_hourshift; infinint x_date; }; /// returns true if the data of the first entry is bigger or equal to the one of the second entry /// this class always returns false if both entries are not plain files class crit_in_place_data_bigger : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_data_bigger(*this); }; }; /// returns true if the data of the first entry is saved int the archive (not marked as unchanged since the archive of reference) /// if the entry is not an inode the result is also true class crit_in_place_data_saved : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_data_saved(*this); }; }; /// return true if the entry is a dirty file (or hard linked dirty file) class crit_in_place_data_dirty : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_data_dirty(*this); }; }; /// return true if the entry is a sparse file (or hard linked sparse file) class crit_in_place_data_sparse : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_data_sparse(*this); }; }; /// returns true if the first entry is first an inode, and has some EA (EA may be saved /// or just recorded as existing). class crit_in_place_EA_present : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *tmp = dynamic_cast(&first); return tmp != nullptr && tmp->ea_get_saved_status() != cat_inode::ea_none && tmp->ea_get_saved_status() != cat_inode::ea_removed; }; criterium *clone() const { return new (get_pool()) crit_in_place_EA_present(*this); }; }; /// returns true if the EA of the first entry is more recent or equal to the one of the second entry /// if no EA are present in 'to be added' or if it even not an inode true is returned. If 'in place' /// does not have EA or is even not an inode true is returned unless 'to be added' has EA present. /// \note that the comparison is done on the ctime, EA may be just marked as saved in the archive of /// reference or be saved in the current archive, this does not have any impact on the comparison. class crit_in_place_EA_more_recent : public criterium { public: crit_in_place_EA_more_recent(const infinint & hourshift = 0) : x_hourshift(hourshift) {}; bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_EA_more_recent(*this); }; private: infinint x_hourshift; }; /// returns true if the EA of the first entry is more recent or equal to the fixed date given in argument to the constructor /// comparison using ctime of the "in place" object. If no ctime is available (not an inode for example) /// the date is considered equal to zero. class crit_in_place_EA_more_recent_or_equal_to : public criterium { public: crit_in_place_EA_more_recent_or_equal_to(const infinint & date, const infinint & hourshift = 0) : x_hourshift(hourshift), x_date(date) {}; bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_EA_more_recent_or_equal_to(*this); }; private: infinint x_hourshift; infinint x_date; }; /// returns true if the first entry has more or even EA (in number not in size) than the second entry /// if an entry is not an inode or has no EA it is assumed it has zero EA, the comparison is done on that number. class crit_in_place_more_EA : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_more_EA(*this); }; }; /// returns true if the space used by EA of the first entry is greater or equal to the space used by the EA of the second entry (no EA means 0 byte for EA storage) /// this criterium does not have any consideration for the second entry class crit_in_place_EA_bigger : public crit_in_place_more_EA { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_EA_bigger(*this); }; }; /// returns true if the in place entry has its EA saved (not just marked as saved) in the archve of reference /// this criterium does not have any consideration for the second entry class crit_in_place_EA_saved : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_in_place_EA_saved(*this); }; }; /// returns true if the two entries are of the same type (plain-file/char dev/block dev/named pipe/symlink/directory/unix socket) /// two plain files are considered of same type even if one is hard linked while the other is not /// same thing whether one entry has EA while the other has not, they are still considered of the same type. class crit_same_type : public criterium { public: bool evaluate(const cat_nomme &first, const cat_nomme &second) const; criterium *clone() const { return new (get_pool()) crit_same_type(*this); }; }; /// realises the negation of the criterium given in argument to its constructor class crit_not : public criterium { public: crit_not(const criterium & crit) { x_crit = crit.clone(); if(x_crit == nullptr) throw Ememory("crit_not::crit_not"); }; crit_not(const crit_not & ref) : criterium (ref) { copy_from(ref); }; const crit_not & operator = (const crit_not & ref) { destroy(); copy_from(ref); return *this; }; ~crit_not() { destroy(); }; bool evaluate(const cat_nomme & first, const cat_nomme & second) const { return ! x_crit->evaluate(first, second); }; criterium *clone() const { return new (get_pool()) crit_not(*this); }; protected: const criterium *x_crit; private: void copy_from(const crit_not & ref); void destroy() { if(x_crit != nullptr) { delete x_crit; x_crit = nullptr; } }; }; /// realises the *AND* operator class crit_and : public criterium { public: crit_and() { clear(); }; crit_and(const crit_and & ref) : criterium(ref) { copy_from(ref); }; const crit_and & operator = (const crit_and & ref) { detruit(); copy_from(ref); return *this; }; ~crit_and() { detruit(); }; void add_crit(const criterium & ref); void clear() { detruit(); }; /// this call merges to the current call the arguments of another "crit_and", the given argument is cleared of its arguments. void gobe(crit_and & to_be_voided); virtual bool evaluate(const cat_nomme & first, const cat_nomme & second) const; criterium *clone() const { return new (get_pool()) crit_and(*this); }; protected: std::vector operand; private: void copy_from(const crit_and & ref); void detruit(); }; class crit_or : public crit_and { public: crit_or() { clear(); }; bool evaluate(const cat_nomme & first, const cat_nomme & second) const; criterium *clone() const { return new (get_pool()) crit_or(*this); }; }; class crit_invert : public crit_not { public: crit_invert(const criterium & crit) : crit_not(crit) {}; bool evaluate(const cat_nomme & first, const cat_nomme & second) const { return x_crit->evaluate(second, first); }; criterium *clone() const { return new (get_pool()) crit_invert(*this); }; }; /// ask user for EA action /// \param[in] dialog for user interaction /// \param[in] full_name full path to the entry do ask decision for /// \param[in] already_here pointer to the object 'in place' /// \param[in] dolly pointer to the object 'to be added' /// \return the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception extern over_action_ea crit_ask_user_for_EA_action(user_interaction & dialog, const std::string & full_name, const cat_entree *already_here, const cat_entree *dolly); /// ask user for FSA action /// \param[in] dialog for user interaction /// \param[in] full_name full path to the entry do ask decision for /// \param[in] already_here pointer to the object 'in place' /// \param[in] dolly pointer to the object 'to be added' /// \return the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception extern over_action_ea crit_ask_user_for_FSA_action(user_interaction & dialog, const std::string & full_name, const cat_entree *already_here, const cat_entree *dolly); /// ask user for Data action /// \param[in] dialog for user interaction /// \param[in] full_name full path to the entry do ask decision for /// \param[in] already_here pointer to the object 'in place' /// \param[in] dolly pointer to the object 'to be added' /// \return the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception extern over_action_data crit_ask_user_for_data_action(user_interaction & dialog, const std::string & full_name, const cat_entree *already_here, const cat_entree *dolly); /// show information suited for user comparison and decision for entry in conflict /// \param[in] dialog for user interaction /// \param[in] full_name path to the entry of the entry to display information /// \param[in] already_here pointer to the object 'in place' /// \param[in] dolly pointer to the object 'to be added' extern void crit_show_entry_info(user_interaction & dialog, const std::string & full_name, const cat_entree *already_here, const cat_entree *dolly); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/hash_fichier.hpp0000644000175000017430000001167212641772777014416 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file hash_fichier.hpp /// \brief class hash_fichier definition. /// \ingroup Private /// /// This is an inherited class from class fichier /// Objects of that class are write-only objects that provide a hash of the written data /// other hash algorithm may be added in the future #ifndef HASH_FICHIER_HPP #define HASH_FICHIER_HPP #include "../my_config.h" extern "C" { #if HAVE_GCRYPT_H #ifndef GCRYPT_NO_DEPRECATED #define GCRYPT_NO_DEPRECATED #endif #include #endif } #include #include "generic_file.hpp" #include "fichier_global.hpp" #include "integers.hpp" namespace libdar { /// the available hashing algorithms /// \ingroup API enum hash_algo { hash_none, //< no hashing algorithm hash_md5, //< MD5 algorithm hash_sha1, //< SHA1 algorithm hash_sha512 //< SHA-512 algorithm }; /// \addtogroup Private /// @{ extern std::string hash_algo_to_string(hash_algo algo); class hash_fichier : public fichier_global { public: /// hash_file constructor /// /// \param[in] dialog for user interaction /// \param[in] under points to an object where to write data to /// \param[in] under_filename name of the plain file we write to, this argument is required to build the hash file /// \param[in] hash_file points to an object where to drop the hash file once writings are finished /// \param[in] algo hash algorithm to use. hash_none is not an acceptable value /// \note if the constructor succeed, the objects pointed to by under and hash_file are owned and deleted by this hash_file object hash_fichier(user_interaction & dialog, fichier_global *under, const std::string & under_filename, fichier_global *hash_file, hash_algo algo); // copy constructor hash_fichier(const hash_fichier & ref) : fichier_global(ref) { throw SRC_BUG; }; // assignment operator const hash_fichier & operator = (const hash_fichier & ref) { throw SRC_BUG; }; // destructor ~hash_fichier(); // inherited from fichier_global void change_ownership(const std::string & user, const std::string & group) { if(ref == nullptr || hash_ref == nullptr) throw SRC_BUG; ref->change_ownership(user, group); hash_ref->change_ownership(user, group); }; void change_permission(U_I perm) { if(ref == nullptr || hash_ref == nullptr) throw SRC_BUG; ref->change_permission(perm); hash_ref->change_permission(perm); }; infinint get_size() const { if(ref == nullptr) throw SRC_BUG; return ref->get_size(); }; void fadvise(advise adv) const { if(ref == nullptr) throw SRC_BUG; ref->fadvise(adv); }; // inherited from generic_file bool skippable(skippability direction, const infinint & amount) { return false; }; bool skip(const infinint & pos) {if(ref == nullptr || pos != ref->get_position()) throw SRC_BUG; else return true; }; bool skip_to_eof() { if(get_mode() == gf_write_only) return true; else throw SRC_BUG; }; bool skip_relative(S_I x) { if(x != 0) throw SRC_BUG; else return true; }; infinint get_position() const { if(ref == nullptr) throw SRC_BUG; return ref->get_position(); }; /// for debugging purposes only void set_only_hash() { only_hash = true; }; protected: // inherited from fichier_global void inherited_read_ahead(const infinint & amount) { ref->read_ahead(amount); }; U_I fichier_global_inherited_write(const char *a, U_I size); bool fichier_global_inherited_read(char *a, U_I size, U_I & read, std::string & message); // inherited from generic_file void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate(); private: fichier_global *ref; fichier_global *hash_ref; bool only_hash; //< if set, avoids copying data to file, only compute hash (debugging purpose) #if CRYPTO_AVAILABLE gcry_md_hd_t hash_handle; #endif std::string ref_filename; U_I hash_gcrypt; bool eof; bool hash_dumped; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cache.cpp0000644000175000017430000002313212641772777013032 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_LIMITS_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } #include "cache.hpp" using namespace std; namespace libdar { cache::cache(generic_file & hidden, bool shift_mode, U_I x_size) : generic_file(hidden.get_mode()) // except if hidden is read-only we provide read-write facility in // the cache, for what is out of the cache we check // the underlying object mode { // sanity checks if(x_size < 10) throw Erange("cache::cache", gettext("wrong value given as initial_size argument while initializing cache")); ref = & hidden; buffer = nullptr; alloc_buffer(x_size); next = 0; last = 0; first_to_write = size; buffer_offset = ref->get_position(); shifted_mode = shift_mode; } cache::~cache() { try { flush_write(); } catch(...) { // ignore all exceptions } release_buffer(); } bool cache::skippable(skippability direction, const infinint & amount) { infinint in_cache = available_in_cache(direction); // either available data is enough to assure skippability or we // calculate the direction and amount to ask to the lower layer (ref) if(in_cache >= amount) return true; else { switch(direction) { case skip_forward: if(ref->get_position() <= buffer_offset) return ref->skippable(direction, buffer_offset - ref->get_position() + next + amount); else { infinint backw = ref->get_position() - buffer_offset; infinint forw = amount + next; if(backw >= forw) return ref->skippable(skip_backward, backw - forw); else return ref->skippable(skip_forward, forw - backw); } case skip_backward: if(ref->get_position() >= buffer_offset) { infinint backw = ref->get_position() - buffer_offset + amount; infinint forw = next; if(backw >= forw) return ref->skippable(skip_backward, backw - forw); else return ref->skippable(skip_forward, forw - backw); } else { infinint backw = amount; infinint forw = buffer_offset - ref->get_position() + next; if(backw >= forw) return ref->skippable(skip_backward, backw - forw); else return ref->skippable(skip_forward, forw - backw); } default: throw SRC_BUG; } } } bool cache::skip(const infinint & pos) { if(is_terminated()) throw SRC_BUG; if(pos >= buffer_offset && pos <= buffer_offset + last) { // skipping inside the buffer is possible infinint tmp_next = pos - buffer_offset; // assigning to next its new value to reflect the skip() operation next = 0; tmp_next.unstack(next); if(!tmp_next.is_zero()) throw SRC_BUG; return true; } else // skipping would lead the current position to be outside the buffer { bool ret; if(need_flush_write()) flush_write(); next = last = 0; ret = ref->skip(pos); buffer_offset = ref->get_position(); return ret; } } bool cache::skip_to_eof() { bool ret; if(is_terminated()) throw SRC_BUG; if(need_flush_write()) flush_write(); next = last = 0; ret = ref->skip_to_eof(); buffer_offset = ref->get_position(); return ret; } bool cache::skip_relative(S_I x) { skippability dir = x >= 0 ? skip_forward : skip_backward; U_I in_cache = available_in_cache(dir); U_I abs_x = x >= 0 ? x : -x; if(is_terminated()) throw SRC_BUG; if(abs_x <= in_cache) // skipping within cache { next += x; // note that x is a *signed* integer // sanity checks if(next > last) throw SRC_BUG; return true; } else // must replace data in cache to skip { if(need_flush_write()) flush_write(); switch(dir) { case skip_forward: return skip(buffer_offset + abs_x); case skip_backward: if(buffer_offset < abs_x) return false; else return skip(buffer_offset - abs_x); default: throw SRC_BUG; } } } U_I cache::inherited_read(char *a, U_I x_size) { U_I ret = 0; bool eof = false; do { if(next >= last) // no more data to read from cache { if(need_flush_write()) flush_write(); if(x_size - ret < size) { fulfill_read(); // may fail if underlying is write_only (exception thrown) if(next >= last) // could not read anymore data eof = true; } else // reading the remaining directly from lower layer { ret += ref->read(a + ret, x_size - ret); // may fail if underlying is write_only if(ret < x_size) eof = true; clear_buffer(); // force clearing whatever is shifted_mode buffer_offset = ref->get_position(); } } if(!eof && ret < x_size) { U_I needed = x_size - ret; U_I avail = last - next; U_I min = avail > needed ? needed : avail; if(min > 0) { (void)memcpy(a+ret, buffer + next, min); ret += min; next += min; } else throw SRC_BUG; } } while(ret < x_size && !eof); return ret; } void cache::inherited_write(const char *a, U_I x_size) { U_I wrote = 0; U_I avail, remaining; while(wrote < x_size) { avail = size - next; if(avail == 0) // we need to flush the cache { if(need_flush_write()) flush_write(); // may fail if underlying is read_only avail = size - next; } remaining = x_size - wrote; if(avail < remaining && !need_flush_write()) { // less data in cache than to be wrote and no write pending data in cache // we write directly to the lower layer buffer_offset += next; next = last = 0; ref->skip(buffer_offset); ref->write(a + wrote, remaining); // may fail if underlying is read_only wrote = x_size; buffer_offset += remaining; } else // filling cache with data { U_I min = remaining < avail ? remaining : avail; if(first_to_write >= last) first_to_write = next; (void)memcpy(buffer + next, a + wrote, min); wrote += min; next += min; if(last < next) last = next; } } } void cache::alloc_buffer(size_t x_size) { if(buffer != nullptr) throw SRC_BUG; if(get_pool() != nullptr) buffer = (char *)get_pool()->alloc(x_size); else buffer = new (nothrow) char[x_size]; if(buffer == nullptr) throw Ememory("cache::alloc_buffer"); size = x_size; } void cache::release_buffer() { if(buffer == nullptr) throw SRC_BUG; if(get_pool() != nullptr) get_pool()->release(buffer); else delete [] buffer; buffer = nullptr; size = 0; } void cache::shift_by_half() { U_I half = last / 2; U_I reste = last % 2; if(next < half) return; // current position would be out of the buffer so we don't shift if(first_to_write < half) throw SRC_BUG; if(last > 1) { (void)memmove(buffer, buffer + half, half + reste); if(need_flush_write()) first_to_write -= half; else first_to_write = size; next -= half; last -= half; } buffer_offset += half; } void cache::clear_buffer() { if(need_flush_write()) throw SRC_BUG; buffer_offset += next; next = last = 0; } void cache::flush_write() { if(get_mode() == gf_read_only) return; // nothing to flush // flushing the cache if(need_flush_write()) // we have something to flush { ref->skip(buffer_offset + first_to_write); ref->write(buffer + first_to_write, last - first_to_write); } first_to_write = size; if(shifted_mode) shift_by_half(); else clear_buffer(); } void cache::fulfill_read() { U_I lu; if(get_mode() == gf_write_only) return; // nothing to fill // flushing / shifting the cache contents to make room to receive new data if(shifted_mode) shift_by_half(); else clear_buffer(); /////// // some data may remain in the cache, we need to preserve them !!! // this occurres when a shift by half of the buffer has been done just before /////// ref->skip(buffer_offset + last); lu = ref->read(buffer + last, size - last); // may fail if underlying is write_only last += lu; } U_I cache::available_in_cache(skippability direction) const { U_I ret; switch(direction) { case skip_forward: ret = last - next; break; case skip_backward: ret = next; break; default: throw SRC_BUG; } return ret; } } // end of namespace dar-2.5.3/src/libdar/fsa_family.cpp0000644000175000017430000000675212641772777014112 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } #include "erreurs.hpp" #include "tools.hpp" #include "fsa_family.hpp" using namespace std; namespace libdar { string fsa_family_to_string(fsa_family f) { switch(f) { case fsaf_hfs_plus: return "HFS+"; case fsaf_linux_extX: return "ext2/3/4"; default: throw SRC_BUG; } } string fsa_nature_to_string(fsa_nature n) { switch(n) { case fsan_unset: throw SRC_BUG; case fsan_creation_date: return gettext("creation date"); case fsan_append_only: return gettext("append only"); case fsan_compressed: return gettext("compressed"); case fsan_no_dump: return gettext("no dump flag"); case fsan_immutable: return gettext("immutable"); case fsan_data_journaling: return gettext("journalized"); case fsan_secure_deletion: return gettext("secure deletion"); case fsan_no_tail_merging: return gettext("no tail merging"); case fsan_undeletable: return gettext("undeletable"); case fsan_noatime_update: return gettext("no atime update"); case fsan_synchronous_directory: return gettext("synchronous directory"); case fsan_synchronous_update: return gettext("synchronous update"); case fsan_top_of_dir_hierarchy: return gettext("top of directory hierarchy"); default: throw SRC_BUG; } } fsa_scope all_fsa_families() { fsa_scope ret; ret.insert(fsaf_hfs_plus); ret.insert(fsaf_linux_extX); return ret; } const U_I FSA_SCOPE_BIT_HFS_PLUS = 1; const U_I FSA_SCOPE_BIT_LINUX_EXTX = 2; infinint fsa_scope_to_infinint(const fsa_scope & val) { infinint ret = 0; if(val.find(fsaf_hfs_plus) != val.end()) ret |= FSA_SCOPE_BIT_HFS_PLUS; if(val.find(fsaf_linux_extX) != val.end()) ret |= FSA_SCOPE_BIT_LINUX_EXTX; return ret; } fsa_scope infinint_to_fsa_scope(const infinint & ref) { fsa_scope ret; ret.clear(); if((ref & FSA_SCOPE_BIT_HFS_PLUS) != 0) ret.insert(fsaf_hfs_plus); if((ref & FSA_SCOPE_BIT_LINUX_EXTX) != 0) ret.insert(fsaf_linux_extX); return ret; } string fsa_scope_to_string(bool saved, const fsa_scope & scope) { string ret = ""; // first letter if(scope.find(fsaf_hfs_plus) != scope.end()) if(saved) ret += "H"; else ret += "h"; else ret += "-"; // second letter if(scope.find(fsaf_linux_extX) != scope.end()) if(saved) ret += "L"; else ret += "l"; else ret += "-"; return ret; } } // end of namespace dar-2.5.3/src/libdar/libdar.pc.tmpl.in0000644000175000017430000000046212641772777014425 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libdar Description: Disk ARchive library Requires: Version: #LIBDAR_VERSION# Libs: -L${libdir} -ldar#LIBDAR_SUFFIX# @LIBS@ @GPGME_LIBS@ #CXXSTDFLAGS# Cflags: -I${includedir} #LIBDAR_MODE# @GPGME_CFLAGS@ #CXXSTDFLAGS# dar-2.5.3/src/libdar/filesystem_specific_attribute.cpp0000644000175000017430000007653412641773016020104 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #ifdef LIBDAR_NODUMP_FEATURE #if HAVE_SYS_IOCTL_H #include #endif #if LIBDAR_NODUMP_FEATURE == NODUMP_LINUX #include #else #if LIBDAR_NODUMP_FEATURE == NODUMP_EXT2FS #include #else #error "unknown location of ext2_fs.h include file" #endif #endif #endif #if HAVE_UNISTD_H #include #endif } #include #include "integers.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "filesystem_specific_attribute.hpp" #include "cygwin_adapt.hpp" #include "deci.hpp" #include "fichier_local.hpp" #include "compile_time_features.hpp" #include "capabilities.hpp" #include "erreurs.hpp" using namespace std; namespace libdar { static bool compare_for_sort(const filesystem_specific_attribute *a, const filesystem_specific_attribute *b); template bool binary_search_in_sorted_list(const vector & table, const T *val, U_I & index) { U_I min = 0; U_I max = table.size(); if(val == nullptr) throw SRC_BUG; if(max == 0) // empty table return false; do { index = (min + max)/2; if(table[index] == nullptr) throw SRC_BUG; if(*(table[index]) < *val) min = index + 1; else max = index; } while(!table[index]->is_same_type_as(*val) && max - min > 0); if(max - min <= 0) index = min; return min < table.size() && (table[index])->is_same_type_as(*val); } /////////////////////////////////////////////////////////////////////////////////// bool filesystem_specific_attribute::is_same_type_as(const filesystem_specific_attribute & ref) const { return get_family() == ref.get_family() && get_nature() == ref.get_nature(); } bool filesystem_specific_attribute::operator < (const filesystem_specific_attribute & ref) const { if(fam < ref.fam) return true; else if(fam > ref.fam) return false; else return nat < ref.nat; } /////////////////////////////////////////////////////////////////////////////////// const U_I FAM_SIG_WIDTH = 1; const U_I NAT_SIG_WIDTH = 2; static bool compare_for_sort(const filesystem_specific_attribute *a, const filesystem_specific_attribute *b) { if(a == nullptr || b == nullptr) throw SRC_BUG; return *a < *b; } void filesystem_specific_attribute_list::clear() { vector::iterator it = fsa.begin(); while(it != fsa.end()) { if(*it != nullptr) { delete *it; *it = nullptr; } ++it; } fsa.clear(); } bool filesystem_specific_attribute_list::is_included_in(const filesystem_specific_attribute_list & ref, const fsa_scope & scope) const { bool ret = true; vector::const_iterator it = fsa.begin(); vector::const_iterator rt = ref.fsa.begin(); while(ret && it != fsa.end()) { if(rt == ref.fsa.end()) { ret = false; continue; // skip the rest of the while loop } if(*it == nullptr) throw SRC_BUG; if(*rt == nullptr) throw SRC_BUG; if(scope.find((*it)->get_family()) == scope.end()) { // this FSA is out of the scope, skipping it ++it; continue; // skip the rest of the while loop } while(rt != ref.fsa.end() && *(*rt) < *(*it)) { ++rt; if(*rt == nullptr) throw SRC_BUG; } if(rt == ref.fsa.end()) ret = false; else if(*(*rt) == *(*it)) ++it; else ret = false; } return ret; } void filesystem_specific_attribute_list::read(generic_file & f, archive_version ver) { infinint size = infinint(f); U_I sub_size; do { sub_size = 0; size.unstack(sub_size); if(size > 0 && sub_size == 0) throw SRC_BUG; while(sub_size > 0) { char buffer[FAM_SIG_WIDTH + NAT_SIG_WIDTH + 1]; fsa_family fam; fsa_nature nat; filesystem_specific_attribute *ptr = nullptr; f.read(buffer, FAM_SIG_WIDTH); buffer[FAM_SIG_WIDTH] = '\0'; fam = signature_to_family(buffer); f.read(buffer, NAT_SIG_WIDTH); buffer[NAT_SIG_WIDTH] = '\0'; nat = signature_to_nature(buffer); switch(nat) { case fsan_unset: throw SRC_BUG; case fsan_creation_date: ptr = new (get_pool()) fsa_time(f, ver, fam, nat); break; case fsan_append_only: case fsan_compressed: case fsan_no_dump: case fsan_immutable: case fsan_data_journaling: case fsan_secure_deletion: case fsan_no_tail_merging: case fsan_undeletable: case fsan_noatime_update: case fsan_synchronous_directory: case fsan_synchronous_update: case fsan_top_of_dir_hierarchy: ptr = new (get_pool()) fsa_bool(f, fam, nat); break; default: throw SRC_BUG; } if(ptr == nullptr) throw Ememory("filesystem_specific_attribute_list::read"); fsa.push_back(ptr); ptr = nullptr; --sub_size; } } while(!size.is_zero()); update_familes(); sort_fsa(); } void filesystem_specific_attribute_list::write(generic_file & f) const { infinint size = fsa.size(); vector::const_iterator it = fsa.begin(); size.dump(f); while(it != fsa.end()) { string tmp; if(*it == nullptr) throw SRC_BUG; tmp = family_to_signature((*it)->get_family()); f.write(tmp.c_str(), tmp.size()); tmp = nature_to_signature((*it)->get_nature()); f.write(tmp.c_str(), tmp.size()); (*it)->write(f); ++it; } } void filesystem_specific_attribute_list::get_fsa_from_filesystem_for(const string & target, const fsa_scope & scope, mode_t itype) { clear(); if(scope.find(fsaf_hfs_plus) != scope.end()) { fill_HFS_FSA_with(target, itype); } if(scope.find(fsaf_linux_extX) != scope.end()) { fill_extX_FSA_with(target, itype); } update_familes(); sort_fsa(); } bool filesystem_specific_attribute_list::set_fsa_to_filesystem_for(const string & target, const fsa_scope & scope, user_interaction & ui) const { bool ret = false; if(scope.find(fsaf_linux_extX) != scope.end()) ret |= set_extX_FSA_to(ui, target); if(scope.find(fsaf_hfs_plus) != scope.end()) ret |= set_hfs_FSA_to(ui, target); return ret; } const filesystem_specific_attribute & filesystem_specific_attribute_list::operator [] (U_I arg) const { if(arg >= fsa.size()) throw SRC_BUG; if(fsa[arg] == nullptr) throw SRC_BUG; return *(fsa[arg]); } infinint filesystem_specific_attribute_list::storage_size() const { infinint ret = infinint(size()).get_storage_size(); vector::const_iterator it = fsa.begin(); infinint overhead = family_to_signature(fsaf_hfs_plus).size() + nature_to_signature(fsan_creation_date).size(); while(it != fsa.end()) { if(*it == nullptr) throw SRC_BUG; ret += (*it)->storage_size() + overhead; ++it; } return ret; } filesystem_specific_attribute_list filesystem_specific_attribute_list::operator + (const filesystem_specific_attribute_list & arg) const { filesystem_specific_attribute_list ret = *this; vector::const_iterator it = arg.fsa.begin(); while(it != arg.fsa.end()) { if(*it == nullptr) throw SRC_BUG; ret.add(*(*it)); ++it; } ret.update_familes(); ret.sort_fsa(); return ret; } bool filesystem_specific_attribute_list::find(fsa_family fam, fsa_nature nat, const filesystem_specific_attribute *&ptr) const { fsa_bool tmp = fsa_bool(fam, nat, true); U_I index; if(binary_search_in_sorted_list(fsa, (filesystem_specific_attribute *)(&tmp), index)) { ptr = fsa[index]; return true; } else return false; } void filesystem_specific_attribute_list::copy_from(const filesystem_specific_attribute_list & ref) { vector::const_iterator it = ref.fsa.begin(); fsa.clear(); while(it != ref.fsa.end()) { if(*it == nullptr) throw SRC_BUG; fsa.push_back((*it)->clone()); ++it; } familes = ref.familes; } void filesystem_specific_attribute_list::update_familes() { vector::iterator it = fsa.begin(); familes.clear(); while(it != fsa.end()) { if(*it == nullptr) throw SRC_BUG; familes.insert((*it)->get_family()); ++it; } } void filesystem_specific_attribute_list::add(const filesystem_specific_attribute & ref) { U_I index = 0; if(binary_search_in_sorted_list(fsa, &ref, index)) { if(fsa[index] == nullptr) throw SRC_BUG; else { filesystem_specific_attribute *rep = ref.clone(); if(rep == nullptr) throw Ememory("filesystem_specific_attribute_list::add"); try { delete fsa[index]; fsa[index] = rep; } catch(...) { delete rep; throw; } } } else { filesystem_specific_attribute *rep = ref.clone(); if(rep == nullptr) throw Ememory("filesystem_specific_attribute_list::add"); try { fsa.resize(fsa.size()+1, nullptr); for(U_I i = fsa.size()-1 ; i > index ; --i) { fsa[i] = fsa[i-1]; fsa[i-1] = nullptr; } fsa[index] = rep; } catch(...) { delete rep; throw; } } } void filesystem_specific_attribute_list::sort_fsa() { sort(fsa.begin(), fsa.end(), compare_for_sort); } template void create_or_throw(T *& ref, memory_pool *pool, fsa_family f, fsa_nature n, const U & val) { if(ref != nullptr) throw SRC_BUG; ref = new (pool) T(f, n, val); if(ref == nullptr) throw Ememory("template create_or_throw"); } void filesystem_specific_attribute_list::fill_extX_FSA_with(const std::string & target, mode_t itype) { #ifdef LIBDAR_NODUMP_FEATURE S_I fd = -1; // symlink do not have their own extX FSA: restoring FSA of a symlink change the FSA of the target of the symlink if(S_ISREG(itype) || S_ISDIR(itype)) { try { fichier_local ftmp = fichier_local(target, compile_time::furtive_read()); fd = ftmp.give_fd_and_terminate(); } catch(Egeneric & e) { if(!compile_time::furtive_read()) throw; // not a problem about furtive read mode try // trying openning not using furtive read mode { fichier_local ftmp = fichier_local(target, false); fd = ftmp.give_fd_and_terminate(); } catch(Egeneric & e) { fd = -1; // we assume this FSA family is not supported for that file } } if(fd < 0) return; // silently aborting assuming FSA family not supported for that file try { S_I f = 0; fsa_bool * ptr = nullptr; if(ioctl(fd, EXT2_IOC_GETFLAGS, &f) < 0) { close(fd); return; // assuming there is no support for that FSA family } #ifdef EXT2_APPEND_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_append_only, (f & EXT2_APPEND_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_COMPR_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_compressed, (f & EXT2_COMPR_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_NODUMP_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_no_dump, (f & EXT2_NODUMP_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_IMMUTABLE_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_immutable, (f & EXT2_IMMUTABLE_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT3_JOURNAL_DATA_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_data_journaling, (f & EXT3_JOURNAL_DATA_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #else #ifdef EXT2_JOURNAL_DATA_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_data_journaling, (f & EXT2_JOURNAL_DATA_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #endif #ifdef EXT2_SECRM_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_secure_deletion, (f & EXT2_SECRM_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_NOTAIL_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_no_tail_merging, (f & EXT2_NOTAIL_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_UNRM_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_undeletable, (f & EXT2_UNRM_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_NOATIME_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_noatime_update, (f & EXT2_NOATIME_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_DIRSYNC_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_synchronous_directory, (f & EXT2_DIRSYNC_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_SYNC_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_synchronous_update, (f & EXT2_SYNC_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif #ifdef EXT2_TOPDIR_FL create_or_throw(ptr, get_pool(), fsaf_linux_extX, fsan_top_of_dir_hierarchy, (f & EXT2_TOPDIR_FL) != 0); fsa.push_back(ptr); ptr = nullptr; #endif } catch(...) { close(fd); throw; } close(fd); } #else // nothing to do, as this FSA has not been activated at compilation time #endif } void filesystem_specific_attribute_list::fill_HFS_FSA_with(const std::string & target, mode_t itype) { #ifdef LIBDAR_BIRTHTIME struct stat tmp; int lu = stat(target.c_str(), &tmp); if(lu < 0) return; // silently aborting assuming FSA family not supported for that file else { fsa_time * ptr = nullptr; #ifdef LIBDAR_MICROSECOND_READ_ACCURACY datetime birthtime = datetime(tmp.st_birthtim.tv_sec, tmp.st_birthtim.tv_nsec, datetime::tu_nanosecond); if(birthtime.is_null()) birthtime = datetime(tmp.st_birthtime, 0, datetime::tu_second); #else datetime birthtime = datetime(tmp.st_birthtime, 0, datetime::tu_second); #endif create_or_throw(ptr, get_pool(), fsaf_hfs_plus, fsan_creation_date, birthtime); fsa.push_back(ptr); ptr = nullptr; } #endif } bool filesystem_specific_attribute_list::set_extX_FSA_to(user_interaction & ui, const std::string & target) const { bool ret = false; bool has_extX_FSA = false; vector::const_iterator it = fsa.begin(); while(!has_extX_FSA && it != fsa.end()) { if(*it == nullptr) throw SRC_BUG; if((*it)->get_family() == fsaf_linux_extX) has_extX_FSA = true; ++it; } #ifdef LIBDAR_NODUMP_FEATURE if(has_extX_FSA) { S_I fd = -1; try { bool furtive = capability_FOWNER(ui, false) == capa_set ? compile_time::furtive_read() : false; fichier_local ftmp = fichier_local(target, furtive); fd = ftmp.give_fd_and_terminate(); } catch(Egeneric & e) { throw Erange("filesystem_specific_attribute_list::fill_extX_FSA_with", string(gettext("Failed setting (opening) extX family FSA: ")) + e.get_message()); } if(fd < 0) throw SRC_BUG; try { S_I f = 0; // will contain the desirable flag bits field S_I f_orig = 0; // will contain the original flag bits field const fsa_bool *it_bool = nullptr; if(ioctl(fd, EXT2_IOC_GETFLAGS, &f_orig) < 0) throw Erange("filesystem_specific_attribute_list::fill_extX_FSA_with", string(gettext("Failed reading existing extX family FSA: ")) + tools_strerror_r(errno)); f = f_orig; for(it = fsa.begin() ; it != fsa.end() ; ++it) { if(*it == nullptr) throw SRC_BUG; it_bool = dynamic_cast(*it); if((*it)->get_family() == fsaf_linux_extX) { switch((*it)->get_nature()) { case fsan_unset: throw SRC_BUG; case fsan_creation_date: throw SRC_BUG; // unknown nature for this family type case fsan_append_only: if(it_bool == nullptr) throw SRC_BUG; // should be a boolean #ifdef EXT2_APPEND_FL if(it_bool->get_value()) f |= EXT2_APPEND_FL; else f &= ~EXT2_APPEND_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_compressed: #ifdef EXT2_COMPR_FL if(it_bool->get_value()) f |= EXT2_COMPR_FL; else f &= ~EXT2_COMPR_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_no_dump: #ifdef EXT2_NODUMP_FL if(it_bool->get_value()) f |= EXT2_NODUMP_FL; else f &= ~EXT2_NODUMP_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_immutable: #ifdef EXT2_IMMUTABLE_FL if(it_bool->get_value()) f |= EXT2_IMMUTABLE_FL; else f &= ~EXT2_IMMUTABLE_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_data_journaling: #ifdef EXT3_JOURNAL_DATA_FL if(it_bool->get_value()) f |= EXT3_JOURNAL_DATA_FL; else f &= ~EXT3_JOURNAL_DATA_FL; #else #ifdef EXT2_JOURNAL_DATA_FL if(it_bool->get_value()) f |= EXT2_JOURNAL_DATA_FL; else f &= ~EXT2_JOURNAL_DATA_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif #endif break; case fsan_secure_deletion: #ifdef EXT2_SECRM_FL if(it_bool->get_value()) f |= EXT2_SECRM_FL; else f &= ~EXT2_SECRM_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_no_tail_merging: #ifdef EXT2_NOTAIL_FL if(it_bool->get_value()) f |= EXT2_NOTAIL_FL; else f &= ~EXT2_NOTAIL_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_undeletable: #ifdef EXT2_UNRM_FL if(it_bool->get_value()) f |= EXT2_UNRM_FL; else f &= ~EXT2_UNRM_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_noatime_update: #ifdef EXT2_NOATIME_FL if(it_bool->get_value()) f |= EXT2_NOATIME_FL; else f &= ~EXT2_NOATIME_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_synchronous_directory: #ifdef EXT2_DIRSYNC_FL if(it_bool->get_value()) f |= EXT2_DIRSYNC_FL; else f &= ~EXT2_DIRSYNC_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; case fsan_synchronous_update: #ifdef EXT2_SYNC_FL if(it_bool->get_value()) f |= EXT2_SYNC_FL; else f &= ~EXT2_SYNC_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string(fsan_append_only).c_str(), target.c_str()); #endif break; case fsan_top_of_dir_hierarchy: #ifdef EXT2_TOPDIR_FL if(it_bool->get_value()) f |= EXT2_TOPDIR_FL; else f &= ~EXT2_TOPDIR_FL; #else ui.printf(gettext("Warning: FSA %s/%s support has not been found at compilation time, cannot restore it for inode %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), fsa_nature_to_string((*it)->get_nature()).c_str(), target.c_str()); #endif break; default: throw SRC_BUG; } } } // now that f has been totally computed // we must handle the point that some FSA flag // need specific privileged to be set or cleared S_I mask_IMMUT = 0; // will carry the mask for flags that need the IMMUTABLE capability S_I mask_SYS_RES = 0; // will carry the mask for flags that need the SYS_RESOURCE capability #ifdef EXT2_APPEND_FL mask_IMMUT |= EXT2_APPEND_FL; #endif #ifdef EXT2_IMMUTABLE_FL mask_IMMUT |= EXT2_IMMUTABLE_FL; #endif #ifdef EXT3_JOURNAL_DATA_FL mask_SYS_RES |= EXT3_JOURNAL_DATA_FL; #else #ifdef EXT3_JOURNAL_DATA_FL mask_SYS_RES |= EXT2_JOURNAL_DATA_FL; #endif #endif // now that masks have been computed, we will proceed // in several steps: // - first setting the flag that do not need any privileges (abort upon error) // - second set the flags that need IMMUTABLE capability (warn and continue upon error) // - third set the flags that need SYS_RESOURCE capability (warn and continue upon error) // STEP 1: non privileged flags S_I tmp_f = (f & ~mask_IMMUT & ~mask_SYS_RES) | (f_orig & (mask_IMMUT | mask_SYS_RES)); if(tmp_f != f_orig) { if(ioctl(fd, EXT2_IOC_SETFLAGS, &tmp_f) < 0) throw Erange("filesystem_specific_attribute_list::fill_extX_FSA_with", string(gettext("Failed set extX family FSA: ")) + tools_strerror_r(errno )); ret = true; // some flags have been set or cleared } f_orig = tmp_f; // f_orig has been modified with the new values of the non priviledged flag bits // STEP 2 : setting the IMMUTABLE flags only if((f & mask_IMMUT) != (f_orig & mask_IMMUT)) // some immutable flags need to be changed { tmp_f = (f & mask_IMMUT) | (f_orig & ~mask_IMMUT); // only diff is IMMUTABLE flags switch(capability_LINUX_IMMUTABLE(ui, true)) { case capa_set: case capa_unknown: if(ioctl(fd, EXT2_IOC_SETFLAGS, &tmp_f) < 0) { string tmp = tools_strerror_r(errno); ui.printf("Failed setting FSA extX IMMUTABLE flags for %s: %", target.c_str(), tmp.c_str()); } else { f_orig = tmp_f; // f_orig now integrates the IMMUTABLE flags that we could set ret = true; // some flags have been set or cleared } break; case capa_clear: ui.printf(gettext("Not setting FSA extX IMMUTABLE flags for %s due to of lack of capability"), target.c_str()); break; default: throw SRC_BUG; } } /////// setting the SYS_RESOURCE flags only if((f & mask_SYS_RES) != (f_orig & mask_SYS_RES)) // some SYS_RESOURCE flags need to be changed { tmp_f = (f & mask_SYS_RES) | (f_orig & ~mask_SYS_RES); // only diff is the SYS_RES flags switch(capability_SYS_RESOURCE(ui, true)) { case capa_set: case capa_unknown: if(ioctl(fd, EXT2_IOC_SETFLAGS, &tmp_f) < 0) { string tmp = tools_strerror_r(errno); ui.printf("Failed setting FSA extX SYSTEME RESOURCE flags for %s: %", target.c_str(), tmp.c_str()); } else { f_orig = tmp_f; // f_orig now integrates the SYS_RESOURCE flags that we could set ret = true; // some flags have been set or cleared } break; case capa_clear: ui.printf(gettext("Not setting FSA extX SYSTEM RESOURCE flags for %s due to of lack of capability"), target.c_str()); break; default: throw SRC_BUG; } } } catch(...) { close(fd); throw; } close(fd); } #else if(has_extX_FSA) { ui.printf(gettext("Warning! %s Filesystem Specific Attribute support have not been activated at compilation time and could not be restored for %s"), fsa_family_to_string(fsaf_linux_extX).c_str(), target.c_str()); } #endif return ret; } bool filesystem_specific_attribute_list::set_hfs_FSA_to(user_interaction & ui, const std::string & target) const { bool ret = false; // the birthtime is set with the different other dates of that inode, so // here we just check that this FSA list provides a birthtime info: const filesystem_specific_attribute *tmp = nullptr; ret = find(fsaf_hfs_plus, fsan_creation_date, tmp); #ifndef LIBDAR_BIRTHTIME if(ret) ui.printf(gettext("Birth Time attribute cannot be restored for %s because no FSA familly able to carry that attribute could be activated at compilation time."), target.c_str()); // here we just warn, the birthtime restoration will be tried (calling twice utime()), even // if dar has not been compiled with birthtime support. Birthtime support is necessary on ty // read birthtime value of an inode #endif return ret; } string filesystem_specific_attribute_list::family_to_signature(fsa_family f) { string ret; switch(f) { case fsaf_hfs_plus: ret = "h"; break; case fsaf_linux_extX: ret = "l"; break; default: throw SRC_BUG; } if(ret.size() != FAM_SIG_WIDTH) throw SRC_BUG; if(ret == "X") throw SRC_BUG; // resevered for field extension if necessary in the future return ret; } string filesystem_specific_attribute_list::nature_to_signature(fsa_nature n) { string ret; switch(n) { case fsan_unset: throw SRC_BUG; case fsan_creation_date: ret = "aa"; break; case fsan_append_only: ret = "ba"; break; case fsan_compressed: ret = "bb"; break; case fsan_no_dump: ret = "bc"; break; case fsan_immutable: ret = "bd"; break; case fsan_data_journaling: ret = "be"; break; case fsan_secure_deletion: ret = "bf"; break; case fsan_no_tail_merging: ret = "bg"; break; case fsan_undeletable: ret = "bh"; break; case fsan_noatime_update: ret = "bi"; break; case fsan_synchronous_directory: ret = "bj"; break; case fsan_synchronous_update: ret = "bk"; break; case fsan_top_of_dir_hierarchy: ret = "bl"; break; default: throw SRC_BUG; } if(ret.size() != NAT_SIG_WIDTH) throw SRC_BUG; if(ret == "XX") throw SRC_BUG; // resevered for field extension if necessary in the future return ret; } fsa_family filesystem_specific_attribute_list::signature_to_family(const string & sig) { if(sig.size() != FAM_SIG_WIDTH) throw SRC_BUG; if(sig == "h") return fsaf_hfs_plus; if(sig == "l") return fsaf_linux_extX; if(sig == "X") throw SRC_BUG; // resevered for field extension if necessary in the future throw SRC_BUG; } fsa_nature filesystem_specific_attribute_list::signature_to_nature(const string & sig) { if(sig.size() != NAT_SIG_WIDTH) throw SRC_BUG; if(sig == "aa") return fsan_creation_date; if(sig == "ba") return fsan_append_only; if(sig == "bb") return fsan_compressed; if(sig == "bc") return fsan_no_dump; if(sig == "bd") return fsan_immutable; if(sig == "be") return fsan_data_journaling; if(sig == "bf") return fsan_secure_deletion; if(sig == "bg") return fsan_no_tail_merging; if(sig == "bh") return fsan_undeletable; if(sig == "bi") return fsan_noatime_update; if(sig == "bj") return fsan_synchronous_directory; if(sig == "bk") return fsan_synchronous_update; if(sig == "bl") return fsan_top_of_dir_hierarchy; if(sig == "XX") throw SRC_BUG; // resevered for field extension if necessary in the future throw SRC_BUG; } /////////////////////////////////////////////////////////////////////////////////// fsa_bool::fsa_bool(generic_file & f, fsa_family fam, fsa_nature nat): filesystem_specific_attribute(f, fam, nat) { char ch; S_I lu = f.read(&ch, 1); if(lu == 1) { switch(ch) { case 'T': val = true; break; case 'F': val = false; break; default: throw Edata(gettext("Unexepected value for boolean FSA, data corruption may have occurred")); } } else throw Erange("fsa_bool::fsa_bool", string(gettext("Error while reading FSA: ")) + tools_strerror_r(errno)); } bool fsa_bool::equal_value_to(const filesystem_specific_attribute & ref) const { const fsa_bool *ptr = dynamic_cast(&ref); if(ptr != nullptr) return val == ptr->val; else return false; } /////////////////////////////////////////////////////////////////////////////////// fsa_infinint::fsa_infinint(generic_file & f, fsa_family fam, fsa_nature nat): filesystem_specific_attribute(f, fam, nat) { val.read(f); } string fsa_infinint::show_val() const { return deci(val).human(); } bool fsa_infinint::equal_value_to(const filesystem_specific_attribute & ref) const { const fsa_infinint *ptr = dynamic_cast(&ref); if(ptr != nullptr) return val == ptr->val; else return false; } /////////////////////////////////////////////////////////////////////////////////// fsa_time::fsa_time(generic_file & f, archive_version ver, fsa_family fam, fsa_nature nat): filesystem_specific_attribute(f, fam, nat) { val.read(f, ver); } string fsa_time::show_val() const { return tools_display_date(val); } bool fsa_time::equal_value_to(const filesystem_specific_attribute & ref) const { const fsa_time *ptr = dynamic_cast(&ref); if(ptr != nullptr) return val == ptr->val; else return false; } } // end of namespace dar-2.5.3/src/libdar/erreurs_ext.hpp0000644000175000017430000000445012641772777014345 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file erreurs_ext.hpp /// \brief contains some additional exception class thrown by libdar /// \ingroup Private #ifndef ERREURS_EXT_HPP #define ERREURS_EXT_HPP #include "erreurs.hpp" #include "infinint.hpp" namespace libdar { /// \addtogroup Private /// @{ /// Ethread_cancel with infinint attribute class Ethread_cancel_with_attr : public Ethread_cancel { public : Ethread_cancel_with_attr(bool now, U_64 x_flag, const infinint & attr); Ethread_cancel_with_attr(const Ethread_cancel_with_attr & ref): Ethread_cancel(ref) { copy_from(ref); }; const Ethread_cancel_with_attr & operator = (const Ethread_cancel_with_attr & ref) { detruit(); copy_from(ref); return *this; }; ~Ethread_cancel_with_attr() { detruit(); }; const infinint get_attr() const { return *x_attr; }; private : // infinint may throw Ebug exception from destructor // having a field of type infinint lead this class // to have a default destructor throwing Ebug too // which implies Egeneric to have the same which // makes circular dependency as Ebug cannot be defined // before Egeneric. Here is the reason why we use a infinint* here infinint *x_attr; void detruit(); void copy_from(const Ethread_cancel_with_attr & ref); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/thread_cancellation.hpp0000644000175000017430000001627012641773000015740 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file thread_cancellation.hpp /// \brief to be able to cancel libdar operation while running in a given thread. /// \ingroup API /// /// the class thread_cancellation implemented in this module /// permits to define checkpoints where is looked whether the current /// thread has been marked as to be canceled by the user /// The advantage of this class is that it then throws a Euser_abort /// exception which properly terminates the libdar operation in the thread /// freeing allocated memory and release mutex properly. Note that the thread /// is not canceled but libdar call in this thread returns as soon as a checkpoint /// is met during the execution. #ifndef THREAD_CANCELLATION_HPP #define THREAD_CANCELLATION_HPP #include "../my_config.h" extern "C" { #if MUTEX_WORKS #if HAVE_PTHREAD_H #include #endif #endif } #include #include #include "integers.hpp" namespace libdar { /// class to be used as parent to provide checkpoints to inherited classes /// the class provides a checkpoints to inherited classes and a mechanism /// that let any libdar external code to ask the termination of a libdar /// call executing in a given thread. This does not imply the termination /// of the thread itself but it implies the return of the thread execution /// to the code that called libdar /// \ingroup Private class thread_cancellation { public: /// the constructor thread_cancellation(); /// the destructor virtual ~thread_cancellation() throw(Ebug); /// Checkpoint test : whether the current libdar call must abort or not /// \exception Euser_abort is thrown if the thread the checkpoint is running /// from is marked as to be canceled. void check_self_cancellation() const; /// by default delayed (non immediate) cancellation generate a specific exception, /// it is possible for delayed cancellation only, do block such exceptions for a certain time ///\param[in] mode can be set to true to block delayed cancellations ///\note when unblocking delayed cancellations, if a delayed cancellation has been ///requested during the ignore time, it will be thrown by this call void block_delayed_cancellation(bool mode); #if MUTEX_WORKS /// marks the thread given in argument as to be canceled //! \param[in] tid the thread ID of the thread where any libdar call must abort //! \param[in] x_immediate whether the cancellation must be as fast as possible or can take a //! \param[in] x_flag is a value to transmit to the Ethread_cancel exception used to cancel libdar's call stack //! little time to make a usable archive static void cancel(pthread_t tid, bool x_immediate, U_64 x_flag); /// gives the cancellation status of the given thread ID //! \param[in] tid the thread to check //! \return true if the given thread is under cancellation static bool cancel_status(pthread_t tid); /// abort the pending thread cancellation /// \return true if the pending thread was still running and /// false if it has already aborted. static bool clear_pending_request(pthread_t tid); /// define association between threads: if a cancellation is requested for src, it will also be requested for dst /// /// \param[in] src orginal target for cancellation /// \param[in] dst additional target for cancellation /// \note that the propagation of cancellation request with association is transitive /// in other word if t1 is associtated with t2 which is associated with t3, /// requesting cancellation of t1 will also lead to signal cancellation request for t2 and t3 /// \note that association is not symmetrical, unless associating A to B *and* B to A static void associate_tid_to_tid(pthread_t src, pthread_t dst); /// remove all association from a given tid to any other thread /// /// \param[in] src is the thread id that has to be removed from the /// association table (see associate_tid_to_tid() above). static void remove_association_for_tid(pthread_t src); /// remove all association for any thread to a given targetted thread /// /// \param[in] dst all association target at dst will be removed static void remove_association_targeted_at(pthread_t dst); /// clean class info from all related information about that thread, like associations and pending cancellations static void dead_thread(pthread_t tid); #endif /// method for debugging/control purposes static U_I count() { #if MUTEX_WORKS return info.size(); #else return 0; #endif }; #if MUTEX_WORKS private: // class types struct fields { pthread_t tid; ///< thread id of the current thread bool block_delayed; ///< whether we buffer any delayed cancellation requests for "this" thread bool immediate; ///< whether we take a few more second to make a real usable archive bool cancellation; ///< true if a thread has to be canceled U_64 flag; ///< user defined informational field, given to the Ethread_cancel constructor }; // object information fields status; // class's static variables and types static pthread_mutex_t access; //< mutex for the access to "info" static std::list info; //< list of all object static std::list preborn; //< canceled thread that still not have a thread_cancellation object to deal with cancellation static std::multimap thread_asso; //< which other thread to propagate cancellation request to, given a initial tid // helper class routing static void set_cancellation_in_info_for(pthread_t tid, bool cancel_status, bool x_immediate, U_64 x_flag, bool & found, bool & previous_val, bool & bug); static void add_to_preborn(pthread_t tid, bool x_immediate, U_64 x_flag); static void remove_from_preborn(pthread_t tid, bool & found, bool & prev); static void find_asso_tid_with(pthread_t tid, std::multimap::iterator & begin, std::multimap::iterator & end); #endif }; } // end of namespace #endif dar-2.5.3/src/libdar/mem_ui.hpp0000644000175000017430000000765012642457363013246 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file mem_ui.hpp /// \brief class mem_ui definition. This class is to be used as parent class to handle user_interaction object management /// \ingroup Private #ifndef MEM_UI_HPP #define MEM_UI_HPP #include "../my_config.h" #include "user_interaction.hpp" namespace libdar { /// \addtogroup Private /// @{ /// class mem_ui to keep a copy of a user_interaction object /// this class is targeted for inheritance (it is advised to use a "protected" /// inheritance, not a "public" one). Instead of having all /// the stuf of managing, cloning, releasing a pointer on user_interaction /// a class simply put itslef as inherited from mem_ui to take the benefit /// of this implementation, once and for all. Use this class with caution /// espetially for class which will generate a ton of objects, as this will /// duplicate the user_interaction object in the same number. /// sometimes it is more efficient to have the user_interaction object as /// parameter of the constructor, using it if necessary while constructing the /// object only. In that situation, if the user_interaction is not need any /// further after construction, no need to make the class inherit from mem_ui. class mem_ui { public: /// constructor /// \param[in] dialog the user_interaction object to clone and store /// If you plan to use mem_ui, you should pass the user_interaction to its constructor /// for you later be able to call get_ui() at any time from the inherited class mem_ui(const user_interaction & dialog) { set_ui(dialog); }; /// \param[in] dialog pointer to a user_interaction object that will be *referred* to /// and which must stay alive during the whole life of "this" object. This object is not /// destroyed nor cloned by mem_ui. mem_ui(user_interaction *dialog) { ui = dialog; cloned = false; }; /// the copy constructor /// need to be called from the copy constructor of any inherited class that explicitely define one mem_ui(const mem_ui & ref) { copy_from(ref); }; /// destructor /// it is declared as virtual, for precaution, as it may not be very frequent to /// release an object having just a mem_ui pointer on it. virtual ~mem_ui() throw(Ebug) { detruire(); }; /// assignement operator /// you need to call it from the inherited class assignement operator /// if the inherited class explicitely defines its own one. const mem_ui & operator = (const mem_ui & ref) { detruire(); copy_from(ref); return *this; }; protected: /// get access to the user_interaction cloned object /// \return a reference to the clone object. This reference stays valid during all /// the live of the object. user_interaction & get_ui() const; private: user_interaction *ui; bool cloned; void detruire(); void copy_from(const mem_ui & ref); void set_ui(const user_interaction & dialog); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/tlv_list.cpp0000644000175000017430000000374112641773000013607 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "tlv_list.hpp" using namespace std; namespace libdar { void tlv_list::dump(generic_file & f) const { infinint number = contents.size(); vector::iterator it = const_cast(this)->contents.begin(); vector::iterator fin = const_cast(this)->contents.end(); number.dump(f); while(it != fin) { it->dump(f); it++; } } tlv & tlv_list::operator[] (U_I item) const { tlv_list *me = const_cast(this); if(item > contents.size()) throw Erange("tlv_list::operator[]", "index out of range when accessing a tlv_list object"); if(me == nullptr) throw SRC_BUG; return me->contents[item]; } void tlv_list::init(generic_file & f) { infinint number; number.read(f); // read from file the number of tlv stored contents.clear(); // erase list contents while(!number.is_zero()) // read each tlv from file { contents.push_back(tlv(f)); number--; } } } // end of namespace dar-2.5.3/src/libdar/data_tree.cpp0000644000175000017430000011735412641772777013731 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // to allow compilation under Cygwin we need // else Cygwin's lack __int16_t symbol !?! #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif } // end extern "C" #include #include "data_tree.hpp" #include "tools.hpp" #include "user_interaction.hpp" #include "deci.hpp" #include "path.hpp" #include "datetime.hpp" #include "cat_all_entrees.hpp" using namespace std; using namespace libdar; static data_tree *read_from_file(generic_file & f, unsigned char db_version, memory_pool *pool); static void read_from_file(generic_file &f, archive_num &a); static void write_to_file(generic_file &f, archive_num a); static void display_line(user_interaction & dialog, archive_num num, const datetime *data, data_tree::etat data_presence, const datetime *ea, data_tree::etat ea_presence); #define ETAT_SAVED 'S' #define ETAT_PRESENT 'P' #define ETAT_REMOVED 'R' namespace libdar { void data_tree::status::dump(generic_file & f) const { date.dump(f); switch(present) { case et_saved: f.write("S", 1); break; case et_present: f.write("P", 1); break; case et_removed: f.write("R", 1); break; case et_absent: f.write("A", 1); break; default: throw SRC_BUG; } } void data_tree::status::read(generic_file & f, unsigned char db_version) { char tmp; date.read(f, db2archive_version(db_version)); if(f.read(&tmp, 1) != 1) throw Erange("data_tree::status::read", gettext("reached End of File before all expected data could be read")); switch(tmp) { case 'S': present = et_saved; break; case 'P': present = et_present; break; case 'R': present = et_removed; break; case 'A': present = et_absent; break; default: throw Erange("data_tree::status::read", gettext("Unexpected value found in database")); } } data_tree::data_tree(const string & name) { filename = name; } data_tree::data_tree(generic_file & f, unsigned char db_version) { archive_num k; status sta; // signature has already been read tools_read_string(f, filename); infinint tmp = infinint(f); // number of entry in last_mod map while(!tmp.is_zero()) { read_from_file(f, k); switch(db_version) { case 1: sta.date = infinint(f); sta.present = et_saved; last_mod[k] = sta; break; case 2: case 3: case 4: sta.read(f, db_version); last_mod[k] = sta; break; default: // unsupported database version throw SRC_BUG; // this statement should have been prevented earlier in the code to avoid destroying or loosing data from the database } --tmp; } tmp = infinint(f); // number of entry in last_change map while(!tmp.is_zero()) { read_from_file(f, k); switch(db_version) { case 1: sta.date = infinint(f); sta.present = et_saved; last_change[k] = sta; break; case 2: case 3: case 4: sta.read(f, db_version); last_change[k] = sta; break; default: throw SRC_BUG; } --tmp; } } void data_tree::dump(generic_file & f) const { char tmp = obj_signature(); infinint sz; map::const_iterator it = last_mod.begin(); f.write(&tmp, 1); tools_write_string(f, filename); sz = last_mod.size(); sz.dump(f); while(it != last_mod.end()) { write_to_file(f, it->first); // key it->second.dump(f); // value ++it; } sz = last_change.size(); sz.dump(f); it = last_change.begin(); while(it != last_change.end()) { write_to_file(f, it->first); // key it->second.dump(f); // value ++it; } } data_tree::lookup data_tree::get_data(archive_num & archive, const datetime & date, bool even_when_removed) const { map::const_iterator it = last_mod.begin(); datetime max_seen = datetime(0), max_real = datetime(0); //archive (first argument) carries the last archive number (in the order of the database) in which a valid entry has been //found, but which is not just a record "et_present" meaning that the file existed but has not been saved (differential backup context) or "et_absent" (no entry in the corresponding archive). archive_num archive_seen = 0; //< last archive number (in the order of the database) in which a valid entry has been found (any state) archive_num archive_even_when_removed = 0; //< last archive number in which a valid entry with data available has been found bool presence_seen = false; //< whether the last found valid entry indicates file was present or removed bool presence_real = false; //< whether the last found valid entry not being in an "et_present" state was present or removed lookup ret; archive = 0; // 0 is never assigned to an archive number while(it != last_mod.end()) { if(it->second.date >= max_seen // > and = because there should never be twice the same value // and we must be able to see a value of 0 (initially max = 0) which is valid. && (date.is_null() || it->second.date <= date)) { max_seen = it->second.date; archive_seen = it->first; switch(it->second.present) { case et_saved: case et_present: presence_seen = true; break; case et_removed: case et_absent: presence_seen = false; break; default: throw SRC_BUG; } } if(it->second.date >= max_real // > and = because there should never be twice the same value // and we must be able to see a value of 0 (initially max = 0) which is valid. && (date.is_null() || it->second.date <= date)) { if(it->second.present != et_present) { max_real = it->second.date; archive = it->first; switch(it->second.present) { case et_saved: presence_real = true; archive_even_when_removed = archive; break; case et_removed: case et_absent: presence_real = false; break; case et_present: throw SRC_BUG; default: throw SRC_BUG; } } } ++it; } if(even_when_removed && archive_even_when_removed > 0) { archive = archive_even_when_removed; presence_seen = presence_real = true; } if(archive == 0) if(archive_seen != 0) // last acceptable entry is a file present but not saved, but no full backup is present in a previous archive { archive = archive_seen; ret = not_restorable; } else ret = not_found; else if(archive_seen != 0) if(presence_seen && !presence_real) // last acceptable entry is a file present but not saved, // but no full backup is present in a previous archive { archive = archive_seen; ret = not_restorable; } else if(presence_seen != presence_real) throw SRC_BUG; else // archive > 0 && presence_seen == present_real if(presence_real) ret = found_present; else ret = found_removed; else // archive != 0 but archive_seen == 0 throw SRC_BUG; return ret; } data_tree::lookup data_tree::get_EA(archive_num & archive, const datetime & date, bool even_when_removed) const { map::const_iterator it = last_change.begin(); datetime max_seen = datetime(0), max_real = datetime(0); bool presence_seen = false, presence_real = false; archive_num archive_seen = 0; archive_num archive_even_when_removed = 0; lookup ret; archive = 0; // 0 is never assigned to an archive number while(it != last_change.end()) { if(it->second.date >= max_seen // > and = because there should never be twice the same value // and we must be able to see a value of 0 (initially max = 0) which is valid. && (date.is_null() || it->second.date <= date)) { max_seen = it->second.date; archive_seen = it->first; switch(it->second.present) { case et_saved: case et_present: presence_seen = true; break; case et_removed: case et_absent: presence_seen = false; break; default: throw SRC_BUG; } } if(it->second.date >= max_real // > and = because there should never be twice the same value // and we must be able to see a value of 0 (initially max = 0) which is valid. && (date.is_null() || it->second.date <= date)) { if(it->second.present != et_present) { max_real = it->second.date; archive = it->first; switch(it->second.present) { case et_saved: presence_real = true; archive_even_when_removed = archive; break; case et_removed: case et_absent: presence_real = false; break; case et_present: throw SRC_BUG; default: throw SRC_BUG; } } } ++it; } if(even_when_removed && archive_even_when_removed > 0) { archive = archive_even_when_removed; presence_seen = presence_real = true; } if(archive == 0) if(archive_seen != 0) // last acceptable entry is a file present but not saved, but no full backup is present in a previous archive ret = not_restorable; else ret = not_found; else if(archive_seen != 0) if(presence_seen && !presence_real) // last acceptable entry is a file present but not saved, but no full backup is present in a previous archive ret = not_restorable; else if(presence_seen != presence_real) throw SRC_BUG; else // archive > 0 && presence_seen == present_real if(presence_real) ret = found_present; else ret = found_removed; else throw SRC_BUG; return ret; } bool data_tree::read_data(archive_num num, datetime & val, etat & present) const { map::const_iterator it = last_mod.find(num); if(it != last_mod.end()) { val = it->second.date; present = it->second.present; return true; } else return false; } bool data_tree::read_EA(archive_num num, datetime & val, etat & present) const { map::const_iterator it = last_change.find(num); if(it != last_change.end()) { val = it->second.date; present = it->second.present; return true; } else return false; } void data_tree::finalize(const archive_num & archive, const datetime & deleted_date, const archive_num & ignore_archives_greater_or_equal) { map::iterator it = last_mod.begin(); bool presence_max = false; archive_num num_max = 0; datetime last_mtime = datetime(0); // used as deleted_date for EA if last mtime is found bool found_in_archive = false; // checking the last_mod map while(it != last_mod.end() && !found_in_archive) { if(it->first == archive && it->second.present != et_absent) found_in_archive = true; else if(it->first > num_max && (it->first < ignore_archives_greater_or_equal || ignore_archives_greater_or_equal == 0)) { num_max = it->first; switch(it->second.present) { case et_saved: case et_present: presence_max = true; last_mtime = it->second.date; // used as deleted_data for EA break; case et_removed: case et_absent: presence_max = false; last_mtime = it->second.date; // keeping this date as it is // not possible to know when the EA have been removed // since it does not change mtime of file nor of its parent // directory (this is an heuristic). break; default: throw SRC_BUG; } } ++it; } if(!found_in_archive) // not entry found for asked archive (or recorded as et_absent) { if(presence_max) { // the most recent entry found stated that this file // existed at the time "last_mtime" // and this entry is absent from the archive under addition // thus we must record that it has been removed in the // archive we currently add. if(deleted_date > last_mtime) set_data(archive, deleted_date, et_absent); // add an entry telling that this file does no more exist in the current archive else set_data(archive, last_mtime, et_absent); // add an entry telling thatthis file does no more exists, using the last known date // as deleted data. This situation may appear when one makes a first backup // then a second one but excluding from the backup that particular file. This file // may reappear later with if is backup included in the backup possibily with the same // date. In 2.4.x we added 1 second to the last known date to create the deleted date // which lead out of order warning to show for the database. Since 2.5.x date resolution // may be one microsecond (no more 1 second) thus we now keep the last known date as // delete date } else // the entry has been seen previously but as removed in the latest state, // if we already have an et_absent entry (which is possible during a reordering archive operation within a database), we can (and must) suppress it. { map::iterator it = last_mod.find(archive); if(it != last_mod.end()) // we have an entry associated to this archive { switch(it->second.present) { case et_saved: case et_present: throw SRC_BUG; // entry has not been found in the current archive case et_removed: break; // we must keep it, it was in the original archive case et_absent: last_mod.erase(it); // this entry had been added from previous neighbor archive, we must remove it now, it was not part of the original archive break; default: throw SRC_BUG; } } // else already absent from the base for this archive, cool. } } // else, entry found for the current archive ////////////////////// // now checking the last_change map // it = last_change.begin(); presence_max = false; num_max = 0; found_in_archive = false; while(it != last_change.end() && !found_in_archive) { if(it->first == archive && it->second.present != et_absent) found_in_archive = true; else if(it->first > num_max && (it->first < ignore_archives_greater_or_equal || ignore_archives_greater_or_equal == 0)) { num_max = it->first; switch(it->second.present) { case et_saved: case et_present: presence_max = true; break; case et_removed: case et_absent: presence_max = false; break; default: throw SRC_BUG; } } ++it; } if(!found_in_archive) // not entry found for asked archive { if(num_max != 0) // num_max may be equal to zero if this entry never had any EA in any recorded archive if(presence_max) set_EA(archive, (last_mtime < deleted_date ? deleted_date : last_mtime), et_absent); // add an entry telling that EA for this file do no more exist in the current archive // else last entry found stated the EA was removed, nothing more to do } // else, entry found for the current archive } bool data_tree::remove_all_from(const archive_num & archive_to_remove, const archive_num & last_archive) { map::iterator it = last_mod.begin(); // if this file was stored as "removed" in the archive we tend to remove from the database // this "removed" information is propagated to the next archive if both: // - the next archive exists and has no information recorded about this file // - this entry does not only exist in the archive about to be removed if(archive_to_remove < last_archive) { datetime del_date; etat status; if(last_mod.size() > 1 && read_data(archive_to_remove, del_date, status)) if(status == et_removed) { datetime tmp; if(!read_data(archive_to_remove + 1, tmp, status)) set_data(archive_to_remove + 1, del_date, et_removed); } if(last_change.size() > 1 && read_EA(archive_to_remove, del_date, status)) if(status == et_removed) { datetime tmp; if(!read_EA(archive_to_remove + 1, tmp, status)) set_EA(archive_to_remove + 1, del_date, et_removed); } } while(it != last_mod.end()) { if(it->first == archive_to_remove) { last_mod.erase(it); break; // stops the while loop, as there is at most one element with that key } else ++it; } it = last_change.begin(); while(it != last_change.end()) { if(it->first == archive_to_remove) { last_change.erase(it); break; // stops the while loop, as there is at most one element with that key } else ++it; } return last_mod.empty() && last_change.empty(); } void data_tree::listing(user_interaction & dialog) const { map::const_iterator it = last_mod.begin(); map::const_iterator ut = last_change.begin(); dialog.printf(gettext("Archive number | Data | status || EA | status \n")); dialog.printf(gettext("---------------+-------------------------+--------++-------------------------+----------\n")); while(it != last_mod.end() || ut != last_change.end()) { if(it != last_mod.end()) if(ut != last_change.end()) if(it->first == ut->first) { display_line(dialog, it->first, &(it->second.date), it->second.present, &(ut->second.date), ut->second.present); ++it; ++ut; } else // not in the same archive if(it->first < ut->first) // it only { display_line(dialog, it->first, &(it->second.date), it->second.present, nullptr, data_tree::et_removed); ++it; } else // ut only { display_line(dialog, ut->first, nullptr, data_tree::et_removed, &(ut->second.date), ut->second.present); ++ut; } else // ut at end of list thus it != last_mod.end() (see while condition) { display_line(dialog, it->first, &(it->second.date), it->second.present, nullptr, data_tree::et_removed); ++it; } else // it at end of list, this ut != last_change.end() (see while condition) { display_line(dialog, ut->first, nullptr, data_tree::et_removed, &(ut->second.date), ut->second.present); ++ut; } } } void data_tree::apply_permutation(archive_num src, archive_num dst) { map transfert; map::iterator it = last_mod.begin(); transfert.clear(); while(it != last_mod.end()) { transfert[data_tree_permutation(src, dst, it->first)] = it->second; ++it; } last_mod = transfert; transfert.clear(); it = last_change.begin(); while(it != last_change.end()) { transfert[data_tree_permutation(src, dst, it->first)] = it->second; ++it; } last_change = transfert; } void data_tree::skip_out(archive_num num) { map resultant; map::iterator it = last_mod.begin(); infinint tmp; while(it != last_mod.end()) { if(it->first > num) resultant[it->first-1] = it->second; else resultant[it->first] = it->second; ++it; } last_mod = resultant; resultant.clear(); it = last_change.begin(); while(it != last_change.end()) { if(it->first > num) resultant[it->first-1] = it->second; else resultant[it->first] = it->second; ++it; } last_change = resultant; } void data_tree::compute_most_recent_stats(vector & data, vector & ea, vector & total_data, vector & total_ea) const { archive_num most_recent = 0; datetime max = datetime(0); map::const_iterator it = last_mod.begin(); while(it != last_mod.end()) { if(it->second.present == et_saved) { if(it->second.date >= max) { most_recent = it->first; max = it->second.date; } ++total_data[it->first]; } ++it; } if(most_recent > 0) ++data[most_recent]; most_recent = 0; max = datetime(0); it = last_change.begin(); while(it != last_change.end()) { if(it->second.present == et_saved) { if(it->second.date >= max) { most_recent = it->first; max = it->second.date; } ++total_ea[it->first]; } ++it; } if(most_recent > 0) ++ea[most_recent]; } // helper data structure for check_map_order method struct trecord { datetime date; bool set; trecord() { set = false; date = datetime(0); }; trecord(const trecord & ref) { date = ref.date; set = ref.set; }; const trecord & operator = (const trecord & ref) { date = ref.date; set = ref.set; return *this; }; }; bool data_tree::fix_corruption() { bool ret = true; map::iterator it = last_mod.begin(); while(it != last_mod.end() && ret) { if(it->second.present != et_removed && it->second.present != et_absent) ret = false; ++it; } it = last_change.begin(); while(it != last_change.end() && ret) { if(it->second.present != et_removed && it->second.present != et_absent) ret = false; ++it; } return ret; } bool data_tree::check_map_order(user_interaction & dialog, const map the_map, const path & current_path, const string & field_nature, bool & initial_warn) const { // some variable to work with around the_map U_I dates_size = the_map.size()+1; vector dates = vector(dates_size); map::const_iterator it = the_map.begin(); vector::iterator rec_it; datetime last_date = datetime(0); // now the algorithm // extracting dates from map into an ordered vector while(it != the_map.end()) { trecord rec; rec.date = it->second.date; rec.set = true; while(dates_size <= it->first) { dates.push_back(trecord()); ++dates_size; } dates[it->first] = rec; ++it; } // checking whether dates are sorted crescendo following the archive number rec_it = dates.begin(); while(rec_it != dates.end()) { if(rec_it->set) { if(rec_it->date >= last_date) last_date = rec_it->date; else // order is not respected { string tmp = current_path.display() == "." ? get_name() : (current_path + get_name()).display(); dialog.printf(gettext("Dates of file's %S are not increasing when database's archive number grows. Concerned file is: %S"), &field_nature, &tmp); if(initial_warn) { dialog.warning(gettext("Dates are not increasing for all files when database's archive number grows, working with this database may lead to improper file's restored version. Please reorder the archive within the database in the way that the older is the first archive and so on up to the most recent archive being the last of the database")); try { dialog.pause(gettext("Do you want to ignore the same type of error for other files?")); return false; } catch(Euser_abort & e) { initial_warn = false; } } break; // aborting the while loop } } ++rec_it; } return true; } //////////////////////////////////////////////////////////////// data_dir::data_dir(const string &name) : data_tree(name) { rejetons.clear(); } data_dir::data_dir(generic_file &f, unsigned char db_version) : data_tree(f, db_version) { infinint tmp = infinint(f); // number of children data_tree *entry = nullptr; rejetons.clear(); try { while(!tmp.is_zero()) { entry = read_from_file(f, db_version, get_pool()); if(entry == nullptr) throw Erange("data_dir::data_dir", gettext("Unexpected end of file")); rejetons.push_back(entry); entry = nullptr; --tmp; } } catch(...) { list::iterator next = rejetons.begin(); while(next != rejetons.end()) { delete *next; *next = nullptr; ++next; } if(entry != nullptr) delete entry; throw; } } data_dir::data_dir(const data_dir & ref) : data_tree(ref) { rejetons.clear(); } data_dir::data_dir(const data_tree & ref) : data_tree(ref) { rejetons.clear(); } data_dir::~data_dir() { list::iterator next = rejetons.begin(); while(next != rejetons.end()) { delete *next; *next = nullptr; ++next; } } void data_dir::dump(generic_file & f) const { list::const_iterator it = rejetons.begin(); infinint tmp = rejetons.size(); data_tree::dump(f); tmp.dump(f); while(it != rejetons.end()) { if(*it == nullptr) throw SRC_BUG; (*it)->dump(f); ++it; } } data_tree *data_dir::find_or_addition(const string & name, bool is_dir, const archive_num & archive) { const data_tree *fils = read_child(name); data_tree *ret = nullptr; if(fils == nullptr) // brand-new data_tree to build { if(is_dir) ret = new (get_pool()) data_dir(name); else ret = new (get_pool()) data_tree(name); if(ret == nullptr) throw Ememory("data_dir::find_or_addition"); add_child(ret); } else // already saved in another archive { // check if dir/file nature has changed const data_dir *fils_dir = dynamic_cast(fils); if(fils_dir == nullptr && is_dir) // need to upgrade data_tree to data_dir { ret = new (get_pool()) data_dir(*fils); // upgrade data_tree in an empty data_dir if(ret == nullptr) throw Ememory("data_dir::find_or_addition"); try { remove_child(name); add_child(ret); } catch(...) { delete ret; throw; } } else // no change in dir/file nature ret = const_cast(fils); } return ret; } void data_dir::add(const cat_inode *entry, const archive_num & archive) { const cat_directory *entry_dir = dynamic_cast(entry); data_tree * tree = find_or_addition(entry->get_name(), entry_dir != nullptr, archive); archive_num last_archive; lookup result; datetime last_mod = entry->get_last_modif() > entry->get_last_change() ? entry->get_last_modif() : entry->get_last_change(); switch(entry->get_saved_status()) { case s_saved: case s_fake: tree->set_data(archive, last_mod, et_saved); break; case s_not_saved: tree->set_data(archive, last_mod, et_present); break; default: throw SRC_BUG; } switch(entry->ea_get_saved_status()) { case cat_inode::ea_none: break; case cat_inode::ea_removed: result = tree->get_EA(last_archive, datetime(0), false); if(result == found_present || result == not_restorable) tree->set_EA(archive, entry->get_last_change(), et_removed); // else no need to add an et_remove entry in the map break; case cat_inode::ea_partial: tree->set_EA(archive, entry->get_last_change(), et_present); break; case cat_inode::ea_fake: case cat_inode::ea_full: tree->set_EA(archive, entry->get_last_change(), et_saved); break; default: throw SRC_BUG; } } void data_dir::add(const cat_detruit *entry, const archive_num & archive) { data_tree * tree = find_or_addition(entry->get_name(), false, archive); archive_num last_archive; lookup result; result = tree->get_data(last_archive, datetime(0), false); if(result == found_present || result == not_restorable) tree->set_data(archive, entry->get_date(), et_removed); result = tree->get_EA(last_archive, datetime(0), false); if(result == found_present || result == not_restorable) tree->set_EA(archive, entry->get_date(), et_removed); } const data_tree *data_dir::read_child(const string & name) const { list::const_iterator it = rejetons.begin(); while(it != rejetons.end() && *it != nullptr && (*it)->get_name() != name) ++it; if(it == rejetons.end()) return nullptr; else if(*it == nullptr) throw SRC_BUG; else return *it; } void data_dir::read_all_children(vector & fils) const { list::const_iterator it = rejetons.begin(); fils.clear(); while(it != rejetons.end()) fils.push_back((*it++)->get_name()); } bool data_dir::check_order(user_interaction & dialog, const path & current_path, bool & initial_warn) const { list::const_iterator it = rejetons.begin(); bool ret = data_tree::check_order(dialog, current_path, initial_warn); path subpath = current_path.display() == "." ? get_name() : current_path + get_name(); while(it != rejetons.end() && ret) { if(*it == nullptr) throw SRC_BUG; ret = (*it)->check_order(dialog, subpath, initial_warn); ++it; } return ret; } void data_dir::finalize(const archive_num & archive, const datetime & deleted_date, const archive_num & ignore_archives_greater_or_equal) { datetime new_deleted_date; archive_num tmp_archive; etat tmp_presence; data_tree::finalize(archive, deleted_date, ignore_archives_greater_or_equal); switch(get_data(tmp_archive, datetime(0), false)) { case found_present: case found_removed: break; // acceptable result case not_found: if(fix_corruption()) throw Edata("This is to signal the caller of this method that this object has to be removed from database"); // exception caugth in data_dir::finalize_except_self throw Erange("data_dir::finalize", gettext("This database has been corrupted probably due to a bug in release 2.4.0 to 2.4.9, and it has not been possible to cleanup this corruption, please rebuild the database from archives or extracted \"catalogues\", if the database has never been used by one of the previously mentioned released, you are welcome to open a bug report and provide as much as possible details about the circumstances")); case not_restorable: break; // also an acceptable result; default: throw SRC_BUG; } if(!read_data(tmp_archive, new_deleted_date, tmp_presence)) throw SRC_BUG; finalize_except_self(archive, new_deleted_date, ignore_archives_greater_or_equal); } void data_dir::finalize_except_self(const archive_num & archive, const datetime & deleted_date, const archive_num & ignore_archives_greater_or_equal) { list::iterator it = rejetons.begin(); while(it != rejetons.end()) { if(*it == nullptr) throw SRC_BUG; try { (*it)->finalize(archive, deleted_date, ignore_archives_greater_or_equal); ++it; } catch(Edata & e) { delete (*it); rejetons.erase(it); it = rejetons.begin(); } } } bool data_dir::remove_all_from(const archive_num & archive_to_remove, const archive_num & last_archive) { list::iterator it = rejetons.begin(); while(it != rejetons.end()) { if((*it) == nullptr) throw SRC_BUG; if((*it)->remove_all_from(archive_to_remove, last_archive)) { delete *it; // release the memory used by the object *it = nullptr; rejetons.erase(it); // remove the entry from the list it = rejetons.begin(); // does not seems "it" points to the next item after erase, so we restart from the beginning } else ++it; } return data_tree::remove_all_from(archive_to_remove, last_archive) && rejetons.size() == 0; } void data_dir::show(user_interaction & dialog, archive_num num, string marge) const { list::const_iterator it = rejetons.begin(); archive_num ou_data, ou_ea; bool data, ea; string etat, name; lookup lo_data, lo_ea; bool even_when_removed = (num != 0); while(it != rejetons.end()) { if(*it == nullptr) throw SRC_BUG; data_dir *dir = dynamic_cast(*it); lo_data = (*it)->get_data(ou_data, datetime(0), even_when_removed); lo_ea = (*it)->get_EA(ou_ea, datetime(0), even_when_removed); data = lo_data == found_present && (ou_data == num || num == 0); ea = lo_ea == found_present && (ou_ea == num || num == 0); name = (*it)->get_name(); if(data || ea || num == 0) { etat = ""; if(data) etat += gettext("[ Saved ]"); else etat += gettext("[ ]"); if(ea) etat += gettext("[ EA ]"); else etat += gettext("[ ]"); if(dialog.get_use_dar_manager_show_files()) dialog.dar_manager_show_files(name, data, ea); else dialog.printf("%S %S%S\n", &etat, &marge, &name); } if(dir != nullptr) dir->show(dialog, num, marge+name+"/"); ++it; } } void data_dir::apply_permutation(archive_num src, archive_num dst) { list::iterator it = rejetons.begin(); data_tree::apply_permutation(src, dst); while(it != rejetons.end()) { (*it)->apply_permutation(src, dst); ++it; } } void data_dir::skip_out(archive_num num) { list::iterator it = rejetons.begin(); data_tree::skip_out(num); while(it != rejetons.end()) { (*it)->skip_out(num); ++it; } } void data_dir::compute_most_recent_stats(vector & data, vector & ea, vector & total_data, vector & total_ea) const { list::const_iterator it = rejetons.begin(); data_tree::compute_most_recent_stats(data, ea, total_data, total_ea); while(it != rejetons.end()) { (*it)->compute_most_recent_stats(data, ea, total_data, total_ea); ++it; } } bool data_dir::fix_corruption() { while(rejetons.begin() != rejetons.end() && *(rejetons.begin()) != nullptr && (*(rejetons.begin()))->fix_corruption()) { delete *(rejetons.begin()); rejetons.erase(rejetons.begin()); } if(rejetons.begin() != rejetons.end()) return false; else return data_tree::fix_corruption(); } void data_dir::add_child(data_tree *fils) { if(fils == nullptr) throw SRC_BUG; rejetons.push_back(fils); } void data_dir::remove_child(const string & name) { list::iterator it = rejetons.begin(); while(it != rejetons.end() && *it != nullptr && (*it)->get_name() != name) ++it; if(it != rejetons.end()) { if(*it == nullptr) throw SRC_BUG; else rejetons.erase(it); } } //////////////////////////////////////////////////////////////// data_dir *data_tree_read(generic_file & f, unsigned char db_version, memory_pool *pool) { data_tree *lu = read_from_file(f, db_version, pool); data_dir *ret = dynamic_cast(lu); if(ret == nullptr && lu != nullptr) delete lu; return ret; } bool data_tree_find(path chemin, const data_dir & racine, const data_tree *& ptr) { string filename; const data_dir *current = &racine; bool loop = true; if(!chemin.is_relative()) throw SRC_BUG; while(loop) { if(!chemin.pop_front(filename)) { filename = chemin.display(); loop = false; } ptr = current->read_child(filename); if(ptr == nullptr) loop = false; if(loop) { current = dynamic_cast(ptr); if(current == nullptr) { loop = false; ptr = nullptr; } } } return ptr != nullptr; } void data_tree_update_with(const cat_directory *dir, archive_num archive, data_dir *racine) { const cat_nomme *entry; dir->reset_read_children(); while(dir->read_children(entry)) { const cat_directory *entry_dir = dynamic_cast(entry); const cat_inode *entry_ino = dynamic_cast(entry); const cat_mirage *entry_mir = dynamic_cast(entry); const cat_detruit *entry_det = dynamic_cast(entry); if(entry_mir != nullptr) { entry_ino = entry_mir->get_inode(); entry_mir->get_inode()->change_name(entry_mir->get_name()); } if(entry_ino == nullptr) if(entry_det != nullptr) { if(!entry_det->get_date().is_null()) racine->add(entry_det, archive); // else this is an old archive that does not store date with cat_detruit objects } else continue; // continue with next loop, we ignore entree objects that are neither inode nor cat_detruit else racine->add(entry_ino, archive); if(entry_dir != nullptr) // going into recursion { data_tree *new_root = const_cast(racine->read_child(entry->get_name())); data_dir *new_root_dir = dynamic_cast(new_root); if(new_root == nullptr) throw SRC_BUG; // the racine->add method did not add an item for "entry" if(new_root_dir == nullptr) throw SRC_BUG; // the racine->add method did not add a data_dir item data_tree_update_with(entry_dir, archive, new_root_dir); } } } archive_num data_tree_permutation(archive_num src, archive_num dst, archive_num x) { if(src < dst) if(x < src || x > dst) return x; else if(x == src) return dst; else return x-1; else if(src == dst) return x; else // src > dst if(x > src || x < dst) return x; else if(x == src) return dst; else return x+1; } } // end of namespace //////////////////////////////////////////////////////////////// static data_tree *read_from_file(generic_file & f, unsigned char db_version, memory_pool *pool) { char sign; data_tree *ret; if(f.read(&sign, 1) != 1) return nullptr; // nothing more to read if(sign == data_tree::signature()) ret = new (pool) data_tree(f, db_version); else if(sign == data_dir::signature()) ret = new (pool) data_dir(f, db_version); else throw Erange("read_from_file", gettext("Unknown record type")); if(ret == nullptr) throw Ememory("read_from_file"); return ret; } static void read_from_file(generic_file &f, archive_num &a) { char buffer[sizeof(archive_num)]; archive_num *ptr = (archive_num *)&(buffer[0]); f.read(buffer, sizeof(archive_num)); a = ntohs(*ptr); } static void write_to_file(generic_file &f, archive_num a) { char buffer[sizeof(archive_num)]; archive_num *ptr = (archive_num *)&(buffer[0]); *ptr = htons(a); f.write(buffer, sizeof(archive_num)); } static void display_line(user_interaction & dialog, archive_num num, const datetime *data, data_tree::etat data_presence, const datetime *ea, data_tree::etat ea_presence) { const string REMOVED = gettext("removed "); const string PRESENT = gettext("present "); const string SAVED = gettext("saved "); const string ABSENT = gettext("absent "); const string NO_DATE = " "; string data_state; string ea_state; string data_date; string ea_date; switch(data_presence) { case data_tree::et_saved: data_state = SAVED; break; case data_tree::et_present: data_state = PRESENT; break; case data_tree::et_removed: data_state = REMOVED; break; case data_tree::et_absent: data_state = ABSENT; break; default: throw SRC_BUG; } switch(ea_presence) { case data_tree::et_saved: ea_state = SAVED; break; case data_tree::et_present: ea_state = PRESENT; break; case data_tree::et_removed: ea_state = REMOVED; break; case data_tree::et_absent: throw SRC_BUG; // state not used for EA default: throw SRC_BUG; } if(data == nullptr) { data_state = ABSENT; data_date = NO_DATE; } else data_date = tools_display_date(*data); if(ea == nullptr) { ea_state = ABSENT; ea_date = NO_DATE; } else ea_date = tools_display_date(*ea); if(dialog.get_use_dar_manager_show_version()) dialog.dar_manager_show_version(num, data_date, data_state, ea_date, ea_state); else dialog.printf(" \t%u\t%S %S %S %S\n", num, &data_date, &data_state, &ea_date, &ea_state); } dar-2.5.3/src/libdar/generic_thread.hpp0000644000175000017430000001141712641772777014742 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file generic_thread.hpp /// \brief class generic_thread provides a way to interact with a generic_file ran in an other thread /// \ingroup Private /// #ifndef GENERIC_THREAD_HPP #define GENERIC_THREAD_HPP #include "../my_config.h" #include "generic_file.hpp" #include "messaging.hpp" #include "slave_thread.hpp" #include "erreurs.hpp" namespace libdar { class generic_thread : public generic_file { public: // default values for constuctor static const unsigned int tampon_block_size = 102401; static const unsigned int tampon_num_block = 1000; static const unsigned int tampon_block_size_ctrl = 1024; static const unsigned int tampon_num_block_ctrl = 10; /// constructor /// /// \param[in] ptr is the generic_file that will be read from/written to by a separated thread /// \param[in] block_size is the size of block used to pass information to and from the remote thread /// \param[in] num_block maximum number of blocks that can be sent without being retrieved by the other threads /// \note that the pointed to generic_file must exist during the whole life of the generic_thread. Its memory /// management after the generic_thread has died is under the responsibility of the caller of the generic_thread generic_thread(generic_file *ptr, U_I data_block_size = tampon_block_size, U_I data_num_block = tampon_num_block, U_I ctrl_block_size = tampon_block_size_ctrl, U_I ctrl_num_block = tampon_num_block_ctrl); generic_thread(const generic_thread & ref); //< copy constructor is disabled (throws exception) const generic_thread & operator = (const generic_thread & ref) { throw SRC_BUG; }; virtual ~generic_thread(); // inherited methods from generic_file virtual bool skippable(skippability direction, const infinint & amount); virtual bool skip(const infinint & pos); virtual bool skip_to_eof(); virtual bool skip_relative(S_I x); virtual infinint get_position() const; protected: // inherited from generic_file virtual void inherited_read_ahead(const infinint & amount); virtual U_I inherited_read(char *a, U_I size); virtual void inherited_write(const char *a, U_I size); /// generic_file inherited method to sync all pending writes /// /// \note no data in transit in this object so we should not do anything, /// however for performance propagating the order to slave_thread virtual void inherited_sync_write(); virtual void inherited_flush_read(); virtual void inherited_terminate(); private: libthreadar::fast_tampon toslave_data; libthreadar::fast_tampon tomaster_data; libthreadar::fast_tampon toslave_ctrl; libthreadar::fast_tampon tomaster_ctrl; slave_thread *remote; bool reached_eof; //< whether we reached end of file char data_header; //< contains 1 byte header for data char data_header_eof; //< contains 1 byte header for data + eof bool running; //< whether a remote is expected to run, tid is then set pthread_t tid; //< thread id of remote // the following variables are locally used in quite all methods // they do not contain valuable information outside each method call messaging_encode order; messaging_decode answer; unsigned int num; char *ptr; label dataname; void send_order(); void read_answer(); //< \note ptr must be released/recycled after this call void check_answer(msg_type expected); void wake_up_slave_if_asked(); //< check whether an order to wakeup the slave has been received, and send wake up the slave void release_block_answer() { tomaster_ctrl.fetch_recycle(ptr); ptr = nullptr; }; void release_data_ptr(); void purge_data_pipe(); //< drops all data in the toslave_data pipe void my_run(); void my_join(); }; } // end of namespace #endif dar-2.5.3/src/libdar/criterium.cpp0000644000175000017430000006631312642474445013772 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "criterium.hpp" #include "nls_swap.hpp" #include "cat_all_entrees.hpp" using namespace std; namespace libdar { static const char *signature2string(unsigned char sign); testing::testing(const criterium & input, const crit_action & go_true, const crit_action & go_false) { x_input = input.clone(); x_go_true = go_true.clone(); x_go_false = go_false.clone(); if(!check()) { free(); throw Ememory("testing::testing"); } } void testing::free() { if(x_input != nullptr) { delete x_input; x_input = nullptr; } if(x_go_true != nullptr) { delete x_go_true; x_go_true = nullptr; } if(x_go_false != nullptr) { delete x_go_false; x_go_false = nullptr; } } void testing::copy_from(const testing & ref) { x_input = ref.x_input->clone(); x_go_true = ref.x_go_true->clone(); x_go_false = ref.x_go_false->clone(); if(!check()) { free(); throw Ememory("testing::copy_from"); } } bool testing::check() const { return x_input != nullptr && x_go_true != nullptr && x_go_false != nullptr; } void crit_chain::add(const crit_action & act) { crit_action *tmp = act.clone(); if(tmp == nullptr) throw Ememory("crit_chain::add"); sequence.push_back(tmp); } void crit_chain::gobe(crit_chain & to_be_voided) { vector::iterator it = to_be_voided.sequence.begin(); try { while(it != to_be_voided.sequence.end()) { if(*it == nullptr) throw SRC_BUG; sequence.push_back(*it); ++it; } to_be_voided.sequence.clear(); } catch(...) { if(it != to_be_voided.sequence.end() && sequence.back() == *it) ++it; while(it != to_be_voided.sequence.end()) { if(*it != nullptr) { delete *it; *it = nullptr; } ++it; } to_be_voided.sequence.clear(); throw; } } void crit_chain::get_action(const cat_nomme & first, const cat_nomme & second, over_action_data & data, over_action_ea & ea) const { NLS_SWAP_IN; try { vector::const_iterator it = sequence.begin(); over_action_data tmp_data; over_action_ea tmp_ea; data = data_undefined; ea = EA_undefined; if(it == sequence.end()) throw Erange("crit_chain::get_action", gettext("cannot evaluate an empty chain in an overwriting policy")); while(it != sequence.end() && (data == data_undefined || ea == EA_undefined)) { if(*it == nullptr) throw SRC_BUG; (*it)->get_action(first, second, tmp_data, tmp_ea); if(data == data_undefined || tmp_data != data_undefined) data = tmp_data; if(ea == EA_undefined || tmp_ea != EA_undefined) ea = tmp_ea; ++it; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void crit_chain::destroy() { vector::iterator it = sequence.begin(); while(it != sequence.end()) { if(*it != nullptr) { delete *it; *it = nullptr; } ++it; } sequence.clear(); } void crit_chain::copy_from(const crit_chain & ref) { vector::const_iterator it = ref.sequence.begin(); crit_action * tmp = nullptr; sequence.clear(); try { while(it != ref.sequence.end()) { if(*it == nullptr) throw SRC_BUG; tmp = (*it)->clone(); if(tmp == nullptr) throw Ememory("crit_chain::copy_from"); sequence.push_back(tmp); tmp = nullptr; ++it; } } catch(...) { destroy(); if(tmp != nullptr) delete tmp; throw; } } ///////////////////////////////////////////////////////////////////// //////////// implementation of criterium classes follows //////////// ///////////////////////////////////////////////////////////////////// const cat_inode *criterium::get_inode(const cat_nomme *arg) { const cat_inode *ret; const cat_mirage *arg_m = dynamic_cast(arg); if(arg_m != nullptr) ret = const_cast(arg_m->get_inode()); else ret = dynamic_cast(arg); return ret; } bool crit_in_place_is_inode::evaluate(const cat_nomme &first, const cat_nomme &second) const { return dynamic_cast(&first) != nullptr || dynamic_cast(&first) != nullptr; } bool crit_in_place_is_file::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); return dynamic_cast(first_i) != nullptr && dynamic_cast(first_i) == nullptr; } bool crit_in_place_is_hardlinked_inode::evaluate(const cat_nomme &first, const cat_nomme &second) const { return dynamic_cast(&first) != nullptr; } bool crit_in_place_is_new_hardlinked_inode::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_mirage * tmp = dynamic_cast(&first); return tmp != nullptr && tmp->is_first_mirage(); } bool crit_in_place_data_more_recent::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_inode *second_i = get_inode(&second); datetime first_date = first_i != nullptr ? first_i->get_last_modif() : datetime(0); datetime second_date = second_i != nullptr ? second_i->get_last_modif() : datetime(0); return first_i == nullptr || first_date >= second_date || tools_is_equal_with_hourshift(x_hourshift, first_date, second_date); } bool crit_in_place_data_more_recent_or_equal_to::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); datetime first_date = first_i != nullptr ? first_i->get_last_modif() : datetime(0); return first_i == nullptr || first_date >= x_date || tools_is_equal_with_hourshift(x_hourshift, first_date, x_date); } bool crit_in_place_data_bigger::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_inode *second_i = get_inode(&second); const cat_file *first_f = dynamic_cast(first_i); const cat_file *second_f = dynamic_cast(second_i); if(first_f != nullptr && second_f != nullptr) return first_f->get_size() >= second_f->get_size(); else return true; } bool crit_in_place_data_saved::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); if(first_i != nullptr) return first_i->get_saved_status() == s_saved; else return true; } bool crit_in_place_data_dirty::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_file *first_f = dynamic_cast(first_i); if(first_f != nullptr) return first_f->is_dirty(); else return false; } bool crit_in_place_data_sparse::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_file *first_f = dynamic_cast(first_i); if(first_f != nullptr) return first_f->get_sparse_file_detection_read(); else return false; } bool crit_in_place_EA_more_recent::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_inode *second_i = get_inode(&second); datetime ctime_f, ctime_s; if(first_i != nullptr) { switch(first_i->ea_get_saved_status()) { case cat_inode::ea_none: case cat_inode::ea_removed: ctime_f = datetime(0); break; default: ctime_f = first_i->get_last_change(); } } else ctime_f = datetime(0); if(second_i != nullptr) { switch(second_i->ea_get_saved_status()) { case cat_inode::ea_none: case cat_inode::ea_removed: return true; break; default: ctime_s = second_i->get_last_change(); } } else return true; return ctime_f >= ctime_s || tools_is_equal_with_hourshift(x_hourshift, ctime_f, ctime_s); } bool crit_in_place_EA_more_recent_or_equal_to::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); datetime ctime_f; if(first_i != nullptr) { switch(first_i->ea_get_saved_status()) { case cat_inode::ea_none: case cat_inode::ea_removed: ctime_f = datetime(0); break; default: ctime_f = first_i->get_last_change(); } } else ctime_f = datetime(0); return ctime_f >= x_date || tools_is_equal_with_hourshift(x_hourshift, ctime_f, x_date); } bool crit_in_place_more_EA::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_inode *second_i = get_inode(&second); infinint first_nEA, second_nEA; if(first_i != nullptr) { switch(first_i->ea_get_saved_status()) { case cat_inode::ea_full: first_nEA = first_i->get_ea()->size(); break; default: first_nEA = 0; } } else first_nEA = 0; if(second_i != nullptr) { switch(second_i->ea_get_saved_status()) { case cat_inode::ea_full: second_nEA = second_i->get_ea()->size(); break; default: second_nEA = 0; } } else second_nEA = 0; return first_nEA >= second_nEA; } bool crit_in_place_EA_bigger::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_inode *second_i = get_inode(&second); infinint first_EA_size, second_EA_size; if(first_i != nullptr) { switch(first_i->ea_get_saved_status()) { case cat_inode::ea_full: first_EA_size = first_i->get_ea()->space_used(); break; default: first_EA_size = 0; } } else first_EA_size = 0; if(second_i != nullptr) { switch(second_i->ea_get_saved_status()) { case cat_inode::ea_full: second_EA_size = second_i->get_ea()->space_used(); break; default: second_EA_size = 0; } } else second_EA_size = 0; return first_EA_size >= second_EA_size; } bool crit_in_place_EA_saved::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); return first_i != nullptr && first_i->ea_get_saved_status() == cat_inode::ea_full; } bool crit_same_type::evaluate(const cat_nomme &first, const cat_nomme &second) const { const cat_inode *first_i = get_inode(&first); const cat_inode *second_i = get_inode(&second); const cat_file * first_file = dynamic_cast(first_i); const cat_lien * first_lien = dynamic_cast(first_i); const cat_directory * first_dir = dynamic_cast(first_i); const cat_chardev * first_char = dynamic_cast(first_i); const cat_blockdev * first_block = dynamic_cast(first_i); const cat_tube * first_tube = dynamic_cast(first_i); const cat_prise * first_prise = dynamic_cast(first_i); const cat_detruit *first_detruit = dynamic_cast(&first); // first not first_i here ! const cat_file * second_file = dynamic_cast(second_i); const cat_lien * second_lien = dynamic_cast(second_i); const cat_directory * second_dir = dynamic_cast(second_i); const cat_chardev * second_char = dynamic_cast(second_i); const cat_blockdev * second_block = dynamic_cast(second_i); const cat_tube * second_tube = dynamic_cast(second_i); const cat_prise * second_prise = dynamic_cast(second_i); const cat_detruit *second_detruit = dynamic_cast(&second); // second not second_i here ! return (first_file != nullptr && second_file != nullptr) || (first_lien != nullptr && second_lien != nullptr) || (first_dir != nullptr && second_dir != nullptr) || (first_char != nullptr && second_char != nullptr) || (first_block != nullptr && second_block != nullptr) || (first_tube != nullptr && second_tube != nullptr) || (first_prise != nullptr && second_prise != nullptr) || (first_detruit != nullptr && second_detruit != nullptr); } void crit_not::copy_from(const crit_not & ref) { if(ref.x_crit == nullptr) throw SRC_BUG; if(ref.x_crit == nullptr) throw SRC_BUG; x_crit = ref.x_crit->clone(); if(x_crit == nullptr) throw Ememory("crit_not::copy_from"); } void crit_and::add_crit(const criterium & ref) { criterium *cloned = ref.clone(); if(cloned == nullptr) throw Ememory("crit_and::add_crit"); try { operand.push_back(cloned); } catch(...) { if(operand.back() == cloned) operand.pop_back(); delete cloned; throw; } } void crit_and::gobe(crit_and & to_be_voided) { vector::iterator it = to_be_voided.operand.begin(); try { while(it != to_be_voided.operand.end()) { if(*it == nullptr) throw SRC_BUG; operand.push_back(*it); ++it; } to_be_voided.operand.clear(); } catch(...) { if(it != to_be_voided.operand.end() && operand.back() == *it) ++it; while(it != to_be_voided.operand.end()) { if(*it != nullptr) { delete *it; *it = nullptr; } ++it; } to_be_voided.operand.clear(); throw; } } bool crit_and::evaluate(const cat_nomme & first, const cat_nomme & second) const { bool ret = true; NLS_SWAP_IN; try { vector::const_iterator it = operand.begin(); if(it == operand.end()) throw Erange("crit_and::evaluate", gettext("Cannot evaluate this crit_and criterium as no criterium has been added to it")); while(ret && it != operand.end()) { ret &= (*it)->evaluate(first, second); ++it; }; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } void crit_and::copy_from(const crit_and & ref) { vector::const_iterator it = ref.operand.begin(); operand.clear(); try { criterium *cloned; while(it != ref.operand.end()) { cloned = (*it)->clone(); if(cloned == nullptr) throw Ememory("crit_add::copy_from"); operand.push_back(cloned); ++it; } } catch(...) { detruit(); throw; } } void crit_and::detruit() { vector::iterator it = operand.begin(); while(it != operand.end()) { if(*it != nullptr) { delete *it; *it = nullptr; } ++it; } operand.clear(); } bool crit_or::evaluate(const cat_nomme & first, const cat_nomme & second) const { bool ret = false; NLS_SWAP_IN; try { vector::const_iterator it = operand.begin(); if(it == operand.end()) throw Erange("crit_or::evaluate", gettext("Cannot evaluate this crit_or criterium as no criterium has been added to it")); while(!ret && it != operand.end()) { ret |= (*it)->evaluate(first, second); ++it; }; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } over_action_data crit_ask_user_for_data_action(user_interaction & dialog, const string & full_name, const cat_entree *already_here, const cat_entree *dolly) { over_action_data ret = data_undefined; NLS_SWAP_IN; try { const string confirm = gettext("yes"); bool loop = true; string resp; while(loop) { dialog.printf(gettext("Conflict found while selecting the file to retain in the resulting archive:")); dialog.printf(gettext("User Decision requested for data of file %S"), &full_name); crit_show_entry_info(dialog, full_name, already_here, dolly); resp = dialog.get_string(gettext("\nYour decision about file's data:\n[P]reserve\n[O]verwrite\nmark [S]aved and preserve\nmark saved and overwri[T]e\n[R]emove\n[*] keep undefined\n[A]bort\n Your Choice? "), true); if(resp.size() != 1) dialog.warning(gettext("Please answer by the character between brackets ('[' and ']') and press return")); else { switch(*resp.begin()) { case 'P': ret = data_preserve; loop = false; break; case 'O': ret = data_overwrite; loop = false; break; case 'S': ret = data_preserve_mark_already_saved; loop = false; break; case 'T': ret = data_overwrite_mark_already_saved; loop = false; break; case 'R': ret = data_remove; loop = false; break; case '*': ret = data_undefined; loop = false; break; case 'A': resp = dialog.get_string(tools_printf(gettext("Warning, are you sure you want to abort (please answer \"%S\" to confirm)? "), &confirm), true); if(resp == confirm) throw Ethread_cancel(false, 0); else dialog.warning(gettext("Cancellation no confirmed")); break; default: dialog.warning(string(gettext("Unknown choice: ")) + resp); } } } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } over_action_ea crit_ask_user_for_EA_action(user_interaction & dialog, const string & full_name, const cat_entree *already_here, const cat_entree *dolly) { over_action_ea ret = EA_undefined; NLS_SWAP_IN; try { const string confirm = gettext("yes"); bool loop = true; string resp; while(loop) { dialog.printf(gettext("Conflict found while selecting the file to retain in the resulting archive:")); dialog.printf(gettext("User Decision requested for EA of file %S"), &full_name); crit_show_entry_info(dialog, full_name, already_here, dolly); resp = dialog.get_string(gettext("\nYour decision about file's EA:\n[p]reserve\n[o]verwrite\nmark [s]aved and preserve\nmark saved and overwri[t]e\n[m]erge EA and preserve\nmerge EA a[n]d overwrite\n[r]emove\n[*] keep undefined\n[a]bort\n Your choice? "), true); if(resp.size() != 1) dialog.warning(gettext("Please answer by the character between brackets ('[' and ']') and press return")); else { switch(*resp.begin()) { case 'p': ret = EA_preserve; loop = false; break; case 'o': ret = EA_overwrite; loop = false; break; case 's': ret = EA_preserve_mark_already_saved; loop = false; break; case 't': ret = EA_overwrite_mark_already_saved; loop = false; break; case 'm': ret = EA_merge_preserve; loop = false; break; case 'n': ret = EA_merge_overwrite; loop = false; break; case 'r': ret = EA_clear; loop = false; break; case '*': ret = EA_undefined; loop = false; break; case 'a': resp = dialog.get_string(tools_printf(gettext("Warning, are you sure you want to abort (please answer \"%S\" to confirm)? "), &confirm), true); if(resp == confirm) throw Ethread_cancel(false, 0); else dialog.warning(gettext("Cancellation no confirmed")); break; default: dialog.warning(string(gettext("Unknown choice: ")) + resp); } } } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } over_action_ea crit_ask_user_for_FSA_action(user_interaction & dialog, const string & full_name, const cat_entree *already_here, const cat_entree *dolly) { over_action_ea ret = EA_undefined; NLS_SWAP_IN; try { const string confirm = gettext("yes"); bool loop = true; string resp; while(loop) { dialog.printf(gettext("Conflict found while selecting the file to retain in the resulting archive:")); dialog.printf(gettext("User Decision requested for FSA of file %S"), &full_name); crit_show_entry_info(dialog, full_name, already_here, dolly); resp = dialog.get_string(gettext("\nYour decision about file's FSA:\n[p]reserve\n[o]verwrite\nmark [s]aved and preserve\nmark saved and overwri[t]e\n[*] keep undefined\n[a]bort\n Your choice? "), true); if(resp.size() != 1) dialog.warning(gettext("Please answer by the character between brackets ('[' and ']') and press return")); else { switch(*resp.begin()) { case 'p': ret = EA_preserve; loop = false; break; case 'o': ret = EA_overwrite; loop = false; break; case 's': ret = EA_preserve_mark_already_saved; loop = false; break; case 't': ret = EA_overwrite_mark_already_saved; loop = false; break; case '*': ret = EA_undefined; loop = false; break; case 'a': resp = dialog.get_string(tools_printf(gettext("Warning, are you sure you want to abort (please answer \"%S\" to confirm)? "), &confirm), true); if(resp == confirm) throw Ethread_cancel(false, 0); else dialog.warning(gettext("Cancellation no confirmed")); break; default: dialog.warning(string(gettext("Unknown choice: ")) + resp); } } } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return ret; } void crit_show_entry_info(user_interaction & dialog, const string & full_name, const cat_entree *already_here, const cat_entree *dolly) { NLS_SWAP_IN; try { const string yes = gettext("YES"); const string no = gettext("NO"); const cat_inode * al_inode = dynamic_cast(already_here); const cat_directory * al_directory = dynamic_cast(already_here); const cat_file * al_file = dynamic_cast(already_here); const cat_mirage * al_mirage = dynamic_cast(already_here); const cat_inode * do_inode = dynamic_cast(dolly); const cat_directory * do_directory = dynamic_cast(dolly); const cat_file * do_file = dynamic_cast(dolly); const cat_mirage * do_mirage = dynamic_cast(dolly); dialog.printf(gettext("Entry information:\t\"in place\"\t\"to be added\"")); dialog.printf(gettext("Is inode :\t %S \t\t %S"), al_inode == nullptr ? &no : &yes , do_inode == nullptr ? &no : &yes); dialog.printf(gettext("Is directory :\t %S \t\t %S"), al_directory == nullptr ? &no : &yes , do_directory == nullptr ? &no : &yes); dialog.printf(gettext("Is plain file :\t %S \t\t %S"), al_file == nullptr ? &no : &yes , do_file == nullptr ? &no : &yes); dialog.printf(gettext("Is hard linked :\t %S \t\t %S"), al_mirage == nullptr ? &no : &yes , do_mirage == nullptr ? &no : &yes); dialog.printf(gettext("Entry type :\t %s \t %s"), signature2string(already_here->signature()), signature2string(dolly->signature())); if(al_inode != nullptr && do_inode != nullptr) { const string me = gettext("me"); const string notme = ""; bool in_place_data_recent = al_inode->get_last_modif() >= do_inode->get_last_modif(); bool in_place_ea_recent = al_inode->get_last_change() >= do_inode->get_last_change(); bool al_ea_saved = al_inode->ea_get_saved_status() == cat_inode::ea_full; bool do_ea_saved = do_inode->ea_get_saved_status() == cat_inode::ea_full; bool al_fsa_saved = al_inode->fsa_get_saved_status() == cat_inode::fsa_full; bool do_fsa_saved = do_inode->fsa_get_saved_status() == cat_inode::fsa_full; dialog.printf(gettext("Data more recent :\t %S \t\t %S"), in_place_data_recent ? &me : ¬me , in_place_data_recent ? ¬me : &me); if(al_file != nullptr && do_file != nullptr) { infinint al_size = al_file->get_size(); infinint do_size = do_file->get_size(); bool al_dirty = al_file->is_dirty(); bool do_dirty = do_file->is_dirty(); bool al_sparse = al_file->get_sparse_file_detection_read(); bool do_sparse = do_file->get_sparse_file_detection_read(); dialog.printf(gettext("Data size :\t %i \t\t %i"), &al_size, &do_size); dialog.printf(gettext("Sparse file :\t %S \t\t %S"), al_sparse ? &yes : &no, do_sparse ? &yes : &no); dialog.printf(gettext("Dirty file :\t %S \t\t %S"), al_dirty ? &yes : &no, do_dirty ? &yes : &no); } dialog.printf(gettext("Data full saved :\t %S \t\t %S"),al_inode->get_saved_status() == s_saved ? &yes:&no , do_inode->get_saved_status() == s_saved ? &yes:&no); dialog.printf(gettext("EA full saved :\t %S \t\t %S"),al_ea_saved ? &yes:&no , do_ea_saved ? &yes:&no); if(al_ea_saved || do_ea_saved) dialog.printf(gettext("EA more recent :\t %S \t\t %S"),in_place_ea_recent ? &me : ¬me , in_place_data_recent ? ¬me : &me); dialog.printf(gettext("FSA full saved :\t %S \t\t %S"), al_fsa_saved ? &yes:&no , do_fsa_saved ? &yes:&no); if(al_fsa_saved || do_fsa_saved) { string al_fam = al_fsa_saved ? fsa_scope_to_string(al_fsa_saved, al_inode->fsa_get_families()) : "-"; string do_fam = do_fsa_saved ? fsa_scope_to_string(do_fsa_saved, do_inode->fsa_get_families()) : "-"; dialog.printf(gettext("FSA familly :\t %S \t\t %S"), &al_fam, &do_fam); } if(al_ea_saved && do_ea_saved) { const ea_attributs *al_ea = al_inode->get_ea(); const ea_attributs *do_ea = do_inode->get_ea(); infinint al_tmp = al_ea->size(); infinint do_tmp = do_ea->size(); dialog.printf(gettext("EA number :\t %i \t\t %i"), &al_tmp, &do_tmp); al_tmp = al_ea->space_used(); do_tmp = do_ea->space_used(); dialog.printf(gettext("EA size :\t %i \t\t %i"), &al_tmp, &do_tmp); } } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } static const char *signature2string(unsigned char sign) { unsigned char normalized_sig = toupper(sign); switch(normalized_sig) { case 'D': return gettext("directory"); case 'Z': throw SRC_BUG; // EOD should never be considered by overwriting policy case 'M': return gettext("hard linked inode"); case 'F': return gettext("plain file"); case 'L': return gettext("soft link"); case 'C': return gettext("char device"); case 'B': return gettext("block device"); case 'P': return gettext("named pipe"); case 'S': return gettext("unix socket"); case 'X': return gettext("deleted entry"); case 'O': return gettext("door inode"); case 'I': throw SRC_BUG; // ignored entry should never be found in an archive case 'J': throw SRC_BUG; // ignored directory entry should never be found in an archive default: throw SRC_BUG; // unknown entry type } } } // end of namespace dar-2.5.3/src/libdar/cat_ignored_dir.hpp0000644000175000017430000000426512641772777015116 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_ignored_dir.hpp /// \brief class used to remember in a catalogue that a cat_directory has been ignored /// \ingroup Private #ifndef CAT_IGNORED_DIR_HPP #define CAT_IGNORED_DIR_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_inode.hpp" #include "cat_directory.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the ignored cat_directory class, to be promoted later as empty cat_directory if needed class cat_ignored_dir : public cat_inode { public: cat_ignored_dir(const cat_directory &target) : cat_inode(target) {}; cat_ignored_dir(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, bool small) : cat_inode(dialog, pdesc, reading_ver, s_not_saved, small) { throw SRC_BUG; }; bool operator == (const cat_entree & ref) const; unsigned char signature() const { return 'j'; }; cat_entree *clone() const { return new (get_pool()) cat_ignored_dir(*this); }; protected: void inherited_dump(const pile_descriptor & pdesc, bool small) const; // behaves like an empty cat_directory }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_lien.cpp0000644000175000017430000000653612641772777013556 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_lien.hpp" using namespace std; namespace libdar { cat_lien::cat_lien(const infinint & uid, const infinint & gid, U_16 perm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const string & name, const string & target, const infinint & fs_device) : cat_inode(uid, gid, perm, last_access, last_modif, last_change, name, fs_device) { points_to = target; set_saved_status(s_saved); } cat_lien::cat_lien(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small) : cat_inode(dialog, pdesc, reading_ver, saved, small) { generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; if(saved == s_saved) tools_read_string(*ptr, points_to); } bool cat_lien::operator == (const cat_entree & ref) const { const cat_lien *ref_lien = dynamic_cast(&ref); if(ref_lien == nullptr) return false; else return points_to == ref_lien->points_to && cat_inode::operator == (ref); } const string & cat_lien::get_target() const { if(get_saved_status() != s_saved) throw SRC_BUG; return points_to; } void cat_lien::set_target(string x) { set_saved_status(s_saved); points_to = x; } void cat_lien::sub_compare(const cat_inode & other, bool isolated_mode) const { const cat_lien *l_other = dynamic_cast(&other); if(l_other == nullptr) throw SRC_BUG; // bad argument cat_inode::compare has a bug if(get_saved_status() == s_saved && l_other->get_saved_status() == s_saved) if(get_target() != l_other->get_target()) throw Erange("cat_lien:sub_compare", string(gettext("symbolic link does not point to the same target: ")) + get_target() + " <--> " + l_other->get_target()); } void cat_lien::inherited_dump(const pile_descriptor & pdesc, bool small) const { generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; cat_inode::inherited_dump(pdesc, small); if(get_saved_status() == s_saved) tools_write_string(*ptr, points_to); } } // end of namespace dar-2.5.3/src/libdar/sparse_file.cpp0000644000175000017430000003045412641773000014244 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include "sparse_file.hpp" #define BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < BUFFER_SIZE #undef BUFFER_SIZE #define BUFFER_SIZE SSIZE_MAX #endif #endif #include "crc.hpp" using namespace std; namespace libdar { // sparse_file class static members: bool sparse_file::initialized = false; unsigned char sparse_file::zeroed_field[SPARSE_FIXED_ZEROED_BLOCK]; // sparse_file::sparse_file(generic_file *below, const infinint & hole_size) : escape(below, std::set()), zero_count(0), offset(0) { // change the escape sequences fixed part to not collide with a possible underlying (the "below" object or below this "below" object) escape object change_fixed_escape_sequence(ESCAPE_FIXED_SEQUENCE_SPARSE_FILE); if(!initialized) { // we avoid the cost of using a mutex, as even if two or more threads execute this statement at the same time, // the first to finish will avoid other new thread to change these values executing this code, // while the thread already executing this code, will just redo the same thing as what has been done by the first thread to finish // thread (zero the area to zeros). (void)memset(zeroed_field, 0, SPARSE_FIXED_ZEROED_BLOCK); initialized = true; } reset(); copy_to_no_skip = false; if(below == nullptr) throw SRC_BUG; min_hole_size = hole_size; UI_min_hole_size = 0; min_hole_size.unstack(UI_min_hole_size); if(!min_hole_size.is_zero()) // hole size is larger than maximum buffer UI_min_hole_size = 0; // disabling hole lookup inside buffers (faster execution) min_hole_size = hole_size; // setting back min_hole_size to its value } infinint sparse_file::get_position() const { if(is_terminated()) throw SRC_BUG; switch(get_mode()) { case gf_read_only: if(zero_count > offset) throw SRC_BUG; return offset - zero_count; case gf_write_only: return offset + zero_count; default: throw SRC_BUG; } } U_I sparse_file::inherited_read(char *a, U_I size) { U_I lu = 0; bool eof = false; U_I tmp; U_I needed; if(escape_read) return escape::inherited_read(a, size); while(lu < size && ! eof) { needed = size - lu; switch(mode) { case hole: if(zero_count.is_zero()) // start of a new hole { if(!next_to_read_is_mark(seqt_file)) { sequence_type t; if(next_to_read_is_which_mark(t)) if(t == seqt_file) throw SRC_BUG; else throw Erange("sparse_file::inherited_read", gettext("Incoherent structure in data carrying sparse files: unknown mark")); // we were not at the end of file, while an escape sequence different from seqt_file was met else eof = true; // no mark next to be read, thus we are at EOF for real } else if(skip_to_next_mark(seqt_file, false)) { read_as_escape(true); try { try { zero_count.read(*this); } catch(Egeneric &e) { e.prepend_message("Error while reading the size of a hole:"); throw; } } catch(...) { read_as_escape(false); throw; } read_as_escape(false); seen_hole = true; offset += zero_count; } else throw SRC_BUG; // the next to read mark was seqt_file, but could not skip forward to that mark !?! } else // zero_count > 0 , whe have not yet read all the bytes of the hole { U_I available = 0; zero_count.unstack(available); if(available == 0) throw SRC_BUG; // could not unstack, but zero_count not equal to zero !?! else { if(needed < available) { (void)memset(a + lu, 0, needed); zero_count += available - needed; lu += needed; } else { (void)memset(a + lu, 0, available); lu += available; // zero_count is already null, due to previous call to unstack() } } if(zero_count.is_zero()) mode = normal; } break; case normal: tmp = escape::inherited_read(a + lu, needed); if(has_escaped_data_since_last_skip()) data_escaped = true; offset += tmp; lu += tmp; if(tmp < needed) { zero_count = 0; mode = hole; } break; default: throw SRC_BUG; } } return lu; } void sparse_file::copy_to(generic_file &ref, const infinint & crc_size, crc * & value) { char buffer[BUFFER_SIZE]; S_I lu; bool loop = true; bool last_is_skip = false; if(is_terminated()) throw SRC_BUG; if(!crc_size.is_zero()) { value = create_crc_from_size(crc_size, get_pool()); if(value == nullptr) throw SRC_BUG; } else value = nullptr; try { do { lu = escape::inherited_read(buffer, BUFFER_SIZE); if(has_escaped_data_since_last_skip()) data_escaped = true; if(lu > 0) { if(!crc_size.is_zero()) value->compute(offset, buffer, lu); ref.write(buffer, lu); offset += lu; last_is_skip = false; } else // lu == 0 if(next_to_read_is_mark(seqt_file)) { if(!skip_to_next_mark(seqt_file, false)) throw SRC_BUG; else { read_as_escape(true); try { zero_count.read(*this); } catch(...) { read_as_escape(false); zero_count = 0; throw; } read_as_escape(false); if(copy_to_no_skip) { while(!zero_count.is_zero()) { U_I to_write = 0; zero_count.unstack(to_write); while(to_write > 0) { U_I min = to_write > SPARSE_FIXED_ZEROED_BLOCK ? SPARSE_FIXED_ZEROED_BLOCK : to_write; ref.write((const char *)zeroed_field, min); to_write -= min; } } } else // using skip to restore hole into the copied-to generic_file { offset += zero_count; zero_count = 0; if(!ref.skip(offset)) throw Erange("sparse_file::copy_to", gettext("Cannot skip forward to restore a hole")); last_is_skip = true; seen_hole = true; } } } else // reached EOF ? { sequence_type m; if(next_to_read_is_which_mark(m)) // this is not EOF, but unsued mark is present if(m == seqt_file) throw SRC_BUG; // should have been reported above by next_to_read_is_mark(seqt_file) else throw Erange("sparse_file::copy", gettext("Data corruption or unknown sparse_file mark found in file's data")); else // Yes, this is the EOF { if(last_is_skip) { (void)ref.skip_relative(-1); ref.write((const char *)&zeroed_field, 1); } loop = false; } } } while(loop); } catch(...) { if(value != nullptr) { delete value; value = nullptr; } throw; } } void sparse_file::inherited_write(const char *a, U_I size) { U_I written = 0; U_I hole_start = 0; U_I hole_length = 0; if(is_terminated()) throw SRC_BUG; if(escape_write) return escape::inherited_write(a, size); while(written < size) { switch(mode) { case normal: if(look_for_hole(a + written, size - written, UI_min_hole_size, hole_start, hole_length)) { U_I next_data = written + hole_start + hole_length; if(hole_length < UI_min_hole_size) throw SRC_BUG; // bug in look for hole! escape::inherited_write(a + written, hole_start); if(has_escaped_data_since_last_skip()) data_escaped = true; if(next_data < size) // hole is inside "a" { write_hole(hole_length); written = next_data; } else // hole is at the end of "a" { mode = hole; zero_count = hole_length; offset += written + hole_start; // offset points at the start of the hole written = size; // this ends the while loop } } else // no hole in the remaing data to inspect (either hole size is larger than any possible buffer or no hole could be found in buffer) { escape::inherited_write(a + written, size - written); offset += size; written = size; // this ends the while loop if(has_escaped_data_since_last_skip()) data_escaped = true; } break; case hole: if(written > 0) throw SRC_BUG; // we should not pass from normal to hole inside a single call to this same method written = count_initial_zeros(a, size); if(written < size) // some normal data are present after the hole { zero_count += written; dump_pending_zeros(); offset -= written; // to have offset giving the offset of the first byte of "a" // instead of the first byte after the written hole (which is shifted in "a" // by an amount of "written" byte(s). } else // all data of the buffer is part of the current hole zero_count += size; break; default: throw SRC_BUG; } } } void sparse_file::inherited_sync_write() { switch(mode) { case hole: dump_pending_zeros(); break; case normal: break; default: throw SRC_BUG; } escape::inherited_sync_write(); } void sparse_file::dump_pending_zeros() { if(mode != hole) throw SRC_BUG; offset += zero_count; if(zero_count <= min_hole_size) { U_I tmp = 0; // write down zeroed bytes normally (zero_count bytes) do { zero_count.unstack(tmp); while(tmp > 0) { if(tmp > SPARSE_FIXED_ZEROED_BLOCK) { escape::inherited_write((const char *)zeroed_field, SPARSE_FIXED_ZEROED_BLOCK); tmp -= SPARSE_FIXED_ZEROED_BLOCK; } else { escape::inherited_write((const char *)zeroed_field, tmp); tmp = 0; } } } while(!zero_count.is_zero()); } else // enough data to record a hole { write_hole(zero_count); } zero_count = 0; mode = normal; } void sparse_file::write_hole(const infinint & length) { add_mark_at_current_position(seqt_file); write_as_escape(true); // to avoid recursion dumping offset try { length.dump(*this); } catch(...) { write_as_escape(false); // back in normal writing mode throw; } write_as_escape(false); // back in normal writing mode seen_hole = true; } void sparse_file::reset() { mode = normal; zero_count = 0; escape_write = false; escape_read = false; seen_hole = false; data_escaped = false; } bool sparse_file::look_for_hole(const char *a, U_I size, U_I min_hole_size, U_I & start, U_I & length) { U_I inspected = 0; length = 0; while(inspected < size) { start = inspected; while(start < size && a[start] != '\0') ++start; if(start < size) { inspected = start + 1; while(inspected < size && a[inspected] == '\0') ++inspected; } else inspected = start; length = inspected - start; if(min_hole_size > 0 && length > min_hole_size) inspected = size; else { ++inspected; length = 0; } } return length > 0; } U_I sparse_file::count_initial_zeros(const char *a, U_I size) { U_I curs = 0; while(curs < size && a[curs] == '\0') ++curs; return curs; } } // end of namespace dar-2.5.3/src/libdar/trivial_sar.cpp0000644000175000017430000002676112642457363014311 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // this was necessary to compile under Mac OS-X (boggus dirent.h) #if HAVE_STDINT_H #include #endif #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_UNISTD_H #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_FCNTL_H #include #endif #if STDC_HEADERS #include #endif } // end extern "C" #include "sar.hpp" #include "deci.hpp" #include "user_interaction.hpp" #include "tools.hpp" #include "erreurs.hpp" #include "cygwin_adapt.hpp" #include "deci.hpp" #include "entrepot.hpp" #include "sar_tools.hpp" #include "trivial_sar.hpp" using namespace std; namespace libdar { trivial_sar::trivial_sar(const user_interaction & dialog, gf_mode open_mode, const std::string & base_name, const std::string & extension, const entrepot & where, const label & internal_name, const label & data_name, const std::string & execute, bool allow_over, bool warn_over, bool force_permission, U_I permission, hash_algo x_hash, const infinint & x_min_digits, bool format_07_compatible) : generic_file(open_mode), mem_ui(dialog) { // some local variables to be used fichier_global *tmp = nullptr; const string filename = sar_tools_make_filename(base_name, 1, x_min_digits, extension); // sanity checks if(open_mode == gf_read_only) throw SRC_BUG; // initializing object fields from constructor arguments reference = nullptr; offset = 0; cur_pos = 0; end_of_slice = 0; hook = execute; base = base_name; ext = extension; of_data_name = data_name; old_sar = false; min_digits = x_min_digits; hook_where = where.get_full_path().display(); old_sar = format_07_compatible; // creating the slice if it does not exist else failing try { try { tmp = where.open(get_ui(), filename, open_mode, force_permission, permission, true, //< fail if exists false, //< erase x_hash); } catch(Esystem & e) { switch(e.get_code()) { case Esystem::io_exist: if(tmp != nullptr) throw SRC_BUG; if(!allow_over) throw Erange("trivial_sar::trivial_sar", tools_printf(gettext("%S already exists, and overwritten is forbidden, aborting"), &filename)); if(warn_over) get_ui().pause(tools_printf(gettext("%S is about to be overwritten, continue ?"), &filename)); try { tmp = where.open(get_ui(), filename, open_mode, force_permission, permission, false, //< fail if exists true, //< erase x_hash); } catch(Esystem & e) { switch(e.get_code()) { case Esystem::io_exist: throw SRC_BUG; case Esystem::io_absent: throw SRC_BUG; case Esystem::io_access: e.prepend_message(tools_printf(gettext("Failed creating slice %S: "), &filename)); throw; // propagate the exception default: throw SRC_BUG; } } break; case Esystem::io_absent: if(tmp != nullptr) throw SRC_BUG; else throw SRC_BUG; // not for the same reason, must know that reporting the same error but on a different line case Esystem::io_access: e.prepend_message(tools_printf(gettext("Failed creating slice %S: "), &filename)); throw; // propagate the exception default: if(tmp != nullptr) throw SRC_BUG; else throw SRC_BUG; // not for the same reason, must know that reporting the same error but on a different line } } if(tmp == nullptr) throw SRC_BUG; set_info_status(CONTEXT_LAST_SLICE); reference = tmp; init(internal_name); tmp = nullptr; // setting it to null only now was necesary to be able to release the object in case of exception } catch(...) { if(tmp != nullptr) delete tmp; throw; } if(tmp != nullptr) throw SRC_BUG; } trivial_sar::trivial_sar(const user_interaction & dialog, const std::string & pipename, bool lax) : generic_file(gf_read_only) , mem_ui(dialog) { label for_init; reference = nullptr; offset = 0; cur_pos = 0; end_of_slice = 0; hook = ""; base = ""; ext = ""; old_sar = false; min_digits = 0; hook_where = ""; set_info_status(CONTEXT_INIT); try { if(pipename == "-") reference = new (get_pool()) tuyau(get_ui(), 0, gf_read_only); else reference = new (get_pool()) tuyau(get_ui(), pipename, gf_read_only); if(reference == nullptr) throw Ememory("trivial_sar::trivial_sar"); for_init.clear(); init(for_init); } catch(...) { if(reference != nullptr) { delete reference; reference = nullptr; } throw; } } trivial_sar::trivial_sar(const user_interaction & dialog, generic_file *f, const label & internal_name, const label & data_name, bool format_07_compatible, const std::string & execute) : generic_file(gf_write_only), mem_ui(dialog) { if(f == nullptr) throw SRC_BUG; reference = f; offset = 0; cur_pos = 0; end_of_slice = 0; hook = execute; base = ""; ext = ""; of_data_name = data_name; old_sar = format_07_compatible; min_digits = 0; hook_where = ""; set_info_status(CONTEXT_LAST_SLICE); init(internal_name); } trivial_sar::~trivial_sar() { try { terminate(); } catch(...) { /// ignore all exceptions } if(reference != nullptr) delete reference; } bool trivial_sar::skip(const infinint & pos) { if(is_terminated()) throw SRC_BUG; if(pos == cur_pos) return true; else cur_pos = pos; return reference->skip(pos + offset); } void trivial_sar::inherited_terminate() { if(reference != nullptr) { char last = flag_type_terminal; switch(get_mode()) { case gf_read_only: break; // explicitely accepting other value case gf_write_only: case gf_read_write: if(!old_sar) reference->write(&last, 1); // adding the trailing flag break; default: throw SRC_BUG; } // telling the system to free this file from the cache, when relying on a plain file fichier_global *ref_fic = dynamic_cast(reference); if(ref_fic != nullptr) ref_fic->fadvise(fichier_global::advise_dontneed); delete reference; // this closes the slice so we can now eventually play with it: reference = nullptr; } if(hook != "") { switch(get_mode()) { case gf_read_only: break; case gf_write_only: case gf_read_write: tools_hook_substitute_and_execute(get_ui(), hook, hook_where, base, "1", sar_tools_make_padded_number("1", min_digits), ext, get_info_status()); break; default: throw SRC_BUG; } } } bool trivial_sar::skip_relative(S_I x) { if(is_terminated()) throw SRC_BUG; if(x > 0) { bool ret = reference->skip_relative(x); if(ret) // skip succeeded cur_pos += x; else // skip failed where_am_i(); return ret; } else { U_I x_opposit = -x; if(reference->get_position() > offset + x_opposit) return reference->skip_relative(x); else return reference->skip(offset); // start of file if(cur_pos > x_opposit) { bool ret = reference->skip_relative(x); if(ret) cur_pos -= x_opposit; else where_am_i(); return ret; } else { bool ret = reference->skip(offset); cur_pos = 0; return ret; } } } void trivial_sar::init(const label & internal_name) { header tete; switch(reference->get_mode()) { case gf_read_only: tete.read(get_ui(), *reference); if(tete.get_set_flag() == flag_type_non_terminal) throw Erange("trivial_sar::trivial_sar", gettext("This archive has slices and is not possible to read from a pipe")); // if flag is flag_type_located_at_end_of_slice, we will warn at end of slice offset = reference->get_position(); of_data_name = tete.get_set_data_name(); old_sar = tete.is_old_header(); cur_pos = 0; break; case gf_write_only: case gf_read_write: tete.get_set_magic() = SAUV_MAGIC_NUMBER; tete.get_set_internal_name() = internal_name; tete.get_set_flag() = flag_type_terminal; tete.get_set_data_name() = of_data_name; if(old_sar) tete.set_format_07_compatibility(); tete.write(get_ui(), *reference); offset = reference->get_position(); cur_pos = 0; break; default: throw SRC_BUG; } } U_I trivial_sar::inherited_read(char *a, U_I size) { U_I ret = reference->read(a, size); tuyau *tmp = dynamic_cast(reference); if(tmp != nullptr && !tmp->has_next_to_read()) { if(ret > 0) { if(!old_sar) { --ret; if(a[ret] != flag_type_terminal) throw Erange("trivial_sar::inherited_read", gettext("This archive is not single sliced, more data exists in the next slices but cannot be read from the current pipe, aborting")); else end_of_slice = 1; } else end_of_slice = 1; } // else assuming EOF has already been reached } cur_pos += ret; return ret; } void trivial_sar::inherited_write(const char *a, U_I size) { cur_pos += size; try { reference->write(a, size); } catch(...) { where_am_i(); throw; } } void trivial_sar::where_am_i() { cur_pos = reference->get_position(); if(cur_pos >= offset) cur_pos -= offset; else // we are at an invalid offset (in the slice header) { if(!reference->skip(offset)) throw Edata(string("trivial_sar: ")+ gettext("Cannot skip to a valid position in file")); cur_pos = 0; } } } // end of namespace dar-2.5.3/src/libdar/cat_tools.cpp0000644000175000017430000002310512642474445013746 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_tools.hpp" #include "cat_all_entrees.hpp" #include "deci.hpp" using namespace std; namespace libdar { // local sub routines static string local_fsa_fam_to_string(const cat_inode & ref); // exported routine implementation string local_perm(const cat_inode &ref, bool hard) { saved_status st; char type; U_32 perm = ref.get_perm(); if(!extract_base_and_status(ref.signature(), (unsigned char &)type, st)) throw SRC_BUG; return tools_get_permission_string(type, perm, hard); } string local_uid(const cat_inode & ref) { return tools_name_of_uid(ref.get_uid()); } string local_gid(const cat_inode & ref) { return tools_name_of_gid(ref.get_gid()); } string local_size(const cat_inode & ref) { string ret; const cat_file *fic = dynamic_cast(&ref); const cat_directory *dir = dynamic_cast(&ref); if(fic != nullptr) ret = tools_display_integer_in_metric_system(fic->get_size(), "o", true); else if(dir != nullptr) ret = tools_display_integer_in_metric_system(dir->get_size(), "o", true); else ret = "0"; return ret; } string local_storage_size(const cat_inode & ref) { string ret; const cat_file *fic = dynamic_cast(&ref); if(fic != nullptr) { deci d = fic->get_storage_size(); ret = d.human(); } else ret = "0"; return ret; } string local_date(const cat_inode & ref) { return tools_display_date(ref.get_last_modif()); } string local_flag(const cat_inode & ref, bool isolated, bool dirty_seq) { string ret; const cat_file *ref_f = dynamic_cast(&ref); bool dirty = dirty_seq || (ref_f != nullptr ? ref_f->is_dirty() : false); saved_status st = ref.get_saved_status(); cat_inode::ea_status ea_st = ref.ea_get_saved_status(); if(isolated && st == s_saved && !dirty) st = s_fake; if(isolated && ea_st == cat_inode::ea_full) ea_st = cat_inode::ea_fake; switch(st) { case s_saved: if(dirty) ret = gettext("[DIRTY]"); else ret = gettext("[Saved]"); break; case s_fake: ret = gettext("[InRef]"); break; case s_not_saved: ret = "[ ]"; break; default: throw SRC_BUG; } switch(ea_st) { case cat_inode::ea_full: ret += gettext("[Saved]"); break; case cat_inode::ea_fake: ret += gettext("[InRef]"); break; case cat_inode::ea_partial: ret += "[ ]"; break; case cat_inode::ea_none: ret += " "; break; case cat_inode::ea_removed: ret += "[Suppr]"; break; default: throw SRC_BUG; } ret += "[" + local_fsa_fam_to_string(ref) + "]"; const cat_file *fic = dynamic_cast(&ref); const cat_directory *dir = dynamic_cast(&ref); if(fic != nullptr && fic->get_saved_status() == s_saved) ret += string("[") + tools_get_compression_ratio(fic->get_storage_size(), fic->get_size(), fic->get_compression_algo_read() != none || fic->get_sparse_file_detection_read()) + "]"; else if(dir != nullptr) ret += string("[") + tools_get_compression_ratio(dir->get_storage_size(), dir->get_size(), true) + "]"; else ret += "[-----]"; if(fic != nullptr && fic->get_sparse_file_detection_read()) ret += "[X]"; else ret += "[ ]"; return ret; } void xml_listing_attributes(user_interaction & dialog, const string & beginning, const string & data, const string & metadata, const cat_entree * obj, bool list_ea) { string user; string group; string permissions; string atime; string mtime; string ctime; const cat_inode *e_ino = dynamic_cast(obj); const cat_mirage *e_hard = dynamic_cast(obj); if(e_hard != nullptr) e_ino = e_hard->get_inode(); if(e_ino != nullptr) { user = local_uid(*e_ino); group = local_gid(*e_ino); permissions = local_perm(*e_ino, e_hard != nullptr); atime = deci(e_ino->get_last_access().get_second_value()).human(); mtime = deci(e_ino->get_last_modif().get_second_value()).human(); if(e_ino->has_last_change()) { ctime = deci(e_ino->get_last_change().get_second_value()).human(); if(ctime == "0") ctime = ""; } else ctime = ""; } else { user = ""; group = ""; permissions = ""; atime = ""; mtime = ""; ctime = ""; } dialog.printf("%S\n", &beginning, &data, &metadata, &user, &group, &permissions, &atime, &mtime, &ctime); if(list_ea && e_ino != nullptr && e_ino->ea_get_saved_status() == cat_inode::ea_full) { string new_begin = beginning + "\t"; local_display_ea(dialog, e_ino, new_begin + " ea_name=\"", "\">", true); dialog.printf("%S", &beginning); } } bool extract_base_and_status(unsigned char signature, unsigned char & base, saved_status & saved) { bool fake = (signature & SAVED_FAKE_BIT) != 0; signature &= ~SAVED_FAKE_BIT; if(!isalpha(signature)) return false; base = tolower(signature); if(fake) if(base == signature) saved = s_fake; else return false; else if(signature == base) saved = s_saved; else saved = s_not_saved; return true; } void local_display_ea(user_interaction & dialog, const cat_inode * ino, const string &prefix, const string &suffix, bool xml_output) { if(ino == nullptr) return; if(ino->ea_get_saved_status() == cat_inode::ea_full) { const ea_attributs *owned = ino->get_ea(); string key, val; if(owned == nullptr) throw SRC_BUG; owned->reset_read(); while(owned->read(key, val)) { if(xml_output) key = tools_output2xml(key); dialog.warning(prefix + key + suffix); } } } unsigned char mk_signature(unsigned char base, saved_status state) { if(! islower(base)) throw SRC_BUG; switch(state) { case s_saved: return base; case s_fake: return base | SAVED_FAKE_BIT; case s_not_saved: return toupper(base); default: throw SRC_BUG; } } void unmk_signature(unsigned char sig, unsigned char & base, saved_status & state, bool isolated) { if((sig & SAVED_FAKE_BIT) == 0 && !isolated) if(islower(sig)) state = s_saved; else state = s_not_saved; else state = s_fake; base = tolower(sig & ~SAVED_FAKE_BIT); } bool compatible_signature(unsigned char a, unsigned char b) { a = tolower(a & ~SAVED_FAKE_BIT); b = tolower(b & ~SAVED_FAKE_BIT); switch(a) { case 'e': case 'f': return b == 'e' || b == 'f'; default: return b == a; } } unsigned char get_base_signature(unsigned char a) { unsigned char ret; saved_status st; unmk_signature(a, ret, st, false); if(ret == 'e') ret = 'f'; return ret; } string entree_to_string(const cat_entree *obj) { string ret; if(obj == nullptr) throw SRC_BUG; switch(get_base_signature(obj->signature())) { case 'j': ret = gettext("ignored directory"); break; case 'd': ret = gettext("folder"); break; case 'x': ret = gettext("deleted file"); break; case 'o': ret = gettext("door"); break; case 'f': ret = gettext("file"); break; case 'l': ret = gettext("symlink"); break; case 'c': ret = gettext("char device"); break; case 'b': ret = gettext("block device"); break; case 'p': ret = gettext("pipe"); break; case 's': ret = gettext("socket"); break; case 'i': ret = gettext("ignored entry"); break; case 'm': ret = gettext("hard linked inode"); break; case 'z': ret = gettext("end of directory"); break; default: throw SRC_BUG; // missing inode type } return ret; } // local routine implementation static string local_fsa_fam_to_string(const cat_inode & ref) { string ret = ""; if(ref.fsa_get_saved_status() != cat_inode::fsa_none) { fsa_scope sc = ref.fsa_get_families(); bool upper = ref.fsa_get_saved_status() == cat_inode::fsa_full; ret = fsa_scope_to_string(upper, sc); if(ret.size() < 3) ret += "-"; } else ret = "---"; return ret; } } // end of namespace dar-2.5.3/src/libdar/cat_nomme.cpp0000644000175000017430000000362512641772777013736 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_nomme.hpp" #include "tools.hpp" using namespace std; namespace libdar { cat_nomme::cat_nomme(const pile_descriptor & pdesc, bool small) : cat_entree(pdesc, small) { pdesc.check(small); if(small) tools_read_string(*pdesc.esc, xname); else tools_read_string(*pdesc.stack, xname); } bool cat_nomme::operator == (const cat_entree & ref) const { const cat_nomme *ref_nomme = dynamic_cast(&ref); if(ref_nomme == nullptr) return false; else return xname == ref_nomme->xname; } void cat_nomme::inherited_dump(const pile_descriptor & pdesc, bool small) const { cat_entree::inherited_dump(pdesc, small); pdesc.check(small); if(small) tools_write_string(*pdesc.esc, xname); else tools_write_string(*pdesc.stack, xname); } } // end of namespace dar-2.5.3/src/libdar/wrapperlib.hpp0000644000175000017430000001474712641773000014133 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file wrapperlib.hpp /// \brief libz and libbz2 wrapper to have identical interface to these libraries. /// \ingroup Private /// /// libz and libbz2 library differ in the way they return values /// in certain circumpstances. This module defines the wrapperlib class /// that make their use homogeneous. #ifndef WRAPPERLIB_HPP #define WRAPPERLIB_HPP #include "../my_config.h" extern "C" { #if HAVE_ZLIB_H && LIBZ_AVAILABLE #include #endif #if HAVE_BZLIB_H && LIBBZ2_AVAILABLE #include #endif #if HAVE_LZMA_H && LIBLZMA_AVAILABLE #include #endif } // end extern "C" #include "integers.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ const int WR_OK = 0; const int WR_MEM_ERROR = 1; const int WR_VERSION_ERROR = 2; const int WR_STREAM_ERROR = 3; const int WR_DATA_ERROR = 4; const int WR_NO_FLUSH = 5; const int WR_BUF_ERROR = 6; const int WR_STREAM_END = 7; const int WR_FINISH = 8; enum wrapperlib_mode { zlib_mode, bzlib_mode, xz_mode }; /// this class encapsulates calls to libz or libbz2 /// this is mainly an adaptation of libbz2 specificities to /// have libb2 acting exactly as libz does. /// \ingroup Private class wrapperlib : public on_pool { public: wrapperlib(wrapperlib_mode mode); wrapperlib(const wrapperlib & ref); const wrapperlib & operator = (const wrapperlib & ref); ~wrapperlib(); void set_next_in(const char *x) { return (this->*x_set_next_in)(x); }; void set_avail_in(U_I x) { return (this->*x_set_avail_in)(x); }; U_I get_avail_in() const { return (this->*x_get_avail_in)(); }; U_64 get_total_in() const { return (this->*x_get_total_in)(); }; void set_next_out(char *x) { return (this->*x_set_next_out)(x); }; char *get_next_out() const { return (this->*x_get_next_out)(); }; void set_avail_out(U_I x) { return (this->*x_set_avail_out)(x); }; U_I get_avail_out() const { return (this->*x_get_avail_out)(); }; U_64 get_total_out() const { return (this->*x_get_total_out)(); }; S_I compressInit(U_I compression_level) { level = compression_level; return (this->*x_compressInit)(compression_level); }; S_I decompressInit() { return (this->*x_decompressInit)(); }; S_I compressEnd() { return (this->*x_compressEnd)(); }; S_I decompressEnd() { return (this->*x_decompressEnd)(); }; S_I compress(S_I flag) { return (this->*x_compress)(flag); }; S_I decompress(S_I flag) { return (this->*x_decompress)(flag);}; S_I compressReset(); S_I decompressReset(); private: #if LIBZ_AVAILABLE z_stream *z_ptr; #endif #if LIBBZ2_AVAILABLE bz_stream *bz_ptr; #endif #if LIBLZMA_AVAILABLE lzma_stream *lzma_ptr; #endif S_I level; void (wrapperlib::*x_set_next_in)(const char *x); void (wrapperlib::*x_set_avail_in)(U_I x); U_I (wrapperlib::*x_get_avail_in)() const; U_64 (wrapperlib::*x_get_total_in)() const; void (wrapperlib::*x_set_next_out)(char *x); char *(wrapperlib::*x_get_next_out)() const; void (wrapperlib::*x_set_avail_out)(U_I x); U_I (wrapperlib::*x_get_avail_out)() const; U_64 (wrapperlib::*x_get_total_out)() const; S_I (wrapperlib::*x_compressInit)(U_I compression_level); S_I (wrapperlib::*x_decompressInit)(); S_I (wrapperlib::*x_compressEnd)(); S_I (wrapperlib::*x_decompressEnd)(); S_I (wrapperlib::*x_compress)(S_I flag); S_I (wrapperlib::*x_decompress)(S_I flag); // set of routines for zlib #if LIBZ_AVAILABLE S_I z_compressInit(U_I compression_level); S_I z_decompressInit(); S_I z_compressEnd(); S_I z_decompressEnd(); S_I z_compress(S_I flag); S_I z_decompress(S_I flag); void z_set_next_in(const char *x); void z_set_avail_in(U_I x); U_I z_get_avail_in() const; U_64 z_get_total_in() const; void z_set_next_out(char *x); char *z_get_next_out() const; void z_set_avail_out(U_I x); U_I z_get_avail_out() const; U_64 z_get_total_out() const; #endif // set of routines for bzlib #if LIBBZ2_AVAILABLE S_I bz_compressInit(U_I compression_level); S_I bz_decompressInit(); S_I bz_compressEnd(); S_I bz_decompressEnd(); S_I bz_compress(S_I flag); S_I bz_decompress(S_I flag); void bz_set_next_in(const char *x); void bz_set_avail_in(U_I x); U_I bz_get_avail_in() const; U_64 bz_get_total_in() const; void bz_set_next_out(char *x); char *bz_get_next_out() const; void bz_set_avail_out(U_I x); U_I bz_get_avail_out() const; U_64 bz_get_total_out() const; #endif // set of routines for liblzma #if LIBLZMA_AVAILABLE S_I lzma_compressInit(U_I compression_level); S_I lzma_decompressInit(); S_I lzma_end(); S_I lzma_encode(S_I flag); void lzma_set_next_in(const char *x); void lzma_set_avail_in(U_I x); U_I lzma_get_avail_in() const; U_64 lzma_get_total_in() const; void lzma_set_next_out(char *x); char *lzma_get_next_out() const; void lzma_set_avail_out(U_I x); U_I lzma_get_avail_out() const; U_64 lzma_get_total_out() const; #endif }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/mem_cluster.hpp0000644000175000017430000001074412641772777014320 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file mem_cluster.hpp /// \brief defines mem_cluster class that holds a fixed set of fixed size allocatable memory blocks /// \ingroup Private #ifndef MEM_CLUSTER_HPP #define MEM_CLUSTER_HPP #include "../my_config.h" #include "mem_allocator.hpp" namespace libdar { /// \addtogroup Private /// @{ class mem_cluster : public mem_allocator { public: mem_cluster(U_I x_block_size, //< block size that will be allocated from this mem_cluster U_I table_size_64, //< the total number of block in this mem_cluster is table_size_64 * 64 mem_manager *x_holder); //< this is the object that holds this mem_cluster object mem_cluster(const mem_cluster & ref): mem_allocator(ref) { throw SRC_BUG; }; const mem_cluster & operator = (const mem_cluster & ref) { throw SRC_BUG; }; ~mem_cluster(); /// return true if all available memory blocks have been allocated bool is_full() const { return available_blocks == 0; }; /// return true if non of the allocated memory block have been allocated bool is_empty() const { return available_blocks == max_available_blocks; }; /// returns a pointer to a newly allocated memory block of the size given at construction time void *alloc(); /// returns the block size used at construction time U_I get_block_size() const { return block_size; }; /// provides a status of the current object std::string dump() const; /// inherited from allocator, allow an allocated memory block to be recycled as available memory block virtual void release(void *ptr); #ifdef LIBDAR_DEBUG_MEMORY virtual U_I max_percent_full() const { return (max_available_blocks - min_avail_reached)*100/max_available_blocks; }; #else virtual U_I max_percent_full() const { return 0; }; #endif private: static const U_64 FULL = ~(U_64)(0); //< this is 1111...111 integer in binary notation static const U_64 HALF = (~(U_64)(0)) >> 1; //< this is 0111...111 integer in binary notation static const U_64 LEAD = ~((~(U_64)(0)) >> 1); //< this is 1000...000 integer in binary notation // the memory obtained by that object is split in two parts: // - the alloc_table which tells what block is sub-allocated or not // - the alloc_area which contains all the blocks that can be sub-allocated // all this memory is obtained at once and the address to release at object destructor is given by alloc_table // because it takes place at the beginning of the obtained memory char *alloc_area; //< points to the allocatable memory block U_I alloc_area_size; //< size of sub-allocatable memory in bytes (excluding the alloc_table part of the allocated memory used for management) U_I block_size; //< size of requested blocks U_64 *alloc_table; //< maps the blocks of the allocated memory that have been (sub-)allocated U_I alloc_table_size; //< size of the map (in number of U_64 integers) U_I next_free_in_table; //< next U_64 to look at for a request of block allocation U_I available_blocks; //< current number of available block in alloc U_I max_available_blocks; //< max available block in alloc #ifdef LIBDAR_DEBUG_MEMORY U_I min_avail_reached; //< records the max fullfilment reached #endif U_I find_free_slot_in(U_I table_integer) const; void set_slot_in(U_I table_integer, U_I bit_offset, bool value); std::string examination_status() const; // debugging, displays the list of allocated blocks that remain }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/on_pool.hpp0000644000175000017430000002247112641772777013446 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file on_pool.hpp /// \brief this is the base class of object that can be allocated on a memory pool /// \ingroup Private #ifndef ON_POOL_HPP #define ON_POOL_HPP #include "../my_config.h" #include #include #include "integers.hpp" #include "memory_pool.hpp" #include "mem_allocator.hpp" #include "cygwin_adapt.hpp" namespace libdar { /// \addtogroup Private /// @{ /// class on_pool is the ancestors of all class that are able to be allocated on a memory pool /// /// \note: new and new[] operators using memory pool never throw an exception upon allocation failure /// but rather return nullptr pointer. This is the way it was working before g++03 and g++11 class on_pool { public: #ifdef LIBDAR_SPECIAL_ALLOC /// constructor /// /// \note If an object has been created by new (not new[], temporary, or local variable) /// the get_pool() method can return the pool used for allocation, else it returns nullptr. /// The consequence is that objects dynamically created within an array (new []) cannot know /// the whether they have been allocated using a memory pool or not on_pool() { dynamic_init(); }; /// copy constructor /// /// \note the default copy constructor is not adequate as it would copy the value of dynamic /// of the source object whatever is the way the new object is created (dynamically allocated or not) on_pool(const on_pool & ref) { dynamic_init(); }; /// the assignment operator /// /// \note the assignement operator must not modify the field "dynamic" so we must not use /// the default operator const on_pool & operator = (const on_pool & ref) { return *this; }; /// virtual destructor as this class will have inherited classes virtual ~on_pool() throw(Ebug) {}; #endif /// the usual new operator is wrapped to allow proper delete operation later on (throws std::bad_alloc upon allocation failure) /// /// \note memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool void *operator new(size_t n_byte) { void *ret = alloc(n_byte, nullptr); if(ret == nullptr) throw std::bad_alloc(); return ret; }; /// the usual new operator is wrapped to allow proper delete operation later on (does not throw exception upon allocation failure) /// /// \note memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool void *operator new(size_t n_byte, const std::nothrow_t & nothrow_value) { return alloc(n_byte, nullptr); }; /// the usual new[] operator is wrapped to allow proper delete[] operation later on (throws std::bad_alloc upon allocation failure) /// /// \note memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool void *operator new[](size_t n_byte) { void *ret = alloc(n_byte, nullptr); if(ret == nullptr) throw std::bad_alloc(); return ret; }; /// the usual new[] operator is wrapped to allow proper delete[] operation later on (does not throw exception upon allocation failure) /// /// \note memory allocation done this way does not use the default C++ new[] operator, which may be slower than using memory pool void *operator new[](size_t n_byte, const std::nothrow_t & nothrow_value) { return alloc(n_byte, nullptr); }; /// this operator allocates a single object on a memory pool /// /// \note usage is: type *ptr = new (pool_obj) type(initial,values) /// \note such object has to be delete normally no need to call the destructor manually void *operator new(size_t n_byte, memory_pool *p) { return alloc(n_byte, p); }; /// this operator allocates an array of objects on a memory pool /// /// \note usage is: type *ptr = new (pool_obj) type(initial,values) /// \note such object has to be delete normally no need to call the destructor manually void *operator new[] (size_t n_byte, memory_pool *p) { return alloc(n_byte, p); }; /// this operator is called by the compiler if an exception is throw from the constructor of the allocated object void operator delete(void *ptr, memory_pool *p) { dealloc(ptr); }; /// this operator is called by the compiler if an exception is throw from the constructor of the allocated objects void operator delete[](void *ptr, memory_pool *p) { dealloc(ptr); }; /// this is the usual delete operator, modified to handle allocated objects allocated on a memory pool or not void operator delete(void *ptr) { dealloc(ptr); }; /// this is the usual delete[] operator, modified to handle allocated objects allocated on a memory pool or not void operator delete[](void *ptr) { dealloc(ptr); }; protected: /// get the pool used to allocate "this" /// /// \return the address of the memory pool that has been used to allocate the object /// \note if the object has not been allocated using a memory pool nullptr is returned /// \note if the object has not been dynamically allocated, that's to say is a local variable /// or a temporary object, get_pool() must not be called as it will return unpredictable /// result and could most probably crash the application if the returned data is used #ifdef LIBDAR_SPECIAL_ALLOC memory_pool *get_pool() const { return dynamic ? (((pool_ptr *)this) - 1)->reserve : nullptr; }; #else memory_pool *get_pool() const { return nullptr; }; #endif template void meta_new(T * & ptr, size_t num) { #ifdef LIBDAR_SPECIAL_ALLOC size_t byte = num * sizeof(T); if(get_pool() != nullptr) ptr = (T *)get_pool()->alloc(byte); else ptr = (T *)new (std::nothrow) char [byte]; #else ptr = new (std::nothrow) T[num]; #endif } template void meta_delete(T * ptr) { #ifdef LIBDAR_SPECIAL_ALLOC if(get_pool() != nullptr) get_pool()->release(ptr); else delete [] (char *)(ptr); #else delete [] ptr; #endif } private: #ifdef LIBDAR_SPECIAL_ALLOC /// this data structure is placed at the beginning of any allocated block /// /// \note thanks to this structure, it is possible to know which memory pool has to be /// informed of the memory release in order for the memory block to be recyclable union pool_ptr { memory_pool *reserve; //< this is to be able to pass the pool object to the constructor if it requires dynamic memory allocation U_I alignment__i; //< to properly align the allocated memory block that follows U_32 alignment_32; //< to properly align the allocated memory block that follows U_64 alignment_64; //< to properly align the allocated memory block that follows }; // this field is necessary to make distinction between object on the heap that have a pool_ptr header from those // created as local or temporary variable (on the stack). bool dynamic; /// used from constructors to setup field "dynamic" void dynamic_init() const { const_cast(this)->dynamic = (alloc_not_constructed == this); alloc_not_constructed = nullptr; }; #endif /// does the whole magic of memory allocation with and without memory_pool /// /// \param[in] size is the size of the requested block of memory to allocate /// \param[in] is the address of the pool to request the memory block to, nullptr if default memory allocation shall be used /// \return the address of the allocated memory block is returned, nullptr is returned upon memory allocation failure static void *alloc(size_t size, memory_pool *p); /// does the whole magic of memory release with and without memory_pool /// /// \param[in] ptr is the address of the memory block to release /// \note may throw exceptions if the given address has never been allocated or is nullptr static void dealloc(void *ptr); #ifdef LIBDAR_SPECIAL_ALLOC #ifdef CYGWIN_BUILD static on_pool *alloc_not_constructed; // under cygwin the thread_local directive does not work but // as we build only command-line tools that are single threaded // program, it does not hurt using global static field here // well, as soon as another application than dar/dar_xform/... // relies on a cygwin build of libdar, this trick should be changed #else thread_local static on_pool * alloc_not_constructed; #endif #endif }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/crc.hpp0000644000175000017430000001031512641772777012542 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file crc.hpp /// \brief class crc definition, used to handle Cyclic Redundancy Checks /// \ingroup Private #ifndef CRC_HPP #define CRC_HPP #include "../my_config.h" #include #include #include "integers.hpp" #include "storage.hpp" #include "infinint.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ class crc : public on_pool { public: static const U_I OLD_CRC_SIZE = 2; virtual ~crc() throw(Ebug) {}; virtual bool operator == (const crc & ref) const = 0; bool operator != (const crc & ref) const { return ! (*this == ref); }; virtual void compute(const infinint & offset, const char *buffer, U_I length) = 0; virtual void compute(const char *buffer, U_I length) = 0; // for sequential read only virtual void clear() = 0; virtual void dump(generic_file & f) const = 0; virtual std::string crc2str() const = 0; virtual infinint get_size() const = 0; virtual crc *clone() const = 0; }; extern crc *create_crc_from_file(generic_file & f, memory_pool *pool, bool old = false); extern crc *create_crc_from_size(infinint width, memory_pool *pool); class crc_i : public crc { public: crc_i(const infinint & width); crc_i(const infinint & width, generic_file & f); crc_i(const crc_i & ref) : size(ref.size), cyclic(ref.size) { copy_data_from(ref); pointer = cyclic.begin(); }; const crc_i & operator = (const crc_i & ref) { copy_from(ref); return *this; }; bool operator == (const crc & ref) const; void compute(const infinint & offset, const char *buffer, U_I length); void compute(const char *buffer, U_I length); // for sequential read only void clear(); void dump(generic_file & f) const; std::string crc2str() const; infinint get_size() const { return size; }; protected: crc *clone() const { return new (get_pool()) crc_i(*this); }; private: infinint size; //< size of the checksum storage::iterator pointer; //< points to the next byte to modify storage cyclic; //< the checksum storage void copy_from(const crc_i & ref); void copy_data_from(const crc_i & ref); }; class crc_n : public crc { public: crc_n(U_I width); crc_n(U_I width, generic_file & f); crc_n(const crc_n & ref) { copy_from(ref); }; const crc_n & operator = (const crc_n & ref); ~crc_n() { destroy(); }; bool operator == (const crc & ref) const; void compute(const infinint & offset, const char *buffer, U_I length); void compute(const char *buffer, U_I length); // for sequential read only void clear(); void dump(generic_file & f) const; std::string crc2str() const; infinint get_size() const { return size; }; protected: crc *clone() const { return new (get_pool()) crc_n(*this); }; private: U_I size; //< size of checksum (non infinint mode) unsigned char *pointer; //< points to the next byte to modify (non infinint mode) unsigned char *cyclic; //< the checksum storage (non infinint mode) void alloc(U_I width); void copy_from(const crc_n & ref); void copy_data_from(const crc_n & ref); void destroy(); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/label.cpp0000644000175000017430000000622312641772777013050 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_STRING_H #include #endif } // end extern "C" #include "label.hpp" #include "infinint.hpp" #include "tools.hpp" namespace libdar { label::label() { clear(); } bool label::operator == (const label & ref) const { return memcmp(val, ref.val, LABEL_SIZE) == 0; } void label::clear() { (void)memset(val, 0, LABEL_SIZE); } bool label::is_cleared() const { U_I i = 0; while(i < LABEL_SIZE && val[i] == '\0') i++; return i >= LABEL_SIZE; } void label::generate_internal_filename() { const time_t src1 = ::time(nullptr); const pid_t src2 = getpid(); const uid_t src3 = getuid(); unsigned char *dest = (unsigned char *)(&val); unsigned char *src = (unsigned char *)(&src1); U_I s1 = sizeof(src1) < LABEL_SIZE ? sizeof(src1) : LABEL_SIZE; for(U_I i = 0 ; i < s1; ++i) dest[i] = src[i]; if(s1 < LABEL_SIZE) { s1 = LABEL_SIZE - s1; // number of byte left to fill in "ret" s1 = s1 < sizeof(src2) ? s1 : sizeof(src2); // number of byte to copy src = (unsigned char *)(&src2); for(U_I i = 0; i < s1; ++i) dest[sizeof(src1)+i] = src[i]; } s1 = sizeof(src1) + sizeof(src2); if(s1 < LABEL_SIZE) { U_I s2 = LABEL_SIZE - s1; s2 = s2 < sizeof(src3) ? s2 : sizeof(src3); src = (unsigned char *)(&src3); for(U_I i = 0; i < s2; ++i) dest[s1+i] = src[i]; } for(s1 = s1 + sizeof(src3); s1 < LABEL_SIZE; ++s1) dest[s1] = (U_I)tools_pseudo_random(255); } void label::read(generic_file & f) { if(f.read(val, LABEL_SIZE) != (S_I)LABEL_SIZE) throw Erange("label::read", gettext("Incomplete label")); } void label::dump(generic_file & f) const { f.write(val, LABEL_SIZE); } void label::copy_from(const label & ref) { (void)memcpy(val, ref.val, LABEL_SIZE); } const label label_zero; } // end of namespace dar-2.5.3/src/libdar/tuyau.cpp0000644000175000017430000002625612641773000013124 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_ERRNO_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include "tuyau.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "integers.hpp" #include "cygwin_adapt.hpp" #define BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < BUFFER_SIZE #undef BUFFER_SIZE #define BUFFER_SIZE SSIZE_MAX #endif #endif using namespace std; namespace libdar { static gf_mode generic_file_get_mode(S_I fd); tuyau::tuyau(const user_interaction & dialog, S_I fd) : generic_file(generic_file_get_mode(fd)), mem_ui(dialog) { gf_mode tmp; if(fd < 0) throw Erange("tuyau::tuyau", "Bad file descriptor given"); tmp = generic_file_get_mode(fd); if(tmp == gf_read_write) throw Erange("tuyau::tuyau", tools_printf("A pipe cannot be in read and write mode at the same time, I need precision on the mode to use for the given filedscriptor")); pipe_mode = pipe_fd; filedesc = fd; position = 0; other_end_fd = -1; has_one_to_read = false; } tuyau::tuyau(const user_interaction & dialog, S_I fd, gf_mode mode) : generic_file(mode), mem_ui(dialog) { gf_mode tmp; if(fd < 0) throw Erange("tuyau::tuyau", "Bad file descriptor given"); if(mode == gf_read_write) throw Erange("tuyau::tuyau", tools_printf("A pipe cannot be in read and write mode at the same time")); tmp = generic_file_get_mode(fd); if(tmp != gf_read_write && tmp != mode) throw Erange("tuyau::tuyau", tools_printf("%s cannot be restricted to %s", generic_file_get_name(tmp), generic_file_get_name(mode))); pipe_mode = pipe_fd; filedesc = fd; position = 0; other_end_fd = -1; has_one_to_read = false; } tuyau::tuyau(const user_interaction & dialog, const string & filename, gf_mode mode) : generic_file(mode), mem_ui(dialog) { pipe_mode = pipe_path; chemin = filename; position = 0; other_end_fd = -1; has_one_to_read = false; } tuyau::tuyau(const user_interaction & dialog) : generic_file(gf_write_only), mem_ui(dialog) { int tube[2]; if(pipe(tube) < 0) throw Erange("tuyau::tuyau", string(gettext("Error while creating anonymous pipe: ")) + tools_strerror_r(errno)); pipe_mode = pipe_both; position = 0; filedesc = tube[1]; other_end_fd = tube[0]; has_one_to_read = false; } tuyau::~tuyau() { try { terminate(); } catch(...) { // ignore all exceptions } } int tuyau::get_read_fd() const { if(is_terminated()) throw SRC_BUG; if(pipe_mode == pipe_both) return other_end_fd; else throw Erange("tuyau::get_read_fd", gettext("Pipe's other end is not known, cannot provide a filedescriptor on it")); } void tuyau::close_read_fd() { if(is_terminated()) throw SRC_BUG; if(pipe_mode == pipe_both) { close(other_end_fd); pipe_mode = pipe_fd; } else throw Erange("tuyau::get_read_fd", gettext("Pipe's other end is not known, cannot close any filedescriptor pointing on it")); } void tuyau::do_not_close_read_fd() { if(is_terminated()) throw SRC_BUG; if(pipe_mode == pipe_both) pipe_mode = pipe_fd; else throw Erange("tuyau::get_read_fd", "Pipe's other end is not known, there is no reason to ask not to close a filedescriptor on it"); } bool tuyau::skippable(skippability direction, const infinint & amount) { if(get_mode() == gf_read_only) return direction == skip_forward; else return false; } bool tuyau::skip(const infinint & pos) { if(is_terminated()) throw SRC_BUG; if(pos < position) throw Erange("tuyau::skip", "Skipping backward is not possible on a pipe"); else if(pos == position) return true; else return read_and_drop(pos - position); } bool tuyau::skip_to_eof() { if(is_terminated()) throw SRC_BUG; if(get_mode() != gf_write_only) return read_to_eof(); else return true; } bool tuyau::skip_relative(S_I x) { if(is_terminated()) throw SRC_BUG; if(x < 0) throw Erange("tuyau::skip", "Skipping backward is not possible on a pipe"); else return read_and_drop(x); } bool tuyau::has_next_to_read() { if(is_terminated()) throw SRC_BUG; if(has_one_to_read) return true; else { S_I ret = ::read(filedesc, &next_to_read, 1); if(ret <= 0) return false; else { has_one_to_read = true; return true; } } } U_I tuyau::inherited_read(char *a, U_I size) { S_I ret; U_I lu = 0; #ifdef MUTEX_WORKS check_self_cancellation(); #endif ouverture(); switch(pipe_mode) { case pipe_fd: case pipe_both: break; case pipe_path: throw SRC_BUG; default: throw SRC_BUG; } if(size == 0) return 0; if(has_one_to_read) { a[lu] = next_to_read; ++lu; has_one_to_read = false; } do { #ifdef SSIZE_MAX U_I to_read = size - lu > SSIZE_MAX ? SSIZE_MAX : size - lu; #else U_I to_read = size - lu; #endif ret = ::read(filedesc, a+lu, to_read); if(ret < 0) { switch(errno) { case EINTR: break; case EIO: throw Ehardware("tuyau::inherited_read", ""); default: throw Erange("tuyau::inherited_read", string(gettext("Error while reading from pipe: "))+tools_strerror_r(errno)); } } else if(ret > 0) lu += ret; } while(lu < size && ret > 0); position += lu; return lu; } void tuyau::inherited_write(const char *a, U_I size) { U_I total = 0; ssize_t ret; #ifdef SSIZE_MAX static const U_I step = SSIZE_MAX/2; #else const U_I step = size; // which is no limit... #endif #ifdef MUTEX_WORKS check_self_cancellation(); #endif ouverture(); switch(pipe_mode) { case pipe_fd: case pipe_both: break; case pipe_path: throw SRC_BUG; default: throw SRC_BUG; } while(total < size) { if(size - total > step) ret = ::write(filedesc, a+total, step); else ret = ::write(filedesc, a+total, size - total); if(ret < 0) { switch(errno) { case EINTR: break; case EIO: throw Ehardware("tuyau::inherited_write", string(gettext("Error while writing data to pipe: ")) + tools_strerror_r(errno)); case ENOSPC: get_ui().pause(gettext("No space left on device, you have the opportunity to make room now. When ready : can we continue ?")); break; default : throw Erange("tuyau::inherited_write", string(gettext("Error while writing data to pipe: ")) + tools_strerror_r(errno)); } } else total += (U_I)ret; } position += total; } void tuyau::inherited_terminate() { switch(pipe_mode) { case pipe_both: close(other_end_fd); // no break here ! case pipe_fd: other_end_fd = -1; close(filedesc); filedesc = -1; break; case pipe_path: break; default: throw SRC_BUG; } } void tuyau::ouverture() { if(pipe_mode == pipe_path) { S_I flag; switch(get_mode()) { case gf_read_only: flag = O_RDONLY; break; case gf_write_only: flag = O_WRONLY; break; case gf_read_write: flag = O_RDWR; break; default: throw SRC_BUG; } filedesc = ::open(chemin.c_str(), flag|O_BINARY); if(filedesc < 0) throw Erange("tuyau::ouverture", string(gettext("Error opening pipe: "))+tools_strerror_r(errno)); pipe_mode = pipe_fd; } } bool tuyau::read_and_drop(infinint byte) { char buffer[BUFFER_SIZE]; U_I u_step; U_I step, max_i_step = 0; S_I lu; bool eof = false; max_i_step = int_tools_maxof_agregate(max_i_step); if(max_i_step <= 0) throw SRC_BUG; // error in max positive value calculation, just above if(max_i_step > BUFFER_SIZE) max_i_step = BUFFER_SIZE; // max read a time if(get_mode() != gf_read_only) throw Erange("tuyau::read_and_drop", "Cannot skip in pipe in writing mode"); u_step = 0; byte.unstack(u_step); do { while(u_step > 0 && !eof) { if(u_step > max_i_step) step = max_i_step; else step = u_step; lu = read(buffer, step); if(lu < 0) throw SRC_BUG; if((U_I)lu < step) eof = true; u_step -= lu; position += lu; } if(!eof) { u_step = 0; byte.unstack(u_step); } } while(u_step > 0 && !eof); if(!byte.is_zero()) throw SRC_BUG; return !eof; } bool tuyau::read_to_eof() { char buffer[BUFFER_SIZE]; S_I lu = 0; if(get_mode() != gf_read_only) throw Erange("tuyau::read_and_drop", "Cannot skip in pipe in writing mode"); while((lu = read(buffer, BUFFER_SIZE)) > 0) position += lu; return true; } static gf_mode generic_file_get_mode(S_I fd) { S_I flags = fcntl(fd, F_GETFL) & O_ACCMODE; gf_mode ret; switch(flags) { case O_RDONLY: ret = gf_read_only; break; case O_WRONLY: ret = gf_write_only; break; case O_RDWR: ret = gf_read_write; break; default: throw Erange("generic_file_get_mode", gettext("File mode is neither read nor write")); } return ret; } } // end of namespace dar-2.5.3/src/libdar/slice_layout.cpp0000644000175000017430000000653012641773000014442 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "slice_layout.hpp" using namespace std; namespace libdar { void slice_layout::read(generic_file & f) { char tmp; first_size.read(f); other_size.read(f); first_slice_header.read(f); other_slice_header.read(f); if(f.read(&tmp , 1) == 1) { switch(tmp) { case OLDER_THAN_V8: older_sar_than_v8 = true; break; case V8: older_sar_than_v8 = false; break; default: throw SRC_BUG; } } else throw Erange("slice_layout::read", gettext("Missing data while reading slice_layout object")); } void slice_layout::write(generic_file & f) const { char tmp = older_sar_than_v8 ? OLDER_THAN_V8 : V8; first_size.dump(f); other_size.dump(f); first_slice_header.dump(f); other_slice_header.dump(f); f.write(&tmp, 1); } void slice_layout::clear() { first_size = 0; other_size = 0; first_slice_header = 0; other_slice_header = 0; older_sar_than_v8 = false; } void slice_layout::which_slice(const infinint & offset, infinint & slice_num, infinint & slice_offset) const { // considering particular case of a non-sliced archive if(first_size.is_zero() || other_size.is_zero()) { slice_num = 1; if(offset < first_slice_header) slice_offset = first_slice_header; else slice_offset = offset - first_slice_header; return; } // sanity checks if(first_size < first_slice_header) throw SRC_BUG; if(other_size < other_slice_header) throw SRC_BUG; if(first_slice_header.is_zero()) throw SRC_BUG; if(other_slice_header.is_zero()) throw SRC_BUG; // end of sanity checks infinint byte_in_first_file = first_size - first_slice_header; infinint byte_per_file = other_size - other_slice_header; if(!older_sar_than_v8) { --byte_in_first_file; --byte_per_file; // this is due to the trailing flag (one byte length) } if(offset < byte_in_first_file) { slice_num = 1; slice_offset = offset + first_slice_header; } else { euclide(offset - byte_in_first_file, byte_per_file, slice_num, slice_offset); slice_num += 2; // "+2" because file number starts to 1 and first file is already counted slice_offset += other_slice_header; } } } // end of namespace dar-2.5.3/src/libdar/cat_file.hpp0000644000175000017430000001416212642474445013535 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_file.hpp /// \brief class used to record plain files in a catalogue /// \ingroup Private #ifndef CAT_FILE_HPP #define CAT_FILE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_inode.hpp" #include "cat_tools.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the plain file class class cat_file : public cat_inode { public : enum get_data_mode { keep_compressed, //< provide access to compressed data keep_hole, //< provide access to uncompressed data but sparse_file datastructure normal, //< provide access to full data (uncompressed, uses skip() to restore holes) plain //< provide access to plain data, no skip to restore holes, provide instead zeroed bytes }; static const U_8 FILE_DATA_WITH_HOLE = 0x01; //< file's data contains hole datastructure static const U_8 FILE_DATA_IS_DIRTY = 0x02; //< data modified while being saved cat_file(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & src, const path & che, const infinint & taille, const infinint & fs_device, bool x_furtive_read_mode); cat_file(const cat_file & ref); cat_file(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, compression default_algo, bool small); ~cat_file() { detruit(); }; bool has_changed_since(const cat_inode & ref, const infinint & hourshift, cat_inode::comparison_fields what_to_check) const; infinint get_size() const { return *size; }; void change_size(const infinint & s) const { *size = s; }; infinint get_storage_size() const { return *storage_size; }; void set_storage_size(const infinint & s) { *storage_size = s; }; virtual generic_file *get_data(get_data_mode mode) const; // returns a newly allocated object in read_only mode void clean_data(); // partially free memory (but get_data() becomes disabled) void set_offset(const infinint & r); const infinint & get_offset() const; unsigned char signature() const { return mk_signature('f', get_saved_status()); }; void set_crc(const crc &c); bool get_crc(const crc * & c) const; //< the argument is set the an allocated crc object the owned by the "cat_file" object, its stay valid while this "cat_file" object exists and MUST NOT be deleted by the caller in any case bool has_crc() const { return check != nullptr; }; bool get_crc_size(infinint & val) const; //< returns true if crc is know and puts its width in argument void drop_crc() { if(check != nullptr) { delete check; check = nullptr; } }; // whether the plain file has to detect sparse file void set_sparse_file_detection_read(bool val) { if(status == from_cat) throw SRC_BUG; if(val) file_data_status_read |= FILE_DATA_WITH_HOLE; else file_data_status_read &= ~FILE_DATA_WITH_HOLE; }; void set_sparse_file_detection_write(bool val) { if(val) file_data_status_write |= FILE_DATA_WITH_HOLE; else file_data_status_write &= ~FILE_DATA_WITH_HOLE; }; // whether the plain file is stored with a sparse_file datastructure in the archive bool get_sparse_file_detection_read() const { return (file_data_status_read & FILE_DATA_WITH_HOLE) != 0; }; bool get_sparse_file_detection_write() const { return (file_data_status_write & FILE_DATA_WITH_HOLE) != 0; }; cat_entree *clone() const { return new (get_pool()) cat_file(*this); }; compression get_compression_algo_read() const { return algo_read; }; compression get_compression_algo_write() const { return algo_write; }; // object migration methods (merging) void change_compression_algo_write(compression x) { algo_write = x; }; // dirtiness bool is_dirty() const { return dirty; }; void set_dirty(bool value) { dirty = value; }; protected: void sub_compare(const cat_inode & other, bool isolated_mode) const; void inherited_dump(const pile_descriptor & pdesc, bool small) const; void post_constructor(const pile_descriptor & pdesc); enum { empty, from_path, from_cat } status; private: std::string chemin; //< path to the data (when read from filesystem) infinint *offset; //< start location of the data in 'loc' infinint *size; //< size of the data (uncompressed) infinint *storage_size; //< how much data used in archive (after compression) crc *check; bool dirty; //< true when a file has been modified at the time it was saved compression algo_read; //< which compression algorithm to use to read the file's data compression algo_write; //< which compression algorithm to use to write down (merging) the file's data bool furtive_read_mode; // used only when status equals "from_path" char file_data_status_read; // defines the datastructure to use when reading the data char file_data_status_write; // defines the datastructure to apply when writing down the data void detruit(); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_mirage.hpp0000644000175000017430000001072312641772777014071 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_mirage.hpp /// \brief smart pointer to an etoile object. Used to store hard link information inside a catalogue /// \ingroup Private #ifndef CAT_MIRAGE_HPP #define CAT_MIRAGE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_nomme.hpp" #include "cat_etoile.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the hard link implementation, cat_mirage is the named entry owned by a directory it points to a common "cat_etoile class" /// well, a mirage is this fake apparition of water in a desert... I guess you get the picture now... :-) class cat_mirage : public cat_nomme { public: enum mirage_format {fmt_mirage, //< new format fmt_hard_link, //< old dual format fmt_file_etiquette }; //< old dual format cat_mirage(const std::string & name, cat_etoile *ref) : cat_nomme(name) { star_ref = ref; if(ref == nullptr) throw SRC_BUG; star_ref->add_ref(this); }; cat_mirage(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, mirage_format fmt, bool lax, bool small); cat_mirage(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, bool lax, bool small); cat_mirage(const cat_mirage & ref) : cat_nomme (ref) { star_ref = ref.star_ref; if(star_ref == nullptr) throw SRC_BUG; star_ref->add_ref(this); }; const cat_mirage & operator = (const cat_mirage & ref); ~cat_mirage() { star_ref->drop_ref(this); }; bool operator == (const cat_entree & ref) const; unsigned char signature() const { return 'm'; }; cat_entree *clone() const { return new (get_pool()) cat_mirage(*this); }; cat_inode *get_inode() const { if(star_ref == nullptr) throw SRC_BUG; return star_ref->get_inode(); }; infinint get_etiquette() const { return star_ref->get_etiquette(); }; infinint get_etoile_ref_count() const { return star_ref->get_ref_count(); }; cat_etoile *get_etoile() const { return star_ref; }; bool is_inode_counted() const { return star_ref->is_counted(); }; bool is_inode_wrote() const { return star_ref->is_wrote(); }; bool is_inode_dumped() const { return star_ref->is_dumped(); }; void set_inode_counted(bool val) const { star_ref->set_counted(val); }; void set_inode_wrote(bool val) const { star_ref->set_wrote(val); }; void set_inode_dumped(bool val) const { star_ref->set_dumped(val); }; void post_constructor(const pile_descriptor & pdesc); /// whether we are the mirage that triggered this hard link creation bool is_first_mirage() const { return star_ref->get_first_ref() == this; }; // overwriting virtual method from cat_entree virtual void change_location(const pile_descriptor & pdesc) { get_inode()->change_location(pdesc); }; protected: void inherited_dump(const pile_descriptor & pdesc, bool small) const; private: cat_etoile *star_ref; void init(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, mirage_format fmt, bool lax, bool small); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/pile_descriptor.cpp0000644000175000017430000000302712641772777015157 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "pile_descriptor.hpp" using namespace std; namespace libdar { pile_descriptor::pile_descriptor(pile *ptr) { if(ptr == nullptr) throw SRC_BUG; stack = ptr; ptr->find_first_from_top(compr); ptr->find_first_from_bottom(esc); } void pile_descriptor::check(bool small) const { if(stack == nullptr) throw SRC_BUG; if(esc == nullptr && small) throw SRC_BUG; if(compr == nullptr) throw SRC_BUG; } } // end of namespace dar-2.5.3/src/libdar/header.hpp0000644000175000017430000001211012641772777013216 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file header.hpp /// \brief slice header structure is defined here /// \ingroup Private #ifndef HEADER_HPP #define HEADER_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "user_interaction.hpp" #include "tlv_list.hpp" #include "label.hpp" #include "on_pool.hpp" #include namespace libdar { /// \addtogroup Private /// @{ const U_32 SAUV_MAGIC_NUMBER = 123; // Why "SAUV_..." because SAUV was the name of DAR much before its first release :-) typedef U_32 magic_number; enum flag_type { flag_type_terminal = 'T', flag_type_non_terminal = 'N', flag_type_located_at_end_of_slice = 'E' // since archive format version 8 }; /// this class manages the header of each slice /// this class was a struct before release 2.4.0, now promoted /// to a class it hides the fields and uses TLV to store the /// fields in the archive. This makes the header easier to /// extend by adding new fields, while letting a chance for the /// old implementation to be able to use more recent archives /// the main use of TLV is to handle optional fields easily. class header : public on_pool { public: // constructors & Co. header(); header(const header & ref) { copy_from(ref); }; const header & operator = (const header & ref) { free_pointers(); copy_from(ref); return *this; }; ~header() { free_pointers(); }; // global methods void read(user_interaction & ui, generic_file & f, bool lax = false ); void write(user_interaction &, generic_file & f) const; /// minimal size of a header in an archive /// \return min size of a header once stored in an archive /// \note since release 2.4.0 the header used for each slice is exactly the same. /// before this release the header of the first slice might be bigger, it was known that /// the size of the other header was "min_size" this let dar be able to find the proper /// slice for a given position. For compatibility with older DAR format, it is thus important /// to not change the value returned by this class method. This call is only used /// when reading archive generated by old versions of dar < 2.4.0. (aka archive format <= 7) static U_I min_size() { return sizeof(magic_number) + sizeof(label) + 2*sizeof(char); }; // fields access methods magic_number & get_set_magic() { return magic; }; label & get_set_internal_name() { return internal_name; }; char & get_set_flag() { return flag; }; label & get_set_data_name() { return data_name; }; bool get_first_slice_size(infinint & size) const; void set_first_slice_size(const infinint & size); void unset_first_slice_size() { if(first_size != nullptr) { delete first_size; first_size = nullptr; } }; bool get_slice_size(infinint & size) const; void set_slice_size(const infinint & size); void unset_slice_size() { if(slice_size != nullptr) { delete slice_size; slice_size = nullptr; } }; bool is_old_header() const { return old_header; }; void set_format_07_compatibility() { old_header = true; }; private: magic_number magic; //< constant string for all Dar archives label internal_name; //< constant string for all slices of a given archive (computed based on date and pid) label data_name; //< constant string for a set of data (constant with dar_xform, used to link isolated catalogue to its original data) char flag; //< whether slice is the last of the archive or not infinint *first_size; //< size of the first slice infinint *slice_size; //< size of slices (except first slice if specified else and last if not fulfilled) bool old_header; //< true if the header has been read from an old archive (before release 2.4.0, format 07 and below) and if true when writing, create an old slice header (compatible with format 07). void copy_from(const header & ref); void free_pointers(); void fill_from(user_interaction & ui, const tlv_list & list); tlv_list build_tlv_list(user_interaction & ui) const; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/escape.cpp0000644000175000017430000007464512642474445013236 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "escape.hpp" extern "C" { #ifdef HAVE_STRIN_H #include #endif } // extern "C" using namespace std; extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } // end extern "C" namespace libdar { //-- class static variable (well constant to be correct) // escape sequence structure // // fixed pattern (5 bytes) + escape sequence type (1 byte) = total length: 6 bytes // 0xAD 0xFD 0xEA 0x77 0x21 + { 'X' | 'H' | 'F' | 'E' | 'C' | ... } // // the fixed pattern may have its first byte (which default value is 0xAD) modified if necessary to // avoid escaping of escape sequences when using two escape objects, one writing its data to a second one. const unsigned char escape::usual_fixed_sequence[ESCAPE_SEQUENCE_LENGTH] = { ESCAPE_FIXED_SEQUENCE_NORMAL, 0xFD, 0xEA, 0x77, 0x21, 0x00 }; const infinint escape::READ_BUFFER_SIZE_INFININT = MAX_BUFFER_SIZE; //-- class routines escape::escape(generic_file *below, const set & x_unjumpable) : generic_file(below->get_mode()) { x_below = below; if(below == nullptr) throw SRC_BUG; write_buffer_size = 0; read_buffer_size = 0; read_eof = false; already_read = 0; escape_seq_offset_in_buffer = 0; escaped_data_count_since_last_skip = 0; below_position = x_below->get_position(); unjumpable = x_unjumpable; for(U_I i = 0 ; i < ESCAPE_SEQUENCE_LENGTH; ++i) fixed_sequence[i] = usual_fixed_sequence[i]; } escape::~escape() { try { terminate(); } catch(...) { // ignore all exceptions } } const escape & escape::operator = (const escape & ref) { generic_file *me = this; const generic_file *you = &ref; if(is_terminated()) throw SRC_BUG; *me = *you; // copying the generic_file data copy_from(ref); // copying the escape specific data return *this; } void escape::add_mark_at_current_position(sequence_type t) { // some necessary sanity checks if(is_terminated()) throw SRC_BUG; if(get_mode() == gf_read_only) throw SRC_BUG; check_below(); // sanity checks done if(t == seqt_not_a_sequence) throw Erange("escape::add_mark_at_current_position", gettext("Adding an explicit escape sequence of type seqt_not_a_sequence is forbidden")); flush_write(); escaped_data_count_since_last_skip = 0; set_fixed_sequence_for(t); x_below->write((const char*)fixed_sequence, ESCAPE_SEQUENCE_LENGTH); below_position += ESCAPE_SEQUENCE_LENGTH; } bool escape::skip_to_next_mark(sequence_type t, bool jump) { bool found = false; if(is_terminated()) throw SRC_BUG; // check whether we are not in write mode !!! if(get_mode() != gf_read_only) throw SRC_BUG; // escape implementation does not support this mode read_eof = false; // may be have been set because we reached a mark while reading data, so we now need to unset it escaped_data_count_since_last_skip = 0; do { // looking at data currently in the buffer if(escape_seq_offset_in_buffer < read_buffer_size) // amorce found in buffer { already_read = escape_seq_offset_in_buffer; // dropping data before that start of escape sequence // at that time, this may be just the start of what seems to be an escape mark, // so we need more data, which may turn out to show that this is not an escape mark if(!mini_read_buffer()) { read_eof = true; // not enough data available, thus clean_read(); } else // we could get more data to determine whether we have a mark in the buffer or not { if(escape_seq_offset_in_buffer + ESCAPE_SEQUENCE_LENGTH - 1 < read_buffer_size) { sequence_type found_type = char2type(read_buffer[escape_seq_offset_in_buffer + ESCAPE_SEQUENCE_LENGTH - 1]); if(found_type == seqt_not_a_sequence) { // this is just escaped data, so we skip it already_read = escape_seq_offset_in_buffer + ESCAPE_SEQUENCE_LENGTH; // moving the marker to the next possible escape sequence escape_seq_offset_in_buffer = already_read + trouve_amorce(read_buffer + already_read, read_buffer_size - already_read, fixed_sequence); } else // real mark found if(found_type == t) // found the expected type of mark { found = true; already_read = escape_seq_offset_in_buffer + ESCAPE_SEQUENCE_LENGTH; escape_seq_offset_in_buffer = already_read + trouve_amorce(read_buffer + already_read, read_buffer_size - already_read, fixed_sequence); } else if(jump && unjumpable.find(found_type) == unjumpable.end()) // not an unjumpable mark or jump allowed for any mark { already_read = escape_seq_offset_in_buffer + ESCAPE_SEQUENCE_LENGTH; escape_seq_offset_in_buffer = already_read + trouve_amorce(read_buffer + already_read, read_buffer_size - already_read, fixed_sequence); } else // not an unjumpable mark read_eof = true; } else // what seemed to be the start of a mark is not a mark already_read = escape_seq_offset_in_buffer; } } else // no mark in current data { // dropping all data in read_buffer, and filling it again with some new data read_buffer_size = x_below->read(read_buffer, READ_BUFFER_SIZE); below_position += read_buffer_size; if(read_buffer_size == 0) read_eof = true; already_read = 0; escape_seq_offset_in_buffer = trouve_amorce(read_buffer, read_buffer_size, fixed_sequence); } } while(!found && !read_eof); return found; } bool escape::next_to_read_is_mark(sequence_type t) { sequence_type toberead; if(is_terminated()) throw SRC_BUG; if(next_to_read_is_which_mark(toberead)) return t == toberead; else return false; } void escape::remove_unjumpable_mark(sequence_type t) { set::iterator it = unjumpable.find(t); if(is_terminated()) throw SRC_BUG; if(it != unjumpable.end()) unjumpable.erase(it); } bool escape::next_to_read_is_which_mark(sequence_type & t) { if(is_terminated()) throw SRC_BUG; check_below(); if(get_mode() != gf_read_only) throw SRC_BUG; if(escape_seq_offset_in_buffer > already_read) //no next to read mark return false; // if read_buffer size is less than ESCAPE_SEQUENCE MARK, then read some data for that if(mini_read_buffer()) { if(read_buffer_size - already_read < ESCAPE_SEQUENCE_LENGTH) throw SRC_BUG; // check the data in the read_buffer if(escape_seq_offset_in_buffer == already_read) { t = char2type(read_buffer[already_read + ESCAPE_SEQUENCE_LENGTH - 1]); if(t == seqt_not_a_sequence) throw SRC_BUG; // mini_read_buffer did not made its job properly! return true; } else return false; // no escape sequence found next to be read } else // not enough data available in x_below to form a escape sequence mark (eof reached) return false; } bool escape::skippable(skippability direction, const infinint & amount) { switch(get_mode()) { case gf_read_only: return x_below->skippable(direction, amount); case gf_write_only: case gf_read_write: if(direction == skip_forward) return false; else return x_below->skippable(direction, amount); default: throw SRC_BUG; } } bool escape::skip(const infinint & pos) { bool ret = true; if(is_terminated()) throw SRC_BUG; check_below(); escaped_data_count_since_last_skip = 0; if(get_position() == pos) return true; switch(get_mode()) { case gf_read_only: read_eof = false; flush_or_clean(); ret = x_below->skip(pos); if(ret) below_position = pos; else below_position = x_below->get_position(); break; case gf_write_only: if(get_position() != pos) throw Efeature("Skipping on write_only escape object"); else ret = true; break; case gf_read_write: // only backward skipping is allowed in that mode if(get_position() < pos) throw Efeature("Skipping forward not implemented in write mode for escape class"); else { char tmp_buffer[WRITE_BUFFER_SIZE]; infinint cur_below = below_position; U_I trouve; try { if(pos >= ESCAPE_SEQUENCE_LENGTH) { U_I lu = 0; below_position = pos - ESCAPE_SEQUENCE_LENGTH; ret = x_below->skip(below_position); if(ret) { lu = x_below->read(tmp_buffer, ESCAPE_SEQUENCE_LENGTH); below_position += lu; write_buffer_size = lu; } else below_position = x_below->get_position(); } else // skipping very close after the start of file, no escape mark can take place there { U_I width = 0; U_I lu = 0; infinint tmp = pos; tmp.unstack(width); if(tmp != 0) throw SRC_BUG; width = ESCAPE_SEQUENCE_LENGTH - width; if(!x_below->skip(0)) throw SRC_BUG; // should succeed or throw an exception in that situation (backward skipping) lu = x_below->read(tmp_buffer, width); write_buffer_size = lu; below_position = lu; ret = true; } } catch(...) { x_below->skip(cur_below); below_position = cur_below; throw; } (void)memcpy(write_buffer, tmp_buffer, write_buffer_size); trouve = trouve_amorce(write_buffer, write_buffer_size, fixed_sequence); if(trouve == 0) // we read a whole escape sequence write_buffer_size = 0; // so we know that we can restart the lookup process here from scratch else if(trouve == write_buffer_size) // no start of escape sequence found write_buffer_size = 0; // so we know that we can restart the lookup process here from scratch else // partial escape sequence found, moving at the beginning of the write_buffer for further lookup { (void)memmove(write_buffer, write_buffer + trouve, write_buffer_size - trouve); write_buffer_size -= trouve; } } break; default: throw SRC_BUG; // this mode is not allowed } return ret; } bool escape::skip_to_eof() { bool ret; if(is_terminated()) throw SRC_BUG; check_below(); if(get_mode() != gf_read_only) throw Efeature("Skipping not implemented in write mode for escape class"); // if the buffer is neither empty not full, we cannot know what to do with this date // either place it asis in the below file, or escape it in the below file. flush_or_clean(); read_eof = true; escaped_data_count_since_last_skip = 0; ret = x_below->skip_to_eof(); below_position = x_below->get_position(); return ret; } bool escape::skip_relative(S_I x) { bool ret; if(is_terminated()) throw SRC_BUG; if(x == 0) return true; check_below(); read_eof = false; escaped_data_count_since_last_skip = 0; if(get_mode() != gf_read_only) throw Efeature("Skipping not implemented in write mode for escape class"); // if the buffer is neither empty not full, we cannot know what to do with this date // either place it asis in the below file, or escape it in the below file. flush_or_clean(); ret = x_below->skip_relative(x); if(ret) // skipping succeeded { if(x >= 0) below_position += x; else // x is negative { if(below_position < -x) below_position = 0; else below_position -= -x; // trick used, because infinint cannot be negative } } else // skipping failed, need to consult x_below to know where we are now below_position = x_below->get_position(); return ret; } infinint escape::get_position() const { if(is_terminated()) throw SRC_BUG; check_below(); if(get_mode() == gf_read_only) return below_position - read_buffer_size + already_read - escaped_data_count_since_last_skip; else return below_position + write_buffer_size - escaped_data_count_since_last_skip; } void escape::inherited_read_ahead(const infinint & amount) { if(is_terminated()) throw SRC_BUG; check_below(); if(!read_eof) x_below->read_ahead(amount); } U_I escape::inherited_read(char *a, U_I size) { U_I returned = 0; // ############# if EOF -> stop if(read_eof && already_read == read_buffer_size) return 0; // eof reached. (real eof or next to read is a real mark) // ############# if read_buffer not empty (we copy as needed and available data from the buffer into "a") up to the first mark bool loop = true; do { if(escape_seq_offset_in_buffer < already_read) throw SRC_BUG; U_I avail = escape_seq_offset_in_buffer - already_read; if(avail > 0) { U_I needed = size - returned; U_I min_cp = avail > needed ? needed : avail; (void)memcpy(a + returned, read_buffer + already_read, min_cp); returned += min_cp; already_read += min_cp; } if(already_read == read_buffer_size) { already_read = read_buffer_size = 0; escape_seq_offset_in_buffer = 0; } if(returned == size) return returned; if(returned > size) throw SRC_BUG; if(already_read != read_buffer_size) { // some data remains in the buffer (either more than requested, or due to a real or data mark found in it) if(already_read != escape_seq_offset_in_buffer) throw SRC_BUG; // more data was requested but could not be delivered, while no mark is next to be read from read_buffer!? if(mini_read_buffer()) // se we complete it and eventually unescape data from data mark : mini_read_buffer() does this { // there is now enough data in buffer_size to tell that this is a real completed mark if(escape_seq_offset_in_buffer == already_read) // there is a real mark next to be read in the buffer { // no more real data to be read read_eof = true; loop = false; } else { // the real mark is not the next to be read, some data have been unescaped before it loop = true; } } else // data in buffer is not a mark, just a truncated mark at an EOF so we can take it as pure data { escape_seq_offset_in_buffer = read_buffer_size; loop = true; } } else loop = false; } while(loop); // ############# OK, now, read_buffer is empty, no eof/mark met and still more data needed. // reading data from "below" directly into "a" after already placed data (if there is enough place to detect marks) loop = !read_eof; // if all data could be read, we already returned from this function, so we do not reach this statement, // if data remains in read_buffer, this is thus because we need more, but either the buffer is empty // or we met a real mark, so we reached "eof" and must not continue the reading in the following loop. while(loop) { U_I needed = size - returned; U_I read; if(needed > ESCAPE_SEQUENCE_LENGTH) { U_I delta; // filling missing data in "a" from x_below read = x_below->read(a + returned, needed); below_position += read; if(read < needed) read_eof = true; // analyse the new data, unescape data sequences, (skip left for each escaped data) and stop at the first non data escape sequence // we temporarily use the variable escape_seq_offset_in_buffer to point in "a" instead of "read_buffer" escape_seq_offset_in_buffer = remove_data_marks_and_stop_at_first_real_mark(a + returned, read, delta, fixed_sequence); escaped_data_count_since_last_skip += delta; read -= delta; if(escape_seq_offset_in_buffer > read) throw SRC_BUG; returned += escape_seq_offset_in_buffer; if(escape_seq_offset_in_buffer < read) { // mark found in data // copy back the remaining data to read_buffer if(READ_BUFFER_SIZE < read - escape_seq_offset_in_buffer) throw SRC_BUG; // read_buffer too small to store all in-transit data read_buffer_size = read - escape_seq_offset_in_buffer; escape_seq_offset_in_buffer = 0; already_read = 0; // not setting yet read_eof, as it could be a false mark (starting like a mark, but not enough data to determin the real nature of the sequence) (void)memcpy(read_buffer, a + returned, read_buffer_size); read_eof = false; // because we moved out data from the one ready to be returned // eithet this was not the eof, and thus this call does not change anything // or it was EOF because data "read" was less than "needed" // but here some data will still be in read_buffer so EOF must be cleaned // be sure the mark is completed and return as much as requested data if not a complet mark needed = size - returned; if(needed > 0) { read = escape::inherited_read(a + returned, needed); // recursive call returned += read; } loop = false; } else // no mark found in data, all that got read is pure data and is directly sent to the upper layer { escape_seq_offset_in_buffer = read_buffer_size; // both should be equal to zero now loop = returned < size && !read_eof; } } else // too short space in "a" to put data and be sure there is not any mark in it, so we use read_buffer again { (void)mini_read_buffer(); // filling the read_buffer if(escape_seq_offset_in_buffer > 0) // some more data available in read_buffer returned += escape::inherited_read(a + returned, needed); // recursive call else read_eof = true; loop = false; } } // return the amount of data put into "a" return returned; } void escape::inherited_write(const char *a, U_I size) { U_I written = 0; U_I trouve; if(size == 0) return; // nothing to do if(write_buffer_size > 0) // some data are pending in transit { U_I initial_buffer_size = write_buffer_size; if(write_buffer_size >= ESCAPE_SEQUENCE_LENGTH - 1) throw SRC_BUG; // filling the buffer U_I delta = WRITE_BUFFER_SIZE - write_buffer_size; // available room in write_buffer delta = delta > size ? size : delta; (void)memcpy(write_buffer + write_buffer_size, a, delta); write_buffer_size += delta; written += delta; // checking for escape sequence in write_buffer trouve = trouve_amorce(write_buffer, write_buffer_size, fixed_sequence); if(trouve == write_buffer_size) // no escape sequence found { x_below->write(write_buffer, write_buffer_size); below_position += write_buffer_size; write_buffer_size = 0; } else // start of escape sequence found { if(trouve + ESCAPE_SEQUENCE_LENGTH - 1 <= write_buffer_size) // no doubt, we have a full escape sequence in data, we need to protect this data { x_below->write(write_buffer, trouve); below_position += trouve; set_fixed_sequence_for(seqt_not_a_sequence); x_below->write((const char *)fixed_sequence, ESCAPE_SEQUENCE_LENGTH); below_position += ESCAPE_SEQUENCE_LENGTH; // still remains valid data not yet written in write_buffer at offset 'trouve + ESCAPE_SEQUENCE_LENGTH - 1' // however this data is also in the input write_buffer (a, size) written = (trouve + ESCAPE_SEQUENCE_LENGTH - 1) - initial_buffer_size; // this way, we do not have to copy back to "a" the not yet written data ++escaped_data_count_since_last_skip; write_buffer_size = 0; // dropping all supplementary data added // it will be treated from the "a" buffer where they had been copied from } else // the escape sequence found is not complete { U_I yet_in_a = size - written; U_I missing_for_sequence = trouve + (ESCAPE_SEQUENCE_LENGTH - 1) - write_buffer_size; if(write_buffer_size < WRITE_BUFFER_SIZE && yet_in_a > 0) throw SRC_BUG; // write_buffer_size not filled while remains available data in "a" ! // either the escape sequence is entirely in "a" (and partially copied in write_buffer) // or there is not enough data in "a" to determin whether this start of sequence is complete or not // first, we can at least write down the data up to offset "trouve - 1" (that's "trouve" bytes). x_below->write(write_buffer, trouve); below_position += trouve; if(yet_in_a >= missing_for_sequence) // sequence entirely available with remaining data in "a" { if(trouve < initial_buffer_size) throw SRC_BUG; // some original data of write_buffer are part of the escape sequence !!! written = trouve - initial_buffer_size; write_buffer_size = 0; } else // missing data to determine the nature of the sequence { (void)memmove(write_buffer, write_buffer + trouve, write_buffer_size - trouve); write_buffer_size -= trouve; if(write_buffer_size >= ESCAPE_SEQUENCE_LENGTH - 1) throw SRC_BUG; // should never seen this if() condition if(write_buffer_size + yet_in_a > WRITE_BUFFER_SIZE) throw SRC_BUG; // not possible to reach normally, because yet_in_a < missing_for_sequence < SEQUENCE_LENGTH (void)memcpy(write_buffer + write_buffer_size, a+written, yet_in_a); written = size; write_buffer_size += yet_in_a; } } } } // now that we have eventually treated the write_buffer, we get two possibilities // either no escape sequence is pending in the write_buffer [write_buffer_size == 0] (escape sequence in "a" or non escape sequence found at all) // or an potential escape sequence is pending in the write_buffer, which only occurs if "a" does not contain any more // data to detemine the exact nature of this sequence [ written == size ] if(written != size && write_buffer_size > 0) throw SRC_BUG; // anormal situation, seen the previous comment. while(written < size) { U_I remains = size - written; trouve = trouve_amorce(a + written, remains, fixed_sequence); if(trouve == remains) { x_below->write(a + written, remains); below_position += remains; written = size; } else { if(trouve > 0) { x_below->write(a + written, trouve); below_position += trouve; written += trouve; } if(trouve + ESCAPE_SEQUENCE_LENGTH - 1 <= remains) // full escape sequence { set_fixed_sequence_for(seqt_not_a_sequence); x_below->write((const char *)fixed_sequence, ESCAPE_SEQUENCE_LENGTH); below_position += ESCAPE_SEQUENCE_LENGTH; written += ESCAPE_SEQUENCE_LENGTH - 1; ++escaped_data_count_since_last_skip; } else // not completed sequence { remains = size - written; if(remains >= ESCAPE_SEQUENCE_LENGTH - 1) throw SRC_BUG; // how possible is to not be able to fully determine the sequence ??? (void)memcpy(write_buffer, a + written, remains); write_buffer_size = remains; written = size; } } } } char escape::type2char(sequence_type x) { switch(x) { case seqt_not_a_sequence: return 'X'; case seqt_file: return 'F'; case seqt_ea: return 'E'; case seqt_catalogue: return 'C'; case seqt_data_name: return 'D'; case seqt_file_crc: return 'R'; case seqt_ea_crc: return 'r'; case seqt_changed: return 'W'; case seqt_dirty: return 'I'; case seqt_failed_backup: return '!'; case seqt_fsa: return 'S'; case seqt_fsa_crc: return 's'; default: throw SRC_BUG; } } escape::sequence_type escape::char2type(char x) { switch(x) { case 'X': return seqt_not_a_sequence; case 'F': return seqt_file; case 'E': return seqt_ea; case 'C': return seqt_catalogue; case 'D': return seqt_data_name; case 'R': return seqt_file_crc; case 'r': return seqt_ea_crc; case 'W': return seqt_changed; case 'I': return seqt_dirty; case '!': return seqt_failed_backup; case 'S': return seqt_fsa; case 's': return seqt_fsa_crc; default: throw Erange("escape::char2type", gettext("Unknown escape sequence type")); } } void escape::clean_read() { read_buffer_size = already_read = escape_seq_offset_in_buffer = 0; read_eof = false; escaped_data_count_since_last_skip = 0; } void escape::flush_write() { check_below(); if(write_buffer_size > 0) { x_below->write(write_buffer, write_buffer_size); below_position += write_buffer_size; write_buffer_size = 0; } } void escape::copy_from(const escape & ref) { x_below = ref.x_below; write_buffer_size = ref.write_buffer_size; if(write_buffer_size > WRITE_BUFFER_SIZE) throw SRC_BUG; (void)memcpy(write_buffer, ref.write_buffer, write_buffer_size); read_buffer_size = ref.read_buffer_size; if(read_buffer_size > READ_BUFFER_SIZE) throw SRC_BUG; (void)memcpy(read_buffer, ref.read_buffer, read_buffer_size); already_read = ref.already_read; read_eof = ref.read_eof; escaped_data_count_since_last_skip = ref.escaped_data_count_since_last_skip; below_position = ref.below_position; unjumpable = ref.unjumpable; (void)memcpy(fixed_sequence, ref.fixed_sequence, ESCAPE_SEQUENCE_LENGTH); } bool escape::mini_read_buffer() { U_I avail = read_buffer_size - already_read; if(avail < ESCAPE_SEQUENCE_LENGTH) { // we need more data if(already_read + ESCAPE_SEQUENCE_LENGTH >= READ_BUFFER_SIZE) { // we need room to place more data, so we skip data at the beginning of the read_buffer if(already_read < ESCAPE_SEQUENCE_LENGTH) throw SRC_BUG; // READ_BUFFER_SIZE is expected to be (much) larger than twice the escape sequence length, // so now, we never have to use memmove in place of memcpy: (void)memcpy(read_buffer, read_buffer + already_read, avail); if(escape_seq_offset_in_buffer < already_read) throw SRC_BUG; // escape_seq_offset_in_buffer, has not been updated sometime before escape_seq_offset_in_buffer -= already_read; already_read = 0; read_buffer_size = avail; } // recording up to what point data had been unescaped if(escape_seq_offset_in_buffer > read_buffer_size) throw SRC_BUG; // should not be greater than read_buffer_size else { U_I delta; // will receive the amount of byte to reduce the buffer (one byte for each data mark found) U_I delta_size; // will holds the size of the data to unescape U_I offset_in_buffer; U_I short_read; // adding some data at the end of the buffer short_read = x_below->read(read_buffer + read_buffer_size, ESCAPE_SEQUENCE_LENGTH - avail); read_buffer_size += short_read; below_position += short_read; avail = read_buffer_size - already_read; // we can continue unescaping the new data // but only what has not yet been unescaped, thus no data before escape_seq_offset_in_buffer delta_size = read_buffer_size - escape_seq_offset_in_buffer; offset_in_buffer = remove_data_marks_and_stop_at_first_real_mark(read_buffer + escape_seq_offset_in_buffer, delta_size, delta, fixed_sequence); delta_size -= delta; escaped_data_count_since_last_skip += delta; read_buffer_size = escape_seq_offset_in_buffer + delta_size; escape_seq_offset_in_buffer += offset_in_buffer; } } else // enough data, but removing any data mark found in the beginning of the read_buffer { if(escape_seq_offset_in_buffer == already_read && char2type(read_buffer[escape_seq_offset_in_buffer + ESCAPE_SEQUENCE_LENGTH - 1]) == seqt_not_a_sequence) { // next to read is a data mark, we must un-escape data U_I delta = 0; escape_seq_offset_in_buffer = already_read + remove_data_marks_and_stop_at_first_real_mark(read_buffer + already_read, read_buffer_size - already_read, delta, fixed_sequence); escaped_data_count_since_last_skip += delta; read_buffer_size -= delta; } } if(avail < ESCAPE_SEQUENCE_LENGTH) { read_eof = true; return false; } else return true; } U_I escape::trouve_amorce(const char *a, U_I size, const unsigned char escape_sequence[ESCAPE_SEQUENCE_LENGTH]) { U_I ret = 0; // points to the start of the escape sequence U_I curs = 0; // points to current byte considered U_I amorce = 0; // points to the byte to compare in the fixed sequence U_I found = ESCAPE_SEQUENCE_LENGTH - 1; // maximum number of byte to compare in fixed sequence while(curs < size && amorce < found) { if((unsigned char)a[curs] == escape_sequence[amorce]) { if(amorce == 0) ret = curs; ++amorce; } else if(amorce > 0) { curs -= amorce; amorce = 0; } ++curs; } if(curs >= size) // reached the end of the field if(amorce == 0) // and no start of escape sequence could be found ret = size; // else we return the start of the escape sequence found (or partial escape sequence if found at the end of the "a" buffer return ret; } U_I escape::remove_data_marks_and_stop_at_first_real_mark(char *a, U_I size, U_I & delta, const unsigned char escape_sequence[ESCAPE_SEQUENCE_LENGTH]) { bool loop = false; U_I ret = 0; delta = 0; do { ret += trouve_amorce(a + ret, size - ret, escape_sequence); if(ret < size) // start of escape sequence found if(ret + ESCAPE_SEQUENCE_LENGTH <= size) // we can determin the nature of the escape sequence if(char2type(a[ret + ESCAPE_SEQUENCE_LENGTH - 1]) == seqt_not_a_sequence) { (void)memmove(a + ret + ESCAPE_SEQUENCE_LENGTH - 1, a + ret + ESCAPE_SEQUENCE_LENGTH, size - ret - ESCAPE_SEQUENCE_LENGTH); ++delta; --size; // this modification is local to this method. loop = true; ret += ESCAPE_SEQUENCE_LENGTH - 1; // skipping one byte, as this is the escape data byte of which we just removed the protection } else loop = false; // real mark found else loop = false; // cannot know whether this is a real mark or just escaped data else loop = false; // no mark found } while(loop); return ret; } } // end of namespace dar-2.5.3/src/libdar/messaging.cpp0000644000175000017430000003004212641772777013742 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "messaging.hpp" #include "tools.hpp" using namespace std; namespace libdar { bool msg_equivalent(msg_type arg1, msg_type arg2) { bool ret = false; switch(arg1) { case msg_type::order_read_ahead: case msg_type::order_read_ahead_begin: if(arg2 == msg_type::order_read_ahead || arg2 == msg_type::order_read_ahead_begin) ret = true; break; case msg_type::order_skip: case msg_type::order_skip_begin: if(arg2 == msg_type::order_skip || arg2 == msg_type::order_skip_begin) ret = true; break; case msg_type::order_skippable_fwd: case msg_type::order_skippable_fwd_begin: if(arg2 == msg_type::order_skippable_fwd || arg2 == msg_type::order_skippable_fwd_begin) ret = true; break; case msg_type::order_skippable_bkd: case msg_type::order_skippable_bkd_begin: if(arg2 == msg_type::order_skippable_bkd || arg2 == msg_type::order_skippable_bkd_begin) ret = true; break; case msg_type::answr_position: case msg_type::answr_position_begin: if(arg2 == msg_type::answr_position || arg2 == msg_type::answr_position_begin) ret = true; break; case msg_type::unset: case msg_type::order_read: case msg_type::order_sync_write: case msg_type::answr_sync_write_done: case msg_type::order_skip_to_eof: case msg_type::order_skip_fwd: case msg_type::order_skip_bkd: case msg_type::answr_skip_done: case msg_type::answr_skippable: case msg_type::order_get_position: case msg_type::answr_exception: case msg_type::order_end_of_xmit: case msg_type::order_stop_readahead: case msg_type::answr_readahead_stopped: case msg_type::order_wakeup: ret = (arg1 == arg2); break; case msg_type::data_partial: case msg_type::data_completed: if(arg2 == msg_type::data_partial || arg2 == msg_type::data_completed) ret = true; break; default: throw SRC_BUG; } return ret; } bool msg_continues(msg_type msg) { switch(msg) { case msg_type::order_read_ahead_begin: case msg_type::order_skip_begin: case msg_type::order_skippable_fwd_begin: case msg_type::order_skippable_bkd_begin: case msg_type::answr_position_begin: return true; case msg_type::unset: case msg_type::order_read_ahead: case msg_type::order_read: case msg_type::order_sync_write: case msg_type::answr_sync_write_done: case msg_type::order_skip: case msg_type::order_skip_to_eof: case msg_type::order_skip_fwd: case msg_type::order_skip_bkd: case msg_type::answr_skip_done: case msg_type::order_skippable_fwd: case msg_type::order_skippable_bkd: case msg_type::answr_skippable: case msg_type::order_get_position: case msg_type::answr_position: case msg_type::answr_exception: case msg_type::order_end_of_xmit: case msg_type::order_stop_readahead: case msg_type::answr_readahead_stopped: case msg_type::order_wakeup: case msg_type::data_partial: // this is not an error case msg_type::data_completed: return false; default: throw SRC_BUG; } } char msg_type2char(msg_type x) { switch(x) { case msg_type::unset: throw SRC_BUG; case msg_type::order_read_ahead: return 'a'; case msg_type::order_read_ahead_begin: return 'A'; case msg_type::order_read: return 'r'; case msg_type::order_sync_write: return 'y'; case msg_type::answr_sync_write_done: return 'Y'; case msg_type::order_skip: return 's'; case msg_type::order_skip_begin: return 'S'; case msg_type::order_skip_to_eof: return 'z'; case msg_type::order_skip_fwd: return 'g'; case msg_type::order_skip_bkd: return 'c'; case msg_type::answr_skip_done: return 'o'; case msg_type::order_skippable_fwd: return 'f'; case msg_type::order_skippable_fwd_begin: return 'F'; case msg_type::order_skippable_bkd: return 'b'; case msg_type::order_skippable_bkd_begin: return 'B'; case msg_type::answr_skippable: return 'i'; case msg_type::order_get_position: return 'q'; case msg_type::answr_position: return 'p'; case msg_type::answr_position_begin: return 'P'; case msg_type::answr_exception: return 'X'; case msg_type::order_end_of_xmit: return 'Z'; case msg_type::order_stop_readahead: return 'W'; case msg_type::answr_readahead_stopped: return 'w'; case msg_type::order_wakeup: return 'h'; case msg_type::data_partial: return 'd'; case msg_type::data_completed: return 'D'; default: throw SRC_BUG; } } msg_type char2msg_type(char x) { switch(x) { case 'a': return msg_type::order_read_ahead; case 'A': return msg_type::order_read_ahead_begin; case 'r': return msg_type::order_read; case 'y': return msg_type::order_sync_write; case 'Y': return msg_type::answr_sync_write_done; case 's': return msg_type::order_skip; case 'S': return msg_type::order_skip_begin; case 'z': return msg_type::order_skip_to_eof; case 'g': return msg_type::order_skip_fwd; case 'c': return msg_type::order_skip_bkd; case 'o': return msg_type::answr_skip_done; case 'f': return msg_type::order_skippable_fwd; case 'F': return msg_type::order_skippable_fwd_begin; case 'b': return msg_type::order_skippable_bkd; case 'B': return msg_type::order_skippable_bkd_begin; case 'i': return msg_type::answr_skippable; case 'q': return msg_type::order_get_position; case 'p': return msg_type::answr_position; case 'P': return msg_type::answr_position_begin; case 'X': return msg_type::answr_exception; case 'Z': return msg_type::order_end_of_xmit; case 'W': return msg_type::order_stop_readahead; case 'w': return msg_type::answr_readahead_stopped; case 'h': return msg_type::order_wakeup; case 'd': return msg_type::data_partial; case 'D': return msg_type::data_completed; default: throw SRC_BUG; } } msg_type msg_continuation_of(msg_type x) { switch(x) { case msg_type::order_read_ahead_begin: throw SRC_BUG; case msg_type::order_skip_begin: throw SRC_BUG; case msg_type::order_skippable_fwd_begin: throw SRC_BUG; case msg_type::order_skippable_bkd_begin: throw SRC_BUG; case msg_type::answr_position_begin: throw SRC_BUG; case msg_type::unset: throw SRC_BUG; case msg_type::order_read_ahead: return msg_type::order_read_ahead_begin; case msg_type::order_read: throw SRC_BUG; case msg_type::order_sync_write: throw SRC_BUG; case msg_type::answr_sync_write_done: throw SRC_BUG; case msg_type::order_skip: return msg_type::order_skip_begin; case msg_type::order_skip_to_eof: throw SRC_BUG; case msg_type::order_skip_fwd: throw SRC_BUG; case msg_type::order_skip_bkd: throw SRC_BUG; case msg_type::answr_skip_done: throw SRC_BUG; case msg_type::order_skippable_fwd: return msg_type::order_skippable_fwd_begin; case msg_type::order_skippable_bkd: return msg_type::order_skippable_bkd_begin; case msg_type::answr_skippable: throw SRC_BUG; case msg_type::order_get_position: throw SRC_BUG; case msg_type::answr_position: return msg_type::answr_position_begin; case msg_type::answr_exception: throw SRC_BUG; case msg_type::order_end_of_xmit: throw SRC_BUG; case msg_type::order_stop_readahead: throw SRC_BUG; case msg_type::answr_readahead_stopped: throw SRC_BUG; case msg_type::order_wakeup: throw SRC_BUG; case msg_type::data_partial: return msg_type::data_partial; case msg_type::data_completed: return msg_type::data_partial; default: throw SRC_BUG; } } ////////////////////////////////////////////////////////////////////// void messaging_decode::clear() { buffer.reset(); msgt = msg_type::unset; } bool messaging_decode::add_block(const char *x_input, U_I size) { if(size < 1) throw SRC_BUG; else { msg_type tmp = char2msg_type(x_input[0]); if(msgt == msg_type::unset || msg_equivalent(msgt, tmp)) msgt = tmp; } if(msgt != msg_type::data_partial && msgt != msg_type::data_completed) { buffer.skip_to_eof(); buffer.write(x_input + 1, size - 1); } return !msg_continues(msgt); } infinint messaging_decode::get_infinint() const { infinint ret; messaging_decode *me = const_cast(this); if(me == nullptr) throw SRC_BUG; me->buffer.skip(0); ret.read(me->buffer); return ret; } U_I messaging_decode::get_U_I() const { U_I lu; U_I ret; messaging_decode *me = const_cast(this); if(me == nullptr) throw SRC_BUG; // no ending conversion, we stay in the same process on the same host me->buffer.skip(0); lu = me->buffer.read((char *)(&ret), sizeof(ret)); if(lu < sizeof(ret)) throw SRC_BUG; return ret; } string messaging_decode::get_string() const { string ret; messaging_decode *me = const_cast(this); if(me == nullptr) throw SRC_BUG; me->buffer.skip(0); tools_read_string(me->buffer, ret); return ret; } bool messaging_decode::get_bool() const { char tmp; U_I lu; messaging_decode *me = const_cast(this); if(me == nullptr) throw SRC_BUG; // no ending conversion, we stay in the same process on the same host me->buffer.skip(0); lu = me->buffer.read(&tmp, sizeof(tmp)); if(lu < sizeof(tmp)) throw SRC_BUG; return tmp != 0; } label messaging_decode::get_label() const { label ret; messaging_decode *me = const_cast(this); if(me == nullptr) throw SRC_BUG; me->buffer.skip(0); ret.read(me->buffer); return ret; } ////////////////////////////////////////////////////////////////////// void messaging_encode::clear() { buffer.reset(); msgt = msg_type::unset; } void messaging_encode::set_infinint(const infinint & val) { buffer.skip_to_eof(); val.dump(buffer); } void messaging_encode::set_U_I(U_I val) { // no ending conversion, we stay in the same process on the same host buffer.skip_to_eof(); buffer.write((char *)(&val), sizeof(val)); } void messaging_encode::set_string(const string & val) { buffer.skip_to_eof(); tools_write_string(buffer, val); } void messaging_encode::set_bool(bool val) { char tmp = val ? 1 : 0; buffer.skip_to_eof(); buffer.write(&tmp, sizeof(tmp)); } void messaging_encode::set_label(const label & val) { buffer.skip_to_eof(); val.dump(buffer); } void messaging_encode::reset_get_block() { buffer.skip(0); } bool messaging_encode::get_block(char *ptr, unsigned int & size) { U_I wrote; bool completed = true; if(size < 1) throw SRC_BUG; ptr[0] = msg_type2char(msgt); wrote = buffer.read(ptr + 1, size - 1); if(wrote == size - 1) // filled the buffer { if(buffer.get_position() < buffer.size()) { // some data remains to be written ptr[0] = msg_type2char(msg_continuation_of(msgt)); completed = false; } } size = wrote + 1; return completed; } } // end of generic_thread::namespace dar-2.5.3/src/libdar/cat_detruit.hpp0000644000175000017430000000502212641772777014301 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_detruit.hpp /// \brief used to record information in a catalogue about a deleted file (differential backup context) /// \ingroup Private #ifndef CAT_DETRUIT_HPP #define CAT_DETRUIT_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_nomme.hpp" #include "datetime.hpp" #include "archive_version.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the deleted file entry class cat_detruit : public cat_nomme { public : cat_detruit(const std::string & name, unsigned char firm, const datetime & date) : cat_nomme(name) , del_date(date) { signe = firm; }; cat_detruit(const pile_descriptor & pdesc, const archive_version & reading_ver, bool small); cat_detruit(const cat_nomme & ref) : cat_nomme(ref.get_name()), del_date(0) { signe = ref.signature(); }; bool operator == (const cat_entree & ref) const; unsigned char get_signature() const { return signe; }; void set_signature(unsigned char x) { signe = x; }; const datetime & get_date() const { return del_date; }; void set_date(const datetime & ref) { del_date = ref; }; /// inherited from cat_entree unsigned char signature() const { return 'x'; }; /// inherited from cat_entree cat_entree *clone() const { return new (get_pool()) cat_detruit(*this); }; protected: void inherited_dump(const pile_descriptor & pdesc, bool small) const; private : unsigned char signe; datetime del_date; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/mem_sized.hpp0000644000175000017430000000631412641772777013753 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file mem_sized.hpp /// \brief defines mem_sized class that holds a variable sized set of fixed sized blocks using class mem_cluster /// \ingroup Private #ifndef MEM_SIZED_HPP #define MEM_SIZED_HPP #include "../my_config.h" #include "mem_allocator.hpp" #include "mem_cluster.hpp" #include namespace libdar { /// \addtogroup Private /// @{ class mem_sized : public mem_manager { public: mem_sized(U_I x_block_size); mem_sized(const mem_sized & ref) { throw SRC_BUG; }; const mem_sized & operator = (const mem_sized & ref) { throw SRC_BUG; }; ~mem_sized(); /// to allocate a block of memory /// /// \param[out] ptr is set to the address of the mem_allocator that will have to be informed /// when the returned block will be released /// \return the address of the newly allocated block or nullptr upon failure void *alloc(mem_allocator * & ptr); /// returns true if all memory block so far allocated have been released bool is_empty() const; /// display a status of current mem_sized std::string dump() const; #ifdef LIBDAR_DEBUG_MEMORY /// provides information about the usage of the memory_pool U_I max_percent_full() const; #endif /// inherited from mem_manager virtual void push_to_release_list(mem_allocator *ref); private: static const U_I average_table_size = 10240; U_I table_size_64; //< size for clusters std::list clusters; //< the list of owned mem_cluster objects std::list::iterator next_free_in_table; //< points to an mem_cluster that is known to have free slots mem_cluster *pending_release; //< a totally free cluster that can be recycled if all others are full and a new block is requested or freed if another mem_cluster becomes also totally free #ifdef LIBDAR_DEBUG_MEMORY U_I sum_percent; //< summ of all max percent usage obtained before deleting a mem_cluster object (used for statistical purposes) U_I num_cluster; //< number of cluster which sum_percent has been collected from (sum_percent/num_cluster gives the average load of mem_clusters) #endif }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/fichier_global.cpp0000644000175000017430000000535412641772777014726 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include "infinint.hpp" #include "generic_file.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "cygwin_adapt.hpp" #include "int_tools.hpp" #include "fichier_global.hpp" #include "tools.hpp" #include #include #define BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < BUFFER_SIZE #undef BUFFER_SIZE #define BUFFER_SIZE SSIZE_MAX #endif #endif using namespace std; namespace libdar { void fichier_global::inherited_write(const char *a, U_I size) { U_I wrote = 0; while(wrote < size) { wrote += fichier_global_inherited_write(a+wrote, size-wrote); if(wrote < size) get_ui().pause(gettext("No space left on device, you have the opportunity to make room now. When ready : can we continue ?")); } } U_I fichier_global::inherited_read(char *a, U_I size) { U_I ret = 0; U_I read = 0; string message; while(!fichier_global_inherited_read(a+ret, size-ret, read, message)) { ret += read; get_ui().pause(message); } ret += read; return ret; } } // end of namespace dar-2.5.3/src/libdar/semaphore.cpp0000644000175000017430000000773712642457363013757 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "erreurs.hpp" #include "tools.hpp" #include "deci.hpp" #include "cat_all_entrees.hpp" #include "semaphore.hpp" using namespace std; namespace libdar { semaphore::semaphore(user_interaction & dialog, const string & backup_hook_file_execute, const mask & backup_hook_file_mask) : mem_ui(& dialog) { count = 0; chem = ""; filename = ""; uid = 0; gid = 0; sig = '\0'; execute = backup_hook_file_execute; match = backup_hook_file_mask.clone(); if(match == nullptr) throw Ememory("semaphore::semaphore"); } void semaphore::raise(const string & x_chem, const cat_entree *object, bool data_to_save) { if(count == 1) throw SRC_BUG; if(count > 1) // outer directory under controlled backup (hook_execute() ran in "start" context) { if(dynamic_cast(object) != nullptr) if(data_to_save) --count; else throw SRC_BUG; // CAT_EOD should always have its data to be saved else { if(dynamic_cast(object) != nullptr) ++count; } } else // semaphore is ready for a new entry { const cat_nomme *o_nom = dynamic_cast(object); if(o_nom == nullptr) return; // CAT_EOD associated to an unsaved directory if(data_to_save && match->is_covered(x_chem)) { const cat_directory *o_dir = dynamic_cast(object); const cat_inode *o_ino = dynamic_cast(object); if(o_dir != nullptr) count = 2; else count = 1; chem = x_chem; filename = o_nom->get_name(); uid = o_ino != nullptr ? o_ino->get_uid() : 0; gid = o_ino != nullptr ? o_ino->get_gid() : 0; sig = get_base_signature(object->signature()); tools_hook_execute(get_ui(), build_string("start")); } } } void semaphore::lower() { if(count == 1) { count = 0; tools_hook_execute(get_ui(), build_string("end")); } } string semaphore::build_string(const string & context) { map corres; corres['%'] = "%"; corres['p'] = chem; corres['f'] = filename; corres['c'] = context; corres['t'] = tools_printf("%c", sig); try { deci gid_string = gid; deci uid_string = uid; corres['u'] = uid_string.human(); corres['g'] = gid_string.human(); } catch(Edeci & e) { throw Edeci("semaphore::build_string", string(gettext("Error while converting UID/GID to string for backup hook file: ")) + e.get_message()); } return tools_substitute(execute, corres); } void semaphore::copy_from(const semaphore & ref) { count = ref.count; chem = ref.chem; filename = ref.filename; uid = ref.uid; gid = ref.gid; sig = ref.sig; execute = ref.execute; if(ref.match == nullptr) throw SRC_BUG; match = ref.match->clone(); if(match == nullptr) throw Ememory("semaphore::copy_from"); } void semaphore::detruit() { if(match != nullptr) { delete match; match = nullptr; } } } // end of namespace dar-2.5.3/src/libdar/tuyau.hpp0000644000175000017430000001175712641773000013131 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file tuyau.hpp /// \brief defines the implementation of pipe under the generic_file interface. /// \ingroup Private /// /// mainly used between zapette and slave_zapette, this is a full implementation /// of the generic_file interface that takes care of dead lock when two pipes needs /// to be openned between the same two entities, each having one for reading and the /// other for writing. #ifndef TUYAU_HPP #define TUYAU_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "thread_cancellation.hpp" #include "mem_ui.hpp" namespace libdar { /// pipe implementation under the generic_file interface. /// \ingroup Private class tuyau : public generic_file, public thread_cancellation, protected mem_ui { public: tuyau(const user_interaction & dialog, //< for user interaction int fd); //< fd is the filedescriptor of a pipe extremity already openned tuyau(const user_interaction & dialog, //< for user interaction int fd, //< fd is the filedescriptor of a pipe extremity already openned gf_mode mode); //< forces the mode if possible tuyau(const user_interaction & dialog, //< for user interaction const std::string &filename, //< named pipe to open gf_mode mode); //< forces the mode if possible tuyau(const user_interaction & dialog);//< creates a anonymous pipe and bind itself to the writing end. The reading end can be obtained by get_read_side() method ~tuyau(); // provides the reading end of the anonymous pipe when the current object has created it (no filedesc, no path given to constructor). // it cannot be called more than once. int get_read_fd() const; /// closes the read fd of the anonymous pipe (this is to be used by a writer) /// \note to ensure a proper behavior of the 'eof', the writer must close the read fd /// this call let this be done, assuming the read has already fetched the fd and forked /// in a new process void close_read_fd(); /// ask to not close the read descriptor upon object destruction (the fd survives the object) void do_not_close_read_fd(); // inherited from generic_file bool skippable(skippability direction, const infinint & amount); bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(signed int x); infinint get_position() const { return position; }; bool has_next_to_read(); protected: void inherited_read_ahead(const infinint & amount) {}; // relying on the operating system virtual U_I inherited_read(char *a, U_I size); virtual void inherited_write(const char *a, U_I size); void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate(); private: enum { pipe_fd, //< holds a single file descriptor for the pipe pipe_path, //< holds a filename to be openned (named pipe) pipe_both //< holds a pair of file descriptors } pipe_mode; //< defines how the object's status (which possible values defined by the anonymous enum above) infinint position; //< recorded position in the stream int filedesc; //< file descriptors of the pipe int other_end_fd; //< in pipe_both mode, this holds the reading side of the anonymous pipe std::string chemin; //< in pipe_path mode only, this holds the named pipe to be open bool has_one_to_read; //< if true, the next char to read is placed in "next_to_read" char next_to_read; //< when has_one_to_read is true, contains the next to read byte void ouverture(); /// skip forward by reading data /// \param[in] byte is the amount of byte to skip forward /// \return true if the given amount of byte could be read, false otherwise (reached EOF). bool read_and_drop(infinint byte); /// skip to eof by reading data bool read_to_eof(); }; } // end of namespace #endif dar-2.5.3/src/libdar/pile.hpp0000644000175000017430000002154112641772777012727 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file pile.hpp /// \brief class pile definition. Used to manage a stack of generic_file objects /// \ingroup Private #ifndef PILE_HPP #define PILE_HPP #include "../my_config.h" #include #include #include "generic_file.hpp" namespace libdar { /// \addtogroup Private /// @{ class pile : public generic_file { public: /// the constructor /// /// \note the mode (gf_mode) of the pile is the one of the first object pushed on the stack, /// thus when empty we choose the arbitrary gf_read_only value, because the stack is empty. pile() : generic_file(gf_read_only) { stack.clear(); }; pile(const pile & ref) : generic_file(ref) { copy_from(ref); }; const pile & operator = (const pile & ref) { detruit(); copy_from(ref); return *this; }; ~pile() { detruit(); }; /// add a generic_file on the top /// /// \param[in] f is the address of the object to add to the stack /// \param[in] label unique label associated to this object in the current stack, exception thrown if label already used in stack /// \param[in] extend_mode allow the new object to have more read/write permission than the already placed object, which have the effect to change the read/write permission of the stack itself, future push() will accept wider permission even if extend_mode is not set /// \note once added, the object memory allocation is managed by the pile object /// the pile is responsible of destroying this object if its destructor is called /// however, the pile object releases its responsibility about any object that /// will be poped (see pop() below) from the stack. /// \note empty label (empty string) is the only value that can be used for several objects of the stack void push(generic_file *f, const std::string & label = "", bool extend_mode = false); /// remove the top generic_file from the top /// /// \returns the address of the object that has been poped from the stack or nullptr if the stack is empty /// \note this is now the duty of the caller to release this object memory when the object is no more needed generic_file *pop(); /// remove the top generic_file and destroy it /// \param[in] ptr is the type of the object that must be found on the top of the stack. It may be the type of an parent class. /// \return true if and only if the object on the top of the stack could be matched to the given type, this object is then poped from the stack and destroyed. template bool pop_and_close_if_type_is(T *ptr); /// returns the address of the top generic_file generic_file *top() { if(stack.empty()) return nullptr; else return stack.back().ptr; }; /// returns the address of teh bottom generic_file generic_file *bottom() { if(stack.empty()) return nullptr; else return stack[0].ptr; }; /// returns the number of objects in the stack U_I size() const { return stack.size(); }; /// returns true if the stack is empty, false otherwise. bool is_empty() const { return stack.empty(); }; /// clears the stack void clear() { detruit(); }; /// this template let the class user find out the higher object on the stack of the given type /// \param[in,out] ref gives the type of the object to look for, and gets the address of the first object found starting from the top /// \note if no object of that type could be found in the stack ref is set to nullptr template void find_first_from_top(T * & ref); /// this template is similar to the template "find_first_from_top" except that the search is started from the bottom of the stack template void find_first_from_bottom(T * & ref); /// return the generic_file object just below the given object or nullptr if the object is at the bottom of the stack or is not in the stack generic_file *get_below(const generic_file *ref); /// return the generic_file object just above the given object or nullptr if the object is at the bottom of the stack or is not in the stack generic_file *get_above(const generic_file *ref); /// find the object associated to a given label /// /// \param[in] label is the label to look for, empty string is forbidden /// \return the object associated to label, else an exception is thrown generic_file *get_by_label(const std::string & label); /// if label is associated to a member of the stack, makes this member of the stack an anoymous member (the label is no more associated to this object, while this object stays in the stack untouched /// /// \param[in] label the label to clear, empty string is not a valid label an exception is thrown if used here /// \note no exception is thrown else, even if the label is not present in the stack void clear_label(const std::string & label); /// associate a additional label to the object currently at the top of the stack /// /// \param[in] label the label to add /// \note this does not remove an eventually existing label that had been added either by push() or add_label() previously /// \note an object of the stack can thus be refered by several different labels void add_label(const std::string & label); /// call the generic_file::sync_write() method of all object found above ptr in the stack void sync_write_above(generic_file *ptr); /// call the generic_file::flush_read() method of all objects found above ptr in the stack void flush_read_above(generic_file *ptr); // inherited methods from generic_file // they all apply to the top generic_file object, they fail by Erange() exception if the stack is empty bool skippable(skippability direction, const infinint & amount); bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const; void copy_to(generic_file & ref); void copy_to(generic_file & ref, const infinint & crc_size, crc * & value); protected: void inherited_read_ahead(const infinint & amount); U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write(); void inherited_flush_read(); void inherited_terminate(); private: struct face { generic_file * ptr; std::list labels; }; // ok, had not much idea to find a name for that struct, "face" was the first idea found to be associated with "pile", which means stack // in French but also is the name of the face of a coin where its value is written. The opposite face of a coin is called "face" in French // because often a face is design there and the expression "tirer `a pile ou face" (meaning "to toss up") is very common. std::vector stack; void copy_from(const pile & ref) { throw SRC_BUG; // it is not possible to copy an object to its another of the exact same type when only a pure virtual pointer pointing on it is available, or when no virtual "clone'-like method is available from the root pure virtual class (generic_file here). }; void detruit(); std::vector::iterator look_for_label(const std::string & label); }; template bool pile::pop_and_close_if_type_is(T *ptr) { generic_file *top = nullptr; if(!stack.empty()) { top = stack.back().ptr; ptr = dynamic_cast(top); if(ptr != nullptr) { stack.pop_back(); delete top; return true; } else return false; } else return false; } template void pile::find_first_from_top(T * & ref) { ref = nullptr; for(std::vector::reverse_iterator it = stack.rbegin(); it != stack.rend() && ref == nullptr; ++it) ref = dynamic_cast(it->ptr); } template void pile::find_first_from_bottom(T * & ref) { ref = nullptr; for(std::vector::iterator it = stack.begin(); it != stack.end() && ref == nullptr; ++it) ref = dynamic_cast(it->ptr); } /// @} } // end of namespace #endif dar-2.5.3/src/libdar/fichier_local.hpp0000644000175000017430000001071012642457363014545 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file fichier_local.hpp /// \brief class fichier_global definition. This is a full implementation/inherited class of class fichier_global /// this type of object are generated by entrepot_local. /// \ingroup Private #ifndef FICHIER_LOCAL_HPP #define FICHIER_LOCAL_HPP #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif } // end extern "C" #include "integers.hpp" #include "thread_cancellation.hpp" #include "label.hpp" #include "crc.hpp" #include "user_interaction.hpp" #include "mem_ui.hpp" #include "fichier_global.hpp" #include namespace libdar { /// \addtogroup Private /// @{ class fichier_local : public fichier_global { public : // constructors fichier_local(user_interaction & dialog, const std::string & chemin, gf_mode m, U_I permission, bool fail_if_exists, bool erase, bool furtive_mode); fichier_local(const std::string & chemin, bool furtive_mode = false); // builds a read-only object fichier_local(const fichier_local & ref) : fichier_global(ref) { copy_from(ref); }; // assignment operator const fichier_local & operator = (const fichier_local & ref) { detruit(); copy_parent_from(ref); copy_from(ref); return *this; }; // destructor ~fichier_local() { detruit(); }; /// set the ownership of the file virtual void change_ownership(const std::string & user, const std::string & group); /// change the permission of the file virtual void change_permission(U_I perm); /// return the size of the file infinint get_size() const; /// set posix_fadvise for the whole file void fadvise(advise adv) const; // inherited from generic_file bool skippable(skippability direction, const infinint & amount) { return true; }; bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const; /// provide the low level filedescriptor to the call and terminate() /// /// \note this the caller duty to close() the provided filedescriptor S_I give_fd_and_terminate() { int ret = filedesc; filedesc = -1; terminate(); return ret; }; protected : // inherited from generic_file grand-parent class void inherited_read_ahead(const infinint & amount) {}; // nothing done, calling readahead(2) could be added in the future void inherited_sync_write() { fsync(); }; void inherited_flush_read() {}; // nothing stored in transit in this object void inherited_terminate() { if(adv == advise_dontneed) fadvise(adv); }; // inherited from fichier_global parent class U_I fichier_global_inherited_write(const char *a, U_I size); bool fichier_global_inherited_read(char *a, U_I size, U_I & read, std::string & message); private : S_I filedesc; advise adv; void open(const std::string & chemin, gf_mode m, U_I permission, bool fail_if_exists, bool erase, bool furtive_mode); void copy_from(const fichier_local & ref); void copy_parent_from(const fichier_local & ref); void detruit() { if(filedesc >= 0) close(filedesc); filedesc = -1; }; int advise_to_int(advise arg) const; /// sync the data to disk /// this is necessary under Linux for better efficiency /// before calling fadvise(advise_dontneed) else write pending blocks /// would stay in the cache more time than necessary void fsync() const; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_tube.hpp0000644000175000017430000000473612642457363013563 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_tube.hpp /// \brief class to record named pipes in a catalogue /// \ingroup Private #ifndef CAT_TUBE_HPP #define CAT_TUBE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_inode.hpp" #include "cat_tools.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the named pipe class class cat_tube : public cat_inode { public : cat_tube(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & xname, const infinint & fs_device): cat_inode(xuid, xgid, xperm, last_access, last_modif, last_change, xname, fs_device) { set_saved_status(s_saved); }; cat_tube(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small): cat_inode(dialog, pdesc, reading_ver, saved, small) {}; bool operator == (const cat_entree & ref) const; // using dump from cat_inode class // using method is_more_recent_than() from cat_inode class // using method has_changed_since() from cat_inode class /// inherited from cat_entree unsigned char signature() const { return mk_signature('p', get_saved_status()); }; /// inherited from cat_entree cat_entree *clone() const { return new (get_pool()) cat_tube(*this); }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/catalogue.cpp0000644000175000017430000014075312642474445013734 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // to allow compilation under Cygwin we need // else Cygwin's lack __int16_t symbol !?! #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #ifdef STDC_HEADERS #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include #include #include #include "catalogue.hpp" #include "tools.hpp" #include "tronc.hpp" #include "user_interaction.hpp" #include "deci.hpp" #include "header.hpp" #include "defile.hpp" #include "pile.hpp" #include "sparse_file.hpp" #include "fichier_local.hpp" #include "macro_tools.hpp" #include "null_file.hpp" #include "range.hpp" #include "cat_all_entrees.hpp" #include "cat_tools.hpp" using namespace std; namespace libdar { static bool local_check_dirty_seq(escape *ptr); static inline string yes_no(bool val) { return (val ? "yes" : "no"); } catalogue::catalogue(const user_interaction & dialog, const datetime & root_last_modif, const label & data_name) : mem_ui(dialog), out_compare("/") { contenu = nullptr; try { contenu = new (get_pool()) cat_directory(0,0,0,datetime(0),root_last_modif,datetime(0),"root",0); if(contenu == nullptr) throw Ememory("catalogue::catalogue(path)"); current_compare = contenu; current_add = contenu; current_read = contenu; sub_tree = nullptr; ref_data_name = data_name; } catch(...) { if(contenu != nullptr) delete contenu; throw; } stats.clear(); } catalogue::catalogue(const user_interaction & dialog, const pile_descriptor &pdesc, const archive_version & reading_ver, compression default_algo, bool lax, const label & lax_layer1_data_name, bool only_detruit) : mem_ui(dialog), out_compare("/") { string tmp; unsigned char a; saved_status st; unsigned char base; map corres; crc *calc_crc = nullptr; crc *read_crc = nullptr; contenu = nullptr; pdesc.check(false); try { pdesc.stack->reset_crc(CAT_CRC_SIZE); try { if(reading_ver > 7) { // we first need to read the ref_data_name try { ref_data_name.read(*pdesc.stack); } catch(Erange & e) { throw Erange("catalogue::catalogue(generic_file &)", gettext("incoherent catalogue structure")); } } else ref_data_name.clear(); // a cleared data_name is emulated for older archives if(lax) { if(ref_data_name != lax_layer1_data_name && !lax_layer1_data_name.is_cleared()) { get_ui().warning(gettext("LAX MODE: catalogue label does not match archive label, as if it was an extracted catalogue, assuming data corruption occurred and fixing the catalogue to be considered an a plain internal catalogue")); ref_data_name = lax_layer1_data_name; } } pdesc.stack->read((char *)&a, 1); // need to read the signature before constructing "contenu" if(! extract_base_and_status(a, base, st) && !lax) throw Erange("catalogue::catalogue(generic_file &)", gettext("incoherent catalogue structure")); if(base != 'd' && !lax) throw Erange("catalogue::catalogue(generic_file &)", gettext("incoherent catalogue structure")); stats.clear(); contenu = new (get_pool()) cat_directory(get_ui(), pdesc, reading_ver, st, stats, corres, default_algo, lax, only_detruit, false); if(contenu == nullptr) throw Ememory("catalogue::catalogue(path)"); if(only_detruit) contenu->remove_all_mirages_and_reduce_dirs(); current_compare = contenu; current_add = contenu; current_read = contenu; sub_tree = nullptr; } catch(...) { calc_crc = pdesc.stack->get_crc(); // keeping "f" in coherent status if(calc_crc != nullptr) { delete calc_crc; calc_crc = nullptr; } throw; } calc_crc = pdesc.stack->get_crc(); // keeping "f" incoherent status in any case if(calc_crc == nullptr) throw SRC_BUG; if(reading_ver > 7) { bool force_crc_failure = false; try { read_crc = create_crc_from_file(*pdesc.stack, get_pool()); } catch(Egeneric & e) { force_crc_failure = true; } if(force_crc_failure || read_crc == nullptr || calc_crc == nullptr || read_crc->get_size() != calc_crc->get_size() || *read_crc != *calc_crc) { if(!lax) throw Erange("catalogue::catalogue(generic_file &)", gettext("CRC failed for table of contents (aka \"catalogue\")")); else get_ui().pause(gettext("LAX MODE: CRC failed for catalogue, the archive contents is corrupted. This may even lead dar to see files in the archive that never existed, but this will most probably lead to other failures in restoring files. Shall we proceed anyway?")); } } } catch(...) { if(contenu != nullptr) delete contenu; if(calc_crc != nullptr) delete calc_crc; if(read_crc != nullptr) delete read_crc; throw; } // "contenu" must not be destroyed under normal terminaison! if(calc_crc != nullptr) delete calc_crc; if(read_crc != nullptr) delete read_crc; } const catalogue & catalogue::operator = (const catalogue &ref) { mem_ui * me = this; const mem_ui & you = ref; detruire(); if(me == nullptr) throw SRC_BUG; *me = you; // copying the mem_ui data // now copying the catalogue's data out_compare = ref.out_compare; partial_copy_from(ref); return *this; } void catalogue::reset_read() const { catalogue *ceci = const_cast(this); ceci->current_read = ceci->contenu; ceci->contenu->reset_read_children(); } void catalogue::end_read() const { catalogue *ceci = const_cast(this); ceci->current_read = ceci->contenu; ceci->contenu->end_read(); } void catalogue::skip_read_to_parent_dir() const { catalogue *ceci = const_cast(this); cat_directory *tmp = ceci->current_read->get_parent(); if(tmp == nullptr) throw Erange("catalogue::skip_read_to_parent_dir", gettext("root does not have a parent directory")); ceci->current_read = tmp; } bool catalogue::read(const cat_entree * & ref) const { catalogue *ceci = const_cast(this); const cat_nomme *tmp; if(ceci->current_read->read_children(tmp)) { const cat_directory *dir = dynamic_cast(tmp); if(dir != nullptr) { ceci->current_read = const_cast(dir); dir->reset_read_children(); } ref = tmp; return true; } else { cat_directory *papa = ceci->current_read->get_parent(); ref = &r_eod; if(papa == nullptr) return false; // we reached end of root, no cat_eod generation else { ceci->current_read = papa; return true; } } } bool catalogue::read_if_present(string *name, const cat_nomme * & ref) const { catalogue *ceci = const_cast(this); const cat_nomme *tmp; if(current_read == nullptr) throw Erange("catalogue::read_if_present", gettext("no current directory defined")); if(name == nullptr) // we have to go to parent directory { if(current_read->get_parent() == nullptr) throw Erange("catalogue::read_if_present", gettext("root directory has no parent directory")); else ceci->current_read = current_read->get_parent(); ref = nullptr; return true; } else // looking for a real filename if(current_read->search_children(*name, tmp)) { cat_directory *d = dynamic_cast(const_cast(tmp)); if(d != nullptr) // this is a directory need to chdir to it ceci->current_read = d; ref = tmp; return true; } else // filename not present in current dir return false; } void catalogue::remove_read_entry(std::string & name) { if(current_read == nullptr) throw Erange("catalogue::remove_read_entry", gettext("no current reading directory defined")); current_read->remove(name); } void catalogue::tail_catalogue_to_current_read() { while(current_read != nullptr) { current_read->tail_to_read_children(); current_read = current_read->get_parent(); } current_read = contenu; } void catalogue::reset_sub_read(const path &sub) { if(! sub.is_relative()) throw SRC_BUG; if(sub_tree != nullptr) delete sub_tree; sub_tree = new (get_pool()) path(sub); if(sub_tree == nullptr) throw Ememory("catalogue::reset_sub_read"); sub_count = -1; // must provide the path to subtree; reset_read(); } bool catalogue::sub_read(const cat_entree * &ref) { string tmp; if(sub_tree == nullptr) throw SRC_BUG; // reset_sub_read switch(sub_count) { case 0 : // sending oed to go back to the root if(sub_tree->pop(tmp)) { ref = &r_eod; return true; } else { ref = nullptr; delete sub_tree; sub_tree = nullptr; sub_count = -2; return false; } case -2: // reading is finished return false; case -1: // providing path to sub_tree if(sub_tree->read_subdir(tmp)) { const cat_nomme *xtmp; if(const_cast(current_read)->search_children(tmp, xtmp)) { ref = xtmp; const cat_directory *dir = dynamic_cast(xtmp); if(dir != nullptr) { current_read = const_cast(dir); return true; } else if(sub_tree->read_subdir(tmp)) { get_ui().warning(sub_tree->display() + gettext(" is not present in the archive")); delete sub_tree; sub_tree = nullptr; sub_count = -2; return false; } else // subdir is a single file (no tree)) { sub_count = 0; return true; } } else { get_ui().warning(sub_tree->display() + gettext(" is not present in the archive")); delete sub_tree; sub_tree = nullptr; sub_count = -2; return false; } } else { sub_count = 1; current_read->reset_read_children(); // now reading the sub_tree // no break ! } default: if(read(ref) && sub_count > 0) { const cat_directory *dir = dynamic_cast(ref); const cat_eod *fin = dynamic_cast(ref); if(dir != nullptr) sub_count++; if(fin != nullptr) sub_count--; return true; } else throw SRC_BUG; } } void catalogue::reset_add() { current_add = contenu; } void catalogue::add(cat_entree *ref) { if(current_add == nullptr) throw SRC_BUG; cat_eod *f = dynamic_cast(ref); if(f == nullptr) // ref is not cat_eod { cat_nomme *n = dynamic_cast(ref); cat_directory *t = dynamic_cast(ref); if(n == nullptr) throw SRC_BUG; // unknown type neither "cat_eod" nor "cat_nomme" current_add->add_children(n); if(t != nullptr) // ref is a directory current_add = t; stats.add(ref); } else // ref is an cat_eod { cat_directory *parent = current_add->get_parent(); if(parent == nullptr) throw SRC_BUG; // root has no parent directory, cannot change to it else current_add = parent; delete ref; // all data given throw add becomes owned by the catalogue object } } void catalogue::re_add_in(const string &subdirname) { const cat_nomme *sub = nullptr; if(const_cast(current_add)->search_children(subdirname, sub)) { const cat_directory *subdir = dynamic_cast(sub); if(subdir != nullptr) current_add = const_cast(subdir); else throw Erange("catalogue::re_add_in", gettext("Cannot recurs in a non directory entry")); } else throw Erange("catalogue::re_add_in", gettext("The entry to recurs in does not exist, cannot add further entry to that absent subdirectory")); } void catalogue::re_add_in_replace(const cat_directory &dir) { if(dir.has_children()) throw Erange("catalogue::re_add_in_replace", "Given argument must be an empty dir"); re_add_in(dir.get_name()); *current_add = dir; // the directory's 'operator =' method does preverse existing children of the left (assigned) operand } void catalogue::add_in_current_read(cat_nomme *ref) { if(current_read == nullptr) throw SRC_BUG; // current read directory does not exists current_read->add_children(ref); } void catalogue::reset_compare() const { catalogue *me = const_cast(this); if(me == nullptr) throw SRC_BUG; me->current_compare = me->contenu; me->out_compare = "/"; } bool catalogue::compare(const cat_entree * target, const cat_entree * & extracted) const { catalogue *me = const_cast(this); const cat_mirage *mir = dynamic_cast(target); const cat_directory *dir = dynamic_cast(target); const cat_eod *fin = dynamic_cast(target); const cat_nomme *nom = dynamic_cast(target); if(me == nullptr) throw SRC_BUG; if(mir != nullptr) dir = dynamic_cast(mir->get_inode()); if(out_compare.degre() > 1) // actually scanning a nonexisting directory { if(dir != nullptr) me->out_compare += dir->get_name(); else if(fin != nullptr) { string tmp_s; if(!me->out_compare.pop(tmp_s)) { if(out_compare.is_relative()) throw SRC_BUG; // should not be a relative path !!! else // both cases are bugs, but need to know which case is generating a bug throw SRC_BUG; // out_compare.degre() > 0 but cannot pop ! } } return false; } else // scanning an existing directory { const cat_nomme *found; if(fin != nullptr) { cat_directory *tmp = current_compare->get_parent(); if(tmp == nullptr) throw Erange("catalogue::compare", gettext("root has no parent directory")); me->current_compare = tmp; extracted = target; return true; } if(nom == nullptr) throw SRC_BUG; // ref, is neither a cat_eod nor a cat_nomme ! what's that ??? if(current_compare->search_children(nom->get_name(), found)) { const cat_detruit *src_det = dynamic_cast(nom); const cat_detruit *dst_det = dynamic_cast(found); const cat_inode *src_ino = dynamic_cast(nom); const cat_inode *dst_ino = dynamic_cast(found); const cat_mirage *src_mir = dynamic_cast(nom); const cat_mirage *dst_mir = dynamic_cast(found); // extracting cat_inode from hard links if(src_mir != nullptr) src_ino = src_mir->get_inode(); if(dst_mir != nullptr) dst_ino = dst_mir->get_inode(); // updating internal structure to follow directory tree : if(dir != nullptr) { const cat_directory *d_ext = dynamic_cast(dst_ino); if(d_ext != nullptr) me->current_compare = const_cast(d_ext); else me->out_compare += dir->get_name(); } // now comparing the objects : if(src_ino != nullptr) if(dst_ino != nullptr) { if(!src_ino->same_as(*dst_ino)) return false; } else return false; else if(src_det != nullptr) if(dst_det != nullptr) { if(!dst_det->same_as(*dst_det)) return false; } else return false; else throw SRC_BUG; // src_det == nullptr && src_ino == nullptr, thus a cat_nomme which is neither cat_detruit nor cat_inode ! if(dst_mir != nullptr) extracted = dst_mir->get_inode(); else extracted = found; return true; } else { if(dir != nullptr) me->out_compare += dir->get_name(); return false; } } } infinint catalogue::update_destroyed_with(const catalogue & ref) { cat_directory *current = contenu; const cat_nomme *ici; const cat_entree *projo; const cat_eod *pro_eod; const cat_directory *pro_dir; const cat_detruit *pro_det; const cat_nomme *pro_nom; const cat_mirage *pro_mir; infinint count = 0; ref.reset_read(); while(ref.read(projo)) { pro_eod = dynamic_cast(projo); pro_dir = dynamic_cast(projo); pro_det = dynamic_cast(projo); pro_nom = dynamic_cast(projo); pro_mir = dynamic_cast(projo); if(pro_eod != nullptr) { cat_directory *tmp = current->get_parent(); if(tmp == nullptr) throw SRC_BUG; // reached root for "contenu", and not yet for "ref"; current = tmp; continue; } if(pro_det != nullptr) continue; if(pro_nom == nullptr) throw SRC_BUG; // neither an cat_eod nor a cat_nomme ! what's that ? if(!current->search_children(pro_nom->get_name(), ici)) { unsigned char firm; if(pro_mir != nullptr) firm = pro_mir->get_inode()->signature(); else firm = pro_nom->signature(); cat_detruit *det_tmp = new (get_pool()) cat_detruit(pro_nom->get_name(), firm, current->get_last_modif()); if(det_tmp == nullptr) throw Ememory("catalogue::update_destroyed_with"); try { current->add_children(det_tmp); } catch(...) { delete det_tmp; throw; } count++; if(pro_dir != nullptr) ref.skip_read_to_parent_dir(); } else if(pro_dir != nullptr) { const cat_directory *ici_dir = dynamic_cast(ici); if(ici_dir != nullptr) current = const_cast(ici_dir); else ref.skip_read_to_parent_dir(); } } return count; } void catalogue::update_absent_with(const catalogue & ref, infinint aborting_next_etoile) { cat_directory *current = contenu; const cat_nomme *ici; const cat_entree *projo; const cat_eod *pro_eod; const cat_directory *pro_dir; const cat_detruit *pro_det; const cat_nomme *pro_nom; const cat_inode *pro_ino; const cat_mirage *pro_mir; map corres_clone; // for each etiquette from the reference catalogue // gives an cloned or original cat_etoile object // in the current catalogue ref.reset_read(); while(ref.read(projo)) { pro_eod = dynamic_cast(projo); pro_dir = dynamic_cast(projo); pro_det = dynamic_cast(projo); pro_nom = dynamic_cast(projo); pro_ino = dynamic_cast(projo); pro_mir = dynamic_cast(projo); if(pro_eod != nullptr) { cat_directory *tmp = current->get_parent(); if(tmp == nullptr) throw SRC_BUG; // reached root for "contenu", and not yet for "ref"; current = tmp; continue; } if(pro_det != nullptr) continue; if(pro_nom == nullptr) throw SRC_BUG; // neither an cat_eod nor a cat_nomme! what's that? if(pro_mir != nullptr) pro_ino = pro_mir->get_inode(); // warning: the returned cat_inode's name is undefined // one must use the mirage's own name if(pro_ino == nullptr) throw SRC_BUG; // a nome that is not an cat_inode nor a cat_detruit!? What's that? if(!current->search_children(pro_nom->get_name(), ici)) { cat_entree *clo_ent = nullptr; cat_inode *clo_ino = nullptr; cat_directory *clo_dir = nullptr; cat_mirage *clo_mir = nullptr; cat_etoile *clo_eto = nullptr; try { clo_ent = pro_ino->clone(); clo_ino = dynamic_cast(clo_ent); clo_dir = dynamic_cast(clo_ent); // sanity checks if(clo_ino == nullptr) throw SRC_BUG; // clone of an cat_inode is not an cat_inode??? if((clo_dir != nullptr) ^ (pro_dir != nullptr)) throw SRC_BUG; // both must be nullptr or both must be non nullptr // converting cat_inode to unsaved entry clo_ino->set_saved_status(s_not_saved); if(clo_ino->ea_get_saved_status() != cat_inode::ea_none) { if(clo_ino->ea_get_saved_status() == cat_inode::ea_removed) clo_ino->ea_set_saved_status(cat_inode::ea_none); else clo_ino->ea_set_saved_status(cat_inode::ea_partial); } // handling hard links if(pro_mir != nullptr) { try { map::iterator it = corres_clone.find(pro_mir->get_etiquette()); if(it == corres_clone.end()) { clo_eto = new (get_pool()) cat_etoile(clo_ino, aborting_next_etoile++); if(clo_eto == nullptr) throw Ememory("catalogue::update_absent_with"); else clo_ent = nullptr; // object now managed by clo_eto try { corres_clone[pro_mir->get_etiquette()] = clo_eto; clo_mir = new (get_pool()) cat_mirage(pro_mir->get_name(), clo_eto); if(clo_mir == nullptr) throw Ememory("catalogue::update_absent_with"); } catch(...) { if(clo_eto != nullptr) delete clo_eto; throw; } } else // mapping already exists (a star already shines) { // we have cloned the cat_inode but we do not need it as // an hard linked structure already exists delete clo_ent; clo_ent = nullptr; // so we add a new reference to the existing hard linked structure clo_mir = new (get_pool()) cat_mirage(pro_mir->get_name(), it->second); if(clo_mir == nullptr) throw Ememory("catalogue::update_absent_with"); } // adding it to the catalogue current->add_children(clo_mir); } catch(...) { if(clo_mir != nullptr) { delete clo_mir; clo_mir = nullptr; } throw; } } else // not a hard link entry { // adding it to the catalogue current->add_children(clo_ino); clo_ent = nullptr; // object now managed by the current catalogue } // recusing in case of directory if(clo_dir != nullptr) { if(current->search_children(pro_ino->get_name(), ici)) { if((void *)ici != (void *)clo_dir) throw SRC_BUG; // we have just added the entry we were looking for, but could find another one!?! current = clo_dir; } else throw SRC_BUG; // cannot find the entry we have just added!!! } } catch(...) { if(clo_ent != nullptr) { delete clo_ent; clo_ent = nullptr; } throw; } } else // entry found in the current catalogue { if(pro_dir != nullptr) { const cat_directory *ici_dir = dynamic_cast(ici); if(ici_dir != nullptr) current = const_cast(ici_dir); else ref.skip_read_to_parent_dir(); } if(pro_mir != nullptr) { const cat_mirage *ici_mir = dynamic_cast(ici); if(ici_mir != nullptr && corres_clone.find(pro_mir->get_etiquette()) == corres_clone.end()) { // no correspondance found // so we add a one to the map corres_clone[pro_mir->get_etiquette()] = ici_mir->get_etoile(); } } } } } void catalogue::listing(bool isolated, const mask &selection, const mask &subtree, bool filter_unsaved, bool list_ea, string marge) const { const cat_entree *e = nullptr; thread_cancellation thr; const string marge_plus = " | "; const U_I marge_plus_length = marge_plus.size(); defile juillet = FAKE_ROOT; const cat_eod tmp_eod; get_ui().printf(gettext("Access mode | User | Group | Size | Date | [Data ][ EA ][FSA][Compr][S]| Filename\n")); get_ui().printf("---------------+------+-------+-------+-------------------------------+------------------------------+-----------\n"); if(filter_unsaved) contenu->recursive_has_changed_update(); reset_read(); while(read(e)) { const cat_eod *e_eod = dynamic_cast(e); const cat_directory *e_dir = dynamic_cast(e); const cat_detruit *e_det = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_mirage *e_hard = dynamic_cast(e); const cat_nomme *e_nom = dynamic_cast(e); thr.check_self_cancellation(); juillet.enfile(e); if(e_eod != nullptr) { // descendre la marge U_I length = marge.size(); if(length >= marge_plus_length) marge.erase(length - marge_plus_length, marge_plus_length); else throw SRC_BUG; get_ui().printf("%S +---\n", &marge); } else if(e_nom == nullptr) throw SRC_BUG; // not an cat_eod nor a cat_nomme, what's that? else if(subtree.is_covered(juillet.get_path()) && (e_dir != nullptr || selection.is_covered(e_nom->get_name()))) { if(e_det != nullptr) { string tmp = e_nom->get_name(); string tmp_date = !e_det->get_date().is_null() ? tools_display_date(e_det->get_date()) : "Unknown date"; saved_status poub; char type; if(!extract_base_and_status(e_det->get_signature(), (unsigned char &)type, poub)) type = '?'; if(type == 'f') type = '-'; get_ui().printf(gettext("%S [%c] [ REMOVED ENTRY ] (%S) %S\n"), &marge, type, &tmp_date, &tmp); } else { if(e_hard != nullptr) e_ino = e_hard->get_inode(); if(e_ino == nullptr) throw SRC_BUG; else if(!filter_unsaved || e_ino->get_saved_status() != s_not_saved || (e_ino->ea_get_saved_status() == cat_inode::ea_full || e_ino->ea_get_saved_status() == cat_inode::ea_fake) || (e_dir != nullptr && e_dir->get_recursive_has_changed())) { bool dirty_seq = local_check_dirty_seq(get_escape_layer()); string a = local_perm(*e_ino, e_hard != nullptr); string b = local_uid(*e_ino); string c = local_gid(*e_ino); string d = local_size(*e_ino); string e = local_date(*e_ino); string f = local_flag(*e_ino, isolated, dirty_seq); string g = e_nom->get_name(); if(list_ea && e_hard != nullptr) { infinint tiq = e_hard->get_etiquette(); g += tools_printf(" [%i] ", &tiq); } get_ui().printf("%S%S\t%S\t%S\t%S\t%S\t%S %S\n", &marge, &a, &b, &c, &d, &e, &f, &g); if(list_ea) local_display_ea(get_ui(), e_ino, marge + gettext(" Extended Attribute: ["), "]"); if(e_dir != nullptr) marge += marge_plus; } else // not saved, filtered out { if(e_dir != nullptr) { skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } } } } else // filtered out if(e_dir != nullptr) { skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } // else what was skipped is not a directory, nothing to do. } } void catalogue::tar_listing(bool isolated, const mask &selection, const mask &subtree, bool filter_unsaved, bool list_ea, string beginning) const { const cat_entree *e = nullptr; thread_cancellation thr; defile juillet = FAKE_ROOT; const cat_eod tmp_eod; if(!get_ui().get_use_listing()) { get_ui().printf(gettext("[Data ][ EA ][FSA][Compr][S]| Permission | User | Group | Size | Date | filename\n")); get_ui().printf("-----------------------------+------------+-------+-------+-------+-------------------------------+------------\n"); } if(filter_unsaved) contenu->recursive_has_changed_update(); reset_read(); while(read(e)) { string sep = beginning == "" ? "" : "/"; const cat_eod *e_eod = dynamic_cast(e); const cat_directory *e_dir = dynamic_cast(e); const cat_detruit *e_det = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_mirage *e_hard = dynamic_cast(e); const cat_nomme *e_nom = dynamic_cast(e); thr.check_self_cancellation(); juillet.enfile(e); if(e_eod != nullptr) { string tmp; // removing the last directory of the path contained in beginning path p = beginning; if(p.pop(tmp)) beginning = p.display(); else if(p.degre() == 1) beginning = ""; else throw SRC_BUG; } else if(e_nom == nullptr) throw SRC_BUG; else { if(subtree.is_covered(juillet.get_path()) && (e_dir != nullptr || selection.is_covered(e_nom->get_name()))) { if(e_det != nullptr) { string tmp = e_nom->get_name(); string tmp_date = ! e_det->get_date().is_null() ? tools_display_date(e_det->get_date()) : "Unknown date"; if(get_ui().get_use_listing()) get_ui().listing(REMOVE_TAG, "xxxxxxxxxx", "", "", "", tmp_date, beginning+sep+tmp, false, false); else { saved_status poub; char type; if(!extract_base_and_status(e_det->get_signature(), (unsigned char &)type, poub)) type = '?'; if(type == 'f') type = '-'; get_ui().printf("%s (%S) [%c] %S%S%S\n", REMOVE_TAG, &tmp_date, type, &beginning, &sep, &tmp); } } else { if(e_hard != nullptr) e_ino = e_hard->get_inode(); if(e_ino == nullptr) throw SRC_BUG; else { string nom = e_nom->get_name(); if(!filter_unsaved || e_ino->get_saved_status() != s_not_saved || (e_ino->ea_get_saved_status() == cat_inode::ea_full || e_ino->ea_get_saved_status() == cat_inode::ea_fake) || (e_dir != nullptr && e_dir->get_recursive_has_changed())) { bool dirty_seq = local_check_dirty_seq(get_escape_layer()); string a = local_perm(*e_ino, e_hard != nullptr); string b = local_uid(*e_ino); string c = local_gid(*e_ino); string d = local_size(*e_ino); string e = local_date(*e_ino); string f = local_flag(*e_ino, isolated, dirty_seq); if(list_ea && e_hard != nullptr) { infinint tiq = e_hard->get_etiquette(); nom += tools_printf(" [%i] ", &tiq); } if(get_ui().get_use_listing()) get_ui().listing(f, a, b, c, d, e, beginning+sep+nom, e_dir != nullptr, e_dir != nullptr && e_dir->has_children()); else get_ui().printf("%S %S %S\t%S\t%S\t%S\t%S%S%S\n", &f, &a, &b, &c, &d, &e, &beginning, &sep, &nom); if(list_ea) local_display_ea(get_ui(), e_ino, gettext(" Extended Attribute: ["), "]"); if(e_dir != nullptr) beginning += sep + nom; } else // not saved, filtered out { if(e_dir != nullptr) { juillet.enfile(&tmp_eod); skip_read_to_parent_dir(); } } } } } else // excluded, filtered out if(e_dir != nullptr) { juillet.enfile(&tmp_eod); skip_read_to_parent_dir(); } // else what was skipped is not a directory, nothing to do. } } } void catalogue::xml_listing(bool isolated, const mask &selection, const mask &subtree, bool filter_unsaved, bool list_ea, string beginning) const { const cat_entree *e = nullptr; thread_cancellation thr; defile juillet = FAKE_ROOT; get_ui().warning(""); get_ui().warning("\n"); get_ui().warning(""); if(filter_unsaved) contenu->recursive_has_changed_update(); reset_read(); while(read(e)) { const cat_eod *e_eod = dynamic_cast(e); const cat_directory *e_dir = dynamic_cast(e); const cat_detruit *e_det = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_mirage *e_hard = dynamic_cast(e); const cat_lien *e_sym = dynamic_cast(e); const cat_device *e_dev = dynamic_cast(e); const cat_nomme *e_nom = dynamic_cast(e); const cat_eod tmp_eod; thr.check_self_cancellation(); juillet.enfile(e); if(e_eod != nullptr) { U_I length = beginning.size(); if(length > 0) beginning.erase(length - 1, 1); // removing the last tab character else throw SRC_BUG; get_ui().printf("%S\n", &beginning); } else if(e_nom == nullptr) throw SRC_BUG; else { if(subtree.is_covered(juillet.get_path()) && (e_dir != nullptr || selection.is_covered(e_nom->get_name()))) { string name = tools_output2xml(e_nom->get_name()); if(e_det != nullptr) { unsigned char sig; saved_status state; string data = "deleted"; string metadata = "absent"; unmk_signature(e_det->get_signature(), sig, state, isolated); switch(sig) { case 'd': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata); get_ui().printf("%S\n", &beginning); break; case 'f': case 'h': case 'e': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata); get_ui().printf("%S\n", &beginning); break; case 'l': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata); get_ui().printf("%S\n", &beginning); break; case 'c': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata); get_ui().printf("%S\n", &beginning); break; case 'b': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata); get_ui().printf("%S\n", &beginning); break; case 'p': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata); get_ui().printf("%S\n", &beginning); break; case 's': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata); get_ui().printf("%S\n", &beginning); break; default: throw SRC_BUG; } } else // other than cat_detruit object { if(e_hard != nullptr) { e_ino = e_hard->get_inode(); e_sym = dynamic_cast(e_ino); e_dev = dynamic_cast(e_ino); } if(e_ino == nullptr) throw SRC_BUG; // this is a cat_nomme which is neither a cat_detruit nor an cat_inode if(!filter_unsaved || e_ino->get_saved_status() != s_not_saved || (e_ino->ea_get_saved_status() == cat_inode::ea_full || e_ino->ea_get_saved_status() == cat_inode::ea_fake) || (e_dir != nullptr && e_dir->get_recursive_has_changed())) { string data, metadata, maj, min, chksum, target; string dirty, sparse; string size = local_size(*e_ino); string stored = local_storage_size(*e_ino); const cat_file *reg = dynamic_cast(e_ino); // ino is no more it->second (if it->second was a cat_mirage) const crc *crc_tmp = nullptr; saved_status data_st; cat_inode::ea_status ea_st = isolated ? cat_inode::ea_fake : e_ino->ea_get_saved_status(); unsigned char sig; unmk_signature(e_ino->signature(), sig, data_st, isolated); data_st = isolated ? s_fake : e_ino->get_saved_status(); // the trusted source for cat_inode status is get_saved_status, not the signature (may change in future, who knows) if(stored == "0" && (reg == nullptr || !reg->get_sparse_file_detection_read())) stored = size; // defining "data" string switch(data_st) { case s_saved: data = "saved"; break; case s_fake: case s_not_saved: data = "referenced"; break; default: throw SRC_BUG; } // defining "metadata" string switch(ea_st) { case cat_inode::ea_full: metadata = "saved"; break; case cat_inode::ea_partial: case cat_inode::ea_fake: metadata = "referenced"; break; case cat_inode::ea_none: case cat_inode::ea_removed: metadata = "absent"; break; default: throw SRC_BUG; } // building entry for each type of cat_inode switch(sig) { case 'd': // directories get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata, e, list_ea); beginning += "\t"; break; case 'h': // hard linked files case 'e': // hard linked files throw SRC_BUG; // no more used in dynamic data case 'f': // plain files if(data_st == s_saved) { const cat_file * f_ino = dynamic_cast(e_ino); if(f_ino == nullptr) throw SRC_BUG; dirty = yes_no(f_ino->is_dirty()); sparse= yes_no(f_ino->get_sparse_file_detection_read()); } else { stored = ""; dirty = ""; sparse = ""; } if(reg == nullptr) throw SRC_BUG; // f is signature for plain files if(reg->get_crc(crc_tmp) && crc_tmp != nullptr) chksum = crc_tmp->crc2str(); else chksum = ""; get_ui().printf("%S\n", &beginning, &name, &size, &stored, &chksum, &dirty, &sparse); xml_listing_attributes(get_ui(), beginning, data, metadata, e, list_ea); get_ui().printf("%S\n", &beginning); break; case 'l': // soft link if(data_st == s_saved) target = tools_output2xml(e_sym->get_target()); else target = ""; get_ui().printf("%S\n", &beginning, &name, &target); xml_listing_attributes(get_ui(), beginning, data, metadata, e, list_ea); get_ui().printf("%S\n", &beginning); break; case 'c': case 'b': // this is maybe less performant, to have both 'c' and 'b' here and // make an additional test, but this has the advantage to not duplicate // very similar code, which would obviously evoluate the same way. // Experience shows that two identical codes even when driven by the same need // are an important source of bugs, as one may forget to update both of them, the // same way... if(sig == 'c') target = "character"; else target = "block"; // we re-used target variable which is not used for the current cat_inode if(data_st == s_saved) { maj = tools_uword2str(e_dev->get_major()); min = tools_uword2str(e_dev->get_minor()); } else maj = min = ""; get_ui().printf("%S\n", &beginning, &name, &target, &maj, &min); xml_listing_attributes(get_ui(), beginning, data, metadata, e, list_ea); get_ui().printf("%S\n", &beginning); break; case 'p': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata, e, list_ea); get_ui().printf("%S\n", &beginning); break; case 's': get_ui().printf("%S\n", &beginning, &name); xml_listing_attributes(get_ui(), beginning, data, metadata, e, list_ea); get_ui().printf("%S\n", &beginning); break; default: throw SRC_BUG; } } else // not saved, filtered out { if(e_dir != nullptr) { skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } } } } // end of filter check else // filtered out if(e_dir != nullptr) { skip_read_to_parent_dir(); juillet.enfile(&tmp_eod); } // else what was skipped is not a directory, nothing to do. } } get_ui().warning(""); } void catalogue::slice_listing(bool isolated, const mask & selection, const mask & subtree, const slice_layout & slicing) const { const cat_entree *e = nullptr; thread_cancellation thr; defile juillet = FAKE_ROOT; const cat_eod tmp_eod; range all_slices; range file_slices; get_ui().warning("Slice(s)|[Data ][ EA ][FSA][Compr][S]|Permission| Filemane"); get_ui().warning("--------+-----------------------------+----------+-----------------------------"); reset_read(); while(read(e)) { const cat_eod *e_eod = dynamic_cast(e); const cat_directory *e_dir = dynamic_cast(e); const cat_inode *e_ino = dynamic_cast(e); const cat_mirage *e_hard = dynamic_cast(e); const cat_nomme *e_nom = dynamic_cast(e); const cat_detruit *e_det = dynamic_cast(e); thr.check_self_cancellation(); juillet.enfile(e); if(e_eod != nullptr) continue; if(e_nom == nullptr) throw SRC_BUG; else { if(subtree.is_covered(juillet.get_path()) && (e_dir != nullptr || selection.is_covered(e_nom->get_name()))) { file_slices = macro_tools_get_slices(e_nom, slicing); all_slices += file_slices; if(e_det != nullptr) get_ui().printf("%s\t %s%s\n", file_slices.display().c_str(), REMOVE_TAG, juillet.get_string().c_str()); else { if(e_hard != nullptr) e_ino = e_hard->get_inode(); if(e_ino == nullptr) throw SRC_BUG; else { bool dirty_seq = local_check_dirty_seq(get_escape_layer()); string a = local_perm(*e_ino, e_hard != nullptr); string f = local_flag(*e_ino, isolated, dirty_seq); get_ui().printf("%s\t %S%S %s\n", file_slices.display().c_str(), &f, &a, juillet.get_string().c_str()); } } } else // excluded, filtered out if(e_dir != nullptr) { juillet.enfile(&tmp_eod); skip_read_to_parent_dir(); } // else what was skipped is not a directory, nothing to do. } } get_ui().warning("-----"); get_ui().printf("All displayed files have their data in slice range [%s]\n", all_slices.display().c_str()); get_ui().warning("-----"); } void catalogue::drop_all_non_detruits() { cat_directory *ptr = contenu; const cat_nomme *e = nullptr; const cat_directory *e_dir = nullptr; const cat_detruit *e_det = nullptr; ptr->reset_read_children(); while(ptr != nullptr) { if(ptr->read_children(e)) { e_dir = dynamic_cast(e); e_det = dynamic_cast(e); if(e_dir != nullptr) { ptr = const_cast(e_dir); ptr->reset_read_children(); } else if(e_det == nullptr) ptr->remove(e->get_name()); } else // finished reading the current directory { cat_directory *parent = ptr->get_parent(); if(parent != nullptr && !ptr->has_children()) { parent->remove(ptr->get_name()); ptr = parent; } else ptr = parent; } } } bool catalogue::is_subset_of(const catalogue & ref) const { bool ret = true; const cat_entree *moi = nullptr; const cat_entree *toi = nullptr; reset_read(); ref.reset_compare(); try { while(ret && !read(moi)) { if(moi == nullptr) throw SRC_BUG; if(!ref.compare(moi, toi)) ret = false; else { if(toi == nullptr) throw SRC_BUG; if(*toi != *moi) ret = false; } } } catch(Edata & e) { ret = false; // no rethrow } catch(Erange & e) { ret = false; // no rethrow } return ret; } void catalogue::reset_dump() const { cat_directory * d = const_cast(contenu); if(d == nullptr) throw SRC_BUG; d->set_all_mirage_s_inode_dumped_field_to(false); } void catalogue::dump(const pile_descriptor & pdesc) const { crc *tmp = nullptr; pdesc.check(false); if(pdesc.compr->is_compression_suspended()) { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->resume_compression(); } else { pdesc.stack->sync_write_above(pdesc.compr); pdesc.compr->sync_write(); // required to reset the compression engine and be able to uncompress from that position later on } try { pdesc.stack->reset_crc(CAT_CRC_SIZE); try { ref_data_name.dump(*pdesc.stack); contenu->dump(pdesc, false); } catch(...) { tmp = pdesc.stack->get_crc(); throw; } tmp = pdesc.stack->get_crc(); if(tmp == nullptr) throw SRC_BUG; tmp->dump(*pdesc.stack); } catch(...) { if(tmp != nullptr) delete tmp; throw; } if(tmp != nullptr) delete tmp; } void catalogue::reset_all() { out_compare = "/"; current_compare = contenu; current_add = contenu; current_read = contenu; if(sub_tree != nullptr) { delete sub_tree; sub_tree = nullptr; } } void catalogue::copy_detruits_from(const catalogue & ref) { const cat_entree *ent; ref.reset_read(); reset_add(); while(ref.read(ent)) { const cat_detruit *ent_det = dynamic_cast(ent); const cat_directory *ent_dir = dynamic_cast(ent); const cat_eod *ent_eod = dynamic_cast(ent); if(ent_dir != nullptr) re_add_in(ent_dir->get_name()); if(ent_eod != nullptr) { cat_eod *tmp = new (get_pool()) cat_eod(); if(tmp == nullptr) throw Ememory("catalogue::copy_detruits_from"); try { add(tmp); } catch(...) { delete tmp; throw; } } if(ent_det != nullptr) { cat_detruit *cp = new (get_pool()) cat_detruit(*ent_det); if(cp == nullptr) throw Ememory("catalogue::copy_detruits_from"); try { add(cp); } catch(...) { delete cp; throw; } } } } void catalogue::swap_stuff(catalogue & ref) { // swapping contenu cat_directory *tmp = contenu; contenu = ref.contenu; ref.contenu = tmp; tmp = nullptr; // swapping stats entree_stats tmp_st = stats; stats = ref.stats; ref.stats = tmp_st; // swapping label label tmp_lab; tmp_lab = ref_data_name; ref_data_name = ref.ref_data_name; ref.ref_data_name = tmp_lab; // avoid pointers to point to the now other's object tree reset_all(); ref.reset_all(); } void catalogue::partial_copy_from(const catalogue & ref) { contenu = nullptr; sub_tree = nullptr; try { if(ref.contenu == nullptr) throw SRC_BUG; contenu = new (get_pool()) cat_directory(*ref.contenu); if(contenu == nullptr) throw Ememory("catalogue::catalogue(const catalogue &)"); current_compare = contenu; current_add = contenu; current_read = contenu; if(ref.sub_tree != nullptr) { sub_tree = new (get_pool()) path(*ref.sub_tree); if(sub_tree == nullptr) throw Ememory("catalogue::partial_copy_from"); } else sub_tree = nullptr; sub_count = ref.sub_count; stats = ref.stats; } catch(...) { if(contenu != nullptr) { delete contenu; contenu = nullptr; } if(sub_tree != nullptr) { delete sub_tree; sub_tree = nullptr; } throw; } } void catalogue::detruire() { if(contenu != nullptr) { delete contenu; contenu = nullptr; } if(sub_tree != nullptr) { delete sub_tree; sub_tree = nullptr; } } const cat_eod catalogue::r_eod; const U_I catalogue::CAT_CRC_SIZE = 4; static bool local_check_dirty_seq(escape *ptr) { bool ret; if(ptr != nullptr) { bool already_set = ptr->is_unjumpable_mark(escape::seqt_file); if(!already_set) ptr->add_unjumpable_mark(escape::seqt_file); ret = ptr != nullptr && ptr->skip_to_next_mark(escape::seqt_dirty, true); if(!already_set) ptr->remove_unjumpable_mark(escape::seqt_file); } else ret = false; return ret; } } // end of namespace dar-2.5.3/src/libdar/datetime.cpp0000644000175000017430000002041312641772777013562 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "datetime.hpp" using namespace std; namespace libdar { static const infinint one_unit = 1; static const infinint one_thousand = 1000; static const infinint one_million = one_thousand*one_thousand; static const infinint one_billion = one_million*one_thousand; bool datetime::operator < (const datetime & ref) const { if(sec < ref.sec) return true; if(sec > ref.sec) return false; // sec == ref.sec if(uni == ref.uni) return frac < ref.frac; else { // using the unit having the less precision to perform the comparison time_unit c = max(uni, ref.uni); return get_subsecond_value(c) < ref.get_subsecond_value(c); } } bool datetime::operator == (const datetime & ref) const { if(sec != ref.sec) return false; else { // using the unit having the less precision to perform the comparison time_unit c = max(uni, ref.uni); return get_subsecond_value(c) == ref.get_subsecond_value(c); } } datetime datetime::operator - (const datetime & ref) const { datetime val = *this; if(*this < ref) throw SRC_BUG; // negative date would result of the operation val.sec -= ref.sec; // using the most precised unit to avoid loosing accuracy val.uni = min(uni, ref.uni); infinint me_frac = get_subsecond_value(val.uni); infinint ref_frac = ref.get_subsecond_value(val.uni); if(me_frac >= ref_frac) val.frac = me_frac - ref_frac; else { --val.sec; // removing 1 second val.frac = me_frac + how_much_to_make_1_second(val.uni); val.frac -= ref_frac; } return val; } datetime datetime::operator + (const datetime & ref) const { datetime val = *this; val.sec += ref.sec; // using the most precised unit to avoid loosing accuracy val.uni = min(uni, ref.uni); infinint me_frac = get_subsecond_value(val.uni); infinint ref_frac = ref.get_subsecond_value(val.uni); val.frac = me_frac + ref_frac; if(val.frac >= how_much_to_make_1_second(val.uni)) { ++val.sec; val.frac -= how_much_to_make_1_second(val.uni); } return val; } datetime datetime::loose_diff(const datetime & ref) const { datetime val = *this; time_unit max_capa = tu_second; if(*this < ref) throw SRC_BUG; // negative date would result of the operation val.sec -= ref.sec; // using the less precised unit to avoid loosing accuracy val.uni = max(uni, ref.uni); #if LIBDAR_MICROSECOND_READ_ACCURACY && LIBDAR_MICROSECOND_WRITE_ACCURACY max_capa = tu_microsecond; #endif if(val.uni < max_capa) val.uni = max_capa; infinint me_frac = get_subsecond_value(val.uni); infinint ref_frac = ref.get_subsecond_value(val.uni); if(me_frac >= ref_frac) val.frac = me_frac - ref_frac; else { --val.sec; // removing 1 second val.frac = me_frac + how_much_to_make_1_second(val.uni); val.frac -= ref_frac; } return val; } bool datetime::is_subsecond_an_integer_value_of(time_unit target, infinint & newval) const { if(target <= uni) { newval = frac * get_scaling_factor(uni, target); return true; } else { const infinint & f = get_scaling_factor(target, uni); // target = f*uni infinint r; euclide(frac, f, newval, r); // frac = f*newval + r return r.is_zero(); } } void datetime::reduce_to_largest_unit() const { infinint newval; datetime *me = const_cast(this); if(me == nullptr) throw SRC_BUG; switch(uni) { case tu_nanosecond: if(!is_subsecond_an_integer_value_of(tu_microsecond, newval)) break; // cannot reduce the unit further else { me->frac = newval; me->uni = tu_microsecond; } /* no break ! */ case tu_microsecond: if(!is_subsecond_an_integer_value_of(tu_second, newval)) break; // cannot reduce the unit further else { me->frac = newval; me->uni = tu_second; } /* no break ! */ case tu_second: // cannot reduce further as // this is the largest known time unit // so we break here break; default: throw SRC_BUG; } } infinint datetime::get_subsecond_value(time_unit unit) const { infinint ret; (void) is_subsecond_an_integer_value_of(unit, ret); return ret; } bool datetime::get_value(time_t & second, time_t & subsecond, time_unit unit) const { infinint tmp; second = 0; tmp = sec; tmp.unstack(second); if(!tmp.is_zero()) return false; if(unit < tu_second && uni < tu_second && !frac.is_zero()) { (void) is_subsecond_an_integer_value_of(unit, tmp); subsecond = 0; tmp.unstack(subsecond); return tmp.is_zero(); } else { subsecond = 0; return true; } } void datetime::dump(generic_file &x) const { char tmp; // reduce_to_largest_unit(); tmp = time_unit_to_char(uni); x.write(&tmp, 1); sec.dump(x); if(uni < tu_second) frac.dump(x); } void datetime::read(generic_file &f, archive_version ver) { if(ver < 9) uni = tu_second; else { char tmp; f.read(&tmp, 1); uni = char_to_time_unit(tmp); } sec.read(f); if(uni < tu_second) frac.read(f); else frac = 0; } datetime::time_unit datetime::min(time_unit a, time_unit b) { if(a < b) return a; else return b; } datetime::time_unit datetime::max(time_unit a, time_unit b) { if(a < b) return b; else return a; } const char datetime::time_unit_to_char(time_unit a) { switch(a) { case tu_nanosecond: return 'n'; case tu_microsecond: return 'u'; case tu_second: return 's'; default: throw SRC_BUG; } } datetime::time_unit datetime::char_to_time_unit(const char a) { switch(a) { case 'n': return tu_nanosecond; case 's': return tu_second; case 'u': return tu_microsecond; default: throw Erange("datetime::time_unit", gettext("Unknown time unit")); } } const infinint & datetime::get_scaling_factor(time_unit source, time_unit dest) { if(dest > source) throw SRC_BUG; switch(source) { case tu_second: if(dest == tu_second) return one_unit; else if(dest == tu_microsecond) return one_million; else if(dest == tu_nanosecond) return one_billion; else throw SRC_BUG; // unknown dest unit! case tu_microsecond: if(dest == tu_microsecond) return one_unit; else if(dest == tu_nanosecond) return one_thousand; else throw SRC_BUG; // unknown dest unit! case tu_nanosecond: if(dest == tu_nanosecond) return one_unit; else throw SRC_BUG; // unknown dest unit! default: throw SRC_BUG; } } infinint datetime::how_much_to_make_1_second(time_unit unit) { switch(unit) { case tu_nanosecond: return one_billion; case tu_microsecond: return one_million; case tu_second: return 1; default: throw SRC_BUG; } } archive_version db2archive_version(unsigned char db_version) { // the class datetime read() method is based on dar archive version. // here we know the database version (dar_manager). Starting with version 4 (release 2.5.0) // time is no more stored as an integer. This correspond to dar archive version 9 // and above (release 2.5.0 too), wherefrom this hack below: return db_version > 3 ? archive_version(9,0) : archive_version(8,0); } } // end of namespace dar-2.5.3/src/libdar/libdar.cpp0000644000175000017430000003432212641772777013227 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_UNISTD_H #include #endif #if LIBLZO2_AVAILABLE #if HAVE_LZO_LZO1X_H #include #endif #endif #if HAVE_STDLIB_H #include #endif #if HAVE_GCRYPT_H #ifndef GCRYPT_NO_DEPRECATED #define GCRYPT_NO_DEPRECATED #endif #include #endif #if HAVE_TIME_H #include #endif #if HAVE_GPGME_H #include #endif } // end extern "C" #include #include #include "libdar.hpp" #include "erreurs.hpp" #include "infinint.hpp" #include "generic_file.hpp" #include "user_interaction.hpp" #include "archive.hpp" #include "nls_swap.hpp" #ifdef __DYNAMIC__ #include "user_group_bases.hpp" #endif #include using namespace std; #define WRAPPER_IN try { // #define WRAPPER_OUT(code,msg) \ code = LIBDAR_NOEXCEPT; \ } \ catch(Ememory & e) \ { \ code = LIBDAR_EMEMORY; \ msg = e.get_message(); \ } \ catch(Ebug & e) \ { \ code = LIBDAR_EBUG; \ msg = e.get_message(); \ } \ catch(Einfinint & e) \ { \ code = LIBDAR_EINFININT; \ msg = e.get_message(); \ } \ catch(Elimitint & e) \ { \ code = LIBDAR_ELIMITINT; \ msg = e.get_message(); \ } \ catch(Erange & e) \ { \ code = LIBDAR_ERANGE; \ msg = e.get_message(); \ } \ catch(Edeci & e) \ { \ code = LIBDAR_EDECI; \ msg = e.get_message(); \ } \ catch(Efeature & e) \ { \ code = LIBDAR_EFEATURE; \ msg = e.get_message(); \ } \ catch(Ehardware & e) \ { \ code = LIBDAR_EHARDWARE; \ msg = e.get_message(); \ } \ catch(Euser_abort & e) \ { \ code = LIBDAR_EUSER_ABORT; \ msg = e.get_message(); \ } \ catch(Edata & e) \ { \ code = LIBDAR_EDATA; \ msg = e.get_message(); \ } \ catch(Escript & e) \ { \ code = LIBDAR_ESCRIPT; \ msg = e.get_message(); \ } \ catch(Elibcall & e) \ { \ code = LIBDAR_ELIBCALL; \ msg = e.get_message(); \ } \ catch(Ecompilation & e) \ { \ code = LIBDAR_ECOMPILATION; \ msg = e.get_message(); \ } \ catch(Ethread_cancel & e) \ { \ code = LIBDAR_THREAD_CANCEL; \ msg = e.get_message(); \ } \ catch(Egeneric & e) \ {/*unknown Egeneric exception*/ \ code = LIBDAR_EBUG; \ msg = string(gettext("Caught an unknown Egeneric exception: ")) + e.get_message(); \ } \ catch(...) \ {/* unknown Egeneric exception*/ \ code = LIBDAR_UNKNOWN; \ msg = gettext("Caught a none libdar exception"); \ } // namespace libdar { static void libdar_init(bool init_libgcrypt_if_not_done); // drives the "libdar_initialized" variable static bool libdar_initialized = false; //< static variable modified once during the first get_version call #ifdef CRYPTO_AVAILABLE static bool libdar_initialized_gcrypt = false; //< to record whether libdar did initialized libgcrypt #endif void get_version(U_I & major, U_I & minor, bool init_libgcrypt) { NLS_SWAP_IN; major = LIBDAR_COMPILE_TIME_MAJOR; minor = LIBDAR_COMPILE_TIME_MINOR; libdar_init(init_libgcrypt); NLS_SWAP_OUT; } void get_version_noexcept(U_I & major, U_I & minor, U_16 & exception, string & except_msg, bool init_libgcrypt) { NLS_SWAP_IN; WRAPPER_IN get_version(major, minor, init_libgcrypt); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; } void get_version(U_I & major, U_I & medium, U_I & minor, bool init_libgcrypt) { NLS_SWAP_IN; major = LIBDAR_COMPILE_TIME_MAJOR; medium = LIBDAR_COMPILE_TIME_MEDIUM; minor = LIBDAR_COMPILE_TIME_MINOR; libdar_init(init_libgcrypt); NLS_SWAP_OUT; } void get_version_noexcept(U_I & major, U_I & medium, U_I & minor, U_16 & exception, std::string & except_msg, bool init_libgcrypt) { NLS_SWAP_IN; WRAPPER_IN get_version(major, medium, minor, init_libgcrypt); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; } archive* open_archive_noexcept(user_interaction & dialog, const path & chem, const std::string & basename, const std::string & extension, const archive_options_read & options, U_16 & exception, std::string & except_msg) { archive *ret = nullptr; NLS_SWAP_IN; WRAPPER_IN ret = new (nothrow) archive(dialog, chem, basename, extension, options); if(ret == nullptr) throw Ememory("open_archive_noexcept"); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return ret; } archive *create_archive_noexcept(user_interaction & dialog, const path & fs_root, const path & sauv_path, const std::string & filename, const std::string & extension, const archive_options_create & options, statistics * progressive_report, U_16 & exception, std::string & except_msg) { archive *arch_ret = nullptr; NLS_SWAP_IN; WRAPPER_IN arch_ret = new (nothrow) archive(dialog, fs_root, sauv_path, filename, extension, options, progressive_report); if(arch_ret == nullptr) throw Ememory("open_archive_noexcept"); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return arch_ret; } void op_isolate_noexcept(user_interaction & dialog, archive *ptr, const path &sauv_path, const std::string & filename, const std::string & extension, const archive_options_isolate & options, U_16 & exception, std::string & except_msg) { NLS_SWAP_IN; WRAPPER_IN if(ptr == nullptr) throw Elibcall("op_isolate_noexcept", gettext("Invald nullptr argument given to 'ptr'")); ptr->op_isolate(dialog, sauv_path, filename, extension, options); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; } archive *merge_archive_noexcept(user_interaction & dialog, const path & sauv_path, archive *ref_arch1, const std::string & filename, const std::string & extension, const archive_options_merge & options, statistics * progressive_report, U_16 & exception, std::string & except_msg) { archive *ret = nullptr; NLS_SWAP_IN; WRAPPER_IN ret = new (nothrow) archive(dialog, sauv_path, ref_arch1, filename, extension, options, progressive_report); if(ret == nullptr) throw Ememory("open_archive_noexcept"); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return ret; } void close_archive_noexcept(archive *ptr, U_16 & exception, std::string & except_msg) { NLS_SWAP_IN; WRAPPER_IN if(ptr == nullptr) throw Elibcall("close_archive_noexcept", gettext("Invalid nullptr pointer given to close_archive")); else { delete ptr; ptr = nullptr; } WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; } char *libdar_str2charptr_noexcept(const std::string & x, U_16 & exception, std::string & except_msg) { char *ret = nullptr; NLS_SWAP_IN; WRAPPER_IN ret = tools_str2charptr(x); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return ret; } static void libdar_init(bool init_libgcrypt_if_not_done) { if(!libdar_initialized) { // locale for gettext if(string(DAR_LOCALEDIR) != string("")) if(bindtextdomain(PACKAGE, DAR_LOCALEDIR) == nullptr) throw Erange("", "Cannot open the translated messages directory, native language support will not work"); // pseudo random generator srand(::time(nullptr)+getpid()+getppid()); // initializing LIBLZO2 #if HAVE_LIBLZO2 if(lzo_init() != LZO_E_OK) throw Erange("libdar_init_thread_safe", gettext("Initialization problem for liblzo2 library")); #endif // initializing libgcrypt #ifdef CRYPTO_AVAILABLE if(!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P)) { if(init_libgcrypt_if_not_done) { gcry_error_t err; // no multi-thread support activated for gcrypt // this must be done from the application as stated // by the libgcrypt documentation if(!gcry_check_version(MIN_VERSION_GCRYPT)) throw Erange("libdar_init_libgcrypt", tools_printf(gettext("Too old version for libgcrypt, minimum required version is %s\n"), MIN_VERSION_GCRYPT)); // initializing default sized secured memory for libgcrypt (void)gcry_control(GCRYCTL_INIT_SECMEM, 65536); // if secured memory could not be allocated, further request of secured memory will fail // and a warning will show at that time (we cannot send a warning (just failure notice) at that time). err = gcry_control(GCRYCTL_ENABLE_M_GUARD); if(err != GPG_ERR_NO_ERROR) throw Erange("libdar_init",tools_printf(gettext("Error while activating libgcrypt's memory guard: %s/%s"), gcry_strsource(err),gcry_strerror(err))); err = gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); if(err != GPG_ERR_NO_ERROR) throw Erange("libdar_init",tools_printf(gettext("Error while telling libgcrypt that initialization is finished: %s/%s"), gcry_strsource(err),gcry_strerror(err))); libdar_initialized_gcrypt = true; } else throw Erange("libdar_init_libgcrypt", gettext("libgcrypt not initialized and libdar not allowed to do so")); } else if(!gcry_check_version(MIN_VERSION_GCRYPT)) throw Erange("libdar_init_libgcrypt", tools_printf(gettext("Too old version for libgcrypt, minimum required version is %s\n"), MIN_VERSION_GCRYPT)); #endif #if GPGME_SUPPORT if(gpgme_check_version(GPGME_MIN_VERSION) == nullptr) { string tmp = "GPGME_SUPPORT"; throw Erange("libdar_init_gpgme", tools_printf(gettext("GPGME version requirement is not satisfied, requires version > %s"), tmp.c_str())); } if(gpgme_err_code(gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP)) != GPG_ERR_NO_ERROR) throw Erange("libdar_init_gpgme", tools_printf(gettext("GPGME engine not available: %s"), gpgme_get_protocol_name(GPGME_PROTOCOL_OpenPGP))); #endif tools_init(); // so now libdar is ready for use! libdar_initialized = true; } } extern void close_and_clean() { #ifdef CRYPTO_AVAILABLE if(libdar_initialized_gcrypt) gcry_control(GCRYCTL_TERM_SECMEM, 0); // by precaution if not already done by libgcrypt itself #endif tools_end(); } statistics op_extract_noexcept(user_interaction & dialog, archive *ptr, const path &fs_root, const archive_options_extract & options, statistics * progressive_report, U_16 & exception, std::string & except_msg) { statistics ret; NLS_SWAP_IN; WRAPPER_IN if(ptr == nullptr) throw Elibcall("op_extract_noexcept", gettext("Invalid nullptr argument given to 'ptr'")); ret = ptr->op_extract(dialog, fs_root, options, progressive_report); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return ret; } void op_listing_noexcept(user_interaction & dialog, archive *ptr, const archive_options_listing & options, U_16 & exception, std::string & except_msg) { NLS_SWAP_IN; WRAPPER_IN if(ptr == nullptr) throw Elibcall("op_extract_noexcept", gettext("Invalid nullptr argument given to 'ptr'")); ptr->op_listing(dialog, options); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; } statistics op_diff_noexcept(user_interaction & dialog, archive *ptr, const path & fs_root, const archive_options_diff & options, statistics * progressive_report, U_16 & exception, std::string & except_msg) { statistics ret; NLS_SWAP_IN; WRAPPER_IN if(ptr == nullptr) throw Elibcall("op_extract_noexcept", gettext("Invalid nullptr argument given to 'ptr'")); ret = ptr->op_diff(dialog, fs_root, options, progressive_report); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return ret; } statistics op_test_noexcept(user_interaction & dialog, archive *ptr, const archive_options_test & options, statistics * progressive_report, U_16 & exception, std::string & except_msg) { statistics ret; NLS_SWAP_IN; WRAPPER_IN if(ptr == nullptr) throw Elibcall("op_extract_noexcept", gettext("Invalid nullptr argument given to 'ptr'")); ret = ptr->op_test(dialog, options, progressive_report); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return ret; } bool get_children_of_noexcept(user_interaction & dialog, archive *ptr, const std::string & dir, U_16 & exception, std::string & except_msg) { bool ret = false; NLS_SWAP_IN; WRAPPER_IN if(ptr == nullptr) throw Elibcall("op_extract_noexcept", gettext("Invalid nullptr argument given to 'ptr'")); ret = ptr->get_children_of(dialog, dir); WRAPPER_OUT(exception, except_msg) NLS_SWAP_OUT; return ret; } } // end of namespace dar-2.5.3/src/libdar/compressor.cpp0000644000175000017430000005510412641772777014167 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SIGNAL_H #include #endif #if HAVE_LIMITS_H #include #endif #if LIBLZO2_AVAILABLE #if HAVE_LZO_LZO1X_H #include #endif #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } // end extern "C" #include "tools.hpp" #include "compressor.hpp" #define BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < BUFFER_SIZE #undef BUFFER_SIZE #define BUFFER_SIZE SSIZE_MAX #endif #endif // value found in lzop source code p_lzo.c #define LZO_COMPRESSED_BUFFER_SIZE 256*1024l #ifdef SSIZE_MAX #if SSIZE_MAX < LZO_COMPRESSED_BUFFER_SIZE #undef LZO_COMPRESSED_BUFFER_SIZE #define LZO_COMPRESSED_BUFFER_SIZE SSIZE_MAX #endif #endif #define LZO_CLEAR_BUFFER_SIZE ((LZO_COMPRESSED_BUFFER_SIZE - 64 - 3)*16/17) // value calculated with information found in LZO's FAQ #if LZO_CLEAR_BUFFER_SIZE < 1 #error "System's SSIZE_MAX too small to handle LZO compression" #endif #define BLOCK_HEADER_LZO 1 #define BLOCK_HEADER_EOF 2 using namespace std; namespace libdar { compressor::compressor(compression algo, generic_file & compressed_side, U_I compression_level) : generic_file(compressed_side.get_mode()) { init(algo, &compressed_side, compression_level); compressed_owner = false; } compressor::compressor(compression algo, generic_file *compressed_side, U_I compression_level) : generic_file(compressed_side->get_mode()) { init(algo, compressed_side, compression_level); compressed_owner = true; } void compressor::init(compression algo, generic_file *compressed_side, U_I compression_level) { // these are eventually overwritten below wrapperlib_mode wr_mode = zlib_mode; current_algo = algo; suspended = false; current_level = compression_level; if(compressed_side == nullptr) throw SRC_BUG; if(compression_level > 9) throw SRC_BUG; compr = decompr = nullptr; lzo_read_buffer = lzo_write_buffer = nullptr; lzo_compressed = nullptr; lzo_wrkmem = nullptr; switch(algo) { case none: read_ptr = &compressor::none_read; write_ptr = &compressor::none_write; break; case bzip2: case xz: if(algo == bzip2) wr_mode = bzlib_mode; if(algo == xz) wr_mode = xz_mode; // NO BREAK ! case gzip: read_ptr = &compressor::gzip_read; write_ptr = &compressor::gzip_write; compr = new (get_pool()) xfer(BUFFER_SIZE, wr_mode); if(compr == nullptr) throw Ememory("compressor::compressor"); decompr = new (get_pool()) xfer(BUFFER_SIZE, wr_mode); if(decompr == nullptr) { delete compr; compr = nullptr; throw Ememory("compressor::compressor"); } switch(compr->wrap.compressInit(compression_level)) { case WR_OK: break; case WR_MEM_ERROR: delete compr; compr = nullptr; delete decompr; decompr = nullptr; throw Ememory("compressor::compressor"); case WR_VERSION_ERROR: delete compr; compr = nullptr; delete decompr; decompr = nullptr; throw Erange("compressor::compressor", gettext("incompatible compression library version or unsupported feature required from compression library")); case WR_STREAM_ERROR: default: delete compr; compr = nullptr; delete decompr; decompr = nullptr; throw SRC_BUG; } switch(decompr->wrap.decompressInit()) { case WR_OK: decompr->wrap.set_avail_in(0); break; case WR_MEM_ERROR: compr->wrap.compressEnd(); delete compr; compr = nullptr; delete decompr; decompr = nullptr; throw Ememory("compressor::compressor"); case WR_VERSION_ERROR: compr->wrap.compressEnd(); delete compr; compr = nullptr; delete decompr; decompr = nullptr; throw Erange("compressor::compressor", gettext("incompatible compression library version or unsupported feature required from compression library")); case WR_STREAM_ERROR: default: compr->wrap.compressEnd(); delete compr; compr = nullptr; delete decompr; decompr = nullptr; throw SRC_BUG; } break; case lzo: #if LIBLZO2_AVAILABLE read_ptr = &compressor::lzo_read; write_ptr = &compressor::lzo_write; lzo_read_size = lzo_write_size = 0; lzo_read_start = 0; lzo_write_flushed = true; lzo_read_reached_eof = false; try { meta_new(lzo_read_buffer, LZO_CLEAR_BUFFER_SIZE); meta_new(lzo_write_buffer, LZO_CLEAR_BUFFER_SIZE); meta_new(lzo_compressed, LZO_COMPRESSED_BUFFER_SIZE); meta_new(lzo_wrkmem, LZO1X_999_MEM_COMPRESS); if(lzo_read_buffer == nullptr || lzo_write_buffer == nullptr || lzo_compressed == nullptr || lzo_wrkmem == nullptr) throw Ememory("compressor::init"); } catch(...) { if(lzo_read_buffer != nullptr) { meta_delete(lzo_read_buffer); lzo_read_buffer = nullptr; } if(lzo_write_buffer != nullptr) { meta_delete(lzo_write_buffer); lzo_write_buffer = nullptr; } if(lzo_compressed != nullptr) { meta_delete(lzo_compressed); lzo_compressed = nullptr; } if(lzo_wrkmem != nullptr) { meta_delete(lzo_wrkmem); lzo_wrkmem = nullptr; } throw; } break; #else throw Ecompilation("lzo compression support"); #endif default : throw SRC_BUG; } compressed = compressed_side; } compressor::~compressor() { try { terminate(); } catch(...) { // ignore all exceptions } if(compr != nullptr) delete compr; if(decompr != nullptr) delete decompr; if(lzo_read_buffer != nullptr) meta_delete(lzo_read_buffer); if(lzo_write_buffer != nullptr) meta_delete(lzo_write_buffer); if(lzo_compressed != nullptr) meta_delete(lzo_compressed); if(lzo_wrkmem != nullptr) meta_delete(lzo_wrkmem); if(compressed_owner) if(compressed != nullptr) delete compressed; } void compressor::suspend_compression() { if(!suspended) { suspended_compr = current_algo; change_algo(none); suspended = true; } } void compressor::resume_compression() { if(suspended) { change_algo(suspended_compr); suspended = false; } } void compressor::local_terminate() { if(compr != nullptr) { S_I ret; // flushing the pending data compr_flush_write(); clean_write(); ret = compr->wrap.compressEnd(); delete compr; compr = nullptr; switch(ret) { case WR_OK: break; case WR_DATA_ERROR: // some data remains in the compression pipe (data loss) throw SRC_BUG; case WR_STREAM_ERROR: throw Erange("compressor::~compressor", gettext("compressed data is corrupted")); default : throw SRC_BUG; } } if(decompr != nullptr) { // flushing data compr_flush_read(); clean_read(); S_I ret = decompr->wrap.decompressEnd(); delete decompr; decompr = nullptr; switch(ret) { case WR_OK: break; default: throw SRC_BUG; } } if(lzo_read_buffer != nullptr) { compr_flush_read(); clean_read(); meta_delete(lzo_read_buffer); lzo_read_buffer = nullptr; } if(lzo_write_buffer != nullptr) { compr_flush_write(); clean_write(); meta_delete(lzo_write_buffer); lzo_write_buffer = nullptr; } if(lzo_compressed != nullptr) { meta_delete(lzo_compressed); lzo_compressed = nullptr; } if(lzo_wrkmem != nullptr) { meta_delete(lzo_wrkmem); lzo_wrkmem = nullptr; } } void compressor::change_algo(compression new_algo, U_I new_compression_level) { if(new_algo == get_algo() && new_compression_level == current_level) return; if(is_terminated()) throw SRC_BUG; // flush data and release zlib memory structures local_terminate(); // change to new algorithm init(new_algo, compressed, new_compression_level); } compressor::xfer::xfer(U_I sz, wrapperlib_mode mode) : wrap(mode) { meta_new(buffer, sz); if(buffer == nullptr) throw Ememory("compressor::xfer::xfer"); size = sz; } compressor::xfer::~xfer() { meta_delete(buffer); } U_I compressor::none_read(char *a, U_I size) { return compressed->read(a, size); } void compressor::none_write(const char *a, U_I size) { compressed->write(a, size); } U_I compressor::gzip_read(char *a, U_I size) { S_I ret; S_I flag = WR_NO_FLUSH; U_I mem_avail_out = 0; enum { normal, no_more_input, eof } processing = normal; if(size == 0) return 0; decompr->wrap.set_next_out(a); decompr->wrap.set_avail_out(size); do { // feeding the input buffer if necessary if(decompr->wrap.get_avail_in() == 0) { decompr->wrap.set_next_in(decompr->buffer); decompr->wrap.set_avail_in(compressed->read(decompr->buffer, decompr->size)); if(decompr->wrap.get_avail_in() == 0) mem_avail_out = decompr->wrap.get_avail_out(); // could not add compressed data, so if no more clear data is produced // we must break the endless loop if WR_STREAM_END is not returned by decompress() // this situation can occur upon data corruption else mem_avail_out = 0; } if(decompr->wrap.get_avail_in() == 0) processing = no_more_input; ret = decompr->wrap.decompress(flag); if(ret == 0 && processing == no_more_input) // nothing extracted from decompression engine and no more compression data available processing = eof; switch(ret) { case WR_OK: case WR_STREAM_END: break; case WR_DATA_ERROR: throw Erange("compressor::gzip_read", gettext("compressed data CRC error")); case WR_MEM_ERROR: throw Ememory("compressor::gzip_read"); case WR_BUF_ERROR: // no process is possible: if(decompr->wrap.get_avail_in() == 0) // because we reached EOF ret = WR_STREAM_END; // lib did not returned WR_STREAM_END (why ?) else // nothing explains why no process is possible: if(decompr->wrap.get_avail_out() == 0) throw SRC_BUG; // bug from DAR: no output possible else throw SRC_BUG; // unexpected comportment from lib break; default: throw SRC_BUG; } } while(decompr->wrap.get_avail_out() != mem_avail_out && ret != WR_STREAM_END && processing != eof); return decompr->wrap.get_next_out() - a; } void compressor::gzip_write(const char *a, U_I size) { compr->wrap.set_next_in(a); compr->wrap.set_avail_in(size); if(a == nullptr) throw SRC_BUG; while(compr->wrap.get_avail_in() > 0) { // making room for output compr->wrap.set_next_out(compr->buffer); compr->wrap.set_avail_out(compr->size); switch(compr->wrap.compress(WR_NO_FLUSH)) { case WR_OK: case WR_STREAM_END: break; case WR_STREAM_ERROR: throw SRC_BUG; case WR_BUF_ERROR: throw SRC_BUG; default : throw SRC_BUG; } if(compr->wrap.get_next_out() != compr->buffer) compressed->write(compr->buffer, (char *)compr->wrap.get_next_out() - compr->buffer); } } U_I compressor::lzo_read(char *a, U_I size) { #if LIBLZO2_AVAILABLE U_I read = 0; while(read < size && !lzo_read_reached_eof) { U_I available = lzo_read_size - lzo_read_start; U_I to_read = size - read; if(available > to_read) { (void)memcpy(a+read, lzo_read_buffer+lzo_read_start, to_read); lzo_read_start += to_read; read += to_read; } else { if(available > 0) { (void)memcpy(a+read, lzo_read_buffer+lzo_read_start, available); lzo_read_start += available; read += available; } if(lzo_read_start < lzo_read_size) throw SRC_BUG; lzo_read_and_uncompress_to_buffer(); lzo_read_reached_eof = (lzo_read_size == 0); // either true or false } } return read; #else throw Efeature(gettext("lzo compression")); #endif } void compressor::lzo_write(const char *a, U_I size) { #if LIBLZO2_AVAILABLE U_I wrote = 0; lzo_write_flushed = false; while(wrote < size) { U_I to_write = size - wrote; U_I space = LZO_CLEAR_BUFFER_SIZE - lzo_write_size; if(to_write < space) { (void)memcpy(lzo_write_buffer + lzo_write_size, a + wrote, to_write); wrote += to_write; lzo_write_size += to_write; } else { (void)memcpy(lzo_write_buffer + lzo_write_size, a + wrote, space); wrote += space; lzo_write_size += space; lzo_compress_buffer_and_write(); } } #else throw Efeature(gettext("lzo compression")); #endif } void compressor::compr_flush_write() { S_I ret; if(is_terminated()) throw SRC_BUG; if(compr != nullptr && compr->wrap.get_total_in() != 0) // (z/bz)lib { // no more input compr->wrap.set_avail_in(0); do { // setting the buffer for reception of data compr->wrap.set_next_out(compr->buffer); compr->wrap.set_avail_out(compr->size); ret = compr->wrap.compress(WR_FINISH); switch(ret) { case WR_OK: case WR_STREAM_END: if(compr->wrap.get_next_out() != compr->buffer) compressed->write(compr->buffer, (char *)compr->wrap.get_next_out() - compr->buffer); break; case WR_BUF_ERROR : throw SRC_BUG; case WR_STREAM_ERROR : throw SRC_BUG; default : throw SRC_BUG; } } while(ret != WR_STREAM_END); if(compr->wrap.compressReset() != WR_OK) throw SRC_BUG; } if(lzo_write_buffer != nullptr && ! lzo_write_flushed) // lzo { lzo_block_header lzo_bh; lzo_compress_buffer_and_write(); lzo_bh.type = BLOCK_HEADER_EOF; lzo_bh.size = 0; if(compressed == nullptr) throw SRC_BUG; lzo_bh.dump(*compressed); lzo_write_flushed = true; } } void compressor::compr_flush_read() { if(is_terminated()) throw SRC_BUG; if(decompr != nullptr) // zlib if(decompr->wrap.decompressReset() != WR_OK) throw SRC_BUG; // keep in the buffer the bytes already read, these are discarded in case of a call to skip lzo_read_reached_eof = false; } void compressor::clean_read() { if(is_terminated()) throw SRC_BUG; if(decompr != nullptr) decompr->wrap.set_avail_in(0); if(lzo_read_buffer != nullptr) // lzo { lzo_read_start = 0; lzo_read_size = 0; } } void compressor::clean_write() { if(is_terminated()) throw SRC_BUG; if(compr != nullptr) { S_I ret; do { compr->wrap.set_next_out(compr->buffer); compr->wrap.set_avail_out(compr->size); compr->wrap.set_avail_in(0); ret = compr->wrap.compress(WR_FINISH); } while(ret == WR_OK); } if(lzo_write_buffer != nullptr) // lzo lzo_write_size = 0; } void compressor::lzo_compress_buffer_and_write() { #if LIBLZO2_AVAILABLE lzo_block_header lzo_bh; lzo_uint compr_size = LZO_COMPRESSED_BUFFER_SIZE; S_I status; //compressing data to lzo_compress buffer status = lzo1x_999_compress_level((lzo_bytep)lzo_write_buffer, lzo_write_size, (lzo_bytep)lzo_compressed, &compr_size, lzo_wrkmem, nullptr, 0, 0, current_level); switch(status) { case LZO_E_OK: break; // all is fine default: throw Erange("compressor::lzo_compress_buffer_and_write", tools_printf(gettext("Probable bug in liblzo2: lzo1x_*_compress returned unexpected code %d"), status)); } // writing down the TL(V) before the compressed data lzo_bh.type = BLOCK_HEADER_LZO; lzo_bh.size = compr_size; if(compressed == nullptr) throw SRC_BUG; lzo_bh.dump(*compressed); compressed->write(lzo_compressed, compr_size); lzo_write_size = 0; #else throw Efeature(gettext("lzo compression")); #endif } void compressor::lzo_read_and_uncompress_to_buffer() { #if LIBLZO2_AVAILABLE lzo_block_header lzo_bh; lzo_uint compr_size; int status; #if LZO1X_MEM_DECOMPRESS > 0 char wrkmem[LZO1X_MEM_DECOMPRESS]; #else char *wrkmem = nullptr; #endif if(compressed == nullptr) throw SRC_BUG; lzo_bh.set_from(*compressed); if(lzo_bh.type != BLOCK_HEADER_LZO && lzo_bh.type != BLOCK_HEADER_EOF) throw Erange("compressor::lzo_read_and_uncompress_to_buffer", gettext("data corruption detected: Incoherence in LZO compressed data")); if(lzo_bh.type == BLOCK_HEADER_EOF) { if(lzo_bh.size != 0) throw Erange("compressor::lzo_read_and_uncompress_to_buffer", gettext("compressed data corruption detected")); lzo_read_size = 0; lzo_read_start = 0; } else { lzo_uint read; if(lzo_bh.size > LZO_COMPRESSED_BUFFER_SIZE) #if !defined(SSIZE_MAX) || SSIZE_MAX > BUFFER_SIZE throw Erange("compressor::lzo_read_and_uncompress_to_buffer", gettext("data corruption detected: Too large block of compressed data")); #else throw Erange("compressor::lzo_read_and_uncompress_to_buffer", gettext("Too large block of compressed data: Either due to data corruption or current system limitation where SSIZE_MAX value implied smaller buffers than required")); #endif compr_size = 0; lzo_bh.size.unstack(compr_size); if(lzo_bh.size != 0) throw SRC_BUG; read = compressed->read(lzo_compressed, compr_size); if(read != compr_size) Erange("compressor::lzo_read_and_uncompress_to_buffer", gettext("compressed data corruption detected")); read = LZO_CLEAR_BUFFER_SIZE; status = lzo1x_decompress_safe((lzo_bytep)lzo_compressed, compr_size, (lzo_bytep)lzo_read_buffer, &read, wrkmem); lzo_read_size = read; lzo_read_start = 0; switch(status) { case LZO_E_OK: break; // all is fine case LZO_E_INPUT_NOT_CONSUMED: throw SRC_BUG; default: lzo_read_size = 0; throw Erange("compressor::lzo_read_and_uncompress_to_buffer", gettext("compressed data corruption detected")); } } #else throw Efeature(gettext("lzo compression")); #endif } void compressor::lzo_block_header::dump(generic_file & f) { f.write(&type, 1); size.dump(f); } void compressor::lzo_block_header::set_from(generic_file & f) { f.read(&type, 1); size.read(f); } compression char2compression(char a) { switch(a) { case 'n': return none; case 'z': return gzip; case 'y': return bzip2; case 'l': return lzo; case 'x': return xz; default : throw Erange("char2compression", gettext("unknown compression")); } } char compression2char(compression c) { switch(c) { case none: return 'n'; case gzip: return 'z'; case bzip2: return 'y'; case lzo: return 'l'; case xz: return 'x'; default: throw Erange("compression2char", gettext("unknown compression")); } } string compression2string(compression c) { switch(c) { case none: return "none"; case gzip: return "gzip"; case bzip2: return "bzip2"; case lzo: return "lzo"; case xz: return "xz"; default: throw Erange("compresion2string", gettext("unknown compression")); } } compression string2compression(const std::string & a) { if(a == "gzip" || a == "gz") return gzip; if(a == "bzip2" || a == "bzip" || a == "bz") return bzip2; if(a == "lzo" || a == "lz" || a == "l") return lzo; if(a == "xz" || a == "lzma") return xz; throw Erange("string2compression", tools_printf(gettext("unknown compression algorithm: %S"), &a)); } } // end of namespace dar-2.5.3/src/libdar/mem_cluster.cpp0000644000175000017430000001332112641772777014305 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "mem_cluster.hpp" #include "tools.hpp" using namespace std; namespace libdar { mem_cluster::mem_cluster(U_I x_block_size, U_I table_size_64, mem_manager *x_holder) : mem_allocator(x_holder) { block_size = x_block_size > 0 ? x_block_size : 1; // trivial case of zero handled by 1 byte length pointed areas alloc_table_size = table_size_64; next_free_in_table = 0; max_available_blocks = table_size_64 * 64; available_blocks = max_available_blocks; alloc_area_size = max_available_blocks * block_size; alloc_table = nullptr; alloc_area = nullptr; #ifdef LIBDAR_DEBUG_MEMORY min_avail_reached = max_available_blocks; #endif try { alloc_table = (U_64 *)new (nothrow) char[alloc_table_size*sizeof(U_64) + alloc_area_size]; if(alloc_table == nullptr) throw Ememory("mem_cluster::mem_cluster"); alloc_area = (char *)(alloc_table + alloc_table_size); for(U_I i = 0; i < alloc_table_size; ++i) alloc_table[i] = 0; } catch(...) { if(alloc_table != nullptr) delete [] alloc_table; throw; } } mem_cluster::~mem_cluster() { if(alloc_table != nullptr) delete [] alloc_table; } void *mem_cluster::alloc() { void * ret = nullptr; if(is_full()) throw SRC_BUG; while(next_free_in_table < alloc_table_size && alloc_table[next_free_in_table] == FULL) ++next_free_in_table; if(next_free_in_table == alloc_table_size) { next_free_in_table = 0; while(next_free_in_table < alloc_table_size && alloc_table[next_free_in_table] == FULL) ++next_free_in_table; if(next_free_in_table == alloc_table_size) throw SRC_BUG; // should be reported as full by full() method } U_I offset = find_free_slot_in(next_free_in_table); ret = alloc_area + block_size * (next_free_in_table * 64 + offset); set_slot_in(next_free_in_table, offset, true); --available_blocks; #ifdef LIBDAR_DEBUG_MEMORY if(available_blocks < min_avail_reached) min_avail_reached = available_blocks; #endif return ret; } U_I mem_cluster::find_free_slot_in(U_I table_integer) const { U_I ret = 0; U_64 focus = alloc_table[table_integer]; // we copy to be able to modify while(focus > HALF) { // the most significant bit is 1 so the corresponding block is already allocated // looking at the next offset focus <<= 1; ++ret; } return ret; } void mem_cluster::set_slot_in(U_I table_integer, U_I bit_offset, bool value) { U_64 add_mask = LEAD >> bit_offset; if(value) { // we must first check the block is not already allocated if((alloc_table[table_integer] & add_mask) != 0) throw SRC_BUG; // double allocation // OK, so we can mark that block as allocated alloc_table[table_integer] |= add_mask; } else { // we must first check the block is not already released if((alloc_table[table_integer] & add_mask) == 0) throw SRC_BUG; // double release // OK, si we can mark that block as released alloc_table[table_integer] &= ~add_mask; } } void mem_cluster::release(void *ptr) { if(ptr < alloc_area || ptr >= alloc_area + alloc_area_size) throw SRC_BUG; // not allocated here else { U_I char_offset = (char *)(ptr) - alloc_area; U_I block_number = char_offset / block_size; U_I table_integer = block_number / 64; U_I offset = block_number % 64; if(char_offset % block_size != 0) throw SRC_BUG; // not at a block boundary set_slot_in(table_integer, offset, false); ++available_blocks; if(available_blocks > max_available_blocks) throw SRC_BUG; if(is_empty()) get_manager().push_to_release_list(this); } } string mem_cluster::dump() const { string ret = ""; U_I counted = max_available_blocks - available_blocks; ret += " Cluster dump:\n"; ret += tools_printf(" block_size = %d\n", block_size); ret += tools_printf(" available_blocks = %d\n", available_blocks); ret += tools_printf(" max_available_blocks = %d\n", max_available_blocks); ret += tools_printf(" which makes %d unreleased block(s)\n", counted); ret += tools_printf(" Follows the list of unreleased blocks for that cluster:\n"); ret += examination_status(); ret += "\n\n"; return ret; } string mem_cluster::examination_status() const { string ret = ""; for(U_I table_ptr = 0; table_ptr < alloc_table_size; ++table_ptr) { U_64 mask = LEAD; for(U_I offset = 0; offset < 64; ++offset) { if((alloc_table[table_ptr] & mask) != 0) ret += tools_printf(" unreleased memory (%d bytes) at: 0x%x\n", block_size, (U_I)(alloc_area + block_size * ( 64 * table_ptr + offset))); mask >>= 1; } } return ret; } } // end of namespace dar-2.5.3/src/libdar/zapette.hpp0000644000175000017430000001445512641773000013434 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file zapette.hpp /// \brief remote control between dar and dar_slave. /// \ingroup Private /// /// Two classes are defined in this module /// - zapette is the dar side master class /// - slave_zapette dar_slave side /// . /// these two classes communicate throw a pair pipes #ifndef ZAPETTE_HPP #define ZAPETTE_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "integers.hpp" #include "mem_ui.hpp" namespace libdar { /// \addtogroup Private /// @{ /// zapette emulate a file that is remotely controlled by slave_zapette /// class zapette sends order to slave_zapette throw a /// a first pipe and receive informations or data in return /// from a second pipe from slave_zapette /// \ingroup Private class zapette : public generic_file, public contextual, protected mem_ui { public: /// zapette constructor /// \param[in] dialog is used to return status information to the user /// \param[in] input is the pipe (see class tuyau) from which is received the information or data /// \param[in] output is used to send orders to slave_zapette /// \param[in] by_the_end if true dar will try to open the archive starting from the end else it will try starting from the first bytes zapette(const user_interaction & dialog, generic_file *input, generic_file *output, bool by_the_end); ~zapette(); // inherited methods from generic_file bool skippable(skippability direction, const infinint & amount) { return true; }; bool skip(const infinint &pos); bool skip_to_eof() { if(is_terminated()) throw SRC_BUG; position = file_size; return true; }; bool skip_relative(S_I x); infinint get_position() const { if(is_terminated()) throw SRC_BUG; return position; }; // overwritten inherited methods from contextual void set_info_status(const std::string & s); bool is_an_old_start_end_archive() const; const label & get_data_name() const; protected: void inherited_read_ahead(const infinint & amount) {}; // optimization will be done when zapette will use the messaging_encode/decode exchange format U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate(); private: generic_file *in, *out; infinint position, file_size; char serial_counter; /// wrapped formatted method to communicate with the slave_zapette located behind the pair of pipes (= tuyau) /// \param[in] size is the size of the amount of data we want the zapette to send us /// \param[in] offset is the byte offset of the portion of the data we want /// \param[in,out] data is the location where to return the requested data /// \param[in] info the new contextual string to set to the slave_zapette. /// \param[out] lu the amount of byte wrote to '*data' /// \param[out] arg infinint value return for special order (see note below). /// \note with default parameters, this method permits the caller to get a portion of data from the /// remote slave_zapette. In addition, it let the caller change the 'contextual' status of the remote object. /// if size is set to REQUEST_SPECIAL_ORDER, the offset is used to transmit a special order to the /// remote slave_zapette. Defined order are for example REQUEST_OFFSET_END_TRANSMIT , REQUEST_OFFSET_GET_FILESIZE, /// and so on (see at the beginning of zapette.cpp file for more). Each of these order may expect a returned value /// which may be an integer (provided by the "arg" argument of this call) a boolean value (provided by the "arg" /// argument where 0 means false and 1 means true) or a char * (first byte to put the answer to is given by 'data' and /// allocated space for the reply must be given through 'lu' which at return gives the effective length of the returned /// string void make_transfert(U_16 size, const infinint &offset, char *data, const std::string & info, S_I & lu, infinint & arg) const; }; /// this class answers to order given by a zapette object /// through a pair of pipes slave_zapette return information about /// a given local archive (single or multi slices). /// \ingroup Private class slave_zapette : public on_pool { public: /// slave_zapette constructor /// \param[in] input is used to receive orders from an zapette object /// \param[in] output is used to return informations or data in answer to received orders /// \param[in] data is where the informations or data is taken from. Object must inherit from contextual slave_zapette(generic_file *input, generic_file *output, generic_file *data); ~slave_zapette(); /// main execution method for slave_zapette class /// this method implement a loop waiting for orders and answering to them /// the loop stops when a special order is received from the peer zapette object void action(); private: generic_file *in; //< where to read orders from generic_file *out; //< where to send requested info or data to generic_file *src; //< where to read data from contextual *src_ctxt; //< same as src but seen as contextual }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cygwin_adapt.hpp0000644000175000017430000000342112641772777014444 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cygwin_adapt.hpp /// \brief thin adaptation layer to Cygwin specifities /// \ingroup Private #ifndef CYGWIN_ADAPT_HPP #define CYGWIN_ADAPT_HPP #include "../my_config.h" /// \ingroup Private /// @} extern "C" { #if HAVE_FCNTL_H #include #endif // if fcntl.h does not define O_TEXT nor O_BINARY (which is a Cygwin // speciality), we define them as neutral ORed values : zero } // end extern "C" #ifndef O_TEXT // zero is neutral in ORed expression where it is expected to be used #define O_TEXT 0 #endif #ifndef O_BINARY // zero is neutral in ORed expression where it is expected to be used #define O_BINARY 0 #else #define CYGWIN_BUILD 1 // if O_BINARY is defined we are compiling on or for a cygwin plateform #endif /// @} #endif dar-2.5.3/src/libdar/macro_tools.cpp0000644000175000017430000016173712641773016014311 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #define LIBDAR_URL_VERSION "http://dar.linux.free.fr/pre-release/doc/Notes.html#Dar_version_naming" extern "C" { #if HAVE_STDLIB_H #include #endif #if HAVE_GCRYPT_H #ifndef GCRYPT_NO_DEPRECATED #define GCRYPT_NO_DEPRECATED #endif #include #endif } // end extern "C" #include "macro_tools.hpp" #include "terminateur.hpp" #include "user_interaction.hpp" #include "zapette.hpp" #include "sar.hpp" #include "elastic.hpp" #include "tronc.hpp" #include "trontextual.hpp" #include "thread_cancellation.hpp" #include "deci.hpp" #include "escape_catalogue.hpp" #include "tronc.hpp" #include "cache.hpp" #include "null_file.hpp" #include "secu_memory_file.hpp" #include "generic_to_global_file.hpp" #include "tlv.hpp" #include "crypto_sym.hpp" #include "crypto_asym.hpp" #include "cat_all_entrees.hpp" #include "crc.hpp" #ifdef LIBTHREADAR_AVAILABLE #include "generic_thread.hpp" #endif using namespace std; namespace libdar { const string LIBDAR_STACK_LABEL_CACHE_PIPE = "CACHE_PIPE"; const string LIBDAR_STACK_LABEL_UNCOMPRESSED = "UNCOMPRESSED"; const string LIBDAR_STACK_LABEL_CLEAR = "CLEAR"; const string LIBDAR_STACK_LABEL_UNCYPHERED = "UNCYPHERED"; const string LIBDAR_STACK_LABEL_LEVEL1 = "LEVEL1"; /// this is the archive version format generated by the application /// this is also the highest version of format that can be read const archive_version macro_tools_supported_version = archive_version(9,0); static void version_check(user_interaction & dialog, const header_version & ver); catalogue *macro_tools_get_catalogue_from(user_interaction & dialog, memory_pool *pool, pile & stack, const header_version & ver, bool info_details, infinint &cat_size, const infinint & second_terminateur_offset, list & signatories, bool lax_mode) { return macro_tools_get_derivated_catalogue_from(dialog, pool, stack, stack, ver, info_details, cat_size, second_terminateur_offset, signatories, lax_mode); } catalogue *macro_tools_get_derivated_catalogue_from(user_interaction & dialog, memory_pool *pool, pile & data_stack, pile & cata_stack, const header_version & ver, bool info_details, infinint &cat_size, const infinint & second_terminateur_offset, list & signatories, bool lax_mode) { terminateur term; catalogue *ret = nullptr; pile_descriptor data_pdesc(&data_stack); pile_descriptor cata_pdesc(&cata_stack); generic_file *crypto = cata_stack.get_by_label(LIBDAR_STACK_LABEL_UNCYPHERED); contextual *data_ctxt = nullptr; contextual *cata_ctxt = nullptr; signatories.clear(); data_stack.find_first_from_top(data_ctxt); if(data_ctxt == nullptr) throw SRC_BUG; cata_stack.find_first_from_top(cata_ctxt); if(cata_ctxt == nullptr) throw SRC_BUG; if(info_details) dialog.warning(gettext("Locating archive contents...")); if(ver.get_edition() > 3) term.read_catalogue(*crypto, ver.is_ciphered(), ver.get_edition(), 0); // terminator is encrypted since format "04" // elastic buffer present when encryption is used else term.read_catalogue(*crypto, false, ver.get_edition()); // elastic buffer did not exist before format "04" cata_stack.flush_read_above(crypto); if(info_details) dialog.warning(gettext("Reading archive contents...")); if(cata_stack.skip(term.get_catalogue_start())) { if(term.get_catalogue_start() > term.get_terminateur_start()) throw SRC_BUG; cat_size = term.get_terminateur_start() - term.get_catalogue_start(); ret = macro_tools_read_catalogue(dialog, pool, ver, cata_pdesc, cat_size, signatories, lax_mode, label_zero, false); // only_detruit if(ret == nullptr) throw Ememory("get_catalogue_from"); try { data_ctxt->set_info_status(CONTEXT_OP); cata_ctxt->set_info_status(CONTEXT_OP); if(&cata_stack != &data_stack) ret->change_location(data_pdesc); } catch(...) { if(ret != nullptr) delete ret; throw; } } else throw Erange("get_catalogue_from", gettext("Missing catalogue in file.")); return ret; } catalogue *macro_tools_read_catalogue(user_interaction & dialog, memory_pool *pool, const header_version & ver, const pile_descriptor & cata_pdesc, const infinint & cat_size, list & signatories, bool lax_mode, const label & lax_layer1_data_name, bool only_detruits) { catalogue *ret = nullptr; memory_file hash_to_compare; hash_fichier *hasher = nullptr; signatories.clear(); cata_pdesc.check(false); try // release hasher in case of exception { if(ver.is_signed()) { generic_to_global_file *global_hash_to_compare = nullptr; generic_to_global_file *global_cata_top_stack = nullptr; try { global_hash_to_compare = new (nothrow) generic_to_global_file(dialog, &hash_to_compare, gf_write_only); if(global_hash_to_compare == nullptr) throw Ememory("macro_tools_get_derivated_catalogue_from"); global_cata_top_stack = new (nothrow) generic_to_global_file(dialog, cata_pdesc.stack->top(), gf_read_only); if(global_cata_top_stack == nullptr) throw Ememory("macro_tools_get_derivated_catalogue_from"); hasher = new (nothrow) hash_fichier(dialog, global_cata_top_stack, "x", global_hash_to_compare, hash_sha512); if(hasher == nullptr) throw Ememory("macro_tools_get_derivated_catalogue_from"); // at this stage, hasher is created // and manages the objects global_cata_stack and global_hash_to_compare } catch(...) { if(global_hash_to_compare != nullptr) delete global_hash_to_compare; if(global_cata_top_stack != nullptr) delete global_cata_top_stack; throw; } cata_pdesc.stack->push(hasher); } try // trap cast and rethrow exceptions { if(!cat_size.is_zero()) cata_pdesc.stack->read_ahead(cat_size); ret = new (pool) catalogue(dialog, cata_pdesc, ver.get_edition(), ver.get_compression_algo(), lax_mode, lax_layer1_data_name, only_detruits); if(ret == nullptr) throw Ememory("macro_tools_read_catalogue"); try { if(hasher != nullptr) { hasher->terminate(); if(cata_pdesc.stack->top() != hasher) throw SRC_BUG; if(cata_pdesc.stack->pop() != hasher) throw SRC_BUG; } if(ver.is_signed()) { tlv hash_to_decrypt(*cata_pdesc.stack); // read the encrypted hash following the catalogue memory_file clear_read_hash; crypto_asym engine(dialog); crc *tmp = nullptr; hash_to_decrypt.skip(0); engine.decrypt(hash_to_decrypt, clear_read_hash); signatories = engine.verify(); if(clear_read_hash.diff(hash_to_compare, 0, 0, 1, tmp)) // difference! { if(lax_mode) dialog.warning(gettext("LAX MODE: catalogue computed hash does not match the signed hash of the archive, ignoring")); else throw Edata(gettext("Catalogue computed hash does not match the signed hash of the archive, archive has been modified since it was signed!")); } else { if(tmp != nullptr) delete tmp; // else no difference, // the caller has the signatories and will compare those with the list contained in the archive header } } } catch(...) { if(ret != nullptr) delete ret; throw; } } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { throw Erange("get_catalogue_from", string(gettext("Cannot open catalogue: ")) + e.get_message()); } } catch(...) { if(cata_pdesc.stack->top() == hasher) { if(cata_pdesc.stack->pop() != hasher) throw SRC_BUG; } if(hasher != nullptr) delete hasher; throw; } if(hasher != nullptr) delete hasher; return ret; } void macro_tools_open_archive(user_interaction & dialog, memory_pool *pool, const entrepot &where, const string &basename, const infinint & min_digits, const string &extension, crypto_algo crypto, const secu_string & pass, U_32 crypto_size, pile & stack, header_version &ver, const string &input_pipe, const string &output_pipe, const string & execute, infinint & second_terminateur_offset, bool lax, bool has_external_cat, bool sequential_read, bool info_details, list & gnupg_signed, slice_layout & sl, bool multi_threaded) { secu_string real_pass = pass; generic_file *tmp = nullptr; contextual *tmp_ctxt = nullptr; cache *tmp_cache = nullptr; stack.clear(); #ifdef LIBTHREADAR_AVAILABLE if(!multi_threaded) stack.ignore_read_ahead(true); else stack.ignore_read_ahead(false); #else stack.ignore_read_ahead(true); #endif sl.first_size = 0; sl.other_size = 0; // we will change that only if sar object is used try { // ****** Building the sar/tuyau/null layer aka level 1 ******* // if(basename == "-") { if(sequential_read) { if(input_pipe == "") { if(info_details) dialog.warning(gettext("Opening standard input to read the archive...")); tmp = new (pool) trivial_sar(dialog, basename, lax); } else { if(info_details) dialog.printf(gettext("Opening named pipe %S as input to read the archive..."), &input_pipe); tmp = new (pool) trivial_sar(dialog, input_pipe, lax); } } else { tuyau *in = nullptr; tuyau *out = nullptr; try { dialog.printf(gettext("Opening a pair of pipes to read the archive, expecting dar_slave at the other ends...")); tools_open_pipes(dialog, input_pipe, output_pipe, in, out, pool); tmp = new (pool) zapette(dialog, in, out, true); if(tmp == nullptr) { delete in; in = nullptr; delete out; out = nullptr; } else { in = out = nullptr; // now managed by the zapette tmp->skip_to_eof(); // not sequential reading mode we must skip at eof } } catch(...) { if(in != nullptr) delete in; if(out != nullptr) delete out; throw; } } } else { sar *tmp_sar = nullptr; if(info_details) dialog.warning(gettext("Opening the archive using the multi-slice abstraction layer...")); tmp = tmp_sar = new (pool) sar(dialog, basename, extension, where, !sequential_read, // not openned by the end in sequential read mode min_digits, lax, execute); if(tmp_sar != nullptr) sl = tmp_sar->get_slicing(); } if(tmp == nullptr) throw Ememory("open_archive"); else { // we always ignore read_ahead as no slave thread will exist for LEVEL1 layer tmp->ignore_read_ahead(true); stack.push(tmp, LIBDAR_STACK_LABEL_LEVEL1); tmp = nullptr; } // ****** Reading the header version ************** // if(info_details) { if(sequential_read) dialog.warning(gettext("Reading the archive header...")); else dialog.warning(gettext("Reading the archive trailer...")); } stack.find_first_from_top(tmp_ctxt); if(tmp_ctxt == nullptr) throw SRC_BUG; second_terminateur_offset = 0; if(sequential_read || tmp_ctxt->is_an_old_start_end_archive() || stack.get_position().is_zero()) //< sar layer failed openning the last slice and fallen back openning the first slice stack.skip(0); else { terminateur term; try { term.read_catalogue(stack, false, macro_tools_supported_version); stack.skip(term.get_catalogue_start()); second_terminateur_offset = term.get_catalogue_start(); } catch(Erange & e) { dialog.printf(gettext("Error while reading archive's header, this may be because this archive is an old encrypted archive or that data corruption took place, Assuming it is an old archive, we have to read the header at the beginning of the first slice...")); stack.skip(0); } } ver.read(stack, dialog, lax); if(second_terminateur_offset.is_zero() && !sequential_read && ver.get_edition() > 7) if(!has_external_cat) { if(!lax) throw Erange("macro_tools_open_archive",gettext("Found a correct archive header at the beginning of the archive, which does not stands to be an old archive, the end of the archive is corrupted and thus the catalogue is not readable, aborting. Either retry providing in addition an isolated catalogue of that archive to perform the operation, or try reading the archive in sequential mode or try in lax mode or, last chance, try both lax and sequential read mode at the same time")); else dialog.pause(gettext("Found a correct archive header at the beginning of the archive, which does not stands to be an old archive, the end of the archive is thus corrupted. Without external catalogue provided and as we do not read the archive in sequential mode, there is very little chance to retreive something from this corrupted archive. Do we continue anyway ?")); } // ************* adding a tronc to hide last terminator and trailer_version ******* // if(!second_terminateur_offset.is_zero()) { if(info_details) dialog.printf(gettext("Opening construction layer...")); tmp = new (pool) tronc(stack.top(), 0, second_terminateur_offset, false); if(tmp == nullptr) throw Ememory("macro_tools_open_archive"); else { tmp->ignore_read_ahead(true); // no slave thread used below in the stack stack.clear_label(LIBDAR_STACK_LABEL_LEVEL1); stack.push(tmp, LIBDAR_STACK_LABEL_LEVEL1); tmp = nullptr; } } // ************* building the encryption layer if necessary ************** // if(info_details) dialog.warning(gettext("Considering cyphering layer...")); if(ver.is_ciphered() && ver.get_edition() >= 9 && crypto == crypto_none && ver.get_sym_crypto_algo() != crypto_none) crypto = ver.get_sym_crypto_algo(); // using the crypto algorithm recorded in the archive if(ver.is_ciphered() && crypto == crypto_none) { if(lax) { dialog.warning(gettext("LAX MODE: Archive seems to be ciphered, but you did not have provided any encryption algorithm, assuming data corruption and considering that the archive is not ciphered")); } else throw Erange("macro_tools_open_archive", tools_printf(gettext("The archive %S is encrypted and no encryption cipher has been given, cannot open archive."), &basename)); } if(ver.get_crypted_key() != nullptr) // we will find the passphrase from the header's encrypted key { // detemining the size of the unencrypted key infinint i_size = ver.get_crypted_key()->size(); U_I size = 0; i_size.unstack(size); if(!i_size.is_zero()) throw SRC_BUG; // unciphering the encrypted key using GnuPG user's keyring, asking for passphrase if necessary secu_memory_file clear_key = secu_memory_file(size); crypto_asym engine(dialog); ver.get_crypted_key()->skip(0); clear_key.skip(0); engine.decrypt(*(ver.get_crypted_key()), clear_key); gnupg_signed = engine.verify(); // substitution of the pass by the clear_key if decrypt succeeded (else it throws an exception) real_pass = clear_key.get_contents(); } if(crypto != crypto_none && real_pass == "") { if(!secu_string::is_string_secured()) dialog.warning(gettext("WARNING: support for secure memory was not available at compilation time, in case of heavy memory load, this may lead the password you are about to provide to be wrote to disk (swap space) in clear. You have been warned!")); real_pass = dialog.get_secu_string(tools_printf(gettext("Archive %S requires a password: "), &basename), false); } switch(crypto) { case crypto_none: if(!ver.get_tape_marks()) { if(info_details) dialog.warning(gettext("No cyphering layer opened, adding cache layer for better performance")); // adding the cache layer only if no escape layer will tape place // over. escape layer act a bit like a cache, making caching here useless tmp = tmp_cache = new (pool) cache (*(stack.top()), false); if(tmp == nullptr) dialog.warning(gettext("Failed opening the cache layer, lack of memory, archive read performances will not be optimized")); } else { if(info_details) dialog.warning(gettext("No cyphering layer opened")); } break; case crypto_blowfish: case crypto_aes256: case crypto_twofish256: case crypto_serpent256: case crypto_camellia256: if(info_details) dialog.warning(gettext("Opening cyphering layer...")); #ifdef LIBDAR_NO_OPTIMIZATION tools_secu_string_show(dialog, string("Used clear key: "), real_pass); #endif if(!second_terminateur_offset.is_zero() || tmp_ctxt->is_an_old_start_end_archive()) // we have openned the archive by the end { crypto_sym *tmp_ptr = nullptr; tmp = tmp_ptr = new (pool) crypto_sym(crypto_size, real_pass, *(stack.top()), true, ver.get_edition(), crypto, ver.get_crypted_key() == nullptr); if(tmp_ptr != nullptr) tmp_ptr->set_initial_shift(ver.get_initial_offset()); } else // archive openned by the beginning { crypto_sym *tmp_ptr; tmp = tmp_ptr = new (pool) crypto_sym(crypto_size, real_pass, *(stack.top()), false, ver.get_edition(), crypto, ver.get_crypted_key() == nullptr); if(tmp_ptr != nullptr) { tmp_ptr->set_callback_trailing_clear_data(¯o_tools_get_terminator_start); if(sequential_read) elastic(*tmp_ptr, elastic_forward, ver.get_edition()); // this is line creates a temporary anonymous object and destroys it just afterward // this is necessary to skip the reading of the initial elastic buffer // nothing prevents the elastic buffer from carrying what could // be considered an escape mark. } } break; case crypto_scrambling: if(info_details) dialog.warning(gettext("Opening cyphering layer...")); #ifdef LIBDAR_NO_OPTIMIZATION tools_secu_string_show(dialog, string("Used clear key: "), real_pass); #endif tmp = new (pool) scrambler(real_pass, *(stack.top())); break; default: throw Erange("macro_tools_open_archive", gettext("Unknown encryption algorithm")); } if(tmp == nullptr) { if(crypto != crypto_none || !ver.get_tape_marks()) throw Ememory("open_archive"); } else { // we always ignore read ahead as encryption layer above sar/zapette/triial_sar has no slave thread below tmp->ignore_read_ahead(true); stack.push(tmp); tmp = nullptr; } #ifdef LIBTHREADAR_AVAILABLE if(multi_threaded && crypto != crypto_none) { if(info_details) dialog.warning(gettext("Creating a new thread to run the previously created layers...")); tmp = new (pool) generic_thread(stack.top()); if(tmp == nullptr) throw Ememory("op_create_in_sub"); if(sequential_read) tmp->read_ahead(0); // the generic_thread above encryption will read asynchronously as much data as possible stack.push(tmp); tmp = nullptr; } #endif stack.add_label(LIBDAR_STACK_LABEL_UNCYPHERED); // *************** building the escape layer if necessary ************ // try { if(ver.get_tape_marks()) { if(info_details) dialog.warning(gettext("Opening escape sequence abstraction layer...")); if(lax) { if(!sequential_read) { dialog.pause(gettext("LAX MODE: Archive is flagged as having escape sequence (which is normal in recent archive versions). However if this is not expected, shall I assume a data corruption occurred in this field and that this flag should be ignored? (If unsure, refuse)")); ver.set_tape_marks(false); } else throw Euser_abort("this exception triggers the creation of the escape layer"); // else in lax & sequential_read, escape sequences are mandatory, we do not propose to ignore them } else throw Euser_abort("this exception triggers the creation of the escape layer"); } else // no escape layer in the archive { if(!lax) { if(sequential_read) throw Erange("macro_tools_open_archive", gettext("Sequential read asked, but this archive is flagged to not have the necessary embedded escape sequences for that operation, aborting")); } else // lax mode if(sequential_read) { dialog.warning(gettext("LAX MODE: the requested sequential read mode relies on escape sequence which seem to be absent from this archive. Assuming data corruption occurred. However, if no data corruption occurred and thus no escape sequence are present in this archive, do not use sequential reading mode to explore this archive else you will just get nothing usable from it")); ver.set_tape_marks(true); throw Euser_abort("this exception triggers the creation of the escape layer"); } else // normal mode if(ver.get_edition() >= 8) // most usually escape mark are present, thus we must warn dialog.pause(gettext("LAX MODE: Archive is flagged to not have escape sequence which is not the case by default since archive format 8 (release 2.4.x). If corruption occurred and an escape sequence is present, this may lead data restoration to fail, answering no at this question will let me consider that an escape sequence layer has to be added in spite of the archive flags. Do you want to continue as suggested by the archive flag, thus without escape sequence layer?")); } } catch(Euser_abort & e) { set unjump; unjump.insert(escape::seqt_catalogue); tmp = new (pool) escape(stack.top(), unjump); if(tmp == nullptr) throw Ememory("open_archive"); #ifdef LIBTHREADAR_AVAILABLE if(!multi_threaded) tmp->ignore_read_ahead(true); else { if(second_terminateur_offset.is_zero()) // archive read from the beginning (sequential read) tmp->ignore_read_ahead(true); // we avoid transmitting read_ahead request to the below thread // which has been configured with an endless read ahead, new read_ahead would abort configured // endlessly read_ahead. } #else tmp->ignore_read_ahead(true); #endif stack.push(tmp); tmp = nullptr; #ifdef LIBTHREADAR_AVAILABLE if(multi_threaded) { if(info_details) dialog.warning(gettext("Creating a new thread to run the escape layer...")); generic_thread *tmp = new (pool) generic_thread(stack.top()); if(tmp == nullptr) throw Ememory("op_create_in_sub"); stack.push(tmp); tmp = nullptr; } #endif } stack.add_label(LIBDAR_STACK_LABEL_CLEAR); // *********** building the compression layer ************* // if(info_details) { if(ver.get_compression_algo() == none) dialog.warning(gettext("Opening the compression abstraction layer (compression algorithm used is none)...")); else dialog.warning(gettext("Opening the compression layer...")); } version_check(dialog, ver); tmp = new (pool) compressor(ver.get_compression_algo(), *(stack.top())); if(tmp == nullptr) throw Ememory("open_archive"); else { #ifdef LIBTHREADAR_AVAILABLE if(!multi_threaded) tmp->ignore_read_ahead(true); #else tmp->ignore_read_ahead(true); #endif stack.push(tmp, LIBDAR_STACK_LABEL_UNCOMPRESSED); tmp = nullptr; #ifdef LIBTHREADAR_AVAILABLE if(multi_threaded && ver.get_compression_algo() != none) { if(info_details) dialog.warning(gettext("Creating a new thread to run the compression layer...")); tmp = new (pool) generic_thread(stack.top()); if(tmp == nullptr) throw Ememory("op_create_in_sub"); stack.clear_label(LIBDAR_STACK_LABEL_UNCOMPRESSED); stack.push(tmp, LIBDAR_STACK_LABEL_UNCOMPRESSED); tmp = nullptr; } #endif } // ************* warning info ************************ // if(info_details) dialog.warning(gettext("All layers have been created successfully")); if(ver.is_ciphered()) dialog.printf(gettext("Warning, the archive %S has been encrypted. A wrong key is not possible to detect, it would cause DAR to report the archive as corrupted\n"), &basename); } catch(...) { if(tmp != nullptr) delete tmp; stack.clear(); throw; } } catalogue *macro_tools_lax_search_catalogue(user_interaction & dialog, memory_pool *pool, pile & stack, const archive_version & edition, compression compr_algo, bool info_details, bool even_partial_catalogue, const label & layer1_data_name) { catalogue *ret = nullptr; thread_cancellation thr_cancel; pile_descriptor pdesc(&stack); bool ok = false; U_I check_abort_every = 10000; U_I check_abort_count = check_abort_every; infinint offset; infinint max_offset; infinint min_offset; infinint amplitude; entree_stats stats; infinint fraction = 101; // obtaining from the user the fraction of the archive to inspect do { string answ = dialog.get_string(gettext("LAX MODE: The catalogue (table of contents) usually takes a few percents of the archive at its end, which percentage do you want me to scan (answer by an *integer* number between 0 and 100)? "), true); try { deci num = answ; fraction = num.computer(); if(fraction > 100) dialog.printf(gettext("LAX MODE: %i is not a valid percent value"), &fraction); } catch(Edeci & e) { dialog.printf(gettext("%S is not a valid number"), & answ); } } while(fraction > 100 || fraction.is_zero()); if(info_details) dialog.printf(gettext("LAX MODE: Beginning search of the catalogue (from the end toward the beginning of the archive, on %i %% of its length), this may take a while..."), &fraction); // finding the upper limit of the search if(stack.skip_to_eof()) max_offset = stack.get_position(); else { dialog.warning(gettext("LAX MODE: Cannot skip at the end of the archive! Using current position to start the catalogue search")); max_offset = stack.get_position(); } if(max_offset.is_zero()) throw Erange("macro_tools_lax_search_catalogue", gettext("LAX MODE: Failed to read the catalogue (no data to inspect)")); if(fraction.is_zero()) throw Erange("macro_tools_lax_search_catalogue", gettext("LAX MODE: Failed to read the catalogue (0 bytes of the archive length asked to look for the catalogue)")); // calculating starting offset and offset range min_offset = ((infinint)100 - fraction)*max_offset/100; amplitude = max_offset - min_offset; if(pdesc.esc != nullptr) { dialog.warning(gettext("LAX MODE: Escape sequence seems present in this archive. I have thus two different methods, either I look for the escape sequence indicating the start of the catalogue or I try each position in turn in the hope it will not be data that look like a catalogue")); try { dialog.pause(gettext("LAX MODE: Trying to locate the escape sequence (safer choice) ?")); if(!pdesc.esc->skip(min_offset)) throw SRC_BUG; if(pdesc.esc->skip_to_next_mark(escape::seqt_catalogue, true)) { dialog.warning(gettext("LAX MODE: Good point! I could find the escape sequence marking the beginning of the catalogue, now trying to read it...")); pdesc.stack->flush_read_above(pdesc.esc); if(pdesc.stack->get_position() != pdesc.esc->get_position()) throw SRC_BUG; offset = pdesc.stack->get_position(); min_offset = offset; // no need to read before this position, we cannot fetch the catalogue there } else { dialog.warning(gettext("LAX MODE: Escape sequence could not be found, it may have been corrupted or out of the scanned portion of the archive, trying to find the catalogue the other way")); throw Euser_abort("THIS MESSAGE SHOULD NEVER APPEAR, It branches the execution to the second way of looking for the catalogue"); } } catch(Euser_abort & e) { offset = min_offset; pdesc.stack->skip(offset); } } while(!ok) { // checking whether thread cancellation has been asked if(++check_abort_count > check_abort_every) { thr_cancel.check_self_cancellation(); check_abort_count = 0; if(info_details) { infinint ratio = (offset - min_offset)*100/amplitude; dialog.warning(tools_printf(gettext("LAX MODE: %i %% remaining"), & ratio)); } } // trying to read a catalogue at the "offset" position try { ret = new (pool) catalogue(dialog, pdesc, edition, compr_algo, even_partial_catalogue, layer1_data_name); if(ret == nullptr) throw Ememory("macro_tools_lax_search_catalogue"); stats = ret->get_stats(); dialog.printf(gettext("Could read a catalogue data structure at offset %i, it contains the following:"), &offset); stats.listing(dialog); dialog.pause(gettext("Do you want to use it for the operation?")); ok = true; } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Efeature & e) { throw; } catch(Ehardware & e) { throw; } catch(Escript & e) { throw; } catch(Ecompilation & e) { throw; } catch(Egeneric & e) { if(offset >= max_offset) { if(info_details) dialog.warning(gettext("LAX MODE: Reached the end of the area to scan, FAILED to find any catalogue")); ret = nullptr; ok = true; } else stack.skip(++offset); } } if(ret == nullptr) throw Erange("macro_tools_lax_search_catalogue", gettext("LAX MODE: Failed to read the catalogue")); else return ret; } static void version_check(user_interaction & dialog, const header_version & ver) { if(ver.get_edition() > macro_tools_supported_version) dialog.pause(gettext("The format version of the archive is too high for that software version, try reading anyway?")); } infinint macro_tools_get_terminator_start(generic_file & f, const archive_version & reading_ver) { terminateur term; f.skip_to_eof(); term.read_catalogue(f, false, reading_ver); return term.get_catalogue_start(); } void macro_tools_create_layers(user_interaction & dialog, pile & layers, header_version & ver, slice_layout & slicing, const slice_layout *ref_slicing, memory_pool *pool, const entrepot & sauv_path_t, const string & filename, const string & extension, bool allow_over, bool warn_over, bool info_details, const infinint & pause, compression algo, U_I compression_level, const infinint & file_size, const infinint & first_file_size, const string & execute, crypto_algo crypto, const secu_string & pass, U_32 crypto_size, const vector & gnupg_recipients, const vector & gnupg_signatories, bool empty, const string & slice_permission, bool add_marks_for_sequential_reading, const string & user_comment, hash_algo hash, const infinint & slice_min_digits, const label & internal_name, const label & data_name, bool multi_threaded) { #if GPGME_SUPPORT U_I gnupg_key_size; #endif try { generic_file *tmp = nullptr; escape *esc = nullptr; bool force_permission = (slice_permission != ""); U_I permission = force_permission ? tools_octal2int(slice_permission) : 0; // 0 or anything else, this does not matter gf_mode open_mode = gf_read_write; // by default first layer is read-write except in case of hashing or encryption // read-write mode is used when skipping back due to file change, the escape layer needs to read the few // bytes before the backward position to take care of tape marks slicing.other_size = file_size; slicing.first_size = first_file_size; layers.clear(); secu_string real_pass = pass; if(hash != hash_none || crypto != crypto_none) open_mode = gf_write_only; try { bool writing_to_pipe = false; // note: // the escape object if present in the stack needs read access from below it when skipping backward // is requested (bad compression ration, changed filed at the time of backup, etc.) // ********** building the level 1 generic_file layer *********** // if(empty) { if(info_details) dialog.warning(gettext("Creating low layer: Writing archive into a black hole object (equivalent to /dev/null)...")); tmp = new (pool) null_file(open_mode); } else if(file_size.is_zero()) // one SLICE if(filename == "-") // output to stdout { if(info_details) dialog.warning(gettext("Creating low layer: Writing archive into standard output object...")); writing_to_pipe = true; tmp = macro_tools_open_archive_tuyau(dialog, pool, 1, gf_write_only, // always write only internal_name, data_name, false, execute); //archive goes to stdout } else { if(info_details) dialog.warning(gettext("Creating low layer: Writing archive into a plain file object...")); tmp = new (pool) trivial_sar(dialog, open_mode, filename, extension, sauv_path_t, // entrepot !! internal_name, data_name, execute, allow_over, warn_over, force_permission, permission, hash, slice_min_digits, false); } else { sar *tmp_sar = nullptr; if(info_details) dialog.warning(gettext("Creating low layer: Writing archive into a sar object (Segmentation and Reassembly) for slicing...")); tmp = tmp_sar = new (pool) sar(dialog, open_mode, filename, extension, file_size, first_file_size, warn_over, allow_over, pause, sauv_path_t, // entrepot !! internal_name, data_name, force_permission, permission, hash, slice_min_digits, false, execute); if(tmp_sar != nullptr) slicing = tmp_sar->get_slicing(); } if(tmp == nullptr) throw Ememory("op_create_in_sub"); else { layers.push(tmp); tmp = nullptr; } // ******** adding cache layer if writing to pipe in order to provide limited read/write mode ***** // if(writing_to_pipe) { if(info_details) dialog.warning(gettext("Adding cache layer over pipe to provide limited skippability...")); cache *c_tmp = new (pool) cache(*(layers.top()), true); if(c_tmp == nullptr) throw Ememory("op_create_in_sub"); else { tmp = c_tmp; // to handle the object destruction in case of exception if(open_mode == gf_read_write) c_tmp->change_to_read_write(); layers.push(c_tmp, LIBDAR_STACK_LABEL_CACHE_PIPE, true); tmp = nullptr; } } // ******** creating and writing down the archive header ******************* // ver.set_edition(macro_tools_supported_version); ver.set_compression_algo(algo); ver.set_command_line(user_comment); ver.set_sym_crypto_algo(crypto); ver.set_tape_marks(add_marks_for_sequential_reading); ver.set_signed(!gnupg_signatories.empty()); if(crypto != crypto_none || !gnupg_recipients.empty()) { if(!secu_string::is_string_secured()) dialog.warning(gettext("WARNING: support for secure memory was not available at compilation time, in case of heavy memory load, this may lead the password/passphrase provided to be wrote to disk (swap space) in clear. You have been warned!")); } if(!gnupg_recipients.empty()) { #if GPGME_SUPPORT memory_file *key = new (pool) memory_file(); if(key == nullptr) throw Ememory("macro_tools_create_layers"); try { // generating random key for symmetric encryption if(info_details) dialog.warning(gettext("Generating random key for symmetric encryption...")); switch(crypto) { case crypto_none: throw SRC_BUG; case crypto_scrambling: throw Erange("macro_tools_create_layers", gettext("Scrambling is a very weak encryption algorithm, this is a non-sens to use with asymmetric encryption")); break; case crypto_blowfish: case crypto_aes256: case crypto_twofish256: case crypto_serpent256: case crypto_camellia256: gnupg_key_size = tools_max(crypto_sym::max_key_len(crypto), crypto_sym::max_key_len_libdar(crypto)); break; default: throw SRC_BUG; } if(gnupg_key_size == 0) throw SRC_BUG; secu_memory_file clear(gnupg_key_size); clear.randomize(gnupg_key_size); U_I iter = 0; U_I next = 1; // checking the strength of the random key switch(crypto) { case crypto_none: throw SRC_BUG; case crypto_scrambling: break; case crypto_blowfish: case crypto_aes256: case crypto_twofish256: case crypto_serpent256: case crypto_camellia256: while(!crypto_sym::is_a_strong_password(crypto, clear.get_contents())) { clear.randomize(gnupg_key_size); ++iter; if(iter % next == 0) dialog.warning(tools_printf(gettext("For your information, this is the iteration %d for which the randomly generated key is reported to be weak by libgcrypt, continuing generating another random key... patience"), iter)); next *= 10; } if(iter > 1) dialog.warning(tools_printf(gettext("... A strong randomly generated key could be found after %d iteration(s)"), iter)); break; default: throw SRC_BUG; } if(info_details) dialog.warning(gettext("Key generated")); #ifdef LIBDAR_NO_OPTIMIZATION tools_secu_string_show(dialog, string("Generated key: "), clear.get_contents()); #endif // encrypting the symmetric key with asymetric algorithm crypto_asym engine(dialog); if(!gnupg_signatories.empty()) engine.set_signatories(gnupg_signatories); clear.skip(0); key->skip(0); if(clear.get_size().is_zero()) throw SRC_BUG; engine.encrypt(gnupg_recipients, clear, *key); real_pass = clear.get_contents(); if(real_pass.get_size() == 0) throw SRC_BUG; if(crypto == crypto_none) crypto = crypto_blowfish; ver.set_crypted_key(key); key = nullptr; // now the pointed to object is under the responsibility of ver object } catch(...) { if(key != nullptr) delete key; throw; } #else throw Ecompilation("Strong Encryption support"); #endif } // optaining a password on-fly if necessary if(crypto != crypto_none && real_pass.get_size() == 0) { secu_string t1 = dialog.get_secu_string(tools_printf(gettext("Archive %S requires a password: "), &filename), false); secu_string t2 = dialog.get_secu_string(gettext("Please confirm your password: "), false); if(t1 == t2) real_pass = t1; else throw Erange("op_create_in_sub", gettext("The two passwords are not identical. Aborting")); } if(ref_slicing != nullptr) { slice_layout *tmp = new (pool) slice_layout(*ref_slicing); if(tmp == nullptr) throw Ememory("macro_tools_create_layers"); try { ver.set_slice_layout(tmp); tmp = nullptr; // now tmp is managed by ver } catch(...) { if(tmp != nullptr) delete tmp; throw; } } else ver.clear_slice_layout(); // we drop the header at the beginning of the archive in any case (to be able to // know whether sequential reading is possible or not, and if sequential reading // is asked, be able to get the required parameter to read the archive. // It also serves of backup copy for normal reading if the end of the archive // is corrupted. if(info_details) dialog.warning(gettext("Writing down the archive header...")); ver.write(layers); // now we can add the initial offset in the archive_header datastructure, which will be written // a second time, but at the end of the archive. If we start reading the archive from the end // we must know where ended the initial archive header. ver.set_initial_offset(layers.get_position()); // ************ building the encryption layer if required ****** // switch(crypto) { case crypto_scrambling: if(info_details) dialog.warning(gettext("Adding a new layer on top: scrambler object...")); tmp = new (pool) scrambler(real_pass, *(layers.top())); #ifdef LIBDAR_NO_OPTIMIZATION tools_secu_string_show(dialog, string("real_pass used: "), real_pass); #endif break; case crypto_blowfish: case crypto_aes256: case crypto_twofish256: case crypto_serpent256: case crypto_camellia256: if(info_details) dialog.warning(gettext("Adding a new layer on top: Strong encryption object...")); tmp = new (pool) crypto_sym(crypto_size, real_pass, *(layers.top()), false, macro_tools_supported_version, crypto, gnupg_recipients.empty()); #ifdef LIBDAR_NO_OPTIMIZATION tools_secu_string_show(dialog, string("real_pass used: "), real_pass); #endif break; case crypto_none: if(!writing_to_pipe) { if(info_details) dialog.warning(gettext("Adding a new layer on top: Caching layer for better performances...")); tmp = new (pool) cache(*(layers.top()), false); } else tmp = nullptr; // a cache is already present just below break; default: throw SRC_BUG; // cryto value should have been checked before } if(!writing_to_pipe || crypto != crypto_none) { if(tmp == nullptr) throw Ememory("op_create_in_sub"); else { layers.push(tmp); tmp = nullptr; } #ifdef LIBTHREADAR_AVAILABLE // adding a generic_thread object in the stack for // a separated thread proceed to read/write to the object pushed on the stack if(multi_threaded && crypto != crypto_none) { if(info_details) dialog.warning(gettext("Creating a new thread to run the previously created layers...")); tmp = new (pool) generic_thread(layers.top()); if(tmp == nullptr) throw Ememory("op_create_in_sub"); layers.push(tmp); tmp = nullptr; } #endif } else { if(tmp != nullptr) throw SRC_BUG; } if(crypto != crypto_none) // initial elastic buffer { if(info_details) dialog.warning(gettext("Writing down the initial elastic buffer through the encryption layer...")); tools_add_elastic_buffer(layers, GLOBAL_ELASTIC_BUFFER_SIZE, 0, 0); } // ********** if required building the escape layer ***** // if(add_marks_for_sequential_reading) { set unjump; if(info_details) dialog.warning(gettext("Adding a new layer on top: Escape layer to allow sequential reading...")); unjump.insert(escape::seqt_catalogue); tmp = esc = new (pool) escape(layers.top(), unjump); if(tmp == nullptr) throw Ememory("op_create_in_sub"); else { layers.push(tmp); tmp = nullptr; #ifdef LIBTHREADAR_AVAILABLE // adding a generic_thread object in the stack for // a separated thread proceed to read/write to the object pushed on the stack if(multi_threaded) { if(info_details) dialog.warning(gettext("Creating a new thread to run the escape layer...")); tmp = new (pool) generic_thread(layers.top()); if(tmp == nullptr) throw Ememory("op_create_in_sub"); layers.push(tmp); tmp = nullptr; } #endif } } // ********** building the level2 layer (compression) ************************ // if(info_details && algo != none) dialog.warning(gettext("Adding a new layer on top: compression...")); tmp = new (pool) compressor(algo, *(layers.top()), compression_level); if(tmp == nullptr) throw Ememory("op_create_in_sub"); else { layers.push(tmp); tmp = nullptr; } #ifdef LIBTHREADAR_AVAILABLE // adding a generic_thread object in the stack for // a separated thread proceed to read/write to the object pushed on the stack if(multi_threaded && algo != none) { if(info_details) dialog.warning(gettext("Creating a new thread to run the compression layer...")); tmp = new (pool) generic_thread(layers.top()); if(tmp == nullptr) throw Ememory("op_create_in_sub"); layers.push(tmp); tmp = nullptr; } #endif if(info_details) dialog.warning(gettext("All layers have been created successfully")); } catch(...) { if(tmp != nullptr) { delete tmp; tmp = nullptr; } throw; } } catch(Erange &e) { string msg = string(gettext("Error creating archive layers: ")) + e.get_message(); throw Edata(msg); } } void macro_tools_close_layers(user_interaction & dialog, pile & layers, const header_version & ver, const catalogue & cat, bool info_details, crypto_algo crypto, compression algo, const vector & gnupg_recipients, const vector & gnupg_signatories, bool empty) { terminateur coord; pile_descriptor pdesc(&layers); tronconneuse *tronco_ptr = nullptr; scrambler *scram_ptr = nullptr; #ifdef LIBTHREADAR_AVAILABLE generic_thread *thread_ptr = nullptr; #endif memory_file *hash_to_sign = nullptr; tlv *signed_hash = nullptr; hash_fichier *hasher = nullptr; // ***************** sanity check ************************************** // if(!gnupg_signatories.empty() && gnupg_recipients.empty()) throw SRC_BUG; // cannot sign without encryption in the current implementation pdesc.check(false); // *********** flushing pending writes and reseting compressor ******** // if(pdesc.esc != nullptr) { layers.sync_write_above(pdesc.esc); // esc is now up to date pdesc.esc->add_mark_at_current_position(escape::seqt_catalogue); } else // still need to reset the compressor // in order to be able to read compressed data starting at that position pdesc.compr->sync_write(); // ********* if archive is signed adding a hash layer to get a hash of *// // *** the catalogue. This hash will then be signed and encrypted and *// // ** dropped as is just after the end of the catalogue */ try { if(!gnupg_signatories.empty()) { generic_to_global_file *global_hash_to_sign = nullptr; generic_to_global_file *global_layers = nullptr; hash_to_sign = new (nothrow) memory_file(); if(hash_to_sign == nullptr) throw Ememory("macro_tools_close_layers"); signed_hash = new (nothrow) tlv(); if(signed_hash == nullptr) throw Ememory("macro_tools_close_layers"); try { global_hash_to_sign = new (nothrow) generic_to_global_file(dialog, hash_to_sign, gf_write_only); global_layers = new (nothrow) generic_to_global_file(dialog, layers.top(), gf_write_only); if(global_hash_to_sign == nullptr || global_layers == nullptr) throw Ememory("macro_tools_close_layers"); hasher = new (nothrow) hash_fichier(dialog, global_layers, string("x"), global_hash_to_sign, hash_sha512); if(hasher == nullptr) throw Ememory("macro_tools_close_layers"); // at this stage, hasher has been built and now owns and // will destroy when no more needed both global_hash_to_sign // and global_layers } catch(...) { if(global_hash_to_sign != nullptr) delete global_hash_to_sign; if(global_layers != nullptr) delete global_layers; throw; } layers.push(hasher); pdesc = pile_descriptor(&layers); } // *********** writing down the catalogue of the archive *************** // coord.set_catalogue_start(layers.get_position()); if(info_details) dialog.warning(gettext("Writing down archive contents...")); cat.reset_dump(); cat.dump(pdesc); // removing the hash from the top of the stack now that the catalogue has been dropped // if(hasher != nullptr) { hasher->terminate(); // this drops the hash to hash_to_sign if(layers.top() != hasher) throw SRC_BUG; if(layers.pop() != hasher) throw SRC_BUG; pdesc = pile_descriptor(&layers); } // if signing is activated ... // if(!gnupg_signatories.empty()) { crypto_asym engine(dialog); if(info_details) dialog.warning(gettext("Calculating the signature of the catalogue hash...")); // ciphering and signing the hash of the catalogue // if(hash_to_sign == nullptr) throw SRC_BUG; else hash_to_sign->skip(0); if(signed_hash == nullptr) throw SRC_BUG; engine.set_signatories(gnupg_signatories); engine.encrypt(gnupg_recipients, *hash_to_sign, *signed_hash); // writing down the size of the hash followed by the hash // if(info_details) dialog.warning(gettext("Writing down the signed hash of the catalogue...")); signed_hash->dump(layers); } } catch(...) { if(hasher != nullptr) { if(layers.top() == hasher) { if(layers.pop() != hasher) throw SRC_BUG; pdesc = pile_descriptor(&layers); } delete hasher; hasher = nullptr; } if(signed_hash != nullptr) { delete signed_hash; signed_hash = nullptr; } if(hash_to_sign != nullptr) { delete hash_to_sign; hash_to_sign = nullptr; } throw; } if(hasher != nullptr) { delete hasher; hasher = nullptr; } if(signed_hash != nullptr) { delete signed_hash; signed_hash = nullptr; } if(hash_to_sign != nullptr) { delete hash_to_sign; hash_to_sign = nullptr; } // releasing the compression layer if(info_details && algo != none) dialog.warning(gettext("Closing the compression layer...")); #ifdef LIBTHREADAR_AVAILABLE (void)layers.pop_and_close_if_type_is(thread_ptr); #endif if(!layers.pop_and_close_if_type_is(pdesc.compr)) throw SRC_BUG; else pdesc.compr = nullptr; // releasing the escape layer if(pdesc.esc != nullptr) { if(info_details) dialog.warning(gettext("Closing the escape layer...")); #ifdef LIBTHREADAR_AVAILABLE (void)layers.pop_and_close_if_type_is(thread_ptr); #endif if(!layers.pop_and_close_if_type_is(pdesc.esc)) throw SRC_BUG; pdesc.esc = nullptr; } // *********** writing down the first terminator at the end of the archive *************** // #ifdef LIBTHREADAR_AVAILABLE // a generic_thread is only added over scrambler and crypto_sym, not when no crypto is used (void)layers.pop_and_close_if_type_is(thread_ptr); #endif tronco_ptr = dynamic_cast(layers.top()); scram_ptr = dynamic_cast(layers.top()); if(info_details) dialog.warning(gettext("Writing down the first archive terminator...")); coord.dump(layers); // since format "04" the terminateur is encrypted if(crypto != crypto_none) { if(info_details) dialog.warning(gettext("writing down the final elastic buffer through the encryption layer...")); // obtaining the crypto block size (for clear data) U_32 block_size = 0; if(tronco_ptr != nullptr) block_size = tronco_ptr->get_clear_block_size(); if(tronco_ptr == nullptr && scram_ptr == nullptr) throw SRC_BUG; // calculating the current offset modulo block_size U_32 offset = 0; if(block_size > 0) { infinint times = 0; infinint reste = 0; euclide(layers.get_position(), infinint(block_size), times, reste); reste.unstack(offset); if(!reste.is_zero()) throw SRC_BUG; } tools_add_elastic_buffer(layers, GLOBAL_ELASTIC_BUFFER_SIZE, block_size, offset); // terminal elastic buffer (after terminateur to protect against // plain text attack on the terminator string) } // releasing memory by calling destructors and releases file descriptors if(tronco_ptr != nullptr || scram_ptr != nullptr) { if(info_details) dialog.warning(gettext("Closing the encryption layer...")); } if(tronco_ptr != nullptr) tronco_ptr->write_end_of_file(); if(tronco_ptr != nullptr) { if(!layers.pop_and_close_if_type_is(tronco_ptr)) throw SRC_BUG; } if(scram_ptr != nullptr) { if(!layers.pop_and_close_if_type_is(scram_ptr)) throw SRC_BUG; } // *********** writing down the trailier_version with the second terminateur *************** // if(info_details) dialog.warning(gettext("Writing down archive trailer...")); coord.set_catalogue_start(layers.get_position()); ver.write(layers); if(info_details) dialog.warning(gettext("Writing down the second archive terminator...")); // due to the possibility a file get shorter after being resaved because it was modified at the // time it was read for backup, we must be sure the last terminator is well positionned at end of file layers.skip_to_eof(); coord.dump(layers); layers.sync_write(); // *********** closing the archive ******************** // if(info_details) dialog.warning(gettext("Closing archive low layer...")); layers.clear(); // closing all generic_files remaining in the layers if(info_details) dialog.warning(gettext("Archive is closed.")); } range macro_tools_get_slices(const cat_nomme *obj, slice_layout sl) { range slices; infinint offset; // used temporarily to record data, EA and FSA offsets infinint slice_num, slice_offset; infinint low; const cat_inode *tmp_inode = dynamic_cast(obj); const cat_file *tmp_file = dynamic_cast(obj); const cat_mirage *tmp_mir = dynamic_cast(obj); if(obj == nullptr) throw SRC_BUG; if(tmp_mir != nullptr) { tmp_inode = tmp_mir->get_inode(); tmp_file = dynamic_cast(tmp_inode); } if(tmp_inode != nullptr) { if(!sl.first_size.is_zero()) { if(tmp_inode->ea_get_saved_status() == cat_inode::ea_full) { if(tmp_inode->ea_get_offset(offset)) { sl.which_slice(offset, slice_num, slice_offset); low = slice_num; offset += tmp_inode->ea_get_size(); sl.which_slice(offset, slice_num, slice_offset); slices += range(low, slice_num); } else throw SRC_BUG; // has EA saved but no offset ?!? } if(tmp_inode->fsa_get_saved_status() == cat_inode::fsa_full) { if(tmp_inode->fsa_get_offset(offset)) { sl.which_slice(offset, slice_num, slice_offset); low = slice_num; offset += tmp_inode->fsa_get_size(); sl.which_slice(offset, slice_num, slice_offset); slices += range(low, slice_num); } else throw SRC_BUG; } } } if(tmp_file != nullptr) { if(tmp_file->get_saved_status() == s_saved) { offset = tmp_file->get_offset(); sl.which_slice(offset, slice_num, slice_offset); low = slice_num; offset += tmp_file->get_storage_size(); sl.which_slice(offset, slice_num, slice_offset); slices += range(low, slice_num); } } return slices; } trivial_sar *macro_tools_open_archive_tuyau(user_interaction & dialog, memory_pool *pool, S_I fd, gf_mode mode, const label & internal_name, const label & data_name, bool slice_header_format_07, const std::string & execute) { generic_file *tmp = nullptr; trivial_sar *ret = nullptr; try { tmp = new (pool) tuyau(dialog, fd, mode); if(tmp == nullptr) throw Ememory("macro_tools_open_archive_tuyau"); ret = new (pool) trivial_sar(dialog, tmp, internal_name, data_name, slice_header_format_07, execute); if(ret == nullptr) throw Ememory("macro_tools_open_archive_tuyau"); else tmp = nullptr; } catch(...) { if(ret != nullptr) delete ret; if(tmp != nullptr) delete tmp; throw; } return ret; } } // end of namespace dar-2.5.3/src/libdar/entrepot.cpp0000644000175000017430000000720312641772777013630 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ // $Id: entrepot.cpp,v 1.1 2012/04/27 11:24:30 edrusb Exp $ // /*********************************************************************/ #include "../my_config.h" #include extern "C" { #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_UNISTD_H #include #endif } // end extern "C" #include "entrepot.hpp" #include "cygwin_adapt.hpp" #include "tools.hpp" using namespace std; namespace libdar { entrepot::entrepot(): where("/"), root("/") { user = ""; group = ""; } void entrepot::set_location(const path & chemin) { if(where != chemin) { read_dir_flush(); where = chemin; } } path entrepot::get_full_path() const { if(get_location().is_relative()) return get_root() + get_location(); else return get_location(); } fichier_global *entrepot::open(user_interaction & dialog, const std::string & filename, gf_mode mode, bool force_permission, U_I permission, bool fail_if_exists, bool erase, hash_algo algo) const { fichier_global *ret = nullptr; // sanity check if(algo != hash_none && (mode != gf_write_only || (!erase && !fail_if_exists))) throw SRC_BUG; // if hashing is asked, we cannot accept to open an existing file without erasing its contents // creating the file to write data to ret = inherited_open(dialog, filename, mode, force_permission, permission, fail_if_exists, erase); if(ret == nullptr) throw SRC_BUG; try { if(algo != hash_none) { fichier_global *hash_file = nullptr; fichier_global *tmp = nullptr; // creating the file to write hash to try { hash_file = inherited_open(dialog, filename+"."+hash_algo_to_string(algo), gf_write_only, force_permission, permission, fail_if_exists, erase); if(hash_file == nullptr) throw SRC_BUG; try { tmp = new (get_pool()) hash_fichier(dialog, ret, filename, hash_file, algo); if(tmp == nullptr) throw Ememory("entrepot::entrepot"); else { ret = tmp; hash_file = nullptr; } } catch(...) { if(hash_file != nullptr) delete hash_file; throw; } } catch(Egeneric & e) { e.prepend_message(gettext("Error met while creating the hash file: ")); throw; } } } catch(...) { if(ret != nullptr) { delete ret; ret = nullptr; } throw; } return ret; } } // end of namespace dar-2.5.3/src/libdar/tlv.cpp0000644000175000017430000000334612641773000012555 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_NETINET_IN_H #include #endif } #include "tlv.hpp" using namespace std; namespace libdar { void tlv::dump(generic_file & f) const { U_16 tmp; tlv *me = const_cast(this); if(me == nullptr) throw SRC_BUG; tmp = htons(type); f.write((char *)&tmp, 2); size().dump(f); me->skip(0); me->copy_to(f); } void tlv::setup(generic_file & f) { init(f); } void tlv::init(generic_file & f) { infinint length; f.read((char *)&type, 2); type = ntohs(type); length.read(f); reset(); if(f.copy_to(*this, length) != length) throw Erange("tlv::init",gettext("Missing data to initiate a TLV object")); } } // end of namespace dar-2.5.3/src/libdar/generic_file_overlay_for_gpgme.hpp0000644000175000017430000000471512641772777020203 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file generic_file_overlay_for_gpgme.hpp /// \brief adaptation class from gpgme data buffer to libdar generic_file interface /// \ingroup Private #ifndef GENERIC_FILE_VERLAY_FOR_GPGME_HPP #define GENERIC_FILE_VERLAY_FOR_GPGME_HPP extern "C" { #if HAVE_GPGME_H #include #endif } #include "../my_config.h" #include "generic_file.hpp" #include "on_pool.hpp" namespace libdar { /// \ingroup Private /// @} class generic_file_overlay_for_gpgme : public on_pool { public: /// create a gpgme data buffer of the given generic_file /// /// \param[in] f is a pointer to an existing generic_file that must exist during the whole live of this overlay object generic_file_overlay_for_gpgme(generic_file *f); /// no copy constructor allowed generic_file_overlay_for_gpgme(const generic_file_overlay_for_gpgme & ref) { throw SRC_BUG; }; /// no asignment operator const generic_file_overlay_for_gpgme operator = (const generic_file_overlay_for_gpgme & ref) { throw SRC_BUG; }; #ifdef GPGME_SUPPORT /// destructor ~generic_file_overlay_for_gpgme() { gpgme_data_release(handle); }; /// return the handle to be used by gpgme to drive the generic_file given at constructor time gpgme_data_t get_gpgme_handle() const { return handle; }; generic_file *get_below() { return below; }; private: generic_file *below; gpgme_data_t handle; gpgme_data_cbs cbs; #endif }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_chardev.cpp0000644000175000017430000000262012641772777014231 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_chardev.hpp" using namespace std; namespace libdar { bool cat_chardev::operator == (const cat_entree & ref) const { const cat_chardev *ref_chardev = dynamic_cast(&ref); if(ref_chardev == nullptr) return false; else return cat_device::operator == (ref); } } // end of namespace dar-2.5.3/src/libdar/memory_check.hpp0000644000175000017430000000350012641772777014436 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #ifndef MEMORY_CHECK_HPP #define MEMORY_CHECK_HPP #include "../my_config.h" // this module redefines the two global operators new and delete // no need to include this header anywhere as these operators will // be used in any case as replacement of the default ones /// adds dump of currently allocated blocks to the debug_memory_output extern void memory_check_snapshot(); /// log special_alloc_operations extern void memory_check_special_report_new(const void *ptr, unsigned long taille); extern void memory_check_special_report_delete(const void *ptr); extern void memory_check_special_new_sized(unsigned long taille); #else #define memory_check_snapshot(null) #define memory_check_special_report_new(ptr, taille) #define memory_check_special_report_delete(ptr) #define memory_check_special_new_sized(taille) #endif dar-2.5.3/src/libdar/memory_check.cpp0000644000175000017430000001452212641772777014437 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "erreurs.hpp" #include "memory_check.hpp" #ifdef LIBDAR_DEBUG_MEMORY extern "C" { #include #include } #define DEBUG_MEM_OUTPUT_FILE "/tmp/dar_debug_mem_allocation.txt" #define DEBUG_MEM_SIZE 10240000 using namespace std; // for output flow using namespace libdar; // required to use SRC_BUG struct debug_mem { void *ptr; size_t size; }; static bool debug_mem_initialized = false; //< whether module has been initialized static debug_mem debug_mem_alloc[DEBUG_MEM_SIZE]; //< stores all current memory allocation requests static long long debug_mem_next = 0; //< pointer to the next most probable place to find an free slot static long long debug_mem_allocated = 0, debug_mem_max_allocated = 0, debug_mem_block = 0, debug_mem_max_block = 0; static FILE *debug_mem_output = nullptr; #define ERROR(MSG) debug_mem_error(__FILE__, __LINE__, MSG) static void debug_mem_error(const char *file, unsigned int line, const char *msg) { fprintf(stderr, "DEBUG MEMORY ERROR: File %s line %u : %s\n", file, line, msg); exit(1); } static void debug_mem_init() { // here we user C i/o calls to stay independent of the new/delete C++ operator for(long long i = 0; i < DEBUG_MEM_SIZE; ++i) { debug_mem_alloc[i].ptr = nullptr; debug_mem_alloc[i].size = 0; } debug_mem_output = fopen(DEBUG_MEM_OUTPUT_FILE, "w"); if(debug_mem_output == nullptr) ERROR("failed openning output file to log debug memory events"); debug_mem_initialized = true; } static long long debug_mem_find_free_slot() { long long ret = debug_mem_next; while(ret < DEBUG_MEM_SIZE && debug_mem_alloc[ret].ptr != nullptr) ++ret; if(ret >= DEBUG_MEM_SIZE) ret = 0; while(ret < DEBUG_MEM_SIZE && debug_mem_alloc[ret].ptr != nullptr) ++ret; if(ret < DEBUG_MEM_SIZE) debug_mem_next = ret + 1; else ERROR("Cannot handle that many blocks, need an increase of the table size in memory_check module"); return ret; } static long long debug_mem_find_slot(void *ptr) { long long ret = 0; while(ret < DEBUG_MEM_SIZE && debug_mem_alloc[ret].ptr != ptr) ++ret; if(ret >= DEBUG_MEM_SIZE) ERROR("unknown memory block asked to be released"); return ret; } static void debug_mem_report(void *ptr, const char *msg) { static long long openum = 0; fprintf(debug_mem_output, "[%04lld %s %p | %lld currently allocated blocks (max = %lld). Total size = %lld bytes (max reached so far = %lld bytes)\n", ++openum, msg, ptr, debug_mem_block, debug_mem_max_block, debug_mem_allocated, debug_mem_max_allocated); } static void *alloc(size_t size) { void *ret = malloc(size); if(ret != nullptr) { long long slot; if(!debug_mem_initialized) debug_mem_init(); // recording new entry in the map slot = debug_mem_find_free_slot(); debug_mem_alloc[slot].size = size; debug_mem_alloc[slot].ptr = ret; // computing current and max allocated space debug_mem_allocated += size; if(debug_mem_allocated > debug_mem_max_allocated) debug_mem_max_allocated = debug_mem_allocated; ++debug_mem_block; if(debug_mem_block > debug_mem_max_block) debug_mem_max_block = debug_mem_block; debug_mem_report(ret, "NEW"); } return ret; } void desalloc(void *p) { long long slot = debug_mem_find_slot(p); debug_mem_allocated -= debug_mem_alloc[slot].size; --debug_mem_block; debug_mem_alloc[slot].ptr = nullptr; debug_mem_alloc[slot].size = 0; free(p); debug_mem_report(p, "DEL"); } void * operator new (size_t size) throw (std::bad_alloc) { void *ret = alloc(size); if(ret == nullptr) throw std::bad_alloc(); return ret; } void * operator new (size_t size, const std::nothrow_t& nothrow_constant) throw () { return alloc(size); } void * operator new[] (size_t size) throw (std::bad_alloc) { void *ret = alloc(size); if(ret == nullptr) throw std::bad_alloc(); return ret; } void * operator new[] (size_t size, const std::nothrow_t& nothrow_constant) throw () { return alloc(size); } void operator delete (void * p) throw() { desalloc(p); } void operator delete (void * p, const std::nothrow_t& nothrow_constant) throw() { desalloc(p); } void operator delete[] (void * p) throw() { desalloc(p); } void operator delete[] (void * p, const std::nothrow_t& nothrow_constant) throw() { desalloc(p); } #endif void memory_check_snapshot() { #ifdef LIBDAR_DEBUG_MEMORY long long curs = 0; fprintf(debug_mem_output, "DUMP START OF THE CURRENT ALLOCATED BLOCKS\n"); while(curs < DEBUG_MEM_SIZE) { if(debug_mem_alloc[curs].ptr != nullptr) fprintf(debug_mem_output, "address = %p size = %ld\n", debug_mem_alloc[curs].ptr, debug_mem_alloc[curs].size); ++curs; } fprintf(debug_mem_output, "DUMP end OF THE CURRENT ALLOCATED BLOCKS\n"); #endif } void memory_check_special_report_new(const void *ptr, unsigned long taille) { #ifdef LIBDAR_DEBUG_MEMORY fprintf(debug_mem_output, "SPECIAL NEW: %p\t size = %ld\n", ptr, taille); #endif } void memory_check_special_report_delete(const void *ptr) { #ifdef LIBDAR_DEBUG_MEMORY fprintf(debug_mem_output, "SPECIAL DEL: %p\n", ptr); #endif } void memory_check_special_new_sized(unsigned long size) { #ifdef LIBDAR_DEBUG_MEMORY fprintf(debug_mem_output, "SPECIAL SIZED created: %ld\n",size); #endif } dar-2.5.3/src/libdar/mem_allocator.cpp0000644000175000017430000000217112641772777014605 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "mem_allocator.hpp" using namespace std; namespace libdar { } // end of namespace dar-2.5.3/src/libdar/tronc.hpp0000644000175000017430000001200212641773000013067 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file tronc.hpp /// \brief defines a limited segment over another generic_file. /// \ingroup Private /// /// This is used to read a part of a file as if it was a real file generating /// end of file behavior when reaching the given length. #ifndef TRONC_HPP #define TRONC_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" namespace libdar { /// \addtogroup Private /// @{ /// makes a segment of a generic_file appear like a real generic_file class tronc : public generic_file { public : /// constructor //! \param f is the file to take the segment from //! \param offset is the position of the beginning of the segment //! \param size is the size of the segment //! \param own_f is true if this object has to owns and may destroy the 'f' object at tronc's destruction time tronc(generic_file *f, const infinint &offset, const infinint &size, bool own_f = false); tronc(generic_file *f, const infinint &offset, const infinint &size, gf_mode mode, bool own_f = false); /// other constructor, the end of the segment is the end of the underlying generic_file /// only data before offset is inaccessible tronc(generic_file *f, const infinint &offset, bool own_f = false); tronc(generic_file *f, const infinint &offset, gf_mode mode, bool own_f = false); /// destructor ~tronc() { if(own_ref) delete ref; }; /// modify the tronc object to zoom on another (size limited) portion of the underlying object void modify(const infinint & new_offset, const infinint & new_size); /// modify the tronc object to zoom on another (size unlimited) portion of the underlying object void modify(const infinint & new_offset); /// modify the tronc object to become transparent and allow unrestricted access to the underlyuing object void modify() { modify(0); }; /// inherited from generic_file bool skippable(skippability direction, const infinint & amount); /// inherited from generic_file bool skip(const infinint & pos); /// inherited from generic_file bool skip_to_eof(); /// inherited from generic_file bool skip_relative(S_I x); /// inherited from generic_file infinint get_position() const { return current; }; /// when a tronc is used over a compressor, it becomes necessary to disable position check /// /// \note by default, before each read or write, the tronc object check that the underlying /// object is at adhoc position in regard to where the cursor is currently in the tronc. Disabling /// that check let ignore possible position mismatch (which are normal when a compressor is found below) /// while reading or writing but keep seeking the underlying object to the requested position upon any call /// to tronc::skip_* familly methods. void check_underlying_position_while_reading_or_writing(bool mode) { check_pos = mode ; }; protected : /// inherited from generic_file void inherited_read_ahead(const infinint & amount); /// inherited from generic_file U_I inherited_read(char *a, U_I size); /// inherited from generic_file void inherited_write(const char *a, U_I size); void inherited_sync_write() { ref->sync_write(); } void inherited_flush_read() {}; void inherited_terminate() {if(own_ref) ref->terminate(); }; private : infinint start; //< offset in the global generic file to start at infinint sz; //< length of the portion to consider generic_file *ref; //< global generic file of which to take a piece infinint current; //< inside position of the next read or write bool own_ref; //< whether we own ref (and must destroy it when no more needed) bool limited; //< whether the sz argument is to be considered bool check_pos; //< whether to check and eventually adjust (seek) the position of the underlying layer at each read or write void set_back_current_position(); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/filesystem.cpp0000644000175000017430000022115512642474445014150 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_ERRNO_H #include #endif #if HAVE_TIME_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_SYS_TYPE_H #include #endif #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_SYS_UN_H #include #endif #if HAVE_UNISTD_H #include #endif #if STDC_HEADERS #include #endif #ifdef LIBDAR_NODUMP_FEATURE #if HAVE_SYS_IOCTL_H #include #endif #if LIBDAR_NODUMP_FEATURE == NODUMP_LINUX #include #else #if LIBDAR_NODUMP_FEATURE == NODUMP_EXT2FS #include #else #error "unknown location of ext2_fs.h include file" #endif #endif #endif #if MAJOR_IN_MKDEV #include #if !defined(makedev) && defined(mkdev) #define makedev(a,b) mkdev((a),(b)) #endif #else #if MAJOR_IN_SYSMACROS #include #endif #endif } // end extern "C" #include #include "filesystem.hpp" #include "tools.hpp" #include "erreurs.hpp" #include "user_interaction.hpp" #include "cat_all_entrees.hpp" #include "ea_filesystem.hpp" #include "cygwin_adapt.hpp" #include "fichier_local.hpp" #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX 104 #endif using namespace std; namespace libdar { static void supprime(user_interaction & ui, const string & ref); static void make_owner_perm(user_interaction & dialog, const cat_inode & ref, const string & chem, bool dir_perm, cat_inode::comparison_fields what_to_check, const fsa_scope & scope); static void make_date(const cat_inode & ref, const string & chem, cat_inode::comparison_fields what_to_check, const fsa_scope & scope); static void attach_ea(const string &chemin, cat_inode *ino, const mask & ea_mask, memory_pool *pool); static bool is_nodump_flag_set(user_interaction & dialog, const path & chem, const string & filename, bool info); static path *get_root_with_symlink(user_interaction & dialog, const path & root, bool info_details, memory_pool *pool); static mode_t get_file_permission(const string & path); /////////////////////////////////////////////////////////////////// ///////////////// filesystem_hard_link_read methods /////////////// /////////////////////////////////////////////////////////////////// cat_nomme *filesystem_hard_link_read::make_read_entree(path & lieu, const string & name, bool see_hard_link, const mask & ea_mask) { const string display = name.empty() ? lieu.display() : (lieu + path(name)).display(); const char *ptr_name = display.c_str(); cat_nomme *ref = nullptr; struct stat buf; string tmp; try { if(lstat(ptr_name, &buf) < 0) { switch(errno) { case EACCES: tmp = tools_strerror_r(errno); get_ui().warning(tools_printf(gettext("Error reading inode of file %s : %s"), ptr_name, tmp.c_str())); break; case ENOENT: if(display.size() >= PATH_MAX || name.size() >= NAME_MAX) get_ui().warning(tools_printf(gettext("Failed reading inode information for %s: "), ptr_name) + tools_strerror_r(errno)); // Cygwin may return shorter name than expected using readdir (see class etage) which // leads the file to be truncated, and thus when we here fetch inode information // we get file non existent error. In that situation this is not the case of a // file that has been removed between the time we read the directory content and the // time here we read inode details, so we issue a warning in that situation break; default: throw Erange("filesystem_hard_link_read::make_read_entree", string(gettext("Cannot read inode for ")) + ptr_name + " : " + tools_strerror_r(errno)); } // the current method returns nullptr (= ref) (meaning file does not exists) } else { #ifdef LIBDAR_MICROSECOND_READ_ACCURACY datetime atime = datetime(buf.st_atim.tv_sec, buf.st_atim.tv_nsec, datetime::tu_nanosecond); datetime mtime = datetime(buf.st_mtim.tv_sec, buf.st_mtim.tv_nsec, datetime::tu_nanosecond); datetime ctime = datetime(buf.st_ctim.tv_sec, buf.st_ctim.tv_nsec, datetime::tu_nanosecond); if(atime.is_null()) atime = datetime(buf.st_atime, 0, datetime::tu_second); if(mtime.is_null()) mtime = datetime(buf.st_mtime, 0, datetime::tu_second); if(ctime.is_null()) ctime = datetime(buf.st_ctime, 0, datetime::tu_second); #else datetime atime = datetime(buf.st_atime, 0, datetime::tu_second); datetime mtime = datetime(buf.st_mtime, 0, datetime::tu_second); datetime ctime = datetime(buf.st_ctime, 0, datetime::tu_second); #endif if(S_ISLNK(buf.st_mode)) { string pointed = tools_readlink(ptr_name); ref = new (get_pool()) cat_lien(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, pointed, buf.st_dev); } else if(S_ISREG(buf.st_mode)) ref = new (get_pool()) cat_file(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, lieu, buf.st_size, buf.st_dev, furtive_read_mode); else if(S_ISDIR(buf.st_mode)) ref = new (get_pool()) cat_directory(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, buf.st_dev); else if(S_ISCHR(buf.st_mode)) ref = new (get_pool()) cat_chardev(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, major(buf.st_rdev), minor(buf.st_rdev), // makedev(major, minor) buf.st_dev); else if(S_ISBLK(buf.st_mode)) ref = new (get_pool()) cat_blockdev(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, major(buf.st_rdev), minor(buf.st_rdev), // makedev(major, minor) buf.st_dev); else if(S_ISFIFO(buf.st_mode)) ref = new (get_pool()) cat_tube(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, buf.st_dev); else if(S_ISSOCK(buf.st_mode)) ref = new (get_pool()) cat_prise(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, buf.st_dev); #if HAVE_DOOR else if(S_ISDOOR(buf.st_mode)) ref = new (get_pool()) door(buf.st_uid, buf.st_gid, buf.st_mode & 07777, atime, mtime, ctime, name, lieu, buf.st_dev); #endif else throw Edata(string(gettext("Unknown file type! file name is: ")) + string(ptr_name)); cat_inode *ino = dynamic_cast(ref); if(ino != nullptr) { // // Extended Attributes Considerations // try { attach_ea(ptr_name, ino, ea_mask, get_pool()); } catch(Ebug & e) { throw; } catch(Euser_abort & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Ememory & e) { throw; } catch(Egeneric & ex) { get_ui().warning(string(gettext("Error reading EA for "))+ptr_name+ " : " + ex.get_message()); // no throw ! // we must be able to continue without EA } // // Filesystem Specific Attributes Considerations // filesystem_specific_attribute_list *fsal = new (get_pool()) filesystem_specific_attribute_list(); if(fsal == nullptr) throw Ememory("filesystem_hard_link_read::make_entree"); try { fsal->get_fsa_from_filesystem_for(display, sc, buf.st_mode); if(!fsal->empty()) { ino->fsa_set_saved_status(cat_inode::fsa_full); ino->fsa_attach(fsal); fsal = nullptr; // now managed by *ino } else { ino->fsa_set_saved_status(cat_inode::fsa_none); delete fsal; fsal = nullptr; } } catch(...) { if(fsal != nullptr) delete fsal; throw; } } // // hard link detection // if(ref == nullptr) throw Ememory("filesystem_hard_link_read::make_read_entree"); if(buf.st_nlink > 1 && see_hard_link && dynamic_cast(ref) == nullptr) { map::iterator it = corres_read.find(node(buf.st_ino, buf.st_dev)); if(it == corres_read.end()) // inode not yet seen, creating the cat_etoile object { cat_inode *ino_ref = dynamic_cast(ref); cat_etoile *tmp_et = nullptr; if(ino_ref == nullptr) throw SRC_BUG; tmp_et = new (get_pool()) cat_etoile(ino_ref, etiquette_counter++); if(tmp_et == nullptr) throw Ememory("filesystem_hard_link_read::make_read_entree"); try { ref = nullptr; // the object pointed to by ref is now managed by tmp_et couple tmp = couple(tmp_et, buf.st_nlink - 1); pair p_tmp(node(buf.st_ino, buf.st_dev), tmp); corres_read.insert(p_tmp); it = corres_read.find(node(buf.st_ino,buf.st_dev)); if(it == corres_read.end()) throw SRC_BUG; // the addition of the entry to the map failed !!! else it->second.obj->get_inode()->change_name(""); // name of inode attached to an cat_etoile is not used so we don't want to waste space in this field. } catch(...) { if(tmp_et != nullptr) delete tmp_et; throw; } ref = new (get_pool()) cat_mirage(name, tmp_et); } else // inode already seen creating a new cat_mirage on the given cat_etoile { // some sanity checks if(it->second.obj == nullptr) throw SRC_BUG; if(ref != nullptr) delete ref; // we don't need this just created inode as it is already attached to the cat_etoile object ref = new (get_pool()) cat_mirage(name, it->second.obj); if(ref != nullptr) { it->second.count--; if(it->second.count == 0) corres_read.erase(it); // this deletes the couple entry, implying the release of memory used by the holder object, but the cat_etoile will only be destroyed once its internal counter drops to zero } } } if(ref == nullptr) throw Ememory("filesystem_hard_link_read::make_read_entree"); } } catch(...) { if(ref != nullptr) { delete ref; ref = nullptr; } throw; } return ref; } /////////////////////////////////////////////////////////////////// ///////////////// filesystem_backup methods /////////////////////// /////////////////////////////////////////////////////////////////// filesystem_backup::filesystem_backup(user_interaction & dialog, const path &root, bool x_info_details, const mask & x_ea_mask, bool check_no_dump_flag, bool x_alter_atime, bool x_furtive_read_mode, bool x_cache_directory_tagging, infinint & root_fs_device, bool x_ignore_unknown, const fsa_scope & scope) : mem_ui(&dialog), filesystem_hard_link_read(dialog, x_furtive_read_mode, scope) { fs_root = nullptr; current_dir = nullptr; ea_mask = nullptr; try { fs_root = get_root_with_symlink(get_ui(), root, x_info_details, get_pool()); if(fs_root == nullptr) throw Ememory("filesystem_backup::filesystem_backup"); info_details = x_info_details; no_dump_check = check_no_dump_flag; alter_atime = x_alter_atime; furtive_read_mode = x_furtive_read_mode; cache_directory_tagging = x_cache_directory_tagging; current_dir = nullptr; ignore_unknown = x_ignore_unknown; ea_mask = x_ea_mask.clone(); if(ea_mask == nullptr) throw Ememory("filesystem_backup::filesystem_backup"); reset_read(root_fs_device); } catch(...) { detruire(); throw; } } void filesystem_backup::detruire() { if(fs_root != nullptr) { delete fs_root; fs_root = nullptr; } if(current_dir != nullptr) { delete current_dir; current_dir = nullptr; } if(ea_mask != nullptr) { delete ea_mask; ea_mask = nullptr; } } void filesystem_backup::copy_from(const filesystem_backup & ref) { const filesystem_hard_link_read *proto_ref = &ref; filesystem_hard_link_read *proto_me = this; *proto_me = *proto_ref; // invoke the copy from parent class fs_root = nullptr; current_dir = nullptr; ea_mask = nullptr; try { if(ref.fs_root != nullptr) { fs_root = new (get_pool()) path(*ref.fs_root); if(fs_root == nullptr) throw Ememory("filesystem_backup::copy_from"); } else fs_root = nullptr; if(ref.current_dir != nullptr) { current_dir = new (get_pool()) path(*ref.current_dir); if(current_dir == nullptr) throw Ememory("filesystem_backup::copy_from"); } else current_dir = nullptr; info_details = ref.info_details; ea_mask = ref.ea_mask->clone(); if(ea_mask == nullptr) throw Ememory("filesystem_backup::copy_from"); no_dump_check = ref.no_dump_check; alter_atime = ref.alter_atime; furtive_read_mode = ref.furtive_read_mode; cache_directory_tagging = ref.cache_directory_tagging; pile = ref.pile; ignore_unknown = ref.ignore_unknown; } catch(...) { detruire(); throw; } } void filesystem_backup::reset_read(infinint & root_fs_device) { corres_reset(); if(current_dir != nullptr) delete current_dir; current_dir = new (get_pool()) path(*fs_root); if(current_dir == nullptr) throw Ememory("filesystem_backup::reset_read"); pile.clear(); const string display = current_dir->display(); const char* tmp = display.c_str(); cat_entree *ref = make_read_entree(*current_dir, "", true, *ea_mask); cat_directory *ref_dir = dynamic_cast(ref); try { if(ref_dir != nullptr) { pile.push_back(etage(get_ui(), tmp, ref_dir->get_last_access(), ref_dir->get_last_modif(), cache_directory_tagging, furtive_read_mode)); root_fs_device = ref_dir->get_device(); } else if(ref == nullptr) throw Erange("filesystem_backup::reset_read", string(gettext("Non existent file: ")) + tmp); else throw Erange("filesystem_backup::reset_read", string(gettext("File must be a directory: "))+ tmp); } catch(...) { if(ref != nullptr) delete ref; throw; } if(ref != nullptr) delete ref; } bool filesystem_backup::read(cat_entree * & ref, infinint & errors, infinint & skipped_dump) { bool once_again; ref = nullptr; errors = 0; skipped_dump = 0; if(current_dir == nullptr) throw SRC_BUG; // constructor not called or badly implemented. do { once_again = false; if(pile.empty()) return false; // end of filesystem reading else // at least one directory to read { etage & inner = pile.back(); string name; if(!inner.read(name)) { string tmp; if(!alter_atime && !furtive_read_mode) tools_noexcept_make_date(current_dir->display(), false, inner.last_acc, inner.last_mod, inner.last_mod); pile.pop_back(); if(pile.empty()) return false; // end of filesystem else { if(! current_dir->pop(tmp)) throw SRC_BUG; ref = new (get_pool()) cat_eod(); } } else // could read a filename in directory { try { // checking the EXT2 nodump flag (if set ignoring the file) if(!no_dump_check || !is_nodump_flag_set(get_ui(), *current_dir, name, info_details)) { ref = make_read_entree(*current_dir, name, true, *ea_mask); try { cat_directory *ref_dir = dynamic_cast(ref); if(ref_dir != nullptr) { *current_dir += name; const string display = current_dir->display(); const char* ptr_name = display.c_str(); try { pile.push_back(etage(get_ui(), ptr_name, ref_dir->get_last_access(), ref_dir->get_last_modif(), cache_directory_tagging, furtive_read_mode)); } catch(Egeneric & e) { string tmp; get_ui().warning(tools_printf(gettext("Cannot read directory contents: %s : "), ptr_name) + e.get_message()); try { pile.push_back(etage()); } catch(Egeneric & e) { delete ref; ref = nullptr; // we ignore this directory and skip to the next entry errors++; if(! current_dir->pop(tmp)) throw SRC_BUG; } } } if(ref == nullptr) once_again = true; // the file has been removed between the time // the directory has been openned, and the time // we try to read it, so we ignore it. // this case is silently ignored and not counted } catch(...) { if(ref != nullptr) { delete ref; ref = nullptr; } throw; } } else // EXT2 nodump flag is set, and we must not consider such file for backup { if(info_details) get_ui().warning(string(gettext("Ignoring file with NODUMP flag set: ")) + (*current_dir + name).display()); skipped_dump++; once_again = true; } } catch(Edata & e) { if(!ignore_unknown) get_ui().warning(string(gettext("Error reading directory contents: ")) + e.get_message() + gettext(" . Ignoring file or directory")); once_again = true; } catch(Erange & e) { get_ui().warning(string(gettext("Error reading directory contents: ")) + e.get_message() + gettext(" . Ignoring file or directory")); once_again = true; errors++; } } } } while(once_again); if(ref == nullptr) throw Ememory("filesystem_backup::read"); else return true; } void filesystem_backup::skip_read_to_parent_dir() { string tmp; if(pile.empty()) throw SRC_BUG; else { if(!alter_atime && !furtive_read_mode) tools_noexcept_make_date(current_dir->display(), false, pile.back().last_acc, pile.back().last_mod, pile.back().last_mod); pile.pop_back(); } if(! current_dir->pop(tmp)) throw SRC_BUG; } /////////////////////////////////////////////////////////////////// ////////////////// filesystem_diff methods /////////////////////// /////////////////////////////////////////////////////////////////// filesystem_diff::filesystem_diff(user_interaction & dialog, const path &root, bool x_info_details, const mask & x_ea_mask, bool x_alter_atime, bool x_furtive_read_mode, const fsa_scope & scope) : mem_ui(&dialog), filesystem_hard_link_read(dialog, x_furtive_read_mode, scope) { fs_root = nullptr; ea_mask = nullptr; current_dir = nullptr; try { fs_root = get_root_with_symlink(get_ui(), root, x_info_details, get_pool()); if(fs_root == nullptr) throw Ememory("filesystem_diff::filesystem_diff"); info_details = x_info_details; ea_mask = x_ea_mask.clone(); if(ea_mask == nullptr) throw Ememory("filesystem_diff::filesystem_diff"); alter_atime = x_alter_atime; furtive_read_mode = x_furtive_read_mode; current_dir = nullptr; reset_read(); } catch(...) { detruire(); throw; } } void filesystem_diff::reset_read() { corres_reset(); if(current_dir != nullptr) delete current_dir; current_dir = new (get_pool()) path(*fs_root); filename_pile.clear(); if(current_dir == nullptr) throw Ememory("filesystem_diff::reset_read"); const string display = current_dir->display(); const char* tmp = display.c_str(); cat_entree *ref = make_read_entree(*current_dir, "", true, *ea_mask); cat_directory *ref_dir = dynamic_cast(ref); try { if(ref_dir != nullptr) { filename_struct rfst; rfst.last_acc = ref_dir->get_last_access(); rfst.last_mod = ref_dir->get_last_modif(); filename_pile.push_back(rfst); } else if(ref == nullptr) throw Erange("filesystem_diff::reset_read", string(gettext("Non existent file: ")) + tmp); else throw Erange("filesystem_diff::reset_read", string(gettext("File must be a directory: ")) + tmp); } catch(...) { if(ref != nullptr) delete ref; throw; } if(ref != nullptr) delete ref; } bool filesystem_diff::read_filename(const string & name, cat_nomme * &ref) { cat_directory *ref_dir = nullptr; if(current_dir == nullptr) throw SRC_BUG; ref = make_read_entree(*current_dir, name, false, *ea_mask); if(ref == nullptr) return false; // no file of that name else { ref_dir = dynamic_cast(ref); if(ref_dir != nullptr) { filename_struct rfst; rfst.last_acc = ref_dir->get_last_access(); rfst.last_mod = ref_dir->get_last_modif(); filename_pile.push_back(rfst); *current_dir += ref_dir->get_name(); } return true; } } void filesystem_diff::skip_read_filename_in_parent_dir() { if(filename_pile.empty()) throw SRC_BUG; string tmp; if(!alter_atime && !furtive_read_mode) tools_noexcept_make_date(current_dir->display(), false, filename_pile.back().last_acc, filename_pile.back().last_mod, filename_pile.back().last_mod); filename_pile.pop_back(); current_dir->pop(tmp); } void filesystem_diff::detruire() { if(fs_root != nullptr) { delete fs_root; fs_root = nullptr; } if(current_dir != nullptr) { delete current_dir; current_dir = nullptr; } if(ea_mask != nullptr) { delete ea_mask; ea_mask = nullptr; } } void filesystem_diff::copy_from(const filesystem_diff & ref) { fs_root = nullptr; ea_mask = nullptr; current_dir = nullptr; try { const filesystem_hard_link_read *proto_ref = &ref; filesystem_hard_link_read *proto_me = this; *proto_me = *proto_ref; if(ref.fs_root != nullptr) { fs_root = new (get_pool()) path(*ref.fs_root); if(fs_root == nullptr) throw Ememory("filesystem_diff::copy_from"); } else fs_root = nullptr; if(ref.current_dir != nullptr) { current_dir = new (get_pool()) path(*ref.current_dir); if(current_dir == nullptr) throw Ememory("filesystem_diff::copy_from"); } else current_dir = nullptr; info_details = ref.info_details; ea_mask = ref.ea_mask->clone(); if(ea_mask == nullptr) throw Ememory("filesystem_diff::copy_from"); alter_atime = ref.alter_atime; furtive_read_mode = ref.furtive_read_mode; filename_pile = ref.filename_pile; } catch(...) { detruire(); throw; } } /////////////////////////////////////////////////////////////////// ////////////////// filesystem_hard_link_write methods //////////// /////////////////////////////////////////////////////////////////// bool filesystem_hard_link_write::raw_set_ea(const cat_nomme *e, const ea_attributs & list_ea, const string & spot, const mask & ea_mask) { const cat_mirage *e_mir = dynamic_cast(e); bool ret = false; try { if(e == nullptr) throw SRC_BUG; // checking that we have not already restored the EA of this // inode through another hard link if(e_mir != nullptr) { map::iterator it; it = corres_write.find(e_mir->get_etiquette()); if(it == corres_write.end()) { // inode never restored; (no data saved just EA) // we must record it corres_ino_ea tmp; tmp.chemin = spot; tmp.ea_restored = true; corres_write[e_mir->get_etiquette()] = tmp; } else if(it->second.ea_restored) return false; // inode already restored else it->second.ea_restored = true; } // restoring Extended Attributes // (void)ea_filesystem_write_ea(spot, list_ea, ea_mask); ret = true; } catch(Euser_abort & e) { ret = false; } return ret; } bool filesystem_hard_link_write::raw_clear_ea_set(const cat_nomme *e, const string & spot) { const cat_mirage *e_mir = dynamic_cast(e); bool ret = false; try { if(e == nullptr) throw SRC_BUG; // checking that we have not already restored the EA of this // inode through another hard link if(e_mir != nullptr) { map::iterator it; it = corres_write.find(e_mir->get_etiquette()); if(it == corres_write.end()) { // inode never restored; (no data saved just EA) // we must record it corres_ino_ea tmp; tmp.chemin = spot; tmp.ea_restored = false; // clearing the EA does not mean we have restored them, setting here "false" let raw_set_ea() being call afterward corres_write[e_mir->get_etiquette()] = tmp; } else // entry found if(it->second.ea_restored) return false; // inode already restored } // Clearing all EA // ea_filesystem_clear_ea(spot, bool_mask(true), get_pool()); ret = true; } catch(Euser_abort & e) { ret = false; } return ret; } void filesystem_hard_link_write::write_hard_linked_target_if_not_set(const cat_mirage *ref, const string & chemin) { if(!known_etiquette(ref->get_etiquette())) { corres_ino_ea tmp; tmp.chemin = chemin; tmp.ea_restored = false; // if EA have to be restored next corres_write[ref->get_etiquette()] = tmp; } } bool filesystem_hard_link_write::known_etiquette(const infinint & eti) { return corres_write.find(eti) != corres_write.end(); } void filesystem_hard_link_write::make_file(const cat_nomme * ref, const path & ou, bool dir_perm, cat_inode::comparison_fields what_to_check, const fsa_scope & scope) { const cat_directory *ref_dir = dynamic_cast(ref); const cat_file *ref_fil = dynamic_cast(ref); const cat_lien *ref_lie = dynamic_cast(ref); const cat_blockdev *ref_blo = dynamic_cast(ref); const cat_chardev *ref_cha = dynamic_cast(ref); const cat_tube *ref_tub = dynamic_cast(ref); const cat_prise *ref_pri = dynamic_cast(ref); const cat_mirage *ref_mir = dynamic_cast (ref); const cat_inode *ref_ino = dynamic_cast (ref); if(ref_ino == nullptr && ref_mir == nullptr) throw SRC_BUG; // neither an cat_inode nor a hard link const string display = (ou + ref->get_name()).display(); const char *name = display.c_str(); S_I ret = -1; // will carry the system call returned value used to create the requested file do { try { if(ref_mir != nullptr) // we potentially have to make a hard link { bool create_file = false; map::iterator it = corres_write.find(ref_mir->get_etiquette()); if(it == corres_write.end()) // first time, we have to create the inode create_file = true; else // the inode already exists, making hard link if possible { const char *old = it->second.chemin.c_str(); ret = link(old, name); if(ret < 0) { string tmp; switch(errno) { case EXDEV: // crossing filesystem case EPERM: // filesystem does not support hard link creation // can't make hard link, trying to duplicate the inode tmp = tools_strerror_r(errno); get_ui().warning(tools_printf(gettext("Error creating hard link %s : %s\n Trying to duplicate the inode"), name, tmp.c_str())); create_file = true; clear_corres_if_pointing_to(ref_mir->get_etiquette(), old); // always succeeds as the etiquette points to "old" // need to remove this entry to be able // to restore EA for other copies break; case ENOENT: // path to the hard link to create does not exit if(ref_mir->get_inode()->get_saved_status() == s_saved) { create_file = true; clear_corres_if_pointing_to(ref_mir->get_etiquette(), old); // always succeeds as the etiquette points to "old" // need to remove this entry to be able // to restore EA for other copies get_ui().warning(tools_printf(gettext("Error creating hard link : %s , the inode to link with [ %s ] has disappeared, re-creating it"), name, old)); } else { create_file = false; // nothing to do; get_ui().warning(tools_printf(gettext("Error creating hard link : %s , the inode to link with [ %s ] is not present, cannot restore this hard link"), name, old)); } break; default : // nothing to do (ret < 0 and create_file == false) break; } } else create_file = false; } if(create_file) { ref_ino = ref_mir->get_inode(); ref_fil = dynamic_cast(ref_mir->get_inode()); ref_lie = dynamic_cast(ref_mir->get_inode()); ref_blo = dynamic_cast(ref_mir->get_inode()); ref_cha = dynamic_cast(ref_mir->get_inode()); ref_tub = dynamic_cast(ref_mir->get_inode()); ref_pri = dynamic_cast(ref_mir->get_inode()); ref_mir->get_inode()->change_name(ref_mir->get_name()); // we temporarily change the name of the attached inode (it is not used usually), by the name of the cat_mirage object } else // hard link made ret = 0; // not necessary, but avoids a warning from compilator ("ret" might be used uninitialized) } // build plain inode object (or initial inode for hard link --- if create_file was true above) if(ref_dir != nullptr) { ret = mkdir(name, 0700); // as the directory has been created we are its owner and we will need only // to create files under it so we need all rights for user, by security for now, no right are // allowed for group and others, but this will be set properly at the end, when all files will // be restored in that directory } else if(ref_fil != nullptr) { generic_file *ou; infinint seek; fichier_local dest = fichier_local(get_ui(), display, gf_write_only, 0700, false, true, false); // the implicit destruction of dest (exiting the block) // will close the 'ret' file descriptor (see ~fichier_local()) ou = ref_fil->get_data(cat_file::normal); try { const crc *crc_ori = nullptr; crc *crc_dyn = nullptr; infinint crc_size; try { if(!ref_fil->get_crc_size(crc_size)) crc_size = tools_file_size_to_crc_size(ref_fil->get_size()); ou->skip(0); ou->read_ahead(ref_fil->get_storage_size()); ou->copy_to(dest, crc_size, crc_dyn); if(crc_dyn == nullptr) throw SRC_BUG; if(ref_fil->get_crc(crc_ori)) { if(crc_ori == nullptr) throw SRC_BUG; if(typeid(*crc_dyn) != typeid(*crc_ori)) throw SRC_BUG; if(*crc_dyn != *crc_ori) throw Erange("filesystem_hard_link_write::make_file", gettext("Bad CRC, data corruption occurred")); // else nothing to do, nor to signal } // else this is a very old archive } catch(...) { if(crc_dyn != nullptr) delete crc_dyn; throw; } if(crc_dyn != nullptr) delete crc_dyn; // nop we do not sync before, so maybe some pages // will be kept in cache for Linux, maybe not for // other systems that support fadvise(2) dest.fadvise(fichier_global::advise_dontneed); } catch(...) { if(ou != nullptr) delete ou; throw; } delete ou; ret = 0; // to report a successful operation at the end of the if/else if chain } else if(ref_lie != nullptr) ret = symlink(ref_lie->get_target().c_str(), name); else if(ref_blo != nullptr) ret = mknod(name, S_IFBLK | 0700, makedev(ref_blo->get_major(), ref_blo->get_minor())); else if(ref_cha != nullptr) ret = mknod(name, S_IFCHR | 0700, makedev(ref_cha->get_major(), ref_cha->get_minor())); else if(ref_tub != nullptr) ret = mknod(name, S_IFIFO | 0700, 0); else if(ref_pri != nullptr) { ret = socket(PF_UNIX, SOCK_STREAM, 0); if(ret >= 0) { S_I sd = ret; struct sockaddr_un addr; addr.sun_family = AF_UNIX; try { strncpy(addr.sun_path, name, UNIX_PATH_MAX - 1); addr.sun_path[UNIX_PATH_MAX - 1] = '\0'; if(::bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0) throw Erange("filesystem_hard_link_write::make_file (socket bind)", string(gettext("Error creating Unix socket file: ")) + name + " : " + tools_strerror_r(errno)); } catch(...) { shutdown(sd, 2); close(sd); throw; } shutdown(sd, 2); close(sd); } } else if(ref_mir == nullptr) throw SRC_BUG; // unknown inode type // else nothing do do cat_mirage have been handled far above if(ret < 0) { if(errno != ENOSPC) throw Erange("filesystem_hard_link_write::make_file", string(gettext("Could not create inode: ")) + name + " : " + tools_strerror_r(errno)); else get_ui().pause(string(gettext("Cannot create inode: ")) + tools_strerror_r(errno) + gettext(" Ready to continue ?")); } else // inode successfully created if(ref_mir != nullptr) { map::iterator it = corres_write.find(ref_mir->get_etiquette()); if(it == corres_write.end()) // we just created the first hard linked to that inode, so we must record its intial link to build subsequent ones { corres_ino_ea tmp; tmp.chemin = string(name); tmp.ea_restored = false; corres_write[ref_mir->get_etiquette()] = tmp; } } } catch(Ethread_cancel & e) { if(ret >= 0) // we need to remove the filesystem entry we were creating // we don't let something uncompletely restored in the filesystem // in any case (immediate cancel or not) (void)unlink(name); // ignoring exit status throw; } } while(ret < 0 && errno == ENOSPC); if(ref_ino != nullptr && ret >= 0) make_owner_perm(get_ui(), *ref_ino, display, dir_perm, what_to_check, scope); } void filesystem_hard_link_write::clear_corres_if_pointing_to(const infinint & ligne, const string & path) { map::iterator it = corres_write.find(ligne); if(it != corres_write.end()) { if(it->second.chemin == path) corres_write.erase(it); } } /////////////////////////////////////////////////////////////////// ////////////////// filesystem_restore methods //////////////////// /////////////////////////////////////////////////////////////////// filesystem_restore::filesystem_restore(user_interaction & dialog, const path &root, bool x_warn_overwrite, bool x_info_details, const mask & x_ea_mask, cat_inode::comparison_fields x_what_to_check, bool x_warn_remove_no_match, bool x_empty, const crit_action *x_overwrite, bool x_only_overwrite, const fsa_scope & scope) : mem_ui(&dialog), filesystem_hard_link_write(dialog), filesystem_hard_link_read(dialog, true, scope) { fs_root = nullptr; ea_mask = nullptr; current_dir = nullptr; overwrite = nullptr; try { fs_root = get_root_with_symlink(get_ui(), root, x_info_details, get_pool()); if(fs_root == nullptr) throw Ememory("filesystem_write::filesystem_write"); ea_mask = x_ea_mask.clone(); if(ea_mask == nullptr) throw Ememory("filesystem_restore::filesystem_restore"); if(x_overwrite == nullptr) throw SRC_BUG; overwrite = x_overwrite->clone(); if(overwrite == nullptr) throw Ememory("filesystem_restore::filesystem_restore"); } catch(...) { detruire(); throw; } warn_overwrite = x_warn_overwrite; info_details = x_info_details; what_to_check = x_what_to_check; warn_remove_no_match = x_warn_remove_no_match; empty = x_empty; only_overwrite = x_only_overwrite; reset_write(); } void filesystem_restore::reset_write() { filesystem_hard_link_write::corres_reset(); filesystem_hard_link_read::corres_reset(); stack_dir.clear(); if(current_dir != nullptr) delete current_dir; current_dir = new (get_pool()) path(*fs_root); if(current_dir == nullptr) throw Ememory("filesystem_write::reset_write"); ignore_over_restricts = false; } void filesystem_restore::write(const cat_entree *x, action_done_for_data & data_restored, bool & ea_restored, bool & data_created, bool & hard_link, bool & fsa_restored) { const cat_eod *x_eod = dynamic_cast(x); const cat_nomme *x_nom = dynamic_cast(x); const cat_directory *x_dir = dynamic_cast(x); const cat_detruit *x_det = dynamic_cast(x); const cat_inode *x_ino = dynamic_cast(x); const cat_mirage *x_mir = dynamic_cast(x); data_restored = done_no_change_no_data; ea_restored = false; data_created = false; fsa_restored = false; hard_link = x_mir != nullptr && known_etiquette(x_mir->get_etiquette()); if(x_mir != nullptr) { x_ino = x_mir->get_inode(); if(x_ino == nullptr) throw SRC_BUG; } if(x_eod != nullptr) { string tmp; current_dir->pop(tmp); if(!stack_dir.empty()) { if(!empty && stack_dir.back().get_restore_date()) { string chem = (*current_dir + stack_dir.back().get_name()).display(); make_owner_perm(get_ui(), stack_dir.back(), chem, true, what_to_check, get_fsa_scope()); make_date(stack_dir.back(), chem, what_to_check, get_fsa_scope()); } } else throw SRC_BUG; stack_dir.pop_back(); return; } if(x_nom == nullptr) throw SRC_BUG; // neither "cat_nomme" nor "cat_eod" else // cat_nomme { bool has_data_saved = (x_ino != nullptr && x_ino->get_saved_status() == s_saved) || x_det != nullptr; bool has_ea_saved = x_ino != nullptr && (x_ino->ea_get_saved_status() == cat_inode::ea_full || x_ino->ea_get_saved_status() == cat_inode::ea_removed); bool has_fsa_saved = x_ino != nullptr && x_ino->fsa_get_saved_status() == cat_inode::fsa_full; path spot = *current_dir + x_nom->get_name(); string spot_display = spot.display(); cat_nomme *exists = nullptr; if(ignore_over_restricts) // only used in sequential_read when a file has been saved several times due // to its contents being modified at backup time while dar was reading it. // here when ignore_over_restricts is true it is asked to remove the previously restored copy of // that file because a better copy has been found in the archive. { ignore_over_restricts = false; // just one shot state ; exists == nullptr : we are ignoring existing entry supprime(get_ui(), spot_display); if(x_det != nullptr) { data_restored = done_data_removed; data_created = false; hard_link = false; ea_restored = false; fsa_restored = false; if(!stack_dir.empty()) stack_dir.back().set_restore_date(true); return; } } else exists = make_read_entree(*current_dir, x_nom->get_name(), false, *ea_mask); try { cat_inode *exists_ino = dynamic_cast(exists); cat_directory *exists_dir = dynamic_cast(exists); if(exists_ino == nullptr && exists != nullptr) throw SRC_BUG; // an object from filesystem should always be an cat_inode !?! if(exists == nullptr) { // no conflict: there is not an already existing file present in filesystem if(x_det != nullptr) throw Erange("filesystem_restore::write", string(gettext("Cannot remove non-existent file from filesystem: ")) + spot_display); if((has_data_saved || hard_link || x_dir != nullptr) && !only_overwrite) { if(info_details) get_ui().warning(string(gettext("Restoring file's data: ")) + spot_display); if(!empty) make_file(x_nom, *current_dir, false, what_to_check, get_fsa_scope()); data_created = true; data_restored = done_data_restored; // recording that we must set back the mtime of the parent directory if(!stack_dir.empty()) stack_dir.back().set_restore_date(true); // we must try to restore EA or FSA only if data could be restored // as in the current situation no file existed before if(has_ea_saved) { if(info_details) get_ui().warning(string(gettext("Restoring file's EA: ")) + spot_display); if(!empty) { const ea_attributs *ea = x_ino->get_ea(); try { ea_restored = raw_set_ea(x_nom, *ea, spot_display, *ea_mask); } catch(Erange & e) { get_ui().warning(tools_printf(gettext("Restoration of EA for %S aborted: "), &spot_display) + e.get_message()); } } else ea_restored = true; } if(has_fsa_saved) { if(info_details) get_ui().warning(string(gettext("Restoring file's FSA: ")) + spot_display); if(!empty) { const filesystem_specific_attribute_list * fsa = x_ino->get_fsa(); if(fsa == nullptr) throw SRC_BUG; try { fsa_restored = fsa->set_fsa_to_filesystem_for(spot_display, get_fsa_scope(), get_ui()); } catch(Erange & e) { get_ui().warning(tools_printf(gettext("Restoration of FSA for %S aborted: "), &spot_display) + e.get_message()); } } } // now that FSA has been read (if sequential mode is used) // we can restore dates in particular creation date from HFS+ FSA if present if(!empty) make_date(*x_ino, spot_display, what_to_check, get_fsa_scope()); } else // no existing inode but no data to restore { data_restored = done_no_change_no_data; data_created = false; hard_link = false; ea_restored = false; fsa_restored = false; } } else // exists != nullptr { over_action_data act_data = data_undefined; over_action_ea act_ea = EA_undefined; // conflict: an entry of that name is already present in filesystem overwrite->get_action(*exists, *x_nom, act_data, act_ea); if(x_ino == nullptr) if(x_det == nullptr) throw SRC_BUG; else { action_over_remove(exists_ino, x_det, spot_display, act_data); data_restored = done_data_removed; data_created = false; hard_link = false; ea_restored = false; fsa_restored = false; // recording that we must set back the mtime of the parent directory if(!stack_dir.empty()) stack_dir.back().set_restore_date(true); } else // a normal inode (or hard linked one) is to be restored { if(has_data_saved) { try { action_over_data(exists_ino, x_nom, spot_display, act_data, data_restored); } catch(Egeneric & e) { } } else // no data saved in the object to restore { data_restored = done_no_change_no_data; if(x_mir != nullptr) write_hard_linked_target_if_not_set(x_mir, spot_display); } if(data_restored != done_data_restored) hard_link = false; // here we can restore EA even if no data has been restored // it will modify EA of the existing file if(act_data != data_remove) { if(has_ea_saved) { try { ea_restored = action_over_ea(exists_ino, x_nom, spot_display, act_ea); } catch(Erange & e) { get_ui().warning(tools_printf(gettext("Restoration of EA for %S aborted: "), &spot_display) + e.get_message()); } } if(has_fsa_saved) { try { fsa_restored = action_over_fsa(exists_ino, x_nom, spot_display, act_ea); } catch(Erange & e) { get_ui().warning(tools_printf(gettext("Restoration of FSA for %S aborted: "), &spot_display) + e.get_message()); } } if(has_fsa_saved || has_ea_saved) { // to accomodate MacOS X we set again mtime to its expected value // because restoring EA modifies mtime on this OS. // Same point but concerning extX FSA, setting them may modify atime // unless furtive read is available. // This does not hurt other Unix systems. if(data_restored == done_data_restored) // set back the mtime to value found in the archive make_date(*x_ino, spot_display, what_to_check, get_fsa_scope()); else // set back the mtime to value found in filesystem before restoration make_date(*exists_ino, spot_display, what_to_check, get_fsa_scope()); } } if(act_data == data_remove) { // recording that we must set back the mtime of the parent directory if(!stack_dir.empty()) stack_dir.back().set_restore_date(true); } } } if(x_dir != nullptr && (exists == nullptr || exists_dir != nullptr || data_restored == done_data_restored)) { *current_dir += x_dir->get_name(); stack_dir.push_back(stack_dir_t(*x_dir, data_restored == done_data_restored)); } } catch(...) { if(exists != nullptr) delete exists; throw; } if(exists != nullptr) delete exists; } } void filesystem_restore::action_over_remove(const cat_inode *in_place, const cat_detruit *to_be_added, const string & spot, over_action_data action) { if(in_place == nullptr || to_be_added == nullptr) throw SRC_BUG; if(action == data_ask) action = crit_ask_user_for_data_action(get_ui(), spot, in_place, to_be_added); switch(action) { case data_preserve: case data_preserve_mark_already_saved: // nothing to do break; case data_overwrite: case data_overwrite_mark_already_saved: case data_remove: if(warn_overwrite) get_ui().pause(tools_printf(gettext("%S is about to be removed from filesystem, continue?"), &spot)); if(compatible_signature(in_place->signature(), to_be_added->get_signature())) { if(info_details) get_ui().printf(gettext("Removing file (reason is file recorded as removed in archive): %S"), &spot); if(!empty) supprime(get_ui(), spot); } else { if(warn_remove_no_match) // warning even if just warn_overwrite is not set get_ui().pause(tools_printf(gettext("%S must be removed, but does not match expected type, remove it anyway ?"), &spot)); if(info_details) get_ui().printf(gettext("Removing file (reason is file recorded as removed in archive): %S"), &spot); if(!empty) supprime(get_ui(), spot); } break; case data_undefined: throw Erange("filesystem_restore::action_over_detruit", tools_printf(gettext("%S: Overwriting policy (Data) is undefined for that file, do not know whether removal is allowed or not!"), &spot)); case data_ask: throw SRC_BUG; default: throw SRC_BUG; } } void filesystem_restore::action_over_data(const cat_inode *in_place, const cat_nomme *to_be_added, const string & spot, over_action_data action, action_done_for_data & data_done) { const cat_mirage *tba_mir = dynamic_cast(to_be_added); const cat_inode *tba_ino = tba_mir == nullptr ? dynamic_cast(to_be_added) : tba_mir->get_inode(); const cat_directory *tba_dir = dynamic_cast(to_be_added); const cat_detruit *tba_det = dynamic_cast(to_be_added); const cat_lien *in_place_symlink = dynamic_cast(in_place); if(tba_ino == nullptr) throw SRC_BUG; if(in_place == nullptr) throw SRC_BUG; if(tba_det != nullptr) throw SRC_BUG; // must be either a cat_mirage or an inode, not any other cat_nomme object if(action == data_ask) action = crit_ask_user_for_data_action(get_ui(), spot, in_place, to_be_added); switch(action) { case data_preserve: case data_preserve_mark_already_saved: if(tba_dir != nullptr && !tba_ino->same_as(*in_place)) throw Erange("filesystem_write::write", tools_printf(gettext("Directory %S cannot be restored: overwriting not allowed and a non-directory inode of that name already exists, all files in that directory will be skipped for restoration:"), &spot)); data_done = done_no_change_policy; break; case data_overwrite: case data_overwrite_mark_already_saved: if(warn_overwrite) { try { get_ui().pause(tools_printf(gettext("%S is about to be overwritten, OK?"), &spot)); } catch(Euser_abort & e) { if(tba_dir != nullptr && tba_ino->same_as(*in_place)) { data_done = done_no_change_policy; return; // if we throw exception here, we will not recurse in this directory, while we could as a directory exists on filesystem } else throw; // throwing the exception here, implies that no EA will be tried to be restored for that file } } if(info_details) get_ui().warning(string(gettext("Restoring file's data: ")) + spot); if(tba_dir != nullptr && tba_ino->same_as(*in_place)) { if(!empty) make_owner_perm(get_ui(), *tba_ino, spot, false, what_to_check, get_fsa_scope()); data_done = done_data_restored; } else // not both in_place and to_be_added are directories { ea_attributs *ea = nullptr; // saving original EA of existing inode filesystem_specific_attribute_list fsa; // saving original FSA of existing inode bool got_ea = true; bool got_fsa = true; try { // reading EA present on filesystem try { ea = ea_filesystem_read_ea(spot, bool_mask(true), get_pool()); } catch(Ethread_cancel & e) { throw; } catch(Egeneric & ex) { got_ea = false; get_ui().warning(tools_printf(gettext("Existing EA for %S could not be read and preserved: "), &spot) + ex.get_message()); } // reading FSA present on filesystem try { fsa.get_fsa_from_filesystem_for(spot, all_fsa_families(), in_place_symlink != nullptr); } catch(Ethread_cancel & e) { throw; } catch(Egeneric & ex) { got_fsa = false; get_ui().warning(tools_printf(gettext("Existing FSA for %S could not be read and preserved: "), &spot) + ex.get_message()); } // removing current entry and creating the new entry in place if(!empty) { supprime(get_ui(), spot); // this destroyes EA, (removes inode, or hard link to inode) make_file(to_be_added, *current_dir, false, what_to_check, get_fsa_scope()); data_done = done_data_restored; } // restoring EA that were present on filesystem try // if possible and available restoring original EA { if(got_ea && !empty) if(ea != nullptr) // if ea is nullptr no EA is present in the original file, thus nothing has to be restored (void)ea_filesystem_write_ea(spot, *ea, bool_mask(true)); // we don't care about the return value, here, errors are returned through exceptions // the returned value is informative only and does not determine any subsequent actions } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { if(ea != nullptr && !ea->size().is_zero()) get_ui().warning(tools_printf(gettext("Existing EA for %S could not be preserved : "), &spot) + e.get_message()); } // restoring FSA that were present on filesystem try // if possible and available restoring original FSA { if(got_fsa && !empty) fsa.set_fsa_to_filesystem_for(spot, all_fsa_families(), get_ui()); } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { if(ea != nullptr && !ea->size().is_zero()) get_ui().warning(tools_printf(gettext("Existing FSA for %S could not be preserved : "), &spot) + e.get_message()); } } catch(...) { if(ea != nullptr) delete ea; throw; } if(ea != nullptr) delete ea; } break; case data_remove: if(warn_overwrite) get_ui().pause(tools_printf(gettext("%S is about to be deleted (required by overwriting policy), do you agree?"), &spot)); if(info_details) get_ui().printf(gettext("Removing file (reason is overwriting policy): %S"), &spot); if(!empty) supprime(get_ui(), spot); data_done = done_data_removed; break; case data_undefined: throw Erange("filesystem_restore::action_over_detruit", tools_printf(gettext("%S: Overwriting policy (Data) is undefined for that file, do not know whether overwriting is allowed or not!"), &spot)); case data_ask: throw SRC_BUG; default: throw SRC_BUG; } } bool filesystem_restore::action_over_ea(const cat_inode *in_place, const cat_nomme *to_be_added, const string & spot, over_action_ea action) { bool ret = false; const cat_inode *tba_ino = dynamic_cast(to_be_added); const cat_mirage *tba_mir = dynamic_cast(to_be_added); if(tba_mir != nullptr) tba_ino = tba_mir->get_inode(); if(tba_ino == nullptr) throw SRC_BUG; if(in_place == nullptr || to_be_added == nullptr) throw SRC_BUG; if(action == EA_ask) action = crit_ask_user_for_EA_action(get_ui(), spot, in_place, to_be_added); // modifying the EA action when the in place inode has not EA if(in_place->ea_get_saved_status() != cat_inode::ea_full) // no EA in filesystem { if(action == EA_merge_preserve || action == EA_merge_overwrite) action = EA_overwrite; // merging when in_place has no EA is equivalent to overwriting } if(tba_ino->ea_get_saved_status() == cat_inode::ea_removed) // EA have been removed since archive of reference { if(action == EA_merge_preserve || action == EA_merge_overwrite) action = EA_clear; // we must remove EA instead of merging } switch(action) { case EA_preserve: case EA_preserve_mark_already_saved: // nothing to do ret = false; break; case EA_overwrite: case EA_overwrite_mark_already_saved: if(tba_ino->ea_get_saved_status() != cat_inode::ea_full && tba_ino->ea_get_saved_status() != cat_inode::ea_removed) throw SRC_BUG; if(warn_overwrite) { try { get_ui().pause(tools_printf(gettext("EA for %S are about to be overwritten, OK?"), &spot)); } catch(Euser_abort & e) { const cat_directory *tba_dir = dynamic_cast(to_be_added); if(tba_dir != nullptr && tba_ino->same_as(*in_place)) return false; else throw; } } if(!empty && !raw_clear_ea_set(to_be_added, spot)) { if(info_details) get_ui().printf(gettext("EA for %S have not been overwritten because this file is a hard link pointing to an already restored inode"), &spot); ret = false; } else // successfully cleared EA { if(info_details) get_ui().warning(string(gettext("Restoring file's EA: ")) + spot); const ea_attributs *tba_ea = tba_ino->get_ea(); if(!empty) ret = raw_set_ea(to_be_added, *tba_ea, spot, *ea_mask); else ret = true; } break; case EA_clear: if(warn_overwrite) { try { get_ui().pause(tools_printf(gettext("EA for %S are about to be removed, OK?"), &spot)); } catch(Euser_abort & e) { return false; } } if(!empty && !raw_clear_ea_set(to_be_added, spot)) { if(info_details) get_ui().printf(gettext("EA for %S have not been cleared as requested by the overwriting policy because this file is a hard link pointing to an already restored inode"), &spot); ret = false; } else { if(info_details) get_ui().warning(string(gettext("Clearing file's EA (requested by overwriting policy): ")) + spot); ret = true; } break; case EA_merge_preserve: case EA_merge_overwrite: if(in_place->ea_get_saved_status() != cat_inode::ea_full) throw SRC_BUG; // should have been redirected to EA_overwrite ! if(warn_overwrite) { try { get_ui().pause(tools_printf(gettext("EA for %S are about to be merged, OK?"), &spot)); } catch(Euser_abort & e) { return false; } } if(tba_ino->ea_get_saved_status() == cat_inode::ea_full) // Note, that cat_inode::ea_removed is the other valid value { const ea_attributs *tba_ea = tba_ino->get_ea(); const ea_attributs *ip_ea = in_place->get_ea(); ea_attributs result; if(action == EA_merge_preserve) result = *tba_ea + *ip_ea; else // action == EA_merge_overwrite result = *ip_ea + *tba_ea; // the + operator on ea_attributs is not reflexive !!! if(!empty) ret = raw_set_ea(to_be_added, result, spot, *ea_mask); else ret = true; } break; case EA_undefined: throw Erange("filesystem_restore::action_over_detruit", tools_printf(gettext("%S: Overwriting policy (EA) is undefined for that file, do not know whether overwriting is allowed or not!"), &spot)); case EA_ask: throw SRC_BUG; default: throw SRC_BUG; } return ret; } bool filesystem_restore::action_over_fsa(const cat_inode *in_place, const cat_nomme *to_be_added, const string & spot, over_action_ea action) { bool ret = false; const cat_inode *tba_ino = dynamic_cast(to_be_added); const cat_mirage *tba_mir = dynamic_cast(to_be_added); if(tba_mir != nullptr) tba_ino = tba_mir->get_inode(); if(tba_ino == nullptr) throw SRC_BUG; if(in_place == nullptr || to_be_added == nullptr) throw SRC_BUG; if(action == EA_ask) action = crit_ask_user_for_FSA_action(get_ui(), spot, in_place, to_be_added); // modifying the FSA action when the in place inode has not FSA if(in_place->fsa_get_saved_status() != cat_inode::fsa_full) // no EA in filesystem { if(action == EA_merge_preserve || action == EA_merge_overwrite) action = EA_overwrite; // merging when in_place has no EA is equivalent to overwriting } switch(action) { case EA_preserve: case EA_preserve_mark_already_saved: // nothing to do ret = false; break; case EA_overwrite: case EA_overwrite_mark_already_saved: if(tba_ino->fsa_get_saved_status() != cat_inode::fsa_full) throw SRC_BUG; if(warn_overwrite) { try { get_ui().pause(tools_printf(gettext("FSA for %S are about to be overwritten, OK?"), &spot)); } catch(Euser_abort & e) { const cat_directory *tba_dir = dynamic_cast(to_be_added); if(tba_dir != nullptr && tba_ino->same_as(*in_place)) return false; else throw; } } if(tba_mir != nullptr && known_etiquette(tba_mir->get_etiquette())) { if(info_details) get_ui().printf(gettext("FSA for %S have not been overwritten because this file is a hard link pointing to an already restored inode"), &spot); ret = false; } else { if(info_details) get_ui().warning(string(gettext("Restoring file's FSA: ")) + spot); if(!empty) { const filesystem_specific_attribute_list * fsa = tba_ino->get_fsa(); if(fsa == nullptr) throw SRC_BUG; ret = fsa->set_fsa_to_filesystem_for(spot, get_fsa_scope(), get_ui()); } else ret = true; } break; case EA_clear: break; case EA_merge_preserve: case EA_merge_overwrite: if(in_place->fsa_get_saved_status() != cat_inode::fsa_full) throw SRC_BUG; // should have been redirected to EA_overwrite ! if(warn_overwrite) { try { get_ui().pause(tools_printf(gettext("FSA for %S are about to be overwritten, OK?"), &spot)); } catch(Euser_abort & e) { return false; } } if(tba_ino->fsa_get_saved_status() == cat_inode::fsa_full) { const filesystem_specific_attribute_list *tba_fsa = tba_ino->get_fsa(); const filesystem_specific_attribute_list *ip_fsa = in_place->get_fsa(); filesystem_specific_attribute_list result; if(action == EA_merge_preserve) result = *tba_fsa + *ip_fsa; else // action == EA_merge_overwrite result = *ip_fsa + *tba_fsa; // the + operator on FSA is not reflexive !!! if(!empty) ret = result.set_fsa_to_filesystem_for(spot, get_fsa_scope(), get_ui()); else ret = true; } break; case EA_undefined: throw Erange("filesystem_restore::action_over_detruit", tools_printf(gettext("%S: Overwriting policy (FSA) is undefined for that file, do not know whether overwriting is allowed or not!"), &spot)); case EA_ask: throw SRC_BUG; default: throw SRC_BUG; } return ret; } void filesystem_restore::detruire() { if(fs_root != nullptr) { delete fs_root; fs_root = nullptr; } if(current_dir != nullptr) { delete current_dir; current_dir = nullptr; } if(ea_mask != nullptr) { delete ea_mask; ea_mask = nullptr; } if(overwrite != nullptr) { delete overwrite; overwrite = nullptr; } } void filesystem_restore::restore_stack_dir_ownership() { string tmp; while(!stack_dir.empty() && current_dir->pop(tmp)) { string chem = (*current_dir + stack_dir.back().get_name()).display(); if(!empty) make_owner_perm(get_ui(), stack_dir.back(), chem, true, what_to_check, get_fsa_scope()); stack_dir.pop_back(); } if(stack_dir.size() > 0) throw SRC_BUG; } /////////////////////////////////////////////////////////////////// ////////////////// static functions /////////////////////////////// /////////////////////////////////////////////////////////////////// static void supprime(user_interaction & ui, const string & ref) { const char *s = ref.c_str(); struct stat buf; if(lstat(s, &buf) < 0) throw Erange("filesystem supprime", string(gettext("Cannot get inode information about file to remove ")) + s + " : " + tools_strerror_r(errno)); if(S_ISDIR(buf.st_mode)) { etage fils = etage(ui, s, datetime(0), datetime(0), false, false); // we don't care the access and modification time because directory will be destroyed string tmp; // first we destroy directory's children while(fils.read(tmp)) supprime(ui, (path(ref)+tmp).display()); // then the directory itself if(rmdir(s) < 0) throw Erange("supprime (dir)", string(gettext("Cannot remove directory ")) + s + " : " + tools_strerror_r(errno)); } else if(unlink(s) < 0) throw Erange("supprime (file)", string(gettext("Cannot remove file ")) + s + " : " + tools_strerror_r(errno)); } static void make_owner_perm(user_interaction & dialog, const cat_inode & ref, const string & chem, bool dir_perm, cat_inode::comparison_fields what_to_check, const fsa_scope & scope) { const char *name = chem.c_str(); const cat_lien *ref_lie = dynamic_cast(&ref); S_I permission; // if we are not root (geteuid()!=0) and if we are restoring in an already // existing (!dir_perm) directory (dynamic_cast...), we must try, to have a chance to // be able to create/modify sub-files or sub-directory, so we set the user write access to // that directory. This chmod is allowed only if we own the directory (so // we only set the write bit for user). If this cannot be changed we are not the // owner of the directory, so we will try to restore as much as our permission // allows it (maybe "group" or "other" write bits are set for us). if(dynamic_cast(&ref) != nullptr && !dir_perm && geteuid() != 0) { mode_t tmp; try { tmp = get_file_permission(name); // the current permission value } catch(Egeneric & e) { tmp = ref.get_perm(); // the value at the time of the backup if we failed reading permission from filesystem } permission = tmp | 0200; // add user write access to be able to add some subdirectories and files } else permission = ref.get_perm(); // restoring fields that are defined by "what_to_check" if(what_to_check == cat_inode::cf_all) if(ref.get_saved_status() == s_saved) { uid_t tmp_uid = 0; gid_t tmp_gid = 0; infinint tmp = ref.get_uid(); tmp.unstack(tmp_uid); if(!tmp.is_zero()) throw Erange("make_owner_perm", gettext("uid value is too high for this system for libdar be able to restore it properly")); tmp = ref.get_gid(); tmp.unstack(tmp_gid); if(!tmp.is_zero()) throw Erange("make_owner_perm", gettext("gid value is too high for this system for libdar be able to restore it properly")); #if HAVE_LCHOWN if(lchown(name, tmp_uid, tmp_gid) < 0) dialog.warning(chem + string(gettext("Could not restore original file ownership: ")) + tools_strerror_r(errno)); #else if(dynamic_cast(&ref) == nullptr) // not a symbolic link if(chown(name, tmp_uid, tmp_gid) < 0) dialog.warning(chem + string(gettext("Could not restore original file ownership: ")) + tools_strerror_r(errno)); // // we don't/can't restore ownership for symbolic links (no system call to do that) // #endif } try { if(what_to_check == cat_inode::cf_all || what_to_check == cat_inode::cf_ignore_owner) if(ref_lie == nullptr) // not restoring permission for symbolic links, it would modify the target not the symlink itself if(chmod(name, permission) < 0) { string tmp = tools_strerror_r(errno); dialog.warning(tools_printf(gettext("Cannot restore permissions of %s : %s"), name, tmp.c_str())); } } catch(Egeneric &e) { if(ref_lie == nullptr) throw; // else (the inode is a symlink), we simply ignore this error } } static void make_date(const cat_inode & ref, const string & chem, cat_inode::comparison_fields what_to_check, const fsa_scope & scope) { const cat_lien *ref_lie = dynamic_cast(&ref); if(what_to_check == cat_inode::cf_all || what_to_check == cat_inode::cf_ignore_owner || what_to_check == cat_inode::cf_mtime) { datetime birthtime = ref.get_last_modif(); fsa_scope::iterator it = scope.find(fsaf_hfs_plus); if(ref.fsa_get_saved_status() == cat_inode::fsa_full && it != scope.end()) { const filesystem_specific_attribute_list * fsa = ref.get_fsa(); const filesystem_specific_attribute *ptr = nullptr; if(fsa == nullptr) throw SRC_BUG; if(fsa->find(fsaf_hfs_plus, fsan_creation_date, ptr)) { const fsa_time *ptr_time = dynamic_cast(ptr); if(ptr_time != nullptr) birthtime = ptr_time->get_value(); } } tools_make_date(chem, ref_lie != nullptr, ref.get_last_access(), ref.get_last_modif(), birthtime); } } static void attach_ea(const string &chemin, cat_inode *ino, const mask & ea_mask, memory_pool *pool) { ea_attributs *eat = nullptr; try { if(ino == nullptr) throw SRC_BUG; eat = ea_filesystem_read_ea(chemin, ea_mask, pool); if(eat != nullptr) { if(eat->size() <= 0) throw SRC_BUG; ino->ea_set_saved_status(cat_inode::ea_full); ino->ea_attach(eat); eat = nullptr; // allocated memory now managed by the cat_inode object } else ino->ea_set_saved_status(cat_inode::ea_none); } catch(...) { if(eat != nullptr) delete eat; throw; } if(eat != nullptr) throw SRC_BUG; } static bool is_nodump_flag_set(user_interaction & dialog, const path & chem, const string & filename, bool info) { #ifdef LIBDAR_NODUMP_FEATURE S_I fd, f = 0; const string display = (chem + filename).display(); const char *ptr = display.c_str(); fd = ::open(ptr, O_RDONLY|O_BINARY|O_NONBLOCK); if(fd < 0) { if(info) { string tmp = tools_strerror_r(errno); dialog.warning(tools_printf(gettext("Failed to open %S while checking for nodump flag: %s"), &filename, tmp.c_str())); } } else { try { if(ioctl(fd, EXT2_IOC_GETFLAGS, &f) < 0) { if(errno != ENOTTY) { if(info) { string tmp = tools_strerror_r(errno); dialog.warning(tools_printf(gettext("Cannot get ext2 attributes (and nodump flag value) for %S : %s"), &filename, tmp.c_str())); } } f = 0; } } catch(...) { close(fd); throw; } close(fd); } return (f & EXT2_NODUMP_FL) != 0; #else return false; #endif } static path *get_root_with_symlink(user_interaction & dialog, const path & root, bool info_details, memory_pool *pool) { path *ret = nullptr; const string display = root.display(); const char *ptr = display.c_str(); struct stat buf; if(lstat(ptr, &buf) < 0) // stat not lstat, thus we eventually get the symlink pointed to inode { string tmp = tools_strerror_r(errno); throw Erange("filesystem:get_root_with_symlink", tools_printf(gettext("Cannot get inode information for %s : %s"), ptr, tmp.c_str())); } if(S_ISDIR(buf.st_mode)) { ret = new (pool) path(root); if(ret == nullptr) throw Ememory("get_root_with_symlink"); } else if(S_ISLNK(buf.st_mode)) { ret = new (pool) path(tools_readlink(ptr)); if(ret == nullptr) throw Ememory("get_root_with_symlink"); if(ret->is_relative()) { string tmp; path base = root; if(base.pop(tmp)) *ret = base + *ret; else if(!root.is_relative()) throw SRC_BUG; // symlink name is not "popable" and is absolute, it is thus the filesystem root '/' // and it is a symbolic link !!! How is it possible that "/" be a symlink ? // a symlink to where ??? } if(info_details && ! (*ret == root) ) dialog.warning(tools_printf(gettext("Replacing %s in the -R option by the directory pointed to by this symbolic link: "), ptr) + ret->display()); } else // not a directory given as argument throw Erange("filesystem:get_root_with_symlink", tools_printf(gettext("The given path %s must be a directory (or symbolic link to an existing directory)"), ptr)); if(ret == nullptr) throw SRC_BUG; // exit without exception, but ret not allocated ! return ret; } static mode_t get_file_permission(const string & path) { struct stat buf; if(lstat(path.c_str(), &buf) < 0) { string tmp = tools_strerror_r(errno); throw Erange("filesystem.cpp:get_file_permission", tools_printf("Cannot read file permission for %s: %s",path.c_str(), tmp.c_str())); } return buf.st_mode; } } // end of namespace dar-2.5.3/src/libdar/tronc.cpp0000644000175000017430000001642712641773000013101 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_ERRNO_H #include #endif } // end extern "C" #include "tronc.hpp" namespace libdar { tronc::tronc(generic_file *f, const infinint & offset, const infinint &size, bool own_f) : generic_file(f->get_mode()) { ref = f; sz = size; start = offset; current = size; // forces skipping the first time own_ref = own_f; limited = true; check_pos = true; } tronc::tronc(generic_file *f, const infinint & offset, const infinint &size, gf_mode mode, bool own_f) : generic_file(mode) { ref = f; sz = size; start = offset; current = size; // forces skipping the firt time own_ref = own_f; limited = true; check_pos = true; } tronc::tronc(generic_file *f, const infinint &offset, bool own_f) : generic_file(f->get_mode()) { ref = f; sz = 0; start = offset; current = 0; own_ref = own_f; limited = false; check_pos = true; } tronc::tronc(generic_file *f, const infinint &offset, gf_mode mode, bool own_f) : generic_file(mode) { ref = f; sz = 0; start = offset; current = 0; own_ref = own_f; limited = false; check_pos = true; } void tronc::modify(const infinint & new_offset, const infinint & new_size) { modify(new_offset); sz = new_size; limited = true; if(current > sz) current = sz; } void tronc::modify(const infinint & new_offset) { current = current + start; // current now temporarily holds the absolute position start = new_offset; if(current <= start) current = 0; else current -= start; // now current points to the same byte but within the new scope limited = false; } bool tronc::skippable(skippability direction, const infinint & amount) { if(is_terminated()) throw SRC_BUG; return ref->skippable(direction, amount); } bool tronc::skip(const infinint & pos) { if(is_terminated()) throw SRC_BUG; if(current == pos && check_pos) // we skip anyway when check_pos is false return true; if(limited && pos > sz) { if(ref->skip(start + sz)) current = sz; else (void)ref->skip(start + current); return false; } else { bool ret = ref->skip(start + pos); if(ret) current = pos; else (void)ref->skip(start + current); return ret; } } bool tronc::skip_to_eof() { bool ret; if(is_terminated()) throw SRC_BUG; if(limited) { ret = ref->skip(start + sz); if(ret) current = sz; else (void)ref->skip(start + current); } else { ret = ref->skip_to_eof(); if(ret) set_back_current_position(); else (void)skip(start + current); } return ret; } bool tronc::skip_relative(S_I x) { if(is_terminated()) throw SRC_BUG; if(x < 0) { if(current < -x) { (void)ref->skip(start); current = 0; return false; } else { bool r = ref->skip_relative(x); if(r) current -= -x; else ref->skip(start + current); return r; } } if(x > 0) { if(limited && current + x >= sz) { current = sz; (void)ref->skip(start + sz); return false; } else { bool r = ref->skip_relative(x); if(r) current += x; else (void)ref->skip(start + current); return r; } } return true; } void tronc::inherited_read_ahead(const infinint & amount) { if(limited) { infinint avail = sz - current; if(avail > amount) ref->read_ahead(amount); else ref->read_ahead(avail); } else ref->read_ahead(amount); } U_I tronc::inherited_read(char *a, U_I size) { U_I lu = 0; infinint abso_pos = start + current; if(check_pos && ref->get_position() != abso_pos) { if(!ref->skip(abso_pos)) throw Erange("tronc::inherited_read", gettext("Cannot skip to the current position in \"tronc\"")); } if(limited) { infinint avail = sz - current; U_32 macro_pas = 0, micro_pas; U_I ret; do { avail.unstack(macro_pas); micro_pas = size - lu > macro_pas ? macro_pas : size - lu; if(micro_pas > 0) { ret = ref->read(a+lu, micro_pas); if(ret > 0) { lu += ret; macro_pas -= ret; } // else ret = 0 and this ends the while loop } else ret = 0; } while(ret > 0); } else lu = ref->read(a, size); current += lu; return lu; } void tronc::inherited_write(const char *a, U_I size) { U_I wrote = 0; if(check_pos) { if(!ref->skip(start + current)) throw Erange("tronc::inherited_read", gettext("Cannot skip to the current position in \"tronc\"")); } if(limited) { infinint avail = sz - current; U_32 macro_pas = 0, micro_pas; do { avail.unstack(macro_pas); if(macro_pas == 0 && wrote < size) throw Erange("tronc::inherited_write", gettext("Tried to write out of size limited file")); micro_pas = size - wrote > macro_pas ? macro_pas : size - wrote; ref->write(a+wrote, micro_pas); wrote += micro_pas; macro_pas -= micro_pas; } while(wrote < size); } else { ref->write(a, size); wrote = size; } current += wrote; } void tronc::set_back_current_position() { if(is_terminated()) throw SRC_BUG; infinint ref_pos = ref->get_position(); if(ref_pos < start) throw SRC_BUG; if(limited) { if(ref_pos > start + sz) throw SRC_BUG; else current = ref_pos - start; } else current = ref_pos - start; } } // end of namespace dar-2.5.3/src/libdar/cat_file.cpp0000644000175000017430000005764212642474445013542 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_file.hpp" #include "fichier_local.hpp" #include "pile.hpp" #include "tronc.hpp" #include "compressor.hpp" #include "sparse_file.hpp" #include "null_file.hpp" using namespace std; namespace libdar { cat_file::cat_file(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const string & src, const path & che, const infinint & taille, const infinint & fs_device, bool x_furtive_read_mode) : cat_inode(xuid, xgid, xperm, last_access, last_modif, last_change, src, fs_device) { chemin = (che + src).display(); status = from_path; set_saved_status(s_saved); offset = nullptr; size = nullptr; storage_size = nullptr; algo_read = none; // field not used for backup algo_write = none; // may be set later by change_compression_algo_write() furtive_read_mode = x_furtive_read_mode; file_data_status_read = 0; file_data_status_write = 0; check = nullptr; dirty = false; try { offset = new (get_pool()) infinint(0); size = new (get_pool()) infinint(taille); storage_size = new (get_pool()) infinint(0); if(offset == nullptr || size == nullptr || storage_size == nullptr) throw Ememory("cat_file::cat_file"); } catch(...) { if(offset != nullptr) { delete offset; offset = nullptr; } if(size != nullptr) { delete size; size = nullptr; } if(storage_size != nullptr) { delete storage_size; storage_size = nullptr; } throw; } } cat_file::cat_file(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, compression default_algo, bool small) : cat_inode(dialog, pdesc, reading_ver, saved, small) { chemin = ""; status = from_cat; size = nullptr; offset = nullptr; storage_size = nullptr; check = nullptr; algo_read = default_algo; // only used for archive format "03" and older algo_write = default_algo; // may be changed later using change_compression_algo_write() furtive_read_mode = false; // no used in that "status" mode file_data_status_read = 0; file_data_status_write = 0; // may be changed later using set_sparse_file_detection_write() dirty = false; generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; try { size = new (get_pool()) infinint(*ptr); if(size == nullptr) throw Ememory("cat_file::cat_file(generic_file)"); if(!small) // inode not partially dumped { if(saved == s_saved) { offset = new (get_pool()) infinint(*ptr); if(offset == nullptr) throw Ememory("cat_file::cat_file(generic_file)"); if(reading_ver > 1) { storage_size = new (get_pool()) infinint(*ptr); if(storage_size == nullptr) throw Ememory("cat_file::cat_file(generic_file)"); if(reading_ver > 7) { char tmp; ptr->read(&file_data_status_read, sizeof(file_data_status_read)); if((file_data_status_read & FILE_DATA_IS_DIRTY) != 0) { dirty = true; file_data_status_read &= ~FILE_DATA_IS_DIRTY; // removing the flag DIRTY flag } file_data_status_write = file_data_status_read; ptr->read(&tmp, sizeof(tmp)); algo_read = char2compression(tmp); algo_write= algo_read; } else if(storage_size->is_zero()) // in older archive storage_size was set to zero if data was not compressed { *storage_size = *size; algo_read = none; algo_write = algo_read; } else { algo_read = default_algo; algo_write = algo_read; } } else // archive format version is "1" { storage_size = new (get_pool()) infinint(*size); if(storage_size == nullptr) throw Ememory("cat_file::cat_file(generic_file)"); *storage_size *= 2; // compressed file should be less larger than twice // the original file // (in case the compression is very bad // and takes more place than no compression) } if(reading_ver >= 8) { check = create_crc_from_file(*ptr, get_pool()); if(check == nullptr) throw Ememory("cat_file::cat_file"); } // before version 8, crc was dump in any case, not only when data was saved } else // not saved { offset = new (get_pool()) infinint(0); storage_size = new (get_pool()) infinint(0); if(offset == nullptr || storage_size == nullptr) throw Ememory("cat_file::cat_file(generic_file)"); } if(reading_ver >= 2) { if(reading_ver < 8) { // fixed length CRC inversion from archive format "02" to "07" // present in any case, even when data is not saved // for archive version >= 8, the crc is only present // if the archive contains file data check = create_crc_from_file(*ptr, get_pool(), true); if(check == nullptr) throw Ememory("cat_file::cat_file"); } // archive version >= 8, crc only present if saved == s_saved (seen above) } else // no CRC in version "1" check = nullptr; } else // partial dump has been done { if(saved == s_saved) { char tmp; ptr->read(&file_data_status_read, sizeof(file_data_status_read)); file_data_status_write = file_data_status_read; ptr->read(&tmp, sizeof(tmp)); algo_read = char2compression(tmp); algo_write = algo_read; } // Now that all data has been read, setting default value for the undumped ones: if(saved == s_saved) offset = new (get_pool()) infinint(0); // can only be set from post_constructor else offset = new (get_pool()) infinint(0); if(offset == nullptr) throw Ememory("cat_file::cat_file(generic_file)"); storage_size = new (get_pool()) infinint(0); // cannot known the storage_size at that time if(storage_size == nullptr) throw Ememory("cat_file::cat_file(generic_file)"); check = nullptr; } } catch(...) { detruit(); throw; } } void cat_file::post_constructor(const pile_descriptor & pdesc) { cat_inode::post_constructor(pdesc); pdesc.check(true); if(offset == nullptr) throw SRC_BUG; else *offset = pdesc.esc->get_position(); // data follows right after the inode+file information+CRC } cat_file::cat_file(const cat_file & ref) : cat_inode(ref) { status = ref.status; chemin = ref.chemin; offset = nullptr; size = nullptr; storage_size = nullptr; check = nullptr; dirty = ref.dirty; algo_read = ref.algo_read; algo_write = ref.algo_write; furtive_read_mode = ref.furtive_read_mode; file_data_status_read = ref.file_data_status_read; file_data_status_write = ref.file_data_status_write; try { if(ref.check != nullptr || (ref.get_escape_layer() != nullptr && ref.get_saved_status() == s_saved)) { if(ref.check == nullptr) { const crc *tmp = nullptr; ref.get_crc(tmp); if(ref.check == nullptr) // failed to read the crc from escape layer throw SRC_BUG; } check = ref.check->clone(); if(check == nullptr) throw Ememory("cat_file::cat_file(cat_file)"); } else check = nullptr; offset = new (get_pool()) infinint(*ref.offset); size = new (get_pool()) infinint(*ref.size); storage_size = new (get_pool()) infinint(*ref.storage_size); if(offset == nullptr || size == nullptr || storage_size == nullptr) throw Ememory("cat_file::cat_file(cat_file)"); } catch(...) { detruit(); throw; } } void cat_file::detruit() { if(offset != nullptr) { delete offset; offset = nullptr; } if(size != nullptr) { delete size; size = nullptr; } if(storage_size != nullptr) { delete storage_size; storage_size = nullptr; } if(check != nullptr) { delete check; check = nullptr; } } void cat_file::inherited_dump(const pile_descriptor & pdesc, bool small) const { generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; cat_inode::inherited_dump(pdesc, small); size->dump(*ptr); if(!small) { if(get_saved_status() == s_saved) { char tmp = compression2char(algo_write); char flags = file_data_status_write; offset->dump(*ptr); storage_size->dump(*ptr); if(dirty) flags |= FILE_DATA_IS_DIRTY; ptr->write(&flags, sizeof(flags)); ptr->write(&tmp, sizeof(tmp)); // since archive version 8, crc is only present for saved inode if(check == nullptr) throw SRC_BUG; // no CRC to dump! else check->dump(*ptr); } } else // we only know whether the file will be compressed or using sparse_file data structure { if(get_saved_status() == s_saved) { char tmp = compression2char(algo_write); (void)ptr->write(&file_data_status_write, sizeof(file_data_status_write)); (void)ptr->write(&tmp, sizeof(tmp)); } } } bool cat_file::has_changed_since(const cat_inode & ref, const infinint & hourshift, cat_inode::comparison_fields what_to_check) const { const cat_file *tmp = dynamic_cast(&ref); if(tmp != nullptr) return cat_inode::has_changed_since(*tmp, hourshift, what_to_check) || *size != *(tmp->size); else throw SRC_BUG; } generic_file *cat_file::get_data(get_data_mode mode) const { generic_file *ret = nullptr; try { if(get_saved_status() != s_saved) throw Erange("cat_file::get_data", gettext("cannot provide data from a \"not saved\" file object")); if(status == empty) throw Erange("cat_file::get_data", gettext("data has been cleaned, object is now empty")); if(status == from_path) { fichier_local *tmp = nullptr; if(mode != normal && mode != plain) throw SRC_BUG; // keep compressed/keep_hole is not possible on an inode take from a filesystem ret = tmp = new (get_pool()) fichier_local(chemin, furtive_read_mode); } else // inode from archive if(get_pile() == nullptr) throw SRC_BUG; // set_archive_localisation never called or with a bad argument else if(get_pile()->get_mode() == gf_write_only) throw SRC_BUG; // cannot get data from a write-only file !!! else { // we will return a small stack of generic_file over the catalogue stack pile *data = new (get_pool()) pile(); if(data == nullptr) throw Ememory("cat_file::get_data"); try { // changing the compression algo of the archive stack if(get_compression_algo_read() != none && mode != keep_compressed) { if(get_compression_algo_read() != get_compressor_layer()->get_algo()) { get_pile()->flush_read_above(get_compressor_layer()); get_compressor_layer()->resume_compression(); if(get_compression_algo_read() != get_compressor_layer()->get_algo()) throw SRC_BUG; } // else nothing to do, compressor is already properly configured } else // disabling de-compression { if(get_compressor_layer()->get_algo() != none) { get_pile()->flush_read_above(get_compressor_layer()); get_compressor_layer()->suspend_compression(); } // else nothing to do, de-compression is already disabled } // adding a tronc object in the local stack object when no compression is used if(!get_small_read()) { if(get_compression_algo_read() == none) { generic_file *tmp = new (get_pool()) tronc(get_pile(), *offset, *storage_size, gf_read_only); if(tmp == nullptr) throw Ememory("cat_file::get_data"); try { data->push(tmp); data->skip(0); } catch(...) { delete tmp; throw; } } else get_pile()->skip(*offset); } // determining on which layer to rely on for possible the next to come sparse file generic_file *parent = data->is_empty() ? get_pile() : data->top(); // adding a sparse_file object in top of the local stack // // if a sparse_file object is to be used, it must be placed on top of the // returned stack, in order to benefit of the sparse_file::copy_to() specific methods // that can restore holes if(get_sparse_file_detection_read() && mode != keep_compressed && mode != keep_hole) { sparse_file *stmp = new (get_pool()) sparse_file(parent); if(stmp == nullptr) throw Ememory("cat_file::get_data"); try { data->push(stmp); } catch(...) { delete stmp; throw; } switch(mode) { case keep_compressed: case keep_hole: throw SRC_BUG; case normal: break; case plain: stmp->copy_to_without_skip(true); break; default: throw SRC_BUG; } } // if the stack to return is empty adding a tronc // to have the proper offset zero at the beginning of the data // // but we must not check the offset coherence between current read // position and underlying position when compression is used below // because it would lead the tronc to ask the compressor to seek // in the compressed data at the current position of uncompressed data if(data->is_empty()) { tronc *tronc_tmp; generic_file *tmp = tronc_tmp = new (get_pool()) tronc(get_pile(), *offset, gf_read_only); if(tmp == nullptr) throw Ememory("cat_file::get_data"); if(tronc_tmp == nullptr) throw SRC_BUG; try { tronc_tmp->check_underlying_position_while_reading_or_writing(false); data->push(tmp); } catch(...) { delete tmp; throw; } } ret = data; } catch(...) { delete data; throw; } } } catch(...) { if(ret != nullptr) delete ret; ret = nullptr; throw; } if(ret == nullptr) throw Ememory("cat_file::get_data"); else return ret; } void cat_file::clean_data() { switch(status) { case from_path: chemin = ""; // smallest possible memory allocation break; case from_cat: *offset = 0; // smallest possible memory allocation // warning, cannot change "size", as it is dump() in catalogue later break; case empty: // nothing to do break; default: throw SRC_BUG; } status = empty; } void cat_file::set_offset(const infinint & r) { if(status == empty) throw SRC_BUG; set_saved_status(s_saved); *offset = r; } const infinint & cat_file::get_offset() const { if(get_saved_status() != s_saved) throw SRC_BUG; if(offset == nullptr) throw SRC_BUG; return *offset; } void cat_file::set_crc(const crc &c) { if(check != nullptr) { delete check; check = nullptr; } check = c.clone(); if(check == nullptr) throw Ememory("cat_file::set_crc"); } bool cat_file::get_crc(const crc * & c) const { if(get_escape_layer() == nullptr) if(check != nullptr) { c = check; return true; } else return false; else { if(get_saved_status() == s_saved) { if(check == nullptr) { try { get_pile()->flush_read_above(get_escape_layer()); if(get_escape_layer()->skip_to_next_mark(escape::seqt_file_crc, false)) { crc *tmp = nullptr; // first, recording storage_size (needed when isolating a catalogue in sequential read mode) if(storage_size->is_zero()) { infinint pos = get_escape_layer()->get_position(); if(pos < *offset) throw SRC_BUG; else *storage_size = pos - *offset; } else throw SRC_BUG; // how is this possible ??? it should always be zero in sequential read mode ! tmp = create_crc_from_file(*(get_escape_layer()), get_pool()); if(tmp == nullptr) throw SRC_BUG; else { const_cast(this)->check = tmp; tmp = nullptr; // object now owned by "this" } } else throw Erange("cat_file::cat_file", gettext("can't read data CRC: No escape mark found for that file")); } catch(...) { // we assign a default crc to the object // to avoid trying reading it again later on if(check == nullptr) { const_cast(this)->check = new (get_pool()) crc_n(1); if(check == nullptr) throw Ememory("cat_file::cat_file"); } throw; } } if(check == nullptr) throw SRC_BUG; // should not be nullptr now! else c = check; return true; } else return false; } } bool cat_file::get_crc_size(infinint & val) const { if(check != nullptr) { val = check->get_size(); return true; } else return false; } void cat_file::sub_compare(const cat_inode & other, bool isolated_mode) const { const cat_file *f_other = dynamic_cast(&other); if(f_other == nullptr) throw SRC_BUG; // cat_inode::compare should have called us with a correct argument if(get_size() != f_other->get_size()) { infinint s1 = get_size(); infinint s2 = f_other->get_size(); throw Erange("cat_file::sub_compare", tools_printf(gettext("not same size: %i <--> %i"), &s1, &s2)); } if(get_saved_status() == s_saved && f_other->get_saved_status() == s_saved) { if(!isolated_mode) { generic_file *me = get_data(normal); if(me == nullptr) throw SRC_BUG; try { generic_file *you = f_other->get_data(normal); if(you == nullptr) throw SRC_BUG; // requesting read_ahead for the peer object // if the object is found on filesystem its // storage_size is zero, which lead a endless // read_ahead request, suitable for the current // context: try { crc *value = nullptr; const crc *original = nullptr; infinint crc_size; if(has_crc()) { if(get_crc(original)) { if(original == nullptr) throw SRC_BUG; crc_size = original->get_size(); } else throw SRC_BUG; // has a crc but cannot get it?!? } else // we must not fetch the crc yet, especially when perfoming a sequential read crc_size = tools_file_size_to_crc_size(f_other->get_size()); try { infinint err_offset; if(me->diff(*you, get_storage_size(), f_other->get_storage_size(), crc_size, value, err_offset)) throw Erange("cat_file::sub_compare", tools_printf(gettext("different file data, offset of first difference is: %i"), &err_offset)); // data is the same, comparing the CRC values if(get_crc(original)) { if(value == nullptr) throw SRC_BUG; if(original->get_size() != value->get_size()) throw Erange("cat_file::sub_compare", gettext("Same data but CRC value could not be verified because we did not guessed properly its width (sequential read restriction)")); if(*original != *value) throw Erange("cat_file::sub_compare", gettext("Same data but stored CRC does not match the data!?!")); } // else old archive without CRC } catch(...) { if(value != nullptr) delete value; throw; } if(value != nullptr) delete value; } catch(...) { delete you; throw; } delete you; } catch(...) { delete me; throw; } delete me; } else // isolated mode { if(check == nullptr) throw SRC_BUG; generic_file *you = f_other->get_data(normal); if(you == nullptr) throw SRC_BUG; try { crc *other_crc = create_crc_from_size(check->get_size(), get_pool()); if(other_crc == nullptr) throw SRC_BUG; try { null_file ignore = gf_write_only; you->copy_to(ignore, check->get_size(), other_crc); if(check->get_size() != other_crc->get_size() || *check != *other_crc) throw Erange("cat_file::compare", tools_printf(gettext("CRC difference concerning file's data (comparing with an isolated catalogue)"))); } catch(...) { delete other_crc; throw; } delete other_crc; } catch(...) { delete you; throw; } delete you; } } } } // end of namespace dar-2.5.3/src/libdar/crypto_asym.cpp0000644000175000017430000003014312641772777014340 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif } // end of extern "C" #include "tools.hpp" #include "crypto_asym.hpp" #include "integers.hpp" #include "generic_file_overlay_for_gpgme.hpp" #include "thread_cancellation.hpp" #include using namespace std; namespace libdar { #if GPGME_SUPPORT static gpgme_error_t read_passphrase(void *hook, const char *uid_hint, const char *passphrase_info, int prev_was_bad, int fd); #endif void crypto_asym::set_signatories(const std::vector & signatories) { #if GPGME_SUPPORT gpgme_key_t *signatories_key = nullptr; if(signatories.empty()) { gpgme_signers_clear(context); has_signatories = false; } else { build_key_list(signatories, signatories_key, true); try { gpgme_signers_clear(context); gpgme_key_t *ptr = signatories_key; gpgme_error_t err; if(ptr == nullptr) throw SRC_BUG; // build_key_list failed while(*ptr != nullptr) { err = gpgme_signers_add(context, *ptr); switch(gpgme_err_code(err)) { case GPG_ERR_NO_ERROR: break; default: throw Erange("crypto_asym::encrypt", string(gettext("Unexpected error reported by GPGME: ")) + tools_gpgme_strerror_r(err)); } ++ptr; } } catch(...) { release_key_list(signatories_key); gpgme_signers_clear(context); has_signatories = false; throw; } release_key_list(signatories_key); has_signatories = true; } #else throw Efeature("Asymetric Strong encryption algorithms using GPGME"); #endif } void crypto_asym::encrypt(const vector & recipients_email, generic_file & clear, generic_file & ciphered) { #if GPGME_SUPPORT gpgme_key_t *ciphering_keys = nullptr; build_key_list(recipients_email, ciphering_keys, false); try { generic_file_overlay_for_gpgme o_clear = &clear; generic_file_overlay_for_gpgme o_ciphered = &ciphered; gpgme_error_t err; if(!has_signatories) err = gpgme_op_encrypt(context, ciphering_keys, (gpgme_encrypt_flags_t)(GPGME_ENCRYPT_NO_ENCRYPT_TO|GPGME_ENCRYPT_ALWAYS_TRUST), o_clear.get_gpgme_handle(), o_ciphered.get_gpgme_handle()); else err = gpgme_op_encrypt_sign(context, ciphering_keys, (gpgme_encrypt_flags_t)(GPGME_ENCRYPT_NO_ENCRYPT_TO|GPGME_ENCRYPT_ALWAYS_TRUST), o_clear.get_gpgme_handle(), o_ciphered.get_gpgme_handle()); switch(gpgme_err_code(err)) { case GPG_ERR_NO_ERROR: break; case GPG_ERR_INV_VALUE: throw SRC_BUG; case GPG_ERR_UNUSABLE_PUBKEY: throw Erange("crypto_asym::encrypt", gettext("Key found but users are not all trusted")); default: throw Erange("crypto_asym::encrypt", string(gettext("Unexpected error reported by GPGME: ")) + tools_gpgme_strerror_r(err)); } } catch(...) { release_key_list(ciphering_keys); throw; } release_key_list(ciphering_keys); #else throw Efeature("Asymetric Strong encryption algorithms using GPGME"); #endif } void crypto_asym::decrypt(generic_file & ciphered, generic_file & clear) { #if GPGME_SUPPORT generic_file_overlay_for_gpgme o_clear = &clear; generic_file_overlay_for_gpgme o_ciphered = &ciphered; gpgme_error_t err = gpgme_op_decrypt_verify(context, o_ciphered.get_gpgme_handle(), o_clear.get_gpgme_handle()); signing_result.clear(); switch(gpgme_err_code(err)) { case GPG_ERR_NO_ERROR: fill_signing_result(); break; case GPG_ERR_INV_VALUE: throw SRC_BUG; case GPG_ERR_NO_DATA: throw Erange("crypto_asym::decrypt", gettext("No data to decrypt")); case GPG_ERR_DECRYPT_FAILED: throw Erange("crypto_asym::decrypt", gettext("Invalid Cipher text")); case GPG_ERR_BAD_PASSPHRASE: throw Erange("crypto_asym::decrypt", gettext("Failed retreiving passphrase")); default: throw Erange("crypto_asym::decrypt", string(gettext("Unexpected error reported by GPGME: ")) + tools_gpgme_strerror_r(err)); } #else throw Efeature("Asymetric Strong encryption algorithms using GPGME"); #endif } void crypto_asym::build_context() { #if GPGME_SUPPORT gpgme_error_t err = gpgme_new(&context); if(gpgme_err_code(err) != GPG_ERR_NO_ERROR) throw Erange("crypto_asym::crypto_asym", string(gettext("Failed creating GPGME context: ")) + tools_gpgme_strerror_r(err)); err = gpgme_set_protocol(context, GPGME_PROTOCOL_OpenPGP); if(gpgme_err_code(err) != GPG_ERR_NO_ERROR) throw Erange("crypto_asym::crypto_asym", string(gettext("Failed setting GPGME context with OpenPGP protocol: ")) + tools_gpgme_strerror_r(err)); gpgme_set_passphrase_cb(context, read_passphrase, (void *)this); #endif } #if GPGME_SUPPORT void crypto_asym::build_key_list(const vector & recipients_email, gpgme_key_t * & ciphering_keys, bool signatories) { U_I size = recipients_email.size() + 1; ciphering_keys = new (nothrow) gpgme_key_t[size]; if(ciphering_keys == nullptr) throw Ememory("crypto_asym::build_key_list"); // clearing all fields in order to be able to know which // index has been allocated and need to be restored in case of error for(U_I i = 0; i < size ; ++i) ciphering_keys[i] = nullptr; try { gpgme_error_t err = GPG_ERR_NO_ERROR; gpgme_user_id_t id = nullptr; bool found = false; bool eof = false; bool loop = false; U_I offset = 0; // for each recipient, listing all keys to find a match for(U_I i = 0; i < recipients_email.size(); ++i) { err = gpgme_op_keylist_start(context, nullptr, 0); switch(gpgme_err_code(err)) { case GPG_ERR_NO_ERROR: break; case GPG_ERR_INV_VALUE: throw SRC_BUG; default: throw Erange("crypto_asym::decrypt", string(gettext("Unexpected error reported by GPGME: ")) + tools_gpgme_strerror_r(err)); } found = false; eof = false; do { // getting the next key err = gpgme_op_keylist_next(context, &(ciphering_keys[i - offset])); switch(gpgme_err_code(err)) { case GPG_ERR_EOF: eof = true; break; case GPG_ERR_NO_ERROR: id = ciphering_keys[i - offset]->uids; loop = true; // for each key, listing all identies associated with it to find a match do { found = (strncmp(recipients_email[i].c_str(), id->email, recipients_email[i].size()) == 0); if(found) { if(ciphering_keys[i - offset]->revoked || ciphering_keys[i - offset]->expired || ciphering_keys[i - offset]->disabled || ciphering_keys[i - offset]->invalid) found = false; if(signatories) { if(!ciphering_keys[i - offset]->can_sign) found = false; } else { if(!ciphering_keys[i - offset]->can_encrypt) found = false; } } if(!found && id->next != nullptr) id = id->next; else loop = false; } while(loop); // if not identity match found for that key deleting the key if(!found) { gpgme_key_unref(ciphering_keys[i - offset]); ciphering_keys[i - offset] = nullptr; } break; default: throw Erange("crypto_asym::decrypt", string(gettext("Unexpected error reported by GPGME: ")) + tools_gpgme_strerror_r(err)); } } while(!found && !eof); // if we exit before gpgme_op_keylist_next() return GPG_ERR_EOF // we must update the state of the context to end the key listing operation if(!eof) (void)gpgme_op_keylist_end(context); if(!found) { if(signatories) get_ui().printf(gettext("No valid signing key could be find for %S"), &(recipients_email[i])); else get_ui().printf(gettext("No valid encryption key could be find for %S"), &(recipients_email[i])); get_ui().pause("Do you want to continue without this recipient?"); ++offset; } } // if no recipient could be found at all aborting the operation if(offset + 1 >= size) { if(signatories) throw Erange("crypto_asym::build_key_list", gettext("No signatory remain with a valid key, signing is impossible, aborting")); else throw Erange("crypto_asym::build_key_list", gettext("No recipient remain with a valid key, encryption is impossible, aborting")); } // the key list must end wth a nullptr entry if(ciphering_keys[size - 1 - offset] != nullptr) throw SRC_BUG; } catch(...) { release_key_list(ciphering_keys); throw; } } void crypto_asym::release_key_list(gpgme_key_t * & ciphering_keys) { if(ciphering_keys != nullptr) { for(U_I i = 0; ciphering_keys[i] != nullptr; ++i) gpgme_key_unref(ciphering_keys[i]); delete [] ciphering_keys; ciphering_keys = nullptr; } } void crypto_asym::fill_signing_result() { gpgme_verify_result_t inter = gpgme_op_verify_result(context); gpgme_signature_t res = nullptr; signator tmp; signing_result.clear(); if(inter != nullptr) res = inter->signatures; else res = nullptr; while(res != nullptr) { if(res->summary & (GPGME_SIGSUM_VALID|GPGME_SIGSUM_GREEN)) tmp.result = signator::good; else if(res->summary & GPGME_SIGSUM_RED) tmp.result = signator::bad; else if(res->summary & GPGME_SIGSUM_KEY_MISSING) tmp.result = signator::unknown_key; else tmp.result = signator::error; if(res->summary & GPGME_SIGSUM_KEY_REVOKED) tmp.key_validity = signator::revoked; else if(res->summary & GPGME_SIGSUM_KEY_EXPIRED) tmp.key_validity = signator::expired; else tmp.key_validity = signator::valid; tmp.fingerprint = res->fpr; tmp.signing_date = datetime(res->timestamp); tmp.signature_expiration_date = datetime(res->exp_timestamp); res = res->next; signing_result.push_back(tmp); } signing_result.sort(); } static gpgme_error_t read_passphrase(void *hook, const char *uid_hint, const char *passphrase_info, int prev_was_bad, int fd) { crypto_asym *obj = (crypto_asym *)(hook); const char * precision = gettext("Passphrase required for key %s :"); string message; secu_string pass; ssize_t wrote; gpgme_error_t ret = GPG_ERR_NO_ERROR; thread_cancellation th; if(obj == nullptr) throw SRC_BUG; if(uid_hint != nullptr) message = tools_printf(precision, uid_hint); else { if(passphrase_info != nullptr) message = tools_printf(precision, passphrase_info); else message = tools_printf(precision, ""); } if(prev_was_bad) obj->get_ui().warning(gettext("Error, invalid passphrase given, try again:")); pass = obj->get_ui().get_secu_string(message, false); th.check_self_cancellation(); wrote = write(fd, pass.c_str(), pass.get_size()); if(wrote < 0 || (U_I)(wrote) != pass.get_size()) { if(wrote == -1) obj->get_ui().warning(string(gettext("Error, while sending the passphrase to GPGME:")) + tools_strerror_r(errno)); else obj->get_ui().warning(gettext("Failed sending the totality of the passphrase to GPGME")); ret = GPG_ERR_CANCELED; } else { wrote = write(fd, "\n", 1); if(wrote != 1) obj->get_ui().warning(gettext("Failed sending CR after the passphrase")); ret = GPG_ERR_NO_ERROR; } return ret; } #endif } // end of namespace dar-2.5.3/src/libdar/fichier_global.hpp0000644000175000017430000001212512642311367014706 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file fichier_global.hpp /// \brief class fichier_global definition. This class is a pure virtual class /// class fichier_global is an abstraction of files objects whatever is their localisation /// like local filesystem, remote ftp server, etc. inherited classes (like fichier_local) /// provide full implementation /// \ingroup Private #ifndef FICHIER_GLOBAL_HPP #define FICHIER_GLOBAL_HPP #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif } // end extern "C" #include "integers.hpp" #include "thread_cancellation.hpp" #include "label.hpp" #include "crc.hpp" #include "user_interaction.hpp" #include "mem_ui.hpp" #include namespace libdar { /// \addtogroup Private /// @{ class fichier_global : public generic_file, public thread_cancellation, public mem_ui { public : enum advise { advise_normal, //< no advise given by the application advise_sequential, //< application expect to read the data sequentially advise_random, //< application expect to read the data in random order advise_noreuse, //< application does not expect to read the data more than once advise_willneed, //< application expect to read the data again in near future advise_dontneed //< application will not read the data in near future }; /// constructors /// /// \note some well defined error case must generate an Esystem exception, other by Erange or more appropriated Egeneric exceptions /// to known what type of error must be handled by Esystem object, see the Esystem::io_error enum fichier_global(const user_interaction & dialog, gf_mode mode): generic_file(mode), mem_ui(dialog) {}; fichier_global(const fichier_global & ref) : generic_file(ref), thread_cancellation(ref), mem_ui(ref) {}; // default assignment operator is fine here // default destructor is fine too here /// set the ownership of the file virtual void change_ownership(const std::string & user, const std::string & group) = 0; /// change the permission of the file virtual void change_permission(U_I perm) = 0; /// return the size of the file virtual infinint get_size() const = 0; /// set posix_fadvise for the whole file virtual void fadvise(advise adv) const = 0; protected : /// replaces generic_file::inherited_write() method, to allow the return of partial writings /// /// a partial writing is allowed when no space is available for writing /// this let global_ficher interact with the user asking whether it can make place /// or if (s)he wants to abord /// \param[in] a points to the start of the area of data to write /// \param[in] size is the size in byte of the data to write /// \return the amount of byte wrote. If the returned value is less than size, this /// is a partial write, and is assumed that free storage space is missing to complete /// the operation virtual U_I fichier_global_inherited_write(const char *a, U_I size) = 0; /// replaces generic_file::inherited_read() method, to allow the return of partial reading /// /// a partial reading is signaled by the inherited class by returning false /// \param[in] a points to the area where to store read data /// \param[in] size is the available place to store data /// \param[out] read is the total amount of data read so far /// \param[out] message is the request to send to the user upon partial reading /// \return true if the reading is full (either read the maximum allowed data or reached end of file) /// false is returned if a user interaction can let the reading go further the message to display to the /// user asking him for action. He will also be proposed to abort the current operation. virtual bool fichier_global_inherited_read(char *a, U_I size, U_I & read, std::string & message) = 0; private: // inherited from generic_file class and relocated as private methods void inherited_write(const char *a, U_I size); U_I inherited_read(char *a, U_I size); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/crypto_sym.cpp0000644000175000017430000005707212641772777014211 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } #include "crypto_sym.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "elastic.hpp" using namespace std; namespace libdar { crypto_sym::crypto_sym(U_32 block_size, const secu_string & password, generic_file & encrypted_side, bool no_initial_shift, const archive_version & reading_ver, crypto_algo algo, bool use_pkcs5) : tronconneuse(block_size, encrypted_side, no_initial_shift, reading_ver) { #if CRYPTO_AVAILABLE ivec = nullptr; clef = nullptr; essiv_clef = nullptr; if(reading_ver <= 5) throw Erange("crypto_sym::blowfish", gettext("Current implementation of blowfish encryption is not compatible with old (weak) implementation, use dar-2.3.x software (or other software based on libdar-4.4.x) to read this archive")); else { secu_string hashed_password; gcry_error_t err; algo_id = get_algo_id(algo); // checking for algorithm availability err = gcry_cipher_algo_info(algo_id, GCRYCTL_TEST_ALGO, nullptr, nullptr); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Cyphering algorithm not available in libgcrypt: %s/%s"), gcry_strsource(err),gcry_strerror(err))); // obtaining the block length err = gcry_cipher_algo_info(algo_id, GCRYCTL_GET_BLKLEN, nullptr, &algo_block_size); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Failed retrieving from libgcrypt the block size used by the cyphering algorithm: %s/%s"), gcry_strsource(err),gcry_strerror(err))); if(algo_block_size == 0) throw SRC_BUG; // initializing ivec in secure memory ivec = (unsigned char *)gcry_malloc_secure(algo_block_size); if(ivec == nullptr) throw Esecu_memory("crypto_sym::crypto_sym"); try { hashed_password = use_pkcs5 ? pkcs5_pass2key(password, "", 2000, max_key_len_libdar(algo)) : password; // key handle initialization err = gcry_cipher_open(&clef, algo_id, GCRY_CIPHER_MODE_CBC, GCRY_CIPHER_SECURE); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Error while opening libgcrypt key handle: %s/%s"), gcry_strsource(err), gcry_strerror(err))); // assigning key to the handle err = gcry_cipher_setkey(clef, (const void *)hashed_password.c_str(), hashed_password.get_size()); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Error while assigning key to libgcrypt key handle: %s/%s"), gcry_strsource(err),gcry_strerror(err))); // essiv initialization dar_set_essiv(hashed_password, essiv_clef, get_reading_version(), algo); } catch(...) { detruit(); throw; }; #ifdef LIBDAR_NO_OPTIMIZATION self_test(); #endif } #else throw Ecompilation(gettext("Missing strong encryption support (libgcrypt)")); #endif } size_t crypto_sym::max_key_len(crypto_algo algo) { #if CRYPTO_AVAILABLE size_t key_len; U_I algo_id = get_algo_id(algo); gcry_error_t err; // checking for algorithm availability err = gcry_cipher_algo_info(algo_id, GCRYCTL_TEST_ALGO, nullptr, nullptr); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Cyphering algorithm not available in libgcrypt: %s/%s"), gcry_strsource(err),gcry_strerror(err))); // obtaining the maximum key length key_len = gcry_cipher_get_algo_keylen(algo_id); if(key_len == 0) throw Erange("crypto_sym::crypto_sym",gettext("Failed retrieving from libgcrypt the maximum key length")); return key_len; #else throw Ecompilation("Strong encryption"); #endif } size_t crypto_sym::max_key_len_libdar(crypto_algo algo) { #if CRYPTO_AVAILABLE size_t key_len = max_key_len(algo); if(algo == crypto_blowfish) key_len = 56; // for historical reasons return key_len; #else throw Ecompilation("Strong encryption"); #endif } bool crypto_sym::is_a_strong_password(crypto_algo algo, const secu_string & password) { #if CRYPTO_AVAILABLE bool ret = true; gcry_error_t err; gcry_cipher_hd_t clef; U_I algo_id = get_algo_id(algo); err = gcry_cipher_open(&clef, algo_id, GCRY_CIPHER_MODE_CBC, GCRY_CIPHER_SECURE); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Error while opening libgcrypt key handle to check password strength: %s/%s"), gcry_strsource(err), gcry_strerror(err))); try { err = gcry_cipher_setkey(clef, (const void *)password.c_str(), password.get_size()); if(err != GPG_ERR_NO_ERROR) { if(gcry_err_code(err) == GPG_ERR_WEAK_KEY) ret = false; else throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Error while assigning key to libgcrypt key handle to check password strength: %s/%s"), gcry_strsource(err),gcry_strerror(err))); } } catch(...) { gcry_cipher_close(clef); throw; } gcry_cipher_close(clef); return ret; #else throw Ecompilation("Strong encryption"); #endif } void crypto_sym::detruit() { #if CRYPTO_AVAILABLE if(clef != nullptr) gcry_cipher_close(clef); if(essiv_clef != nullptr) gcry_cipher_close(essiv_clef); if(ivec != nullptr) { (void)memset(ivec, 0, algo_block_size); gcry_free(ivec); } #endif } U_32 crypto_sym::encrypted_block_size_for(U_32 clear_block_size) { return ((clear_block_size / algo_block_size) + 1) * algo_block_size; // round to the upper "algo_block_size" byte block of data. // and add an additional "algo_block_size" block if no rounding is necessary. // (we need some place to add the elastic buffer at the end of the block) } U_32 crypto_sym::clear_block_allocated_size_for(U_32 clear_block_size) { return encrypted_block_size_for(clear_block_size); } U_32 crypto_sym::encrypt_data(const infinint & block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size) { #if CRYPTO_AVAILABLE U_32 size_to_fill = encrypted_block_size_for(clear_size); // sanity checks // if(crypt_size < size_to_fill) throw SRC_BUG; // not enough room to write encrypted data if(clear_allocated < size_to_fill) // note : clear_block_size_for() returns the same as encrypted_block_size_for() throw SRC_BUG; // not large enough allocated memory in clear buffer to add padding // // end of sanity checks if(clear_size < size_to_fill) { elastic stic = elastic(size_to_fill - clear_size); gcry_error_t err; stic.dump((unsigned char *)(const_cast(clear_buf + clear_size)), (U_32)(clear_allocated - clear_size)); err = gcry_cipher_reset(clef); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_encrypt_data",tools_printf(gettext("Error while resetting encryption key for a new block: %s/%s"), gcry_strsource(err),gcry_strerror(err))); make_ivec(block_num, ivec, algo_block_size, essiv_clef); err = gcry_cipher_setiv(clef, (const void *)ivec, algo_block_size); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_encrypt_data",tools_printf(gettext("Error while setting IV for current block: %s/%s"), gcry_strsource(err),gcry_strerror(err))); err = gcry_cipher_encrypt(clef, (unsigned char *)crypt_buf, size_to_fill, (const unsigned char *)clear_buf, size_to_fill); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_encrypt_data",tools_printf(gettext("Error while cyphering data: %s/%s"), gcry_strsource(err),gcry_strerror(err))); return size_to_fill; } else throw SRC_BUG; #else throw Ecompilation(gettext("blowfish strong encryption support")); #endif } U_32 crypto_sym::decrypt_data(const infinint & block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size) { #if CRYPTO_AVAILABLE gcry_error_t err; if(crypt_size == 0) return 0; // nothing to decipher make_ivec(block_num, ivec, algo_block_size, essiv_clef); err = gcry_cipher_setiv(clef, (const void *)ivec, algo_block_size); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_encrypt_data",tools_printf(gettext("Error while setting IV for current block: %s/%s"), gcry_strsource(err),gcry_strerror(err))); err = gcry_cipher_decrypt(clef, (unsigned char *)clear_buf, crypt_size, (const unsigned char *)crypt_buf, crypt_size); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_encrypt_data",tools_printf(gettext("Error while decyphering data: %s/%s"), gcry_strsource(err),gcry_strerror(err))); elastic stoc = elastic((unsigned char *)clear_buf, crypt_size, elastic_backward, get_reading_version()); if(stoc.get_size() > crypt_size) throw Erange("crypto_sym::crypto_encrypt_data",gettext("Data corruption may have occurred, cannot decrypt data")); return crypt_size - stoc.get_size(); #else throw Ecompilation(gettext("blowfish strong encryption support")); #endif } #if CRYPTO_AVAILABLE void crypto_sym::make_ivec(const infinint & ref, unsigned char *ivec, U_I size, const gcry_cipher_hd_t & IVkey) { // Stronger IV calculation: ESSIV. // ESSIV mode helps to provide (at least) IND-CPA security. unsigned char *sect = nullptr; infinint ref_cp = ref; infinint mask = 0xFF; infinint tmp; gcry_error_t err; sect = new (nothrow) unsigned char[size]; if(sect == nullptr) throw Ememory("crypto_sym::make_ivec"); try { U_I i = size; while(i > 0) { --i; sect[i] = ref_cp[0]; ref_cp >>= 8; } // IV(sector) = E_salt(sector) err = gcry_cipher_encrypt(IVkey, (unsigned char *)ivec, size, (const unsigned char *)sect, size); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_encrypt_data",tools_printf(gettext("Error while generating IV: %s/%s"), gcry_strsource(err), gcry_strerror(err))); } catch(...) { delete [] sect; throw; } delete [] sect; } #endif #if CRYPTO_AVAILABLE secu_string crypto_sym::pkcs5_pass2key(const secu_string & password, const string & salt, U_I iteration_count, U_I output_length) { // Password-based key derivation function (PBKDF2) from PKCS#5 v2.0 // Using HMAC-SHA1 as the underlying pseudorandom function. gcry_error_t err; gcry_md_hd_t hmac; U_32 l = 0, r = 0; secu_string retval; if (output_length == 0) return secu_string(); // Let l be the number of EVP_MD_size(digest) blocks in the derived key, rounding up. // Let r be the number of octets in the last block. l = output_length / gcry_md_get_algo_dlen(GCRY_MD_SHA1); r = output_length % gcry_md_get_algo_dlen(GCRY_MD_SHA1); if (r == 0) r = gcry_md_get_algo_dlen(GCRY_MD_SHA1); else ++l; // round up // testing SHA1 availability err = gcry_md_test_algo(GCRY_MD_SHA1); if(err != GPG_ERR_NO_ERROR) throw Ecompilation(tools_printf(gettext("Error! SHA1 not available in libgcrypt: %s/%s"), gcry_strsource(err),gcry_strerror(err))); // opening a handle for Message Digest err = gcry_md_open(&hmac, GCRY_MD_SHA1, GCRY_MD_FLAG_SECURE|GCRY_MD_FLAG_HMAC); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::pkcs5_pass2key",tools_printf(gettext("Error while derivating key from password (HMAC open): %s/%s"), gcry_strsource(err),gcry_strerror(err))); // setting the HMAC key err = gcry_md_setkey(hmac, password.c_str(), password.get_size()); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::pkcs5_pass2key",tools_printf(gettext("Error while derivating key from password (HMAC set key): %s/%s"), gcry_strsource(err),gcry_strerror(err))); // now ready to compute HMAC-SHA1 message digest using "hmac" try { U_I UjLen = gcry_md_get_algo_dlen(GCRY_MD_SHA1); char *Ti = nullptr, *Uj = nullptr; retval.resize(output_length); Ti = (char *)gcry_malloc_secure(gcry_md_get_algo_dlen(GCRY_MD_SHA1)); if(Ti == nullptr) throw Ememory("crypto_sym::pkcs5_pass2key"); try { Uj = (char *)gcry_malloc_secure(gcry_md_get_algo_dlen(GCRY_MD_SHA1)); if(Uj == nullptr) throw Ememory("crypto_sym::pkcs5_pass2key"); try { for (U_32 i = 1; i <= l; ++i) { // Ti = U_1 \xor U_2 \xor ... \xor U_c // U_1 = PRF(P, S || INT(i)) unsigned char ii[4]; unsigned char *tmp_md = nullptr; ii[0] = (i >> 24) & 0xff; ii[1] = (i >> 16) & 0xff; ii[2] = (i >> 8) & 0xff; ii[3] = i & 0xff; gcry_md_reset(hmac); gcry_md_write(hmac, (const unsigned char *) salt.c_str(), salt.size()); gcry_md_write(hmac, ii, 4); tmp_md = gcry_md_read(hmac, GCRY_MD_SHA1); (void)memcpy(Uj, tmp_md, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); (void)memcpy(Ti, tmp_md, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); for (U_32 j = 2; j <= iteration_count; ++j) { // U_j = PRF(P, U_{j-1}) gcry_md_reset(hmac); gcry_md_write(hmac, (const unsigned char *) Uj, UjLen); tmp_md = gcry_md_read(hmac, GCRY_MD_SHA1); (void)memcpy(Uj, tmp_md, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); tools_memxor(Ti, tmp_md, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); } if (i < l) retval.append(Ti, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); else // last block retval.append(Ti, r); } // end of main for() loop } catch(...) { (void)memset(Uj, 0, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); gcry_free(Uj); throw; } (void)memset(Uj, 0, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); gcry_free(Uj); } catch(...) { (void)memset(Ti, 0, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); gcry_free(Ti); throw; } (void)memset(Ti, 0, gcry_md_get_algo_dlen(GCRY_MD_SHA1)); gcry_free(Ti); } catch(...) { gcry_md_close(hmac); throw; } gcry_md_close(hmac); return retval; } #endif #if CRYPTO_AVAILABLE void crypto_sym::dar_set_essiv(const secu_string & key, gcry_cipher_hd_t & IVkey, const archive_version & ver, crypto_algo main_cipher) { // Calculate the ESSIV salt. // Recall that ESSIV(sector) = E_salt(sector); salt = H(key). unsigned int IV_cipher; unsigned int IV_hashing; if(ver >= archive_version(8,1) && main_cipher != crypto_blowfish) { IV_cipher = GCRY_CIPHER_AES256; // to have an algorithm available when ligcrypt is used in FIPS mode IV_hashing = GCRY_MD_SHA256; // SHA224 was also ok but as time passes, it would get sooner unsave } else { // due to 8 bytes block_size we keep using // blowfish for the essiv key: other cipher have 16 bytes block size // and generating an IV of eight bytes would require doubling the size // of the data to encrypt and skinking the encrypted data afterward to // the 8 requested bytes of the IV for the main key... // // in the other side, the replacement of blowfish by aes256 starting format 8.1 // was requested to have libdar working when libgcrypt is in FIPS mode, which // forbids the use of blowfish... we stay here compatible with FIPS mode. IV_cipher = GCRY_CIPHER_BLOWFISH; IV_hashing = GCRY_MD_SHA1; } void *digest = nullptr; U_I digest_len = gcry_md_get_algo_dlen(IV_hashing); gcry_error_t err; if(digest_len == 0) throw SRC_BUG; digest = gcry_malloc_secure(digest_len); if(digest == nullptr) throw Ememory("crypto_sym::dar_set_essiv"); try { // making a hash of the provided password into the digest variable gcry_md_hash_buffer(IV_hashing, digest, (const void *)key.c_str(), key.get_size()); // creating a handle for a new handle with algo equal to "IV_cipher" err = gcry_cipher_open(&IVkey, IV_cipher, GCRY_CIPHER_MODE_ECB, GCRY_CIPHER_SECURE); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::dar_set_essiv",tools_printf(gettext("Error while creating ESSIV handle: %s/%s"), gcry_strsource(err),gcry_strerror(err))); // obtaining key len for IV_cipher size_t essiv_key_len; err = gcry_cipher_algo_info(IV_cipher, GCRYCTL_GET_KEYLEN, nullptr, &essiv_key_len); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Failed retrieving from libgcrypt the key length to use (essiv key): %s/%s"), gcry_strsource(err),gcry_strerror(err))); // failing if the digest size is larger than key size for IV_cipher if(digest_len > essiv_key_len && IV_cipher != GCRY_CIPHER_BLOWFISH) throw SRC_BUG; // IV_cipher and IV_hashing must be chosen in coherence! // we do not complain for older format archive... its done now and worked so far. // This bug report is rather to signal possible problem when time will come // to update the cipher and digest algorithms // assiging the digest as key for the new handle err = gcry_cipher_setkey(IVkey, digest, digest_len); if(err != GPG_ERR_NO_ERROR) { // tolerating WEAK key here, we use that key to fill the IV of the real strong key if(gpg_err_code(err) != GPG_ERR_WEAK_KEY) throw Erange("crypto_sym::dar_set_essiv",tools_printf(gettext("Error while assigning key to libgcrypt key handle (essiv): %s/%s"), gcry_strsource(err),gcry_strerror(err))); } // obtaining the block size of the essiv cipher size_t algo_block_size_essiv; err = gcry_cipher_algo_info(IV_cipher, GCRYCTL_GET_BLKLEN, nullptr, &algo_block_size_essiv); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Failed retrieving from libgcrypt the block size used by the cyphering algorithm (essiv): %s/%s"), gcry_strsource(err),gcry_strerror(err))); if(algo_block_size_essiv == 0) throw SRC_BUG; // obtaining the block size of the main cipher size_t local_algo_block_size; err = gcry_cipher_algo_info(get_algo_id(main_cipher), GCRYCTL_GET_BLKLEN, nullptr, &local_algo_block_size); if(err != GPG_ERR_NO_ERROR) throw Erange("crypto_sym::crypto_sym",tools_printf(gettext("Failed retrieving from libgcrypt the block size used by the cyphering algorithm: %s/%s"), gcry_strsource(err),gcry_strerror(err))); if(local_algo_block_size == 0) throw SRC_BUG; // testing the coherence of block size between main cipher key // and cipher key used to generate IV for the main cipher key if(local_algo_block_size < algo_block_size_essiv) throw SRC_BUG; // cannot cipher less data (IV for main key) than block size of IV key else if(local_algo_block_size % algo_block_size_essiv != 0) throw SRC_BUG; // in ECB mode we should encrypt an integer number of blocks according // to IV key block size } catch(...) { (void)memset(digest, 0, digest_len); // attempt to scrub memory gcry_free(digest); throw; } (void)memset(digest, 0, digest_len); // attempt to scrub memory gcry_free(digest); } #endif #ifdef LIBDAR_NO_OPTIMIZATION void crypto_sym::self_test(void) { #if CRYPTO_AVAILABLE // // Test PBKDF2 (test vectors are from RFC 3962.) // secu_string result; string p1 = "password"; string p2 = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // 64 characters string p4 = p2 + "X"; // 65 characters secu_string pass = secu_string(100); gcry_cipher_hd_t esivkey; pass.append(p1.c_str(), (U_I)p1.size()); result = pkcs5_pass2key(pass, "ATHENA.MIT.EDUraeburn", 1, 16); if (result != string("\xcd\xed\xb5\x28\x1b\xb2\xf8\x01\x56\x5a\x11\x22\xb2\x56\x35\x15", 16)) throw Erange("crypto_sym::self_test", gettext("Library used for blowfish encryption does not respect RFC 3962")); result = pkcs5_pass2key(pass, "ATHENA.MIT.EDUraeburn", 1200, 32); if (result != string("\x5c\x08\xeb\x61\xfd\xf7\x1e\x4e\x4e\xc3\xcf\x6b\xa1\xf5\x51\x2b" "\xa7\xe5\x2d\xdb\xc5\xe5\x14\x2f\x70\x8a\x31\xe2\xe6\x2b\x1e\x13", 32) ) throw Erange("crypto_sym::self_test", gettext("Library used for blowfish encryption does not respect RFC 3962")); pass.clear(); pass.append(p2.c_str(), (U_I)p2.size()); result = pkcs5_pass2key(pass, "pass phrase equals block size", 1200, 32); if (result != string("\x13\x9c\x30\xc0\x96\x6b\xc3\x2b\xa5\x5f\xdb\xf2\x12\x53\x0a\xc9" "\xc5\xec\x59\xf1\xa4\x52\xf5\xcc\x9a\xd9\x40\xfe\xa0\x59\x8e\xd1", 32)) throw Erange("crypto_sym::self_test", gettext("Library used for blowfish encryption does not respect RFC 3962")); pass.resize((U_I)p4.size()); pass.append(p4.c_str(), (U_I)p4.size()); result = pkcs5_pass2key(pass, "pass phrase exceeds block size", 1200, 32); if (result != string("\x9c\xca\xd6\xd4\x68\x77\x0c\xd5\x1b\x10\xe6\xa6\x87\x21\xbe\x61" "\x1a\x8b\x4d\x28\x26\x01\xdb\x3b\x36\xbe\x92\x46\x91\x5e\xc8\x2a", 32)) throw Erange("crypto_sym::self_test", gettext("Library used for blowfish encryption does not respect RFC 3962")); // // Test make_ivec // struct { unsigned int sector; char iv[9]; } tests[] = { { 0, "\x79\xbf\x81\x22\x26\xe4\x13\x6f" }, { 7, "\x61\x03\xd1\x20\x8a\x0d\x22\x2d" }, { 8, "\xc9\x61\xce\x29\x2e\x65\x28\xbe" }, { 0x10000007, "\x37\xe9\xc0\x92\xc3\x55\xfb\x4b" }, { 0xa5a55a5a, "\x08\x7f\x1a\xa9\xec\x4a\xc0\xc5" }, { 0xffffffff, "\x7a\x8f\x9c\xd0\xcb\xcc\x56\xec" }, { 0xdeadbeef, "" } }; char ivec[8]; int i; string p3 = string("\0\0\0\0", 4); pass.clear(); pass.append(p3.c_str(), (U_I)p3.size()); dar_set_essiv(pass, esivkey, 1, crypto_blowfish); try { for (i = 0; tests[i].sector != 0xdeadbeef; ++i) { make_ivec(tests[i].sector, (unsigned char *) ivec, 8, esivkey); if (memcmp(ivec, tests[i].iv, 8) != 0) //cerr << "sector = " << tests[i].sector << endl; //cerr << "ivec = @@" << string(ivec, 8) << "@@" << endl; //cerr << "should be @@" << string(tests[i].iv, 8) << "@@" << endl; throw Erange("crypto_sym::self_test", gettext("Library used for blowfish encryption does not respect RFC 3962")); } } catch(...) { gcry_cipher_close(esivkey); throw; } gcry_cipher_close(esivkey); #endif } #endif #if CRYPTO_AVAILABLE U_I crypto_sym::get_algo_id(crypto_algo algo) { U_I algo_id; switch(algo) { case crypto_blowfish: algo_id = GCRY_CIPHER_BLOWFISH; break; case crypto_aes256: algo_id = GCRY_CIPHER_AES256; break; case crypto_twofish256: algo_id = GCRY_CIPHER_TWOFISH; break; case crypto_serpent256: algo_id = GCRY_CIPHER_SERPENT256; break; case crypto_camellia256: algo_id = GCRY_CIPHER_CAMELLIA256; break; default: throw SRC_BUG; } return algo_id; } #endif } // end of namespace dar-2.5.3/src/libdar/filesystem.hpp0000644000175000017430000004233112642457363014152 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file filesystem.hpp /// \brief defines several classes that realize the interface with the filesystem /// \ingroup Private /// /// - filesystem_hard_link_read /// - filesystem_backup /// - filesystem_diff /// - filesystem_hard_link_write /// - filesystem_restore #ifndef FILESYSTEM_HPP #define FILESYSTEM_HPP #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_STAT_H #include #endif } // end extern "C" #include #include #include "catalogue.hpp" #include "infinint.hpp" #include "etage.hpp" #include "criterium.hpp" #include "fsa_family.hpp" #include "on_pool.hpp" #include "cat_all_entrees.hpp" namespace libdar { /// \addtogroup Private /// @{ /// keep trace of hard links when reading the filesystem class filesystem_hard_link_read : virtual protected mem_ui, virtual public on_pool { // this class is not to be used directly // it only provides some routine for the inherited classes public: filesystem_hard_link_read(user_interaction & dialog, bool x_furtive_read_mode, const fsa_scope & scope) : mem_ui(&dialog) { furtive_read_mode = x_furtive_read_mode; sc = scope; }; // the copy of the current object would make copy of addresses in // corres_read that could be released twice ... thus, copy constructor and // assignement are forbidden for this class: filesystem_hard_link_read(const filesystem_hard_link_read & ref) : mem_ui(ref) { throw SRC_BUG; }; const filesystem_hard_link_read & operator = (const filesystem_hard_link_read & ref) { throw SRC_BUG; }; // get the last assigned number for a hard linked inode const infinint & get_last_etoile_ref() const { return etiquette_counter; }; virtual ~filesystem_hard_link_read() {}; /// provide the FSA scope used by the object const fsa_scope get_fsa_scope() const { return sc; }; protected: // reset the whole list of hard linked inodes (hard linked inode stay alive but are no more referenced by the current object) void corres_reset() { corres_read.clear(); etiquette_counter = 0; }; // create and return a libdar object corresponding to one pointed to by its path // during this operation, hard linked inode are recorded in a list to be easily pointed // to by a new reference to it. cat_nomme *make_read_entree(path & lieu, //< path of the file to read const std::string & name, //< name of the file to read bool see_hard_link, //< whether we want to detect hard_link and eventually return a cat_mirage object (not necessary when diffing an archive with filesystem) const mask & ea_mask); //< which EA to consider when creating the object private: // private datastructure struct couple { nlink_t count; //< counts the number of hard link on that inode that have not yet been found in filesystem, once this count reaches zero, the "couple" structure can be dropped and the "holder" too (no more expected hard links to be found) cat_etoile *obj; //< the address of the corresponding cat_etoile object for that inode cat_mirage holder; //< it increments by one the obj internal counters, thus, while this object is alive, the obj will not be destroyed couple(cat_etoile *ptr, nlink_t ino_count) : holder("FAKE", ptr) { count = ino_count; obj = ptr; }; }; struct node { node(ino_t num, dev_t dev) { numnode = num; device = dev; }; // this operator is required to use the type node in a std::map bool operator < (const node & ref) const { return numnode < ref.numnode || (numnode == ref.numnode && device < ref.device); }; ino_t numnode; dev_t device; }; // private variable std::map corres_read; infinint etiquette_counter; bool furtive_read_mode; fsa_scope sc; }; /// make a flow sequence of inode to feed the backup filtering routing class filesystem_backup : public filesystem_hard_link_read { public: filesystem_backup(user_interaction & dialog, const path &root, bool x_info_details, const mask & x_ea_mask, bool check_no_dump_flag, bool alter_atime, bool furtive_read_mode, bool x_cache_directory_tagging, infinint & root_fs_device, bool x_ignore_unknown, const fsa_scope & scope); filesystem_backup(const filesystem_backup & ref) : mem_ui(ref), filesystem_hard_link_read(ref.get_ui(), ref.furtive_read_mode, get_fsa_scope()) { copy_from(ref); }; const filesystem_backup & operator = (const filesystem_backup & ref) { detruire(); copy_from(ref); return *this; }; ~filesystem_backup() { detruire(); }; void reset_read(infinint & root_fs_device); bool read(cat_entree * & ref, infinint & errors, infinint & skipped_dump); void skip_read_to_parent_dir(); // continue reading in parent directory and // ignore all entry not yet read of current directory private: path *fs_root; //< filesystem's root to consider bool info_details; //< detailed information returned to the user mask *ea_mask; //< mask defining the EA to consider bool no_dump_check; //< whether to check against the nodump flag presence bool alter_atime; //< whether to set back atime or not bool furtive_read_mode; //< whether to use furtive read mode (if true, alter_atime is ignored) bool cache_directory_tagging; //< whether to consider cache directory taggin standard path *current_dir; //< needed to translate from an hard linked inode to an already allocated object std::vector pile; //< to store the contents of a directory bool ignore_unknown; //< whether to ignore unknown inode types void detruire(); void copy_from(const filesystem_backup & ref); }; /// make a flow of inode to feed the difference filter routine class filesystem_diff : public filesystem_hard_link_read { public: filesystem_diff(user_interaction & dialog, const path &root, bool x_info_details, const mask & x_ea_mask, bool alter_atime, bool furtive_read_mode, const fsa_scope & scope); filesystem_diff(const filesystem_diff & ref) : mem_ui(ref), filesystem_hard_link_read(ref.get_ui(), ref.furtive_read_mode, get_fsa_scope()) { copy_from(ref); }; const filesystem_diff & operator = (const filesystem_diff & ref) { detruire(); copy_from(ref); return *this; }; ~filesystem_diff() { detruire(); }; void reset_read(); bool read_filename(const std::string & name, cat_nomme * &ref); // looks for a file of name given in argument, in current reading directory // if this is a directory, subsequent read take place in it void skip_read_filename_in_parent_dir(); // subsequent calls to read_filename will take place in parent directory. private: struct filename_struct { datetime last_acc; datetime last_mod; }; path *fs_root; bool info_details; mask *ea_mask; bool alter_atime; bool furtive_read_mode; path *current_dir; std::vector filename_pile; void detruire(); void copy_from(const filesystem_diff & ref); }; /// keep trace of already written inodes to restore hard links class filesystem_hard_link_write : virtual protected mem_ui, virtual public on_pool { // this class is not to be used directly // it only provides routines to its inherited classes public: filesystem_hard_link_write(user_interaction & dialog) : mem_ui(& dialog) { corres_write.clear(); }; filesystem_hard_link_write(const filesystem_hard_link_write & ref) : mem_ui(ref) { throw SRC_BUG; }; const filesystem_hard_link_write & operator = (const filesystem_hard_link_write & ref) { throw SRC_BUG; }; void write_hard_linked_target_if_not_set(const cat_mirage *ref, const std::string & chemin); // if a hard linked inode has not been restored (no change, or less recent than the one on filesystem) // it is necessary to inform filesystem, where to hard link on, any future hard_link // that could be necessary to restore. bool known_etiquette(const infinint & eti); // return true if an inode in filesystem has been seen for that hard linked inode /// forget everything about a hard link if the path used to build subsequent hard links is the one given in argument /// \param[in] ligne is the etiquette number for that hard link /// \param[in] path if the internaly recorded path to build subsequent hard link to that inode is equal to path, forget everything about this hard linked inode void clear_corres_if_pointing_to(const infinint & ligne, const std::string & path); protected: void corres_reset() { corres_write.clear(); }; void make_file(const cat_nomme * ref, //< object to restore in filesystem const path & ou, //< where to restore it bool dir_perm, //< false for already existing directories, this makes dar set the minimum available permission to be able to restore files in that directory at a later time cat_inode::comparison_fields what_to_check, //< defines whether to restore permission, ownership, dates, etc. const fsa_scope & scope); //< fsa scope to use for restoration // generate inode or make a hard link on an already restored or existing inode. /// add the given EA matching the given mask to the file pointed to by "e" and spot /// \param[in] e may be an inode or a hard link to an inode, /// \param[in] list_ea the list of EA to restore /// \param[in] spot the path where to restore these EA (full path required, including the filename of 'e') /// \param[in] ea_mask the EA entry to restore from the list_ea (other entries are ignored) /// \return true if EA could be restored, false if "e" is a hard link to an inode that has its EA already restored previously /// \note the list_ea EA are restored to spot path, the object e is only here to validate that this operation /// has not already been done through another hard linked inode to that same inode bool raw_set_ea(const cat_nomme *e, const ea_attributs & list_ea, const std::string & spot, const mask & ea_mask); // check whether the inode for which to restore EA is not a hard link to // an already restored inode. if not, it calls the proper ea_filesystem call to restore EA /// remove EA set from filesystem's file, allows subsequent raw_set_ea /// \param[in] e this object may be a hard link to or an inode /// \param[in] path the path in the filesystem where reside the object whose EA to clear /// \return true if EA could be cleared, false if "e" is a hard link to an inode that has its EA already restored previously bool raw_clear_ea_set(const cat_nomme *e, const std::string & path); private: struct corres_ino_ea { std::string chemin; bool ea_restored; }; std::map corres_write; }; /// receive the flow of inode from the restoration filtering routing and promotes these to real filesystem objects class filesystem_restore : public filesystem_hard_link_write, public filesystem_hard_link_read { public: /// constructor filesystem_restore(user_interaction & dialog, const path & root, bool x_warn_overwrite, bool x_info_details, const mask & x_ea_mask, cat_inode::comparison_fields what_to_check, bool x_warn_remove_no_match, bool empty, const crit_action *x_overwrite, bool x_only_overwrite, const fsa_scope & scope); /// copy constructor is forbidden (throws an exception) filesystem_restore(const filesystem_restore & ref) : mem_ui(ref), filesystem_hard_link_write(ref), filesystem_hard_link_read(get_ui(), true, get_fsa_scope()) { throw SRC_BUG; }; /// assignment operator is forbidden (throws an exception) const filesystem_restore & operator = (const filesystem_restore & ref) { throw SRC_BUG; }; /// destructor ~filesystem_restore() { restore_stack_dir_ownership(); detruire(); }; /// reset the writing process for the current object void reset_write(); typedef enum { done_data_restored, //< data has been restored to filesystem done_no_change_no_data, //< no change in filesystem because no data present in archive done_no_change_policy, //< no change in filesystem because of overwiting policy decision done_data_removed //< data (= whole inode) removed from filesystem } action_done_for_data; /// restore a libdar object to a filesystem entry both data and EA /// \param[in] x is the libdar object to restore /// \param[out] data_restored true if data has been restored (inode or hard link created), false if either there is no data to restore or if this action is forbidden by the overwriting policy /// \param[out] ea_restored true if EA has been restored, false if either no EA to restore or if forbidden by overwriting policy /// \param[out] data_created true if data has been restored leading to file creation, false in any other case /// \param[out] hard_link true when data_restored is true and only a hard link to an already existing inode has been created /// \param[out] fsa_restored true if FSA has been restored, false if either no FSA to restore or if forbidden by overwriting policy /// \note any failure to restore data or EA that is not due to its absence in "x" nor to an interdiction from the overwriting policy is signaled /// through an exception. void write(const cat_entree *x, action_done_for_data & data_restored, bool & ea_restored, bool & data_created, bool & hard_link, bool & fsa_restored); /// ask for no warning or user interaction for the next write operation /// \note this is used when a file has been saved several times due to its changes at the time of the backup /// and is restored in sequential read. Restoring each failed backup would lead to ask each time the /// actions to take about overwriting... anoying for the user void ignore_overwrite_restrictions_for_next_write() { ignore_over_restricts = true; }; private: class stack_dir_t : public cat_directory { public: stack_dir_t(const cat_directory & ref, bool restore) : cat_directory(ref) { restore_date = restore; }; bool get_restore_date() const { return restore_date; }; void set_restore_date(bool val) { restore_date = val; }; private: bool restore_date; }; path *fs_root; bool info_details; mask *ea_mask; bool warn_overwrite; cat_inode::comparison_fields what_to_check; bool warn_remove_no_match; std::vector stack_dir; path *current_dir; bool empty; bool ignore_over_restricts; const crit_action *overwrite; bool only_overwrite; void detruire(); void restore_stack_dir_ownership(); // subroutines of write() /// perform action due to the overwriting policy when the "to be added" entry is a detruit object void action_over_remove(const cat_inode *in_place, const cat_detruit *to_be_added, const std::string & spot, over_action_data action); /// perform action for data due to the overwriting policy when the "to be added" entry is not a cat_detruit void action_over_data(const cat_inode *in_place, const cat_nomme *to_be_added, const std::string & spot, over_action_data action, action_done_for_data & data_done); /// perform action for EA due to overwriting policy bool action_over_ea(const cat_inode *in_place, const cat_nomme *to_be_added, const std::string & spot, over_action_ea action); /// perform action for FSA due to overwriting policy bool action_over_fsa(const cat_inode *in_place, const cat_nomme *to_be_added, const std::string & spot, over_action_ea action); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/wrapperlib.cpp0000644000175000017430000003770512641773000014125 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "wrapperlib.hpp" #include "erreurs.hpp" #define CHECK_Z if(z_ptr == nullptr) throw SRC_BUG #define CHECK_BZ if(bz_ptr == nullptr) throw SRC_BUG #define CHECK_LZMA if(lzma_ptr == nullptr) throw SRC_BUG; using namespace std; namespace libdar { #if LIBZ_AVAILABLE static S_I zlib2wrap_code(S_I code); static S_I wrap2zlib_code(S_I code); #endif #if LIBBZ2_AVAILABLE static S_I bzlib2wrap_code(S_I code); static S_I wrap2bzlib_code(S_I code); #endif #if LIBLZMA_AVAILABLE static S_I lzma2wrap_code(S_I code); static lzma_action wrap2lzma_code(S_I code); #endif wrapperlib::wrapperlib(wrapperlib_mode mode) { switch(mode) { case zlib_mode: #if LIBZ_AVAILABLE meta_new(z_ptr, 1); if(z_ptr == nullptr) throw Ememory("wrapperlib::wrapperlib"); #if LIBBZ2_AVAILABLE bz_ptr = nullptr; #endif #if LIBLZMA_AVAILABLE lzma_ptr = nullptr; #endif z_ptr->zalloc = nullptr; z_ptr->zfree = nullptr; z_ptr->opaque = nullptr; x_compressInit = & wrapperlib::z_compressInit; x_decompressInit = & wrapperlib::z_decompressInit; x_compressEnd = & wrapperlib::z_compressEnd; x_decompressEnd = & wrapperlib::z_decompressEnd; x_compress = & wrapperlib::z_compress; x_decompress = & wrapperlib::z_decompress; x_set_next_in = & wrapperlib::z_set_next_in; x_set_avail_in = & wrapperlib::z_set_avail_in; x_get_avail_in = & wrapperlib::z_get_avail_in; x_get_total_in = & wrapperlib::z_get_total_in; x_set_next_out = & wrapperlib::z_set_next_out; x_get_next_out = & wrapperlib::z_get_next_out; x_set_avail_out = & wrapperlib::z_set_avail_out; x_get_avail_out = & wrapperlib::z_get_avail_out; x_get_total_out = & wrapperlib::z_get_total_out; break; #else throw Ecompilation("zlib compression support"); #endif case bzlib_mode: #if LIBBZ2_AVAILABLE meta_new(bz_ptr, 1); if(bz_ptr == nullptr) throw Ememory("wrapperlib::wrapperlib"); #if LIBZ_AVAILABLE z_ptr = nullptr; #endif #if LIBLZMA_AVAILABLE lzma_ptr = nullptr; #endif bz_ptr->bzalloc = nullptr; bz_ptr->bzfree = nullptr; bz_ptr->opaque = nullptr; x_compressInit = & wrapperlib::bz_compressInit; x_decompressInit = & wrapperlib::bz_decompressInit; x_compressEnd = & wrapperlib::bz_compressEnd; x_decompressEnd = & wrapperlib::bz_decompressEnd; x_compress = & wrapperlib::bz_compress; x_decompress = & wrapperlib::bz_decompress; x_set_next_in = & wrapperlib::bz_set_next_in; x_set_avail_in = & wrapperlib::bz_set_avail_in; x_get_avail_in = & wrapperlib::bz_get_avail_in; x_get_total_in = & wrapperlib::bz_get_total_in; x_set_next_out = & wrapperlib::bz_set_next_out; x_get_next_out = & wrapperlib::bz_get_next_out; x_set_avail_out = & wrapperlib::bz_set_avail_out; x_get_avail_out = & wrapperlib::bz_get_avail_out; x_get_total_out = & wrapperlib::bz_get_total_out; break; #else throw Ecompilation("libbz2 compression support"); #endif case xz_mode: #if LIBZ_AVAILABLE z_ptr = nullptr; #endif #if LIBBZ2_AVAILABLE bz_ptr = nullptr; #endif #if LIBLZMA_AVAILABLE meta_new(lzma_ptr, 1); if(lzma_ptr == nullptr) throw Ememory("wrapperlib::wrapperlib"); *lzma_ptr = LZMA_STREAM_INIT; x_compressInit = & wrapperlib::lzma_compressInit; x_decompressInit = & wrapperlib::lzma_decompressInit; x_compressEnd = & wrapperlib::lzma_end; x_decompressEnd = & wrapperlib::lzma_end; x_compress = & wrapperlib::lzma_encode; x_decompress = & wrapperlib::lzma_encode; x_set_next_in = & wrapperlib::lzma_set_next_in; x_set_avail_in = & wrapperlib::lzma_set_avail_in; x_get_avail_in = & wrapperlib::lzma_get_avail_in; x_get_total_in = & wrapperlib::lzma_get_total_in; x_set_next_out = & wrapperlib::lzma_set_next_out; x_get_next_out = & wrapperlib::lzma_get_next_out; x_set_avail_out = & wrapperlib::lzma_set_avail_out; x_get_avail_out = & wrapperlib::lzma_get_avail_out; x_get_total_out = & wrapperlib::lzma_get_total_out; #endif break; default: throw SRC_BUG; } level = -1; } wrapperlib::wrapperlib(const wrapperlib & ref) { throw Efeature(gettext("Cannot copy a wrapperlib object (NOT IMPLEMENTED)")); } const wrapperlib & wrapperlib::operator = (const wrapperlib & ref) { throw Efeature(gettext("Cannot copy a wrapperlib object (NOT IMPLEMENTED)")); } wrapperlib::~wrapperlib() { #if LIBZ_AVAILABLE if(z_ptr != nullptr) meta_delete(z_ptr); #endif #if LIBBZ2_AVAILABLE if(bz_ptr != nullptr) meta_delete(bz_ptr); #endif #if LIBLZMA_AVAILABLE if(lzma_ptr != nullptr) { ::lzma_end(lzma_ptr); meta_delete(lzma_ptr); } #endif } ////////////// Zlib routines ///////////// #if LIBZ_AVAILABLE S_I wrapperlib::z_compressInit(U_I compression_level) { CHECK_Z; return zlib2wrap_code(deflateInit(z_ptr, compression_level)); } S_I wrapperlib::z_decompressInit() { CHECK_Z; return zlib2wrap_code(inflateInit(z_ptr)); } S_I wrapperlib::z_compressEnd() { CHECK_Z; return zlib2wrap_code(deflateEnd(z_ptr)); } S_I wrapperlib::z_decompressEnd() { CHECK_Z; return zlib2wrap_code(inflateEnd(z_ptr)); } S_I wrapperlib::z_compress(S_I flag) { CHECK_Z; return zlib2wrap_code(deflate(z_ptr, wrap2zlib_code(flag))); } S_I wrapperlib::z_decompress(S_I flag) { CHECK_Z; return zlib2wrap_code(inflate(z_ptr, wrap2zlib_code(flag))); } void wrapperlib::z_set_next_in(const char *x) { CHECK_Z; z_ptr->next_in = (Bytef *)x; } void wrapperlib::z_set_avail_in(U_I x) { CHECK_Z; z_ptr->avail_in = x; } U_I wrapperlib::z_get_avail_in() const { CHECK_Z; return z_ptr->avail_in; } U_64 wrapperlib::z_get_total_in() const { CHECK_Z; return z_ptr->total_in; } void wrapperlib::z_set_next_out(char *x) { CHECK_Z; z_ptr->next_out = (Bytef *)x; } char *wrapperlib::z_get_next_out() const { CHECK_Z; return (char *)z_ptr->next_out; } void wrapperlib::z_set_avail_out(U_I x) { CHECK_Z; z_ptr->avail_out = x; } U_I wrapperlib::z_get_avail_out() const { CHECK_Z; return z_ptr->avail_out; } U_64 wrapperlib::z_get_total_out() const { CHECK_Z; return z_ptr->total_out; } #endif ////////////// BZlib routines ///////////// #if LIBBZ2_AVAILABLE void wrapperlib::bz_set_next_in(const char *x) { CHECK_BZ; bz_ptr->next_in = (char*)x; // It must be a bug in bz that the input is not a const char* } void wrapperlib::bz_set_avail_in(U_I x) { CHECK_BZ; bz_ptr->avail_in = x; } U_I wrapperlib::bz_get_avail_in() const { CHECK_BZ; return bz_ptr->avail_in; } U_64 wrapperlib::bz_get_total_in() const { CHECK_BZ; return ((U_64)(bz_ptr->total_in_hi32) << 32) | ((U_64)(bz_ptr->total_in_lo32)); } void wrapperlib::bz_set_next_out(char *x) { CHECK_BZ; bz_ptr->next_out = x; } char *wrapperlib::bz_get_next_out() const { CHECK_BZ; return bz_ptr->next_out; } void wrapperlib::bz_set_avail_out(U_I x) { CHECK_BZ; bz_ptr->avail_out = x; } U_I wrapperlib::bz_get_avail_out() const { CHECK_BZ; return bz_ptr->avail_out; } U_64 wrapperlib::bz_get_total_out() const { CHECK_BZ; return ((U_64)(bz_ptr->total_out_hi32) << 32) | ((U_64)(bz_ptr->total_out_lo32)); } S_I wrapperlib::bz_compressInit(U_I compression_level) { CHECK_BZ; return bzlib2wrap_code(BZ2_bzCompressInit(bz_ptr, compression_level, 0, 30)); } S_I wrapperlib::bz_decompressInit() { CHECK_BZ; return bzlib2wrap_code(BZ2_bzDecompressInit(bz_ptr, 0,0)); } S_I wrapperlib::bz_compressEnd() { CHECK_BZ; return bzlib2wrap_code(BZ2_bzCompressEnd(bz_ptr)); } S_I wrapperlib::bz_decompressEnd() { CHECK_BZ; return bzlib2wrap_code(BZ2_bzDecompressEnd(bz_ptr)); } S_I wrapperlib::bz_compress(S_I flag) { S_I ret; CHECK_BZ; ret = BZ2_bzCompress(bz_ptr, wrap2bzlib_code(flag)); if(ret == BZ_SEQUENCE_ERROR) ret = BZ_STREAM_END; return bzlib2wrap_code(ret); } S_I wrapperlib::bz_decompress(S_I flag) { // flag is not used here. S_I ret; CHECK_BZ; ret = BZ2_bzDecompress(bz_ptr); if(ret == BZ_SEQUENCE_ERROR) ret = BZ_STREAM_END; return bzlib2wrap_code(ret); } #endif ////////////// LZMA routines ///////////// #if LIBLZMA_AVAILABLE S_I wrapperlib::lzma_compressInit(U_I compression_level) { CHECK_LZMA; return lzma2wrap_code(lzma_easy_encoder(lzma_ptr, compression_level, LZMA_CHECK_CRC32)); // CR32 is large enough, even no LZMA_CHECK_NONE would // be possible as compressed data is protected by libdar // CRC which width is proportionnal to the size of the // compressed file. } S_I wrapperlib::lzma_decompressInit() { CHECK_LZMA; return lzma2wrap_code(lzma_auto_decoder(lzma_ptr, UINT64_MAX, 0)); } S_I wrapperlib::lzma_end() { CHECK_LZMA; return WR_OK; // nothing done } S_I wrapperlib::lzma_encode(S_I flag) { CHECK_LZMA; return lzma2wrap_code(lzma_code(lzma_ptr, wrap2lzma_code(flag))); } void wrapperlib::lzma_set_next_in(const char *x) { CHECK_LZMA; lzma_ptr->next_in = (Bytef *)x; } void wrapperlib::lzma_set_avail_in(U_I x) { CHECK_LZMA; lzma_ptr->avail_in = x; } U_I wrapperlib::lzma_get_avail_in() const { CHECK_LZMA; return lzma_ptr->avail_in; } U_64 wrapperlib::lzma_get_total_in() const { CHECK_LZMA; return lzma_ptr->total_in; } void wrapperlib::lzma_set_next_out(char *x) { CHECK_LZMA; lzma_ptr->next_out = (Bytef *)x; } char *wrapperlib::lzma_get_next_out() const { CHECK_LZMA; return (char *)lzma_ptr->next_out; } void wrapperlib::lzma_set_avail_out(U_I x) { CHECK_LZMA; lzma_ptr->avail_out = x; } U_I wrapperlib::lzma_get_avail_out() const { CHECK_LZMA; return lzma_ptr->avail_out; } U_64 wrapperlib::lzma_get_total_out() const { CHECK_LZMA; return lzma_ptr->total_out; } #endif S_I wrapperlib::compressReset() { S_I ret; if(level < 0) throw Erange("wrapperlib::compressReset", gettext("compressReset called but compressInit never called before")); ret = compressEnd(); if(ret == WR_OK) return compressInit(level); else return ret; } S_I wrapperlib::decompressReset() { S_I ret = decompressEnd(); if(ret == WR_OK) return decompressInit(); else return ret; } #if LIBZ_AVAILABLE static S_I zlib2wrap_code(S_I code) { switch(code) { case Z_OK: return WR_OK; case Z_MEM_ERROR: return WR_MEM_ERROR; case Z_VERSION_ERROR: return WR_VERSION_ERROR; case Z_STREAM_END: return WR_STREAM_END; case Z_DATA_ERROR: return WR_DATA_ERROR; case Z_BUF_ERROR: return WR_BUF_ERROR; case Z_STREAM_ERROR: return WR_STREAM_ERROR; case Z_NEED_DICT: return WR_DATA_ERROR; // we do not use explicit dictionnary for compression, // this is zlib assumes it requires a dictionnary, this is // to be considered a data error. default: throw SRC_BUG; // unexpected error code } } static S_I wrap2zlib_code(S_I code) { switch(code) { case WR_NO_FLUSH: return Z_NO_FLUSH; case WR_FINISH: return Z_FINISH; default: throw SRC_BUG; } } #endif #if LIBBZ2_AVAILABLE static S_I bzlib2wrap_code(S_I code) { switch(code) { case BZ_OK: case BZ_RUN_OK: case BZ_FLUSH_OK: case BZ_FINISH_OK: return WR_OK; case BZ_PARAM_ERROR: return WR_STREAM_ERROR; case BZ_CONFIG_ERROR: return WR_VERSION_ERROR; case BZ_MEM_ERROR: return WR_MEM_ERROR; case BZ_DATA_ERROR: case BZ_DATA_ERROR_MAGIC: return WR_DATA_ERROR; case BZ_STREAM_END: return WR_STREAM_END; case BZ_SEQUENCE_ERROR: default: throw SRC_BUG; } } static S_I wrap2bzlib_code(S_I code) { switch(code) { case WR_NO_FLUSH: return BZ_RUN; case WR_FINISH: return BZ_FINISH; default: throw SRC_BUG; } } #endif #if LIBLZMA_AVAILABLE static S_I lzma2wrap_code(S_I code) { switch(code) { case LZMA_OK: return WR_OK; case LZMA_MEM_ERROR: return WR_MEM_ERROR; case LZMA_OPTIONS_ERROR: case LZMA_FORMAT_ERROR: // no memory usage limit used from libdar, only file format error can generate this code return WR_VERSION_ERROR; case LZMA_STREAM_END: return WR_STREAM_END; case LZMA_DATA_ERROR: return WR_DATA_ERROR; case LZMA_BUF_ERROR: return WR_BUF_ERROR; case LZMA_NO_CHECK: case LZMA_UNSUPPORTED_CHECK: return WR_STREAM_ERROR; case LZMA_PROG_ERROR: throw SRC_BUG; // error in libdar calling liblzma case LZMA_GET_CHECK: throw SRC_BUG; // can be retured by lzma_code "only if the decoder was initialized with the LZMA_TELL_ANY_CHECK flag" // flag we do not use from libdar default: throw SRC_BUG; // unexpected error code } } static lzma_action wrap2lzma_code(S_I code) { switch(code) { case WR_NO_FLUSH: return LZMA_RUN; case WR_FINISH: return LZMA_FINISH; default: throw SRC_BUG; } } #endif } // end of namespace dar-2.5.3/src/libdar/mask_list.cpp0000644000175000017430000001734312641772777013764 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_ERRNO_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_STRING_H #include #endif } // end extern "C" #include "mask_list.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "cygwin_adapt.hpp" #include "fichier_local.hpp" #include "nls_swap.hpp" using namespace std; namespace libdar { static bool modified_lexicalorder_a_lessthan_b(const std::string & a, const std::string & b); mask_list::mask_list(const string & filename_list_st, bool case_sensit, const path & prefix_t, bool include) { NLS_SWAP_IN; try { case_s = case_sensit; //< object's field including = include; //< object's field fichier_local source = filename_list_st; //< where we read data from char *buffer = nullptr; //< hold the just read data static const U_I buf_size = 20480; //< size of buffer: we read at most this number of bytes at a time list tmp; //< list of all raw lines read, without any prefix U_I lu = 0, curs; //< cursor used as cisors to split data in line char *beg = nullptr; //< points to the beginning of the next line inside buffer, when more than one line can be found in buffer string str_beg; //< holds the std::string copy of beg, eventually uppercased string current_entry = ""; //< holds the current line converted to string between each read() path prefix = prefix_t; //< the prefix to add to relative paths ///////////// // changing the prefix to uppercase if case sensitivity is disabled if(!case_sensit) { string ptp = prefix_t.display(); string upper; tools_to_upper(ptp, upper); prefix = path(upper); } ///////////// // building buffer that will be used to split read data line by line meta_new(buffer, buf_size+1); // one char more to be able to add a '\0' if necessary if(buffer == nullptr) throw Erange("mask_list::mask_list", tools_printf(gettext("Cannot allocate memory for buffer while reading %S"), &filename_list_st)); ///////////// // filling 'tmp' with with each line read try { do { lu = source.read(buffer, buf_size); if(lu > 0) { curs = 0; beg = buffer; do { while(curs < lu && buffer[curs] != '\n' && buffer[curs] != '\0') curs++; if(curs < lu) { if(buffer[curs] == '\0') throw Erange("mask_list::mask_list", tools_printf(gettext("Found '\0' character in %S, not a plain file, aborting"), &filename_list_st)); if(buffer[curs] == '\n') { buffer[curs] = '\0'; if(!case_s) tools_to_upper(beg, str_beg); else str_beg = string(beg); current_entry += str_beg; if(current_entry != "") tmp.push_back(current_entry); current_entry = ""; curs++; beg = buffer + curs; } else throw SRC_BUG; } else // reached end of buffer without having found an end of string { buffer[lu] = '\0'; if(!case_s) tools_to_upper(beg, str_beg); else str_beg = string(beg); current_entry += str_beg; } } while(curs < lu); } } while(lu > 0); if(current_entry != "") tmp.push_back(current_entry); } catch(...) { meta_delete(buffer); throw; } meta_delete(buffer); buffer = nullptr; ///////////// // completing relative paths of the list if(prefix.is_relative() && !prefix.is_subdir_of("", true)) throw Erange("mask_list::mask_list", gettext("Mask_list's prefix must be an absolute path or start with \"\" string for archive merging")); else { path current = "/"; list ::iterator it = tmp.begin(); while(it != tmp.end()) { try { current = *it; if(current.is_relative()) { current = prefix + current; *it = current.display(); } } catch(Egeneric & e) { string err = e.get_message(); string line = *it; throw Erange("mask_list::mask_list", tools_printf(gettext("Error met while reading line\n\t%S\n from file %S: %S"), &line, &filename_list_st, &err)); } it++; } } ///////////// // sorting the list of entry // sorting the list with a modified lexicographical order where the / as is lowest character, other letter order unchanged tmp.sort(&modified_lexicalorder_a_lessthan_b); tmp.unique(); // remove duplicates // converting the sorted list to vector, to get the indexing feature of this type contenu.assign(tmp.begin(), tmp.end()); taille = contenu.size(); if(taille < contenu.size()) throw Erange("mask_list::mask_list", tools_printf(gettext("Too much line in file %S (integer overflow)"), &filename_list_st)); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } bool mask_list::is_covered(const string & expression) const { if(taille == 0) return false; U_I min = 0, max = taille-1, tmp; string target; bool ret; if(case_s) target = expression; else tools_to_upper(expression, target); // divide & conquer algorithm on a sorted list (aka binary search) while(max - min > 1) { tmp = (min + max)/2; if(contenu[tmp] < target) min = tmp; else if(contenu[tmp] == target) max = min = tmp; else max = tmp; } ret = contenu[max] == target || contenu[min] == target; if(including && !ret) // if including files, we must also include directories leading to a listed file { string c_max = contenu[max]; ret = path(c_max).is_subdir_of(expression, case_s); } return ret; } static bool modified_lexicalorder_a_lessthan_b(const string & a, const string & b) { string::const_iterator at = a.begin(); string::const_iterator bt = b.begin(); while(at != a.end() && bt != b.end()) { if(*at == '/') { if(*bt != '/') return true; // else both a and b current letter are equal to '/' // reading further } else { if(*bt == '/') return false; else { if(*at != *bt) return *at < *bt; // else a and b letter are equal // reading further to find a difference } } ++at; ++bt; } if(at == a.end()) return true; // even if bt == b.end() too, we assume a < b if(bt == b.end()) return false; else throw SRC_BUG; // at != a.end() and bt != b.end() how did we escaped the while loop? } } // end of namespace dar-2.5.3/src/libdar/storage.hpp0000644000175000017430000002136512641773000013422 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file storage.hpp /// \brief contains a class that permits arbitrary large data storage /// \ingroup Private #include "../my_config.h" #include "erreurs.hpp" #include "integers.hpp" #include "on_pool.hpp" #ifdef LIBDAR_MODE #include "infinint.hpp" #endif // it is necessary to not protect the previous inclusion inside // the STORAGE_HPP protection to avoid cyclic dependancies. #ifndef STORAGE_HPP #define STORAGE_HPP #ifndef LIBDAR_MODE namespace libdar { class infinint; } #endif namespace libdar { class generic_file; /// arbitrary large storage structure /// used to store infinint /// \ingroup Private class storage : public on_pool { private: struct cellule { cellule() : next(nullptr), prev(nullptr), data(nullptr), size(0) {}; struct cellule *next, *prev; unsigned char *data; U_32 size; }; public: storage(U_32 size) { make_alloc(size, first, last); }; storage(const infinint & size); storage(const storage & ref) { copy_from(ref); }; storage(generic_file & f, const infinint &size); ~storage() throw(Ebug) { detruit(first); }; const storage & operator = (const storage & val) { detruit(first); copy_from(val); return *this; }; bool operator < (const storage & ref) const { return difference(ref) < 0; }; // true if arg uses more space than this bool operator == (const storage & ref) const { return difference(ref) == 0; }; //true if arg have same space than this bool operator > (const storage & ref) const { return difference(ref) > 0; }; bool operator <= (const storage & ref) const { return difference(ref) <= 0; }; bool operator >= (const storage & ref) const { return difference(ref) >= 0; }; bool operator != (const storage & ref) const { return difference(ref) != 0; }; unsigned char & operator [](infinint position); unsigned char operator [](const infinint & position) const; infinint size() const; void clear(unsigned char val = 0); void dump(generic_file & f) const; class iterator : public on_pool { public : iterator() : ref(nullptr), cell(nullptr), offset(0) {}; // default constructor by reference is OK // default destructor is OK // default operator = is OK iterator operator ++ (S_I x) { iterator ret = *this; skip_plus_one(); return ret; }; iterator operator -- (S_I x) { iterator ret = *this; skip_less_one(); return ret; }; iterator & operator ++ () { skip_plus_one(); return *this; }; iterator & operator -- () { skip_less_one(); return *this; }; iterator operator + (U_32 s) const { iterator ret = *this; ret += s; return ret; }; iterator operator - (U_32 s) const { iterator ret = *this; ret -= s; return ret; }; iterator & operator += (U_32 s); iterator & operator -= (U_32 s); unsigned char &operator *() const; void skip_to(const storage & st, infinint val); // absolute position in st infinint get_position() const; bool operator == (const iterator & cmp) const { return ref == cmp.ref && cell == cmp.cell && offset == cmp.offset; }; bool operator != (const iterator & cmp) const { return ! (*this == cmp); }; private: static const U_32 OFF_BEGIN = 1; static const U_32 OFF_END = 2; const storage *ref; struct cellule *cell; U_32 offset; void relative_skip_to(S_32 val); bool points_on_data() const { return ref != nullptr && cell != nullptr && offset < cell->size; }; inline void skip_plus_one(); inline void skip_less_one(); friend class storage; }; // public storage methode using iterator iterator begin() const { iterator ret; ret.cell = first; if(ret.cell != nullptr) ret.offset = 0; else ret.offset = iterator::OFF_END; ret.ref = this; return ret; }; iterator end() const { iterator ret; ret.cell = nullptr; ret.offset = iterator::OFF_END; ret.ref = this; return ret; }; // WARNING for the two following methods : // there is no "reverse_iterator" type, unlike the standart lib, // thus when going from rbegin() to rend(), you must use the -- operator // unlike the stdlib, that uses the ++ operator. this is the only difference in use with stdlib. iterator rbegin() const { iterator ret; ret.cell = last; ret.offset = last != nullptr ? last->size-1 : 0; ret.ref = this; return ret; }; iterator rend() const { iterator ret; ret.cell = nullptr, ret.offset = iterator::OFF_BEGIN; ret.ref = this; return ret; }; /// write data to the storage at the location pointed to by it /// \param[in,out] it where to write data to, at the end this iterator points just after the data that has been wrote /// \param[in] a gives to the address where is located the data to write to the storage object /// \param[in] size how much bytes to write to the storage U_I write(iterator & it, unsigned char *a, U_I size); U_I read(iterator & it, unsigned char *a, U_I size) const; bool write(iterator & it, unsigned char a) { return write(it, &a, 1) == 1; }; bool read(iterator & it, unsigned char &a) const { return read(it, &a, 1) == 1; }; // after one of these 3 calls, the iterator given in argument are undefined (they may point nowhere) void insert_null_bytes_at_iterator(iterator it, U_I size); void insert_const_bytes_at_iterator(iterator it, unsigned char a, U_I size); void insert_bytes_at_iterator(iterator it, unsigned char *a, U_I size); void insert_as_much_as_necessary_const_byte_to_be_as_wider_as(const storage & ref, const iterator & it, unsigned char value); void remove_bytes_at_iterator(iterator it, U_I number); void remove_bytes_at_iterator(iterator it, infinint number); private: struct cellule *first, *last; void copy_from(const storage & ref); S_32 difference(const storage & ref) const; void reduce(); // heuristic that tries to free some memory; void insert_bytes_at_iterator_cmn(iterator it, bool constant, unsigned char *a, U_I size); void fusionne(struct cellule *a_first, struct cellule *a_last, struct cellule *b_first, struct cellule *b_last, struct cellule *&res_first, struct cellule * & res_last); /////////////////////////////// // these were STATIC statments, but now object methods // because they rely on on_pool templates that require object field void detruit(struct cellule *c); void make_alloc(U_32 size, struct cellule * & begin, struct cellule * & end); void make_alloc(infinint size, cellule * & begin, struct cellule * & end); friend class storage::iterator; }; inline void storage::iterator::skip_plus_one() { if(cell != nullptr) if(++offset >= cell->size) { cell = cell->next; if(cell != nullptr) offset = 0; else offset = OFF_END; } } inline void storage::iterator::skip_less_one() { if(cell != nullptr) { if(offset > 0) --offset; else { cell = cell->prev; if(cell != nullptr) offset = cell->size - 1; else offset = OFF_BEGIN; } } } } // end of namespace #endif dar-2.5.3/src/libdar/crypto_asym.hpp0000644000175000017430000001017312641772777014346 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file crypto_asym.hpp /// \brief the asymetric cryptographical algoritms relying on gpgme /// \ingroup Private #ifndef CRYPTO_ASYM_HPP #define CRYPTO_ASYM_HPP extern "C" { #if HAVE_GPGME_H #include #endif } #include "../my_config.h" #include "generic_file.hpp" #include "generic_file_overlay_for_gpgme.hpp" #include "erreurs.hpp" #include "mem_ui.hpp" #include "crypto.hpp" #include namespace libdar { /// \ingroup Private /// @} class crypto_asym : public mem_ui { public: /// general use constructor crypto_asym(const user_interaction & ui) : mem_ui(ui) { build_context(); has_signatories = false; }; /// the destructor ~crypto_asym() { release_context(); }; /// disabling copy constructor crypto_asym(const crypto_asym & ref): mem_ui(ref) { throw SRC_BUG; }; /// disabling object assignment const crypto_asym & operator = (const crypto_asym & ref) { throw SRC_BUG; }; /// defines the list of email which associated key will be used for signing void set_signatories(const std::vector & signatories); /// encrypt (and sign if signatures have been given using set_signatories) data for the given recipients /// /// \param[in] recipients_email list of email of recipient that will be able to read the encrypted data /// \param[in] clear where to read from clear data to be encrypted (the object must be readable) /// \param[out] ciphered where to write down encrypted data (the object must be writable) /// \note this assumes the GnuPG keyring has the public keys of the recipient listed void encrypt(const std::vector & recipients_email, generic_file & clear, generic_file & ciphered); /// un-cipher data /// /// \param[in] ciphered contains the encrypted data to decipher /// \param[out] clear resulting un-ciphered (thus clear) data (the object must be readable) /// \note this assumes the GnuPG keyring has an appropriated private key (the objet must be writable) void decrypt(generic_file & ciphered, generic_file & clear); /// after un-ciphering data retrieve the list of signature that were used beside encryption /// return a sorted list of signatories const std::list & verify() const { return signing_result; }; /// exposing to public visibility the protected method of mem_ui user_interaction & get_ui() const { return mem_ui::get_ui(); }; private: bool has_signatories; std::list signing_result; #if GPGME_SUPPORT gpgme_ctx_t context; //< GPGME context void release_context() { gpgme_release(context); }; void build_key_list(const std::vector & recipients_email, //< list of email to find a key for gpgme_key_t * & ciphering_keys, //< resulting nullptr terminated list of keys bool signatories); //< false if email key need encryption capability, true for signing void release_key_list(gpgme_key_t * & ciphering_keys); void fill_signing_result(); #else void release_context() {}; #endif void build_context(); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/generic_file_overlay_for_gpgme.cpp0000644000175000017430000000711712641772777020175 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "tools.hpp" #include "generic_file_overlay_for_gpgme.hpp" namespace libdar { #ifdef GPGME_SUPPORT static ssize_t gpgme_data_read_cb(void *handle, void *buffer, size_t size); static ssize_t gpgme_data_write_cb(void *handle, const void *buffer, size_t size); static off_t gpgme_data_seek_cb(void *handle, off_t offset, int whence); static void gpgme_data_release_cb(void *handle); #endif generic_file_overlay_for_gpgme::generic_file_overlay_for_gpgme(generic_file *f) { #ifdef GPGME_SUPPORT gpgme_error_t err; if(f == nullptr) throw SRC_BUG; below = f; cbs.read = &gpgme_data_read_cb; cbs.write = &gpgme_data_write_cb; cbs.seek = &gpgme_data_seek_cb; cbs.release = &gpgme_data_release_cb; err = gpgme_data_new_from_cbs(&handle, &cbs, this); if(gpgme_err_code(err) != GPG_ERR_NO_ERROR) { throw Erange("generic_file_overlay_for_gpgme::generi_file_overlay_for_gpgme", tools_printf(gettext("Error creating data buffer overlay for GPGME: %s"), tools_gpgme_strerror_r(err).c_str())); } #else throw Efeature("Asymetric Strong encryption algorithms using GPGME"); #endif } #if GPGME_SUPPORT static ssize_t gpgme_data_read_cb(void *handle, void *buffer, size_t size) { generic_file_overlay_for_gpgme *obj = (generic_file_overlay_for_gpgme *)(handle); return obj->get_below()->read((char*)buffer, size); } static ssize_t gpgme_data_write_cb(void *handle, const void *buffer, size_t size) { generic_file_overlay_for_gpgme *obj = (generic_file_overlay_for_gpgme *)(handle); obj->get_below()->write((char*)buffer, size); return size; } static off_t gpgme_data_seek_cb(void *handle, off_t offset, int whence) { generic_file_overlay_for_gpgme *obj = (generic_file_overlay_for_gpgme *)(handle); off_t ret; switch(whence) { case SEEK_SET: obj->get_below()->skip(infinint(offset)); break; case SEEK_CUR: obj->get_below()->skip_relative(offset); break; case SEEK_END: obj->get_below()->skip_to_eof(); obj->get_below()->skip_relative(offset); default: throw SRC_BUG; } if(whence == SEEK_SET) ret = offset; else { infinint tmp = obj->get_below()->get_position(); ret = 0; tmp.unstack(ret); if(!tmp.is_zero()) throw Erange("gpgme_data_seek_cb", gettext("File offset too large to be stored in off_t type")); } return ret; } static void gpgme_data_release_cb(void *handle) { // nothing to do // the generic_file_overlay_for_gpgme object // has no internal data to be released by gpgme } #endif } // end of namespace dar-2.5.3/src/libdar/capabilities.hpp0000644000175000017430000000404712641772777014431 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file capabilities.hpp /// \brief provide information about current thread (underlying using the widthdrawn POSIX.1e API) /// \ingroup Private #ifndef CAPABILITIES_HPP #define CAPABILITIES_HPP #include "../my_config.h" #include "user_interaction.hpp" namespace libdar { /// \addtogroup API /// @{ // return from the EFFECTIVE set the value of the associated capability for the calling thread enum capa_status { capa_set, //< current thread has the requested capability capa_clear, //< current thread has not the requested capability capa_unknown }; //< impossible to determine whether the current thread has the requested capability extern capa_status capability_LINUX_IMMUTABLE(user_interaction & ui, bool verbose); extern capa_status capability_SYS_RESOURCE(user_interaction & ui, bool verbose); extern capa_status capability_FOWNER(user_interaction & ui, bool verbose); extern capa_status capability_CHOWN(user_interaction & ui, bool verbose); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/int_tools.hpp0000644000175000017520000000447512610405012013762 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file int_tools.hpp /// \brief elementary operation for infinint integers /// \ingroup Private #ifndef INT_TOOLS_HPP #define INT_TOOLS_HPP #include "../my_config.h" #include "integers.hpp" #include "erreurs.hpp" namespace libdar { /// \addtogroup Private /// @{ typedef unsigned char int_tools_bitfield[8]; extern void int_tools_swap_bytes(unsigned char &a, unsigned char &b); extern void int_tools_swap_bytes(unsigned char *a, U_I size); extern void int_tools_expand_byte(unsigned char a, int_tools_bitfield &bit); extern void int_tools_contract_byte(const int_tools_bitfield &b, unsigned char & a); // integer (agregates) manipulations // argument must be a regular interger (a bit field). template extern T int_tools_rotate_right_one_bit(T v) { bool retenue = (v & 1) != 0; v >>= 1; if(retenue) v |= T(1) << (sizeof(v)*8 - 1); return v; } template extern T int_tools_maxof_agregate(T unused) { unused = 0; unused = ~unused; unused = unused > 0 ? unused : ~int_tools_rotate_right_one_bit(T(1)); return unused; } template static B int_tools_higher_power_of_2(B val) { B i = 0; while((val >> i) > 1) i++; return i; } /// @} } #endif dar-2.5.3/src/libdar/capabilities.cpp0000644000175000017430000000637012641772777014425 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_CAPABILITY_H #include #else #if HAVE_LINUX_CAPABILITY_H #include #endif #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif } #include "capabilities.hpp" #include "tools.hpp" using namespace std; namespace libdar { #ifndef HAVE_CAPABILITIES capa_status capability_LINUX_IMMUTABLE(user_interaction & ui, bool verbose) { return capa_unknown; } capa_status capability_SYS_RESOURCE(user_interaction & ui, bool verbose) { return capa_unknown; } capa_status capability_FOWNER(user_interaction & ui, bool verbose) { return capa_unknown; } capa_status capability_CHOWN(user_interaction & ui, bool verbose) { return capa_unknown; } #else static capa_status cap_check(cap_value_t capa, user_interaction & ui, bool verbose, const std::string & capa_name); capa_status capability_LINUX_IMMUTABLE(user_interaction & ui, bool verbose) { return cap_check(CAP_LINUX_IMMUTABLE, ui, verbose, "Immutable"); } capa_status capability_SYS_RESOURCE(user_interaction & ui, bool verbose) { return cap_check(CAP_SYS_RESOURCE, ui, verbose, "System Resource"); } capa_status capability_FOWNER(user_interaction & ui, bool verbose) { return cap_check(CAP_FOWNER, ui, verbose, "File Owner for all files"); } capa_status capability_CHOWN(user_interaction & ui, bool verbose) { return cap_check(CAP_CHOWN, ui, verbose, "change ownership"); } static capa_status cap_check(cap_value_t capa, user_interaction & ui, bool verbose, const std::string & capa_name) { capa_status ret = capa_unknown; cap_t capaset = cap_get_proc(); cap_flag_value_t val; try { if(cap_get_flag(capaset, capa, CAP_EFFECTIVE, &val) == 0) ret = (val == CAP_SET) ? capa_set : capa_clear; else { ret = capa_unknown; if(verbose) { string tmp = tools_strerror_r(errno); ui.printf(gettext("Error met while checking for capability %S: %s"), &capa_name, tmp.c_str()); } } } catch(...) // well a try/catch may seems useless here, but it does not hurt ... :-) { cap_free(capaset); throw; } cap_free(capaset); return ret; } #endif } // end of namespace dar-2.5.3/src/libdar/cat_device.hpp0000644000175000017430000000520612641772777014064 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_device.hpp /// \brief parent class for all special devices inodes /// \ingroup Private #ifndef CAT_DEVICE_HPP #define CAT_DEVICE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_inode.hpp" #include "integers.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the special cat_device root class class cat_device : public cat_inode { public : cat_device(const infinint & uid, const infinint & gid, U_16 perm, const datetime & last_access, const datetime & last_modif, const datetime &last_change, const std::string & name, U_16 major, U_16 minor, const infinint & fs_device); cat_device(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small); bool operator == (const cat_entree & ref) const; int get_major() const { if(get_saved_status() != s_saved) throw SRC_BUG; else return xmajor; }; int get_minor() const { if(get_saved_status() != s_saved) throw SRC_BUG; else return xminor; }; void set_major(int x) { xmajor = x; }; void set_minor(int x) { xminor = x; }; // using method is_more_recent_than() from cat_inode class // using method has_changed_since() from cat_inode class // signature is left pure abstract protected : void sub_compare(const cat_inode & other, bool isolated_mode) const; void inherited_dump(const pile_descriptor & pdesc, bool small) const; private : U_16 xmajor, xminor; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_directory.cpp0000644000175000017430000005422112642474445014615 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_all_entrees.hpp" #include "cat_tools.hpp" using namespace std; namespace libdar { // static field of class cat_directory const cat_eod cat_directory::fin; // methods of class cat_directory cat_directory::cat_directory(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const string & xname, const infinint & fs_device) : cat_inode(xuid, xgid, xperm, last_access, last_modif, last_change, xname, fs_device) { parent = nullptr; #ifdef LIBDAR_FAST_DIR fils.clear(); #endif ordered_fils.clear(); it = ordered_fils.begin(); set_saved_status(s_saved); recursive_has_changed = true; updated_sizes = false; } cat_directory::cat_directory(const cat_directory &ref) : cat_inode(ref) { parent = nullptr; #ifdef LIBDAR_FAST_DIR fils.clear(); #endif ordered_fils.clear(); it = ordered_fils.begin(); recursive_has_changed = ref.recursive_has_changed; updated_sizes = false; } const cat_directory & cat_directory::operator = (const cat_directory & ref) { const cat_inode *ref_ino = &ref; cat_inode * this_ino = this; *this_ino = *ref_ino; // this assigns the inode part of the object // we don't modify the existing subfiles or subdirectories nor we copy them from the reference cat_directory recursive_flag_size_to_update(); return *this; } cat_directory::cat_directory(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, entree_stats & stats, std::map & corres, compression default_algo, bool lax, bool only_detruit, bool small) : cat_inode(dialog, pdesc, reading_ver, saved, small) { cat_entree *p; cat_nomme *t; cat_directory *d; cat_detruit *x; cat_mirage *m; cat_eod *fin = nullptr; bool lax_end = false; parent = nullptr; #ifdef LIBDAR_FAST_DIR fils.clear(); #endif ordered_fils.clear(); recursive_has_changed = true; // need to call recursive_has_changed_update() first if this fields has to be used updated_sizes = false; try { while(fin == nullptr && !lax_end) { try { p = cat_entree::read(dialog, get_pool(), pdesc, reading_ver, stats, corres, default_algo, lax, only_detruit, small); } catch(Euser_abort & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { if(!lax) throw; else { dialog.warning(string(gettext("LAX MODE: Error met building a catalogue entry, skipping this entry and continuing. Skipped error is: ")) + e.get_message()); p = nullptr; } } if(p != nullptr) { d = dynamic_cast(p); fin = dynamic_cast(p); t = dynamic_cast(p); x = dynamic_cast(p); m = dynamic_cast(p); if(!only_detruit || d != nullptr || x != nullptr || fin != nullptr || m != nullptr) { // we must add the cat_mirage object, else // we will trigger an incoherent catalogue structure // as the cat_mirage without inode cannot link to the cat_mirage with inode // carring the same etiquette if we destroy them right now. if(t != nullptr) // p is a "cat_nomme" { #ifdef LIBDAR_FAST_DIR fils[t->get_name()] = t; #endif ordered_fils.push_back(t); } if(d != nullptr) // p is a cat_directory d->parent = this; if(t == nullptr && fin == nullptr) throw SRC_BUG; // neither an cat_eod nor a cat_nomme ! what's that ??? } else { delete p; p = nullptr; d = nullptr; fin = nullptr; t = nullptr; x = nullptr; } } else if(!lax) throw Erange("cat_directory::cat_directory", gettext("missing data to build a cat_directory")); else lax_end = true; } if(fin != nullptr) { delete fin; // no need to keep it fin = nullptr; } it = ordered_fils.begin(); } catch(Egeneric & e) { clear(); throw; } } cat_directory::~cat_directory() throw(Ebug) { clear(); } bool cat_directory::operator == (const cat_entree & ref) const { const cat_directory *ref_dir = dynamic_cast(&ref); if(ref_dir == nullptr) return false; else return cat_inode::operator == (ref); } void cat_directory::inherited_dump(const pile_descriptor & pdesc, bool small) const { list::const_iterator x = ordered_fils.begin(); cat_inode::inherited_dump(pdesc, small); if(!small) { while(x != ordered_fils.end()) { if(*x == nullptr) throw SRC_BUG; if(dynamic_cast(*x) != nullptr) ++x; // "cat_ignored" need not to be saved, they are only useful when updating_destroyed else { (*x)->specific_dump(pdesc, small); ++x; } } } // else in small mode, we do not dump any children // an inode may have children while small dump is asked // when performing a merging operation fin.specific_dump(pdesc, small); // end of "this" cat_directory // fin is a static constant variable of class cat_directory, // this hack avoids recurrent construction/destruction of a cat_eod object. } void cat_directory::recursive_update_sizes() const { if(!updated_sizes) { cat_directory *me = const_cast(this); if(me == nullptr) throw SRC_BUG; me->x_size = 0; me->x_storage_size = 0; list::const_iterator it = ordered_fils.begin(); const cat_directory *f_dir = nullptr; const cat_file *f_file = nullptr; while(it != ordered_fils.end()) { if(*it == nullptr) throw SRC_BUG; f_dir = dynamic_cast(*it); f_file = dynamic_cast(*it); if(f_dir != nullptr) { // recursion occurs here // by calling get_size() and get_storage_size() of child directories /// which in turn will call the recursive_update_sizes() of child objects me->x_size += f_dir->get_size(); me->x_storage_size += f_dir->get_storage_size(); } else if(f_file != nullptr && f_file->get_saved_status() == s_saved) { me->x_size += f_file->get_size(); if(!f_file->get_storage_size().is_zero() || f_file->get_sparse_file_detection_read()) me->x_storage_size += f_file->get_storage_size(); else me->x_storage_size += f_file->get_size(); // in very first archive formats, storage_size was set to zero to // indicate "no compression used" // the only way to have zero as storage_size is either file size is // zero or file is a sparse_file with only zeroed bytes. Sparse file // were not taken into account in that old archive that set storage_size // to zero to indicate the absence of compression } ++it; } me->updated_sizes = true; } } void cat_directory::recursive_flag_size_to_update() const { cat_directory *me = const_cast(this); if(me == nullptr) throw SRC_BUG; me->updated_sizes = false; if(parent != nullptr) parent->recursive_flag_size_to_update(); } void cat_directory::add_children(cat_nomme *r) { cat_directory *d = dynamic_cast(r); const cat_nomme *ancien_nomme; if(r == nullptr) throw SRC_BUG; if(search_children(r->get_name(), ancien_nomme)) // same entry already present { const cat_directory *a_dir = dynamic_cast(ancien_nomme); if(a_dir != nullptr && d != nullptr) // both directories : merging them { a_dir = d; // updates the inode part, does not touch the cat_directory specific part as defined in the cat_directory::operator = list::iterator xit = d->ordered_fils.begin(); while(xit != d->ordered_fils.end()) { const_cast(a_dir)->add_children(*xit); ++xit; } // need to clear the lists of objects before destroying the cat_directory objects itself // to avoid the destructor destroyed the director children that have been merged to the a_dir cat_directory #ifdef LIBDAR_FAST_DIR d->fils.clear(); #endif d->ordered_fils.clear(); delete r; r = nullptr; d = nullptr; } else // not directories: removing and replacing old entry { if(ancien_nomme == nullptr) throw SRC_BUG; // removing the old object remove(ancien_nomme->get_name()); ancien_nomme = nullptr; // adding the new object #ifdef LIBDAR_FAST_DIR fils[r->get_name()] = r; #endif ordered_fils.push_back(r); } } else // no conflict: adding { #ifdef LIBDAR_FAST_DIR fils[r->get_name()] = r; #endif ordered_fils.push_back(r); } if(d != nullptr) d->parent = this; recursive_flag_size_to_update(); } void cat_directory::reset_read_children() const { cat_directory *moi = const_cast(this); moi->it = moi->ordered_fils.begin(); } void cat_directory::end_read() const { cat_directory *moi = const_cast(this); moi->it = moi->ordered_fils.end(); } bool cat_directory::read_children(const cat_nomme *&r) const { cat_directory *moi = const_cast(this); if(moi->it != moi->ordered_fils.end()) { r = *(moi->it); ++(moi->it); return true; } else return false; } void cat_directory::tail_to_read_children() { #ifdef LIBDAR_FAST_DIR map::iterator dest; list::iterator ordered_dest = it; while(ordered_dest != ordered_fils.end()) { try { if(*ordered_dest == nullptr) throw SRC_BUG; dest = fils.find((*ordered_dest)->get_name()); fils.erase(dest); delete *ordered_dest; *ordered_dest = nullptr; ordered_dest++; } catch(...) { ordered_fils.erase(it, ordered_dest); throw; } } #endif ordered_fils.erase(it, ordered_fils.end()); it = ordered_fils.end(); recursive_flag_size_to_update(); } void cat_directory::remove(const string & name) { // locating old object in ordered_fils list::iterator ot = ordered_fils.begin(); while(ot != ordered_fils.end() && *ot != nullptr && (*ot)->get_name() != name) ++ot; if(ot == ordered_fils.end()) throw Erange("cat_directory::remove", tools_printf(gettext("Cannot remove nonexistent entry %S from catalogue"), &name)); if(*ot == nullptr) throw SRC_BUG; #ifdef LIBDAR_FAST_DIR // localizing old object in fils map::iterator ut = fils.find(name); if(ut == fils.end()) throw SRC_BUG; // sanity checks if(*ot != ut->second) throw SRC_BUG; // removing reference from fils fils.erase(ut); #endif // recording the address of the object to remove cat_nomme *obj = *ot; // removing its reference from ordered_fils // and having "it" pointing to the entry following the // removed one, if it would have been the next entry to be read if(it == ot) it = ordered_fils.erase(ot); else (void)ordered_fils.erase(ot); // destroying the object itself delete obj; recursive_flag_size_to_update(); } void cat_directory::recursively_set_to_unsaved_data_and_FSA() { list::iterator it = ordered_fils.begin(); cat_directory *n_dir = nullptr; cat_inode *n_ino = nullptr; cat_mirage *n_mir = nullptr; // dropping info for the current cat_directory set_saved_status(s_not_saved); if(ea_get_saved_status() == cat_inode::ea_full) ea_set_saved_status(cat_inode::ea_partial); if(fsa_get_saved_status() == cat_inode::fsa_full) fsa_set_saved_status(cat_inode::fsa_partial); // doing the same for each entry found in that cat_directory while(it != ordered_fils.end()) { if(*it == nullptr) throw SRC_BUG; n_dir = dynamic_cast(*it); n_ino = dynamic_cast(*it); n_mir = dynamic_cast(*it); if(n_mir != nullptr) n_ino = n_mir->get_inode(); if(n_dir != nullptr) n_dir->recursively_set_to_unsaved_data_and_FSA(); else // nothing to do for cat_directory the recursive call does the job { if(n_ino != nullptr) { n_ino->set_saved_status(s_not_saved); if(n_ino->ea_get_saved_status() == cat_inode::ea_full) n_ino->ea_set_saved_status(ea_partial); if(n_ino->fsa_get_saved_status() == cat_inode::fsa_full) n_ino->fsa_set_saved_status(cat_inode::fsa_partial); } } ++it; } } void cat_directory::change_location(const pile_descriptor & pdesc) { list::iterator tmp_it = ordered_fils.begin(); cat_nomme::change_location(pdesc); while(tmp_it != ordered_fils.end()) { if(*tmp_it == nullptr) throw SRC_BUG; (*tmp_it)->change_location(pdesc); ++tmp_it; } } void cat_directory::clear() { it = ordered_fils.begin(); while(it != ordered_fils.end()) { if(*it == nullptr) throw SRC_BUG; delete *it; *it = nullptr; ++it; } #ifdef LIBDAR_FAST_DIR fils.clear(); #endif ordered_fils.clear(); it = ordered_fils.begin(); recursive_flag_size_to_update(); } bool cat_directory::search_children(const string &name, const cat_nomme * & ptr) const { #ifdef LIBDAR_FAST_DIR map::const_iterator ut = fils.find(name); if(ut != fils.end()) { if(ut->second == nullptr) throw SRC_BUG; ptr = ut->second; if(ptr == nullptr) throw SRC_BUG; } else ptr = nullptr; #else list::const_iterator ot = ordered_fils.begin(); while(ot != ordered_fils.end() && *ot != nullptr && (*ot)->get_name() != name) ++ot; if(ot != ordered_fils.end()) { ptr = *ot; if(ptr == nullptr) throw SRC_BUG; } else ptr = nullptr; #endif return ptr != nullptr; } bool cat_directory::callback_for_children_of(user_interaction & dialog, const string & sdir, bool isolated) const { const cat_directory *current = this; const cat_nomme *next_nom = nullptr; const cat_directory *next_dir = nullptr; const cat_inode *next_ino = nullptr; const cat_detruit *next_detruit = nullptr; const cat_mirage *next_mir = nullptr; string segment; bool loop = true; const cat_nomme *tmp_nom; if(!dialog.get_use_listing()) throw Erange("cat_directory::callback_for_children_of", gettext("listing() method must be given")); if(sdir != "") { path dir = sdir; if(!dir.is_relative()) throw Erange("cat_directory::callback_for_children_of", gettext("argument must be a relative path")); /////////////////////////// // looking for the inner most cat_directory (basename of given path) // do { if(!dir.pop_front(segment)) { segment = dir.display(); loop = false; } if(current->search_children(segment, tmp_nom)) { next_nom = const_cast(tmp_nom); next_mir = dynamic_cast(next_nom); if(next_mir != nullptr) next_dir = dynamic_cast(next_mir->get_inode()); else next_dir = dynamic_cast(next_nom); if(next_dir != nullptr) current = next_dir; else return false; } else return false; } while(loop); } /////////////////////////// // calling listing() for each element of the "current" cat_directory // if(current == nullptr) throw SRC_BUG; loop = false; // loop now serves as returned value current->reset_read_children(); while(current->read_children(next_nom)) { next_mir = dynamic_cast(next_nom); if(next_mir != nullptr) next_ino = next_mir->get_inode(); else next_ino = dynamic_cast(next_nom); next_detruit = dynamic_cast(next_nom); next_dir = dynamic_cast(next_ino); if(next_ino != nullptr) { string a = local_perm(*next_ino, next_mir != nullptr); string b = local_uid(*next_ino); string c = local_gid(*next_ino); string d = local_size(*next_ino); string e = local_date(*next_ino); string f = local_flag(*next_ino, isolated, false); string g = next_ino->get_name(); dialog.listing(f,a,b,c,d,e,g, next_dir != nullptr, next_dir != nullptr && next_dir->has_children()); loop = true; } else if(next_detruit != nullptr) { string a = next_detruit->get_name(); dialog.listing(REMOVE_TAG, "xxxxxxxxxx", "", "", "", "", a, false, false); loop = true; } else throw SRC_BUG; // unknown class } return loop; } void cat_directory::recursive_has_changed_update() const { list::const_iterator it = ordered_fils.begin(); const_cast(this)->recursive_has_changed = false; while(it != ordered_fils.end()) { const cat_directory *d = dynamic_cast(*it); const cat_inode *ino = dynamic_cast(*it); if(d != nullptr) { d->recursive_has_changed_update(); const_cast(this)->recursive_has_changed |= d->get_recursive_has_changed(); } if(ino != nullptr && !recursive_has_changed) const_cast(this)->recursive_has_changed |= ino->get_saved_status() != s_not_saved || ino->ea_get_saved_status() == ea_full || ino->ea_get_saved_status() == ea_removed; ++it; } } infinint cat_directory::get_tree_size() const { infinint ret = ordered_fils.size(); const cat_directory *fils_dir = nullptr; list::const_iterator ot = ordered_fils.begin(); while(ot != ordered_fils.end()) { if(*ot == nullptr) throw SRC_BUG; fils_dir = dynamic_cast(*ot); if(fils_dir != nullptr) ret += fils_dir->get_tree_size(); ++ot; } return ret; } infinint cat_directory::get_tree_ea_num() const { infinint ret = 0; list::const_iterator it = ordered_fils.begin(); while(it != ordered_fils.end()) { const cat_directory *fils_dir = dynamic_cast(*it); const cat_inode *fils_ino = dynamic_cast(*it); const cat_mirage *fils_mir = dynamic_cast(*it); if(fils_mir != nullptr) fils_ino = fils_mir->get_inode(); if(fils_ino != nullptr) if(fils_ino->ea_get_saved_status() != ea_none && fils_ino->ea_get_saved_status() != ea_removed) ++ret; if(fils_dir != nullptr) ret += fils_dir->get_tree_ea_num(); ++it; } return ret; } infinint cat_directory::get_tree_mirage_num() const { infinint ret = 0; list::const_iterator it = ordered_fils.begin(); while(it != ordered_fils.end()) { const cat_directory *fils_dir = dynamic_cast(*it); const cat_mirage *fils_mir = dynamic_cast(*it); if(fils_mir != nullptr) ++ret; if(fils_dir != nullptr) ret += fils_dir->get_tree_mirage_num(); ++it; } return ret; } void cat_directory::get_etiquettes_found_in_tree(map & already_found) const { list::const_iterator it = ordered_fils.begin(); while(it != ordered_fils.end()) { const cat_mirage *fils_mir = dynamic_cast(*it); const cat_directory *fils_dir = dynamic_cast(*it); if(fils_mir != nullptr) { map::iterator tiq = already_found.find(fils_mir->get_etiquette()); if(tiq == already_found.end()) already_found[fils_mir->get_etiquette()] = 1; else already_found[fils_mir->get_etiquette()] = tiq->second + 1; // due to st::map implementation, it is not recommanded to modify an entry directly // using a "pair" structure (the one that holds .first and .second fields) } if(fils_dir != nullptr) fils_dir->get_etiquettes_found_in_tree(already_found); ++it; } } void cat_directory::remove_all_mirages_and_reduce_dirs() { list::iterator curs = ordered_fils.begin(); while(curs != ordered_fils.end()) { if(*curs == nullptr) throw SRC_BUG; cat_directory *d = dynamic_cast(*curs); cat_mirage *m = dynamic_cast(*curs); cat_nomme *n = dynamic_cast(*curs); // sanity check if((m != nullptr && n == nullptr) || (d != nullptr && n == nullptr)) throw SRC_BUG; // recursive call if(d != nullptr) d->remove_all_mirages_and_reduce_dirs(); if(m != nullptr || (d != nullptr && d->is_empty())) { #ifdef LIBDAR_FAST_DIR map::iterator monfils = fils.find(n->get_name()); if(monfils == fils.end()) throw SRC_BUG; if(monfils->second != *curs) throw SRC_BUG; fils.erase(monfils); #endif curs = ordered_fils.erase(curs); // curs now points to the next item delete n; } else ++curs; } recursive_flag_size_to_update(); } void cat_directory::set_all_mirage_s_inode_dumped_field_to(bool val) { list::iterator curs = ordered_fils.begin(); while(curs != ordered_fils.end()) { if(*curs == nullptr) throw SRC_BUG; cat_directory *d = dynamic_cast(*curs); cat_mirage *m = dynamic_cast(*curs); // recursive call if(d != nullptr) d->set_all_mirage_s_inode_dumped_field_to(val); if(m != nullptr) m->set_inode_dumped(val); ++curs; } } } // end of namespace dar-2.5.3/src/libdar/tronconneuse.hpp0000644000175000017430000003051712641773000014477 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file tronconneuse.hpp /// \brief defines a block structured file. /// \ingroup Private /// /// Mainly used for strong encryption. #ifndef TRONCONNEUSE_HPP #define TRONCONNEUSE_HPP #include "../my_config.h" #include #include "infinint.hpp" #include "generic_file.hpp" #include "archive_version.hpp" namespace libdar { /// \addtogroup Private /// @{ /// this is a partial implementation of the generic_file interface to cypher/decypher data block by block. /// This class is a pure virtual one, as several calls have to be defined by inherited classes /// - encrypted_block_size_for /// - clear_block_allocated_size_for /// - encrypt_data /// - decrypt_data /// . /// tronconneuse is either read_only or write_only, read_write is not allowed. /// The openning mode is defined by encrypted_side's mode. /// In write_only no skip() is allowed, writing is sequential from the beginning of the file to the end /// (like writing to a pipe). /// In read_only all skip() functions are available. /// \ingroup Private class tronconneuse : public generic_file { public: /// This is the constructor /// \param[in] block_size is the size of block encryption (the size of clear data encrypted toghether). /// \param[in] encrypted_side where encrypted data are read from or written to. /// \param[in] no_initial_shift assume that no unencrypted data is located at the begining of the underlying file, else this is the /// position of the encrypted_side at the time of this call that is used as initial_shift /// \param[in] reading_ver version of the archive format /// \note that encrypted_side is not owned and destroyed by tronconneuse, it must exist during all the life of the /// tronconneuse object, and is not destroyed by the tronconneuse's destructor tronconneuse(U_32 block_size, generic_file & encrypted_side, bool no_initial_shift, const archive_version & reading_ver); /// copy constructor tronconneuse(const tronconneuse & ref) : generic_file(ref) { copy_from(ref); }; /// assignment operator const tronconneuse & operator = (const tronconneuse & ref); /// destructor virtual ~tronconneuse() { detruit(); }; // must not write pure virtual method from here, directly or not /// inherited from generic_file bool skippable(skippability direction, const infinint & amount); /// inherited from generic_file bool skip(const infinint & pos); /// inherited from generic_file bool skip_to_eof(); /// inherited from generic_file bool skip_relative(S_I x); /// inherited from generic_file infinint get_position() const { if(is_terminated()) throw SRC_BUG; return current_position; }; /// in write_only mode indicate that end of file is reached /// this call must be called in write mode to purge the /// internal cache before deleting the object (else some data may be lost) /// no further write call is allowed /// \note this call cannot be used from the destructor, because it relies on pure virtual methods void write_end_of_file() { if(is_terminated()) throw SRC_BUG; flush(); weof = true; }; /// this method to modify the initial shift. This overrides the constructor "no_initial_shift" of the constructor void set_initial_shift(const infinint & x) { initial_shift = x; }; /// let the caller give a callback function that given a generic_file with cyphered data, is able /// to return the offset of the first clear byte located *after* all the cyphered data, this /// callback function is used (if defined by the following method), when reaching End of File. void set_callback_trailing_clear_data(infinint (*call_back)(generic_file & below, const archive_version & reading_ver)) { trailing_clear_data = call_back; }; /// returns the block size give to constructor U_32 get_clear_block_size() const { return clear_block_size; }; private: /// inherited from generic_file /// this protected inherited method is now private for inherited classes of tronconneuse void inherited_read_ahead(const infinint & amount); /// this protected inherited method is now private for inherited classes of tronconneuse U_I inherited_read(char *a, U_I size); /// inherited from generic_file /// this protected inherited method is now private for inherited classes of tronconneuse void inherited_write(const char *a, U_I size); /// this protected inherited method is now private for inherited classes of tronconneuse void inherited_sync_write() { flush(); }; /// this protected inherited method is now private for inherited classes of tronconneuse void inherited_flush_read() { buf_byte_data = 0; }; /// this protected inherited method is now private for inherited classes of tronconneuse void inherited_terminate() {}; protected: /// defines the size necessary to encrypt a given amount of clear data /// \param[in] clear_block_size is the size of the clear block to encrypt. /// \return the size of the memory to allocate to receive corresponding encrypted data. /// \note this implies that encryption algorithm must always generate a fixed size encrypted block of data for /// a given fixed size block of data. However, the size of the encrypted block of data may differ from /// the size of the clear block of data virtual U_32 encrypted_block_size_for(U_32 clear_block_size) = 0; /// it may be necessary by the inherited class have few more bytes allocated after the clear data given for encryption /// \param[in] clear_block_size is the size in byte of the clear data that will be asked to encrypt. /// \return the requested allocated buffer size (at least the size of the clear data). /// \note when giving clear buffer of data of size "clear_block_size" some inherited class may requested /// that a bit more of data must be allocated. /// this is to avoid copying data when the algorithm needs to add some data after the /// clear data before encryption. virtual U_32 clear_block_allocated_size_for(U_32 clear_block_size) = 0; /// this method encrypts the clear data given /// \param block_num is the number of the block to which correspond the given data, This is an informational field for inherited classes. /// \param[in] clear_buf points to the first byte of clear data to encrypt. /// \param[in] clear_size is the length in byte of data to encrypt. /// \param[in] clear_allocated is the size of the allocated memory (modifiable bytes) in clear_buf: clear_block_allocated_size_for(clear_size) /// \param[in,out] crypt_buf is the area where to put corresponding encrypted data. /// \param[in] crypt_size is the allocated memory size for crypt_buf: encrypted_block_size_for(clear_size) /// \return is the amount of data put in crypt_buf (<= crypt_size). /// \note it must respect that : returned value = encrypted_block_size_for(clear_size argument) virtual U_32 encrypt_data(const infinint & block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size) = 0; /// this method decyphers data /// \param[in] block_num block number of the data to decrypt. /// \param[in] crypt_buf pointer to the first byte of encrypted data. /// \param[in] crypt_size size of encrypted data to decrypt. /// \param[in,out] clear_buf pointer where to put clear data. /// \param[in] clear_size allocated size of clear_buf. /// \return is the amount of data put in clear_buf (<= clear_size) virtual U_32 decrypt_data(const infinint & block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size) = 0; protected: const archive_version & get_reading_version() const { return reading_ver; }; private: infinint initial_shift; //< the initial_shift first bytes of the underlying file are not encrypted // infinint buf_offset; //< offset of the first byte in buf U_32 buf_byte_data; //< number of byte of information in buf (buf_byte_data <= buf_size) U_32 buf_size; //< size of allocated memory for clear data in buf char *buf; //< decrypted data (or data to encrypt) // U_32 clear_block_size; //< max amount of data that will be encrypted at once (must stay less than buf_size) infinint current_position; //< position of the next character to read or write from the upper layer perspective, offset zero is the first encrypted byte, thus the first byte after initial_shift infinint block_num; //< block number we next read or write generic_file *encrypted; //< generic_file where is put / get the encrypted data // U_32 encrypted_buf_size; //< allocated size of encrypted_buf U_32 encrypted_buf_data; //< amount of byte of information in encrypted_buf char *encrypted_buf; //< buffer of encrypted data (read or to write) // infinint extra_buf_offset; //< offset of the first byte of extra_buf U_32 extra_buf_size; //< allocated size of extra_buf U_32 extra_buf_data; //< amount of byte of information in extra_buf char *extra_buf; //< additional read encrypted that follow what is in encrypted_buf used to check for clear data after encrypted data // bool weof; //< whether write_end_of_file() has been called bool reof; //< whether we reached eof while reading archive_version reading_ver;//< archive format we currently read infinint (*trailing_clear_data)(generic_file & below, const archive_version & reading_ver); //< callback function that gives the amount of clear data found at the end of the given file void detruit(); void copy_from(const tronconneuse & ref); U_32 fill_buf(); // returns the position (of the next read op) inside the buffer and fill the buffer with clear data void flush(); // flush any pending data (write mode only) to encrypted device void init_buf(); // initialize if necessary the various buffers that relies on inherited method values /// convert clear position to corresponding position in the encrypted data ///\param[in] pos is the position in the clear data ///\param[out] file_buf_start is the position of the beginning of the crypted block where can be found the data ///\param[out] file_buf_clear is the position of the beginning of the corresponding clear block ///\param[out] pos_in_buf is the position in the clear block of the 'pos' offset ///\param[out] block_num is the block number we have our requested position inside void position_clear2crypt(const infinint & pos, infinint & file_buf_start, infinint & clear_buf_start, infinint & pos_in_buf, infinint & block_num); void position_crypt2clear(const infinint & pos, infinint & clear_pos); // gives the position of the next character // of clear data that corresponds to the encrypted data which index is pos bool check_current_position() { return fill_buf() < buf_byte_data; }; // return true if a there is a byte of information at the given offset /// remove clear data at the end of the encrypted_buf /// \param[in] crypt_offset is the offset of the first byte of encrypted_buf not /// considering initial_shift bytes before the begining of the encrypted data void remove_trailing_clear_data_from_encrypted_buf(const infinint & crypt_offset); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/crc.cpp0000644000175000017430000002726612641772777012552 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } // end extern "C" #include #include #include "generic_file.hpp" #include "crc.hpp" using namespace std; #define INFININT_MODE_START 10240 namespace libdar { static void n_compute(const char *buffer, U_I length, unsigned char * begin, unsigned char * & pointer, unsigned char * end, U_I crc_size); ///////////////////////////////////////////// // some TEMPLATES and static routines first // template string T_crc2str(P begin, P end) { ostringstream ret; P curs = begin; while(curs != end) { ret << hex << ((*curs & 0xF0) >> 4); ret << hex << (*curs & 0x0F); ++curs; } return ret.str(); } template void T_old_read(P & pointer, P begin, P end, const char *buffer, U_I size) { U_I pos = 0; while(pointer != end && pos < size) { *pointer = buffer[pos]; ++pointer; ++pos; } if(pointer != end || pos < size) throw SRC_BUG; // should reach both ends at the same time pointer = begin; } template void B_compute_block(B anonymous, const char *buffer, U_I length, unsigned char * begin, unsigned char * & pointer, unsigned char * end, U_I & cursor) { B *buf_end = (B *)(buffer + length - sizeof(anonymous) + 1); B *buf_ptr = (B *)(buffer); B *crc_end = (B *)(end); B *crc_ptr = (B *)(begin); if(begin >= end) throw SRC_BUG; else { U_I crc_size = end - begin; if(crc_size % sizeof(anonymous) != 0) throw SRC_BUG; if(crc_size / sizeof(anonymous) == 0) throw SRC_BUG; } while(buf_ptr < buf_end) { *crc_ptr ^= *buf_ptr; ++buf_ptr; ++crc_ptr; if(crc_ptr >= crc_end) crc_ptr = (B *)(begin); } cursor = (char *)(buf_ptr) - buffer; pointer = (unsigned char *)(crc_ptr); } template void T_compute(const char *buffer, U_I length, P begin, P & pointer, P end) { if(pointer == end) throw SRC_BUG; for(U_I cursor = 0; cursor < length; ++cursor) { *pointer ^= buffer[cursor]; if(++pointer == end) pointer = begin; } } static void n_compute(const char *buffer, U_I length, unsigned char * begin, unsigned char * & pointer, unsigned char * end, U_I crc_size) { U_I cursor = 0; //< index of next byte to read from buffer // initial bytes if(pointer != begin) { while(pointer != end && cursor < length) { *pointer ^= buffer[cursor]; ++cursor; ++pointer; } if(pointer == end) // we had enough data to have pointer reach the end of the crc_field pointer = begin; } // block bytes if(pointer == begin && cursor < length) // we can now use the optimized rountine relying on operation by block of bytes { U_I partial_cursor = 0; // But we cannot use optimized method on some systems if we are not aligned to the size boundary if(crc_size % 8 == 0 && (U_I)(buffer + cursor) % 8 == 0) B_compute_block(U_64(0), buffer + cursor, length - cursor, begin, pointer, end, partial_cursor); else if(crc_size % 4 == 0 && (U_I)(buffer + cursor) % 4 == 0) B_compute_block(U_32(0), buffer + cursor, length - cursor, begin, pointer, end, partial_cursor); else if(crc_size % 2 == 0 && (U_I)(buffer + cursor) % 2 == 0) B_compute_block(U_16(0), buffer + cursor, length - cursor, begin, pointer, end, partial_cursor); /// warning, adding a new type here need modifying crc_n::alloc() to provide aligned crc storage cursor += partial_cursor; } // final bytes if(cursor < length) T_compute(buffer + cursor, length - cursor, begin, pointer, end); } template bool T_compare(P me_begin, P me_end, P you_begin, P you_end) { P me = me_begin; P you = you_begin; while(me != me_end && you != you_end && *me == *you) { ++me; ++you; } return me == me_end && you == you_end; } ///////////////////////////////////////////// // Class CRC_I implementation follows // crc_i::crc_i(const infinint & width) : size(width), cyclic(width) { if(width.is_zero()) throw Erange("crc::crc", gettext("Invalid size for CRC width")); clear(); } crc_i::crc_i(const infinint & width, generic_file & f) : size(width), cyclic(f, width) { pointer = cyclic.begin(); } bool crc_i::operator == (const crc & ref) const { const crc_i *ref_i = dynamic_cast(&ref); if(ref_i == nullptr) throw SRC_BUG; if(size != ref_i->size) return false; else // same size return T_compare(cyclic.begin(), cyclic.end(), ref_i->cyclic.begin(), ref_i->cyclic.end()); } void crc_i::compute(const infinint & offset, const char *buffer, U_I length) { infinint tmp = offset % size; // first we skip the cyclic at the correct position pointer.skip_to(cyclic, tmp); // now we can compute the CRC compute(buffer, length); } void crc_i::compute(const char *buffer, U_I length) { T_compute(buffer, length, cyclic.begin(), pointer, cyclic.end()); } void crc_i::clear() { cyclic.clear(); pointer = cyclic.begin(); } void crc_i::dump(generic_file & f) const { size.dump(f); cyclic.dump(f); } string crc_i::crc2str() const { return T_crc2str(cyclic.begin(), cyclic.end()); } void crc_i::copy_from(const crc_i & ref) { if(size != ref.size) { size = ref.size; cyclic = ref.cyclic; } else copy_data_from(ref); pointer = cyclic.begin(); } void crc_i::copy_data_from(const crc_i & ref) { if(ref.size == size) { storage::iterator ref_it = ref.cyclic.begin(); storage::iterator it = cyclic.begin(); while(ref_it != ref.cyclic.end() && it != cyclic.end()) { *it = *ref_it; ++it; ++ref_it; } if(ref_it != ref.cyclic.end() || it != cyclic.end()) throw SRC_BUG; } else throw SRC_BUG; } ///////////////////////////////////////////// // Class CRC_N implementation follows // crc_n::crc_n(U_I width) { pointer = nullptr; cyclic = nullptr; try { if(width == 0) throw Erange("crc::crc", gettext("Invalid size for CRC width")); alloc(width); clear(); } catch(...) { destroy(); throw; } } crc_n::crc_n(U_I width, generic_file & f) { pointer = nullptr; cyclic = nullptr; try { alloc(width); f.read((char*)cyclic, size); } catch(...) { destroy(); throw; } } const crc_n & crc_n::operator = (const crc_n & ref) { if(size != ref.size) { destroy(); copy_from(ref); } else copy_data_from(ref); return *this; } bool crc_n::operator == (const crc & ref) const { const crc_n *ref_n = dynamic_cast(&ref); if(ref_n == nullptr) throw SRC_BUG; if(size != ref_n->size) return false; else // same size return T_compare(cyclic, cyclic + size, ref_n->cyclic, ref_n->cyclic + ref_n->size); } void crc_n::compute(const infinint & offset, const char *buffer, U_I length) { infinint tmp = offset % size; U_I s_offset = 0; // first we skip the cyclic at the correct position tmp.unstack(s_offset); if(tmp != 0) throw SRC_BUG; // tmp does not fit in a U_I variable ! pointer = cyclic + s_offset; // now we can compute the CRC compute(buffer, length); } void crc_n::compute(const char *buffer, U_I length) { n_compute(buffer, length, cyclic, pointer, cyclic + size, size); } void crc_n::clear() { (void)memset(cyclic, 0, size); pointer = cyclic; } void crc_n::dump(generic_file & f) const { infinint tmp = size; tmp.dump(f); f.write((const char *)cyclic, size); } string crc_n::crc2str() const { return T_crc2str(cyclic, cyclic + size); } void crc_n::alloc(U_I width) { size = width; if(get_pool() == nullptr) { ////////////////////////////////////////////////////////////////////// // the following trick is to have cyclic aligned at its boundary size // (its allocated address is a multiple of it size) // some CPU need that (sparc), and it does not hurt for other ones. if(width % 8 == 0) cyclic = (unsigned char *)(new (nothrow) U_64[width/8]); else if(width % 4 == 0) cyclic = (unsigned char *)(new (nothrow) U_32[width/4]); else if(width % 2 == 0) cyclic = (unsigned char *)(new (nothrow) U_16[width/2]); else cyclic = new (nothrow) unsigned char[size]; // end of the trick and back to default situation ////////////////////////////////////////////////////////////////////// // WARNING! this trick allows the use of 2, 4 or 8 bytes operations // // instead of byte by byte one, in n_compute calls B_compute_block // // CODE MUST BE ADAPTED THERE AND IN destroy() IF CHANGED HERE!!! // ////////////////////////////////////////////////////////////////////// } else cyclic = (unsigned char *)get_pool()->alloc(width); // pool should provide aligned data in any case if(cyclic == nullptr) throw Ememory("crc::copy_from"); pointer = cyclic; } void crc_n::copy_from(const crc_n & ref) { alloc(ref.size); copy_data_from(ref); } void crc_n::copy_data_from(const crc_n & ref) { if(size != ref.size) throw SRC_BUG; (void)memcpy(cyclic, ref.cyclic, size); pointer = cyclic; } void crc_n::destroy() { if(cyclic != nullptr) { if(get_pool() == nullptr) delete [] cyclic; else get_pool()->release(cyclic); cyclic = nullptr; } size = 0; pointer = nullptr; } ///////////////////////////////////////////// // exported routines implementation // crc *create_crc_from_file(generic_file & f, memory_pool *pool, bool old) { crc *ret = nullptr; if(old) ret = new (pool) crc_n(crc::OLD_CRC_SIZE, f); else { infinint taille = f; // reading the crc size if(taille < INFININT_MODE_START) { U_I s = 0; taille.unstack(s); if(!taille.is_zero()) throw SRC_BUG; ret = new (pool) crc_n(s, f); } else ret = new (pool) crc_i(taille, f); } if(ret == nullptr) throw Ememory("create_crc_from_file"); return ret; } crc *create_crc_from_size(infinint width, memory_pool *pool) { crc *ret = nullptr; if(width < INFININT_MODE_START) { U_I s = 0; width.unstack(s); if(!width.is_zero()) throw SRC_BUG; ret = new (pool) crc_n(s); } else ret = new (pool) crc_i(width); if(ret == nullptr) throw Ememory("create_crc_from_size"); return ret; } } // end of namespace dar-2.5.3/src/libdar/mask_list.hpp0000644000175000017430000000574112641772777013770 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file mask_list.hpp /// \brief here lies a mask that selects files present in a given list /// \ingroup API /// /// The mask_list classes defined here is to be used for filtering files /// in the libdar API calls. #ifndef MASK_LIST_HPP #define MASK_LIST_HPP #include "../my_config.h" #include "mask.hpp" #include namespace libdar { /// \addtogroup API /// @{ /// the mask_list class, matches string that are present in a given file /// /// the given file must contain one entry per line (thus no carriage return /// is allowed in a given entry). Note that the file listed in the /// file may have a relative path or an absolute path. class mask_list : public mask { public: /// the constructor /// \param[in] filename_list_st is the path to the file listing the /// filename to select for the operation /// \param[in] case_sensit whether comparison is case sensitive or not /// \param[in] prefix add this prefix to relative paths of the list. The /// prefix should be either absolute, or "" (in case of operations /// on an existing archive) /// \param[in] include whether the mask_list is used for file inclusion or file exclusion mask_list(const std::string & filename_list_st, bool case_sensit, const path & prefix, bool include); /// inherited from the mask class bool is_covered(const std::string & expression) const; /// inherited from the mask class mask *clone() const { return new (get_pool()) mask_list(*this); }; /// routing only necessary for doing some testing U_I size() const { return contenu.size(); }; private: std::vector contenu; U_I taille; bool case_s; bool including; // mask is used for including files (not for excluding files) }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/slave_thread.hpp0000644000175000017430000001161012641773000014407 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file slave_thread.hpp /// \brief class slave_thread is runs a I/O operations on a given genercif_file in a separated thread /// \ingroup Private /// #ifndef SLAVE_THREAD_HPP #define SLAVE_THREAD_HPP #include "../my_config.h" #if HAVE_LIBTHREADAR_LIBTHREADAR_HPP #include #endif #include "generic_file.hpp" #include "messaging.hpp" #include "erreurs.hpp" namespace libdar { class slave_thread : public libthreadar::thread, public on_pool { public: /// constructor /// /// \note none of the given pointer will be deleted by slave_thread nor a copy /// of them will be done (which for some is forbidden anyway), these pointed to /// objects must thus exist during the whole live of the slave_thread slave_thread(generic_file *x_data, libthreadar::fast_tampon *x_input_data, libthreadar::fast_tampon *x_output_data, libthreadar::fast_tampon *x_input_ctrl, libthreadar::fast_tampon *x_output_ctrl); slave_thread(const slave_thread & ref) { throw SRC_BUG; }; const slave_thread & operator = (const slave_thread & ref) { throw SRC_BUG; }; /// true if the thread has suspended waiting for a new order (no data to write, no read_ahead to perform) bool wake_me_up() const { if(wake_me) { const_cast(this)->wake_me = false; return true; } else return false; }; protected: virtual void inherited_run(); private: generic_file *data; libthreadar::fast_tampon *input_data; libthreadar::fast_tampon *output_data; libthreadar::fast_tampon *input_ctrl; libthreadar::fast_tampon *output_ctrl; messaging_encode answer; //< used to communicate with master thread messaging_decode order; //< used to communicate with master thread unsigned int num; //< size of the read block or to be written block char *ptr; //< address of the block to be written or to be read char data_header; //< the one byte message to prepend data with, when more data block follow to answer a given order char data_header_completed; //< the one byte message to prepend data with, when end of order is reached infinint read_ahead; //< amount of data sent for reading and not yet asked for reading bool endless_read_ahead; //< whether an endeless read ahead request has been asked infinint to_send_ahead; //< remaining amount of data to send for the requested read_ahead U_I immediate_read; //< next action is to read this amount of data bool stop; //< whether thread end has been asked bool wake_me; //< whether we ask the master awake us void init(); void set_header_vars(); //< set the value of data_header and data_header_completed fields void read_order(); //< \note ptr must be released/recycled after this call void send_answer(); //< send the answer to the last order received bool pending_order() { return input_ctrl->is_not_empty(); }; bool pending_input_data() { return input_data->is_not_empty(); }; void treat_input_data(); //< empty input_data and write down the data void ask_to_wake_me_up(); //< ask the master to wake the slave upon possible action /// send a block of data to the master thread /// /// \param[in] size is the number of byte to send, no more than /// one block will be sent even if size is larger. If size is zero /// as much as possible data will be sent in the block /// \param[out] eof is set back to true of the operation reached end of file /// \return the effective number of byte sent in the block U_I send_data_block(U_I size, bool & eof); bool treat_order(); //< \return true if answer is prepared and must be sent back to the master thread /// send the amount of byte equal to "immediate_read" to the master thread (counting read_ahead data) void go_read(); }; } // end of namespace #endif dar-2.5.3/src/libdar/trontextual.hpp0000644000175000017430000000402712641773000014343 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file trontextual.hpp /// \brief class trontextual is a contextual variant of class tronc /// \ingroup Private #ifndef TRONTEXTUAL_HPP #define TRONTEXTUAL_HPP #include "../my_config.h" #include "tronc.hpp" #include "infinint.hpp" #include "generic_file.hpp" namespace libdar { /// trontextual class is a contextual class tronc, that's all. class trontextual : public tronc, public contextual { public: trontextual(generic_file *f, const infinint & offset, const infinint & size, bool own_f = false); trontextual(generic_file *f, const infinint & offset, const infinint & size, gf_mode mode, bool own_f = false); bool is_an_old_start_end_archive() const { if(ref == nullptr) throw SRC_BUG; return ref->is_an_old_start_end_archive(); }; const label & get_data_name() const { if(ref == nullptr) throw SRC_BUG; return ref->get_data_name(); }; private: contextual *ref; //< this is just a pointer to data owned by the inherited class tronc part of this object void init(generic_file *f); }; } #endif dar-2.5.3/src/libdar/compile_time_features.hpp0000644000175000017430000001071712642474445016335 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file compile_time_features.hpp /// \brief nested namespace containing routines that give features activated at compile time /// \ingroup API #ifndef COMPILE_TIME_FEATURES_HPP #define COMPILE_TIME_FEATURES_HPP #include "../my_config.h" /// \addtogroup API /// @{ namespace libdar { /// nested namespace inside libdar /// it contains one routine per feature that can be activated or disabled at compile time /// this is to replace the "libdar::get_compile_time_feature" function /// that cannot be updates without breaking backward compatibility namespace compile_time { /// returns whether EA support has been activated at compilation time bool ea(); /// returns whether largefile (>2GiB) support has been activated at compilation time bool largefile(); /// returns whether nodump flag support has been activated at compilation time bool nodump(); /// returns whether special allocation support has been activated at compilation time /// /// special allocation support brings from a tiny to an important improvement in /// execution time, depending on the number of small files involved in the operation bool special_alloc(); /// returns the internal integer type used /// \note zero is returned if infinint type is used U_I bits(); /// returns whether the current libdar is thread safe bool thread_safe(); /// returns whether libdar is dependent on libz and if so has gzip compression/decompression available bool libz(); /// returns whether libdar is dependent on libbz2 and if so has bzip2 compression/decompression available bool libbz2(); /// returns whether libdar is dependent on liblzo and if so has lzo compression/decompression available bool liblzo(); /// returns whether libdar is dependent on liblxz/liblzma and if so has xz compression/decompression available bool libxz(); /// returns whether libdar is dependent on libgcrypt and if so has strong encryption and hashing features available bool libgcrypt(); /// returns whether libdar can support furtive read mode when run by privileged user bool furtive_read(); /// type used to return the endian nature of the current system enum endian { big = 'B', //< big endian little = 'L', //< little endian error = 'E' //< neither big nor little endian! (libdar cannot run on such system) }; /// returns the detected integer endian of the system endian system_endian(); /// returns true if libdar has support for posix_fadvise activated available bool posix_fadvise(); /// returns whether libdar has been built with speed optimization for last directory bool fast_dir(); /// returns whether libdar has been built with support for linux ext2/3/4 FSA bool FSA_linux_extX(); /// returns whether libdar has been built with support for HFS+ FSA bool FSA_birthtime(); /// returns whether libdar is able to read timestamps at a microsecond accuracy bool microsecond_read(); /// returns whether libdar is able to write timestamps at a microsecond accuracy bool microsecond_write(); /// returns whether libdar is able to restore dates of symlinks bool symlink_restore_dates(); /// returns whether public key cipher (relying on gpgme) are available bool public_key_cipher(); /// returns whether libthreadar linking will be done, allowing libdar to span several threads bool libthreadar(); } } // end of namespace /// @} #endif dar-2.5.3/src/libdar/database_header.hpp0000644000175000017430000000523712641772777015056 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file database_header.hpp /// \brief defines the database structure in file /// \ingroup Private #ifndef DATABASE_HEADER_HPP #define DATABASE_HEADER_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "user_interaction.hpp" namespace libdar { /// \ingroup Private /// @} /// create the header for a dar_manager database /// \param[in] dialog is used for user interaction /// \param[in] pool memory pool to use or nullptr for default memory allocation /// \param[in] filename is the file's name to create/overwrite /// \param[in] overwrite set to true to allow file overwriting (else generates an error if file exists) /// \return the database header has been read and checked the database can now be read from the returned generic_file pointed by the returned value /// then it must be destroyed with the delete operator. extern generic_file *database_header_create(user_interaction & dialog, memory_pool *pool, const std::string & filename, bool overwrite); /// read the header of a dar_manager database /// \param[in] dialog for user interaction /// \param[in] pool memory pool to use or nullptr for default memory allocation /// \param[in] filename is the filename to read from /// \param[out] db_version version of the database /// \return the generic_file where the database header has been put extern generic_file *database_header_open(user_interaction & dialog, memory_pool *pool, const std::string & filename, unsigned char & db_version); extern const unsigned char database_header_get_supported_version(); ///@} } // end of namespace #endif dar-2.5.3/src/libdar/mask.hpp0000644000175000017430000003035412641772777012733 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file mask.hpp /// \brief here lies a collection of mask classes /// /// The mask classes defined here are to be used to filter files /// in the libdar API calls. /// \ingroup API #ifndef MASK_HPP #define MASK_HPP #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif #if HAVE_REGEX_H #include #endif } // end extern "C" #include #include #include "path.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup API /// @{ /// the generic class, parent of all masks /// this is a pure virtual class that is used in API call /// any of the following mask classes inherit from this class class mask : public on_pool { public : virtual ~mask() {}; /// check wether the given string is covered by the mask /// \param[in] expression is the filename to check /// \return true if the given filename is covered by the mask /// \note only libdar internally needs to call this method virtual bool is_covered(const std::string &expression) const = 0; /// check whether the given path is covered by the mask /// \param[in] chemin is the path to check /// \return true if the given path is covered by the mask /// \note only libdar internally needs to call this method /// \note this is an optional method to the previous one, it can be overwritten virtual bool is_covered(const path & chemin) const { return is_covered(chemin.display()); }; /// this is to be able to copy a mask without knowing its /// exact class and without loosing its specialized data virtual mask *clone() const = 0; }; /// boolean mask, either always true or false /// it matches all files or no files at all class bool_mask : public mask { public : /// the constructor /// \param[in] always is the value that this mask will always return /// when the is_covered method will be used /// \note once initialized an object cannot change its behavior bool_mask(bool always) { val = always; }; /// inherited from the mask class bool is_covered(const std::string & expression) const { return val; }; bool is_covered(const path & chemin) const { return val; }; /// inherited from the mask class mask *clone() const { return new (get_pool()) bool_mask(val); }; private : bool val; }; /// matches as done on shell command lines (see "man 7 glob") class simple_mask : public mask { public : /// the constructor to use by libdar external programs /// \param[in] wilde_card_expression is the glob expression that defines the mask /// \param[in] case_sensit whether the mask is case sensitive or not simple_mask(const std::string & wilde_card_expression, bool case_sensit); /// copy constructor simple_mask(const simple_mask & m) : mask(m) { copy_from(m); }; /// assignment operator const simple_mask & operator = (const simple_mask & m); /// inherited from the mask class bool is_covered(const std::string &expression) const; /// inherited from the mask class mask *clone() const { return new (get_pool()) simple_mask(*this); }; private : std::string the_mask; bool case_s; void copy_from(const simple_mask & m); }; /// matches regular expressions (see "man 7 regex") class regular_mask : public mask { public : /// the constructor to be used by libdar external programs /// \param[in] wilde_card_expression is the regular expression that defines the mask /// \param[in] x_case_sensit whether the mask is case sensitive or not regular_mask(const std::string & wilde_card_expression, bool x_case_sensit); /// the copy constructor regular_mask(const regular_mask & ref); /// the assignment operator regular_mask & operator= (const regular_mask & ref); /// destructor virtual ~regular_mask() { regfree(&preg); }; /// inherited from the mask class bool is_covered(const std::string & expression) const; /// inherited from the mask class mask *clone() const { return new (get_pool()) regular_mask(*this); }; private : regex_t preg; std::string mask_exp; //< used only by the copy constructor bool case_sensit; //< used only by the copy constructor void set_preg(const std::string & wilde_card_expression, bool x_case_sensit); }; /// negation of another mask /// this is the first mask built over masks /// it realizes the negation of the given mask class not_mask : public mask { public : /// the constructor to be used by libdar external programs /// \param[in] m is the mask to negate /// \note the mask used as argument need not to survive the just created not_mask object /// as an internal copy of the mask given in argument has been done. not_mask(const mask &m) { copy_from(m); }; /// copy constructor not_mask(const not_mask & m) : mask(m) { copy_from(m); }; /// assignment operator const not_mask & operator = (const not_mask & m); /// destructor ~not_mask() { detruit(); }; /// inherited from the mask class bool is_covered(const std::string &expression) const { return !ref->is_covered(expression); }; bool is_covered(const path & chemin) const { return !ref->is_covered(chemin); }; /// inherited from the mask class mask *clone() const { return new (get_pool()) not_mask(*this); }; private : mask *ref; void copy_from(const not_mask &m); void copy_from(const mask &m); void detruit(); }; /// makes an *AND* operator between two or more masks class et_mask : public mask { public : /// the constructor to be used by libdar external programs /// \note at this stage the mask is not usable and will /// throw an exception until some mask are added to the *AND* /// thanks to the add_mask() method et_mask() {}; /// copy constructor et_mask(const et_mask &m) : mask(m) { copy_from(m); }; /// assignment operator const et_mask & operator = (const et_mask &m); /// destructor ~et_mask() { detruit(); }; /// add a mask to the operator /// \param[in] toadd a mask to add to the *AND* operator /// \note the mask given in argument has not to survive the et_mask to which it has been added /// a internal copy of the mask has been done. void add_mask(const mask & toadd); /// inherited from the mask class bool is_covered(const std::string & expression) const { return t_is_covered(expression); }; bool is_covered(const path & chemin) const { return t_is_covered(chemin); }; /// inherited from the mask class mask *clone() const { return new (get_pool()) et_mask(*this); }; /// the number of mask on which is done the *AND* operator /// \return the number of mask that has been added thanks to the add_mask() method /// \note there is no mean to remove a given mask once it has been added (see the clear method) U_I size() const { return lst.size(); }; /// clear the mask /// remove all previously added masks /// \note that after this call the mask is no more usable as the *AND* operator cannot be done /// on any mask void clear() { detruit(); }; protected : std::vector lst; private : void copy_from(const et_mask & m); void detruit(); template bool t_is_covered(const T & expression) const { std::vector::const_iterator it = lst.begin(); if(lst.empty()) throw Erange("et_mask::is_covered", dar_gettext("No mask in the list of mask to operate on")); while(it != lst.end() && (*it)->is_covered(expression)) ++it; return it == lst.end(); } }; /// makes the *OR* operator between two or more masks /// this mask has exactly the same use as the et_mask /// please see the et_mask documentation. The only difference /// is that it makes an *OR* operation rather than an *AND* /// with the masks added thanks to the add_mask method class ou_mask : public et_mask { public: /// inherited from the mask class bool is_covered(const std::string & expression) const { return t_is_covered(expression); }; bool is_covered(const path & chemin) const { return t_is_covered(chemin); } ; /// inherited from the mask class mask *clone() const { return new (get_pool()) ou_mask(*this); }; private: template bool t_is_covered(const T & expression) const { std::vector::const_iterator it = lst.begin(); if(lst.empty()) throw Erange("et_mask::is_covered", dar_gettext("No mask to operate on in the list of mask")); while(it != lst.end() && ! (*it)->is_covered(expression)) it++; return it != lst.end(); } }; /// string matches if it is subdir of mask or mask is a subdir of expression class simple_path_mask : public mask { public : /// the constructor to be used by libdar external programs /// \param[in] p the path the compare with /// \param[in] case_sensit whether the mask is case sensitive or not /// \note p must be a valid path simple_path_mask(const path &p, bool case_sensit) : chemin(p) { case_s = case_sensit; }; /// inherited from the mask class bool is_covered(const std::string & expression) const { throw SRC_BUG; }; bool is_covered(const path & chemin) const; /// inherited from the mask class mask *clone() const { return new (get_pool()) simple_path_mask(*this); }; private : path chemin; bool case_s; }; /// matches if string is exactly the given mask (no wilde card expression) class same_path_mask : public mask { public : /// the constructor to be used by libdar external programs /// \param[in] p is the path to compare with /// \param[in] case_sensit whether the mask is case sensitive or not same_path_mask(const std::string &p, bool case_sensit) { chemin = p; case_s = case_sensit; }; /// inherited from the mask class bool is_covered(const std::string &chemin) const; /// inherited from the mask class mask *clone() const { return new (get_pool()) same_path_mask(*this); }; private : std::string chemin; bool case_s; }; /// matches if string is the given constructor string or a sub directory of it class exclude_dir_mask : public mask { public: /// the constructor to be used by libdar external programs /// \param[in] p is the path to compare with /// \param[in] case_sensit whether the mask is case sensitive or not exclude_dir_mask(const std::string &p, bool case_sensit) { chemin = p; case_s = case_sensit;}; /// inherited from the mask class bool is_covered(const std::string &expression) const { throw SRC_BUG; } bool is_covered(const path &chemin) const { return chemin.is_subdir_of(chemin, case_s); }; /// inherited from the mask class mask *clone() const { return new (get_pool()) exclude_dir_mask(*this); }; private: std::string chemin; bool case_s; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/user_interaction.cpp0000644000175000017430000003053712641773000015327 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_IOCTL_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_FCNTL_H #include #endif #if STDC_HEADERS #include #endif } // end extern "C" #include #include "user_interaction.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "integers.hpp" #include "deci.hpp" #include "nls_swap.hpp" using namespace std; namespace libdar { // // // Methods of user_interaction class // // user_interaction::user_interaction() { use_listing = false; use_dar_manager_show_files = false; use_dar_manager_contents = false; use_dar_manager_statistics = false; use_dar_manager_show_version = false; at_once = 0; count = 0; } void user_interaction::warning(const std::string & message) { if(at_once > 0) { U_I c = 0, max = message.size(); while(c < max) { if(message[c] == '\n') count++; c++; } count++; // for the implicit \n at end of message if(count >= at_once) { count = 0; (void)this->pause(dar_gettext("Continue? ")); } } inherited_warning(message); } void user_interaction::listing(const std::string & flag, const std::string & perm, const std::string & uid, const std::string & gid, const std::string & size, const std::string & date, const std::string & filename, bool is_dir, bool has_children) { // stupid code to stop having compiler complaining against unused arguments throw Elibcall("user_interaction::listing", tools_printf("Not overwritten listing() method called with: (%S, %S, %S, %S, %S, %S, %S, %s, %s)", &flag, &perm, &uid, &gid, &size, &date, &filename, is_dir ? "true" : "false", has_children ? "true" : "false")); } void user_interaction::dar_manager_show_files(const string & filename, bool data_change, bool ea_change) { throw Elibcall("user_interaction::dar_manager_show_files", "Not overwritten dar_manager_show_files() method has been called!"); } void user_interaction::dar_manager_contents(U_I number, const string & chemin, const string & archive_name) { throw Elibcall("user_interaction::dar_manager_contents", "Not overwritten dar_manager_contents() method has been called!"); } void user_interaction::dar_manager_statistics(U_I number, const infinint & data_count, const infinint & total_data, const infinint & ea_count, const infinint & total_ea) { throw Elibcall("user_interaction::dar_manager_statistics", "Not overwritten dar_manager_statistics() method has been called!"); } void user_interaction::dar_manager_show_version(U_I number, const string & data_date, const string & data_presence, const string & ea_date, const string & ea_presence) { throw Elibcall("user_interaction::dar_manager_show_version", "Not overwritten dar_manager_show_version() method has been called!"); } void user_interaction::printf(const char *format, ...) { va_list ap; va_start(ap, format); string output = ""; try { output = tools_vprintf(format, ap); } catch(...) { va_end(ap); throw; } va_end(ap); tools_remove_last_char_if_equal_to('\n', output); warning(output); } // // // Methods of user_interaction_callback class // // user_interaction_callback::user_interaction_callback(void (*x_warning_callback)(const string &x, void *context), bool (*x_answer_callback)(const string &x, void *context), string (*x_string_callback)(const string &x, bool echo, void *context), secu_string (*x_secu_string_callback)(const string &x, bool echo, void *context), void *context_value) { NLS_SWAP_IN; try { if(x_warning_callback == nullptr || x_answer_callback == nullptr) throw Elibcall("user_interaction_callback::user_interaction_callback", dar_gettext("nullptr given as argument of user_interaction_callback()")); warning_callback = x_warning_callback; answer_callback = x_answer_callback; string_callback = x_string_callback; secu_string_callback = x_secu_string_callback; tar_listing_callback = nullptr; dar_manager_show_files_callback = nullptr; dar_manager_contents_callback = nullptr; dar_manager_statistics_callback = nullptr; dar_manager_show_version_callback = nullptr; context_val = context_value; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void user_interaction_callback::pause(const string & message) { if(answer_callback == nullptr) throw SRC_BUG; else { try { if(! (*answer_callback)(message, context_val)) throw Euser_abort(message); } catch(Euser_abort & e) { throw; } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::pause", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::pause", dar_gettext("No exception allowed from libdar callbacks")); } } } void user_interaction_callback::inherited_warning(const string & message) { if(warning_callback == nullptr) throw SRC_BUG; else { try { (*warning_callback)(message + '\n', context_val); } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::warning", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::warning", dar_gettext("No exception allowed from libdar callbacks")); } } } string user_interaction_callback::get_string(const string & message, bool echo) { if(string_callback == nullptr) throw SRC_BUG; else { try { return (*string_callback)(message, echo, context_val); } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::get_string", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::get_string", dar_gettext("No exception allowed from libdar callbacks")); } } } secu_string user_interaction_callback::get_secu_string(const string & message, bool echo) { if(string_callback == nullptr) throw SRC_BUG; else { try { return (*secu_string_callback)(message, echo, context_val); } catch(Ebug & e) { throw; } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::get_secu_string", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::get_secu_string", dar_gettext("No exception allowed from libdar callbacks")); } } } void user_interaction_callback::listing(const string & flag, const string & perm, const string & uid, const string & gid, const string & size, const string & date, const string & filename, bool is_dir, bool has_children) { if(tar_listing_callback != nullptr) { try { (*tar_listing_callback)(flag, perm, uid, gid, size, date, filename, is_dir, has_children, context_val); } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::listing", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::listing", dar_gettext("No exception allowed from libdar callbacks")); } } } void user_interaction_callback::dar_manager_show_files(const string & filename, bool available_data, bool available_ea) { if(dar_manager_show_files_callback != nullptr) { try { (*dar_manager_show_files_callback)(filename, available_data, available_ea, context_val); } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::dar_manager_show_files", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::dar_manager_show_files", dar_gettext("No exception allowed from libdar callbacks")); } } } void user_interaction_callback::dar_manager_contents(U_I number, const std::string & chemin, const std::string & archive_name) { if(dar_manager_contents_callback != nullptr) { try { (*dar_manager_contents_callback)(number, chemin, archive_name, context_val); } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::dar_manager_contents", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::dar_manager_contents", dar_gettext("No exception allowed from libdar callbacks")); } } } void user_interaction_callback::dar_manager_statistics(U_I number, const infinint & data_count, const infinint & total_data, const infinint & ea_count, const infinint & total_ea) { if(dar_manager_statistics_callback != nullptr) { try { (*dar_manager_statistics_callback)(number, data_count, total_data, ea_count, total_ea, context_val); } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::dar_manager_statistics", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::dar_manager_statistics", dar_gettext("No exception allowed from libdar callbacks")); } } } void user_interaction_callback::dar_manager_show_version(U_I number, const string & data_date, const string & data_presence, const string & ea_date, const string & ea_presence) { if(dar_manager_show_version_callback != nullptr) { try { (*dar_manager_show_version_callback)(number, data_date, data_presence, ea_date, ea_presence, context_val); } catch(Egeneric & e) { throw Elibcall("user_interaction_callback::dar_manager_show_version", string(dar_gettext("No exception allowed from libdar callbacks")) + ": " + e.get_message()); } catch(...) { throw Elibcall("user_interaction_callback::dar_manager_show_version", dar_gettext("No exception allowed from libdar callbacks")); } } } user_interaction * user_interaction_callback::clone() const { user_interaction *ret = new (get_pool()) user_interaction_callback(*this); // copy constructor if(ret == nullptr) throw Ememory("user_interaction_callback::clone"); else return ret; } } // end of namespace dar-2.5.3/src/libdar/fsa_family.hpp0000644000175000017430000000455212641772777014113 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file fsa_family.hpp /// \brief filesystem specific attributes available families and fsa_scope definition /// \ingroup API #ifndef FSA_FAMILY_HPP #define FSA_FAMILY_HPP #include #include #include "integers.hpp" #include "crc.hpp" namespace libdar { /// \addtogroup API /// @{ /// FSA family enum fsa_family { fsaf_hfs_plus, fsaf_linux_extX }; // note: adding new fsa_family need updating all_fsa_family() /// FSA nature enum fsa_nature { fsan_unset, fsan_creation_date, fsan_append_only, fsan_compressed, fsan_no_dump, fsan_immutable, fsan_data_journaling, fsan_secure_deletion, fsan_no_tail_merging, fsan_undeletable, fsan_noatime_update, fsan_synchronous_directory, fsan_synchronous_update, fsan_top_of_dir_hierarchy }; extern std::string fsa_family_to_string(fsa_family f); extern std::string fsa_nature_to_string(fsa_nature n); typedef std::set fsa_scope; /// provides a scope containing all FSA families extern fsa_scope all_fsa_families(); extern infinint fsa_scope_to_infinint(const fsa_scope & val); extern fsa_scope infinint_to_fsa_scope(const infinint & ref); extern std::string fsa_scope_to_string(bool saved, const fsa_scope & scope); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/int_tools.cpp0000644000175000017520000000407312610405012013747 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "int_tools.hpp" namespace libdar { void int_tools_swap_bytes(unsigned char &a, unsigned char &b) { unsigned char c = a; a = b; b = c; } void int_tools_swap_bytes(unsigned char *a, U_I size) { if(size <= 1) return; else { int_tools_swap_bytes(a[0], a[size-1]); int_tools_swap_bytes(a+1, size-2); // terminal recursivity } } void int_tools_expand_byte(unsigned char a, int_tools_bitfield &bit) { unsigned char mask = 0x80; for(S_I i = 0; i < 8; ++i) { bit[i] = (a & mask) >> (7 - i); mask >>= 1; } } void int_tools_contract_byte(const int_tools_bitfield &b, unsigned char & a) { a = 0; for(S_I i = 0; i < 8; ++i) { a <<= 1; if(b[i] > 1) throw Erange("infinint.cpp : contract_byte", gettext("a binary digit is either 0 or 1")); a += b[i]; } } } // end of namespace dar-2.5.3/src/libdar/archive_options.cpp0000644000175000017430000011520512642474445015156 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "archive_options.hpp" #include "entrepot_local.hpp" using namespace std; namespace libdar { // general default values static const U_32 default_crypto_size = 10240; static const path default_ref_chem = "/"; static const U_I default_min_compr_size = 100; static const cat_inode::comparison_fields default_comparison_fields = cat_inode::cf_all; static const crit_constant_action default_crit_action = crit_constant_action(data_preserve, EA_preserve); static const string default_user_comment = "N/A"; // some local helper functions inline void archive_option_destroy_mask(mask * & ptr); inline void archive_option_clean_mask(mask * & ptr, memory_pool *pool, bool all = true); inline void archive_option_destroy_crit_action(crit_action * & ptr); inline void archive_option_clean_crit_action(crit_action * & ptr); ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// inline void archive_option_clean_mask(mask * & ptr, memory_pool *pool, bool all) { archive_option_destroy_mask(ptr); ptr = new (pool) bool_mask(all); if(ptr == nullptr) throw Ememory("archive_option_clean_mask"); } inline void archive_option_destroy_mask(mask * & ptr) { if(ptr != nullptr) { delete ptr; ptr = nullptr; } } inline void archive_option_clean_crit_action(crit_action * & ptr) { archive_option_destroy_crit_action(ptr); ptr = default_crit_action.clone(); if(ptr == nullptr) throw Ememory("archive_options::archive_option_clean_crit_action"); } inline void archive_option_destroy_crit_action(crit_action * & ptr) { if(ptr != nullptr) { delete ptr; ptr = nullptr; } } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// archive_options_read::archive_options_read() : x_ref_chem(default_ref_chem) { x_entrepot = nullptr; x_ref_entrepot = nullptr; clear(); } void archive_options_read::clear() { // setting the default values for all options destroy(); x_crypto = crypto_none; x_pass.clear(); x_crypto_size = default_crypto_size; x_input_pipe = ""; x_output_pipe = ""; x_execute = ""; x_info_details = false; x_lax = false; x_sequential_read = false; x_slice_min_digits = 0; x_entrepot = new (get_pool()) entrepot_local("", "", false); // never using furtive_mode to read slices if(x_entrepot == nullptr) throw Ememory("archive_options_read::clear"); x_ignore_signature_check_failure = false; x_multi_threaded = true; // external_cat = false; x_ref_chem = default_ref_chem; x_ref_basename = ""; x_ref_crypto = crypto_none; x_ref_pass.clear(); x_ref_crypto_size = default_crypto_size; x_ref_execute = ""; x_ref_slice_min_digits = 0; x_ref_entrepot = new (get_pool()) entrepot_local("", "", false); // never using furtive_mode to read slices if(x_ref_entrepot == nullptr) throw Ememory("archive_options_read::clear"); } void archive_options_read::set_default_crypto_size() { x_crypto_size = default_crypto_size; x_ref_crypto_size = default_crypto_size; } void archive_options_read::unset_external_catalogue() { x_ref_chem = default_ref_chem; x_ref_basename = ""; external_cat = false; } const path & archive_options_read::get_ref_path() const { NLS_SWAP_IN; try { if(!external_cat) throw Elibcall("archive_options_read::get_external_catalogue", gettext("Cannot get catalogue of reference as it has not been provided")); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return x_ref_chem; } const string & archive_options_read::get_ref_basename() const { NLS_SWAP_IN; try { if(!external_cat) throw Elibcall("archive_options_read::get_external_catalogue", gettext("Error, catalogue of reference has not been provided")); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; return x_ref_basename; } void archive_options_read::copy_from(const archive_options_read & ref) { x_crypto = ref.x_crypto; x_pass = ref.x_pass; x_crypto_size = ref.x_crypto_size; x_input_pipe = ref.x_input_pipe; x_output_pipe = ref.x_output_pipe; x_execute = ref.x_execute; x_info_details = ref.x_info_details; x_lax = ref.x_lax; x_sequential_read = ref.x_sequential_read; x_slice_min_digits = ref.x_slice_min_digits; if(ref.x_entrepot == nullptr) throw SRC_BUG; x_entrepot = ref.x_entrepot->clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_read::copy_from"); x_ignore_signature_check_failure = ref.x_ignore_signature_check_failure; x_multi_threaded = ref.x_multi_threaded; // external_cat = ref.external_cat; x_ref_chem = ref.x_ref_chem; x_ref_basename = ref.x_ref_basename; x_ref_crypto = ref.x_ref_crypto; x_ref_pass = ref.x_ref_pass; x_ref_crypto_size = ref.x_ref_crypto_size; x_ref_execute = ref.x_ref_execute; x_ref_slice_min_digits = ref.x_ref_slice_min_digits; if(ref.x_ref_entrepot == nullptr) throw SRC_BUG; x_ref_entrepot = ref.x_ref_entrepot->clone(); if(x_ref_entrepot == nullptr) throw Ememory("archive_options_read::copy_from"); } void archive_options_read::destroy() { if(x_entrepot != nullptr) { delete x_entrepot; x_entrepot = nullptr; } if(x_ref_entrepot != nullptr) { delete x_ref_entrepot; x_ref_entrepot = nullptr; } } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// archive_options_create::archive_options_create() { x_selection = x_subtree = x_ea_mask = x_compr_mask = x_backup_hook_file_mask = nullptr; x_entrepot = nullptr; try { clear(); } catch(...) { destroy(); throw; } } archive_options_create::archive_options_create(const archive_options_create & ref) { x_selection = x_subtree = x_ea_mask = x_compr_mask = x_backup_hook_file_mask = nullptr; x_entrepot = nullptr; try { copy_from(ref); } catch(...) { destroy(); throw; } } void archive_options_create::clear() { NLS_SWAP_IN; try { destroy(); archive_option_clean_mask(x_selection, get_pool()); archive_option_clean_mask(x_subtree, get_pool()); archive_option_clean_mask(x_ea_mask, get_pool()); archive_option_clean_mask(x_compr_mask, get_pool()); archive_option_clean_mask(x_backup_hook_file_mask, get_pool(), false); x_ref_arch = nullptr; x_allow_over = true; x_warn_over = true; x_info_details = false; x_display_treated = false; x_display_treated_only_dir = false; x_display_skipped = false; x_display_finished = false; x_pause = 0; x_empty_dir = false; x_compr_algo = none; x_compression_level = 9; x_file_size = 0; x_first_file_size = 0; x_execute = ""; x_crypto = crypto_none; x_pass.clear(); x_crypto_size = default_crypto_size; x_gnupg_recipients.clear(); x_gnupg_signatories.clear(); x_min_compr_size = default_min_compr_size; x_nodump = false; exclude_by_ea = ""; x_what_to_check = default_comparison_fields; x_hourshift = 0; x_empty = false; x_alter_atime = true; x_old_alter_atime = true; #if FURTIVE_READ_MODE_AVAILABLE x_furtive_read = true; #else x_furtive_read = false; #endif x_same_fs = false; x_snapshot = false; x_cache_directory_tagging = false; x_fixed_date = 0; x_slice_permission = ""; x_slice_user_ownership = ""; x_slice_group_ownership = ""; x_repeat_count = 3; x_repeat_byte = 1; x_sequential_marks = true; x_sparse_file_min_size = 15; // min value to activate the feature (0 means no detection of sparse_file) x_security_check = true; x_user_comment = default_user_comment; x_hash = hash_none; x_slice_min_digits = 0; x_backup_hook_file_execute = ""; x_ignore_unknown = false; x_entrepot = new (get_pool()) entrepot_local( "", "", false); // never using furtive_mode to read slices if(x_entrepot == nullptr) throw Ememory("archive_options_create::clear"); x_scope = all_fsa_families(); x_multi_threaded = true; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_create::set_selection(const mask & selection) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); x_selection = selection.clone(); if(x_selection == nullptr) throw Ememory("archive_options_create::set_selection"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_create::set_subtree(const mask & subtree) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_subtree); x_subtree = subtree.clone(); if(x_subtree == nullptr) throw Ememory("archive_options_create::set_subtree"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_create::set_ea_mask(const mask & ea_mask) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_ea_mask); x_ea_mask = ea_mask.clone(); if(x_ea_mask == nullptr) throw Ememory("archive_options_create::set_ea_mask"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_create::set_compr_mask(const mask & compr_mask) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_compr_mask); x_compr_mask = compr_mask.clone(); if(x_compr_mask == nullptr) throw Ememory("archive_options_create::set_compr_mask"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_create::set_backup_hook(const std::string & execute, const mask & which_files) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_backup_hook_file_mask); x_backup_hook_file_mask = which_files.clone(); if(x_backup_hook_file_mask == nullptr) throw Ememory("archive_options_create::set_backup_hook"); x_backup_hook_file_execute = execute; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_create::set_entrepot(const entrepot & entr) { if(x_entrepot != nullptr) delete x_entrepot; x_entrepot = entr.clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_create::set_entrepot"); } void archive_options_create::destroy() { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); archive_option_destroy_mask(x_subtree); archive_option_destroy_mask(x_ea_mask); archive_option_destroy_mask(x_compr_mask); archive_option_destroy_mask(x_backup_hook_file_mask); if(x_entrepot != nullptr) { delete x_entrepot; x_entrepot = nullptr; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_create::copy_from(const archive_options_create & ref) { x_selection = nullptr; x_subtree = nullptr; x_ea_mask = nullptr; x_compr_mask = nullptr; x_backup_hook_file_mask = nullptr; x_entrepot = nullptr; if(ref.x_selection == nullptr) throw SRC_BUG; if(ref.x_subtree == nullptr) throw SRC_BUG; if(ref.x_ea_mask == nullptr) throw SRC_BUG; if(ref.x_compr_mask == nullptr) throw SRC_BUG; if(ref.x_backup_hook_file_mask == nullptr) throw SRC_BUG; x_selection = ref.x_selection->clone(); x_subtree = ref.x_subtree->clone(); x_ea_mask = ref.x_ea_mask->clone(); x_compr_mask = ref.x_compr_mask->clone(); x_backup_hook_file_mask = ref.x_backup_hook_file_mask->clone(); if(x_selection == nullptr || x_subtree == nullptr || x_ea_mask == nullptr || x_compr_mask == nullptr || x_backup_hook_file_mask == nullptr) throw Ememory("archive_options_create::copy_from"); x_ref_arch = ref.x_ref_arch; x_allow_over = ref.x_allow_over; x_warn_over = ref.x_warn_over; x_info_details = ref.x_info_details; x_display_treated = ref.x_display_treated; x_display_treated_only_dir = ref.x_display_treated_only_dir; x_display_skipped = ref.x_display_skipped; x_display_finished = ref.x_display_finished; x_pause = ref.x_pause; x_empty_dir = ref.x_empty_dir; x_compr_algo = ref.x_compr_algo; x_compression_level = ref.x_compression_level; x_file_size = ref.x_file_size; x_first_file_size = ref.x_first_file_size; x_execute = ref.x_execute; x_crypto = ref.x_crypto; x_pass = ref.x_pass; x_crypto_size = ref.x_crypto_size; x_gnupg_recipients = ref.x_gnupg_recipients; x_gnupg_signatories = ref.x_gnupg_signatories; x_min_compr_size = ref.x_min_compr_size; x_nodump = ref.x_nodump; x_what_to_check = ref.x_what_to_check; x_hourshift = ref.x_hourshift; x_empty = ref.x_empty; x_alter_atime = ref.x_alter_atime; x_old_alter_atime = ref.x_old_alter_atime; x_furtive_read = ref.x_furtive_read; x_same_fs = ref.x_same_fs; x_snapshot = ref.x_snapshot; x_cache_directory_tagging = ref.x_cache_directory_tagging; x_fixed_date = ref.x_fixed_date; x_slice_permission = ref.x_slice_permission; x_slice_user_ownership = ref.x_slice_user_ownership; x_slice_group_ownership = ref.x_slice_group_ownership; x_repeat_count = ref.x_repeat_count; x_repeat_byte = ref.x_repeat_byte; x_sequential_marks = ref.x_sequential_marks; x_sparse_file_min_size = ref.x_sparse_file_min_size; x_security_check = ref.x_security_check; x_user_comment = ref.x_user_comment; x_hash = ref.x_hash; x_slice_min_digits = ref.x_slice_min_digits; x_backup_hook_file_execute = ref.x_backup_hook_file_execute; x_ignore_unknown = ref.x_ignore_unknown; if(x_entrepot != nullptr) throw SRC_BUG; x_entrepot = ref.x_entrepot->clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_create::copy_from"); x_scope = ref.x_scope; x_multi_threaded = ref.x_multi_threaded; } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// void archive_options_isolate::clear() { NLS_SWAP_IN; try { destroy(); x_allow_over = true; x_warn_over = true; x_info_details = false; x_pause = 0; x_algo = none; x_compression_level = 9; x_file_size = 0; x_first_file_size = 0; x_execute = ""; x_crypto = crypto_none; x_pass.clear(); x_crypto_size = default_crypto_size; x_gnupg_recipients.clear(); x_gnupg_signatories.clear(); x_empty = false; x_slice_permission = ""; x_slice_user_ownership = ""; x_slice_group_ownership = ""; x_user_comment = default_user_comment; x_hash = hash_none; x_slice_min_digits = 0; x_sequential_marks = true; x_entrepot = new (get_pool()) entrepot_local("", "", false); // never using furtive_mode to read slices if(x_entrepot == nullptr) throw Ememory("archive_options_isolate::clear"); x_multi_threaded = true; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_isolate::set_entrepot(const entrepot & entr) { if(x_entrepot != nullptr) delete x_entrepot; x_entrepot = entr.clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_isolate::set_entrepot"); } void archive_options_isolate::destroy() { if(x_entrepot != nullptr) { delete x_entrepot; x_entrepot = nullptr; } } void archive_options_isolate::copy_from(const archive_options_isolate & ref) { x_allow_over = ref.x_allow_over; x_warn_over = ref.x_warn_over; x_info_details = ref.x_info_details; x_pause = ref.x_pause; x_algo = ref.x_algo; x_compression_level = ref.x_compression_level; x_file_size = ref.x_file_size; x_first_file_size = ref.x_first_file_size; x_execute = ref.x_execute; x_crypto = ref.x_crypto; x_pass = ref.x_pass; x_crypto_size = ref.x_crypto_size; x_gnupg_recipients = ref.x_gnupg_recipients; x_gnupg_signatories = ref.x_gnupg_signatories; x_empty = ref.x_empty; x_slice_permission = ref.x_slice_permission; x_slice_user_ownership = ref.x_slice_user_ownership; x_slice_group_ownership = ref.x_slice_group_ownership; x_user_comment = ref.x_user_comment; x_hash = ref.x_hash; x_slice_min_digits = ref.x_slice_min_digits; x_sequential_marks = ref.x_sequential_marks; if(ref.x_entrepot == nullptr) throw SRC_BUG; x_entrepot = ref.x_entrepot->clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_isolate::copy_from"); x_multi_threaded = ref.x_multi_threaded; } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// void archive_options_merge::clear() { NLS_SWAP_IN; try { destroy(); archive_option_clean_mask(x_selection, get_pool()); archive_option_clean_mask(x_subtree, get_pool()); archive_option_clean_mask(x_ea_mask, get_pool()); archive_option_clean_mask(x_compr_mask, get_pool()); archive_option_clean_crit_action(x_overwrite); x_ref = nullptr; x_allow_over = true; x_warn_over = true; x_info_details = false; x_display_treated = false; x_display_treated_only_dir = false; x_display_skipped = false; x_pause = 0; x_empty_dir = false; x_compr_algo = none; x_compression_level = 9; x_file_size = 0; x_first_file_size = 0; x_execute = ""; x_crypto = crypto_none; x_pass.clear(); x_crypto_size = default_crypto_size; x_gnupg_recipients.clear(); x_gnupg_signatories.clear(); x_min_compr_size = default_min_compr_size; x_empty = false; x_keep_compressed = false; x_slice_permission = ""; x_slice_user_ownership = ""; x_slice_group_ownership = ""; x_decremental = false; x_sequential_marks = true; x_sparse_file_min_size = 0; // disabled by default x_user_comment = default_user_comment; x_hash = hash_none; x_slice_min_digits = 0; x_entrepot = new (get_pool()) entrepot_local("", "", false); // never using furtive_mode to read slices if(x_entrepot == nullptr) throw Ememory("archive_options_merge::clear"); x_scope = all_fsa_families(); x_multi_threaded = true; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_merge::set_selection(const mask & selection) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); x_selection = selection.clone(); if(x_selection == nullptr) throw Ememory("archive_options_merge::set_selection"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_merge::set_subtree(const mask & subtree) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_subtree); x_subtree = subtree.clone(); if(x_subtree == nullptr) throw Ememory("archive_options_merge::set_subtree"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_merge::set_overwriting_rules(const crit_action & overwrite) { NLS_SWAP_IN; try { archive_option_destroy_crit_action(x_overwrite); x_overwrite = overwrite.clone(); if(x_overwrite == nullptr) throw Ememory("archive_options_merge::set_overwriting_rules"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_merge::set_ea_mask(const mask & ea_mask) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_ea_mask); x_ea_mask = ea_mask.clone(); if(x_ea_mask == nullptr) throw Ememory("archive_options_merge::set_ea_mask"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_merge::set_compr_mask(const mask & compr_mask) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_compr_mask); x_compr_mask = compr_mask.clone(); if(x_compr_mask == nullptr) throw Ememory("archive_options_merge::set_compr_mask"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_merge::set_entrepot(const entrepot & entr) { if(x_entrepot != nullptr) delete x_entrepot; x_entrepot = entr.clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_merge::set_entrepot"); } void archive_options_merge::destroy() { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); archive_option_destroy_mask(x_subtree); archive_option_destroy_mask(x_ea_mask); archive_option_destroy_mask(x_compr_mask); archive_option_destroy_crit_action(x_overwrite); if(x_entrepot != nullptr) { delete x_entrepot; x_entrepot = nullptr; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_merge::copy_from(const archive_options_merge & ref) { x_selection = nullptr; x_subtree = nullptr; x_ea_mask = nullptr; x_compr_mask = nullptr; x_overwrite = nullptr; x_entrepot = nullptr; try { if(ref.x_selection == nullptr) throw SRC_BUG; if(ref.x_subtree == nullptr) throw SRC_BUG; if(ref.x_ea_mask == nullptr) throw SRC_BUG; if(ref.x_compr_mask == nullptr) throw SRC_BUG; if(ref.x_overwrite == nullptr) throw SRC_BUG; if(ref.x_entrepot == nullptr) throw SRC_BUG; x_selection = ref.x_selection->clone(); x_subtree = ref.x_subtree->clone(); x_ea_mask = ref.x_ea_mask->clone(); x_compr_mask = ref.x_compr_mask->clone(); x_overwrite = ref.x_overwrite->clone(); x_entrepot = ref.x_entrepot->clone(); if(x_selection == nullptr || x_subtree == nullptr || x_ea_mask == nullptr || x_compr_mask == nullptr || x_overwrite == nullptr || x_entrepot == nullptr) throw Ememory("archive_options_extract::copy_from"); x_ref = ref.x_ref; x_allow_over = ref.x_allow_over; x_warn_over = ref.x_warn_over; x_info_details = ref.x_info_details; x_display_treated = ref.x_display_treated; x_display_treated_only_dir = ref.x_display_treated_only_dir; x_display_skipped = ref.x_display_skipped; x_pause = ref.x_pause; x_empty_dir = ref.x_empty_dir; x_compr_algo = ref.x_compr_algo; x_compression_level = ref.x_compression_level; x_file_size = ref.x_file_size; x_first_file_size = ref.x_first_file_size; x_execute = ref.x_execute; x_crypto = ref.x_crypto; x_pass = ref.x_pass; x_crypto_size = ref.x_crypto_size; x_gnupg_recipients = ref.x_gnupg_recipients; x_gnupg_signatories = ref.x_gnupg_signatories; x_min_compr_size = ref.x_min_compr_size; x_empty = ref.x_empty; x_keep_compressed = ref.x_keep_compressed; x_slice_permission = ref.x_slice_permission; x_slice_user_ownership = ref.x_slice_user_ownership; x_slice_group_ownership = ref.x_slice_group_ownership; x_decremental = ref.x_decremental; x_sequential_marks = ref.x_sequential_marks; x_sparse_file_min_size = ref.x_sparse_file_min_size; x_user_comment = ref.x_user_comment; x_hash = ref.x_hash; x_slice_min_digits = ref.x_slice_min_digits; x_scope = ref.x_scope; x_multi_threaded = ref.x_multi_threaded; } catch(...) { clear(); throw; } } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// void archive_options_extract::clear() { NLS_SWAP_IN; try { archive_option_clean_mask(x_selection, get_pool()); archive_option_clean_mask(x_subtree, get_pool()); archive_option_clean_mask(x_ea_mask, get_pool()); archive_option_clean_crit_action(x_overwrite); x_warn_over = true; x_info_details = false; x_display_treated = false; x_display_treated_only_dir = false; x_display_skipped = false; x_flat = false; x_what_to_check = default_comparison_fields; x_warn_remove_no_match = true; x_empty = false; x_empty_dir = true; x_dirty = dirty_warn; x_only_deleted = false; x_ignore_deleted = false; x_scope = all_fsa_families(); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_extract::set_selection(const mask & selection) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); x_selection = selection.clone(); if(x_selection == nullptr) throw Ememory("archive_options_extract::set_selection"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_extract::set_subtree(const mask & subtree) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_subtree); x_subtree = subtree.clone(); if(x_subtree == nullptr) throw Ememory("archive_options_extract::set_subtree"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_extract::set_ea_mask(const mask & ea_mask) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_ea_mask); x_ea_mask = ea_mask.clone(); if(x_ea_mask == nullptr) throw Ememory("archive_options_extract::set_ea_mask"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_extract::set_overwriting_rules(const crit_action & over) { NLS_SWAP_IN; try { archive_option_destroy_crit_action(x_overwrite); x_overwrite = over.clone(); if(x_overwrite == nullptr) throw Ememory("archive_options_extract::set_overwriting_rules"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_extract::destroy() { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); archive_option_destroy_mask(x_subtree); archive_option_destroy_mask(x_ea_mask); archive_option_destroy_crit_action(x_overwrite); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_extract::copy_from(const archive_options_extract & ref) { x_selection = nullptr; x_subtree = nullptr; x_ea_mask = nullptr; x_overwrite = nullptr; try { if(ref.x_selection == nullptr) throw SRC_BUG; if(ref.x_subtree == nullptr) throw SRC_BUG; if(ref.x_ea_mask == nullptr) throw SRC_BUG; if(ref.x_overwrite == nullptr) throw SRC_BUG; x_selection = ref.x_selection->clone(); x_subtree = ref.x_subtree->clone(); x_ea_mask = ref.x_ea_mask->clone(); x_overwrite = ref.x_overwrite->clone(); if(x_selection == nullptr || x_subtree == nullptr || x_ea_mask == nullptr || x_overwrite == nullptr) throw Ememory("archive_options_extract::copy_from"); x_warn_over = ref.x_warn_over; x_info_details = ref.x_info_details; x_display_treated = ref.x_display_treated; x_display_treated_only_dir = ref.x_display_treated_only_dir; x_display_skipped = ref.x_display_skipped; x_flat = ref.x_flat; x_what_to_check = ref.x_what_to_check; x_warn_remove_no_match = ref.x_warn_remove_no_match; x_empty = ref.x_empty; x_empty_dir = ref.x_empty_dir; x_dirty = ref.x_dirty; x_only_deleted = ref.x_only_deleted; x_ignore_deleted = ref.x_ignore_deleted; x_scope = ref.x_scope; } catch(...) { clear(); throw; } } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// void archive_options_listing::clear() { NLS_SWAP_IN; try { destroy(); x_info_details = false; x_list_mode = normal; archive_option_clean_mask(x_selection, get_pool()); archive_option_clean_mask(x_subtree, get_pool()); x_filter_unsaved = false; x_display_ea = false; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_listing::set_selection(const mask & selection) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); x_selection = selection.clone(); if(x_selection == nullptr) throw Ememory("archive_options_listing::set_selection"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_listing::set_subtree(const mask & subtree) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_subtree); x_subtree = subtree.clone(); if(x_subtree == nullptr) throw Ememory("archive_options_listing::set_subtree"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_listing::set_user_slicing(const infinint & slicing_first, const infinint & slicing_others) { if(x_slicing_first == nullptr) { x_slicing_first = new (get_pool()) infinint(slicing_first); if(x_slicing_first == nullptr) throw Ememory("archive_options_listing::set_user_slicing"); } else *x_slicing_first = slicing_first; if(x_slicing_others == nullptr) { x_slicing_others = new (get_pool()) infinint(slicing_others); if(x_slicing_others == nullptr) throw Ememory("archive_options_listing::set_user_slicing"); } else *x_slicing_others = slicing_others; } const mask & archive_options_listing::get_selection() const { if(x_selection == nullptr) throw Erange("archive_option_listing", dar_gettext("No mask available")); return *x_selection; } const mask & archive_options_listing::get_subtree() const { if(x_subtree == nullptr) throw Erange("archive_option_listing", dar_gettext("No mask available")); return *x_subtree; } bool archive_options_listing::get_user_slicing(infinint & slicing_first, infinint & slicing_others) const { if(x_slicing_first != nullptr && x_slicing_others != nullptr) { slicing_first = *x_slicing_first; slicing_others = *x_slicing_others; return true; } else return false; } void archive_options_listing::destroy() { NLS_SWAP_IN; try { if(x_slicing_first != nullptr) { delete x_slicing_first; x_slicing_first = nullptr; } if(x_slicing_others != nullptr) { delete x_slicing_others; x_slicing_others = nullptr; } archive_option_destroy_mask(x_selection); archive_option_destroy_mask(x_subtree); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_listing::copy_from(const archive_options_listing & ref) { x_selection = nullptr; x_subtree = nullptr; x_slicing_first = nullptr; x_slicing_others = nullptr; try { if(ref.x_selection == nullptr) throw SRC_BUG; x_selection = ref.x_selection->clone(); x_subtree = ref.x_subtree->clone(); if(x_selection == nullptr || x_subtree == nullptr) throw Ememory("archive_options_listing::copy_from"); if(ref.x_slicing_first != nullptr) { x_slicing_first = new (get_pool()) infinint(*ref.x_slicing_first); if(x_slicing_first == nullptr) throw Ememory("archive_options_listing::copy_from"); } if(ref.x_slicing_others != nullptr) { x_slicing_others = new (get_pool()) infinint(*ref.x_slicing_others); if(x_slicing_others == nullptr) throw Ememory("archive_options_listing::copy_from"); } x_info_details = ref.x_info_details; x_list_mode = ref.x_list_mode; x_filter_unsaved = ref.x_filter_unsaved; x_display_ea = ref.x_display_ea; } catch(...) { clear(); throw; } } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// void archive_options_diff::clear() { NLS_SWAP_IN; try { destroy(); archive_option_clean_mask(x_selection, get_pool()); archive_option_clean_mask(x_subtree, get_pool()); x_info_details = false; x_display_treated = false; x_display_treated_only_dir = false; x_display_skipped = false; archive_option_clean_mask(x_ea_mask, get_pool()); x_what_to_check = cat_inode::cf_all; x_alter_atime = true; x_old_alter_atime = true; #if FURTIVE_READ_MODE_AVAILABLE x_furtive_read = true; #else x_furtive_read = false; #endif x_hourshift = 0; x_compare_symlink_date = true; x_scope = all_fsa_families(); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_diff::set_selection(const mask & selection) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); x_selection = selection.clone(); if(x_selection == nullptr) throw Ememory("archive_options_diff::set_selection"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_diff::set_subtree(const mask & subtree) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_subtree); x_subtree = subtree.clone(); if(x_subtree == nullptr) throw Ememory("archive_options_diff::set_subtree"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_diff::set_ea_mask(const mask & ea_mask) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_ea_mask); x_ea_mask = ea_mask.clone(); if(x_ea_mask == nullptr) throw Ememory("archive_options_dif::set_ea_mask"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_diff::set_furtive_read_mode(bool furtive_read) { NLS_SWAP_IN; try { #if FURTIVE_READ_MODE_AVAILABLE x_furtive_read = furtive_read; if(furtive_read) { x_old_alter_atime = x_alter_atime; x_alter_atime = true; // this is required to avoid libdar manipulating ctime of inodes } else x_alter_atime = x_old_alter_atime; #else if(furtive_read) throw Ecompilation(gettext("Furtive read mode")); x_furtive_read = false; #endif } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_diff::destroy() { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); archive_option_destroy_mask(x_subtree); archive_option_destroy_mask(x_ea_mask); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_diff::copy_from(const archive_options_diff & ref) { x_selection = nullptr; x_subtree = nullptr; x_ea_mask = nullptr; try { if(ref.x_selection == nullptr) throw SRC_BUG; if(ref.x_subtree == nullptr) throw SRC_BUG; if(ref.x_ea_mask == nullptr) throw SRC_BUG; x_selection = ref.x_selection->clone(); x_subtree = ref.x_subtree->clone(); x_ea_mask = ref.x_ea_mask->clone(); if(x_selection == nullptr || x_subtree == nullptr || x_ea_mask == nullptr) throw Ememory("archive_options_extract::copy_from"); x_info_details = ref.x_info_details; x_display_treated = ref.x_display_treated; x_display_treated_only_dir = ref.x_display_treated_only_dir; x_display_skipped = ref.x_display_skipped; x_what_to_check = ref.x_what_to_check; x_alter_atime = ref.x_alter_atime; x_old_alter_atime = ref.x_old_alter_atime; x_furtive_read = ref.x_furtive_read; x_hourshift = ref.x_hourshift; x_compare_symlink_date = ref.x_compare_symlink_date; x_scope = ref.x_scope; } catch(...) { clear(); throw; } } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// void archive_options_test::clear() { NLS_SWAP_IN; try { destroy(); archive_option_clean_mask(x_selection, get_pool()); archive_option_clean_mask(x_subtree, get_pool()); x_info_details = false; x_display_treated = false; x_display_treated_only_dir = false; x_display_skipped = false; x_empty = false; } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_test::set_selection(const mask & selection) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); x_selection = selection.clone(); if(x_selection == nullptr) throw Ememory("archive_options_test::set_selection"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_test::set_subtree(const mask & subtree) { NLS_SWAP_IN; try { archive_option_destroy_mask(x_subtree); x_subtree = subtree.clone(); if(x_subtree == nullptr) throw Ememory("archive_option_test::set_subtree"); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_test::destroy() { NLS_SWAP_IN; try { archive_option_destroy_mask(x_selection); archive_option_destroy_mask(x_subtree); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void archive_options_test::copy_from(const archive_options_test & ref) { x_selection = nullptr; x_subtree = nullptr; try { if(ref.x_selection == nullptr) throw SRC_BUG; if(ref.x_subtree == nullptr) throw SRC_BUG; x_selection = ref.x_selection->clone(); x_subtree = ref.x_subtree->clone(); if(x_selection == nullptr || x_subtree == nullptr) throw Ememory("archive_options_extract::copy_from"); x_info_details = ref.x_info_details; x_display_treated = ref.x_display_treated; x_display_treated_only_dir = ref.x_display_treated_only_dir; x_display_skipped = ref.x_display_skipped; x_empty = ref.x_empty; } catch(...) { clear(); throw; } } } // end of namespace dar-2.5.3/src/libdar/header.cpp0000644000175000017430000002553212641772777013225 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // to allow compilation under Cygwin we need // else Cygwin's lack __int16_t symbol !?! #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif } // end extern "C" #include "header.hpp" #include "tlv_list.hpp" #include "tools.hpp" #include "fichier_global.hpp" using namespace std; namespace libdar { enum extension_type { extension_none = 'N', //< no extension (obsolete since format "08") extension_size = 'S', //< extension is the size of slices (obsolete since format "08") extension_tlv = 'T' //< extension is a TLV (systematic since format "08") }; enum tlv_type { tlv_size = 1, //< TLV gives the size of slices (infinint) tlv_first_size = 2, //< TLV gives the size of first slice (infinint) tlv_data_name = 3, //< TLV gives the name of the data set tlv_reserved = 65535 //< TLV reserved if 16 bits type space is exhausted to signal a new (larger type storage, to be implemented of course) }; /*************************************************************/ /******************* HEADER datastructure ********************/ /*************************************************************/ header::header() { magic = 0; internal_name.clear(); data_name.clear(); flag = '\0'; first_size = nullptr; slice_size = nullptr; old_header = false; } void header::read(user_interaction & ui, generic_file & f, bool lax) { magic_number tmp; tlv_list tempo; char extension; fichier_global *f_fic = dynamic_cast(&f); free_pointers(); old_header = false; if(f.read((char *)&tmp, sizeof(magic_number)) != sizeof(magic_number)) throw Erange("header::read", gettext("Reached end of file while reading slice header")); magic = ntohl(tmp); try { internal_name.read(f); } catch(Erange & e) { throw Erange("header::read", gettext("Reached end of file while reading slice header")); } if(f.read(&flag, 1) != 1) throw Erange("header::read", gettext("Reached end of file while reading slice header")); if(f.read(&extension, 1) != 1) throw Erange("header::read", gettext("Reached end of file while reading slice header")); data_name.clear(); switch(extension) { case extension_none: if(f_fic != nullptr) { slice_size = new (get_pool()) infinint(f_fic->get_size()); if(slice_size == nullptr) { if(!lax) throw Ememory("header::read"); else { ui.warning(gettext("LAX MODE: slice size is not possible to read, (lack of virtual memory?), continuing anyway...")); slice_size = new (get_pool()) infinint(0); if(slice_size == nullptr) throw Ememory("header::read"); } // this extension was used in archives before release 2.4.0 // when the first slice had the same size of the following ones // the slice size of all slices if thus the one of the first which // was learnt by getting the size of the file // this works also for single sliced archives. } } old_header = true; break; case extension_size: slice_size = new (get_pool()) infinint(f); if(slice_size == nullptr) { if(!lax) throw Ememory("header::read"); else { ui.warning(gettext("LAX MODE: slice size is not possible to read, (lack of virtual memory?), continuing anyway...")); slice_size = new (get_pool()) infinint(0); if(slice_size == nullptr) throw Ememory("header::read"); } } if(f_fic != nullptr) { first_size = new (get_pool()) infinint(f_fic->get_size()); if(first_size == nullptr) { if(!lax) throw Ememory("header::read"); else { ui.warning(gettext("LAX MODE: first slice size is not possible to read, (lack of virtual memory?), continuing anyway...")); first_size = new (get_pool()) infinint(0); if(first_size == nullptr) throw Ememory("header::read"); } // note: the "extension_size" extension was used in archives before release 2.4.0 // this option was only used in the first slice and contained the size of slices (not of the first slice) // when the first slice had a different size. This way, reading the size of the current file gives // the size of the first slice while the header extension gives the size of following slices. } } else if(!lax) throw Erange("header::read", gettext("Archive format older than \"08\" (release 2.4.0) cannot be read through a single pipe. It only can be read using dar_slave or normal plain file (slice)")); else ui.warning(gettext("LAX MODE: first slice size is not possible to read, continuing anyway...")); old_header = true; break; case extension_tlv: tempo.read(f); // read the list of TLV stored in the header fill_from(ui, tempo); // from the TLV list, set the different fields of the current header object if(slice_size == nullptr && f_fic != nullptr) { slice_size = new (get_pool()) infinint(f_fic->get_size()); if(slice_size == nullptr) throw Ememory("header::read"); } break; default: if(!lax) throw Erange("header::read", gettext("Badly formatted SAR header (unknown TLV type in slice header)")); else { ui.warning(gettext("LAX MODE: Unknown data in slice header, ignoring and continuing")); slice_size = new (get_pool()) infinint(0); if(slice_size == nullptr) throw Ememory("header::read"); } } if(data_name.is_cleared()) data_name = internal_name; } void header::write(user_interaction & ui, generic_file & f) const { magic_number tmp; char tmp_ext[] = { extension_tlv, '\0' }; tmp = htonl(magic); f.write((char *)&tmp, sizeof(magic)); internal_name.dump(f); f.write(&flag, 1); if(old_header) { if(first_size != nullptr && slice_size != nullptr && *first_size != *slice_size) { tmp_ext[0] = extension_size; f.write(tmp_ext, 1); slice_size->dump(f); } else { tmp_ext[0] = extension_none; f.write(tmp_ext, 1); } } else { f.write(tmp_ext, 1); // since release 2.4.0, tlv is always used to store optional information build_tlv_list(ui).dump(f); } } bool header::get_first_slice_size(infinint & size) const { if(first_size != nullptr) { size = *first_size; return true; } else return false; } void header::set_first_slice_size(const infinint & size) { if(first_size == nullptr) { first_size = new (get_pool()) infinint(); if(first_size == nullptr) throw Ememory("header::set_first_file_size"); } *first_size = size; } bool header::get_slice_size(infinint & size) const { if(slice_size != nullptr) { size = *slice_size; return true; } else return false; } void header::set_slice_size(const infinint & size) { if(slice_size == nullptr) { slice_size = new (get_pool()) infinint(); if(slice_size == nullptr) throw Ememory("header::set_slice_size"); } *slice_size = size; } void header::copy_from(const header & ref) { magic = ref.magic; internal_name = ref.internal_name; data_name = ref.data_name; flag = ref.flag; first_size = nullptr; slice_size = nullptr; try { if(ref.first_size != nullptr) { first_size = new (get_pool()) infinint(); if(first_size == nullptr) throw Ememory("header::copy_from"); *first_size = *ref.first_size; } if(ref.slice_size != nullptr) { slice_size = new (get_pool()) infinint(); if(slice_size == nullptr) throw Ememory("header::copy_from"); *slice_size = *ref.slice_size; } old_header = ref.old_header; } catch(...) { free_pointers(); throw; } } void header::free_pointers() { if(first_size != nullptr) { delete first_size; first_size = nullptr; } if(slice_size != nullptr) { delete slice_size; slice_size = nullptr; } } void header::fill_from(user_interaction & ui, const tlv_list & extension) { U_I taille = extension.size(); free_pointers(); for(U_I index = 0; index < taille; ++index) { switch(extension[index].get_type()) { case tlv_first_size: first_size = new (get_pool()) infinint(); if(first_size == nullptr) throw Ememory("header::fill_from"); extension[index].skip(0); first_size->read(extension[index]); break; case tlv_size: slice_size = new (get_pool()) infinint(); if(slice_size == nullptr) throw Ememory("header::fill_from"); extension[index].skip(0); slice_size->read(extension[index]); break; case tlv_data_name: try { extension[index].skip(0); data_name.read(extension[index]); } catch(Erange & e) { throw Erange("header::fill_from", gettext("incomplete data set name found in a slice header")); } break; default: ui.pause(tools_printf(gettext("Unknown entry found in slice header (type = %d), option not supported. The archive you are reading may have been generated by a more recent version of libdar, ignore this entry and continue anyway?"), extension[index].get_type())); } } } tlv_list header::build_tlv_list(user_interaction & ui) const { tlv_list ret; tlv tmp; if(first_size != nullptr) { tmp.reset(); first_size->dump(tmp); tmp.set_type(tlv_first_size); ret.add(tmp); } if(slice_size != nullptr) { tmp.reset(); slice_size->dump(tmp); tmp.set_type(tlv_size); ret.add(tmp); } tmp.reset(); data_name.dump(tmp); tmp.set_type(tlv_data_name); ret.add(tmp); return ret; } } // end of namespace dar-2.5.3/src/libdar/macro_tools.hpp0000644000175000017430000003741512641773016014311 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file macro_tools.hpp /// \brief macroscopic tools for libdar internals /// \ingroup Private #ifndef MACRO_TOOLS_HPP #define MACRO_TOOLS_HPP #include "../my_config.h" extern "C" { #if HAVE_LIMITS_H #include #endif } #include #include "catalogue.hpp" #include "compressor.hpp" #include "infinint.hpp" #include "header_version.hpp" #include "generic_file.hpp" #include "scrambler.hpp" #include "crypto.hpp" #include "escape.hpp" #include "pile.hpp" #include "entrepot.hpp" #include "tools.hpp" #include "range.hpp" #include "slice_layout.hpp" #include "trivial_sar.hpp" /// \addtogroup Private /// @{ #define BUFFER_SIZE 102400 #ifdef SSIZE_MAX #if SSIZE_MAX < BUFFER_SIZE #undef BUFFER_SIZE #define BUFFER_SIZE SSIZE_MAX #endif #endif #define GLOBAL_ELASTIC_BUFFER_SIZE 51200 namespace libdar { extern const archive_version macro_tools_supported_version; extern const std::string LIBDAR_STACK_LABEL_UNCOMPRESSED; extern const std::string LIBDAR_STACK_LABEL_CLEAR; extern const std::string LIBDAR_STACK_LABEL_UNCYPHERED; extern const std::string LIBDAR_STACK_LABEL_LEVEL1; /// create an container to write an archive to a pipe extern trivial_sar *macro_tools_open_archive_tuyau(user_interaction & dialog, memory_pool *pool, S_I fd, gf_mode mode, const label & internal_name, const label & data_name, bool slice_header_format_07, const std::string & execute); /// setup the given pile object to contain a stack of generic_files suitable to read an archive /// /// \note the stack has the following contents depending on given options /// /// +-top LIBDAR_STACK_LABEL_ /// +----------------------------------------------+---------------------+ /// | [ generic_thread ] |_UNCOMPRESSED | /// | compressor |v v v | /// +----------------------------------------------+---------------------+ /// | [ generic_thread ] |_CLEAR | /// | [ escape ] |v v v | /// +----------------------------------------------+v---v---v------------+ /// | [ generic_thread ] |_UNCYPHERED | /// | [ cache ] | crypto_sym | scrambler |v v v | /// | [ tronc ] |LEVEL 1 | /// | trivial_sar | zapette | sar |v v v | /// +----------------------------------------------+---------------------+ /// +-bottom /// /// \note generic_thread objects are only present in the stack if multi-thread is active /// \note escape is present unless tape mark have been disabled at archive creation time /// \note tronc is not present in sequential read mode /// \note cache layer is present only in absence of encryption and when no escape layer is above /// \note _UNCOMPRESSED label is associated to the top of the stack /// \note _CLEAR is associated to the generic_thread below compressor else escape else /// the cache or crypto_sym or scrambler which then has two Labels (_CLEAR and _UNCYPHERED) extern void macro_tools_open_archive(user_interaction & dialog, //< for user interaction memory_pool *pool, //< whether memory_pool allocation has to be performed const entrepot &where, //< slices location const std::string &basename, //< slice basename const infinint & min_digits, //< minimum digits for the slice number const std::string &extension, //< slice extensions crypto_algo crypto, //< encryption algorithm const secu_string &pass, //< pass key for crypto/scrambling U_32 crypto_size, //< crypto block size pile & stack, //< the stack of generic_file resulting of the archive openning header_version &ver, //< header read from raw data const std::string &input_pipe, //< named pipe for input when basename is "-" (dar_slave) const std::string &output_pipe, //< named pipe for output when basename is "-" (dar_slave) const std::string & execute, //< command to execute between slices infinint & second_terminateur_offset, //< where to start looking for the second terminateur (set to zero if there is only one terminateur). bool lax, // whether we skip&warn the usual verifications bool has_external_cat, //< true if the catalogue will not be read from the current archive (flag used in lax mode only) bool sequential_read, // whether to use the escape sequence (if present) to get archive contents and proceed to sequential reading bool info_details, // be or not verbose about the archive openning std::list & gnupg_signed, //< list of existing signature found for that archive (valid or not) slice_layout & sl, //< slicing layout of the archive bool multi_threaded); //< true if several thread shall be run concurrently by libdar // all allocated objects (ret1, ret2, scram), must be deleted when no more needed by the caller of this routine /// uses terminator to skip to the position where to find the catalogue and read it, taking care of having this catalogue pointing to the real data (context of isolated catalogue --- cata_stack --- used to rescue an internal archive --- data_stack) extern catalogue *macro_tools_get_derivated_catalogue_from(user_interaction & dialog, memory_pool *pool, pile & data_stack, // where to get the files and EA from pile & cata_stack, // where to get the catalogue from const header_version & ver, // version format as defined in the header of the archive to read bool info_details, // verbose display (throught user_interaction) infinint &cat_size, // return size of archive in file (not in memory !) const infinint & second_terminateur_offset, // location of the second terminateur (zero if none exist) std::list & signatories, // returns the list of signatories (empty if archive is was not signed) bool lax_mode); // whether to do relaxed checkings /// uses terminator to skip to the position where to find the catalogue and read it extern catalogue *macro_tools_get_catalogue_from(user_interaction & dialog, memory_pool *pool, pile & stack, // raw data access object const header_version & ver, // version format as defined in the header of the archive to read bool info_details, // verbose display (throught user_interaction) infinint &cat_size, // return size of archive in file (not in memory !) const infinint & second_terminateur_offset, std::list & signatories, // returns the list of signatories (empty if archive is was not signed) bool lax_mode); /// read the catalogue from cata_stack assuming the cata_stack is positionned at the beginning of the area containing archive's dumped data extern catalogue *macro_tools_read_catalogue(user_interaction & dialog, memory_pool *pool, const header_version & ver, const pile_descriptor & cata_pdesc, const infinint & cat_size, std::list & signatories, bool lax_mode, const label & lax_layer1_data_name, bool only_detruits); extern catalogue *macro_tools_lax_search_catalogue(user_interaction & dialog, memory_pool *pool, pile & stack, const archive_version & edition, compression compr_algo, bool info_details, bool even_partial_catalogues, const label & layer1_data_name); // return the offset of the beginning of the catalogue. extern infinint macro_tools_get_terminator_start(generic_file & f, const archive_version & reading_ver); /// build layers for a new archive /// /// \param[in] dialog for user interaction /// \param[out] layers the resulting stack of generic_file layers ready for use /// \param[out] ver the archive "header" to be dropped at end of archive /// \param[out] slicing slicing layout of the archive /// \param[in] ref_slicing if not nullptr the pointed to slicing_layout will be stored in the header/trailer version of the archive /// \param[in] pool memory pool to use for memory allocation (nullptr for no pool usage) /// \param[in] sauv_path_t where to create the archive /// \param[in] filename archive base name /// \param[in] extension archive extension /// \param[in] allow_over whether to allow slice overwriting /// \param[in] warn_over whether to warn before overwriting /// \param[in] info_details whether to display detailed information /// \param[in] pause how many slices to wait before pausing (0 to never wait) /// \param[in] algo compression algorithm /// \param[in] compression_level compression level /// \param[in] file_size size of the slices /// \param[in] first_file_size size of the first slice /// \param[in] execute command to execute after each slice creation /// \param[in] crypto cipher algorithm to use /// \param[in] pass password/passphrase to use for encryption /// \param[in] crypto_size size of crypto blocks /// \param[in] gnupg_recipients list of email recipients'public keys to encrypt a randomly chosen key with /// \param[in] gnupg_signatories list of email which associated signature has to be used to sign the archive /// \param[in] empty dry-run execution (null_file at bottom of the stack) /// \param[in] slice_permission permission to set the slices to /// \param[in] add_marks_for_sequential_reading whether to add an escape layer in the stack /// \param[in] user_comment user comment to add into the slice header/trailer /// \param[in] hash algorithm to use for slices hashing /// \param[in] slice_min_digits minimum number of digits slice number must have /// \param[in] internal_name common label to all slices /// \param[in] data_name to use in slice header /// \param[in] multi_threaded true if libdar can spawn several thread to work /// /// \note the stack has the following contents depending on given options /// /// +-top LIBDAR_STACK_LABEL_ /// +----------------------------------------------+---------------------+ /// | [ generic_thread ] | | /// | compressor | | /// +----------------------------------------------+---------------------+ /// | [ generic_thread ] | | /// | [ escape ] | | /// +-- - - - - - - - - - - - - - - - - - - - - - -+---------------------+ /// | [ generic_thread (if crypt or scam is used) ]| | /// | cache | crypto_sym | scrambler | | /// | [ cache ] |_CACHE_PIPE | /// | trivial_sar | null_file | sar | | /// +----------------------------------------------+---------------------+ /// +-bottom /// /// \note the bottom cache layer is only present when trivial_sar is used to write on a pipe. /// trivial_sar used to write a non sliced archive does not use a cache layer above it /// \note the top cache is only used in place of crypto_sym or scrambler when no encryption /// is required and the cache layer labelled _CACHE_PIPE is absent. /// \note escape layer is present by default unless tape marks have been disabled /// \note the generic_thread are inserted in the stack if multi-threading is possible and allowed /// extern void macro_tools_create_layers(user_interaction & dialog, pile & layers, header_version & ver, slice_layout & slicing, const slice_layout *ref_slicing, memory_pool *pool, const entrepot & sauv_path_t, const std::string & filename, const std::string & extension, bool allow_over, bool warn_over, bool info_details, const infinint & pause, compression algo, U_I compression_level, const infinint & file_size, const infinint & first_file_size, const std::string & execute, crypto_algo crypto, const secu_string & pass, U_32 crypto_size, const std::vector & gnupg_recipients, const std::vector & gnupg_signatories, bool empty, const std::string & slice_permission, bool add_marks_for_sequential_reading, const std::string & user_comment, hash_algo hash, const infinint & slice_min_digits, const label & internal_name, const label & data_name, bool multi_threaded); /// dumps the catalogue and close all the archive layers to terminate the archive /// /// \param[in] dialog for user interaction /// \param[in] layers the archive layers to close /// \param[in] ver the archive "header" to be dropped at end of archive /// \param[in] cat the catalogue to dump in the layer before closing the archive /// \param[in] info_details whether to display detailed information /// \param[in] crypto cipher algorithm used in "layers" /// \param[in] gnupg_recipients used sign the catalog, use an empty vector if there is no signatories (no nedd to sign the hash of the catalogue) /// \param[in] gnupg_signatories used to sign the catalog, use an empty vector to disable signning /// \param[in] algo compression algorithm used /// \param[in] empty dry-run execution (null_file at bottom of the stack) void macro_tools_close_layers(user_interaction & dialog, pile & layers, const header_version & ver, const catalogue & cat, bool info_details, crypto_algo crypto, compression algo, const std::vector & gnupg_recipients, const std::vector & gnupg_signatories, bool empty); /// gives the location of data EA and FSA (when they are saved) of the object given in argument /// /// \param[in] obj a pointer to the object which data & EFSA is to be located /// \param[in] sl slice layout of the archive /// \return a set of slices which will be required to restore that particular file (over the slice(s) /// containing the catalogue of course). range macro_tools_get_slices(const cat_nomme *obj, slice_layout sl); } // end of namespace /// @} #endif dar-2.5.3/src/libdar/semaphore.hpp0000644000175000017430000001255412642457363013755 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file semaphore.hpp /// \brief definition of class semaphore, used to manage invocation of backup hook for files /// \ingroup Private #ifndef SEMAPHORE_HPP #define SEMAPHORE_HPP #include "../my_config.h" #include "mem_ui.hpp" #include "mask.hpp" #include "catalogue.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ /// class semaphore /// Its action is to invoke the execute hook for each file that match the given mask /// Each file to backup has to be "raised()", which, if it matches the mask, leads /// to the execution of the execute hook with the proper substitution for that file /// in the "start" context. /// Then the backup can take place. /// When the backup is finished, the lower() method has to be called to trigger the /// execution of the hook with the proper substitution but in the "end" context. /// but, things are a bit complicated due to the handle of directories: /// If a directory is "raised()" and matches the mask, next calls to raise() do not trigger any /// hook execution even if the file match the mask, while saving into the directory /// that matched first. Instead, each new call to raise() increments an internal counter when /// a new directory is met, which is decremented when an "eod" is given to raised(). /// So it is important to feed raise() with any entry may it has to be saved or not. /// while lower() has only to be called when a file has been saved. /// This is only when this internal counters reaches zero, that the lower() call will /// trigger the execution for this first matched directory, of the hook in the "end" context. /// /// So the expected use is to give each file to be saved (including eod) to the raise() /// method, before eventually saving the file, and call the lower() method only for files that had to /// be saved once the backup is completed, may it be normally or due to an exception being thrown. class semaphore : public mem_ui, public on_pool { public: /// constructor /// \param[in] dialog for user interaction /// \param[in] backup_hook_file_execute is the string to execute, it can contains macros /// to be substitued, %f by filename, %p by path, %u by uid, %g by gid, and %c by the context, /// which is either "start" or "end". /// \param[in] backup_hook_file_mask defines the path+filename of entry that need to have /// the hook executed before and after their backup semaphore(user_interaction & dialog, const std::string & backup_hook_file_execute, const mask & backup_hook_file_mask); /// copy constructor semaphore(const semaphore & ref) : mem_ui(ref) { copy_from(ref); }; /// assignment operator semaphore & operator = (const semaphore & ref) { detruit(); copy_from(ref); return *this; }; /// destructor ~semaphore() { detruit(); }; /// to prepare a file for backup /// all file has to be given to this call, even the eod objects /// \param[in] path is the full path to the object /// \param[in] object is the object about to be saved /// \param[in] data_to_save tells whether this entry will have to be saved or just recursed into (directory for example) /// \note, if data_to_save is true, the lower() method is expected to be used /// before a next call to raise. For a directory this is only the call to lower() /// of the matching EOD that will trigger the hook execution in the "end" context. /// If instead data_to_save if false, no lower() call has to be done. void raise(const std::string & path, const cat_entree *object, bool data_to_save); /// to tell that the backup is completed for the last "raised" entry. void lower(); private: infinint count; //< is the number of subdirectories currently saved in the last directory that matched the mask std::string chem; //< path of the file that has to be call in the "end" context when count will drop to zero std::string filename; //< filename of that same file infinint uid; //< UID of that same file infinint gid; //< GID of that same file unsigned char sig; //< object type std::string execute; //< command to execute const mask *match; //< for which file to run the execute command std::string build_string(const std::string & context); void copy_from(const semaphore & ref); void detruit(); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/hash_fichier.cpp0000644000175000017430000001276212641772777014412 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "hash_fichier.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "path.hpp" using namespace std; namespace libdar { string hash_algo_to_string(hash_algo algo) { switch(algo) { case hash_none: throw SRC_BUG; case hash_md5: return "md5"; case hash_sha1: return "sha1"; case hash_sha512: return "sha512"; default: throw SRC_BUG; } } hash_fichier::hash_fichier(user_interaction & dialog, fichier_global *under, const std::string & under_filename, fichier_global *hash_file, hash_algo algo) : fichier_global(dialog, under->get_mode()) { if(under == nullptr) throw SRC_BUG; if(hash_file == nullptr) throw SRC_BUG; if(under->get_mode() == gf_read_write) throw SRC_BUG; if(hash_file->get_mode() != gf_write_only) throw SRC_BUG; only_hash = false; ref = under; hash_ref = hash_file; path tmp = under_filename; ref_filename = tmp.basename(); eof = false; hash_dumped = false; #if CRYPTO_AVAILABLE gcry_error_t err; switch(algo) { case hash_none: throw SRC_BUG; case hash_md5: hash_gcrypt = GCRY_MD_MD5; break; case hash_sha1: hash_gcrypt = GCRY_MD_SHA1; break; case hash_sha512: hash_gcrypt = GCRY_MD_SHA512; break; default: throw SRC_BUG; } err = gcry_md_test_algo(hash_gcrypt); if(err != GPG_ERR_NO_ERROR) throw Erange("hash_fichier::hash_fichier",tools_printf(gettext("Error while initializing hash: Hash algorithm not available in libgcrypt: %s/%s"), gcry_strsource(err),gcry_strerror(err))); err = gcry_md_open(&hash_handle, hash_gcrypt, 0); // no need of secure memory here if(err != GPG_ERR_NO_ERROR) throw Erange("hash_fichier::hash_fichier",tools_printf(gettext("Error while creating hash handle: %s/%s"), gcry_strsource(err),gcry_strerror(err))); #else throw Ecompilation(gettext("Missing hashing algorithms support (which is part of strong encryption support, using libgcrypt)")); #endif } hash_fichier::~hash_fichier() { try { terminate(); } catch(...) { // ignore all errors } if(ref != nullptr) { delete ref; ref = nullptr; } if(hash_ref != nullptr) { delete hash_ref; hash_ref = nullptr; } } U_I hash_fichier::fichier_global_inherited_write(const char *a, U_I size) { #if CRYPTO_AVAILABLE if(eof) throw SRC_BUG; gcry_md_write(hash_handle, (const void *)a, size); if(!only_hash) ref->write(a, size); return size; #else throw Ecompilation(gettext("Missing hashing algorithms support (which is part of strong encryption support, using libgcrypt)")); #endif } bool hash_fichier::fichier_global_inherited_read(char *a, U_I size, U_I & read, std::string & message) { #if CRYPTO_AVAILABLE if(eof) throw SRC_BUG; read = ref->read(a, size); message = "BUG! This should never show!"; if(read > 0) gcry_md_write(hash_handle, (const void *)a, read); return true; #else throw Ecompilation(gettext("Missing hashing algorithms support (which is part of strong encryption support, using libgcrypt)")); #endif } void hash_fichier::inherited_terminate() { if(!hash_dumped) { // avoids subsequent writings (yeld a bug report if that occurs) eof = true; // avoid a second run of dump_hash() hash_dumped = true; try { #if CRYPTO_AVAILABLE // first we obtain the hash result; const unsigned char *digest = gcry_md_read(hash_handle, hash_gcrypt); const U_I digest_size = gcry_md_get_algo_dlen(hash_gcrypt); try { string hexa = tools_string_to_hexa(string((char *)digest, digest_size)); if(hash_ref == nullptr) throw SRC_BUG; hash_ref->write((const char *)hexa.c_str(), hexa.size()); hash_ref->write(" ", 2); // two spaces sperator used by md5sum and sha1sum hash_ref->write(ref_filename.c_str(), ref_filename.size()); hash_ref->write("\n", 1); // we finish by a new-line character hash_ref->terminate(); } catch(Egeneric & e) { throw Erange("hash_fichier::dump_hash", gettext("Failed writing down the hash: ") + e.get_message()); } #endif // no #else clause (routine used from constructor, if binary lack support // for strong encryption this has already been returned to the user // and we must not trouble the destructor for that } catch(...) { #if CRYPTO_AVAILABLE gcry_md_close(hash_handle); #endif throw; } #if CRYPTO_AVAILABLE gcry_md_close(hash_handle); #endif } } } // end of namespace dar-2.5.3/src/libdar/cat_ignored.hpp0000644000175000017430000000403012641772777014246 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_ignored.hpp /// \brief class used to remember that an entry has been ignored and shall not be recorded as deleted using a detruit object in a catalogue /// \ingroup Private #ifndef CAT_IGNORED_HPP #define CAT_IGNORED_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_nomme.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the present file to ignore (not to be recorded as deleted later) class cat_ignored : public cat_nomme { public : cat_ignored(const std::string & name) : cat_nomme(name) {}; cat_ignored(const pile_descriptor & pdesc, bool small) : cat_nomme(pdesc, small) { throw SRC_BUG; }; bool operator == (const cat_entree & ref) const; unsigned char signature() const { return 'i'; }; cat_entree *clone() const { return new (get_pool()) cat_ignored(*this); }; protected: void inherited_dump(const pile_descriptor & pdesc, bool small) const { throw SRC_BUG; }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_device.cpp0000644000175000017430000001040112641772777014050 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // to allow compilation under Cygwin we need // else Cygwin's lack __int16_t symbol !?! #if HAVE_SYS_TYPES_H #include #endif #if HAVE_NETINET_IN_H #include #endif #if HAVE_ARPA_INET_H #include #endif #ifdef STDC_HEADERS #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_LIMITS_H #include #endif } // end extern "C" #include "cat_device.hpp" using namespace std; namespace libdar { cat_device::cat_device(const infinint & uid, const infinint & gid, U_16 perm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const string & name, U_16 major, U_16 minor, const infinint & fs_dev) : cat_inode(uid, gid, perm, last_access, last_modif, last_change, name, fs_dev) { xmajor = major; xminor = minor; set_saved_status(s_saved); } cat_device::cat_device(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small) : cat_inode(dialog, pdesc, reading_ver, saved, small) { U_16 tmp; generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; if(saved == s_saved) { if(ptr->read((char *)&tmp, sizeof(tmp)) != sizeof(tmp)) throw Erange("special::special", gettext("missing data to build a special device")); xmajor = ntohs(tmp); if(ptr->read((char *)&tmp, sizeof(tmp)) != sizeof(tmp)) throw Erange("special::special", gettext("missing data to build a special device")); xminor = ntohs(tmp); } } bool cat_device::operator == (const cat_entree & ref) const { const cat_device *ref_dev = dynamic_cast(&ref); if(ref_dev == nullptr) return false; else return xmajor == ref_dev->xmajor && xminor == ref_dev->xminor && cat_inode::operator == (ref); } void cat_device::inherited_dump(const pile_descriptor & pdesc, bool small) const { U_16 tmp; generic_file *ptr = nullptr; pdesc.check(small); if(small) ptr = pdesc.esc; else ptr = pdesc.stack; cat_inode::inherited_dump(pdesc, small); if(get_saved_status() == s_saved) { tmp = htons(xmajor); ptr->write((char *)&tmp, sizeof(tmp)); tmp = htons(xminor); ptr->write((char *)&tmp, sizeof(tmp)); } } void cat_device::sub_compare(const cat_inode & other, bool isolated_mode) const { const cat_device *d_other = dynamic_cast(&other); if(d_other == nullptr) throw SRC_BUG; // bug in cat_inode::compare if(get_saved_status() == s_saved && d_other->get_saved_status() == s_saved) { if(get_major() != d_other->get_major()) throw Erange("cat_device::sub_compare", tools_printf(gettext("devices have not the same major number: %d <--> %d"), get_major(), d_other->get_major())); if(get_minor() != d_other->get_minor()) throw Erange("cat_device::sub_compare", tools_printf(gettext("devices have not the same minor number: %d <--> %d"), get_minor(), d_other->get_minor())); } } } // end of namespace dar-2.5.3/src/libdar/cat_entree.hpp0000644000175000017430000002210012642474445014067 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_entree.hpp /// \brief base class for all object contained in a catalogue /// \ingroup Private #ifndef CAT_ENTREE_HPP #define CAT_ENTREE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "infinint.hpp" #include "user_interaction.hpp" #include "pile.hpp" #include "escape.hpp" #include "on_pool.hpp" #include "archive_version.hpp" #include "compressor.hpp" #include "pile_descriptor.hpp" namespace libdar { class cat_etoile; class cat_entree; /// \addtogroup Private /// @{ enum saved_status { s_saved, //< inode is saved in the archive s_fake, //< inode is not saved in the archive but is in the archive of reference (isolation context) s_fake is no more used in archive format "08" and above: isolated catalogue do keep the data pointers and s_saved stays a valid status in isolated catalogues. s_not_saved //< inode is not saved in the archive }; /// holds the statistics contents of a catalogue struct entree_stats { infinint num_x; //< number of file referenced as destroyed since last backup infinint num_d; //< number of directories infinint num_f; //< number of plain files (hard link or not, thus file directory entries) infinint num_c; //< number of char devices infinint num_b; //< number of block devices infinint num_p; //< number of named pipes infinint num_s; //< number of unix sockets infinint num_l; //< number of symbolic links infinint num_D; //< number of Door infinint num_hard_linked_inodes; //< number of inode that have more than one link (inode with "hard links") infinint num_hard_link_entries; //< total number of hard links (file directory entry pointing to \an //< inode already linked in the same or another directory (i.e. hard linked)) infinint saved; //< total number of saved inode (unix inode, not inode class) hard links do not count here infinint total; //< total number of inode in archive (unix inode, not inode class) hard links do not count here void clear() { num_x = num_d = num_f = num_c = num_b = num_p = num_s = num_l = num_D = num_hard_linked_inodes = num_hard_link_entries = saved = total = 0; }; void add(const cat_entree *ref); void listing(user_interaction & dialog) const; }; /// the root class from all other inherite for any entry in the catalogue class cat_entree : public on_pool { public : /// read and create an object of inherited class of class cat_entree /// /// \param[in] dialog for user interaction /// \param[in] pool for memory allocation (nullptr if special_alloc not activated) /// \param[in] f where from to read data in order to create the object /// \param[in] reading_ver archive version format to use for reading /// \param[in,out] stats updated statistical fields /// \param[in,out] corres used to setup hard links /// \param[in] default_algo default compression algorithm /// \param[in] lax whether to use relax mode /// \param[in] only_detruit whether to only consider detruit objects (in addition to the directory tree) /// \param[in] small whether the dump() to read has been done with the small argument set static cat_entree *read(user_interaction & dialog, memory_pool *pool, const pile_descriptor & f, const archive_version & reading_ver, entree_stats & stats, std::map & corres, compression default_algo, bool lax, bool only_detruit, bool small); /// setup an object when read from an archive /// /// \param[in] pdesc points to an existing stack that will be read from to setup fields of inherited classes, /// this pointed to pile object must survive the whole life of the cat_entree object /// \param[in] small whether a small or a whole read is to be read, (inode has been dump() with small set to true) cat_entree(const pile_descriptor & pdesc, bool small); // copy constructor is fine as we only copy the address of pointers // assignment operator is fine too for the same reason /// setup an object when read from filesystem cat_entree() {}; /// destructor virtual ~cat_entree() throw(Ebug) {}; /// returns true if the two object have the same content virtual bool operator == (const cat_entree & ref) const { return true; }; bool operator != (const cat_entree & ref) const { return ! (*this == ref); }; /// write down the object information to a stack /// /// \param[in,out] pdesc is the stack where to write the data to /// \param[in] small defines whether to do a small or normal dump void dump(const pile_descriptor & pdesc, bool small) const; /// this call gives an access to inherited_dump /// /// \param[in,out] pdesc is the stack where to write the data to /// \param[in] small defines whether to do a small or normal dump void specific_dump(const pile_descriptor & pdesc, bool small) const { inherited_dump(pdesc, small); }; /// let inherited classes build object's data after CRC has been read from file in small read mode /// /// \param[in] pdesc stack to read the data from /// \note used from cat_entree::read to complete small read /// \note this method is called by cat_entree::read and mirage::post_constructor only when contructing an object with small set to true virtual void post_constructor(const pile_descriptor & pdesc) {}; /// inherited class signature virtual unsigned char signature() const = 0; /// a way to copy the exact type of an object even if pointed to by a parent class pointer virtual cat_entree *clone() const = 0; /// for archive merging, will let the object drop EA, FSA and Data to an alternate stack than the one it has been read from /// /// \note this is used when cloning an object from a catalogue to provide a merged archive. Such cloned object must point /// the stack of the archive under construction, so we use this call for that need, /// \note this is also used when opening a catalogue if an isolated catalogue in place of the internal catalogue of an archive /// \note this method is virtual for cat_directory to overwrite it and propagate the change to all entries of the directory tree /// as well for mirage to propagate the change to the hard linked inode virtual void change_location(const pile_descriptor & pdesc); protected: /// inherited class may overload this method but shall first call the parent's inherited_dump() in the overloaded method virtual void inherited_dump(const pile_descriptor & pdesc, bool small) const; /// stack used to read object from (nullptr is returned for object created from filesystem) pile *get_pile() const { return pdesc.stack; }; /// compressor generic_file relative methods /// /// \note CAUTION: the pointer to object is member of the get_pile() stack and may be managed by another thread /// all precaution like get_pile()->flush_read_above(get_compressor_layer() shall be take to avoid /// concurrent access to the compressor object by the current thread and the thread managing this object compressor *get_compressor_layer() const { return pdesc.compr; }; /// escape generic_file relative methods /// /// \note CAUTION: the pointer to object is member of the get_pile() stack and may be managed by another thread /// all precaution like get_pile()->flush_read_above(get_escape_layer() shall be take to avoid /// concurrent access to the compressor object by the current thread and the thread managing this object escape *get_escape_layer() const { return pdesc.esc; }; /// return the adhoc layer in the stack to read from the catalogue objects (except the EA, FSA or Data part) generic_file *get_read_cat_layer(bool small) const; private: static const U_I ENTREE_CRC_SIZE; pile_descriptor pdesc; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/sar.cpp0000644000175000017430000011160312642457363012545 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { // this was necessary to compile under Mac OS-X (boggus dirent.h) #if HAVE_STDINT_H #include #endif #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_UNISTD_H #include #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_FCNTL_H #include #endif #if STDC_HEADERS #include #endif } // end extern "C" #include "sar.hpp" #include "deci.hpp" #include "user_interaction.hpp" #include "tools.hpp" #include "erreurs.hpp" #include "cygwin_adapt.hpp" #include "deci.hpp" #include "entrepot.hpp" #include "sar_tools.hpp" using namespace std; namespace libdar { sar::sar(const user_interaction & dialog, const string & base_name, const string & extension, const entrepot & where, bool by_the_end, const infinint & x_min_digits, bool x_lax, const string & execute) : generic_file(gf_read_only), mem_ui(dialog) { opt_warn_overwrite = true; opt_allow_overwrite = false; natural_destruction = true; base = base_name; ext = extension; initial = true; hook = execute; set_info_status(CONTEXT_INIT); slicing.older_sar_than_v8 = false; // will be set to true at header read time a bit further if necessary hash = hash_none; lax = x_lax; min_digits = x_min_digits; entr = nullptr; force_perm = false; to_read_ahead = 0; open_file_init(); try { entr = where.clone(); if(entr == nullptr) throw Ememory("sar::sar"); if(by_the_end) { try { skip_to_eof(); } catch(Erange & e) { string tmp = e.get_message(); get_ui().printf(gettext("Error met while opening the last slice: %S. Trying to open the archive using the first slice..."), &tmp); open_file(1); } } else open_file(1); } catch(...) { try { close_file(true); } catch(...) { if(of_fd != nullptr) { delete of_fd; of_fd = nullptr; } } if(entr != nullptr) delete entr; throw; } } sar::sar(const user_interaction & dialog, gf_mode open_mode, const string & base_name, const string & extension, const infinint & file_size, const infinint & first_file_size, bool x_warn_overwrite, bool x_allow_overwrite, const infinint & x_pause, const entrepot & where, const label & internal_name, const label & data_name, bool force_permission, U_I permission, hash_algo x_hash, const infinint & x_min_digits, bool format_07_compatible, const string & execute) : generic_file(open_mode), mem_ui(dialog) { if(open_mode == gf_read_only) throw SRC_BUG; if(file_size < header::min_size() + 1) //< one more byte to store at least one byte of data throw Erange("sar::sar", gettext("File size too small")); // note that this test does not warranty that the file is large enough to hold a header structure if(first_file_size < header::min_size() + 1) throw Erange("sar::sar", gettext("First file size too small")); // note that this test does not warranty that the file is large enough to hold a header structure initial = true; lax = false; opt_warn_overwrite = x_warn_overwrite; opt_allow_overwrite = x_allow_overwrite; natural_destruction = true; base = base_name; ext = extension; slicing.other_size = file_size; slicing.first_size = first_file_size; hook = execute; pause = x_pause; hash = x_hash; min_digits = x_min_digits; set_info_status(CONTEXT_OP); of_internal_name = internal_name; of_data_name = data_name; force_perm = force_permission; perm = permission; of_fd = nullptr; of_flag = '\0'; slicing.older_sar_than_v8 = format_07_compatible; entr = nullptr; to_read_ahead = 0; try { entr = where.clone(); if(entr == nullptr) throw Ememory("sar::sar"); open_file_init(); open_file(1); } catch(...) { try { close_file(true); } catch(...) { if(of_fd != nullptr) { delete of_fd; of_fd = nullptr; } } if(entr != nullptr) delete entr; throw; } } void sar::inherited_terminate() { close_file(true); if(get_mode() == gf_read_write && natural_destruction) { set_info_status(CONTEXT_LAST_SLICE); hook_execute(of_current); } } sar::~sar() { try { terminate(); } catch(...) { // ignore all exception } if(entr != nullptr) delete entr; } bool sar::skippable(skippability direction, const infinint & amount) { if(hash != hash_none) return false; switch(direction) { case generic_file::skip_backward: if(of_current == 1) return file_offset - slicing.first_slice_header >= amount; else return file_offset - slicing.other_slice_header >= amount; case generic_file::skip_forward: if(of_current == 1) return (file_offset + amount + (slicing.older_sar_than_v8 ? 0 : 1)) < slicing.first_size; else return (file_offset + amount + (slicing.older_sar_than_v8 ? 0 : 1)) < slicing.other_size; default: throw SRC_BUG; } } bool sar::skip(const infinint & pos) { infinint dest_file, offset; if(is_terminated()) throw SRC_BUG; if(get_position() == pos) return true; // no need to skip to_read_ahead = 0; /////////////////////////// // determination of the file to go and its offset to seek in // slicing.which_slice(pos, dest_file, offset); /////////////////////////// // checking whether the required position is acceptable // if(of_last_file_known && dest_file > of_last_file_num) { // going to EOF open_file(of_last_file_num); of_fd->skip_to_eof(); file_offset = of_fd->get_position(); return false; } else { try { open_file(dest_file); set_offset(offset); file_offset = offset; return true; } catch(Erange & e) { return false; } } } bool sar::skip_to_eof() { bool ret; if(is_terminated()) throw SRC_BUG; open_last_file(); if(of_fd == nullptr) throw SRC_BUG; to_read_ahead = 0; ret = of_fd->skip_to_eof(); switch(get_mode()) { case gf_read_only: if(!slicing.older_sar_than_v8) of_fd->skip_relative(-1); file_offset = of_fd->get_position(); set_offset(file_offset); break; case gf_read_write: case gf_write_only: file_offset = of_fd->get_position(); if(of_current == 1) { if(file_offset == slicing.first_size) { // we point to the slice trailer, which is not sar data // so we skip back one byte --file_offset; of_fd->skip(file_offset); } else if(file_offset > slicing.first_size) throw SRC_BUG; // should not be possible to have an initial slice larger than first_size } else { if(file_offset == slicing.other_size) { // we point to the slice trailer, which is not sar data // so we skip back one byte --file_offset; of_fd->skip(file_offset); } else if(file_offset > slicing.other_size) throw SRC_BUG; // should not be possible to have a slice larger than size } break; default: throw SRC_BUG; } return ret; } bool sar::skip_forward(U_I x) { infinint number = of_current; infinint offset = file_offset + x; infinint delta = slicing.older_sar_than_v8 ? 0 : 1; // one byte less per slice with archive format >= 8 if(is_terminated()) throw SRC_BUG; to_read_ahead = 0; while((number == 1 ? offset+delta >= slicing.first_size : offset+delta >= slicing.other_size) && (!of_last_file_known || number <= of_last_file_num)) { offset -= number == 1 ? slicing.first_size - delta : slicing.other_size - delta; offset += slicing.other_slice_header; number++; } if(number == 1 ? offset+delta < slicing.first_size : offset+delta < slicing.other_size) { open_file(number); file_offset = offset; set_offset(file_offset); return true; } else return false; } bool sar::skip_backward(U_I x) { infinint number = of_current; infinint offset = file_offset; infinint offset_neg = x; infinint delta = slicing.older_sar_than_v8 ? 0 : 1; // one byte less per slice with archive format >= 8 if(is_terminated()) throw SRC_BUG; while(number > 1 && offset_neg + slicing.other_slice_header > offset) { offset_neg -= offset - slicing.other_slice_header + 1; number--; if(number > 1) offset = slicing.other_size - 1 - delta; else offset = slicing.first_size - 1 - delta; } if((number > 1 ? offset_neg + slicing.other_slice_header : offset_neg + slicing.first_slice_header) <= offset) { open_file(number); file_offset = offset - offset_neg; set_offset(file_offset); return true; } else { // seek to beginning of file open_file(1); set_offset(slicing.first_slice_header); return false; } } bool sar::skip_relative(S_I x) { if(is_terminated()) throw SRC_BUG; if(x > 0) return skip_forward(x); if(x < 0) return skip_backward(-x); return true; // when x == 0 } infinint sar::get_position() const { infinint delta = slicing.older_sar_than_v8 ? 0 : 1; // one byte less per slice with archive format >= 8 if(is_terminated()) throw SRC_BUG; if(of_current > 1) return slicing.first_size - slicing.first_slice_header - delta + (of_current-2)*(slicing.other_size - slicing.other_slice_header - delta) + file_offset - slicing.other_slice_header; else return file_offset - slicing.first_slice_header; } void sar::inherited_read_ahead(const infinint & amount) { infinint avail_in_slice; if(of_current == 1) avail_in_slice = slicing.first_size; else avail_in_slice = slicing.other_size; avail_in_slice -= file_offset; avail_in_slice -= (slicing.older_sar_than_v8 ? 0 : 1); if(avail_in_slice > amount) { if(of_fd != nullptr) of_fd->read_ahead(amount); to_read_ahead = 0; } else { if(of_fd != nullptr) of_fd->read_ahead(avail_in_slice + (slicing.older_sar_than_v8 ? 0 : 1)); to_read_ahead = amount - avail_in_slice; } } U_I sar::inherited_read(char *a, U_I sz) { U_I lu = 0; bool loop = true; while(lu < sz && loop) { U_I tmp; if(of_fd != nullptr) { try { tmp = of_fd->read(a+lu, sz-lu); if(!slicing.older_sar_than_v8 && of_fd->get_position() == size_of_current) if(tmp > 0) --tmp; // we do not "read" the terminal flag } catch(Euser_abort & e) { natural_destruction = false; // avoid the execution of "between slice" user commands throw; } } else tmp = 0; // simulating an end of slice if(tmp == 0) if(of_flag == flag_type_terminal) loop = false; else if(is_current_eof_a_normal_end_of_slice()) open_file(of_current + 1); else // filling zeroed bytes in place of the missing part of the slice { infinint avail = bytes_still_to_read_in_slice(); U_I place = sz-lu; if(avail < place) { place = 0; avail.unstack(place); } (void)memset(a+lu, 0, place); lu += place; file_offset += place; } else { lu += tmp; file_offset += tmp; } } return lu; } void sar::inherited_write(const char *a, U_I to_write) { infinint max_at_once; U_I tmp_wrote; U_I trailer_size = slicing.older_sar_than_v8 ? 0 : 1; to_read_ahead = 0; while(to_write > 0) { max_at_once = of_current == 1 ? (slicing.first_size - file_offset) - trailer_size : (slicing.other_size - file_offset) - trailer_size; tmp_wrote = 0; max_at_once.unstack(tmp_wrote); if(tmp_wrote > to_write) tmp_wrote = to_write; if(tmp_wrote > 0) { try { of_fd->write(a, tmp_wrote); to_write -= tmp_wrote; file_offset += tmp_wrote; a += tmp_wrote; } catch(Euser_abort & e) { natural_destruction = false; // avoid the execution of "between slice" user commands throw; } } else { open_file(of_current + 1); continue; } } } void sar::close_file(bool terminal) { bool bug = false; if(of_fd != nullptr) { char flag = terminal ? flag_type_terminal : flag_type_non_terminal; if(get_mode() == gf_read_write || get_mode() == gf_write_only) { if(slicing.older_sar_than_v8) { header h = make_write_header(of_current, terminal ? flag_type_terminal : flag_type_non_terminal); of_fd->skip(0); h.write(get_ui(), *of_fd); } else { if(of_fd->get_position() != of_fd->get_size()) bug = true; // we should be at the end of the file else of_fd->write(&flag, 1); } } // telling the system to free this file from the cache of_fd->fadvise(fichier_global::advise_dontneed); of_fd->terminate(); delete of_fd; of_fd = nullptr; } if(bug) throw SRC_BUG; } void sar::open_readonly(const string & fic, const infinint &num) { header h; while(of_fd == nullptr) { // launching user command if any hook_execute(num); // trying to open the file // try { of_fd = entr->open(get_ui(), fic, gf_read_only, false, //< force permission 0, //< permission to enforce (not used here) false, //< fail if exists false, //< erase hash_none); if(of_fd == nullptr) throw SRC_BUG; of_fd->fadvise(fichier_global::advise_normal); // we have no advise to give to the system when reading a slice size_of_current = of_fd->get_size(); } catch(Euser_abort & e) { if(lax) { get_ui().warning(string(gettext("LAX MODE: Caught exception: "))+ e.get_message()); get_ui().pause(tools_printf(gettext("LAX MODE: %S is missing, You have the possibility to create a zero byte length file under the name of this slice, to replace this missing file. This will of course generate error messages about the information that is missing in this slice, but at least libdar will be able to continue. Can we continue now?"), &fic)); continue; // we restart the while loop } else throw; } catch(Esystem & e) { switch(e.get_code()) { case Esystem::io_absent: if(!lax) get_ui().pause(tools_printf(gettext("%S is required for further operation, please provide the file."), &fic)); else get_ui().pause(tools_printf(gettext("%S is required for further operation, please provide the file if you have it."), &fic)); break; case Esystem::io_exist: throw SRC_BUG; case Esystem::io_access: e.prepend_message(tools_printf(gettext("Failed reading slice %S: "), &fic)); throw; // propagate the exception default: throw SRC_BUG; } continue; // we restart the while loop } // trying to read the header // try { h.read(get_ui(), *of_fd, lax); } catch(Ethread_cancel & e) { throw; } catch(Euser_abort & e) { throw; } catch(Efeature & e) { throw; } catch(Elimitint & e) { throw; } catch(Egeneric & e) { if(!lax) { close_file(false); get_ui().pause(tools_printf(gettext("%S has a bad or corrupted header, please provide the correct file."), &fic)); continue; } else get_ui().warning(tools_printf(gettext("LAX MODE: %S has a bad or corrupted header, trying to guess original values and continuing if possible"), &fic)); } // checking against the magic number // if(h.get_set_magic() != SAUV_MAGIC_NUMBER) { if(!lax) { close_file(false); get_ui().pause(tools_printf(gettext("%S is not a valid file (wrong magic number), please provide the good file."), &fic)); continue; } else get_ui().warning(tools_printf(gettext("LAX MODE: In spite of its name, %S does not appear to be a dar slice, assuming a data corruption took place and continuing"), &fic)); } if(h.is_old_header() && slicing.first_slice_header.is_zero() && num != 1) throw Erange("sar::open_readonly", gettext("This is an old archive, it can only be opened starting by the first slice")); // checking the ownership of the set of file (= slice of the same archive or not) // if(slicing.first_slice_header.is_zero()) // this is the first time we open a slice for this archive, we don't even know the slices size { of_internal_name = h.get_set_internal_name(); of_data_name = h.get_set_data_name(); try { if(!h.get_slice_size(slicing.other_size)) { if(!lax) throw SRC_BUG; // slice size should be known or determined by header class else slicing.other_size = 0; } if(!h.get_first_slice_size(slicing.first_size)) slicing.first_size = slicing.other_size; if(slicing.first_size.is_zero() || slicing.other_size.is_zero()) // only possible to reach this statment in lax mode { try { infinint tmp_num = 0; string answ; get_ui().pause(gettext("LAX MODE: Due to probable data corruption, dar could not determine the correct size of slices in this archive. For recent archive, this information is duplicated in each slice, do you want to try opening another slice to get this value if present?")); do { answ = get_ui().get_string(gettext("LAX MODE: Please provide the slice number to read: "), true); try { deci tmp = answ; tmp_num = tmp.computer(); } catch(Edeci &e) { get_ui().warning(gettext("LAX MODE: Please provide an strictly positive integer number")); tmp_num = 0; } } while(tmp_num.is_zero()); get_ui().printf(gettext("LAX MODE: opening slice %i to read its slice header"), &tmp_num); open_file(tmp_num); get_ui().printf(gettext("LAX MODE: closing slice %i, header properly fetched"), &tmp_num); close_file(false); continue; } catch(Euser_abort & e) { get_ui().warning(gettext("LAX MODE: In spite of a the absence of a known slice size, continuing anyway")); } } slicing.first_slice_header = of_fd->get_position(); slicing.other_slice_header = h.is_old_header() ? header::min_size() : slicing.first_slice_header; if(slicing.first_slice_header >= slicing.first_size && !lax) throw Erange("sar::sar", gettext("Incoherent slice header: First slice size too small")); if(slicing.other_slice_header >= slicing.other_size && !lax) throw Erange("sar::sar", gettext("incoherent slice header: Slice size too small")); slicing.older_sar_than_v8 = h.is_old_header(); } catch(Erange & e) { close_file(false); get_ui().pause(tools_printf(gettext("Error opening %S : "), &fic) + e.get_message() + gettext(" . Retry ?")); continue; } } else { if(of_internal_name != h.get_set_internal_name()) { if(!lax) { close_file(false); get_ui().pause(fic + gettext(" is a slice from another backup, please provide the correct slice.")); continue; } else { get_ui().warning(gettext("LAX MODE: internal name of the slice leads dar to consider it is not member of the same archive. Assuming data corruption occurred and relying on the filename of this slice as proof of its membership to the archive")); } } } // checking the flag // if(h.get_set_flag() == flag_type_located_at_end_of_slice) { infinint current_pos = of_fd->get_position(); char end_flag; of_fd->skip_to_eof(); of_fd->skip_relative(-1); of_fd->read(&end_flag, 1); // reading the last char of the slice of_fd->skip(current_pos); switch(end_flag) { case flag_type_terminal: case flag_type_non_terminal: h.get_set_flag() = end_flag; break; case flag_type_located_at_end_of_slice: if(!lax) throw Erange("sar::open_readonly", gettext("Data corruption met at end of slice, forbidden flag found at this position")); else h.get_set_flag() = end_flag; break; default: if(!lax) throw Erange("sar::open_readonly", gettext("Data corruption met at end of slice, unknown flag found")); else h.get_set_flag() = end_flag; break; } } switch(h.get_set_flag()) { case flag_type_terminal: if(of_last_file_known) { if(of_last_file_num != num) { if(!lax) throw Erange("sar::open_readonly", tools_printf(gettext("Two different slices (%i and %i) are marked as the last slice of the backup!"), &of_last_file_num, &num)); else { get_ui().warning(tools_printf(gettext("LAX MODE: slices %i and %i are both recorded as last slice of the archive, keeping the higher number as the real last slice"), &of_last_file_num, &num)); if(num > of_last_file_num) { of_last_file_num = num; of_last_file_size = of_fd->get_size(); } } } // else nothing to do. } else { of_last_file_known = true; of_last_file_num = num; of_last_file_size = of_fd->get_size(); } break; case flag_type_non_terminal: break; default : if(!lax) { close_file(false); get_ui().pause(tools_printf(gettext("Slice %S has an unknown flag (neither terminal nor non_terminal file)."), &fic)); continue; } else if(of_max_seen <= num) { string answ; do { answ = get_ui().get_string(tools_printf(gettext("Due to data corruption, it is not possible to know if slice %S is the last slice of the archive or not. I need your help to figure out this. At the following prompt please answer either one of the following words: \"last\" or \"notlast\" according to the nature of this slice (you can also answer with \"abort\" to abort the program immediately): "), &fic), true); } while(answ != gettext("last") && answ != gettext("notlast") && answ != gettext("abort")); if(answ == gettext("abort")) throw Euser_abort("LAX MODE: Help the compression used..."); if(answ == gettext("last")) { of_last_file_known = true; of_last_file_num = num; of_last_file_size = of_fd->get_size(); h.get_set_flag() = flag_type_terminal; } else h.get_set_flag() = flag_type_non_terminal; } else { get_ui().warning(gettext("LAX MODE: Slice flag corrupted, but a slice of higher number has been seen, thus the header flag was surely not indicating this slice as the last of the archive. Continuing")); h.get_set_flag() = flag_type_non_terminal; } } of_flag = h.get_set_flag(); if(lax) { infinint tmp; if(!h.get_slice_size(tmp) || tmp.is_zero()) { // a problem occured while reading slice header, however we know what is its expected size // so we seek the next read to the end of the slice header if(num == 1) of_fd->skip(slicing.first_slice_header); else of_fd->skip(slicing.other_slice_header); } } } } void sar::open_writeonly(const string & fic, const infinint &num) { bool unlink_on_error = false; bool do_erase = false; // open for writing but succeeds only if this file does NOT already exist try { try { of_fd = entr->open(get_ui(), fic, hash == hash_none ? gf_read_write : gf_write_only, // yes, no anymore always writeonly as stated in the name of this method force_perm, perm, true, //< fail_if_exists false, //< erase hash); } catch(Erange & e) { string tmp = e.get_message(); get_ui().warning(tools_printf(gettext("failed openning slice %S: %S. Will try to erase it first, if allowed"), &fic, &tmp)); throw Esystem("sar::open_writeonly", "failed openning, will try erasing first", Esystem::io_exist); } } catch(Esystem & e) { switch(e.get_code()) { case Esystem::io_exist: try { try { // the file exists, re-trying opening it without fail_if_exists of_fd = entr->open(get_ui(), fic, gf_read_only, false, //< force permission 0, //< permission to enforce (not used here) false, //< fail if exists false, //< erase hash_none); if(of_fd == nullptr) throw SRC_BUG; try { header h; try { h.read(get_ui(), *of_fd); } catch(Erange & e) { h.get_set_internal_name() = of_internal_name; h.get_set_internal_name().invert_first_byte(); // this way we are sure that the file is not considered as part of the current SAR } if(h.get_set_internal_name() != of_internal_name) do_erase = true; // this is not a slice of the current archive delete of_fd; of_fd = nullptr; } catch(...) { if(of_fd != nullptr) { delete of_fd; of_fd = nullptr; } throw; } } catch(Esystem & f) { switch(f.get_code()) { case Esystem::io_exist: throw SRC_BUG; case Esystem::io_absent: throw SRC_BUG; case Esystem::io_access: e.prepend_message(tools_printf(gettext("Failed creating slice %S: "), &fic)); throw; default: throw SRC_BUG; } } } catch(Ebug & e) { throw; } catch(...) { do_erase = true; // reading failed, trying overwriting (if allowed) } try { if(do_erase) { if(!opt_allow_overwrite) throw Erange("sar::open_writeonly", gettext("file exists, and DONT_ERASE option is set.")); if(opt_warn_overwrite) { try { get_ui().pause(fic + gettext(" is about to be overwritten.")); unlink_on_error = true; } catch(...) { natural_destruction = false; throw; } } else unlink_on_error = true; // open with overwriting of_fd = entr->open(get_ui(), fic, hash == hash_none ? gf_read_write : gf_write_only, // yes, no more write only as stated in the name of this method force_perm, perm, false, //< fail if exists true, //< erase hash); } else // open without overwriting if(hash == hash_none) of_fd = entr->open(get_ui(), fic, hash == hash_none ? gf_read_write : gf_write_only, // yes, no more write only as stated in the name of this method force_perm, perm, false, //< fail if exists false, //< erase hash); else throw SRC_BUG; // cannot calculate a hash on a just openned file that is not empty } catch(Esystem & e) { switch(e.get_code()) { case Esystem::io_exist: throw SRC_BUG; // not called with fail_if_exists set case Esystem::io_absent: throw SRC_BUG; // not called in read mode case Esystem::io_access: e.prepend_message(tools_printf(gettext("Failed creating slice %S: "), &fic)); throw; // propagate the exception default: throw SRC_BUG; } } break; case Esystem::io_absent: throw SRC_BUG; case Esystem::io_access: e.prepend_message(tools_printf(gettext("Failed creating slice %S: "), &fic)); throw; // propagate the exception default: throw SRC_BUG; } } if(of_fd == nullptr) throw SRC_BUG; try { header h; of_flag = flag_type_located_at_end_of_slice; h = make_write_header(num, of_flag); h.write(get_ui(), *of_fd); if(num == 1) { slicing.first_slice_header = of_fd->get_position(); if(slicing.first_slice_header.is_zero()) throw SRC_BUG; slicing.other_slice_header = slicing.first_slice_header; // same header in all slice since release 2.4.0 if(slicing.first_slice_header >= slicing.first_size) throw Erange("sar::sar", gettext("First slice size is too small to even just be able to drop the slice header")); if(slicing.other_slice_header >= slicing.other_size) throw Erange("sar::sar", gettext("Slice size is too small to even just be able to drop the slice header")); } } catch(...) { if(unlink_on_error) entr->unlink(fic); if(of_fd != nullptr) { delete of_fd; of_fd = nullptr; } throw; } } void sar::open_file_init() { of_max_seen = 0; of_last_file_known = false; of_fd = nullptr; of_flag = '\0'; slicing.first_slice_header = 0; // means that the sizes have to be determined from file or wrote to file slicing.other_slice_header = 0; size_of_current = 0; // not used in write mode } void sar::open_file(infinint num) { if(of_fd == nullptr || of_current != num) { const string display = sar_tools_make_filename(base, num, min_digits, ext); switch(get_mode()) { case gf_read_only: close_file(false); // launch the shell command before reading a slice open_readonly(display, num); break; case gf_write_only: case gf_read_write: if(num < of_current) throw Erange("sar::open_file", "Skipping backward would imply accessing/modifying previous slice"); // adding the trailing flag if(of_fd != nullptr) close_file(false); if(!initial) { // launch the shell command after the slice has been written hook_execute(of_current); if(!pause.is_zero() && (((num-1) % pause).is_zero())) { deci conv = of_current; bool ready = false; while(!ready) { try { get_ui().pause(string(gettext("Finished writing to file ")) + conv.human() + gettext(", ready to continue ? ")); ready = true; } catch(Euser_abort & e) { get_ui().warning(string(gettext("If you really want to abort the archive creation hit CTRL-C, then press enter."))); ready = false; } } } } else initial = false; open_writeonly(display, num); break; default : close_file(false); throw SRC_BUG; } if(of_max_seen < num) of_max_seen = num; file_offset = num == 1 ? slicing.first_slice_header : slicing.other_slice_header; if(num == of_current + 1 && !to_read_ahead.is_zero()) { of_current = num; inherited_read_ahead(to_read_ahead); } else of_current = num; } } void sar::set_offset(infinint offset) { if(of_fd == nullptr) throw Erange("sar::set_offset", gettext("file not open")); else of_fd->skip(offset); } void sar::open_last_file() { infinint num; switch(get_mode()) { case gf_read_only: if(of_last_file_known) open_file(of_last_file_num); else // last slice number is not known { bool ask_user = false; while(of_fd == nullptr || of_flag != flag_type_terminal) { if(sar_tools_get_higher_number_in_dir(*entr, base, min_digits, ext, num)) { open_file(num); if(of_flag != flag_type_terminal) { if(!ask_user) { close_file(false); hook_execute(0); // %n replaced by 0 means last file is about to be requested ask_user = true; } else { close_file(false); get_ui().pause(string(gettext("The last file of the set is not present in ")) + entr->get_url() + gettext(" , please provide it.")); } } } else // not slice available in the directory if(!ask_user) { hook_execute(0); // %n replaced by 0 means last file is about to be requested ask_user = true; } else { string chem = entr->get_url(); close_file(false); get_ui().pause(tools_printf(gettext("No backup file is present in %S for archive %S, please provide the last file of the set."), &chem, &base)); } } } case gf_read_write: case gf_write_only: open_file(of_max_seen); break; default: throw SRC_BUG; } } header sar::make_write_header(const infinint & num, char flag) { header hh; hh.get_set_magic() = SAUV_MAGIC_NUMBER; hh.get_set_internal_name() = of_internal_name; hh.get_set_data_name() = of_data_name; hh.get_set_flag() = flag; if(slicing.older_sar_than_v8) { if(num == 1) { hh.set_slice_size(slicing.other_size); if(slicing.other_size != slicing.first_size) hh.set_first_slice_size(slicing.first_size); } hh.set_format_07_compatibility(); } else { hh.set_slice_size(slicing.other_size); if(slicing.other_size != slicing.first_size) hh.set_first_slice_size(slicing.first_size); } return hh; } void sar::hook_execute(const infinint &num) { if(hook != "") { try { deci conv = num; string num_str = conv.human(); tools_hook_substitute_and_execute(get_ui(), hook, entr->get_full_path().display(), base, num_str, sar_tools_make_padded_number(num_str, min_digits), ext, get_info_status()); } catch(Escript & g) { natural_destruction = false; throw; } } } bool sar::is_current_eof_a_normal_end_of_slice() const { infinint delta = slicing.older_sar_than_v8 ? 0 : 1; // one byte less per slice with archive format >= 8 if(of_last_file_known && of_last_file_num == of_current) // we are in the last slice, thus eof may occur at any place return true; // we are not in the last slice, thus we can determine at which offset the eof must be met for this slice if(of_current == 1) return file_offset >= slicing.first_size - delta; else return file_offset >= slicing.other_size - delta; } infinint sar::bytes_still_to_read_in_slice() const { infinint delta = slicing.older_sar_than_v8 ? 0 : 1; // one byte less per slice with archive format >= 8 if(of_last_file_known && of_last_file_num == of_current) throw SRC_BUG; // cannot figure out the expected slice size of the last slice of the archive if(of_current == 1) if(file_offset > slicing.first_size - delta) return 0; else return slicing.first_size - file_offset - delta; else if(file_offset > slicing.other_size - delta) return 0; else return slicing.other_size - file_offset - delta; } } // end of namespace dar-2.5.3/src/libdar/mem_ui.cpp0000644000175000017430000000376212642457363013241 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "infinint.hpp" // yep, strange thing to have to include the therorically less dependent header here. // including "mem_ui.hpp" here, lead to cyclic dependancy of headers... this points needs to be clarified #include "mem_ui.hpp" namespace libdar { user_interaction & mem_ui::get_ui() const { if(ui == nullptr) throw SRC_BUG; return *(const_cast(this)->ui); } void mem_ui::detruire() { if(ui != nullptr) { if(cloned) { delete ui; ui = nullptr; } else ui = nullptr; } } void mem_ui::copy_from(const mem_ui & ref) { if(ref.ui == nullptr) ui = nullptr; else { if(ref.cloned) { set_ui(*(ref.ui)); cloned = true; } else { ui = ref.ui; cloned = false; } } } void mem_ui::set_ui(const user_interaction & dialog) { ui = dialog.clone(); if(ui == nullptr) throw Ememory("mem_ui::set_ui"); cloned = true; } } // end of namespace dar-2.5.3/src/libdar/escape_catalogue.cpp0000644000175000017430000005307612642474445015255 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "escape_catalogue.hpp" #include "macro_tools.hpp" #include "cat_all_entrees.hpp" using namespace std; namespace libdar { escape_catalogue::escape_catalogue(user_interaction & dialog, const pile_descriptor & x_pdesc, const datetime & root_last_modif, const label & data_name) : catalogue(dialog, root_last_modif, data_name) { set_esc_and_stack(x_pdesc); x_ver.set_edition(macro_tools_supported_version); x_ver.set_compression_algo(none); x_lax = false; corres.clear(); status = ec_completed; // yes, with that constructor, the catalogue contains all known object and entree do not miss any field cat_det = nullptr; min_read_offset = 0; depth = 0; // we start at the root... of course wait_parent_depth = 0; // to disable this feature // dropping the data_name in the archive pdesc.stack->sync_write_above(pdesc.esc); // esc is now up to date pdesc.esc->add_mark_at_current_position(escape::seqt_data_name); data_name.dump(*pdesc.esc); } escape_catalogue::escape_catalogue(user_interaction & dialog, const pile_descriptor & x_pdesc, const header_version & ver, const list & known_signatories, bool lax) : catalogue(dialog, datetime(0), label_zero) { set_esc_and_stack(x_pdesc); x_ver = ver; known_sig = known_signatories; x_lax = lax; corres.clear(); status = ec_init; // with that constructor, the catalogue starts empty and get completed entry by entry each time a one asks for its contents (read() method) cat_det = nullptr; min_read_offset = 0; depth = 0; // we start at the root wait_parent_depth = 0; // to disable this feature // fetching the value of ref_data_name pdesc.stack->flush_read_above(pdesc.esc); if(pdesc.esc->skip_to_next_mark(escape::seqt_data_name, false)) { // we are at least at revision "08" of archive format, or this is a collision with data of an old archive or of an archive without escape marks label tmp; try { tmp.read(*pdesc.esc); set_data_name(tmp); } catch(...) { if(!lax) throw Erange("escape_catalogue::escape_catalogue", gettext("incoherent data after escape sequence, cannot read internal data set label")); else { get_ui().warning("LAX MODE: Could not read the internal data set label, using a fake value, this will probably avoid using isolated catalogue"); set_data_name(label_zero); } } } else // skip to expected mark failed if(!lax) throw Erange("escape_catalogue::escape_catalogue", gettext("Could not find tape mark for the internal catalogue")); else { contextual *cont_data = nullptr; pdesc.stack->find_first_from_bottom(cont_data); get_ui().warning("LAX MODE: Could not read the internal data set label, using a fake value, this will probably avoid using isolated catalogue"); if(cont_data == nullptr) set_data_name(label_zero); else set_data_name(cont_data->get_data_name()); } } const escape_catalogue & escape_catalogue::operator = (const escape_catalogue &ref) { catalogue *me = this; const catalogue *you = &ref; destroy(); // copying the catalogue part *me = *you; // copying the escape_catalogue specific part copy_from(ref); return *this; } void escape_catalogue::pre_add(const cat_entree *ref) const { escape_catalogue *ceci = const_cast(this); if(ceci->pdesc.esc == nullptr) throw SRC_BUG; ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_file); ref->dump(pdesc, true); } void escape_catalogue::pre_add_ea(const cat_entree *ref) const { escape_catalogue *ceci = const_cast(this); const cat_mirage *ref_mir = dynamic_cast(ref); const cat_inode *ref_ino = dynamic_cast(ref); if(ref_mir != nullptr) ref_ino = ref_mir->get_inode(); if(ref_ino != nullptr) { if(ref_ino->ea_get_saved_status() == cat_inode::ea_full) { if(ceci->pdesc.esc == nullptr) throw SRC_BUG; else { ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_ea); } } // else, nothing to do. } // else, nothing to do. } void escape_catalogue::pre_add_crc(const cat_entree *ref) const { escape_catalogue *ceci = const_cast(this); const cat_mirage *ref_mir = dynamic_cast(ref); const cat_file *ref_file = dynamic_cast(ref); if(ref_mir != nullptr) ref_file = dynamic_cast(ref_mir->get_inode()); if(ref_file != nullptr) { if(ref_file->get_saved_status() == s_saved) { const crc * c = nullptr; if(ref_file->get_crc(c)) { if(ceci->pdesc.esc == nullptr) throw SRC_BUG; ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_file_crc); c->dump(*(ceci->pdesc.esc)); } // else, the data may come from an old archive format } // else, nothing to do. } } void escape_catalogue::pre_add_dirty() const { escape_catalogue *ceci = const_cast(this); if(ceci->pdesc.esc == nullptr) throw SRC_BUG; ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_dirty); } void escape_catalogue::pre_add_ea_crc(const cat_entree *ref) const { escape_catalogue *ceci = const_cast(this); const cat_mirage *ref_mir = dynamic_cast(ref); const cat_inode *ref_ino = dynamic_cast(ref); if(ref_mir != nullptr) ref_ino = ref_mir->get_inode(); if(ref_ino != nullptr) { if(ref_ino->ea_get_saved_status() == cat_inode::ea_full) { const crc * c = nullptr; ref_ino->ea_get_crc(c); if(ceci->pdesc.esc == nullptr) throw SRC_BUG; ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_ea_crc); c->dump(*(ceci->pdesc.esc)); } // else, nothing to do. } // else, nothing to do. } void escape_catalogue::pre_add_waste_mark() const { escape_catalogue *ceci = const_cast(this); if(ceci->pdesc.esc == nullptr) throw SRC_BUG; ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_changed); } void escape_catalogue::pre_add_failed_mark() const { escape_catalogue *ceci = const_cast(this); if(ceci->pdesc.esc == nullptr) throw SRC_BUG; ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_failed_backup); } void escape_catalogue::pre_add_fsa(const cat_entree *ref) const { escape_catalogue *ceci = const_cast(this); const cat_mirage *ref_mir = dynamic_cast(ref); const cat_inode *ref_ino = dynamic_cast(ref); if(ref_mir != nullptr) ref_ino = ref_mir->get_inode(); if(ref_ino != nullptr) { if(ref_ino->fsa_get_saved_status() == cat_inode::fsa_full) { if(ceci->pdesc.esc == nullptr) throw SRC_BUG; else { ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_fsa); } } // else, nothing to do. } // else, nothing to do. } void escape_catalogue::pre_add_fsa_crc(const cat_entree *ref) const { escape_catalogue *ceci = const_cast(this); const cat_mirage *ref_mir = dynamic_cast(ref); const cat_inode *ref_ino = dynamic_cast(ref); if(ref_mir != nullptr) ref_ino = ref_mir->get_inode(); if(ref_ino != nullptr) { if(ref_ino->fsa_get_saved_status() == cat_inode::fsa_full) { const crc * c = nullptr; ref_ino->fsa_get_crc(c); if(ceci->pdesc.esc == nullptr) throw SRC_BUG; ceci->pdesc.stack->sync_write_above(pdesc.esc); ceci->pdesc.esc->add_mark_at_current_position(escape::seqt_fsa_crc); c->dump(*(ceci->pdesc.esc)); } // else, nothing to do. } // else, nothing to do. } void escape_catalogue::reset_read() const { escape_catalogue *ceci = const_cast(this); ceci->reset_reading_process(); catalogue::reset_read(); } void escape_catalogue::end_read() const { escape_catalogue *ceci = const_cast(this); ceci->reset_reading_process(); catalogue::end_read(); } void escape_catalogue::skip_read_to_parent_dir() const { escape_catalogue *ceci = const_cast(this); switch(status) { case ec_init: case ec_eod: case ec_detruits: if(cat_det == nullptr) throw SRC_BUG; cat_det->skip_read_to_parent_dir(); break; case ec_marks: ceci->wait_parent_depth = depth; break; case ec_completed: catalogue::skip_read_to_parent_dir(); break; default: throw SRC_BUG; } } bool escape_catalogue::read(const cat_entree * & ref) const { escape_catalogue *ceci = const_cast(this); const cat_directory *ref_dir = nullptr; const cat_eod *ref_eod = nullptr; bool stop = false; if(pdesc.esc == nullptr) throw SRC_BUG; ref = nullptr; // if we have already read the whole archive contents (included detruits object), // we do not need inspect the archive again, we instead use the data in memory if(status == ec_completed) return catalogue::read(ref); pdesc.stack->flush_read_above(pdesc.esc); try { list cat_signatories; bool only_detruit = false; bool compare_content = false; while(ref == nullptr && !stop) { switch(status) { case ec_init: ceci->status = ec_marks; // no break; case ec_marks: if(min_read_offset > pdesc.esc->get_position()) { // for some reason, like datacorruption, bad CRC or missing CRC in hard linked inode // we skipped back to the hard linked inode information (it failed to be restored the first time) // We must not read again and again the same data, so we skip forward to min_read_offset ceci->pdesc.esc->skip(min_read_offset); } if(pdesc.esc->skip_to_next_mark(escape::seqt_file, true)) { ceci->min_read_offset = pdesc.esc->get_position(); try { ref = cat_entree::read(get_ui(), get_pool(), pdesc, x_ver.get_edition(), ceci->access_stats(), ceci->corres, x_ver.get_compression_algo(), false, // lax mode false, // only_detruit true); // always a small read in that context if(pdesc.esc->next_to_read_is_mark(escape::seqt_failed_backup)) { if(!pdesc.esc->skip_to_next_mark(escape::seqt_failed_backup, false)) throw SRC_BUG; if(ref != nullptr) { delete ref; ref = nullptr; } continue; // restarts the while loop } ref_dir = dynamic_cast(ref); if(ref_dir != nullptr) ++(ceci->depth); ref_eod = dynamic_cast(ref); if(ref_eod != nullptr) { if(!depth.is_zero()) --(ceci->depth); else if(!x_lax) throw Erange("escape_catalogue::read", gettext("Escape sequences used for reading lead the archive to place some files out of the specified root. To overcome this problem, try reading the archive in direct mode (not using sequential reading), try repairing the archive using Parchive if redundancy data has been created or in last resort try using the lax mode")); else // lax mode { get_ui().warning(gettext("LAX MODE: Archive directory structure is corrupted, it would lead to place some files out of the specified root directory. Restoring different directory contents at the root not out of it, which will put files of different directories in the specified root directory")); if(ref == nullptr) throw SRC_BUG; delete ref; // this is the CAT_EOD object ref = nullptr; continue; // restarts the while loop } } } catch(Erange & e) { if(!x_lax) throw; else { get_ui().warning(gettext("LAX MODE: found unknown catalogue entry, assuming data corruption occurred. Skipping to the next entry, this may lead to improper directory structure being restored, if the corrupted data was a directory")); ref = nullptr; continue; // restarts the while loop } } if(ref == nullptr) throw Erange("escape_catalogue::read", gettext("Corrupted entry following an escape mark in the archive")); else { bool is_eod = ref_eod != nullptr; cat_entree *ref_nc = const_cast(ref); ceci->add(ref_nc); if(!wait_parent_depth.is_zero()) // we must not return this object as it is member of a skipped dir { if(depth < wait_parent_depth) // we are back out of the skipped directory { if(is_eod) ceci->wait_parent_depth = 0; else throw SRC_BUG; // we should get out of the directory reading a CAT_EOD ! } ref = nullptr; // must not release object except, they are now part of catalogue continue; // ignore this entry and skip to the next one } if(is_eod) ref = get_r_eod_address(); } } else // no more file to read from in-sequence marks { if(!depth.is_zero()) { get_ui().warning(gettext("Uncompleted archive! Assuming it has been interrupted during the backup process. If an error has been reported just above, simply ignore it, this is about the file that was saved at the time of the interruption.")); ceci->status = ec_eod; ref = get_r_eod_address(); if(ref == nullptr) throw SRC_BUG; --(ceci->depth); } else { // we no more need the hard link correspondance map so we free the memory it uses ceci->corres.clear(); ceci->status = ec_detruits; label tmp; tmp.clear(); if(pdesc.compr == nullptr) throw SRC_BUG; if(pdesc.compr->is_compression_suspended()) { pdesc.compr->resume_compression(); if(pdesc.compr->get_algo() != none) pdesc.stack->flush_read_above(pdesc.compr); } if(pdesc.esc->skip_to_next_mark(escape::seqt_catalogue, true)) { ceci->status = ec_signature; stop = false; ref = nullptr; } else // no more file and no catalogue entry found (interrupted archive) { ceci->status = ec_completed; if(!x_lax) throw Erange("escape_catalogue::read", gettext("Cannot extract from the internal catalogue the list of files to remove")); else { get_ui().warning("LAX MODE: Cannot extract from the internal catalogue the list of files to remove, skipping this step"); ref = nullptr; stop = true; } } } } break; case ec_eod: if(!depth.is_zero()) { ref = get_r_eod_address(); if(ref == nullptr) throw SRC_BUG; --(ceci->depth); } else ceci->status = ec_marks; break; case ec_signature: // build the catalogue to get detruit objects // but first checking the catalogue signature if any // and comparing the internal catalogue to inline catalogue content only_detruit = !is_empty(); compare_content = x_ver.is_signed() && only_detruit; // if the archive is not signed and this is not a isolated catalogue // (that's to say we have sequentially read some entries) we can filter // out from the catalogue all non detruits objects. // Else we need the whole catalogue, if it is an isolated catalogue // We need it but temporarily full if the archive is signed to compare // the inernal catalogue content and CRC (which is signed) with inline content // and CRC used so far for sequential reading, then if OK, we must drop from it // all the non detruits objects ceci->cat_det = macro_tools_read_catalogue(get_ui(), get_pool(), x_ver, pdesc, 0, // cat_size cannot be determined in sequential_read mode cat_signatories, x_lax, label_zero, only_detruit && ! compare_content); if(ceci->cat_det == nullptr) throw Ememory("escape_catalogue::read"); try { if(!same_signatories(known_sig, cat_signatories)) { string msg = gettext("Archive internal catalogue is not identically signed as the archive itself, this might be the sign the archive has been compromised"); if(x_lax) get_ui().pause(msg); else throw Edata(msg); } if(compare_content) { // checking that all entries read so far // have an identical entry in the internal (signed) // catalogue ceci->status = ec_completed; // necessary to compare the inline content if(!is_subset_of(*cat_det)) { string msg = gettext("Archive internal catalogue is properly signed but its content does not match the tape marks used so far for sequentially reading. Possible data corruption or archive compromission occurred! if data extracted in sequential read mode does not match the data extracted in direct access mode, consider the sequential data has been been modified after the archive has been generated"); if(x_lax) get_ui().pause(msg); else throw Edata(msg); } // filter out all except detruits and directories objects cat_det->drop_all_non_detruits(); } cat_det->reset_read(); if(only_detruit) { ceci->status = ec_detruits; stop = false; ref = nullptr; } else { ceci->status = ec_completed; ceci->swap_stuff(*(ceci->cat_det)); delete ceci->cat_det; ceci->cat_det = nullptr; } } catch(...) { if(ceci->cat_det != nullptr) { delete ceci->cat_det; ceci->cat_det = nullptr; } throw; } break; case ec_detruits: if(cat_det == nullptr) throw SRC_BUG; // cat_det has been set to only read detruit() objects // if it fails reading this means we have reached // the end of the detruits if(!cat_det->read(ref)) { ceci->merge_cat_det(); ceci->status = ec_completed; ref = nullptr; stop = true; } else // we return the provided detruit object if(ref == nullptr) throw SRC_BUG; break; case ec_completed: return catalogue::read(ref); default: throw SRC_BUG; } } } catch(...) { if(ref != nullptr && cat_det == nullptr && ref != get_r_eod_address()) // we must not delete objects owned by cat_det delete ref; ref = nullptr; throw; } return ref != nullptr; } bool escape_catalogue::read_if_present(std::string *name, const cat_nomme * & ref) const { escape_catalogue *ceci = const_cast(this); ceci->reset_reading_process(); return catalogue::read_if_present(name, ref); } void escape_catalogue::tail_catalogue_to_current_read() { reset_reading_process(); catalogue::tail_catalogue_to_current_read(); } void escape_catalogue::set_esc_and_stack(const pile_descriptor & x_pdesc) { x_pdesc.check(true); // always expecting an escape layer pdesc = x_pdesc; } void escape_catalogue::copy_from(const escape_catalogue & ref) { pdesc = ref.pdesc; x_ver = ref.x_ver; known_sig = ref.known_sig; x_lax = ref.x_lax; corres = ref.corres; status = ref.status; if(ref.cat_det == nullptr) cat_det = nullptr; else cat_det = new (get_pool()) catalogue(*ref.cat_det); if(cat_det == nullptr) throw Ememory("escape_catalogue::copy_from"); min_read_offset = ref.min_read_offset; depth = ref.depth; wait_parent_depth = ref.wait_parent_depth; } void escape_catalogue::destroy() { if(cat_det != nullptr) { delete cat_det; cat_det = nullptr; } } void escape_catalogue::merge_cat_det() { if(cat_det != nullptr) { copy_detruits_from(*cat_det); delete cat_det; cat_det = nullptr; } } void escape_catalogue::reset_reading_process() { switch(status) { case ec_init: break; case ec_marks: case ec_eod: get_ui().warning(gettext("Resetting the sequential reading process of the archive contents while it is not finished, will make all data unread so far becoming inaccessible")); corres.clear(); status = ec_completed; break; case ec_detruits: merge_cat_det(); status = ec_completed; break; case ec_signature: case ec_completed: break; default: throw SRC_BUG; } depth = 0; wait_parent_depth = 0; } } // end of namespace dar-2.5.3/src/libdar/statistics.cpp0000644000175000017430000001005212641773000014132 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif } #include #include "statistics.hpp" #include "tools.hpp" using namespace std; namespace libdar { void statistics::clear() { if(locking) { LOCK_IN; treated = hard_links = skipped = ignored = tooold = errored = deleted = ea_treated = byte_amount = fsa_treated = 0; LOCK_OUT; } else treated = hard_links = skipped = ignored = tooold = errored = deleted = ea_treated = byte_amount = fsa_treated = 0; } infinint statistics::total() const { infinint ret; if(locking) { LOCK_IN_CONST; ret = treated+skipped+ignored+tooold+errored+deleted; // hard_link are also counted in other counters LOCK_OUT_CONST; } else ret = treated+skipped+ignored+tooold+errored+deleted; return ret; } void statistics::init(bool lock) { locking = lock; #if MUTEX_WORKS if(locking) if(pthread_mutex_init(&lock_mutex, nullptr) < 0) throw Erange("statistics::statistics", string(dar_gettext("Error while initializing \"mutex\" for class \"statistics\": ")) + tools_strerror_r(errno)); #else if(locking) throw Ecompilation("Thread support not activated, cannot use statistics object with lock activated"); #endif if(locking) { increment = & statistics::increment_locked; add_to = & statistics::add_to_locked; returned = & statistics::returned_locked; decrement = & statistics::decrement_locked; set_to = & statistics::set_to_locked; sub_from = & statistics::sub_from_locked; } else { increment = & statistics::increment_unlocked; add_to = & statistics::add_to_unlocked; returned = & statistics::returned_unlocked; decrement = & statistics::decrement_unlocked; set_to = & statistics::set_to_unlocked; sub_from = & statistics::sub_from_unlocked; } } void statistics::detruit() { #if MUTEX_WORKS if(locking) pthread_mutex_destroy(&lock_mutex); #endif } void statistics::copy_from(const statistics & ref) { init(ref.locking); treated = ref.treated; hard_links = ref.hard_links; skipped = ref.skipped; ignored = ref.ignored; tooold = ref.tooold; errored = ref.errored; deleted = ref.deleted; ea_treated = ref.ea_treated; byte_amount = ref.byte_amount; fsa_treated = ref.fsa_treated; } void statistics::dump(user_interaction & dialog) const { dialog.printf("--------- Statistics DUMP ----------"); dialog.printf("locking = %c", locking ? 'y' : 'n'); dialog.printf("treated = %i", &treated); dialog.printf("hard_links = %i", &hard_links); dialog.printf("skipped = %i", &skipped); dialog.printf("ignored = %i", &ignored); dialog.printf("tooold = %i", &tooold); dialog.printf("errored = %i", &errored); dialog.printf("deleted = %i", &deleted); dialog.printf("ea_treated = %i", &ea_treated); dialog.printf("byte_amount = %i", &byte_amount); dialog.printf("fsa_treated = %i", &fsa_treated); dialog.printf("------------------------------------"); } } // end of namespace dar-2.5.3/src/libdar/real_infinint.cpp0000644000175000017430000005247212641772777014621 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif } // end extern "C" #include "real_infinint.hpp" #include "erreurs.hpp" #include "generic_file.hpp" #include "tools.hpp" namespace libdar { infinint::endian infinint::used_endian = not_initialized; U_8 infinint::zeroed_field[ZEROED_SIZE]; infinint::infinint(generic_file & x) { build_from_file(x); } void infinint::build_from_file(generic_file & x) { unsigned char a; bool fin = false; infinint skip = 0; storage::iterator it; S_I lu; int_tools_bitfield bf; while(!fin) { lu = x.read((char *)&a, 1); if(lu <= 0) throw Erange("infinint::build_from_file(generic_file)", gettext("Reached end of file before all data could be read")); if(a == 0) ++skip; else // end of size field { // computing the size to read U_I pos = 0; int_tools_expand_byte(a, bf); for(S_I i = 0; i < 8; ++i) pos += bf[i]; if(pos != 1) throw Erange("infinint::build_from_file(generic_file)", gettext("Badly formed \"infinint\" or not supported format")); // more than 1 bit is set to 1 pos = 0; while(bf[pos] == 0) ++pos; pos += 1; // bf starts at zero, but bit zero means 1 TG of length skip *= 8; skip += pos; skip *= TG; try { field = new (get_pool()) storage(x, skip); } catch(...) { field = nullptr; throw; } if(field != nullptr) { it = field->begin(); fin = true; } else throw Ememory("infinint::build_from_file(generic_file)"); } } reduce(); // necessary to reduce due to TG storage } void infinint::dump(generic_file & x) const { infinint width; infinint pos; unsigned char last_width; infinint justification; U_32 tmp; if(! is_valid()) throw SRC_BUG; if(*(field->begin()) == 0) const_cast(this)->reduce(); width = field->size(); // this is the informational field size in byte // TG is the width in TG, thus the number of bit that must have // the preamble euclide(width, TG, width, justification); if(!justification.is_zero()) // in case we need to add some bytes to have a width multiple of TG ++width; // we need then one more group to have a width multiple of TG euclide(width, 8, width, pos); if(pos.is_zero()) { --width; // division is exact, only last bit of the preambule is set last_width = 0x80 >> 7; // as we add the last byte separately width gets shorter by 1 byte } else // division non exact, the last_width (last byte), make the rounding { U_16 pos_s = 0; pos.unstack(pos_s); last_width = 0x80 >> (pos_s - 1); } // now we write the preamble except the last byte. All these are zeros. tmp = 0; width.unstack(tmp); do { while(tmp != 0) { if(tmp > ZEROED_SIZE) { x.write((char *)zeroed_field, ZEROED_SIZE); tmp -= ZEROED_SIZE; } else { x.write((char *)zeroed_field, tmp); tmp = 0; } } tmp = 0; width.unstack(tmp); } while(tmp > 0); // now we write the last byte of the preambule, which as only one bit set x.write((char *)&last_width, 1); // we need now to write some justification byte to have an informational field multiple of TG if(!justification.is_zero()) { U_16 tmp = 0; justification.unstack(tmp); tmp = TG - tmp; if(tmp > ZEROED_SIZE) throw SRC_BUG; else x.write((char *)zeroed_field, tmp); } // now we continue dumping the informational bytes : field->dump(x); } infinint & infinint::operator += (const infinint & arg) { if(! is_valid() || ! arg.is_valid()) throw SRC_BUG; // enlarge field to be able to receive the result of the operation make_at_least_as_wider_as(arg); // now processing the operation storage::iterator it_a = arg.field->rbegin(); storage::iterator it_res = field->rbegin(); U_I retenue = 0, somme; while(it_res != field->rend() && (it_a != arg.field->rend() || retenue != 0)) { somme = *it_res; if(it_a != arg.field->rend()) { somme += *it_a; --it_a; } somme += retenue; retenue = somme >> 8; somme &= 0xFF; *it_res = somme; --it_res; } if(retenue != 0) { field->insert_null_bytes_at_iterator(field->begin(), 1); (*field)[0] = retenue; } // reduce() is not necessary here, as the resulting filed is // not smaller than the one of the two infinint in presence. // resulting infinint is thus in canonical form (no leading zeros) return *this; } infinint & infinint::operator -= (const infinint & arg) { if(! is_valid() || ! arg.is_valid()) throw SRC_BUG; if(*this < arg) throw Erange("infinint::operator", gettext("Subtracting an \"infinint\" greater than the first, \"infinint\" cannot be negative")); // now processing the operation storage::iterator it_a = arg.field->rbegin(); storage::iterator it_res = field->rbegin(); U_I retenue = 0; S_I somme; U_I tmp; while(it_res != field->rend() && (it_a != arg.field->rend() || retenue != 0)) { somme = *it_res; if(it_a != arg.field->rend()) { somme -= *it_a; --it_a; } somme -= retenue; if(somme < 0) { somme = -somme; tmp = somme & 0xFF; retenue = somme >> 8; if(tmp != 0) { somme = 0x100 - tmp; ++retenue; } else somme = 0; } else retenue = 0; *it_res = somme; --it_res; } // the resulting infinint is most probably *NOT* in canonical form // to improve performance, since release 2.4.0, it is admitted that an infinint may not // be in canonical form. It will be "reduced()" to canonical form only when necessary // at the detriment of the space used during the gap. return *this; } infinint & infinint::operator *= (unsigned char arg) { if(!is_valid()) throw SRC_BUG; storage::iterator it = field->rbegin(); U_I produit, retenue = 0; // assuming U_I is larger than unsigned char while(it != field->rend()) { produit = (*it) * arg + retenue; retenue = 0; retenue = produit >> 8; produit = produit & 0xFF; *it = produit; --it; } if(retenue != 0) { field->insert_null_bytes_at_iterator(field->begin(), 1); (*field)[0] = retenue; } if(arg == 0) reduce(); // only necessary in that case // and it may worth it for big numbers so doing it // even if since release 2.4.0 it is allowed to keep an infinint // under non canonical form return *this; } infinint & infinint::operator *= (const infinint & arg) { infinint ret = 0; if(!is_valid() || !arg.is_valid()) throw SRC_BUG; storage::iterator it_t = field->begin(); while(it_t != field->end()) { ret <<= 8; // shift by one byte; ret += arg * (*it_t); ++it_t; } *this = ret; return *this; // copy constructor } infinint & infinint::operator &= (const infinint & arg) { if(! is_valid() || ! arg.is_valid()) throw SRC_BUG; make_at_least_as_wider_as(arg); storage::iterator it_a = arg.field->rbegin(); storage::iterator it_res = field->rbegin(); while(it_res != field->rend() && it_a != arg.field->rend()) { *it_res &= *it_a; --it_res; --it_a; } if(it_res != field->rend()) { while(it_res != field->rend()) // set upper bits to zero when arg is smaller than *this { *it_res = 0; --it_res; } reduce(); } return *this; } infinint & infinint::operator |= (const infinint & arg) { if(! is_valid() || ! arg.is_valid()) throw SRC_BUG; make_at_least_as_wider_as(arg); storage::iterator it_a = arg.field->rbegin(); storage::iterator it_res = field->rbegin(); while(it_res != field->rend() && it_a != arg.field->rend()) *it_res-- |= *it_a--; return *this; } infinint & infinint::operator ^= (const infinint & arg) { if(! is_valid() || ! arg.is_valid()) throw SRC_BUG; make_at_least_as_wider_as(arg); storage::iterator it_a = arg.field->rbegin(); storage::iterator it_res = field->rbegin(); while(it_res != field->rend() && it_a != arg.field->rend()) { *it_res ^= *it_a; --it_res; --it_a; } return *this; } infinint & infinint::operator >>= (U_32 bit) { if(! is_valid()) throw SRC_BUG; U_32 byte = bit/8; storage::iterator it = field->rbegin() - byte + 1; int_tools_bitfield bf; unsigned char mask, r1 = 0, r2 = 0; U_I shift_retenue; bit = bit % 8; shift_retenue = 8 - bit; if(byte >= field->size()) *this = 0; else { // shift right by "byte" bytes field->remove_bytes_at_iterator(it, byte); // shift right by "bit" bits if(bit != 0) { for(U_I i = 0; i < 8; ++i) bf[i] = i < shift_retenue ? 0 : 1; int_tools_contract_byte(bf, mask); it = field->begin(); while(it != field->end()) { r1 = *it & mask; r1 <<= shift_retenue; *it >>= bit; *it |= r2; r2 = r1; ++it; } } } return *this; } infinint & infinint::operator >>= (infinint bit) { if(! is_valid() || ! bit.is_valid()) throw SRC_BUG; U_32 delta_bit = 0; bit.unstack(delta_bit); do { *this >>= delta_bit; delta_bit = 0; bit.unstack(delta_bit); } while(delta_bit > 0); return *this; } infinint & infinint::operator <<= (U_32 bit) { if(! is_valid()) throw SRC_BUG; U_32 byte = bit/8; storage::iterator it = field->end(); if(this->is_zero()) return *this; bit %= 8; // bit gives now the remaining translation after the "byte" translation if(bit != 0) ++byte; // to prevent the MSB to be lost (in "out of space" ;-) ) // this is the "byte" translation field->insert_null_bytes_at_iterator(it, byte); if(bit != 0) { U_I shift_retenue, r1 = 0, r2 = 0; int_tools_bitfield bf; unsigned char mask; // and now the bit translation // we have shift left one byte in place of 'bit' bits, so we shift right // shift_retenue bits: shift_retenue = 8 - bit; it = field->begin(); // the mask for selecting the retenue for(U_I i = 0; i < 8; ++i) bf[i] = i < bit ? 0 : 1; int_tools_contract_byte(bf, mask); while(it != field->end()) { r1 = (*it) & mask; r1 <<= bit; *it >>= shift_retenue; *it |= r2; r2 = r1; ++it; } } return *this; } infinint & infinint::operator <<= (infinint bit) { U_32 delta_bit = 0; bit.unstack(delta_bit); do { *this <<= delta_bit; delta_bit = 0; bit.unstack(delta_bit); } while(delta_bit > 0); return *this; } unsigned char infinint::operator [] (const infinint & position) const { if(field == nullptr) throw SRC_BUG; if(position.is_zero()) { storage::iterator it = field->rbegin(); if(it != field->rend()) return *it; else return 0x00; } else { if(position < field->size()) return (*field)[field->size() - (position + 1)]; else return 0x00; } } bool infinint::is_zero() const { if(field == nullptr) throw SRC_BUG; storage::iterator it = field->begin(); while(it != field->end() && *it == 0) ++it; return it == field->end(); } S_I infinint::difference(const infinint & b) const { storage::iterator ita; storage::iterator itb; const infinint & a = *this; if(! a.is_valid() || ! b.is_valid()) throw SRC_BUG; // need to reduce object to their canonical form first and if not already in canonical form if(*(a.field->begin()) == 0) const_cast(this)->reduce(); // reducing "this" which a is a reference to, thus reducing "a" if(*(b.field->begin()) == 0) const_cast(b).reduce(); if(*a.field < *b.field) // field is shorter for this than for ref and object have been reduced "reduced", thus a < b return -1; else if(*a.field > *b.field) return +1; else // *a.field == *b.field { ita = a.field->begin(); itb = b.field->begin(); while(ita != a.field->end() && itb != b.field->end() && *ita == *itb) { ++ita; ++itb; } if(ita == a.field->end() && itb == b.field->end()) return 0; if(itb == b.field->end()) return +1; // b can't be greater than a, at most it can be equal to it if(ita == a.field->end()) return -1; // because itb != b.field->end(); return *ita - *itb; } } bool infinint::is_valid() const { return field != nullptr; } void infinint::reduce() { static const U_I max_a_time = ~ (U_I)(0); // this is the argument type of remove_bytes_at_iterator U_I count = 0; storage::iterator it = field->begin(); do { while(it != field->end() && (*it) == 0 && count < max_a_time) { ++it; ++count; } if(it == field->end()) // all zeros { if(count == 0) // empty storage; field->insert_null_bytes_at_iterator(field->begin(), 1); // field width is at least one byte else if(count > 1) field->remove_bytes_at_iterator(field->begin(), count - 1); // cannot remove count because we reached the end of field thus field only contains zeros, and // we must keep field at least one byte width. // else count == 1 and nothing has to be done } else { if(count > 0) field->remove_bytes_at_iterator(field->begin(), count); count = 0; it = field->begin(); } } while(it != field->end() && (*it) == 0); } void infinint::copy_from(const infinint & ref) { if(ref.is_valid()) { field = new (get_pool()) storage(*(ref.field)); if(field == nullptr) throw Ememory("infinint::copy_from"); } else throw SRC_BUG; } void infinint::detruit() { if(field != nullptr) { delete field; field = nullptr; } } void infinint::make_at_least_as_wider_as(const infinint & ref) { if(! is_valid() || ! ref.is_valid()) throw SRC_BUG; field->insert_as_much_as_necessary_const_byte_to_be_as_wider_as(*ref.field, field->begin(), 0x00); } void infinint::setup_endian() { if(integers_system_is_big_endian()) used_endian = big_endian; else used_endian = little_endian; (void)memset(zeroed_field, 0, ZEROED_SIZE); } bool infinint::is_system_big_endian() { if(used_endian == not_initialized) setup_endian(); switch(used_endian) { case big_endian: return true; case little_endian: return false; case not_initialized: throw SRC_BUG; default: throw SRC_BUG; } } /////////////////////////////////////////////////////////////////////// ///////////////// friends and not friends of infinint ///////////////// /////////////////////////////////////////////////////////////////////// infinint operator + (const infinint & a, const infinint & b) { infinint ret = a; ret += b; return ret; } infinint operator - (const infinint & a, const infinint & b) { infinint ret = a; ret -= b; return ret; } infinint operator * (const infinint & a, const infinint & b) { infinint ret = a; ret *= b; return ret; } infinint operator * (const infinint &a, const unsigned char b) { infinint ret = a; ret *= b; return ret; } infinint operator * (const unsigned char a, const infinint &b) { infinint ret = b; ret *= a; return ret; } infinint operator / (const infinint & a, const infinint & b) { infinint q, r; euclide(a, b, q, r); return q; } infinint operator % (const infinint & a, const infinint & b) { infinint q, r; euclide(a, b, q, r); return r; } infinint operator & (const infinint & a, const infinint & bit) { infinint ret = a; ret &= bit; return ret; } infinint operator | (const infinint & a, const infinint & bit) { infinint ret = a; ret |= bit; return ret; } infinint operator ^ (const infinint & a, const infinint & bit) { infinint ret = a; ret ^= bit; return ret; } infinint operator >> (const infinint & a, U_32 bit) { infinint ret = a; ret >>= bit; return ret; } infinint operator >> (const infinint & a, const infinint & bit) { infinint ret = a; ret >>= bit; return ret; } infinint operator << (const infinint & a, U_32 bit) { infinint ret = a; ret <<= bit; return ret; } infinint operator << (const infinint & a, const infinint & bit) { infinint ret = a; ret <<= bit; return ret; } void euclide(infinint a, const infinint &b, infinint &q, infinint &r) { if(b.is_zero()) throw Einfinint("infinint.cpp : euclide", gettext("Division by zero")); // division by zero if(a < b) { q = 0; r = a; return; } // need to reduce a and b first if(*(a.field->begin()) == 0) a.reduce(); r = b; if(*(r.field->begin()) == 0) r.reduce(); while(*a.field >= *r.field) r <<= 8; // one byte q = 0; while(b < r) { r >>= 8; // one byte; q <<= 8; // one byte; while(r <= a) { a -= r; ++q; } } r = a; } } // end of namespace dar-2.5.3/src/libdar/cat_all_entrees.hpp0000644000175000017430000000331712642441371015103 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_all_entrees.hpp /// \brief include file gathering all entree found in a catalogue /// \ingroup Private #ifndef CAT_ALL_ENTREE_HPP #define CAT_ALL_ENTREE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_detruit.hpp" #include "cat_device.hpp" #include "cat_directory.hpp" #include "cat_door.hpp" #include "cat_entree.hpp" #include "cat_etoile.hpp" #include "cat_file.hpp" #include "cat_ignored_dir.hpp" #include "cat_inode.hpp" #include "cat_lien.hpp" #include "cat_mirage.hpp" #include "cat_nomme.hpp" #include "cat_eod.hpp" #include "cat_chardev.hpp" #include "cat_blockdev.hpp" #include "cat_tube.hpp" #include "cat_prise.hpp" #include "cat_ignored.hpp" #endif dar-2.5.3/src/libdar/label.hpp0000644000175000017430000000463412641772777013061 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file label.hpp /// \brief define the datastructure "label" used to identify slice membership to an archive /// \ingroup Private #ifndef LABEL_HPP #define LABEL_HPP #include "../my_config.h" #include "integers.hpp" #include "generic_file.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ class label : public on_pool { public: label(); // builds a label equal to 'zero' label(const label & ref) { copy_from(ref); }; const label & operator = (const label & ref) { copy_from(ref); return *this; }; bool operator == (const label & ref) const; bool operator != (const label & ref) const { return ! ((*this) == ref); }; void clear(); bool is_cleared() const; void generate_internal_filename(); void read(generic_file & f); void dump(generic_file & f) const; void invert_first_byte() { val[0] = ~val[0]; }; // avoid using these two calls, only here for backward compatibility // where the cost to move to object is really too heavy than // sticking with an char array. U_I size() const { return LABEL_SIZE; }; char *data() { return (char *)&val; }; const char *data() const { return (char *)&val; }; static U_I common_size() { return LABEL_SIZE; }; private: static const U_I LABEL_SIZE = 10; char val[LABEL_SIZE]; void copy_from(const label & ref); }; extern const label label_zero; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_lien.hpp0000644000175000017430000000512712642457363013546 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_lien.hpp /// \brief class used to store symbolic links in a catalogue /// \ingroup Private #ifndef CAT_LIEN_HPP #define CAT_LIEN_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_inode.hpp" #include "cat_tools.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the symbolic link inode class class cat_lien : public cat_inode { public : cat_lien(const infinint & uid, const infinint & gid, U_16 perm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & name, const std::string & target, const infinint & fs_device); cat_lien(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small); bool operator == (const cat_entree & ref) const; const std::string & get_target() const; void set_target(std::string x); // using the method is_more_recent_than() from cat_inode // using method has_changed_since() from cat_inode class /// inherited from cat_entree unsigned char signature() const { return mk_signature('l', get_saved_status()); }; /// inherited from cat_entree cat_entree *clone() const { return new (get_pool()) cat_lien(*this); }; protected : void sub_compare(const cat_inode & other, bool isolated_mode) const; void inherited_dump(const pile_descriptor & pdesc, bool small) const; private : std::string points_to; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/elastic.hpp0000644000175000017430000000520012641772777013414 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file elastic.hpp /// \brief here is defined the elastic class /// \ingroup Private #ifndef ELASTIC_HPP #define ELASTIC_HPP #include "../my_config.h" #include "integers.hpp" #include "erreurs.hpp" #include "infinint.hpp" #include "generic_file.hpp" #include "header_version.hpp" namespace libdar { /// \ingroup Private /// @} enum elastic_direction { elastic_forward, elastic_backward }; /// the elastic buffer class /// the elastic class makes possible to insert arbritrary bytes beside information bytes, and to /// retreive later without any other knowledge which bytes are information and which byte are from the /// elastic buffer. The main purpose is for strong encryption /// \ingroup Private class elastic : public on_pool { public: elastic(U_32 size); elastic(const unsigned char *buffer, U_32 size, elastic_direction dir, const archive_version & reading_ver); elastic(generic_file &f, elastic_direction dir, const archive_version & reading_ver); U_32 dump(unsigned char *buffer, U_32 size) const; U_32 get_size() const { return taille; }; static U_I max_length() { return (U_I)(254)*254*254*254 - 1; }; private: U_32 taille; // max size of elastic buffer is 4GB which is large enough void randomize(unsigned char *a) const; U_I base_from_version(const archive_version & reading_ver) const; unsigned char get_low_mark(const archive_version & reading_ver) const; unsigned char get_high_mark(const archive_version & reading_ver) const; unsigned char get_low_mark() const { return 255; }; unsigned char get_high_mark() const { return 254; }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/integers.cpp0000644000175000017520000001143512610405012013555 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : dar.linux@free.fr /*********************************************************************/ #include "../my_config.h" #include "integers.hpp" #include "erreurs.hpp" #include "tools.hpp" namespace libdar { // template to check the width of a particular integer type template void integer_check_width(const char *type_name, T x, unsigned int expected) { if(sizeof(T) != expected) throw Ehardware("interger_check_width", tools_printf(gettext("%s type length is not %d byte(s) but %d"), type_name, expected, sizeof(T))); } template void integer_check_sign(const char *type_name, T x, bool expected_signed) { x = 0; --x; if(x > 0 && expected_signed) // "x > 0" to avoid compilation warning when T is unsigned throw Ehardware("integer_check_sign", tools_printf(gettext("%s type is not a signed type as expected"), type_name)); if(x < 1 && !expected_signed) // "x < 1" to avoid compilation warning when T is unsigned we compare against 1 throw Ehardware("integer_check_sign", tools_printf(gettext("%s type is not an unsigned type as expected"), type_name)); } template bool is_unsigned_big_endian(const char *type_name, T x) { unsigned int size = sizeof(x); unsigned char *ptr = (unsigned char *)(& x); unsigned int i = 0; // given type should be unsigned try { integer_check_sign(type_name, x, false); } catch(Ehardware & e) { throw SRC_BUG; } // setting x to the following serie of bytes values: "1|2|3|..|size" x = 0; i = 1; while(i <= size) { x *= 256; x += i%256; ++i; } // looking for a litte endian sequence i = 0; while(i < size && ptr[i] == (size - i)%256) ++i; if(i == size) // full litte endian sequence found return false; if(i > size) throw SRC_BUG; // looking for a big endian sequence i = 0; while(i < size && ptr[i] == (i+1)%256) ++i; if(i == size) // full big endian sequence found return true; else if(i > size) throw SRC_BUG; else // i < size, thus CPU/system uses neither a little nor a big endian sequence!!! throw Ehardware("is_unsigned_big_endian", tools_printf(gettext("type %s is neither big nor little endian! Do not know how to handle integer in a portable manner on this host, aborting"), type_name)); } void integer_check() { U_8 u8 = 0; U_16 u16 = 0; U_32 u32 = 0; U_64 u64 = 0; U_I ui = 0; S_8 s8 = 0; S_16 s16 = 0; S_32 s32 = 0; S_64 s64 = 0; S_I si = 0; // checking integer type width integer_check_width("U_8", u8, 1); integer_check_width("U_16", u16, 2); integer_check_width("U_32", u32, 4); integer_check_width("U_64", u64, 8); integer_check_width("S_8", s8, 1); integer_check_width("S_16", s16, 2); integer_check_width("S_32", s32, 4); integer_check_width("S_64", s64, 8); // checking signed types and unsigned types is as expected integer_check_sign("U_8", u8, false); integer_check_sign("U_16", u16, false); integer_check_sign("U_32", u32, false); integer_check_sign("U_64", u64, false); integer_check_sign("U_I", ui, false); integer_check_sign("S_8", s8, true); integer_check_sign("S_16", s16, true); integer_check_sign("S_32", s32, true); integer_check_sign("S_64", s64, true); integer_check_sign("S_I", si, true); } bool integers_system_is_big_endian() { U_16 u16 = 0; U_32 u32 = 0; U_64 u64 = 0; U_I ui = 0; bool ref; integer_check(); ref = is_unsigned_big_endian("U_16", u16); if(ref != is_unsigned_big_endian("U_32", u32)) throw Ehardware("integers_system_is_big_endian", gettext("incoherent endian between U_16 and U_32")); if(ref != is_unsigned_big_endian("U_64", u64)) throw Ehardware("integers_system_is_big_endian", gettext("incoherent endian between U_16 and U_64")); if(ref != is_unsigned_big_endian("U_I", ui)) throw Ehardware("integers_system_is_big_endian", gettext("incoherent endian between U_16 and U_I")); return ref; } } dar-2.5.3/src/libdar/filesystem_specific_attribute.hpp0000644000175000017430000002611412641772777020113 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file filesystem_specific_attribute.hpp /// \brief filesystem specific attributes /// \ingroup Private #ifndef FILESYSTEM_SPECIFIC_ATTRIBUTE_HPP #define FILESYSTEM_SPECIFIC_ATTRIBUTE_HPP #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_UNISTD_H #include #endif } // end extern "C" #include #include #include "integers.hpp" #include "crc.hpp" #include "fsa_family.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ /// Filesystem Specific Attributes (FSA) class /// /// this class handle the storage of attributes into and from the archive /// the have not filesystem specific knownledge. This aspect is managed /// by filesystem_specific_attribute_list that upon system call will create /// the liste of FSA and given the list of FSA will try to set them back to the /// filesystem class filesystem_specific_attribute : public on_pool { public: /// constructor used to before reading the FSA from filesystem /// \note when the underlying filesystem does not support the requested EA the constructor /// of the inherited class should throw an exception of type Erange. Only valid object should /// be built, that is object containing the value of the FSA found on the filesystem. filesystem_specific_attribute(fsa_family f) { fam = f; nat = fsan_unset; }; /// constructor used to read a FSA from a libdar archive filesystem_specific_attribute(generic_file & f, fsa_family xfam, fsa_nature xnat) { fam = xfam; nat = xnat; }; /// virtual destructor for inherited classes virtual ~filesystem_specific_attribute() throw(Ebug) {}; /// provide a mean to compare objects types bool is_same_type_as(const filesystem_specific_attribute & ref) const; /// provides a mean to compare objects values virtual bool operator == (const filesystem_specific_attribute & ref) const { return is_same_type_as(ref) && equal_value_to(ref); }; bool operator != (const filesystem_specific_attribute & ref) const { return ! (*this == ref); }; /// used to provided a sorted list of FSA bool operator < (const filesystem_specific_attribute & ref) const; bool operator >= (const filesystem_specific_attribute & ref) const { return !(*this < ref); }; bool operator > (const filesystem_specific_attribute & ref) const { return ref < *this; }; bool operator <= (const filesystem_specific_attribute & ref) const { return !(*this > ref); }; /// obtain the family of the FSA fsa_family get_family() const { return fam; }; /// obtain the nature of the FSA fsa_nature get_nature() const { return nat; }; /// provides a human readable value of the FSA virtual std::string show_val() const = 0; /// write down to libdar archive virtual void write(generic_file & f) const = 0; /// give the storage size for the FSA virtual infinint storage_size() const = 0; /// provides a way to copy objects without having to know the more specific class of the object virtual filesystem_specific_attribute *clone() const = 0; protected: void set_family(const fsa_family & val) { fam = val; }; void set_nature(const fsa_nature & val) { nat = val; }; /// should return true if the value of the argument is equal to the one of 'this' false in any other case (even for object of another inherited class) virtual bool equal_value_to(const filesystem_specific_attribute & ref) const = 0; private: fsa_family fam; fsa_nature nat; }; /////////////////////////////////////////////////////////////////////////// class filesystem_specific_attribute_list : public on_pool { public: filesystem_specific_attribute_list() {}; filesystem_specific_attribute_list(const filesystem_specific_attribute_list & ref) { copy_from(ref); }; const filesystem_specific_attribute_list & operator = (const filesystem_specific_attribute_list & ref) { clear(); copy_from(ref); return *this; }; ~filesystem_specific_attribute_list() { clear(); }; /// clear all attributes void clear(); /// gives the set of FSA family present in the list fsa_scope get_fsa_families() const { return familes; }; /// compare two lists of FSA to see whether they have equal FSA with identical values within the given family scope bool is_included_in(const filesystem_specific_attribute_list & ref, const fsa_scope & scope) const; /// read FSA list from archive void read(generic_file & f, archive_version ver); /// write FSA list to archive void write(generic_file & f) const; /// read FSA list from filesystem void get_fsa_from_filesystem_for(const std::string & target, const fsa_scope & scope, mode_t itype); /// set FSA list to filesystem /// \param [in] target path of file to restore FSA to /// \param [in] scope list of FSA families to only consider /// \param [in] ui user interaction object /// \return true if some FSA have effectively been set, false if no FSA /// could be set either because list was empty of all FSA in the list where out of scope bool set_fsa_to_filesystem_for(const std::string & target, const fsa_scope & scope, user_interaction & ui) const; /// whether the list has at least one FSA bool empty() const { return fsa.empty(); }; /// access to members of the list U_I size() const { return fsa.size(); }; /// provide reference to FSA given its index const filesystem_specific_attribute & operator [] (U_I arg) const; /// give the storage size for the EA infinint storage_size() const; /// addition operator /// /// \note this operator is not reflexive (or symetrical if you prefer). Here "a + b" may differ from "b + a" /// all FSA of the arg are added with overwriting to the FSA of 'this' filesystem_specific_attribute_list operator + (const filesystem_specific_attribute_list & arg) const; /// look for the FSA of given familly and nature /// \param[in] fam family of the FSA to look for /// \param[in] nat nature of the FSA to look for /// \param[in, out] ptr points to the FSA if found /// \return true if such an FSA has been found and set ptr accordingly else return false bool find(fsa_family fam, fsa_nature nat, const filesystem_specific_attribute *&ptr) const; private: std::vector fsa; //< sorted list of FSA fsa_scope familes; void copy_from(const filesystem_specific_attribute_list & ref); void update_familes(); void add(const filesystem_specific_attribute & ref); // add an entry without updating the "familes" field void sort_fsa(); void fill_extX_FSA_with(const std::string & target, mode_t itype); void fill_HFS_FSA_with(const std::string & target, mode_t itype); /// \note return true if some FSA could be set bool set_extX_FSA_to(user_interaction & ui, const std::string & target) const; /// \note return true if some FSA could be set bool set_hfs_FSA_to(user_interaction & ui, const std::string & target) const; static std::string family_to_signature(fsa_family f); static std::string nature_to_signature(fsa_nature n); static fsa_family signature_to_family(const std::string & sig); static fsa_nature signature_to_nature(const std::string & sig); }; /////////////////////////////////////////////////////////////////////////// template T *cloner(const T *x, memory_pool *p) { if(x == nullptr) throw SRC_BUG; T *ret = new (p) T(*x); if(ret == nullptr) throw Ememory("cloner template"); return ret; } /////////////////////////////////////////////////////////////////////////// class fsa_bool : public filesystem_specific_attribute { public: fsa_bool(fsa_family f, fsa_nature n, bool xval) : filesystem_specific_attribute(f), val(xval) { set_nature(n); }; fsa_bool(generic_file & f, fsa_family fam, fsa_nature nat); bool get_value() const { return val; }; /// inherited from filesystem_specific_attribute virtual std::string show_val() const { return val ? gettext("true") : gettext("false"); }; virtual void write(generic_file & f) const { f.write(val ? "T" : "F", 1); }; virtual infinint storage_size() const { return 1; }; virtual filesystem_specific_attribute *clone() const { return cloner(this, get_pool()); }; protected: virtual bool equal_value_to(const filesystem_specific_attribute & ref) const; private: bool val; }; /////////////////////////////////////////////////////////////////////////// class fsa_infinint : public filesystem_specific_attribute { public: fsa_infinint(fsa_family f, fsa_nature n, infinint xval) : filesystem_specific_attribute(f), val(xval) { set_nature(n); }; fsa_infinint(generic_file & f, fsa_family fam, fsa_nature nat); const infinint & get_value() const { return val; }; /// inherited from filesystem_specific_attribute virtual std::string show_val() const; virtual void write(generic_file & f) const { val.dump(f); }; virtual infinint storage_size() const { return val.get_storage_size(); }; virtual filesystem_specific_attribute *clone() const { return cloner(this, get_pool()); }; protected: virtual bool equal_value_to(const filesystem_specific_attribute & ref) const; private: infinint val; }; /////////////////////////////////////////////////////////////////////////// class fsa_time : public filesystem_specific_attribute { public: fsa_time(fsa_family f, fsa_nature n, datetime xval) : filesystem_specific_attribute(f), val(xval) { set_nature(n); }; fsa_time(generic_file & f, archive_version ver, fsa_family fam, fsa_nature nat); const datetime & get_value() const { return val; }; /// inherited from filesystem_specific_attribute virtual std::string show_val() const; virtual void write(generic_file & f) const { val.dump(f); }; virtual infinint storage_size() const { return val.get_storage_size(); }; virtual filesystem_specific_attribute *clone() const { return cloner(this, get_pool()); }; protected: virtual bool equal_value_to(const filesystem_specific_attribute & ref) const; private: datetime val; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/memory_pool.hpp0000644000175000017430000000654712641772777014350 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file memory_pool.hpp /// \brief class memory_pool allocates and recycles blocks of memory for better performances /// it is expected to be used with classes that inherit from class on_pool /// \ingroup API #ifndef MEMORY_POOL_HPP #define MEMORY_POOL_HPP #include "../my_config.h" #include #include "mem_sized.hpp" #include "erreurs.hpp" namespace libdar { /// \addtogroup API /// @{ class memory_pool { public: #ifdef LIBDAR_SPECIAL_ALLOC memory_pool() { carte.clear(); }; #else memory_pool() { throw Efeature("Special allocation"); }; #endif memory_pool(const memory_pool & ref) { throw SRC_BUG ; }; const memory_pool & operator = (const memory_pool & ref) { throw SRC_BUG; }; ~memory_pool() throw(Ebug); /// allocate a memory block of requested size /// /// \param[in] size the size of the requested memory block to allocate /// \param[ou] ptr the mem_allocator object that will have to be informed when that memory block will be released /// \return the address of the newly allocated memory block void *alloc(size_t size); /// release a memory block previously allocated by the memory pool void release(void *ptr); /// cleanup mem_sized objects that were pending for release void garbage_collect(); /// return true if all memory blocks previously allocated have been released bool is_empty() const { return carte.size() == 0; }; /// display a memory_pool status std::string dump() const; #ifdef LIBDAR_DEBUG_MEMORY /// provides information about the usage of the memory_pool std::string max_percent_full() const; #endif private: /// this data structure is placed just before an allocated block to provide a quick way to release it union alloc_ptr { mem_allocator *ptr;//< points to the mem_allocator that provided the block U_I alignment__i; //< to properly align the allocated memory block that follows U_32 alignment_32; //< to properly align the allocated memory block that follows U_64 alignment_64; //< to properly align the allocated memory block that follows }; std::map carte; //< associate a requested block size to the corresponding mem_sized object #ifdef LIBDAR_DEBUG_MEMORY std::map count; //< counts the usage of requests per requested block size #endif }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/generic_thread.cpp0000644000175000017430000002634412641772777014742 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif } // end extern "C" #include "generic_thread.hpp" using namespace std; namespace libdar { generic_thread::generic_thread(generic_file * x_ptr, U_I data_block_size, U_I data_num_block, U_I ctrl_block_size, U_I ctrl_num_block): generic_file(gf_read_only), toslave_data(data_num_block, data_block_size), tomaster_data(data_num_block, data_block_size), toslave_ctrl(ctrl_num_block, ctrl_block_size), tomaster_ctrl(ctrl_num_block, ctrl_block_size) { unsigned int tmp = sizeof(data_header); if(tmp < sizeof(char)) throw SRC_BUG; if(x_ptr == nullptr) throw SRC_BUG; set_mode(x_ptr->get_mode()); reached_eof = false; running = false; order.clear(); order.set_type(msg_type::data_partial); order.reset_get_block(); if(!order.get_block(&data_header, tmp)) throw SRC_BUG; // data header larger than one byte ! order.set_type(msg_type::data_completed); order.reset_get_block(); if(!order.get_block(&data_header_eof, tmp)) throw SRC_BUG; remote = new (get_pool()) slave_thread(x_ptr, &toslave_data, &tomaster_data, &toslave_ctrl, &tomaster_ctrl); if(remote == nullptr) throw Ememory("generic_thread::generic_thread"); try { my_run(); // launching the new thread } catch(...) { if(remote != nullptr) delete remote; throw; } } generic_thread::generic_thread(const generic_thread & ref): generic_file (gf_read_only), toslave_data(2, 10), tomaster_data(2, 10), toslave_ctrl(2, 10), tomaster_ctrl(2, 10) { throw SRC_BUG; } generic_thread::~generic_thread() { if(remote != nullptr) { if(!is_terminated()) terminate(); delete remote; remote = nullptr; } } bool generic_thread::skippable(skippability direction, const infinint & amount) { bool ret; // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); switch(direction) { case generic_file::skip_backward: order.set_type(msg_type::order_skippable_fwd); break; case generic_file::skip_forward: order.set_type(msg_type::order_skippable_bkd); break; default: throw SRC_BUG; } order.set_infinint(amount); // order completed send_order(); read_answer(); check_answer(msg_type::answr_skippable); ret = answer.get_bool(); release_block_answer(); return ret; } bool generic_thread::skip(const infinint & pos) { bool ret; reached_eof = false; // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); order.set_type(msg_type::order_skip); order.set_infinint(pos); // order completed send_order(); read_answer(); check_answer(msg_type::answr_skip_done); // this flushes all read ahead data up before skip occured ret = answer.get_bool(); release_block_answer(); purge_data_pipe(); return ret; } bool generic_thread::skip_to_eof() { bool ret; // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); order.set_type(msg_type::order_skip_to_eof); // order completed send_order(); read_answer(); check_answer(msg_type::answr_skip_done); ret = answer.get_bool(); release_block_answer(); reached_eof = ret; purge_data_pipe(); return ret; } bool generic_thread::skip_relative(S_I x) { U_I val; bool ret; // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); if(x >= 0) { val = x; order.set_type(msg_type::order_skip_fwd); order.set_U_I(val); } else // x < 0 { reached_eof = false; val = -x; order.set_type(msg_type::order_skip_bkd); order.set_U_I(val); } // order completed send_order(); read_answer(); check_answer(msg_type::answr_skip_done); ret = answer.get_bool(); release_block_answer(); purge_data_pipe(); return ret; } infinint generic_thread::get_position() const { infinint ret; // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); order.set_type(msg_type::order_get_position); // order completed send_order(); read_answer(); check_answer(msg_type::answr_position); ret = answer.get_infinint(); release_block_answer(); return ret; } void generic_thread::inherited_read_ahead(const infinint & amount) { // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); order.set_type(msg_type::order_read_ahead); order.set_infinint(amount); // order completed send_order(); } U_I generic_thread::inherited_read(char *a, U_I size) { U_I read = 0; U_I min; char *data_ptr = nullptr; unsigned int data_num; // rerun the thread if an exception has occured previously my_run(); if(reached_eof) return 0; // preparing the order message order.clear(); order.set_type(msg_type::order_read); order.set_U_I(size); // order completed send_order(); // now retreiving the data from the data_pipe do { tomaster_data.fetch(data_ptr, data_num); --data_num; // the first byte contains the message type min = size - read; // what's still need to be read if(data_num > min) // we retreived more data than necessary { U_I kept = data_num - min; (void)memcpy(a + read, data_ptr + 1, min); read += min; (void)memmove(data_ptr + 1, data_ptr + 1 + min, kept); tomaster_data.fetch_push_back(data_ptr, kept + 1); } else // the whole block will be read { (void)memcpy(a + read, data_ptr + 1, data_num); read += data_num; if(data_ptr[0] == data_header_eof) reached_eof = true; tomaster_data.fetch_recycle(data_ptr); } } while(!reached_eof && read < size); return read; } void generic_thread::inherited_write(const char *a, U_I size) { U_I wrote = 0; unsigned int bksize; char *tmptr = nullptr; U_I min; // rerun the thread if an exception has occured previously my_run(); if(tomaster_data.is_not_empty()) throw SRC_BUG; do { toslave_data.get_block_to_feed(tmptr, bksize); if(bksize > 1) tmptr[0] = data_header; else { toslave_data.feed_cancel_get_block(tmptr); throw SRC_BUG; } min = bksize - 1 > size - wrote ? size - wrote : bksize - 1; (void)memcpy(tmptr + 1, a + wrote, min); wrote += min; toslave_data.feed(tmptr, min + 1); wake_up_slave_if_asked(); } while(wrote < size); } void generic_thread::inherited_sync_write() { // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); order.set_type(msg_type::order_sync_write); // order completed send_order(); read_answer(); check_answer(msg_type::answr_sync_write_done); release_block_answer(); } void generic_thread::inherited_flush_read() { // rerun the thread if an exception has occured previously my_run(); // preparing the order message to stop a possible read_ahead // running in the slave_thread order.clear(); order.set_type(msg_type::order_stop_readahead); // order completed send_order(); read_answer(); check_answer(msg_type::answr_readahead_stopped); release_block_answer(); // dropping all data currently in the pipe purge_data_pipe(); // resetting the current object reached_eof = false; } void generic_thread::inherited_terminate() { // rerun the thread if an exception has occured previously my_run(); // preparing the order message order.clear(); order.set_type(msg_type::order_end_of_xmit); // order completed send_order(); purge_data_pipe(); my_join(); } void generic_thread::send_order() { bool completed = false; order.reset_get_block(); do { toslave_ctrl.get_block_to_feed(ptr, num); completed = order.get_block(ptr, num); toslave_ctrl.feed(ptr, num); } while(!completed); } void generic_thread::read_answer() { bool completed = false; answer.clear(); do { tomaster_ctrl.fetch(ptr, num); completed = answer.add_block(ptr, num); if(!completed) tomaster_ctrl.fetch_recycle(ptr); } while(!completed); // note ptr and num are relative // to the last block read which // must be released/recycled calling release_answer() } void generic_thread::check_answer(msg_type expected) { switch(answer.get_type()) { case msg_type::answr_exception: release_block_answer(); my_join(); throw SRC_BUG; // join should rethrow the exception that has been raised in the thread "remote" default: if(answer.get_type() == expected) break; else { release_block_answer(); throw SRC_BUG; } } } void generic_thread::wake_up_slave_if_asked() { if(remote == nullptr) throw SRC_BUG; if(remote->wake_me_up()) { order.clear(); order.set_type(msg_type::order_wakeup); send_order(); } } void generic_thread::purge_data_pipe() { char *tmp; unsigned int tmp_ui; while(tomaster_data.is_not_empty()) { tomaster_data.fetch(tmp, tmp_ui); tomaster_data.fetch_recycle(tmp); } } void generic_thread::my_run() { if(!running) { running = true; if(remote == nullptr) throw SRC_BUG; if(remote->is_running()) throw SRC_BUG; toslave_data.reset(); tomaster_data.reset(); toslave_ctrl.reset(); tomaster_ctrl.reset(); remote->run(); // launching the new thread if(remote->is_running(tid)) { thread_cancellation::associate_tid_to_tid(pthread_self(), tid); thread_cancellation::associate_tid_to_tid(tid, pthread_self()); } else running = false; } } void generic_thread::my_join() { try { remote->join(); // may throw exceptions } catch(...) { if(running) // running may be false if the thread lived to shortly to obtain its tid thread_cancellation::dead_thread(tid); running = false; throw; } if(running) thread_cancellation::dead_thread(tid); running = false; } } // end of generic_thread::namespace dar-2.5.3/src/libdar/archive.hpp0000644000175000017430000006400312642474445013407 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file archive.hpp /// \brief the archive class is defined in this module /// \ingroup API #ifndef ARCHIVE_HPP #define ARCHIVE_HPP #include "../my_config.h" #include #include #include "erreurs.hpp" #include "path.hpp" #include "scrambler.hpp" #include "statistics.hpp" #include "archive_options.hpp" #include "escape.hpp" #include "escape_catalogue.hpp" #include "pile.hpp" #include "list_entry.hpp" #include "on_pool.hpp" #include "crypto.hpp" #include "slice_layout.hpp" namespace libdar { /// the archive class realizes the most general operations on archives /// the operations corresponds to the one the final user expects, these /// are the same abstraction level as the operation realized by the DAR /// command line tool. /// \ingroup API class archive : public on_pool { public: /// this constructor opens an already existing archive (for reading) [this is the "read" constructor] /// \param[in,out] dialog for user interaction /// \param[in] chem the path where to look for slices /// \param[in] basename the slices basename of the archive to read /// ("-" means standard input, and activates the output_pipe and input_pipe arguments) /// \param[in] extension the slice extension (should always be "dar") /// \param[in] options A set of option to use to read the archive archive(user_interaction & dialog, const path & chem, const std::string & basename, const std::string & extension, const archive_options_read & options); /// this constuctor create an archive (full or differential) [this is the "create" constructor] /// \param[in,out] dialog for user interaction /// \param[in] fs_root the filesystem to take as root for the backup /// \param[in] sauv_path the path where to create slices /// \param[in] filename base name of the slices. If "-" is given the archive will be produced in standard output /// \param[in] extension slices extension ("dar") /// \param[in] options optional parameters to use for the operation /// \param[out] progressive_report statistics about the operation, considering the treated files (nullptr can be given if you don't want to use this feature) /// \note the statistics fields used are: /// - .treated: the total number of files seen /// - .hard_link: the number of hard linked inodes /// - .tooold: the number of files that changed at the time they were saved and that could not be resaved (due to repeat limit or byte limit) /// - .skipped: number of files not changed (differential backup) /// - .errored: number of files concerned by filesystem error /// - .ignored: number of files excluded by filters /// - .deleted: number of files recorded as deleted /// - .ea_treated: number of entry having some EA /// - .byte_amount : number of wasted bytes due to repeat on change feature /// . archive(user_interaction & dialog, const path & fs_root, const path & sauv_path, const std::string & filename, const std::string & extension, const archive_options_create & options, statistics * progressive_report); /// WARNING this is a deprecated constructor, use the op_isolate() method for better performances /// \note this method will be remove from the API in a future version of libdar archive(user_interaction & dialog, const path & sauv_path, archive *ref_arch, const std::string & filename, const std::string & extension, const archive_options_isolate & options); /// this constructor builds an archive from two given archive [this is the "merge" constructor] /// \param[in,out] dialog for user interaction /// \param[in] sauv_path the path where to create slices /// \param[in] ref_arch1 the first mandatory input archive (the second is optional and provided within the 'option' argument /// \param[in] filename base name of the slices. If "-" is given the archive will be produced in standard output /// \param[in] extension slices extension ("dar") /// \param[in] options optional parameters to be used for the operation /// \param[out] progressive_report statistics about the operation, considering the treated files (nullptr can be given if you don't want to use this feature) /// \note the statistics fields used are: /// - .treated: the total number of files seen /// - .hard_link: the number of hard linked inodes /// - .ignored: number of files excluded by filters /// - .deleted: number of files recorded as deleted /// - .ea_treated: number of entry with EA /// . archive(user_interaction & dialog, const path & sauv_path, archive *ref_arch1, const std::string & filename, const std::string & extension, const archive_options_merge & options, statistics * progressive_report); /// copy constructor (not implemented, throw an exception if called explicitely or implicitely) /// \note this lack of implementation is intentionnal, Archive should rather be manipulated /// using pointers, or passed as constant reference (const &) in arguments or returned values. /// Moreover, having two objets one copy of the other may lead to unexpected behaviors while /// merging or creating, isolating or merging archives. archive(const archive & ref) : stack(ref.stack) { throw Efeature(dar_gettext("Archive copy constructor is not implemented")); }; archive & operator = (const archive & ref) { throw Efeature(dar_gettext("Archive assignment operator is not implemented")); }; /// the destructor ~archive() throw(Ebug) { free_all(); }; /// extraction of data from an archive /// \param[in,out] dialog for user interaction /// \param[in] fs_root the filesystem to take as root for the restoration /// \param[in] options optional parameter to be used for the operation /// \param[in,out] progressive_report points to an already existing statistics object that can be consulted at any time /// during the call (see the returned value to know the useful fields and their meining), /// nullptr can be given in argument if you only need the result at the end of the operation through the returned value of this call /// this should speed up the operation by a little amount. /// \return the statistics about the operation, considering the treated files /// \note the statistics fields used are: /// - .treated: the total number of files restored /// - .skipped: number of files not saved in the archive /// - .tooold: number of file not restored due to overwriting policy decision /// - .errored: number of files concerned by filesystem error /// - .ignored: number of files excluded by filters /// - .deleted: number of files deleted /// - .hard_links: number of hard link restored /// - .ea_treated: number of entry having some EA /// . statistics op_extract(user_interaction & dialog, const path &fs_root, const archive_options_extract & options, statistics *progressive_report); /// display a summary of the archive /// /// \note see also get_stats() method void summary(user_interaction & dialog); /// listing of the archive contents /// \param[in,out] dialog for user interaction /// \param[in] options list of optional parameters to use for the operation /// \note this call covers the whole listing and uses the user_interaction /// to provide the archive contents (in particular using its listing() method /// if set and activated by its set_use_listing() method). There is however two /// alternative way to get archive contents: /// . archive::get_children_of() method /// . archive::init_catalogue()+get_children_in_table() void op_listing(user_interaction & dialog, const archive_options_listing & options); /// archive comparison with filesystem /// \param[in,out] dialog for user interaction /// \param[in] fs_root the filesystem to take as root for the comparison /// \param[in] options optional parameters to be used with the operation /// \param[in,out] progressive_report points to an already existing statistics object that can be consulted at any time /// during the call (see the returned value to know the useful fields and their meining), /// nullptr can be given in argument if you only need the result at the end of the operation through the returned value of this call /// this should speed up the operation by a little amount. /// \return the statistics about the operation, considering the treated files /// \note the statistics fields used are: /// - .treated: the total number of files seen /// - .errored: number of files that do not match or could not be read /// - .ignored: number of files excluded by filters /// . statistics op_diff(user_interaction & dialog, const path & fs_root, const archive_options_diff & options, statistics * progressive_report); /// test the archive integrity /// \param[in,out] dialog for user interaction /// \param[in] options optional parameter to use for the operation /// \param[in,out] progressive_report points to an already existing statistics object that can be consulted at any time /// during the call (see the returned value to know the useful fields and their meining), /// nullptr can be given in argument if you only need the result at the end of the operation through the returned value of this call /// this should speed up the operation by a little amount. /// \note op_test will generate an error message if used on an archive /// that has been created by the isolate or creation constructor /// this is not only an implementation limitation but also a choice. /// testing an file archive using the C++ object used to create /// the file is not a good idea. You need to first destroy this /// C++ object then create a new one with the reading constructor /// this way only you can be sure your archive is properly tested. /// \return the statistics about the operation, considering the treated files /// \note the statistics fields used are: /// - .treated: the total number of files seen /// - .skipped: number of file older than the one on filesystem /// - .errored: number of files with error /// . statistics op_test(user_interaction & dialog, const archive_options_test & options, statistics * progressive_report); /// this methodes isolates the catalogue of a the current archive into a separated archive /// \param[in,out] dialog for user interaction /// \param[in] sauv_path the path where to create slices /// \param[in] filename base name of the slices ("-" for standard output) /// \param[in] extension slices extension ("dar") /// \param[in] options optional parameters to use for the operation void op_isolate(user_interaction & dialog, const path &sauv_path, const std::string & filename, const std::string & extension, const archive_options_isolate & options); /// getting information about a given directory /// \param[in,out] dialog for user interaction /// \param[in] dir relative path the directory to get information about /// \return true if some children have been found and thus if /// the dialog.listing() method has been called at least once. /// \note the get_children_of() call uses the listing() method /// to send back data to the user. If it is not redifined in the /// dialog object nothing will get sent back to the user bool get_children_of(user_interaction & dialog, const std::string & dir); /// getting information about the given directory (alternative to get_children_of) /// /// \param[in] dir relative path the directory to get information about, use empty string for root directory /// \return a table information about all subdir and subfile for the given directory /// \note at the difference of get_children_of, this call does not rely on a user_interaction class /// to provide the information, but rather returns a table of children. To allow new fields to /// be added to the future the table contains an object that provide a method per field. /// \note before calling this method on this object, a single call to init_catalogue() is /// mandatory const std::vector get_children_in_table(const std::string & dir) const; /// returns true if the pointed directory has one or more subdirectories bool has_subdirectory(const std::string & dir) const; /// retrieving statistics about archive contents const entree_stats get_stats() const { if(cat == nullptr) throw SRC_BUG; return cat->get_stats(); }; /// retrieving signature information about the archive const std::list & get_signatories() const { return gnupg_signed; }; /// necessary to get the catalogue fully loaded in memory in any situation /// in particular in sequential reading mode void init_catalogue(user_interaction & dialog) const; /// gives access to internal catalogue (not to be used from the API) /// \return the catalogue reference contained in this archive /// \note this method is not to be used directly from external application, it is /// not part of the API but must remain a public method for been usable by the database class /// \note this method is not usable (throws an exception) if the archive has been /// open in sequential read mode and the catalogue has not yet been read; use the /// same method but with user_interaction argument instead, in that situation /// or call init_catalogue() first. const catalogue & get_catalogue() const; /// gives access to internal catalogue (not to be used from the API) even in sequential read mode const catalogue & get_catalogue(user_interaction & dialog) const; /// closes all filedescriptors and associated data, just keep the catalogue /// \note once this method has been called, the archive object can only be used /// as reference for a differential archive. /// \note this method is not usable (throws an exception) if the archive has been /// open in sequential read mode and the catalogue has not yet been read; use the /// same method but with user_interaction argument instead in that situation void drop_all_filedescriptors(); /// closes all filedescriptors and associated even when in sequential read mode void drop_all_filedescriptors(user_interaction & dialog); /// change all inode as unsaved (equal to differential backup with no change met) void set_to_unsaved_data_and_FSA() { if(cat == nullptr) throw SRC_BUG; cat->set_to_unsaved_data_and_FSA(); }; /// check that the internal memory_pool has all its blocks properly freeed /// /// \return an empty string in normal situation, else a status report about the /// still allocated blocks that remain in the internal memory_pool /// \note this must be the last call done to that object before destruction and it must /// be done only once std::string free_and_check_memory() const; private: enum operation { oper_create, oper_isolate, oper_merge }; pile stack; //< the different layer through which the archive contents is read or wrote header_version ver; //< information for the archive header memory_pool *pool; //< points to local_pool or inherited pool or to nullptr if no memory_pool has to be used catalogue *cat; //< archive contents infinint local_cat_size; //< size of the catalogue on disk bool exploitable; //< is false if only the catalogue is available (for reference backup or isolation). bool lax_read_mode; //< whether the archive has been openned in lax mode (unused for creation/merging/isolation) bool sequential_read; //< whether the archive is read in sequential mode bool freed_and_checked; //< whether free_and_check has been run std::list gnupg_signed; //< list of signature found in the archive (reading an existing archive) slice_layout slices; //< slice layout, archive is not sliced <=> first_size or other_size fields is set to zero (in practice both are set to zero, but one being set is enought to determine the archive is not sliced) void free_except_memory_pool(); void free_all(); void init_pool(); void check_gnupg_signed(user_interaction & dialog) const; const catalogue & get_cat() const { if(cat == nullptr) throw SRC_BUG; else return *cat; }; const header_version & get_header() const { return ver; }; bool get_sar_param(infinint & sub_file_size, infinint & first_file_size, infinint & last_file_size, infinint & total_file_number); const entrepot *get_entrepot(); //< this method may return nullptr if no entrepot is used (pipes used for archive building, etc.) infinint get_level2_size(); infinint get_cat_size() const { return local_cat_size; }; statistics op_create_in(user_interaction & dialog, operation op, const path & fs_root, const entrepot & sauv_path_t, archive *ref_arch, const mask & selection, const mask & subtree, const std::string & filename, const std::string & extension, bool allow_over, bool warn_over, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, const infinint & pause, bool empty_dir, compression algo, U_I compression_level, const infinint & file_size, const infinint & first_file_size, const mask & ea_mask, const std::string & execute, crypto_algo crypto, const secu_string & pass, U_32 crypto_size, const std::vector & gnupg_recipients, const std::vector & gnupg_signatories, const mask & compr_mask, const infinint & min_compr_size, bool nodump, const std::string & exclude_by_ea, const infinint & hourshift, bool empty, bool alter_atime, bool furtive_read_mode, bool same_fs, cat_inode::comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, const infinint & fixed_date, const std::string & slice_permission, const infinint & repeat_count, const infinint & repeat_byte, bool add_marks_for_sequential_reading, bool security_check, const infinint & sparse_file_min_size, const std::string & user_comment, hash_algo hash, const infinint & slice_min_digits, const std::string & backup_hook_file_execute, const mask & backup_hook_file_mask, bool ignore_unknown, const fsa_scope & scope, bool multi_threaded, statistics * progressive_report); void op_create_in_sub(user_interaction & dialog, //< interaction with user operation op, //< the filter operation to bind to const path & fs_root, //< root of the filesystem to act on const entrepot & sauv_path_t, //< where to create the archive const catalogue * ref_cat1, //< catalogue of the archive of reference, (cannot be nullptr if ref_cat2 is not nullptr) const catalogue * ref_cat2, //< secondary catalogue used for merging, can be nullptr if not used bool initial_pause, //< whether we shall pause before starting the archive creation const mask & selection, //< filter on filenames const mask & subtree, //< filter on directory tree and filenames const std::string & filename, //< basename of the archive to create const std::string & extension, //< extension of the archives bool allow_over, //< whether to allow overwriting (of slices) const crit_action & overwrite, //< whether and how to allow overwriting (for files inside the archive) bool warn_over, //< whether to warn before overwriting bool info_details, //< whether to display detailed informations bool display_treated, //< whether to display treated files bool display_treated_only_dir, //< whether to only display current directory of treated files bool display_skipped, //< display skipped files for the operation bool display_finished, //< display space and compression ratio summary for each completed directory const infinint & pause, //< whether to pause between slices bool empty_dir, //< whether to store excluded dir as empty directories compression algo, //< compression algorithm U_I compression_level, //< compression level (range 1 to 9) const infinint & file_size, //< slice size const infinint & first_file_size, //< first slice size const mask & ea_mask, //< Extended Attribute to consider const std::string & execute, //< Command line to execute between slices crypto_algo crypto, //< crypt algorithm const secu_string & pass, //< password ("" for onfly request of password) U_32 crypto_size, //< size of crypto blocks const std::vector & gnupg_recipients, //< list of email recipients to encrypted a randomly chosen key inside the archive const std::vector & gnupg_signatories, //< list of email recipients to use for signature const mask & compr_mask, //< files to compress const infinint & min_compr_size, //< file size under which to not compress files bool nodump, //< whether to consider the "nodump" filesystem flag const std::string & exclude_by_ea,//< if not empty the ea to use for inode exclusion from backup operation const infinint & hourshift, //< hourshift (see man page -H option) bool empty, //< whether to make an "dry-run" execution bool alter_atime, //< whether to alter atime date (by opposition to ctime) when reading files bool furtive_read_mode, //< whether to neither alter atime nor ctome (if true alter_atime is ignored) bool same_fs, //< confin the files consideration to a single filesystem cat_inode::comparison_fields what_to_check, //< fields to consider wien comparing inodes (see cat_inode::comparison_fields enumeration) bool snapshot, //< make as if all file had not changed bool cache_directory_tagging, //< avoid saving directory which follow the cache directory tagging bool keep_compressed, //< keep file compressed when merging const infinint & fixed_date, //< whether to ignore any archive of reference and only save file which modification is more recent that the given "fixed_date" date const std::string & slice_permission, //< permissions of slices that will be created const infinint & repeat_count, //< max number of retry to save a file that have changed while it was read for backup const infinint & repeat_byte, //< max amount of wasted data used to save a file that have changed while it was read for backup bool decremental, //< in the merging context only, whether to build a decremental backup from the two archives of reference bool add_marks_for_sequential_reading, //< whether to add marks for sequential reading bool security_check, //< whether to check for ctime change with no reason (rootkit ?) const infinint & sparse_file_min_size, //< starting which size to consider looking for holes in sparse files (0 for no detection) const std::string & user_comment, //< user comment to put in the archive hash_algo hash, //< whether to produce hash file, and which algo to use const infinint & slice_min_digits, //< minimum digit for slice number const std::string & backup_hook_file_execute, //< command to execute before and after files to backup const mask & backup_hook_file_mask, //< files elected to have a command executed before and after their backup bool ignore_unknown, //< whether to warn when an unknown inode type is met const fsa_scope & scope, //< FSA scope for the operation bool multi_threaded, //< whether libdar is allowed to spawn several thread to possibily work faster on multicore CPU statistics * st_ptr); //< statistics must not be nullptr ! void disable_natural_destruction(); void enable_natural_destruction(); const label & get_layer1_data_name() const; const label & get_catalogue_data_name() const; bool only_contains_an_isolated_catalogue() const; //< true if the current archive only contains an isolated catalogue void check_against_isolation(user_interaction & dialog, bool lax) const; //< throw Erange exception if the archive only contains an isolated catalogue const cat_directory *get_dir_object(const std::string & dir) const; }; } // end of namespace #endif dar-2.5.3/src/libdar/escape_catalogue.hpp0000644000175000017430000001241112642474445015246 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file escape_catalogue.hpp /// \brief class escape_catalogue definition. Used for sequential writing to archives, as well as several other inherited classes from catalogue.hpp /// \ingroup Private /// /// This class inherits from the class catalogue and implements /// the pre_add(...) method, which role is to add an escape sequence followed /// by an entry dump (usually used at the end of archive is the so called catalogue part /// of the archive). This sequence followed by entry dump is added /// before each file's data all along the archive. /// Other inherited classes, implement the escape specific part, used when performing /// sequential reading of the catalogue #ifndef ESCAPE_CATALOGUE_HPP #define ESCAPE_CATALOGUE_HPP #include "../my_config.h" #include "catalogue.hpp" #include "escape.hpp" #include "pile.hpp" namespace libdar { /// \addtogroup Private /// @{ class escape_catalogue : public catalogue { public: /// constructor to setup a escape_catalogue that will drop marks all along the archive and drop its content at end of archive escape_catalogue(user_interaction & dialog, const pile_descriptor & x_pdesc, const datetime & root_last_modif, const label & data_name); /// constructor to setup a escape_catalogue that will be fed by sequentially reading the archive escape_catalogue(user_interaction & dialog, //< user interaction const pile_descriptor & x_pdesc, //< stack descriptor where to write to const header_version & ver, //< archive header version read const std::list & known_signatories, //< signatories that signed the archive header, to be compared with internal catalogue when reaching the end of the archive bool lax = false); //< whether to use lax mode escape_catalogue(const escape_catalogue & ref) : catalogue(ref) { copy_from(ref); }; const escape_catalogue & operator = (const escape_catalogue &ref); ~escape_catalogue() { destroy(); }; // inherited from catalogue void pre_add(const cat_entree *ref) const; void pre_add_ea(const cat_entree *ref) const; void pre_add_crc(const cat_entree *ref) const; void pre_add_dirty() const; void pre_add_ea_crc(const cat_entree *ref) const; void pre_add_waste_mark() const; void pre_add_failed_mark() const; void pre_add_fsa(const cat_entree *ref) const; void pre_add_fsa_crc(const cat_entree *ref) const; escape *get_escape_layer() const { return pdesc.esc; }; void reset_read() const; void end_read() const; void skip_read_to_parent_dir() const; bool read(const cat_entree * & ref) const; bool read_if_present(std::string *name, const cat_nomme * & ref) const; void tail_catalogue_to_current_read(); bool read_second_time_dir() const { return status == ec_detruits; }; private: enum state { ec_init, //< state in which no one file has yet been searched in the archive ec_marks, //< state in which we find the next file using escape sequence marks ec_eod, //< state in which the archive is missing trailing EOD entries, due to user interruption, thus returning EOD in enough number to get back to the root directory ec_signature, //< state in which we compare inline and internal catalogues ec_detruits, //< state in which which detruits objects are returned from the catalogue ec_completed //< state in which the escape_catalogue object is completed and has all information in memory as a normal catalogue }; pile_descriptor pdesc; header_version x_ver; std::list known_sig; bool x_lax; std::map corres; state status; catalogue *cat_det; //< holds the final catalogue's detruit objects when no more file can be read from the archive infinint min_read_offset; //< next offset in archive should be greater than that to identify a mark infinint depth; //< directory depth of archive being read sequentially infinint wait_parent_depth; //< ignore any further entry while depth is less than wait_parent_depth. disabled is set to zero void set_esc_and_stack(const pile_descriptor & x_pdesc); void copy_from(const escape_catalogue & ref); void destroy(); void merge_cat_det(); void reset_reading_process(); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/database_header.cpp0000644000175000017430000001007212641772777015042 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_STRING_H #include #endif } // end extern "C" #include "database_header.hpp" #include "compressor.hpp" #include "tools.hpp" #include "user_interaction.hpp" #include "integers.hpp" #include "cygwin_adapt.hpp" #include "fichier_local.hpp" using namespace std; namespace libdar { static const unsigned char database_version = 4; #define HEADER_OPTION_NONE 0x00 struct database_header { unsigned char version; unsigned char options; void read(generic_file & f) { f.read((char *)&version, 1); f.read((char *)&options, 1); }; void write(generic_file & f) { f.write((char *)&version, 1); f.write((char *)&options, 1); }; }; generic_file *database_header_create(user_interaction & dialog, memory_pool *pool, const string & filename, bool overwrite) { generic_file *ret = nullptr; struct stat buf; database_header h; compressor *comp; if(stat(filename.c_str(), &buf) >= 0 && !overwrite) throw Erange("database_header_create", gettext("Cannot create database, file exists")); ret = new (pool) fichier_local(dialog, filename, gf_write_only, 0666, !overwrite, overwrite, false); if(ret == nullptr) throw Ememory("database_header_create"); try { h.version = database_version; h.options = HEADER_OPTION_NONE; h.write(*ret); comp = new (pool) compressor(gzip, ret); // upon success, ret is owned by compr if(comp == nullptr) throw Ememory("database_header_create"); else ret = comp; } catch(...) { delete ret; throw; } return ret; } generic_file *database_header_open(user_interaction & dialog, memory_pool *pool, const string & filename, unsigned char & db_version) { generic_file *ret = nullptr; try { database_header h; compressor *comp; try { ret = new (pool) fichier_local(filename, false); } catch(Erange & e) { throw Erange("database_header_open", tools_printf(gettext("Error reading database %S : "), &filename) + e.get_message()); } if(ret == nullptr) throw Ememory("database_header_open"); h.read(*ret); if(h.version > database_version) throw Erange("database_header_open", gettext("The format version of this database is too high for that software version, use a more recent software to read or modify this database")); db_version = h.version; if(h.options != HEADER_OPTION_NONE) throw Erange("database_header_open", gettext("Unknown header option in database, aborting\n")); comp = new (pool) compressor(gzip, ret); if(comp == nullptr) throw Ememory("database_header_open"); else ret = comp; } catch(...) { if(ret != nullptr) delete ret; throw; } return ret; } extern const unsigned char database_header_get_supported_version() { return database_version; } } // end of namespace dar-2.5.3/src/libdar/on_pool.cpp0000644000175000017430000000406112641772777013434 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "erreurs.hpp" #include "on_pool.hpp" using namespace std; namespace libdar { #ifdef LIBDAR_SPECIAL_ALLOC #ifdef CYGWIN_BUILD on_pool *on_pool::alloc_not_constructed = nullptr; #else thread_local on_pool *on_pool::alloc_not_constructed = nullptr; #endif #endif void *on_pool::alloc(size_t size, memory_pool *p) { #ifdef LIBDAR_SPECIAL_ALLOC pool_ptr *tmp = nullptr; size += sizeof(pool_ptr); if(p != nullptr) tmp = (pool_ptr *)p->alloc(size); else tmp = (pool_ptr *)(::new (nothrow) char[size]); if(tmp != nullptr) { tmp->reserve = p; ++tmp; } alloc_not_constructed = (on_pool *)tmp; return tmp; #else return ::new (nothrow) char[size]; #endif } void on_pool::dealloc(void *ptr) { #ifdef LIBDAR_SPECIAL_ALLOC if(ptr == nullptr) throw SRC_BUG; else { pool_ptr *tmp = ((pool_ptr *)ptr) - 1; if(tmp->reserve == nullptr) ::delete[] tmp; else tmp->reserve->release((void *)tmp); } #else ::delete[] (char *)(ptr); #endif } } // end of namespace dar-2.5.3/src/libdar/ea.hpp0000644000175000017430000000560712641772777012370 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file ea.hpp /// \brief contains a set of routines to manage EA values associated to a file /// \ingroup Private #ifndef EA_HPP #define EA_HPP #include "../my_config.h" #include #include #include "infinint.hpp" #include "generic_file.hpp" #include "mask.hpp" #include "header_version.hpp" #include "on_pool.hpp" namespace libdar { /// \ingroup Private /// @} /// the class ea_attributs manages the set of EA that can be associated to an inode class ea_attributs : public on_pool { public: ea_attributs() { alire = attr.begin(); }; ea_attributs(generic_file & f, const archive_version & edit); ea_attributs(const ea_attributs & ref); bool operator == (const ea_attributs & ref) const { return attr == ref.attr; }; void dump(generic_file & f) const; void add(const std::string & key, const std::string & value) { attr[key] = value; }; void reset_read() const; bool read(std::string & key, std::string & value) const; infinint size() const { return attr.size(); }; void clear() { attr.clear(); alire = attr.begin(); }; bool find(const std::string &key, std::string & found_value) const; bool diff(const ea_attributs & other, const mask & filter) const; infinint space_used() const; /// addition operator. /// \param[in] arg ea_attributs to add to self /// \return a ea_attributs object containing all EA of the current object enriched and possibly overwritten /// by those of "arg". /// \note this operator is not reflexive (or symetrical if you prefer) unlike it is in arithmetic. Here instead /// "a + b" is possibly not equal to "b + a" ea_attributs operator + (const ea_attributs & arg) const; private: std::map attr; std::map::iterator alire; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/tlv.hpp0000644000175000017430000000423312641773000012556 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file tlv.hpp /// \brief Generic Type Length Value data structures /// \ingroup Private #ifndef TLV_HPP #define TLV_HPP #include "memory_file.hpp" #include "storage.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ /// Type Length Value Structure /// /// this structure holds arbitrary type of data /// this is used in particular for the slice header /// \note a tlv is a memory_file, that way it holds the /// *V*alue and *L*ength of the data. Only the *T*ype field needs /// to be added to the memory_file datastructure class tlv : public memory_file { public: // constructors & Co. tlv() { type = 0; }; tlv(generic_file & f) { init(f); }; // methods (dump / setup tlv datastructure to/from file) void setup(generic_file & f); //< same as the constructor but on an existing object void dump(generic_file & f) const; //< dumps the tlv contents to file U_16 get_type() const { return type; }; //< get the TLV type void set_type(U_16 val) { type = val; }; //< set the TLV type private: U_16 type; void init(generic_file & f); }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/list_entry.cpp0000644000175000017430000000322412642474445014153 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "tools.hpp" #include "list_entry.hpp" using namespace std; namespace libdar { list_entry::list_entry() { my_name = ""; type = ' '; hard_link = false; uid = 0; gid = 0; perm = 0; data_status = s_saved; ea_status = cat_inode::ea_none; fsa_status = cat_inode::fsa_none; file_size = 0; storage_size = 0; sparse_file = 0; compression_algo = none; dirty = false; target = ""; major = 0; minor = 0; } time_t list_entry::datetime2time_t(const datetime & val) { time_t ret = 0; time_t unused; (void) val.get_value(ret, unused, datetime::tu_second); return ret; } } // end of namespace dar-2.5.3/src/libdar/cat_etoile.cpp0000644000175000017430000000402712641772777014101 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include #include "cat_etoile.hpp" #include "cat_directory.hpp" using namespace std; namespace libdar { cat_etoile::cat_etoile(cat_inode *host, const infinint & etiquette_number) { if(host == nullptr) throw SRC_BUG; if(dynamic_cast(host) != nullptr) throw Erange("cat_etoile::cat_etoile", gettext("Hard links of directories are not supported")); hosted = host; etiquette = etiquette_number; refs.clear(); } void cat_etoile::add_ref(void *ref) { if(find(refs.begin(), refs.end(), ref) != refs.end()) throw SRC_BUG; // this reference is already known refs.push_back(ref); } void cat_etoile::drop_ref(void *ref) { list::iterator it = find(refs.begin(), refs.end(), ref); if(it == refs.end()) throw SRC_BUG; // cannot drop a reference that does not exist refs.erase(it); if(refs.size() == 0) delete this; } } // end of namespace dar-2.5.3/src/libdar/path.cpp0000644000175000017430000001752712641772777012736 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif } #include #include "path.hpp" #include "tools.hpp" #include "nls_swap.hpp" using namespace std; namespace libdar { /// extract the first path member of a given path /// \param[in,out] p is the given path (in), it receive the new path without the first path member /// \param[out] root this argument receive the first path member extracted from argument 'p' /// \return false if given path is empty, true else. May throw exception in case of invalid path given static bool path_get_root(string & p, string & root); path::path(const string & chem, bool x_undisclosed) { NLS_SWAP_IN; try { string tmp; string s; undisclosed = x_undisclosed; try { dirs.clear(); if(chem.empty()) throw Erange("path::path", gettext("Empty string is not a valid path")); if(chem == "/") undisclosed = false; relative = (chem[0] != '/'); if(!relative) s = string(chem.begin()+1, chem.end()); // remove the leading '/' else s = chem; if(undisclosed) // if last char is '/' need to remove it { string::iterator last = tools_find_last_char_of(s, '/'); if(last + 1 == s.end()) // this is the last char of s s = string(s.begin(), last); } if(undisclosed) dirs.push_back(s); else while(path_get_root(s, tmp)) dirs.push_back(tmp); if(dirs.empty() && relative) throw Erange("path::path", gettext("Empty string is not a valid path")); if(!undisclosed) reduce(); reading = dirs.begin(); } catch(Erange & e) { string e_tmp = e.get_message(); throw Erange("path::path", tools_printf(gettext("%S is an not a valid path: %S"), &chem, &e_tmp)); } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } path::path(const path & ref) { dirs = ref.dirs; relative = ref.relative; undisclosed = ref.undisclosed; reading = dirs.begin(); } const path & path::operator = (const path & ref) { dirs = ref.dirs; relative = ref.relative; undisclosed = ref.undisclosed; reading = dirs.begin(); return *this; } bool path::operator == (const path & ref) const { string me = display(); string you = ref.display(); return me == you; } string path::basename() const { if(! dirs.empty()) return dirs.back(); else return "/"; } bool path::read_subdir(string & r) { if(reading != dirs.end()) { r = *reading; ++reading; return true; } else return false; } bool path::pop(string &arg) { if(relative) if(dirs.size() > 1) { arg = dirs.back(); dirs.pop_back(); return true; } else return false; else if(!dirs.empty()) { arg = dirs.back(); dirs.pop_back(); return true; } else return false; } bool path::pop_front(string & arg) { if(relative) if(dirs.size() > 1) { arg = dirs.front(); dirs.pop_front(); return true; } else return false; else if(!dirs.empty()) { relative = false; arg = "/"; return true; } else return false; } path & path::operator += (const path &arg) { if(!arg.relative) throw Erange("path::operator +", dar_gettext("Cannot add an absolute path")); list::const_iterator it = arg.dirs.begin(); list::const_iterator it_fin = arg.dirs.end(); while(it != it_fin) { if(*it != string(".")) dirs.push_back(*it); ++it; } if(arg.undisclosed) undisclosed = true; reduce(); return *this; } bool path::is_subdir_of(const path & p, bool case_sensit) const { string me; string you; if(!case_sensit) { // converting all string in upper case tools_to_upper(display(), me); tools_to_upper(p.display(), you); } else { me = display(); you = p.display(); } if(me.size() >= you.size()) if(strncmp(me.c_str(), you.c_str(), you.size()) == 0) if(me.size() > you.size()) return me[you.size()] == '/'; else return true; else // path differs in the common length part, cannot be a subdir of "you" return false; else // I am shorter in length, cannot be a subdir of "you" return false; } string path::display() const { string ret = relative ? "" : "/"; list::const_iterator it = dirs.begin(); if(it != dirs.end()) ret += *it++; while(it != dirs.end()) ret = ret + "/" + *it++; return ret; } void path::explode_undisclosed() const { path *me = const_cast(this); if(!undisclosed) return; try { string res = display(); path tmp = path(res, false); *me = tmp; } catch(...) { me->reading = me->dirs.begin(); } } void path::reduce() { dirs.remove("."); if(relative && dirs.empty()) dirs.push_back("."); else { list::iterator it = dirs.begin(); list::iterator prev = it; while(it != dirs.end()) { if(*it == ".." && *prev != "..") { list::iterator tmp = prev; it = dirs.erase(it); if(prev != dirs.begin()) { --prev; dirs.erase(tmp); } else { dirs.erase(prev); prev = dirs.begin(); } } else { prev = it; ++it; } } if(relative && dirs.empty()) dirs.push_back("."); } } static bool path_get_root(string & p, string & root) { string::iterator it = p.begin(); if(p.empty()) return false; while(it != p.end() && *it != '/' ) ++it; root = string(p.begin(), it); if(it != p.end()) p = string(it+1, p.end()); else p = ""; if(root.empty()) throw Erange("path_get_root", dar_gettext("Empty string as subdirectory does not make a valid path")); return true; } } // end of namespace dar-2.5.3/src/libdar/storage.cpp0000644000175000017430000005267112641773000013421 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } // end of extern "C" #include "storage.hpp" #include "infinint.hpp" #include "generic_file.hpp" #include "integers.hpp" using namespace std; namespace libdar { storage::storage(const infinint & size) { make_alloc(size, first, last); } storage::storage(generic_file & f, const infinint & size) { U_32 lu, tmp; make_alloc(size, first, last); struct cellule *ptr = first; try { while(ptr != nullptr) { lu = 0; do { tmp = f.read(((char *)(ptr->data))+lu, ptr->size - lu); lu += tmp; } while(lu < ptr->size && tmp != 0); if(lu < ptr->size) throw Erange("storage::storage", gettext("Not enough data to initialize storage field")); ptr = ptr->next; } } catch(...) { detruit(first); first = nullptr; last = nullptr; throw; } } unsigned char storage::operator [](const infinint &position) const { return const_cast(*this)[position]; } unsigned char & storage::operator [](infinint position) { U_32 offset = 0; struct cellule *ptr = first; do { if(ptr == nullptr) throw Erange("storage::operator[]", gettext("Asking for an element out of array")); if(offset > ptr->size) { offset -= ptr->size; ptr = ptr->next; } else position.unstack(offset); } while(offset > ptr->size); return ptr->data[offset]; } infinint storage::size() const { infinint ret = 0; struct cellule *ptr = first; while(ptr != nullptr) { ret += ptr->size; ptr = ptr->next; } return ret; } void storage::clear(unsigned char val) { struct cellule *cur = first; while(cur != nullptr) { (void)memset(cur->data, val, cur->size); cur = cur->next; } } void storage::dump(generic_file & f) const { const struct cellule *ptr = first; while(ptr != nullptr) { f.write((const char *)(ptr->data), ptr->size); ptr = ptr->next; } } U_I storage::write(iterator & it, unsigned char *a, U_I size) { if(it.ref != this) throw Erange("storage::write", gettext("The iterator is not indexing the object it has been asked to write to")); U_I wrote = 0; while(wrote < size && it != end()) { U_32 to_write = size - wrote; U_32 space = it.cell->size - it.offset; if(to_write <= space) { // enough room in current data block (void)memcpy(it.cell->data + it.offset, a + wrote, to_write); wrote += to_write; it.offset += to_write; } else { // more to copy than available in current data block (void)memcpy(it.cell->data + it.offset, a + wrote, space); wrote += space; it.cell = it.cell->next; if(it.cell != nullptr) it.offset = 0; else it.offset = iterator::OFF_END; } } return wrote; } U_I storage::read(iterator & it, unsigned char *a, U_I size) const { if(it.ref != this) throw Erange("storage::read", gettext("The iterator is not indexing the object it has been asked to read from")); U_I read = 0; while(read < size && it != end()) { U_32 to_read = size - read; U_32 space = it.cell->size - it.offset; if(to_read <= space) { // enough room in current data block (void)memcpy(a + read, it.cell->data + it.offset, to_read); read += to_read; it.offset += to_read; } else { // more to copy than available in current data block (void)memcpy(a + read, it.cell->data + it.offset, space); read += space; it.cell = it.cell->next; if(it.cell != nullptr) it.offset = 0; else it.offset = iterator::OFF_END; } } return read; } void storage::insert_null_bytes_at_iterator(iterator it, U_I size) { unsigned char a = 0; insert_bytes_at_iterator_cmn(it, true, &a, size); } void storage::insert_const_bytes_at_iterator(iterator it, unsigned char a, U_I size) { insert_bytes_at_iterator_cmn(it, true, &a, size); } void storage::insert_bytes_at_iterator(iterator it, unsigned char *a, U_I size) { insert_bytes_at_iterator_cmn(it, false, a, size); } void storage::insert_as_much_as_necessary_const_byte_to_be_as_wider_as(const storage & ref, const iterator &it, unsigned char value) { S_32 to_add = 0; const cellule *c_ref = ref.first; cellule *c_me = first; while((c_ref != nullptr || to_add > 0) && (c_me != nullptr || to_add <= 0)) { if(to_add > 0) { to_add -= c_me->size; c_me = c_me->next; } else { to_add += c_ref->size; c_ref = c_ref->next; } } while(to_add > 0) { insert_const_bytes_at_iterator(it, value, to_add); if(c_ref != nullptr) { to_add = c_ref->size; c_ref = c_ref->next; } else to_add = 0; } } void storage::remove_bytes_at_iterator(iterator it, U_I number) { while(number > 0 && it.cell != nullptr) { U_I can_rem = it.cell->size - it.offset; if(can_rem < number) { if(it.offset > 0) { unsigned char *p = nullptr; meta_new(p, it.offset); if(p != nullptr) { (void)memcpy(p, it.cell->data, it.offset); meta_delete(it.cell->data); it.cell->data = p; it.cell->size -= can_rem; it.cell = it.cell->next; it.offset = 0; number -= can_rem; } else throw Ememory("storage::remove_bytes_at_iterator"); } else { struct cellule *t = it.cell->next; if(t != nullptr) it.cell->next->prev = it.cell->prev; else last = it.cell->prev; if(it.cell->prev != nullptr) it.cell->prev->next = t; else first = t; number -= it.cell->size; it.cell->next = nullptr; it.cell->prev = nullptr; detruit(it.cell); it.cell = t; } } else // can_rem >= number { unsigned char *p = nullptr; meta_new(p, it.cell->size - number); if(p != nullptr) { (void)memcpy(p, it.cell->data, it.offset); (void)memcpy(p + it.offset, it.cell->data + it.offset + number, it.cell->size - it.offset - number); meta_delete(it.cell->data); it.cell->data = p; it.cell->size -= number; number = 0; } else throw Ememory("storage::remove_bytes_at_iterator"); } } reduce(); } void storage::remove_bytes_at_iterator(iterator it, infinint number) { U_32 sz = 0; number.unstack(sz); while(sz > 0) { remove_bytes_at_iterator(it, sz); sz = 0; number.unstack(sz); } } void storage::fusionne(struct cellule *a_first, struct cellule *a_last, struct cellule *b_first, struct cellule *b_last, struct cellule *&res_first, struct cellule * & res_last) { if((a_first == nullptr) ^ (a_last == nullptr)) throw SRC_BUG; if((b_first == nullptr) ^ (b_last == nullptr)) throw SRC_BUG; if(a_last != nullptr && b_first != nullptr) { a_last->next = b_first; b_first->prev = a_last; res_first = a_first; res_last = b_last; } else if(a_first == nullptr) { res_first = b_first; res_last = b_last; } else { res_first = a_first; res_last = a_last; } } void storage::copy_from(const storage & ref) { U_32 pas = 0, delta; struct cellule *ptr = ref.first; first = last = nullptr; try { while(ptr != nullptr || pas > 0) { if(ptr != nullptr) { delta = pas + ptr->size; ptr = ptr->next; } else delta = 0; if(delta < pas) // must make the allocation { struct cellule *debut, *fin; make_alloc(pas, debut, fin); fusionne(first, last, debut, fin, first, last); pas = delta; } else pas = delta; } } catch(Ememory & e) { detruit(first); first = last = nullptr; throw; } iterator i_ref = ref.begin(); iterator i_new = begin(); while(i_ref != ref.end()) { *i_new = *i_ref; ++i_new; ++i_ref; } } S_32 storage::difference(const storage & ref) const { struct cellule *b = last, *a = ref.last; S_32 superior = 0; while((a != nullptr || superior <= 0) && (b != nullptr || superior >= 0) && (a != nullptr || b != nullptr)) { if(superior >= 0 && a != nullptr) { superior -= a->size; a = a->next; } if(superior <= 0 && b != nullptr) { superior += b->size; b = b->next; } } return superior; } void storage::reduce() { struct cellule *glisseur = first; U_32 failed_alloc = ~0; while(glisseur != nullptr) { if(glisseur->next != nullptr) { U_I somme = glisseur->next->size + glisseur->size; if(somme < failed_alloc) { unsigned char *p = nullptr; meta_new(p, somme); if(p != nullptr) { struct cellule *tmp = glisseur->next; (void)memcpy(p, glisseur->data, glisseur->size); (void)memcpy(p + glisseur->size, tmp->data, somme - glisseur->size); meta_delete(glisseur->data); glisseur->data = p; glisseur->size = somme; glisseur->next = tmp->next; if(glisseur->next != nullptr) glisseur->next->prev = glisseur; else last = glisseur; tmp->next = tmp->prev = nullptr; detruit(tmp); } else // alloc failed { failed_alloc = somme; glisseur = glisseur->next; } } else // no fusion possible glisseur = glisseur->next; } else // no next cellule glisseur = glisseur->next; } } void storage::insert_bytes_at_iterator_cmn(iterator it, bool constant, unsigned char *a, U_I size) { if(it.ref != this) throw Erange("storage::insert_bytes_at_iterator_cmn", gettext("The iterator is not indexing the object it has been defined for")); if(it.cell != nullptr) { storage temp = size+it.cell->size; struct cellule *before, *after; iterator gliss = temp.begin(); if(constant) temp.clear(*a); temp.write(gliss, it.cell->data, it.offset); if(!constant) temp.write(gliss, a, size); else gliss += size; temp.write(gliss, it.cell->data+it.offset, it.cell->size-it.offset); if(temp.first == nullptr || temp.last == nullptr) throw SRC_BUG; // now we move the chain of cellule from the temp object into the current object (this) // first we release the cellule that has been copied to "temp" object before = it.cell->prev; after = it.cell->next; it.cell->prev = nullptr; it.cell->next = nullptr; detruit(it.cell); it.cell = nullptr; if(before != nullptr) before->next = temp.first; else first = temp.first; temp.first->prev = before; if(after != nullptr) after->prev = temp.last; else last = temp.last; temp.last->next = after; temp.first = temp.last = nullptr; // this way when "temp" object will be destroyed // it will not affect the chain of cells which is now // part of "this" (current object). } else // it_cell == nullptr { storage temp = size; if(constant) temp.clear(*a); else { iterator ut = temp.begin(); temp.write(ut, a,size); } switch(it.offset) { case iterator::OFF_END : if(last != nullptr) last->next = temp.first; else first = temp.first; if(temp.first == nullptr) throw SRC_BUG; temp.first->prev = last; last = temp.last; break; case iterator::OFF_BEGIN : if(first != nullptr) first->prev = temp.last; else last = temp.last; if(temp.last == nullptr) throw SRC_BUG; temp.last->next = first; first = temp.first; break; default: throw SRC_BUG; } temp.last = temp.first = nullptr; } reduce(); } void storage::detruit(struct cellule *c) { struct cellule *t; while(c != nullptr) { if(c->size == 0 && c->data != nullptr) throw SRC_BUG; if(c->data != nullptr) { meta_delete(c->data); c->data = nullptr; } t = c->next; meta_delete(c); c = t; } } void storage::make_alloc(U_32 size, struct cellule * & begin, struct cellule * & end) { struct cellule *newone; struct cellule *previous = nullptr; U_32 dsize = size; begin = end = nullptr; if(size > 0) { do { meta_new(newone, 1); if(newone != nullptr) { newone->prev = previous; newone->next = nullptr; if(previous != nullptr) previous->next = newone; else begin = newone; } else { detruit(begin); begin = nullptr; throw Ememory("storage::make_alloc"); } do { meta_new(newone->data, dsize); if(newone->data != nullptr) { size -= dsize; newone->size = dsize; previous = newone; } else if(dsize > 2) dsize /= 2; else { newone->size = 0; detruit(begin); begin = nullptr; throw Ememory("storage::make_alloc"); } } while(dsize > 1 && newone->data == nullptr); } while (size > 0); end = newone; } } void storage::make_alloc(infinint size, struct cellule * & begin, struct cellule * &end) { struct cellule *debut; struct cellule *fin; U_32 sz = 0; begin = end = nullptr; if(!size.is_zero()) { size.unstack(sz); do { try { make_alloc(sz, debut, fin); if(end != nullptr) { end->next = debut; debut->prev = end; end = fin; } else if(begin != nullptr) throw SRC_BUG; else { begin = debut; end = fin; } } catch(Ememory & e) { if(begin != nullptr) { detruit(begin); begin = nullptr; end = nullptr; } throw; } sz = 0; size.unstack(sz); } while(sz > 0); } } /////////////////////////////////////////////////////////// //////////////////////// ITERATOR ///////////////////////// /////////////////////////////////////////////////////////// storage::iterator & storage::iterator::operator += (U_32 s) { S_32 t = s >> 1; S_32 r = s & 0x1; relative_skip_to(t); relative_skip_to(t+r); return *this; } storage::iterator & storage::iterator::operator -= (U_32 s) { static const U_32 max = (U_32)(~0) >> 1; // maximum U_32 that can also be S_32 if(s > max) { S_32 t = s >> 1; // equivalent to s/2; S_32 r = s & 0x01; // equivalent to s%2; relative_skip_to(-t); relative_skip_to(-t); relative_skip_to(-r); } else relative_skip_to(-(S_32)(s)); return *this; } unsigned char & storage::iterator::operator *() const { if(points_on_data()) return cell->data[offset]; else throw Erange("storage::iterator::operator *()", gettext("Iterator does not point to data")); } void storage::iterator::skip_to(const storage & st, infinint val) { U_16 pas = 0; // relative_skip_to has S_32 as argument, cannot call it with U_32 *this = st.begin(); val.unstack(pas); do { relative_skip_to(pas); pas = 0; val.unstack(pas); } while(pas > 0); } void storage::iterator::relative_skip_to(S_32 val) { if(val >= 0) { while(val > 0 && cell != nullptr) { if(offset + val >= cell->size) { val -= cell->size - offset; cell = cell->next; offset = 0; } else { offset += val; val = 0; } } if(cell == nullptr) offset = OFF_END; } else while(val < 0 && cell != nullptr) { val += offset; if(val < 0) { cell = cell->prev; if(cell != nullptr) offset = cell->size; else offset = OFF_BEGIN; } else offset = val; } } infinint storage::iterator::get_position() const { if(ref == nullptr || ref->first == nullptr) throw Erange("storage::iterator::get_position", gettext("Reference storage of the iterator is empty or non existent")); struct cellule *p = ref->first; infinint ret = 0; if(cell == nullptr) throw Erange("storage::iterator::get_position", gettext("Iterator does not point to data")); while(p != nullptr && p != cell) { ret += p->size; p = p->next; } if(p != nullptr) ret += offset; else throw Erange("storage::iterator::get_position", gettext("The iterator position is not inside the storage of reference")); return ret; } } // end of namespace dar-2.5.3/src/libdar/limitint.hpp0000644000175000017430000005425412641772777013636 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file limitint.hpp /// \brief the reviewed implementation of infinint based on system limited integers /// \ingroup Private /// /// the limitint template class implementation defined in this module can /// handle positive integers and detect overflow. It shares with infinint the same /// interface, so it can be use in place of it, but throw Elimitint exceptions if /// overflow is detected. #ifndef LIMITINT_HPP #define LIMITINT_HPP #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif } // end extern "C" #include #include "integers.hpp" #include "erreurs.hpp" #include "int_tools.hpp" #include "on_pool.hpp" #define ZEROED_SIZE 50 namespace libdar { /// \addtogroup Private /// @{ class generic_file; class user_interaction; /// limitint template class /// \ingroup Private /// /// the limitint template class implementation can /// handle positive integers and detect overflow. It shares with infinint the same /// interface, so it can be use in place of it, but throw Elimitint exceptions if /// overflow is detected. /// this template class receive as argument a positive integer atomic type /// In particular it is assumed that the sizeof() operator gives the amount of /// byte of information that this type can handle, and it is also assumed that /// the bytes of information are contiguous. template class limitint : public on_pool { public : #if SIZEOF_OFF_T > SIZEOF_TIME_T #if SIZEOF_OFF_T > SIZEOF_SIZE_T limitint(off_t a = 0) { limitint_from(a); }; #else limitint(size_t a = 0) { limitint_from(a); }; #endif #else #if SIZEOF_TIME_T > SIZEOF_SIZE_T limitint(time_t a = 0) { limitint_from(a); }; #else limitint(size_t a = 0) { limitint_from(a); }; #endif #endif // read an limitint from a file limitint(generic_file & x); // for coherent footprint with real infinint ~limitint() throw(Ebug) {}; void dump(generic_file &x) const; // write byte sequence to file void read(generic_file &f) { build_from_file(f); }; limitint & operator += (const limitint & ref); limitint & operator -= (const limitint & ref); limitint & operator *= (const limitint & ref); template limitint power(const T & exponent) const; limitint & operator /= (const limitint & ref); limitint & operator %= (const limitint & ref); limitint & operator &= (const limitint & ref); limitint & operator |= (const limitint & ref); limitint & operator ^= (const limitint & ref); limitint & operator >>= (U_32 bit); limitint & operator >>= (limitint bit); limitint & operator <<= (U_32 bit); limitint & operator <<= (limitint bit); limitint operator ++(int a) { limitint ret = *this; ++(*this); return ret; }; limitint operator --(int a) { limitint ret = *this; --(*this); return ret; }; limitint & operator ++() { return *this += 1; }; limitint & operator --() { return *this -= 1; }; U_32 operator % (U_32 arg) const; // increment the argument up to a legal value for its storage type and decrement the object in consequence // note that the initial value of the argument is not ignored ! // when the object is null the value of the argument stays the same as before template void unstack(T &v) { limitint_unstack_to(v); } limitint get_storage_size() const; // it returns number of byte of information necessary to store the integer unsigned char operator [] (const limitint & position) const; // return in little endian order the information bytes storing the integer bool is_zero() const { return field == 0; }; bool operator < (const limitint &x) const { return field < x.field; }; bool operator == (const limitint &x) const { return field == x.field; }; bool operator > (const limitint &x) const { return field > x.field; }; bool operator <= (const limitint &x) const { return field <= x.field; }; bool operator != (const limitint &x) const { return field != x.field; }; bool operator >= (const limitint &x) const { return field >= x.field; }; static bool is_system_big_endian(); B debug_get_max() const { return max_value; }; B debug_get_bytesize() const { return bytesize; }; B debug_get_field() const { return field; }; private : static const int TG = 4; static const U_32 sizeof_field = sizeof(B); // number of bytes enum endian { big_endian, little_endian, not_initialized }; typedef unsigned char group[TG]; B field; void build_from_file(generic_file & x); template void limitint_from(T a); template T max_val_of(T x); template void limitint_unstack_to(T &a); ///////////////////////// // static statments // static endian used_endian; static const U_I bytesize = sizeof(B); static const B max_value = ~B(0) > 0 ? ~B(0) : ~(B(1) << (bytesize*8 - 1)); static U_8 zeroed_field[ZEROED_SIZE]; static void setup_endian(); }; template U_8 limitint::zeroed_field[ZEROED_SIZE]; template limitint operator + (const limitint &, const limitint &); template inline limitint operator + (const limitint & a, U_I b) { return a + limitint(b); } template limitint operator - (const limitint &, const limitint &); template inline limitint operator - (const limitint & a, U_I b) { return a - limitint(b); } template limitint operator * (const limitint &, const limitint &); template inline limitint operator * (const limitint & a, U_I b) { return a * limitint(b); } template limitint operator / (const limitint &, const limitint &); template limitint operator / (const limitint & a, U_I b) { return a / limitint(b); } template limitint operator % (const limitint &, const limitint &); template limitint operator >> (const limitint & a, U_32 bit); template limitint operator >> (const limitint & a, const limitint & bit); template limitint operator << (const limitint & a, U_32 bit); template limitint operator << (const limitint & a, const limitint & bit); template limitint operator & (const limitint & a, U_32 bit); template limitint operator & (const limitint & a, const limitint & bit); template limitint operator | (const limitint & a, U_32 bit); template limitint operator | (const limitint & a, const limitint & bit); template limitint operator ^ (const limitint & a, U_32 bit); template limitint operator ^ (const limitint & a, const limitint & bit); template inline void euclide(T a, T b, T & q, T &r) { q = a/b; r = a%b; } template inline void euclide(limitint a, U_I b, limitint & q, limitint &r) { euclide(a, limitint(b), q, r); } #ifndef INFININT_BASE_TYPE #error INFININT_BASE_TYPE not defined cannot instantiate template #else typedef limitint infinint; #endif } // end of namespace /////////////////////////////////////////////////////////////////////// ///////// template implementation //////////////////////////////////// /////////////////////////////////////////////////////////////////////// #include "generic_file.hpp" #include "user_interaction.hpp" namespace libdar { template typename limitint::endian limitint::used_endian = not_initialized; template limitint::limitint(generic_file & x) { build_from_file(x); } template void limitint::build_from_file(generic_file & x) { unsigned char a; bool fin = false; limitint skip = 0; char *ptr = (char *)&field; S_I lu; int_tools_bitfield bf; while(!fin) { lu = x.read((char *)&a, 1); if(lu <= 0) throw Erange("limitint::build_from_file(generic_file)", gettext("Reached end of file before all data could be read")); if(a == 0) ++skip; else // end of size field { // computing the size to read U_I pos = 0; int_tools_expand_byte(a, bf); for(S_I i = 0; i < 8; ++i) pos += bf[i]; if(pos != 1) throw Erange("limitint::build_from_file(generic_file)", gettext("Badly formed \"infinint\" or not supported format")); // more than 1 bit is set to 1 pos = 0; while(bf[pos] == 0) ++pos; pos += 1; // bf starts at zero, but bit zero means 1 TG of length skip *= 8; skip += pos; skip *= TG; if(skip.field > bytesize) throw Elimitint(); field = 0; // important to also clear "unread" bytes by this call lu = x.read(ptr, skip.field); if(used_endian == not_initialized) setup_endian(); if(used_endian == little_endian) int_tools_swap_bytes((unsigned char *)ptr, skip.field); else field >>= (bytesize - skip.field)*8; fin = true; } } } template void limitint::dump(generic_file & x) const { B width = bytesize; B pos; unsigned char last_width; B justification; S_I direction = +1; unsigned char *ptr, *fin; if(used_endian == not_initialized) setup_endian(); if(used_endian == little_endian) { direction = -1; ptr = (unsigned char *)(&field) + (bytesize - 1); fin = (unsigned char *)(&field) - 1; } else { direction = +1; ptr = (unsigned char *)(&field); fin = (unsigned char *)(&field) + bytesize; } while(ptr != fin && *ptr == 0) { ptr += direction; --width; } if(width == 0) width = 1; // minimum size of information is 1 byte // "width" is the informational field size in byte // TG is the width in TG, thus the number of bit that must have // the preamble euclide(width, (const B)(TG), width, justification); if(justification != 0) // in case we need to add some bytes to have a width multiple of TG ++width; // we need then one more group to have a width multiple of TG euclide(width, (const B)(8), width, pos); if(pos == 0) { width--; // division is exact, only last bit of the preambule is set last_width = 0x80 >> 7; // as we add the last byte separately width gets shorter by 1 byte } else // division non exact, the last_width (last byte), make the rounding { U_16 pos_s = (U_16)(0xFFFF & pos); last_width = 0x80 >> (pos_s - 1); } // now we write the preamble except the last byte. All these are zeros. while(width != 0) if(width > ZEROED_SIZE) { x.write((char *)zeroed_field, ZEROED_SIZE); width -= ZEROED_SIZE; } else { x.write((char *)zeroed_field, width); width = 0; } // now we write the last byte of the preambule, which as only one bit set x.write((char *)&last_width, 1); // we need now to write some justification byte to have an informational field multiple of TG if(justification != 0) { justification = TG - justification; if(justification > ZEROED_SIZE) throw SRC_BUG; else x.write((char *)zeroed_field, justification); } // now we continue dumping the informational bytes: if(ptr == fin) // field is equal to zero x.write((char *)zeroed_field, 1); else // we have some bytes to write down while(ptr != fin) { x.write((char *)ptr, 1); ptr += direction; } } template limitint & limitint::operator += (const limitint & arg) { B res = field + arg.field; if(res < field || res < arg.field) throw Elimitint(); else field = res; return *this; } template limitint & limitint::operator -= (const limitint & arg) { if(field < arg.field) throw Erange("limitint::operator", gettext("Subtracting an \"infinint\" greater than the first, \"infinint\" cannot be negative")); // now processing the operation field -= arg.field; return *this; } template limitint & limitint::operator *= (const limitint & arg) { static const B max_power = bytesize*8 - 1; B total = int_tools_higher_power_of_2(field) + int_tools_higher_power_of_2(arg.field) + 1; // for an explaination about "+2" see NOTES if(total > max_power) // this is a bit too much restrictive, but unless remaking bit by bit, the operation, // I don't see how to simply (and fast) know the result has not overflowed. // of course, it would be fast and easy to access the CPU flag register to check for overflow, // but that would not be portable, and unfortunately I haven't found any standart C++ expression that // could transparently access to it. throw Elimitint(); total = field*arg.field; if(field != 0 && arg.field != 0) if(total < field || total < arg.field) throw Elimitint(); field = total; return *this; } template template limitint limitint::power(const T & exponent) const { limitint ret = 1; for(T count = 0; count < exponent; ++count) ret *= *this; return ret; } template limitint & limitint::operator /= (const limitint & arg) { if(arg == 0) throw Einfinint("limitint.cpp : operator /=", gettext("Division by zero")); field /= arg.field; return *this; } template limitint & limitint::operator %= (const limitint & arg) { if(arg == 0) throw Einfinint("limitint.cpp : operator %=", gettext("Division by zero")); field %= arg.field; return *this; } template limitint & limitint::operator >>= (U_32 bit) { if(bit >= sizeof_field*8) field = 0; else field >>= bit; return *this; } template limitint & limitint::operator >>= (limitint bit) { field >>= bit.field; return *this; } template limitint & limitint::operator <<= (U_32 bit) { if(bit + int_tools_higher_power_of_2(field) >= bytesize*8) throw Elimitint(); field <<= bit; return *this; } template limitint & limitint::operator <<= (limitint bit) { if(bit.field + int_tools_higher_power_of_2(field) >= bytesize*8) throw Elimitint(); field <<= bit.field; return *this; } template limitint & limitint::operator &= (const limitint & arg) { field &= arg.field; return *this; } template limitint & limitint::operator |= (const limitint & arg) { field |= arg.field; return *this; } template limitint & limitint::operator ^= (const limitint & arg) { field ^= arg.field; return *this; } template U_32 limitint::operator % (U_32 arg) const { return U_32(field % arg); } template template void limitint::limitint_from(T a) { if(sizeof(a) <= bytesize || a <= (T)(max_value)) field = B(a); else throw Elimitint(); } template template T limitint::max_val_of(T x) { x = 0; x = ~x; if(x < 1) // T is a signed integer type, we are not comparing to zero to avoid compiler warning when the template is used against unsigned integers { x = 1; x = int_tools_rotate_right_one_bit(x); x = ~x; } return x; } template template void limitint::limitint_unstack_to(T &a) { // T is supposed to be an unsigned "integer" // (ie.: sizeof returns the width of the storage bit field and no sign bit is present) // Note : static here avoids the recalculation of max_T at each call static const T max_T = max_val_of(a); T step = max_T - a; if(field < (B)(step) && (T)(field) < step) { a += field; field = 0; } else { field -= step; a = max_T; } } template limitint limitint::get_storage_size() const { B tmp = field; B ret = 0; while(tmp != 0) { tmp >>= 8; ret++; } return limitint(ret); } template unsigned char limitint::operator [] (const limitint & position) const { B tmp = field; B index = position.field; // C++ has only class protection, not object protection while(index > 0) { tmp >>= 8; index--; } return (unsigned char)(tmp & 0xFF); } template void limitint::setup_endian() { if(integers_system_is_big_endian()) used_endian = big_endian; else used_endian = little_endian; (void)memset(zeroed_field, 0, ZEROED_SIZE); } template bool limitint::is_system_big_endian() { if(used_endian == not_initialized) setup_endian(); switch(used_endian) { case big_endian: return true; case little_endian: return false; case not_initialized: throw SRC_BUG; default: throw SRC_BUG; } } /////////////////////////////////////////////////////////////////////// ///////////////// friends and not friends of limitint ///////////////// /////////////////////////////////////////////////////////////////////// template limitint operator + (const limitint & a, const limitint & b) { limitint ret = a; ret += b; return ret; } template limitint operator - (const limitint & a, const limitint & b) { limitint ret = a; ret -= b; return ret; } template limitint operator * (const limitint & a, const limitint & b) { limitint ret = a; ret *= b; return ret; } template limitint operator / (const limitint & a, const limitint & b) { limitint ret = a; ret /= b; return ret; } template limitint operator % (const limitint & a, const limitint & b) { limitint ret = a; ret %= b; return ret; } template limitint operator >> (const limitint & a, U_32 bit) { limitint ret = a; ret >>= bit; return ret; } template limitint operator >> (const limitint & a, const limitint & bit) { limitint ret = a; ret >>= bit; return ret; } template limitint operator << (const limitint & a, U_32 bit) { limitint ret = a; ret <<= bit; return ret; } template limitint operator << (const limitint & a, const limitint & bit) { limitint ret = a; ret <<= bit; return ret; } template limitint operator & (const limitint & a, U_32 bit) { limitint ret = a; ret &= bit; return ret; } template limitint operator & (const limitint & a, const limitint & bit) { limitint ret = a; ret &= bit; return ret; } template limitint operator | (const limitint & a, U_32 bit) { limitint ret = a; ret |= bit; return ret; } template limitint operator | (const limitint & a, const limitint & bit) { limitint ret = a; ret |= bit; return ret; } template limitint operator ^ (const limitint & a, U_32 bit) { limitint ret = a; ret ^= bit; return ret; } template limitint operator ^ (const limitint & a, const limitint & bit) { limitint ret = a; ret ^= bit; return ret; } /// @} } // end of namespace #endif dar-2.5.3/src/libdar/cat_prise.hpp0000644000175000017430000000477512642457363013751 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_prise.hpp /// \brief class to record filesystem (UNIX) sockets in a catalogue /// \ingroup Private #ifndef CAT_PRISE_HPP #define CAT_PRISE_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_inode.hpp" #include "cat_tools.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the Unix socket inode class class cat_prise : public cat_inode { public : cat_prise(const infinint & xuid, const infinint & xgid, U_16 xperm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & xname, const infinint & fs_device): cat_inode(xuid, xgid, xperm, last_access, last_modif, last_change, xname, fs_device) { set_saved_status(s_saved); }; cat_prise(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small): cat_inode(dialog, pdesc, reading_ver, saved, small) {}; bool operator == (const cat_entree & ref) const; // using dump from cat_inode class // using method is_more_recent_than() from cat_inode class // using method has_changed_since() from cat_inode class /// inherited from cat_entree unsigned char signature() const { return mk_signature('s', get_saved_status()); }; /// inherited from cat_entree cat_entree *clone() const { return new (get_pool()) cat_prise(*this); }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/memory_file.hpp0000644000175000017430000000460412641772777014306 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file memory_file.hpp /// \brief Memory_file is a generic_file class that only uses virtual memory /// \ingroup Private #ifndef MEMORY_FILE_HPP #define MEMORY_FILE_HPP #include "generic_file.hpp" #include "storage.hpp" namespace libdar { /// \addtogroup Private /// @{ class memory_file : public generic_file { public: /// Constructors & Destructor memory_file() : generic_file(gf_read_write), data(0) { position = 0; }; // memory_storage specific methods void reset() { if(is_terminated()) throw SRC_BUG; position = 0; data = storage(0); }; infinint size() const { return data.size(); }; // virtual method inherited from generic_file bool skippable(skippability direction, const infinint & amount) { return true; }; bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const { if(is_terminated()) throw SRC_BUG; return position; }; protected: // virtual method inherited from generic_file void inherited_read_ahead(const infinint & amount) {}; // no optimization can be done here, we rely on the OS here U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, U_I size); void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate() {}; private: storage data; infinint position; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/trontextual.cpp0000644000175000017430000000333512641773000014337 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "trontextual.hpp" namespace libdar { trontextual::trontextual(generic_file *f, const infinint & offset, const infinint & size, bool own_f) : tronc(f, offset, size, own_f) { init(f); } trontextual::trontextual(generic_file *f, const infinint & offset, const infinint & size, gf_mode mode, bool own_f) : tronc(f, offset, size, mode, own_f) { init(f); } void trontextual::init(generic_file *f) { ref = dynamic_cast(f); if(ref == nullptr) throw Erange("trontextual::trontextual", "Trontextual must receive a class contextual aware generic file as argument"); } } // end of namespace dar-2.5.3/src/libdar/datetime.hpp0000644000175000017430000001567612641772777013606 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file datetime.hpp /// \brief this file contains the definition of class datetime that stores unix times in a portable way /// \ingroup Private #ifndef DATETIME_HPP #define DATETIME_HPP extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_UTIME_H #include #endif #if HAVE_SYS_TIME_H #include #endif } // end extern "C" #include "../my_config.h" #include "on_pool.hpp" #include "infinint.hpp" #include "archive_version.hpp" namespace libdar { class archive; // needed to be able to use pointer on archive object. /// \addtogroup Private /// @{ class datetime : public on_pool { public: // time units must be sorted: the first is the smallest step, last is the largest increment. // this makes the comparison operators (<, >, <=, >=,...) become naturally defined on that type enum time_unit { tu_nanosecond, tu_microsecond, tu_second }; /// constructor based on the number of second ellasped since the end of 1969 datetime(const infinint & value = 0) { sec = value; frac = 0; uni = tu_second; }; /// general constructor /// /// \param[in] sec the number of second since the dawn of computer time (1970) /// \param[in] subsec the fraction of the time below 1 second expressed in the time unit given as next argument /// \param[in] the time unit in which is expressed the previous argument datetime(time_t second, time_t subsec, time_unit unit) { sec = second; frac = subsec; uni = unit; if(uni == tu_second && subsec != 0) throw SRC_BUG; }; /// constructor reading data dump() into a generic_file datetime(generic_file &x, archive_version ver) { read(x, ver); }; // comparison operators bool operator < (const datetime & ref) const; bool operator == (const datetime & ref) const; bool operator != (const datetime & ref) const { return ! (*this == ref); }; bool operator >= (const datetime & ref) const { return ! (*this < ref); }; bool operator > (const datetime & ref) const { return ref < *this; }; bool operator <= (const datetime & ref) const { return ref >= *this; }; // arithmetic on time datetime operator - (const datetime & ref) const; datetime operator + (const datetime & ref) const; /// at the difference of operator - provides the difference using the less precise unit used between the two elements datetime loose_diff(const datetime & ref) const; /// return the integer number of second infinint get_second_value() const { return sec; }; /// return the subsecond time fraction expressed in the given time unit infinint get_subsecond_value(time_unit unit) const; /// returns the time unit used internally to store the subsecond time fraction time_unit get_unit() const { return uni; }; /// return a time as time_t arguments /// /// \param[out] second the time value in second /// \param[out] subsecond is the remaining time fraction as expressed in the unit given as next argument /// \param[in] unit the unit of the subsecond fraction of the timestamp /// \return true upon success, false if the value cannot be represented by system types (overflow) bool get_value(time_t & second, time_t & subsecond, time_unit unit) const; /// write down this to file void dump(generic_file &x) const; /// read this from file void read(generic_file &f, archive_version ver); /// return true if the datetime is exactly January 1st, 1970, 0 h 0 mn 0 s bool is_null() const { return sec.is_zero() && frac.is_zero(); }; /// return true if the datetime is an integer number of second (subsecond part is zero) bool is_integer_second() const { return frac.is_zero(); }; /// return the storage it would require to dump this object infinint get_storage_size() const { return sec.get_storage_size() + frac.get_storage_size() + 1; }; private: // the date must not be stored as a single integer // to avoid reducing the possible addressable dates // when compiling using 32 or 64 bits integer in place // of infinint. The fraction cannot handle smaller unit // than nanosecond if using 32 bits integer. infinint sec; //< the date as number of second ellapsed since 1969 infinint frac; //< the fraction of the date expressed in the unit defined by the "uni" field time_unit uni; //< the time unit used to store the subsecond fraction of the timestamp. /// reduce the value to the largest unit possible void reduce_to_largest_unit() const; /// tells wether the time can be fully specified in the given time unit /// /// \param[in] target time unit to get the subsecond time fraction in /// \param[out] newval value of the subsecond time fracion in the target unit /// \return true if the time is an integer number of the target time unit, /// newval is then the exact subsecond time fraction expressed in that unit. Else, false /// is returned and newval is rounded down time value to the integer /// value just below, what is the correct subsecond time fraction expressed in the target unit bool is_subsecond_an_integer_value_of(time_unit target, infinint & newval) const; static time_unit min(time_unit a, time_unit b); static time_unit max(time_unit a, time_unit b); static const char time_unit_to_char(time_unit a); static time_unit char_to_time_unit(const char a); /// return the factor between two units /// /// \note "from" must be larger than "to" (from >= to), else an exception is thrown /// \return the factor f, which makes the following to be true: from = f*to static const infinint & get_scaling_factor(time_unit source, time_unit dest); /// return the max subsecond value that makes exactly one second for the given unit static infinint how_much_to_make_1_second(time_unit unit); }; /// converts dar_manager database version to dar archive version in order to properly read time fields extern archive_version db2archive_version(unsigned char db_version); /// @} } // end of namespace #endif dar-2.5.3/src/libdar/header_version.hpp0000644000175000017430000001444312641772777014776 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file header_version.hpp /// \brief archive global header/trailer structure is defined here /// \ingroup Private #ifndef HEADER_VERSION_HPP #define HEADER_VERSION_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "tools.hpp" #include "archive_version.hpp" #include "on_pool.hpp" #include "crypto.hpp" #include "slice_layout.hpp" #include "compressor.hpp" namespace libdar { /// \addtogroup Private /// @{ /// manages the archive header and trailer class header_version : public on_pool { public: header_version(); header_version(const header_version & ref) { copy_from(ref); }; const header_version & operator = (const header_version & ref) { detruit(); copy_from(ref); return * this; }; ~header_version() { detruit(); }; /// read the header or trailer from the archive void read(generic_file &f, user_interaction & dialog, bool lax_mode); /// write down the object to the archive (as header if wrote at the beginning of the archive, as trailer is at the end) void write(generic_file &f) const; // settings void set_edition(const archive_version & ed) { edition = ed; }; void set_compression_algo(const compression & zip) { algo_zip = zip; }; void set_command_line(const std::string & line) { cmd_line = line; }; void set_initial_offset(const infinint & offset) { initial_offset = offset; }; void set_sym_crypto_algo(const crypto_algo & algo) { sym = algo; }; /// the object pointed to by key passes to the responsibility of this header_version object void set_crypted_key(memory_file *key) { if(key == nullptr) throw SRC_BUG; clear_crypted_key(); crypted_key = key; }; void clear_crypted_key() { if(crypted_key != nullptr) { delete crypted_key; crypted_key = nullptr; } }; /// the object pointed to by layout is passed under the responsibility of this header_version object void set_slice_layout(slice_layout *layout) { if(layout == nullptr) throw SRC_BUG; clear_slice_layout(); ref_layout = layout; }; void clear_slice_layout() { if(ref_layout != nullptr) { delete ref_layout; ref_layout = nullptr; } }; void set_tape_marks(bool presence) { has_tape_marks = presence; }; void set_signed(bool is_signed) { arch_signed = is_signed; }; // gettings const archive_version & get_edition() const { return edition; }; compression get_compression_algo() const { return algo_zip; }; const std::string & get_command_line() const { return cmd_line; }; const infinint & get_initial_offset() const { return initial_offset; }; bool is_ciphered() const { return ciphered || sym != crypto_none; }; bool is_signed() const { return arch_signed; }; crypto_algo get_sym_crypto_algo() const { return sym; }; memory_file *get_crypted_key() const { return crypted_key; }; const slice_layout *get_slice_layout() const { return ref_layout; }; bool get_tape_marks() const { return has_tape_marks; }; private: archive_version edition; //< archive format compression algo_zip; //< compression algorithm used std::string cmd_line; //< used long ago to store cmd_line, then abandonned, then recycled as a user comment field infinint initial_offset; //< defines at which offset starts the archive (passed the archive header), this field is obiously only used in the trailer not in the header // has to be set to zero when it is unknown, in that case this field is not dump to archive crypto_algo sym; //< strong encryption algorithm used for symmetrical encryption memory_file *crypted_key;//< optional field containing the asymmetrically ciphered key used for strong encryption ciphering slice_layout *ref_layout;//< optional field used in isolated catalogues to record the slicing layout of their archive of reference bool has_tape_marks; //< whether the archive contains tape marks aka escape marks aka sequence marks bool ciphered; // whether the archive is ciphered, even if we do not know its crypto algorithm (old archives) bool arch_signed; // whether the archive is signed void copy_from(const header_version & ref); void detruit(); // FLAG VALUES static const U_I FLAG_SAVED_EA_ROOT = 0x80; //< no more used since version "05" static const U_I FLAG_SAVED_EA_USER = 0x40; //< no more used since version "05" static const U_I FLAG_SCRAMBLED = 0x20; //< scrambled or strong encryption used static const U_I FLAG_SEQUENCE_MARK = 0x10; //< escape sequence marks present for sequential reading static const U_I FLAG_INITIAL_OFFSET = 0x08; //< whether the header contains the initial offset (size of clear data before encrypted) NOTE : This value is set internally by header_version, no need to set flag with it! But that's OK to set it or not, it will be updated according to initial_offset's value. static const U_I FLAG_HAS_CRYPTED_KEY = 0x04; //< the header contains a symmetrical key encrypted with asymmetrical algorithm static const U_I FLAG_HAS_REF_SLICING = 0x02; //< the header contains the slicing information of the archive of reference (used for isolated catalogue) static const U_I FLAG_HAS_AN_EXTENDED_SIZE = 0x01; //< the flag is two bytes length static const U_I FLAG_ARCHIVE_IS_SIGNED = 0x0200; //< archive is signed static const U_I FLAG_HAS_AN_SECOND_EXTENDED_SIZE = 0x0101; //< reserved for future use }; } // end of namespace #endif dar-2.5.3/src/libdar/path.hpp0000644000175000017430000001531012642474445012717 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file path.hpp /// \brief here is the definition of the path class /// \ingroup API /// /// the path class handle path and provide several operation on them #ifndef PATH_HPP #define PATH_HPP #include "../my_config.h" #include #include #include "erreurs.hpp" #include "on_pool.hpp" #define FAKE_ROOT path(string(""), true) namespace libdar { /// the class path is here to manipulate paths in the Unix notation: using'/' /// several operations are provided as well as convertion functions, but /// for the API user, it can be used as if it was a std::string object. /// However if the argument is not a valid path, an exception may be thrown /// by libdar /// \ingroup API class path : public on_pool { public : /// constructor from a string //! This realizes the string to path convertion function //! \param[in] s the string to convert to path //! \param[in] x_undisclosed do not split the given string, consider it as a single directory name, even if some '/' are found in it //! \note empty string is not a valid string (exception thrown) //! \note having undisclosed set to true, does not allow one to pop() right away, first push must be made. While having undisclosed set to false //! let the user pop() right away if the given string is composed of several path members ("member1/member2/member3" for example of path //! allow one to pop() three time, while in the same example setting undisclosed to true, allow one to pop() just once). path(const std::string & s, bool x_undisclosed = false); /// constructor from a char * //! this realizes the char * to path convertion function //! \note empty string is not a valid string (exception thrown) path(const char *s, bool x_undisclosed = false) { *this = path(std::string(s), x_undisclosed); }; /// copy constructor path(const path & ref); /// assignment operator const path & operator = (const path & ref); /// comparison operator bool operator == (const path & ref) const; bool operator != (const path & ref) const { return !(*this == ref); }; /// get the basename of a path /// this function returns the basename that's it the right most member of a path std::string basename() const; /// reset the read_subdir operation /// reset for read_subdir. next call to read_subdir is the most global void reset_read() { reading = dirs.begin(); }; /// sequentially read the elements that compose the path /// \param[out] r the next element of the path /// \return true if a next element could be read /// \note the reading starts at the root and ends with the basename of the path bool read_subdir(std::string & r); /// whether the path is relative or absolute (= start with a /) bool is_relative() const { return relative; }; /// whether the path is absolute or relative bool is_absolute() const { return !relative; }; /// whether the path has an undisclosed part at the beginning bool is_undisclosed() const { return undisclosed; }; /// remove and gives in argument the basename of the path /// \param[out] arg the basename of the path /// \return false if the operation was not possible (no sub-directory to pop) /// \note if the path is absolute the remaing value is '/' when no pop is anymore possible /// while it is the first component of the original path if the path was relative. /// a empty path is not a valide value bool pop(std::string & arg); /// remove and gives in argument the outer most member of the path /// \param[out] arg the value of the outer element of the path /// \return true if the pop_front operation was possible and arg could be set. /// \note removes and returns the first directory of the path, /// when just the basename is present returns false, if the path is absolute, /// the first call change it to relative (except if equal to "/" then return false) bool pop_front(std::string & arg); /// add a path to the current path. The added path *must* be a relative path /// \param[in] arg the relative path to add /// \return the resulting path, (the current object is not modified, where from the "const" qualifier) /// \note arg can be a string also, which is converted to a path on the fly path operator + (const path & arg) const { path tmp = *this; tmp += arg; return tmp; }; /// add a path to the current path. The added path *must* be a relative path /// \param[in] arg the relative path to add /// \return the value of the current (modified) object: "*this". path & operator += (const path & arg); /// test whether the current object is a subdir of the method's argument /// \param[in] p the path to test with /// \param[in] case_sensit whether the test must be in case sensitive manner or not bool is_subdir_of(const path & p, bool case_sensit) const; /// convert back a path to a string /// the returned string is the representation of the current object in Unix notation std::string display() const; /// \brief returns the number of member in the path /// /// \note a absolute path counts one more that its relative brother unsigned int degre() const { return dirs.size() + (relative ? 0 : 1); }; /// \brief if the current object is an undisclosed path, tries to convert it back to normal path void explode_undisclosed() const; private : std::list::iterator reading; std::list dirs; bool relative; bool undisclosed; void reduce(); }; } // end of namespace #endif dar-2.5.3/src/libdar/null_file.hpp0000644000175000017430000000516112641772777013747 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file null_file.hpp /// \brief /dev/null type file implementation under the generic_file interface /// \ingroup Private /// /// this class is used in particular when doing dry-run execution #ifndef NULL_FILE_HPP #define NULL_FILE_HPP #include "../my_config.h" #include "generic_file.hpp" #include "thread_cancellation.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the null_file class implements the /dev/null behavior /// this is a generic_file implementation that emulate the /// comportment of the /dev/null special file. /// all that is writen to is lost, and nothing can be read from /// it (empty file). This is a completed implementation all /// call are consistent. /// \ingroup Private class null_file : public generic_file, public thread_cancellation { public : null_file(gf_mode m) : generic_file(m) {}; bool skippable(skippability direction, const infinint & amount) { return true; }; bool skip(const infinint &pos) { return true; }; bool skip_to_eof() { return true; }; bool skip_relative(signed int x) { return false; }; infinint get_position() const { return 0; }; protected : void inherited_read_ahead(const infinint & amount) {}; U_I inherited_read(char *a, U_I size) { #ifdef MUTEX_WORKS check_self_cancellation(); #endif return 0; }; void inherited_write(const char *a, U_I size) { #ifdef MUTEX_WORKS check_self_cancellation(); #endif }; void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate() {}; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/thread_cancellation.cpp0000644000175000017430000002206712641773000015734 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif } #include "erreurs.hpp" #include "thread_cancellation.hpp" #include "tools.hpp" #define CRITICAL_START \ sigset_t Critical_section_mask_memory; \ tools_block_all_signals(Critical_section_mask_memory); \ pthread_mutex_lock(&access) #define CRITICAL_END pthread_mutex_unlock(&access); \ tools_set_back_blocked_signals(Critical_section_mask_memory) using namespace std; namespace libdar { // class static variables #if MUTEX_WORKS pthread_mutex_t thread_cancellation::access = PTHREAD_MUTEX_INITIALIZER; list thread_cancellation::info; list thread_cancellation::preborn; multimap thread_cancellation::thread_asso; #endif thread_cancellation::thread_cancellation() { #if MUTEX_WORKS bool bug = false; status.tid = pthread_self(); list::iterator ptr; CRITICAL_START; ptr = info.begin(); while(ptr != info.end() && *ptr != nullptr && (*ptr)->status.tid != status.tid) ptr++; if(ptr == info.end()) // first object in that thread { list::iterator it = preborn.begin(); while(it != preborn.end() && it->tid != status.tid) it++; if(it == preborn.end()) // no pending cancellation for that thread { status.block_delayed = false; status.immediate = true; status.cancellation = false; status.flag = 0; } else // pending cancellation for that thread { status = *it; preborn.erase(it); } } else // an object already exist for that thread if(*ptr == nullptr) // bug bug = true; else // an object already exists for that thread status = (*ptr)->status; if(!bug) info.push_back(this); CRITICAL_END; if(bug) throw SRC_BUG; #endif } thread_cancellation::~thread_cancellation() throw(Ebug) { #if MUTEX_WORKS list::iterator ptr; bool bug = false; CRITICAL_START; ptr = info.begin(); while(ptr != info.end() && *ptr != this) ptr++; if(ptr == info.end()) bug = true; else if(*ptr == nullptr) bug = true; else { if((*ptr)->status.cancellation) // cancellation for that thread preborn.push_back((*ptr)->status); info.erase(ptr); } CRITICAL_END; if(bug) throw SRC_BUG; #endif } void thread_cancellation::check_self_cancellation() const { #if MUTEX_WORKS if(status.cancellation && (status.immediate || !status.block_delayed)) { (void)clear_pending_request(status.tid); // avoid other object of that thread to throw exception throw Ethread_cancel(status.immediate, status.flag); // we can throw the exception now } #endif } void thread_cancellation::block_delayed_cancellation(bool mode) { #if MUTEX_WORKS list::iterator ptr; // we update all object of the current thread CRITICAL_START; ptr = info.begin(); while(ptr != info.end()) { if(*ptr == nullptr) throw SRC_BUG; if((*ptr)->status.tid == status.tid) (*ptr)->status.block_delayed = mode; ptr++; } CRITICAL_END; if(status.block_delayed != mode) throw SRC_BUG; if(!mode) check_self_cancellation(); #endif } #if MUTEX_WORKS void thread_cancellation::cancel(pthread_t tid, bool x_immediate, U_64 x_flag) { bool found = false, bug = false, notused = false; multimap::iterator debut; multimap::iterator fin; CRITICAL_START; set_cancellation_in_info_for(tid, true, x_immediate, x_flag, found, notused, bug); if(!found && !bug) // no thread_cancellation object exist for that thread add_to_preborn(tid, x_immediate, x_flag); find_asso_tid_with(tid, debut, fin); while(debut != fin && !bug) { set_cancellation_in_info_for(debut->second, true, x_immediate, x_flag, found, notused, bug); if(!found && !bug) add_to_preborn(debut->second, x_immediate, x_flag); ++debut; } CRITICAL_END; if(bug) throw SRC_BUG; } #endif #if MUTEX_WORKS bool thread_cancellation::cancel_status(pthread_t tid) { bool ret, bug = false; list::iterator ptr; CRITICAL_START; ptr = info.begin(); while(ptr != info.end() && (*ptr) != nullptr && (*ptr)->status.tid != tid) ptr++; if(ptr == info.end()) { list::iterator it = preborn.begin(); while(it != preborn.end() && it->tid != tid) it++; if(it == preborn.end()) ret = false; else ret = it->cancellation; } else if(*ptr == nullptr) bug = true; else ret = (*ptr)->status.cancellation; CRITICAL_END; if(bug) throw SRC_BUG; return ret; } bool thread_cancellation::clear_pending_request(pthread_t tid) { bool ret = false, bug = false, found = false; multimap::iterator debut; multimap::iterator fin; CRITICAL_START; set_cancellation_in_info_for(tid, false, false, 0, found, ret, bug); if(!found && !bug) remove_from_preborn(tid, found, ret); find_asso_tid_with(tid, debut, fin); while(debut != fin && !bug) { set_cancellation_in_info_for(debut->second, false, false, 0, found, ret, bug); if(!found && !bug) remove_from_preborn(debut->second, found, ret); ++debut; } CRITICAL_END; if(bug) throw SRC_BUG; return ret; } void thread_cancellation::associate_tid_to_tid(pthread_t src, pthread_t dst) { CRITICAL_START; thread_asso.insert(pair(src,dst)); CRITICAL_END; } void thread_cancellation::remove_association_for_tid(pthread_t src) { CRITICAL_START; thread_asso.erase(src); CRITICAL_END; } void thread_cancellation::remove_association_targeted_at(pthread_t dst) { CRITICAL_START; multimap::iterator it = thread_asso.begin(); multimap::iterator next = it; while(it != thread_asso.end()) { if(it->second == dst) { next = it; ++next; thread_asso.erase(it); it = next; } else ++it; } CRITICAL_END; } void thread_cancellation::dead_thread(pthread_t tid) { bool found, prev; remove_association_for_tid(tid); remove_association_targeted_at(tid); remove_from_preborn(tid, found, prev); } void thread_cancellation::set_cancellation_in_info_for(pthread_t tid, bool cancel_status, bool x_immediate, U_64 x_flag, bool & found, bool & previous_val, bool & bug) { list::iterator ptr = info.begin(); found = false; bug = false; while(ptr != info.end() && !bug) { if(*ptr == nullptr) bug = true; else if((*ptr)->status.tid == tid) { found = true; (*ptr)->status.immediate = x_immediate; previous_val = (*ptr)->status.cancellation; (*ptr)->status.cancellation = cancel_status; (*ptr)->status.flag = x_flag; } ptr++; } } void thread_cancellation::add_to_preborn(pthread_t tid, bool x_immediate, U_64 x_flag) { list::iterator it = preborn.begin(); fields tmp; tmp.tid = tid; tmp.block_delayed = false; tmp.immediate = x_immediate; tmp.cancellation = true; tmp.flag = x_flag; while(it != preborn.end() && it->tid != tid) it++; if(it != preborn.end()) *it = tmp; else preborn.push_back(tmp); } void thread_cancellation::remove_from_preborn(pthread_t tid, bool & found, bool & prev) { list::iterator it = preborn.begin(); found = false; while(it != preborn.end()) { if(it->tid == tid) { found = true; prev = it->cancellation; preborn.erase(it); it = preborn.begin(); } else it++; } } void thread_cancellation::find_asso_tid_with(pthread_t tid, multimap::iterator & debut, multimap::iterator & fin) { pair< multimap::iterator, multimap::iterator > tmp = thread_asso.equal_range(tid); debut = tmp.first; fin = tmp.second; } #endif } // end of namespace dar-2.5.3/src/libdar/entrepot.hpp0000644000175000017430000001460712641772777013643 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ // $Id: entrepot.hpp,v 1.1 2012/04/27 11:24:30 edrusb Exp $ // /*********************************************************************/ /// \file entrepot.hpp /// \brief defines the entrepot interface. /// Entrepot interface defines a generic way to interact with files (slices) /// on a filesystem. It is used to instanciate file-like objects (from class inherited /// from class fichier_global, in order to read or write data to such file. /// The entrepot_local and fichier_local classes are the only one classes /// available from libdar to implement the entrepot and fichier classes interfaces /// respectively. External applications like webdar can implement entrepot_ftp /// and fichier_ftp classes to provide transparent access to dar backup localted on a /// remote ftp server. More can follow in the future. /// \ingroup Private #ifndef ENTREPOT_HPP #define ENTREPOT_HPP #include "../my_config.h" #include #include "infinint.hpp" #include "generic_file.hpp" #include "user_interaction.hpp" #include "fichier_global.hpp" #include "hash_fichier.hpp" #include "etage.hpp" #include "path.hpp" #include "on_pool.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the Entrepot interface class entrepot : public on_pool { public: /// constructor entrepot(); /// destructor virtual ~entrepot() {}; /// says whether two entrepot objects points to the same location bool operator == (const entrepot & ref) const { return get_url() == ref.get_url(); }; /// defines the directory where to proceed to future open() -- this is a "chdir" semantics void set_location(const path & chemin); /// defines the root to use if set_location is given a relative path void set_root(const path & p_root) { if(p_root.is_relative()) throw Erange("entrepot::set_root", std::string(gettext("root's entrepot must be an absolute path: ")) + p_root.display()); root = p_root; }; /// set default ownership for files to be created thanks to the open() methods void set_user_ownership(const std::string & x_user) { user = x_user; }; void set_group_ownership(const std::string & x_group) { group = x_group; }; const path & get_location() const { return where; }; //< retreives relative to root path the current location points to const path & get_root() const { return root; }; //< retrieves the given root location path get_full_path() const; virtual std::string get_url() const = 0; //< defines an URL-like normalized full location of slices const std::string & get_user_ownership() const { return user; }; const std::string & get_group_ownership() const { return group; }; /// defines the way to open a file and return a "class fichier_global" object as last argument upon success /// /// \param[in] dialog for user interaction /// \param[in] filename is the full path+name of the file to open (read/create/write to) /// \param[in] mode defines which way to open the file (read-only, read-write or write-only) /// \param[in] force_permission whether to set the file permission to the value given in the permission argument /// \param[in] permission if force_permission is set, change the file permission to that value /// \param[in] fail_if_exists tells whether the underlying implementation have to fail throwing Erange("exists") if the file already exist when write access is required /// \param[in] erase tells whether the underlying implementation will empty an existing file before writing to it /// \param[in] algo defines the hash file to create, other value than hash_none are accepted only in writeonly mode with erase or fail_if_exist set /// \return upon success returns an object from a class inherited from fichier_global that the caller has the duty to delete, else an exception is thrown (most of the time it should be a Esystem object) /// by the called inherited class fichier_global *open(user_interaction & dialog, const std::string & filename, gf_mode mode, bool force_permission, U_I permission, bool fail_if_exists, bool erase, hash_algo algo) const; /// routines to read existing files in the current directory (see set_location() / set_root() methods) virtual void read_dir_reset() = 0; virtual bool read_dir_next(std::string & filename) = 0; void unlink(const std::string & filename) const { inherited_unlink(filename); }; //< done this way for homogeneity with open/inherited_open virtual entrepot *clone() const = 0; protected: virtual fichier_global *inherited_open(user_interaction & dialog, //< for user interaction const std::string & filename, //< filename to open gf_mode mode, //< mode to use bool force_permission, //< set the permission of the file to open U_I permission, //< value of the permission to assign when force_permission is true bool fail_if_exists, //< whether to fail if file exists (write mode) bool erase) const = 0; //< whether to erase file if file already exists (write mode) virtual void inherited_unlink(const std::string & filename) const = 0; virtual void read_dir_flush() = 0; //< ends the read_dir_next, (no more entry available) private: path where; path root; std::string user; std::string group; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/user_group_bases.hpp0000644000175000017430000000516212641773000015322 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file user_group_bases.hpp /// \brief defines class that speed up the uid to username and gid to group name lookup /// \ingroup Private #ifndef USER_GROUP_BASES_HPP #define USER_GROUP_BASES_HPP #include "../my_config.h" #ifdef __DYNAMIC__ extern "C" { #if MUTEX_WORKS #if HAVE_PTHREAD_H #include #endif #endif } #include #include #include "infinint.hpp" namespace libdar { /// \addtogroup Private /// @{ class user_group_bases { public: user_group_bases() : filled(false) {}; /// return the user name corresponding to the given uid /// \note if the entry is not known, returns an empty string const std::string & get_username(const infinint & uid) const; /// return the group name corresponding to the given gid /// \note if the entry is not known, returns an empty string const std::string & get_groupname(const infinint & gid) const; private: bool filled; std::map user_database; std::map group_database; void fill() const; static const std::string empty_string; #if MUTEX_WORKS // the system call used to read the password and group database are not re-entrant, the mutex // must block all other thread while a given thread is reading the databases // the best solution would have to let the user provide such a database object already filled // but that would rely on it not to destroy this object while threads are using it // for this reason, here the mutex is 'static' static pthread_mutex_t lock_fill; #endif }; /// @} } // end of namespace #endif #endif dar-2.5.3/src/libdar/cat_chardev.hpp0000644000175000017430000000504512642457363014232 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file cat_chardev.hpp /// \brief class used to record character special devices in a catalogue /// \ingroup Private #ifndef CAT_CHARDEV_HPP #define CAT_CHARDEV_HPP #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_device.hpp" #include "cat_tools.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the char device class class cat_chardev : public cat_device { public: cat_chardev(const infinint & uid, const infinint & gid, U_16 perm, const datetime & last_access, const datetime & last_modif, const datetime & last_change, const std::string & name, U_16 major, U_16 minor, const infinint & fs_device) : cat_device(uid, gid, perm, last_access, last_modif, last_change, name, major, minor, fs_device) {}; cat_chardev(user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, saved_status saved, bool small) : cat_device(dialog, pdesc, reading_ver, saved, small) {}; bool operator == (const cat_entree & ref) const; // using dump from cat_device class // using method is_more_recent_than() from cat_device class // using method has_changed_since() from cat_device class unsigned char signature() const { return mk_signature('c', get_saved_status()); }; cat_entree *clone() const { return new (get_pool()) cat_chardev(*this); }; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/statistics.hpp0000644000175000017430000002533112641773000014145 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file statistics.hpp /// \brief handle the statistic structure that gives a summary of treated files after each operatio /// \ingroup API #ifndef STATISTICS_HPP #define STATISTICS_HPP #include "../my_config.h" #include "infinint.hpp" #include "user_interaction.hpp" extern "C" { #if MUTEX_WORKS #if HAVE_PTHREAD_H #include #endif #endif } /// \addtogroup Private /// @{ #if MUTEX_WORKS #define LOCK_IN pthread_mutex_lock(&lock_mutex) #define LOCK_OUT pthread_mutex_unlock(&lock_mutex) #define LOCK_IN_CONST pthread_mutex_lock(const_cast(&lock_mutex)) #define LOCK_OUT_CONST pthread_mutex_unlock(const_cast(&lock_mutex)) #else #define LOCK_IN // #define LOCK_OUT // #define LOCK_IN_CONST // #define LOCK_OUT_CONST // #endif namespace libdar { /// structure returned by libdar call to give a summary of the operation done in term of file treated /// the different fields are used for backup, restoration and other operation /// their meaning changes a bit depending on the operation. Some operation may /// not use all fields. To have a detailed view of what fields get used and what // are their meaning see the archive class constructor and methods documentation /// \ingroup API class statistics { public: /// constructor /// \param[in] lock whether to use mutex to manipulate (read or write) variables of that object /// \note using a statistics object built without lock (false given as argument to the constructor) may /// lead to application crash if several threads are accessing at the same object at the same time when /// at least one thread is modifying this object, unless you really know what you are doing, it is better /// to always use the default value for this constructor or to explicitely give "true" as argument. statistics(bool lock = true) { init(lock); clear(); }; statistics(const statistics & ref) { copy_from(ref); }; const statistics & operator = (const statistics & ref) { detruit(); copy_from(ref); return *this; }; /// destructor ~statistics() { detruit(); }; /// reset counters to zero void clear(); /// total number of file treated infinint total() const; void incr_treated() { (this->*increment)(&treated); }; ///< increment by one the treated counter void incr_hard_links() { (this->*increment)(&hard_links); }; ///< increment by one the hard_links counter void incr_skipped() { (this->*increment)(&skipped); }; ///< increment by one the skipped counter void incr_ignored() { (this->*increment)(&ignored); }; ///< increment by one the ignored counter void incr_tooold() { (this->*increment)(&tooold); }; ///< increment by one the tooold counter void incr_errored() { (this->*increment)(&errored); }; ///< increment by one the errored counter void incr_deleted() { (this->*increment)(&deleted); }; ///< increment by one the deleted counter void incr_ea_treated() { (this->*increment)(&ea_treated); }; ///< increment by one the ea_treated counter void incr_fsa_treated() { (this->*increment)(&fsa_treated); }; ///< increment by one the fsa treated counter void add_to_ignored(const infinint & val) { (this->*add_to)(&ignored, val); }; ///< increment the ignored counter by a given value void add_to_errored(const infinint & val) { (this->*add_to)(&errored, val); }; ///< increment the errored counter by a given value void add_to_deleted(const infinint & val) { (this->*add_to)(&deleted, val); }; ///< increment the deleted counter by a given value void add_to_byte_amount(const infinint & val) { (this->*add_to)(&byte_amount, val); }; ///< increment the byte amount counter by a given value void sub_from_treated(const infinint & val) { (this->*sub_from)(&treated, val); }; void sub_from_ea_treated(const infinint & val) { (this->*sub_from)(&ea_treated, val); }; void sub_from_hard_links(const infinint & val) { (this->*sub_from)(&hard_links, val); }; void sub_from_fsa_treated(const infinint & val) { (this->*sub_from)(&fsa_treated, val); }; infinint get_treated() const { return (this->*returned)(&treated); }; ///< returns the current value of the treated counter infinint get_hard_links() const { return (this->*returned)(&hard_links); }; ///< returns the current value of the hard_links counter infinint get_skipped() const { return (this->*returned)(&skipped); }; ///< returns the current value of the skipped counter infinint get_ignored() const { return (this->*returned)(&ignored); }; ///< returns the current value of the ignored counter infinint get_tooold() const { return (this->*returned)(&tooold); }; ///< returns the current value of the tooold counter infinint get_errored() const { return (this->*returned)(&errored); }; ///< returns the current value of the errored counter infinint get_deleted() const { return (this->*returned)(&deleted); }; ///< returns the current value of the deleted counter infinint get_ea_treated() const { return (this->*returned)(&ea_treated); }; ///< returns the current value of the ea_treated counter infinint get_byte_amount() const { return (this->*returned)(&byte_amount); }; ///< returns the current value of the byte_amount counter infinint get_fsa_treated() const { return (this->*returned)(&fsa_treated); }; ///< returns the current value of the fsa_treated counter void decr_treated() { (this->*decrement)(&treated); }; ///< decrement by one the treated counter void decr_hard_links() { (this->*decrement)(&hard_links); }; ///< decrement by one the hard_links counter void decr_skipped() { (this->*decrement)(&skipped); }; ///< decrement by one the skipped counter void decr_ignored() { (this->*decrement)(&ignored); }; ///< decrement by one the ignored counter void decr_tooold() { (this->*decrement)(&tooold); }; ///< decrement by one the toold counter void decr_errored() { (this->*decrement)(&errored); }; ///< decrement by one the errored counter void decr_deleted() { (this->*decrement)(&deleted); }; ///< decrement by one the deleted counter void decr_ea_treated() { (this->*decrement)(&ea_treated); }; ///< decrement by one the ea_treated counter void decr_fsa_treated() { (this->*decrement)(&fsa_treated); };///< decrement by one the fsa_treated counter void set_byte_amount(const infinint & val) { (this->*set_to)(&byte_amount, val); }; ///< set to the given value the byte_amount counter // debuging method void dump(user_interaction & dialog) const; private: #if MUTEX_WORKS pthread_mutex_t lock_mutex; ///< lock the access to the private variable of the curent object #endif bool locking; ///< whether we use locking or not infinint treated; ///< number of inode treated (saved, restored, etc.) [all operations] infinint hard_links; ///< number of hard linked inodes treated (including those ignored by filters) infinint skipped; ///< files not changed since last backup / file not restored because not saved in backup infinint ignored; ///< ignored files due to filters infinint tooold; ///< ignored files because less recent than the filesystem entry [restoration] / modfied during backup infinint errored; ///< files that could not be saved / files that could not be restored (filesystem access right) infinint deleted; ///< deleted file seen / number of files deleted during the operation [restoration] infinint ea_treated; ///< number of EA saved / number of EA restored infinint byte_amount; ///< auxilliary counter, holds the wasted bytes due to repeat on change feature for example. infinint fsa_treated; ///< number of FSA saved / number of FSA restored void (statistics::*increment)(infinint * var); ///< generic method for incrementing a variable void (statistics::*add_to)(infinint * var, const infinint & val); ///< generic method for add a value to a variable infinint (statistics::*returned)(const infinint * var) const; ///< generic method for obtaining the value of a variable void (statistics::*decrement)(infinint * var); ///< generic method for decrementing a variable void (statistics::*set_to)(infinint * var, const infinint & val); ///< generic method for setting a variable to a given value void (statistics::*sub_from)(infinint *var, const infinint & val);///< generic method for substracting to a variable void increment_locked(infinint * var) { LOCK_IN; (*var)++; LOCK_OUT; }; void increment_unlocked(infinint * var) { (*var)++; } void add_to_locked(infinint * var, const infinint & val) { LOCK_IN; (*var) += val; LOCK_OUT; } void add_to_unlocked(infinint *var, const infinint & val) { (*var) += val; } infinint returned_locked(const infinint * var) const { infinint ret; LOCK_IN_CONST; ret = *var; LOCK_OUT_CONST; return ret; }; infinint returned_unlocked(const infinint * var) const { return *var; }; void decrement_locked(infinint * var) { LOCK_IN; (*var)--; LOCK_OUT; } void decrement_unlocked(infinint * var) { (*var)--; } void set_to_locked(infinint *var, const infinint & val) { LOCK_IN; (*var) = val; LOCK_OUT; } void set_to_unlocked(infinint *var, const infinint & val) { *var = val; } void sub_from_unlocked(infinint *var, const infinint & val) { *var -= val; } void sub_from_locked(infinint *var, const infinint & val) { LOCK_IN; *var -= val; LOCK_OUT; } void init(bool lock); // set locking & mutex void detruit(); // release and free the mutex void copy_from(const statistics & ref); // reset mutex and copy data from the object of reference }; } // end of namespace /// @} #endif dar-2.5.3/src/libdar/database.cpp0000644000175000017430000005067312641772777013545 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if STDC_HEADERS #include #endif #if HAVE_ERRNO_H #include #endif } // end extern "C" #include #include #include #include "database.hpp" #include "user_interaction.hpp" #include "deci.hpp" #include "tools.hpp" #include "storage.hpp" #include "database_header.hpp" using namespace libdar; using namespace std; static storage *file2storage(generic_file &f, memory_pool *pool); static void memory2file(storage &s, generic_file &f); namespace libdar { database::database() { archive_data dat; dat.chemin = ""; dat.basename = ""; coordinate.clear(); coordinate.push_back(dat); // coordinate[0] is never used, but must exist options_to_dar.clear(); dar_path = ""; files = new (get_pool()) data_dir("."); // "." or whaterver else (this name is not used) if(files == nullptr) throw Ememory("database::database"); data_files = nullptr; check_order_asked = true; cur_db_version = database_header_get_supported_version(); } database::database(user_interaction & dialog, const string & base, const database_open_options & opt) { generic_file *f = database_header_open(dialog, get_pool(), base, cur_db_version); if(f == nullptr) throw Ememory("database::database"); try { check_order_asked = opt.get_warn_order(); build(dialog, *f, opt.get_partial(), opt.get_partial_read_only(), cur_db_version); } catch(...) { delete f; throw; } delete f; } void database::build(user_interaction & dialog, generic_file & f, bool partial, bool read_only, const unsigned char db_version) { NLS_SWAP_IN; try { struct archive_data dat; if(db_version > database_header_get_supported_version()) throw SRC_BUG; // we should not get there if the database is more recent than what that software can handle. this is necessary if we do not want to destroy the database or loose data. coordinate.clear(); infinint tmp = infinint(f); // number of archive to read while(!tmp.is_zero()) { tools_read_string(f, dat.chemin); tools_read_string(f, dat.basename); if(db_version >= 3) dat.root_last_mod.read(f, db2archive_version(db_version)); else dat.root_last_mod = datetime(0); coordinate.push_back(dat); --tmp; } if(coordinate.empty()) throw Erange("database::database", gettext("Badly formatted database")); tools_read_vector(f, options_to_dar); tools_read_string(f, dar_path); if(db_version < database_header_get_supported_version()) partial = false; if(!partial) { files = data_tree_read(f, db_version, get_pool()); if(files == nullptr) throw Ememory("database::database"); if(files->get_name() != ".") files->set_name("."); data_files = nullptr; } else { if(!read_only) { files = nullptr; data_files = file2storage(f, get_pool()); } else { files = nullptr; data_files = nullptr; } } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } database::~database() { if(files != nullptr) delete files; if(data_files != nullptr) delete data_files; } void database::dump(user_interaction & dialog, const std::string & filename, const database_dump_options & opt) const { if(files == nullptr && data_files == nullptr) throw Erange("database::dump", gettext("Cannot write down a read-only database")); generic_file *f = database_header_create(dialog, get_pool(), filename, opt.get_overwrite()); if(f == nullptr) throw Ememory("database::dump"); try { archive_num tmp = coordinate.size(); infinint(tmp).dump(*f); for(archive_num i = 0; i < tmp; ++i) { tools_write_string(*f, coordinate[i].chemin); tools_write_string(*f, coordinate[i].basename); coordinate[i].root_last_mod.dump(*f); } tools_write_vector(*f, options_to_dar); tools_write_string(*f, dar_path); if(files != nullptr) files->dump(*f); else if(data_files != nullptr) memory2file(*data_files, *f); else throw SRC_BUG; } catch(...) { if(f != nullptr) delete f; throw; } if(f != nullptr) delete f; } void database::add_archive(const archive & arch, const string & chemin, const string & basename, const database_add_options & opt) { NLS_SWAP_IN; try { struct archive_data dat; archive_num number = coordinate.size(); if(files == nullptr) throw SRC_BUG; if(basename == "") throw Erange("database::add_archive", gettext("Empty string is an invalid archive basename")); if(number >= ARCHIVE_NUM_MAX) throw Erange("database::add_archive", gettext("Cannot add another archive, database is full")); dat.chemin = chemin; dat.basename = basename; dat.root_last_mod = arch.get_catalogue().get_root_dir_last_modif(); coordinate.push_back(dat); data_tree_update_with(arch.get_catalogue().get_contenu(), number, files); if(number > 1) files->finalize_except_self(number, get_root_last_mod(number), 0); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::remove_archive(archive_num min, archive_num max, const database_remove_options & opt) { NLS_SWAP_IN; try { min = get_real_archive_num(min, opt.get_revert_archive_numbering()); max = get_real_archive_num(max, opt.get_revert_archive_numbering()); if(min > max) throw Erange("database::remove_archive", gettext("Incorrect archive range in database")); if(min == 0 || max >= coordinate.size()) throw Erange("database::remove_archive", gettext("Incorrect archive range in database")); for(U_I i = max ; i >= min ; --i) { if(files == nullptr) throw SRC_BUG; files->remove_all_from(i, coordinate.size() - 1); files->skip_out(i); coordinate.erase(coordinate.begin() + i); } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::change_name(archive_num num, const string & basename, const database_change_basename_options &opt) { NLS_SWAP_IN; try { num = get_real_archive_num(num, opt.get_revert_archive_numbering()); if(num < coordinate.size() && num != 0) coordinate[num].basename = basename; else throw Erange("database::change_name", gettext("Non existent archive in database")); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::set_path(archive_num num, const string & chemin, const database_change_path_options & opt) { NLS_SWAP_IN; try { num = get_real_archive_num(num, opt.get_revert_archive_numbering()); if(num < coordinate.size() && coordinate[num].basename != "") coordinate[num].chemin = chemin; else throw Erange("database::change_name", gettext("Non existent archive in database")); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::set_permutation(archive_num src, archive_num dst) { NLS_SWAP_IN; try { struct archive_data moved; if(files == nullptr) throw SRC_BUG; if(src >= coordinate.size() || src <= 0) throw Erange("database::set_permutation", string(gettext("Invalid archive number: ")) + tools_int2str(src)); if(dst >= coordinate.size() || dst <= 0) throw Erange("database::set_permutation", string(gettext("Invalid archive number: ")) + tools_int2str(dst)); moved = coordinate[src]; coordinate.erase(coordinate.begin()+src); coordinate.insert(coordinate.begin()+dst, moved); files->apply_permutation(src, dst); // update et_absent dates set re_finalize; set::iterator re_it; if(src < dst) { re_finalize.insert(src); re_finalize.insert(dst); re_finalize.insert(dst+1); } else // src >= dst { re_finalize.insert(src+1); re_finalize.insert(dst); re_finalize.insert(dst+1); // if src == dst the set still contains on entry (src or dst). // this is intended to let the user have the possibility // to ask dates recompilation, even if in theory this is useless } re_it = re_finalize.begin(); while(re_it != re_finalize.end()) { files->finalize_except_self(*re_it, get_root_last_mod(*re_it), *re_it + 1); ++re_it; } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::show_contents(user_interaction & dialog) const { NLS_SWAP_IN; try { string opt = tools_concat_vector(" ", options_to_dar); if(!dialog.get_use_dar_manager_contents()) { dialog.warning("\n"); dialog.printf(gettext("dar path : %S\n"), &dar_path); dialog.printf(gettext("dar options : %S\n"), &opt); dialog.printf(gettext("database version: %d\n"), cur_db_version); dialog.warning("\n"); dialog.printf(gettext("archive # | path | basename\n")); dialog.printf("------------+--------------+---------------\n"); } for(archive_num i = 1; i < coordinate.size(); ++i) { if(dialog.get_use_dar_manager_contents()) dialog.dar_manager_contents(i, coordinate[i].chemin, coordinate[i].basename); else { opt = (coordinate[i].chemin == "") ? gettext("") : coordinate[i].chemin; dialog.printf(" \t%u\t%S\t%S\n", i, &opt, &coordinate[i].basename); } } } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::show_files(user_interaction & dialog, archive_num num, const database_used_options & opt) const { NLS_SWAP_IN; try { if(num != 0) num = get_real_archive_num(num, opt.get_revert_archive_numbering()); if(files == nullptr) throw SRC_BUG; if(num < coordinate.size()) files->show(dialog, num); else throw Erange("database::show_files", gettext("Non existent archive in database")); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::show_version(user_interaction & dialog, path chemin) const { NLS_SWAP_IN; try { const data_tree *ptr = nullptr; const data_dir *ptr_dir = files; string tmp; if(files == nullptr) throw SRC_BUG; if(!chemin.is_relative()) throw Erange("database::show_version", gettext("Invalid path, path must be relative")); while(chemin.pop_front(tmp) && ptr_dir != nullptr) { ptr = ptr_dir->read_child(tmp); if(ptr == nullptr) throw Erange("database::show_version", gettext("Non existent file in database")); ptr_dir = dynamic_cast(ptr); } if(ptr_dir == nullptr) throw Erange("database::show_version", gettext("Non existent file in database")); ptr = ptr_dir->read_child(chemin.display()); if(ptr == nullptr) throw Erange("database::show_version", gettext("Non existent file in database")); else ptr->listing(dialog); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::show_most_recent_stats(user_interaction & dialog) const { NLS_SWAP_IN; try { vector stats_data(coordinate.size(), 0); vector stats_ea(coordinate.size(), 0); vector total_data(coordinate.size(), 0); vector total_ea(coordinate.size(), 0); if(files == nullptr) throw SRC_BUG; files->compute_most_recent_stats(stats_data, stats_ea, total_data, total_ea); if(!dialog.get_use_dar_manager_statistics()) { dialog.printf(gettext(" archive # | most recent/total data | most recent/total EA\n")); dialog.printf(gettext("--------------+-------------------------+-----------------------\n")); // having it with gettext let the translater adjust columns width } for(archive_num i = 1; i < coordinate.size(); ++i) if(dialog.get_use_dar_manager_statistics()) dialog.dar_manager_statistics(i, stats_data[i], total_data[i], stats_ea[i], total_ea[i]); else dialog.printf("\t%u %i/%i \t\t\t %i/%i\n", i, &stats_data[i], &total_data[i], &stats_ea[i], &total_ea[i]); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } void database::restore(user_interaction & dialog, const vector & filename, const database_restore_options & opt) { NLS_SWAP_IN; try { map > command_line; deque anneau; const data_tree *ptr; anneau.assign(filename.begin(), filename.end()); if(files == nullptr) throw SRC_BUG; if(opt.get_info_details()) dialog.warning(gettext("Checking chronological ordering of files between the archives...")); check_order(dialog); // determination of the archive to restore and files to restore for each selected file while(!anneau.empty()) { if(data_tree_find(anneau.front(), *files, ptr)) { const data_dir *ptr_dir = dynamic_cast(ptr); archive_num num_data = 0; archive_num num_ea = 0; data_tree::lookup look_ea, look_data; look_data = ptr->get_data(num_data, opt.get_date(), opt.get_even_when_removed()); look_ea = ptr->get_EA(num_ea, opt.get_date(), opt.get_even_when_removed()); switch(look_data) { case data_tree::found_present: break; case data_tree::found_removed: num_data = 0; // we do not restore it if(opt.get_info_details()) dialog.warning(string(gettext("File recorded as removed at this date in database: ")) + anneau.front()); break; case data_tree::not_found: num_data = 0; dialog.warning(string(gettext("File not found in database: ")) + anneau.front()); break; case data_tree::not_restorable: num_data = 0; dialog.warning(string(gettext("File found in database but impossible to restore (only found \"unchanged\" in differential backups): ")) + anneau.front()); break; default: throw SRC_BUG; } switch(look_ea) { case data_tree::found_present: if(opt.get_even_when_removed() && look_data == data_tree::found_present && num_data > num_ea) num_ea = num_data; break; case data_tree::found_removed: num_ea = 0; // we do not restore it break; case data_tree::not_found: num_ea = 0; break; case data_tree::not_restorable: num_ea = 0; dialog.warning(string(gettext("Extended Attribute of file found in database but impossible to restore (only found \"unchanged\" in differential backups): ")) + anneau.front()); break; default: throw SRC_BUG; } // if there is something to restore for that file if(look_ea == data_tree::found_present || look_data == data_tree::found_present) { if(num_data == num_ea) // both EA and data are located in the same archive { if(num_data != 0) // archive is not zero (so it is a real archive) { command_line[num_data].push_back("-g"); command_line[num_data].push_back(anneau.front()); } else // archive number is zero (not a valid archive number) if(!opt.get_date().is_zero()) // a date was specified { string fic = anneau.front(); if(opt.get_info_details()) dialog.printf(gettext("%S did not exist before specified date and cannot be restored"), &fic); } else throw SRC_BUG; // no date limitation, the file's data should have been found } else // num_data != num_ea { if(num_data != 0) { command_line[num_data].push_back("-g"); command_line[num_data].push_back(anneau.front()); } if(num_ea != 0) { command_line[num_ea].push_back("-g"); command_line[num_ea].push_back(anneau.front()); } if(num_data != 0 && num_ea != 0) if(num_data > num_ea) // will restore "EA only" then "data + old EA" { string fic = anneau.front(); if(!opt.get_even_when_removed()) dialog.printf(gettext("Either archives in database are not properly tidied, or file last modification date has been artificially set to an more ancient date. This may lead improper Extended Attribute restoration for inode %S"), &fic); } } } if(ptr_dir != nullptr) { // adding current directory children in the list of files vector fils; vector::iterator fit; path base = anneau.front(); ptr_dir->read_all_children(fils); fit = fils.begin(); while(fit != fils.end()) anneau.push_back((base + *(fit++)).display()); } } else { string fic = anneau.front(); dialog.printf(gettext("Cannot restore file %S : non existent file in database"), &fic); } anneau.pop_front(); } //freeing memory if early_release is set if(opt.get_early_release()) { if(files != nullptr) { delete files; files = nullptr; } } // calling dar for each archive if(!command_line.empty()) { string dar_cmd = dar_path != "" ? dar_path : "dar"; map >::iterator ut = command_line.begin(); vector argvector_init = vector(1, dar_cmd); while(ut != command_line.end()) { try { string archive_name; vector argvpipe; // building the argument list sent through anonymous pipe if(coordinate[ut->first].chemin != "") archive_name = coordinate[ut->first].chemin + "/"; else archive_name = ""; archive_name += coordinate[ut->first].basename; argvpipe.push_back(dar_cmd); // just to fill the argv[0] by the command even when transmitted through anonymous pipe argvpipe.push_back("-x"); argvpipe.push_back(archive_name); if(!opt.get_ignore_dar_options_in_database()) argvpipe += options_to_dar; argvpipe += opt.get_extra_options_for_dar(); argvpipe += ut->second; dialog.printf("CALLING DAR: restoring %d files from archive %S using anonymous pipe to transmit configuration to the dar process", ut->second.size()/2, &archive_name); if(opt.get_info_details()) { dialog.printf("Arguments sent through anonymous pipe are:"); dialog.warning(tools_concat_vector(" ", argvpipe)); } tools_system_with_pipe(dialog, dar_cmd, argvpipe, get_pool()); } catch(Erange & e) { dialog.warning(string(gettext("Error while restoring the following files: ")) + tools_concat_vector( " ", ut->second) + " : " + e.get_message()); } ut++; } } else dialog.warning(gettext("Cannot restore any file, nothing done")); } catch(...) { NLS_SWAP_OUT; throw; } NLS_SWAP_OUT; } archive_num database::get_real_archive_num(archive_num num, bool revert) const { if(num == 0) throw Erange("database::get_real_archive_num", tools_printf(dar_gettext("Invalid archive number: %d"), num)); if(revert) { U_I size = coordinate.size(); // size is +1 because of record zero that is never used but must exist if(size > num) return size - num; else throw Erange("database::get_real_archive_num", tools_printf(dar_gettext("Invalid archive number: %d"), -num)); } else return num; } const datetime & database::get_root_last_mod(const archive_num & num) const { if(num >= coordinate.size()) throw SRC_BUG; return coordinate[num].root_last_mod; } } // end of namespace static storage *file2storage(generic_file &f, memory_pool *pool) { storage *st = new (pool) storage(0); const U_I taille = 102400; unsigned char buffer[taille]; S_I lu; if(st == nullptr) throw Ememory("dar_manager:file2storage"); do { lu = f.read((char *)buffer, taille); if(lu > 0) st->insert_bytes_at_iterator(st->end(), buffer, lu); } while(lu > 0); return st; } static void memory2file(storage &s, generic_file &f) { s.dump(f); } dar-2.5.3/src/libdar/mem_sized.cpp0000644000175000017430000001316212641772777013745 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "mem_sized.hpp" #include "tools.hpp" using namespace std; namespace libdar { ////////////////////////////////////////////// // mem_sized class implementation // mem_sized::mem_sized(U_I block_size) { mem_cluster * tmp = nullptr; if(block_size > 0) { table_size_64 = average_table_size / (64 * block_size) + 1; if(table_size_64 < 1) table_size_64 = 1; } else // for block_size == 0 we allocate only minimal sized mem_clusters table_size_64 = 1; pending_release = nullptr; #ifdef LIBDAR_DEBUG_MEMORY sum_percent = 0; num_cluster = 0; #endif tmp = new (nothrow) mem_cluster(block_size, table_size_64, this); if(tmp == nullptr) throw Ememory("mem_sized::mem_sized"); try { clusters.push_front(tmp); next_free_in_table = clusters.begin(); } catch(...) { delete tmp; throw; } } mem_sized::~mem_sized() { list::iterator it = clusters.begin(); while(it != clusters.end()) { if(*it != nullptr) delete *it; ++it; } clusters.clear(); pending_release = nullptr; } void *mem_sized::alloc(mem_allocator * & ptr) { while(next_free_in_table != clusters.end() && (*next_free_in_table) != nullptr && ( (*next_free_in_table) == pending_release || (*next_free_in_table)->is_full() ) ) ++next_free_in_table; if(next_free_in_table == clusters.end()) { next_free_in_table = clusters.begin(); while(next_free_in_table != clusters.end() && (*next_free_in_table) != nullptr && ( (*next_free_in_table) == pending_release || (*next_free_in_table)->is_full() ) ) ++next_free_in_table; if(next_free_in_table == clusters.end()) { if(pending_release == nullptr) { // all clusters are full, we must allocate a new one if(clusters.empty()) throw SRC_BUG; // at least one mem_cluster should always be present if((*clusters.begin()) == nullptr) throw SRC_BUG; // all *mem_cluster should be valid objects mem_cluster *tmp = new (nothrow) mem_cluster((*clusters.begin())->get_block_size(), table_size_64, this); if(tmp == nullptr) throw Ememory("mem_sized::alloc"); try { clusters.push_front(tmp); } catch(...) { delete tmp; throw; } next_free_in_table = clusters.begin(); } else { // recycling the cluster that was pending for release next_free_in_table = clusters.begin(); while(next_free_in_table != clusters.end() && *next_free_in_table != pending_release) ++next_free_in_table; // next_free_in_table now points to pending_release mem_cluster if(next_free_in_table == clusters.end()) throw SRC_BUG; pending_release = nullptr; // we do not have anymore a cluster pending for release } } } if(*next_free_in_table == nullptr) throw SRC_BUG; else ptr = *next_free_in_table; return (*next_free_in_table)->alloc(); } void mem_sized::push_to_release_list(mem_allocator *ref) { if(pending_release != nullptr) { list::iterator it = clusters.begin(); #ifdef LIBDAR_DEBUG_MEMORY sum_percent += pending_release->max_percent_full(); ++num_cluster; #endif while(it != clusters.end() && (*it) != pending_release) ++it; if(it == clusters.end()) throw SRC_BUG; // cannot release previously recorded cluster if(it == next_free_in_table) ++next_free_in_table; if(!pending_release->is_empty()) throw SRC_BUG; // some blocks have been (re-)allocated from that cluster! delete pending_release; pending_release = nullptr; clusters.erase(it); if(clusters.size() == 0) throw SRC_BUG; // should always have at least one cluster } pending_release = (mem_cluster *)ref; } bool mem_sized::is_empty() const { return clusters.size() == 1 && (*clusters.begin()) != nullptr && (*clusters.begin())->is_empty(); } string mem_sized::dump() const { string ret = ""; list::const_iterator it = clusters.begin(); ret += tools_printf(" %d cluster(s) contain unreleased blocks of memory:\n", clusters.size()); while(it != clusters.end()) { if(*it == nullptr) ret += " !?! nullptr pointer in cluster list !?!\n"; else { if(!(*it)->is_empty()) ret += (*it)->dump(); } ++it; } return ret; } #ifdef LIBDAR_DEBUG_MEMORY U_I mem_sized::max_percent_full() const { U_I tmp_sum = sum_percent; U_I tmp_num = num_cluster; if(pending_release != nullptr) { tmp_sum += pending_release->max_percent_full(); ++tmp_num; } return tmp_num > 0 ? tmp_sum / tmp_num : 0; } #endif } // end of namespace dar-2.5.3/src/libdar/memory_pool.cpp0000644000175000017430000001261712641772777014336 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "memory_pool.hpp" #include "memory_check.hpp" #include "tools.hpp" using namespace std; namespace libdar { memory_pool::~memory_pool() throw(Ebug) { map::iterator it = carte.begin(); while(it != carte.end()) { if(it->second != nullptr) { if(!it->second->is_empty()) throw SRC_BUG; delete it->second; it->second = nullptr; } ++it; } } void *memory_pool::alloc(size_t size) { alloc_ptr *ret = nullptr; //< address that will be returned mem_allocator *ptr = nullptr; //< address of the object that has to be informed of memory release for the allocated block size_t with_overhead = size + sizeof(alloc_ptr); map::iterator it = carte.find(with_overhead); #ifdef LIBDAR_DEBUG_MEMORY // updating statistics map::iterator cit = count.find(with_overhead); if(cit == count.end()) count[size] = 1; else ++(cit->second); #endif // looking for a existing mem_sized object if(it != carte.end()) if(it->second == nullptr) throw SRC_BUG; else // found an existing mem_sized, requesting it a memory block ret = (alloc_ptr *)it->second->alloc(ptr); else { // we must first create a new mem_sized memory_check_special_new_sized(with_overhead); mem_sized *tmp = new (nothrow) mem_sized(with_overhead); if(tmp == nullptr) throw SRC_BUG; // we record the brand-new mem_sized try { carte[with_overhead] = tmp; } catch(...) { delete tmp; throw; } // and request it a memory block ret = (alloc_ptr *)tmp->alloc(ptr); } // filling the overhead structure before the memory block if(ret != nullptr) { try { if(ptr == nullptr) throw SRC_BUG; ret->ptr = ptr; ++ret; memory_check_special_report_new(ret, size); } catch(...) { delete ret; throw; } } return (void *)ret; } void memory_pool::release(void *ptr) { alloc_ptr *tmp = (alloc_ptr *)ptr; if(tmp == nullptr) throw SRC_BUG; // trying to release block at nullptr --tmp; // moving to the previous header if(tmp->ptr == nullptr) throw SRC_BUG; // nullptr found for the mem_allocator of that block tmp->ptr->release((void *)tmp); memory_check_special_report_delete(ptr); } void memory_pool::garbage_collect() { map::iterator it = carte.begin(); while(it != carte.end()) { if(it->second == nullptr) throw SRC_BUG; if(it->second->is_empty()) { map::iterator tmp = it; ++it; delete tmp->second; carte.erase(tmp); } else ++it; } #ifdef LIBDAR_DEBUG_MEMORY count.clear(); #endif } string memory_pool::dump() const { string ret = ""; map::const_iterator it = carte.begin(); ret += "###################################################################\n"; ret += " SPECIAL ALLOCATION MODULE REPORTS UNRELEASED MEMORY ALLOCATIONS\n\n"; while(it != carte.end()) { if(it->second == nullptr) ret += tools_printf("!?! NO corresponding mem_sized object for block size %d\n", it->first); else { if(!it->second->is_empty()) { ret += tools_printf("Dumping list for blocks of %d bytes size", it->first); ret += it->second->dump(); } } ++it; } ret += "###################################################################\n"; return ret; } #ifdef LIBDAR_DEBUG_MEMORY string memory_pool:: max_percent_full() const { string ret = ""; map::const_iterator it = carte.begin(); map::const_iterator cit; U_I freq; ret += " ----------------------------------------------------\n"; ret += " Statistical use of memory allocation per block size:\n"; ret += " ----------------------------------------------------\n"; while(it != carte.end()) { cit = count.find(it->first); if(cit == count.end()) freq = 0; else freq = cit->second; if(it->second == nullptr) ret += tools_printf(" nullptr reference associated to %d bytes blocks !?!?! (number of requests %d)\n", it->first, freq); else ret += tools_printf(" Usage for %d bytes blocks : %d %% (number of requests %d)\n", it->first, it->second->max_percent_full(), freq); ++it; } ret+= " ----------------------------------------------------\n"; return ret; } #endif } // end of namespace dar-2.5.3/src/libdar/slice_layout.hpp0000644000175000017430000000502512641773000014445 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file slice_layout.hpp /// \brief object describing the slicing of an archive /// \ingroup Private #ifndef SLICE_LAYOUT_HPP #define SLICE_LAYOUT_HPP #include #include #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "on_pool.hpp" namespace libdar { class slice_layout : public on_pool { public: // field still exposed (slice_layout was a struct before being a class) // we keep these fields as is for now infinint first_size; //< size of the first slice infinint other_size; //< maximum size of other slices infinint first_slice_header; //< size of the slice header in the first slice infinint other_slice_header; //< size of the slice header in the other slices bool older_sar_than_v8; //< true if the archive format is older than version 8 void read(generic_file & f); void write(generic_file & f) const; void clear(); /// given a slice_layout and a archive offset, provides the corresponding slice and slice offset /// /// \param[in] sl slice_layout /// \param[in] offset input offset as if all slices were sticked toghether /// \param[out] slice_num slice number where to find the given offset /// \param[out] slice_offset offset in that slice where is the given offset void which_slice(const infinint & offset, infinint & slice_num, infinint & slice_offset) const; private: static const char OLDER_THAN_V8 = '7'; static const char V8 = '8'; }; } // end of namespace #endif dar-2.5.3/src/libdar/range.cpp0000644000175000017430000000610712641772777013066 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "range.hpp" using namespace std; namespace libdar { void range::operator += (const range & ref) { list::const_iterator ref_it = ref.parts.begin(); while(ref_it != ref.parts.end()) { list::iterator it = parts.begin(); while(it != parts.end() && *it < *ref_it) ++it; if(it == parts.end()) parts.push_back(*ref_it); else if(*ref_it < *it) parts.insert(it, *ref_it); else { if(!it->overlaps_with(*ref_it)) throw SRC_BUG; it->merge_with(*ref_it); // we also have to test whether the next segment cannot be merged too list::iterator next = it; ++next; if(next != parts.end()) { if(it->overlaps_with(*next)) { it->merge_with(*next); parts.erase(next); } } } ++ref_it; } } string range::display() const { string ret = ""; list::const_iterator it = parts.begin(); while(it != parts.end()) { ret += it->display(); ++it; if(it != parts.end()) ret += ","; } if(ret.size() == 0) ret = ""; return ret; } void range::reset_read() const { range *me = const_cast(this); me->read_cursor = parts.begin(); } bool range::read_next_segment(infinint & low, infinint & high) const { range *me = const_cast(this); if(me->read_cursor != parts.end()) { low = me->read_cursor->get_low(); high = me->read_cursor->get_high(); ++me->read_cursor; return true; } else return false; } void range::segment::merge_with(const segment & ref) { if(*this <= ref) low = ref.low; else if(*this >= ref) high = ref.high; else if(contains(ref)) return; // nothing to do else if(ref.contains(*this)) *this = ref; else throw SRC_BUG; } string range::segment::display() const { string ret = ""; deci dl = low; if(low == high) ret = dl.human(); else { deci dh = high; ret = dl.human() + "-" + dh.human(); } return ret; } } // end of namespace dar-2.5.3/src/libdar/slave_thread.cpp0000644000175000017430000002613712641773000014414 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif } // end extern "C" #include "tronconneuse.hpp" #include "slave_thread.hpp" using namespace std; namespace libdar { slave_thread::slave_thread(generic_file *x_data, libthreadar::fast_tampon *x_input_data, libthreadar::fast_tampon *x_output_data, libthreadar::fast_tampon *x_input_ctrl, libthreadar::fast_tampon *x_output_ctrl) { if(x_data == nullptr) throw SRC_BUG; if(x_input_data == nullptr) throw SRC_BUG; if(x_output_data == nullptr) throw SRC_BUG; if(x_input_ctrl == nullptr) throw SRC_BUG; if(x_output_ctrl == nullptr) throw SRC_BUG; data = x_data; input_data = x_input_data; output_data = x_output_data; input_ctrl = x_input_ctrl; output_ctrl = x_output_ctrl; ptr = nullptr; set_header_vars(); init(); } void slave_thread::init() { num = 0; ptr = nullptr; read_ahead = 0; endless_read_ahead = false; to_send_ahead = 0; immediate_read = 0; wake_me = false; stop = false; } void slave_thread::inherited_run() { try { init(); do { if((!to_send_ahead.is_zero() || endless_read_ahead) && !output_data->is_full()) { U_I tmp = 0; bool eof; if(!endless_read_ahead) to_send_ahead.unstack(tmp); // else tmp == 0 which lead to send a maximum sized block of data in the tampon U_I wrote = send_data_block(tmp, eof); if(wrote > 0) { if(!endless_read_ahead) { tmp -= wrote; to_send_ahead += tmp; } read_ahead += wrote; } if(eof) { endless_read_ahead = false; to_send_ahead = 0; } } if(pending_input_data()) treat_input_data(); else { if(pending_order() || output_data->is_full() || (to_send_ahead.is_zero() && !endless_read_ahead)) { bool need_answer; if(!pending_order()) wake_me = true; read_order(); wake_me = false; try { need_answer = treat_order(); } catch(...) { input_ctrl->fetch_recycle(ptr); throw; } input_ctrl->fetch_recycle(ptr); if(need_answer) { // sending the answer send_answer(); } if(immediate_read > 0) go_read(); } } } while(!stop); } catch(...) { // send an exception message to master thread answer.clear(); answer.set_type(msg_type::answr_exception); send_answer(); // and then die throw; } } void slave_thread::set_header_vars() { unsigned int tmp; answer.clear(); answer.set_type(msg_type::data_partial); answer.reset_get_block(); tmp = 1; if(!answer.get_block(&data_header, tmp)) throw SRC_BUG; if(tmp != 1) throw SRC_BUG; answer.clear(); answer.set_type(msg_type::data_completed); answer.reset_get_block(); tmp = 1; if(!answer.get_block(&data_header_completed, tmp)) throw SRC_BUG; if(tmp != 1) throw SRC_BUG; } void slave_thread::read_order() { bool completed = false; order.clear(); do { input_ctrl->fetch(ptr, num); completed = order.add_block(ptr, num); if(!completed) input_ctrl->fetch_recycle(ptr); } while(!completed); // note ptr and num are relative // to the last block read which // must be released/recycled calling release_answer() } void slave_thread::send_answer() { bool completed = false; answer.reset_get_block(); do { output_ctrl->get_block_to_feed(ptr, num); completed = answer.get_block(ptr, num); output_ctrl->feed(ptr, num); } while(!completed); } U_I slave_thread::send_data_block(U_I size, bool & eof) { U_I min; char *local_ptr = nullptr; unsigned int local_num; eof = false; // preparing the new answer output_data->get_block_to_feed(local_ptr, local_num); try { if(local_num == 0) throw SRC_BUG; local_ptr[0] = data_header; --local_num; if(size == 0) min = local_num; // filling the block with as much data as possible else min = size > local_num ? local_num : size; // returning the minimum of (size, num) size = data->read(local_ptr + 1, min); if(size < min) // reached eof { local_ptr[0] = data_header_completed; eof = true; } } catch(...) { output_data->feed_cancel_get_block(local_ptr); throw; } output_data->feed(local_ptr, size + 1); return size; // note that size has been modified by the effective number of byte read from *data } void slave_thread::treat_input_data() { char *local_ptr = nullptr; unsigned int local_num; if(input_data->is_not_empty()) { if(!to_send_ahead.is_zero() || endless_read_ahead) throw SRC_BUG; // read_ahead asked but no read done, received data to write instead if(!read_ahead.is_zero()) throw SRC_BUG; // read_ahead started but data not read, received data to write instead } while(input_data->is_not_empty()) { input_data->fetch(local_ptr, local_num); try { data->write(local_ptr+1, local_num - 1); } catch(...) { input_data->fetch_recycle(local_ptr); throw; } input_data->fetch_recycle(local_ptr); } } bool slave_thread::treat_order() { bool need_answer = false; infinint tmp; answer.clear(); switch(order.get_type()) { case msg_type::order_read_ahead: tmp = order.get_infinint(); if(tmp.is_zero()) { endless_read_ahead = true; to_send_ahead = 0; } else { endless_read_ahead = false; to_send_ahead += tmp; } data->read_ahead(tmp); // propagate the read_ahead request break; case msg_type::order_read: immediate_read = order.get_U_I(); break; case msg_type::order_sync_write: treat_input_data(); // we do not propagate to below data, just the inter-thread // exchanges have to be synced answer.set_type(msg_type::answr_sync_write_done); need_answer = true; break; case msg_type::order_skip: treat_input_data(); answer.set_type(msg_type::answr_skip_done); answer.set_bool(data->skip(order.get_infinint())); read_ahead = 0; // all in transit data will be dropped by the master to_send_ahead = 0; endless_read_ahead = false; need_answer = true; break; case msg_type::order_skip_to_eof: treat_input_data(); answer.set_type(msg_type::answr_skip_done); answer.set_bool(data->skip_to_eof()); read_ahead = 0; // all in transit data will be dropped by the master to_send_ahead = 0; endless_read_ahead = false; need_answer = true; break; case msg_type::order_skip_fwd: treat_input_data(); answer.set_type(msg_type::answr_skip_done); answer.set_bool(data->skip_relative(order.get_U_I())); read_ahead = 0; // all in transit data will be dropped by the master to_send_ahead = 0; endless_read_ahead = false; need_answer = true; break; case msg_type::order_skip_bkd: treat_input_data(); answer.set_type(msg_type::answr_skip_done); answer.set_bool(data->skip_relative(-order.get_U_I())); read_ahead = 0; // all in transit data will be dropped by the master to_send_ahead = 0; endless_read_ahead = false; need_answer = true; break; case msg_type::order_skippable_fwd: treat_input_data(); if(!read_ahead.is_zero()) throw SRC_BUG; // code is not adapted, it should take into consideration read_ahead data answer.set_type(msg_type::answr_skippable); answer.set_bool(data->skippable(generic_file::skip_forward, order.get_infinint())); need_answer = true; break; case msg_type::order_skippable_bkd: treat_input_data(); if(!read_ahead.is_zero()) throw SRC_BUG; // code is not adapted, it should take into consideration read_ahead data answer.set_type(msg_type::answr_skippable); answer.set_bool(data->skippable(generic_file::skip_backward, order.get_infinint())); need_answer = true; break; case msg_type::order_get_position: treat_input_data(); answer.set_type(msg_type::answr_position); tmp = data->get_position(); if(!read_ahead.is_zero()) { // we need to compensate the position of "data" // by the amount of bytes read ahead from it // but not yet requested for reading by the master thread // (still in transit in the tampon) if(tmp < read_ahead) throw SRC_BUG; // we read ahead more data than available in the underlying generic_file!!! else tmp -= read_ahead; } answer.set_infinint(tmp); need_answer = true; break; case msg_type::order_end_of_xmit: treat_input_data(); stop = true; break; case msg_type::order_stop_readahead: answer.set_type(msg_type::answr_readahead_stopped); read_ahead = 0; // all in transit data will be dropped by the master to_send_ahead = 0; endless_read_ahead = false; need_answer = true; break; case msg_type::order_wakeup: wake_me = false; break; default: throw SRC_BUG; } return need_answer; } void slave_thread::go_read() { U_I sent = 0; bool eof = false; if(input_data->is_not_empty()) throw SRC_BUG; if(!read_ahead.is_zero()) { if(infinint(immediate_read) >= read_ahead) { U_I tmp = 0; // counting out the already sent data thanks to a previous read_ahead read_ahead.unstack(tmp); if(!read_ahead.is_zero()) throw SRC_BUG; immediate_read -= tmp; } else { // all data already sent thanks to a previous read_ahead read_ahead -= immediate_read; immediate_read = 0; } } // after read_ahead consideration, checking what remains to send while(sent < immediate_read && !eof) sent += send_data_block(immediate_read - sent, eof); if(eof) { // stopping a pending read_ahead to_send_ahead = 0; endless_read_ahead = false; } immediate_read = 0; // requested read has completed (either eof or all data sent) // counting down from what remains to send due to pending read_ahead what we have just sent if(!to_send_ahead.is_zero()) { if(infinint(sent) > to_send_ahead) to_send_ahead = 0; else to_send_ahead -= sent; } } } // end of generic_thread::namespace dar-2.5.3/src/libdar/cat_tube.cpp0000644000175000017430000000257512641772777013565 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { } // end extern "C" #include "cat_tube.hpp" using namespace std; namespace libdar { bool cat_tube::operator == (const cat_entree & ref) const { const cat_tube *ref_tube = dynamic_cast(&ref); if(ref_tube == nullptr) return false; else return cat_inode::operator == (ref); } } // end of namespace dar-2.5.3/src/libdar/ea_filesystem.cpp0000644000175000017430000002517112641772777014625 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #ifdef EA_SUPPORT #if HAVE_SYS_TYPES_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_ATTR_XATTR_H #include #endif #if HAVE_SYS_XATTR_H #include #endif #endif } // end extern "C" #include "ea_filesystem.hpp" #include "ea.hpp" #include "tools.hpp" #define MSG_NO_EA_SUPPORT "Extended Attribute support not activated at compilation time" using namespace std; namespace libdar { #ifdef EA_SUPPORT // Wrapper functions for l*attr inline static ssize_t my_lgetxattr(const char *path, const char *name, void *value, size_t size); inline static int my_lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags); inline static ssize_t my_llistxattr(const char *path, char *list, size_t size); inline static int my_lremovexattr(const char *path, const char *name); static bool write_ea(const string & chemin, const ea_attributs & val, const mask & filter); static bool remove_ea(const string & name, const ea_attributs & val, const mask & filter); static ea_attributs * read_ea(const string & name, const mask & filter, memory_pool *p); static vector ea_filesystem_get_ea_list_for(const char *filename, memory_pool *p); #endif bool ea_filesystem_write_ea(const string & chemin, const ea_attributs & val, const mask & filter) { #ifdef EA_SUPPORT return write_ea(chemin, val, filter); #else throw Efeature(gettext(MSG_NO_EA_SUPPORT)); #endif } ea_attributs * ea_filesystem_read_ea(const string & name, const mask & filter, memory_pool *p) { #ifdef EA_SUPPORT return read_ea(name, filter, p); #else return nullptr; #endif } void ea_filesystem_clear_ea(const string &name, const mask & filter, memory_pool *p) { #ifdef EA_SUPPORT ea_attributs * eat = ea_filesystem_read_ea(name, filter, p); try { if(eat != nullptr) remove_ea(name, *eat, bool_mask(true)); } catch(...) { if(eat != nullptr) delete eat; throw; } if(eat != nullptr) delete eat; #else throw Efeature(gettext(MSG_NO_EA_SUPPORT)); #endif } bool ea_filesystem_has_ea(const string & name, memory_pool *p) { #ifdef EA_SUPPORT vector val = ea_filesystem_get_ea_list_for(name.c_str(), p); return ! val.empty(); #else return false; #endif } bool ea_filesystem_has_ea(const string & name, const ea_attributs & list, const mask & filter, memory_pool *p) { #ifdef EA_SUPPORT const char *p_name = name.c_str(); bool ret = false; vector val = ea_filesystem_get_ea_list_for(p_name, p); vector::iterator it = val.begin(); string tmp; while(it != val.end() && ! ret) { if(filter.is_covered(*it)) ret = list.find(*it, tmp); it++; } return ret; #else return false; #endif } #ifdef EA_SUPPORT static bool write_ea(const string & chemin, const ea_attributs & val, const mask & filter) { U_I num = 0; const char *p_chemin = chemin.c_str(); string key, value; val.reset_read(); while(val.read(key, value)) { // doing this for each attribute if(!filter.is_covered(key)) continue; // silently skipping this EA // now, action ! if(my_lsetxattr(p_chemin, key.c_str(), value.c_str(), value.size(), 0) < 0) { string tmp = tools_strerror_r(errno); throw Erange("ea_filesystem write_ea", tools_printf(gettext("Error while adding EA %s : %s"), key.c_str(), tmp.c_str())); } else num++; } return num > 0; } static bool remove_ea(const string & chemin, const ea_attributs & val, const mask & filter) { U_I num = 0; const char *p_chemin = chemin.c_str(); string key, value; val.reset_read(); while(val.read(key, value)) { // doing this for each attribute if(!filter.is_covered(key)) continue; // silently skipping this EA // now, action ! const char *k = key.c_str(); if(my_lremovexattr(p_chemin, k) < 0) { string tmp = tools_strerror_r(errno); if(errno != ENOATTR) throw Erange("ea_filesystem write_ea", tools_printf(gettext("Error while removing %s : %s"), k, tmp.c_str())); } else num++; } return num > 0; } static ea_attributs * read_ea(const string & name, const mask & filter, memory_pool *p) { const char *n_ptr = name.c_str(); ea_attributs *ret = nullptr; vector ea_liste = ea_filesystem_get_ea_list_for(n_ptr, p); vector::iterator it = ea_liste.begin(); try { while(it != ea_liste.end()) { if(filter.is_covered(*it)) { const char *a_name = it->c_str(); const U_I MARGIN = 2; string ea_ent_key, ea_ent_value; S_64 taille = my_lgetxattr(n_ptr, a_name, nullptr, 0); char *value = nullptr; if(taille < 0) { string tmp = tools_strerror_r(errno); throw Erange("ea_filesystem read_ea", tools_printf(gettext("Error reading attribute %s of file %s : %s"), a_name, n_ptr, tmp.c_str())); } if(ret == nullptr) { ret = new (p) ea_attributs(); if(ret == nullptr) throw Ememory("read_ea"); ret->clear(); } if(taille > 0) { if(p == nullptr) value = new (nothrow) char[taille+MARGIN]; else value = (char *)p->alloc(taille+MARGIN); if(value == nullptr) throw Ememory("filesystem : read_ea_from"); try { taille = my_lgetxattr(n_ptr, a_name, value, taille+MARGIN); // if the previous call overflows the buffer this may need to SEGFAULT and so on. if(taille < 0) { string tmp = tools_strerror_r(errno); throw Erange("ea_filesystem read_ea", tools_printf(gettext("Error reading attribute %s of file %s : %s"), a_name, n_ptr, tmp.c_str())); } ea_ent_key = *it; ea_ent_value = string((char *)value, (char *)value+taille); ret->add(ea_ent_key, ea_ent_value); } catch(...) { if(p == nullptr) delete [] value; else p->release(value); throw; } if(p == nullptr) delete [] value; else p->release(value); } else // trivial case where the value has a length of zero { ea_ent_key = *it; ea_ent_value = string(""); ret->add(ea_ent_key, ea_ent_value); } } it++; } } catch(...) { if(ret != nullptr) { delete ret; ret = nullptr; } throw; } return ret; } static vector ea_filesystem_get_ea_list_for(const char *filename, memory_pool *p) { vector ret; const U_I MARGIN = 2; ssize_t taille = my_llistxattr(filename, nullptr, 0); char *liste = nullptr; if(taille < 0) { if(errno == ENOSYS || errno == ENOTSUP) return ret; string tmp = tools_strerror_r(errno); throw Erange("ea_filesystem_get_ea_list_for", tools_printf(gettext("Error retrieving EA list for %s : %s"), filename, tmp.c_str())); } if(p == nullptr) liste = new (nothrow) char[taille+MARGIN]; else liste = (char *)p->alloc(taille+MARGIN); if(liste == nullptr) throw Ememory("filesystem : get_ea_list_for"); try { S_64 cursor = 0; taille = my_llistxattr(filename, liste, taille+MARGIN); if(taille < 0) { string tmp = tools_strerror_r(errno); throw Erange("ea_filesystem_get_ea_list_for", tools_printf(gettext("Error retrieving EA list for %s : %s"), filename, tmp.c_str())); } while(cursor < taille) { ret.push_back(string(liste+cursor)); cursor += strlen(liste+cursor)+1; } } catch(...) { if(p == nullptr) delete [] liste; else p->release(liste); throw; } if(p == nullptr) delete [] liste; else p->release(liste); return ret; } #ifdef OSX_EA_SUPPORT inline static ssize_t my_lgetxattr(const char *path, const char *name, void *value, size_t size) { return getxattr(path, name, value, size, 0, XATTR_NOFOLLOW); } inline static int my_lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags) { return setxattr(path, name, value, size, 0, XATTR_NOFOLLOW | flags); } inline static ssize_t my_llistxattr(const char *path, char *list, size_t size) { return listxattr(path, list, size, XATTR_NOFOLLOW); } inline static int my_lremovexattr(const char *path, const char *name) { return removexattr(path, name, XATTR_NOFOLLOW); } #else inline static ssize_t my_lgetxattr(const char *path, const char *name, void *value, size_t size) { return lgetxattr(path, name, value, size); } inline static int my_lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags) { return lsetxattr(path, name, value, size, flags); } inline static ssize_t my_llistxattr(const char *path, char *list, size_t size) { return llistxattr(path, list, size); } inline static int my_lremovexattr(const char *path, const char *name) { return lremovexattr(path, name); } #endif #endif } // end of namespace dar-2.5.3/src/libdar/memory_file.cpp0000644000175000017430000000471012641772777014277 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "memory_file.hpp" using namespace std; namespace libdar { bool memory_file::skip(const infinint & pos) { if(is_terminated()) throw SRC_BUG; if(pos >= data.size()) { position = data.size(); return false; } else { position = pos; return true; } } bool memory_file::skip_to_eof() { if(is_terminated()) throw SRC_BUG; position = data.size(); return true; } bool memory_file::skip_relative(S_I x) { bool ret = false; if(is_terminated()) throw SRC_BUG; if(x < 0) { U_I tx = -x; if(position < tx) { position = 0; ret = false; } else { position -= tx; ret = true; } } else { position += x; if(position > data.size()) { position = data.size(); ret = false; } else ret = true; } return ret; } U_I memory_file::inherited_read(char *a, U_I size) { U_I ret = 0; while(ret < size && position < data.size()) { *(a++) = (char)(data[position]); ++ret; ++position; } return ret; } void memory_file::inherited_write(const char *a, U_I size) { U_I ret = 0; if(size == 0) return; while(ret < size && position < data.size()) { data[position] = (unsigned char)(*(a++)); ret++; ++position; } data.insert_bytes_at_iterator(data.end(), (unsigned char *)(a), size - ret); position += size - ret; } } // end of namespace dar-2.5.3/src/libdar/compressor.hpp0000644000175000017430000001646612641772777014204 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file compressor.hpp /// \brief compression engine implementation /// \ingroup Private #ifndef COMPRESSOR_HPP #define COMPRESSOR_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" #include "integers.hpp" #include "wrapperlib.hpp" namespace libdar { /// the different compression algorithm available /// values to be used as argument of libdar API calls /// \ingroup API enum compression { none = 'n', ///< no compression gzip = 'z', ///< gzip compression bzip2 = 'y', ///< bzip2 compression lzo = 'l', ///< lzo compression xz = 'x' ///< lzma compression }; /// \ingroup Private /// @} extern compression char2compression(char a); extern char compression2char(compression c); extern std::string compression2string(compression c); extern compression string2compression(const std::string & a); // throw Erange if an unknown string is given /// compression class for gzip and bzip2 algorithms class compressor : public generic_file { public : compressor(compression algo, generic_file & compressed_side, U_I compression_level = 9); // compressed_side is not owned by the object and will remains // after the objet destruction compressor(compression algo, generic_file *compressed_side, U_I compression_level = 9); // compressed_side is owned by the object and will be // deleted a destructor time ~compressor(); compression get_algo() const { return current_algo; }; void suspend_compression(); void resume_compression(); bool is_compression_suspended() const { return suspended; }; // inherited from generic file bool skippable(skippability direction, const infinint & amount) { return compressed->skippable(direction, amount); }; bool skip(const infinint & pos) { compr_flush_write(); compr_flush_read(); clean_read(); return compressed->skip(pos); }; bool skip_to_eof() { compr_flush_write(); compr_flush_read(); clean_read(); return compressed->skip_to_eof(); }; bool skip_relative(S_I x) { compr_flush_write(); compr_flush_read(); clean_read(); return compressed->skip_relative(x); }; infinint get_position() const { return compressed->get_position(); }; protected : void inherited_read_ahead(const infinint & amount) { compressed->read_ahead(amount); }; U_I inherited_read(char *a, U_I size) { return (this->*read_ptr)(a, size); }; void inherited_write(const char *a, U_I size) { (this->*write_ptr)(a, size); }; void inherited_sync_write() { compr_flush_write(); }; void inherited_flush_read() { compr_flush_read(); clean_read(); }; void inherited_terminate() { local_terminate(); }; private : struct xfer : public on_pool { wrapperlib wrap; char *buffer; U_I size; xfer(U_I sz, wrapperlib_mode mode); ~xfer(); }; struct lzo_block_header { char type; //< let the possibility to extend this architecture (for now type is fixed) infinint size; //< size of the following compressed block of data void dump(generic_file & f); void set_from(generic_file & f); }; xfer *compr, *decompr; //< datastructure for bzip2 an gzip compression char *lzo_read_buffer; //< stores clear data (uncompressed) read from the compressed generic_file char *lzo_write_buffer; //< stores the clear data to be compressed and written to the compressed generic_file U_I lzo_read_size; //< number of available bytes in the read buffer for lzo decompression U_I lzo_write_size; //< number of available bytes to compress and next place where to add more data in the wite buffer U_I lzo_read_start; //< location of the next byte to read out from the read buffer bool lzo_write_flushed; //< whether write flushing has been done bool lzo_read_reached_eof; //< whether reading reached end of file and the lzo engine has to be reset to uncompress further data char *lzo_compressed; //< compressed data just read or about to be written char *lzo_wrkmem; //< work memory for LZO library generic_file *compressed; bool compressed_owner; compression current_algo; bool suspended; compression suspended_compr; U_I current_level; void init(compression algo, generic_file *compressed_side, U_I compression_level); void local_terminate(); U_I (compressor::*read_ptr) (char *a, U_I size); U_I none_read(char *a, U_I size); U_I gzip_read(char *a, U_I size); // U_I zip_read(char *a, U_I size); // U_I bzip2_read(char *a, U_I size); // using gzip_read, same code thanks to wrapperlib U_I lzo_read(char *a, U_I size); void (compressor::*write_ptr) (const char *a, U_I size); void none_write(const char *a, U_I size); void gzip_write(const char *a, U_I size); // void zip_write(char *a, U_I size); // void bzip2_write(char *a, U_I size); // using gzip_write, same code thanks to wrapperlib void lzo_write(const char *a, U_I size); void lzo_compress_buffer_and_write(); void lzo_read_and_uncompress_to_buffer(); /// changes compression algorithm used by the compressor /// \param[in] new_algo defines the new algorithm to use /// \param[in] new_compression_level defines the new compression level to use. /// \note valid value for new_compression_level range from 0 (no compression) to /// 9 (maximum compression). void change_algo(compression new_algo, U_I new_compression_level); /// changes the compression algorithm keeping the same compression level void change_algo(compression new_algo) { change_algo(new_algo, current_level); }; void compr_flush_write(); // flush all data to compressed_side, and reset the compressor // for that additional write can be uncompresssed starting at this point. void compr_flush_read(); // reset decompression engine to be able to read the next block of compressed data // if not called, furthur read return EOF void clean_read(); // discard any byte buffered and not yet returned by read() void clean_write(); // discard any byte buffered and not yet wrote to compressed_side; }; /// @} } // end of namespace #endif dar-2.5.3/src/libdar/user_group_bases.cpp0000644000175000017430000000626712641773000015324 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #ifdef __DYNAMIC__ extern "C" { #if HAVE_SYS_TYPE_H #include #endif #if HAVE_PWD_H #include #endif #if HAVE_GRP_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif } #include "erreurs.hpp" #include "user_group_bases.hpp" #include "tools.hpp" #include "erreurs.hpp" using namespace std; #if MUTEX_WORKS #define CRITICAL_START \ sigset_t Critical_section_mask_memory; \ tools_block_all_signals(Critical_section_mask_memory); \ pthread_mutex_lock(&lock_fill) #define CRITICAL_END pthread_mutex_unlock(&lock_fill); \ tools_set_back_blocked_signals(Critical_section_mask_memory) #else #define CRITICAL_START // not a thread-safe implementation #define CRITICAL_END // not a thread-safe implementation #endif namespace libdar { const std::string user_group_bases::empty_string = ""; #if MUTEX_WORKS pthread_mutex_t user_group_bases::lock_fill = PTHREAD_MUTEX_INITIALIZER; #endif void user_group_bases::fill() const { if(!filled) { user_group_bases *me = const_cast(this); struct passwd *pwd; struct group *grp; CRITICAL_START; // filling the user name base if(me == nullptr) throw SRC_BUG; setpwent(); // reset password reading while((pwd = getpwent()) != nullptr) me->user_database[pwd->pw_uid] = pwd->pw_name; endpwent(); // filling the group name base setgrent(); while((grp = getgrent()) != nullptr) me->group_database[grp->gr_gid] = grp->gr_name; endgrent(); CRITICAL_END; me->filled = true; } } const string & user_group_bases::get_username(const infinint & uid) const { map::const_iterator it; fill(); it = user_database.find(uid); if(it != user_database.end()) return it->second; else return empty_string; } const string & user_group_bases::get_groupname(const infinint & gid) const { map::const_iterator it; fill(); it = group_database.find(gid); if(it != group_database.end()) return it->second; else return empty_string; } } // end of namespace #endif dar-2.5.3/src/libdar/terminateur.cpp0000644000175000017430000001063312641773000014304 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "terminateur.hpp" #include "elastic.hpp" #define BLOCK_SIZE 4 namespace libdar { void terminateur::dump(generic_file & f) { infinint size = f.get_position(), nbbit, reste; S_I last_byte; unsigned char a; pos.dump(f); size = f.get_position() - size; euclide(size, BLOCK_SIZE, nbbit, reste); if(!reste.is_zero()) { // adding some non informational bytes to get a multiple of BLOCK_SIZE S_I bourrage = reste % BLOCK_SIZE; a = 0; for(S_I i = bourrage; i < BLOCK_SIZE; ++i) f.write((char *)&a, 1); // one more for remaing bytes and non informational bytes. ++nbbit; } last_byte = nbbit % 8; nbbit /= 8; // now, nbbit is the number of byte of terminator string (more or less 1) if(last_byte != 0) { // making the last byte (starting eof) of the terminator string a = 0; for(S_I i = 0; i < last_byte; ++i) { a >>= 1; a |= 0x80; } f.write((char *)&a, 1); } else // adding a terminal non 0xFF byte. (terminal when read down from end of file) { a = 0; f.write((char *)&a, 1); } // writing down all the other bytes of the terminator string a = 0xff; while(!nbbit.is_zero()) { f.write((char *)&a, 1); --nbbit; } } void terminateur::read_catalogue(generic_file & f, bool with_elastic, const archive_version & reading_ver, const infinint & where_from) { S_I offset = 0; unsigned char a; if(where_from.is_zero()) f.skip_to_eof(); else f.skip(where_from); if(with_elastic) (void)elastic(f, elastic_backward, reading_ver); // temporary anomymous elastic skip backward in 'f' // up to the other elastic buffer end try { // reading & counting the terminator string char b; do { if(f.read_back(b) != 1) throw Erange("",""); // exception used locally a = (unsigned char)b; if(a == 0xFF) ++offset; } while(a == 0xFF); offset *= 8; // offset is now a number of bits // considering the first non 0xFF byte of the terminator string (backward reading) while(a != 0) { if((a & 0x80) == 0) throw Erange("",""); ++offset; a <<= 1; } offset *= BLOCK_SIZE; // offset is now the byte offset of the position start // now we know where is located the position structure pointing to the start of the catalogue if(offset < 0) throw SRC_BUG; // signed int overflow // skipping the start of "location" if(! f.skip_relative(-offset)) throw Erange("",""); t_start = f.get_position(); } catch(Erange &e) { throw Erange("terminateur::get_catalogue", gettext("Badly formatted terminator, cannot extract catalogue location: ") + e.get_message()); } // reading and returning the position pos = infinint(f); } } // end of namespace dar-2.5.3/src/libdar/sar_tools.cpp0000644000175000017430000001001712641772777013772 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif } // end extern "C" #include "sar_tools.hpp" #include "erreurs.hpp" #include "user_interaction.hpp" #include "sar.hpp" #include "tools.hpp" #include "tuyau.hpp" #include "cygwin_adapt.hpp" #include "deci.hpp" using namespace std; namespace libdar { string sar_tools_make_filename(const string & base_name, const infinint & num, const infinint & min_digits, const string & ext) { deci conv = num; string digits = conv.human(); return base_name + '.' + sar_tools_make_padded_number(digits, min_digits) + '.' + ext; } bool sar_tools_extract_num(const string & filename, const string & base_name, const infinint & min_digits, const string & ext, infinint & ret) { try { U_I min_size = base_name.size() + ext.size() + 2; // 2 for two dot characters if(filename.size() <= min_size) return false; // filename is too short if(infinint(filename.size() - min_size) < min_digits && !min_digits.is_zero()) return false; // not enough room for all digits if(filename.find(base_name) != 0) // checking that base_name is present at the beginning return false; if(filename.rfind(ext) != filename.size() - ext.size()) // checking that extension is at the end return false; deci conv = string(filename.begin()+base_name.size()+1, filename.begin() + (filename.size() - ext.size()-1)); ret = conv.computer(); return true; } catch(Ethread_cancel & e) { throw; } catch(Egeneric &e) { return false; } } bool sar_tools_get_higher_number_in_dir(entrepot & entr, const string & base_name, const infinint & min_digits, const string & ext, infinint & ret) { infinint cur; bool somme = false; string entry; entr.read_dir_reset(); ret = 0; somme = false; while(entr.read_dir_next(entry)) if(sar_tools_extract_num(entry, base_name, min_digits, ext, cur)) { if(cur > ret) ret = cur; somme = true; } return somme; } string sar_tools_make_padded_number(const string & num, const infinint & min_digits) { string ret = num; while(infinint(ret.size()) < min_digits) ret = string("0") + ret; return ret; } } // end of namespace dar-2.5.3/src/libdar/catalogue.hpp0000644000175000017430000003106612642474445013735 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file catalogue.hpp /// \brief here is defined the many classed which is build of the catalogue /// \ingroup Private #ifndef CATALOGUE_HPP #define CATALOGUE_HPP #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif } // end extern "C" #include "infinint.hpp" #include "generic_file.hpp" #include "path.hpp" #include "compressor.hpp" #include "integers.hpp" #include "mask.hpp" #include "user_interaction.hpp" #include "label.hpp" #include "escape.hpp" #include "on_pool.hpp" #include "datetime.hpp" #include "slice_layout.hpp" #include "mem_ui.hpp" #include "cat_entree.hpp" #include "cat_nomme.hpp" #include "cat_directory.hpp" namespace libdar { /// \addtogroup Private /// @{ /// the catalogue class which gather all objects contained in a give archive class catalogue : protected mem_ui, public on_pool { public : catalogue(const user_interaction & dialog, const datetime & root_last_modif, const label & data_name); catalogue(const user_interaction & dialog, const pile_descriptor & pdesc, const archive_version & reading_ver, compression default_algo, bool lax, const label & lax_layer1_data_name, //< ignored unless in lax mode, in lax mode unless it is a cleared label, forces the catalogue label to be equal to the lax_layer1_data_name for it be considered a plain internal catalogue, even in case of corruption bool only_detruit = false); //< if set to true, only directories and detruit objects are read from the archive catalogue(const catalogue & ref) : mem_ui(ref), out_compare(ref.out_compare) { partial_copy_from(ref); }; const catalogue & operator = (const catalogue &ref); virtual ~catalogue() { detruire(); }; // reading methods. The reading is iterative and uses the current_read cat_directory pointer virtual void reset_read() const; // set the reading cursor to the beginning of the catalogue virtual void end_read() const; // set the reading cursor to the end of the catalogue virtual void skip_read_to_parent_dir() const; // skip all items of the current dir and of any subdir, the next call will return // next item of the parent dir (no cat_eod to exit from the current dir !) virtual bool read(const cat_entree * & ref) const; // sequential read (generates cat_eod) and return false when all files have been read virtual bool read_if_present(std::string *name, const cat_nomme * & ref) const; // pseudo-sequential read (reading a directory still // implies that following read are located in this subdirectory up to the next EOD) but // it returns false if no entry of this name are present in the current directory // a call with nullptr as first argument means to set the current dir the parent directory void remove_read_entry(std::string & name); // in the currently read directory, removes the entry which name is given in argument const cat_directory & get_current_reading_dir() const { if(current_read == nullptr) throw SRC_BUG; return *current_read; }; // remove from the catalogue all the entries that have not yet been read // by read(). void tail_catalogue_to_current_read(); void reset_sub_read(const path &sub); // initialise sub_read to the given directory bool sub_read(const cat_entree * &ref); // sequential read of the catalogue, ignoring all that // is not part of the subdirectory specified with reset_sub_read // the read include the inode leading to the sub_tree as well as the pending cat_eod // return true if the last read entry has already been read // and has not to be counted again. This is never the case for catalogue but may occure // with escape_catalogue (where from the 'virtual'). // last this method gives a valid result only if the last read() entry is a directory as // only directory may be read() twice. virtual bool read_second_time_dir() const { return false; }; // Additions methods. The addition is also iterative but uses its specific current_add directory pointer void reset_add(); /// catalogue extension routines for escape sequence // real implementation is only needed in escape_catalogue class, here there nothing to be done virtual void pre_add(const cat_entree *ref) const {}; virtual void pre_add_ea(const cat_entree *ref) const {}; virtual void pre_add_crc(const cat_entree *ref) const {}; virtual void pre_add_dirty() const {}; virtual void pre_add_ea_crc(const cat_entree *ref) const {}; virtual void pre_add_waste_mark() const {}; virtual void pre_add_failed_mark() const {}; virtual void pre_add_fsa(const cat_entree *ref) const {}; virtual void pre_add_fsa_crc(const cat_entree *ref) const {}; virtual escape *get_escape_layer() const { return nullptr; }; void add(cat_entree *ref); // add at end of catalogue (sequential point of view) void re_add_in(const std::string &subdirname); // return into an already existing subdirectory for further addition void re_add_in_replace(const cat_directory &dir); // same as re_add_in but also set the properties of the existing directory to those of the given argument void add_in_current_read(cat_nomme *ref); // add in currently read directory const cat_directory & get_current_add_dir() const { if(current_add == nullptr) throw SRC_BUG; return *current_add; }; // Comparison methods. The comparision is here also iterative and uses its specific current_compare directory pointer void reset_compare() const; bool compare(const cat_entree * name, const cat_entree * & extracted) const; // returns true if the ref exists, and gives it back in second argument as it is in the current catalogue. // returns false is no entry of that nature exists in the catalogue (in the current directory) // if ref is a directory, the operation is normaly relative to the directory itself, but // such a call implies a chdir to that directory. thus, a call with an EOD is necessary to // change to the parent directory. // note : // if a directory is not present, returns false, but records the inexistant subdirectory // structure defined by the following calls to this routine, this to be able to know when // the last available directory is back the current one when changing to parent directory, // and then proceed with normal comparison of inode. In this laps of time, the call will // always return false, while it temporary stores the missing directory structure // non interative methods /// add into "this" detruit object corresponding to object of ref absent in "this" /// ///\note ref must have the same directory tree "this", else the operation generates an exception infinint update_destroyed_with(const catalogue & ref); /// copy from ref missing files in "this" and mark then as "not_saved" (no change since reference) /// /// in case of abortion, completes missing files as if what could not be /// inspected had not changed since the reference was done /// aborting_last_etoile is the highest etoile reference withing "this" current object. void update_absent_with(const catalogue & ref, infinint aborting_next_etoile); /// remove/destroy from "this" all objects that are neither directory nor detruit objects void drop_all_non_detruits(); /// check whether all inode existing in the "this" and ref have the same attributes /// /// \note stops at the first inode found in both catalogue that do not match for at least one attribute /// including CRC for DATA, EA or FSA if present, then return false. bool is_subset_of(const catalogue & ref) const; /// before dumping the catalogue, need to set all hardlinked inode they have not been saved once void reset_dump() const; /// write down the whole catalogue to file void dump(const pile_descriptor & pdesc) const; void listing(bool isolated, const mask &selection, const mask & subtree, bool filter_unsaved, bool list_ea, std::string marge) const; void tar_listing(bool isolated, const mask & selection, const mask & subtree, bool filter_unsaved, bool list_ea, std::string beginning) const; void xml_listing(bool isolated, const mask & selection, const mask & subtree, bool filter_unsaved, bool list_ea, std::string beginning) const; void slice_listing(bool isolated, const mask & selection, const mask & subtree, const slice_layout & slicing) const; entree_stats get_stats() const { return stats; }; /// whether the catalogue is empty or not bool is_empty() const { if(contenu == nullptr) throw SRC_BUG; return contenu->is_empty(); }; const cat_directory *get_contenu() const { return contenu; }; // used by data_tree const label & get_data_name() const { return ref_data_name; }; datetime get_root_dir_last_modif() const { return contenu->get_last_modif(); }; /// recursive evaluation of directories that have changed (make the cat_directory::get_recurisve_has_changed() method of entry in this catalogue meaningful) void launch_recursive_has_changed_update() const { contenu->recursive_has_changed_update(); }; datetime get_root_mtime() const { return contenu->get_last_modif(); }; /// reset all pointers to the root (a bit better than reset_add() + reset_read() + reset_compare() + reset_sub_read()) void reset_all(); void set_to_unsaved_data_and_FSA() { if(contenu == nullptr) throw SRC_BUG; contenu->recursively_set_to_unsaved_data_and_FSA(); }; /// change location where to find EA, FSA and DATA for all the objects of the catalogue void change_location(const pile_descriptor & pdesc) { contenu->change_location(pdesc); }; protected: entree_stats & access_stats() { return stats; }; void set_data_name(const label & val) { ref_data_name = val; }; void copy_detruits_from(const catalogue & ref); // needed for escape_catalogue implementation only. const cat_eod * get_r_eod_address() const { return & r_eod; }; // cat_eod are never stored in the catalogue // however it is sometimes required to return such a reference to a valid object // owned by the catalogue. /// invert the data tree memory management responsibility pointed to by "contenu" pointers between the current /// catalogue and the catalogue given in argument. void swap_stuff(catalogue & ref); private : cat_directory *contenu; ///< catalogue contents path out_compare; ///< stores the missing directory structure, when extracting cat_directory *current_compare; ///< points to the current directory when extracting cat_directory *current_add; ///< points to the directory where to add the next file with add_file; cat_directory *current_read; ///< points to the directory where the next item will be read path *sub_tree; ///< path to sub_tree signed int sub_count; ///< count the depth in of read routine in the sub_tree entree_stats stats; ///< statistics catalogue contents label ref_data_name; ///< name of the archive where is located the data void partial_copy_from(const catalogue &ref); void detruire(); static const cat_eod r_eod; // needed to return eod reference, without taking risk of saturating memory static const U_I CAT_CRC_SIZE; }; /// @} } // end of namespace #endif dar-2.5.3/src/my_config.h0000644000175000017430000000233312610405012012114 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #ifndef MY_CONFIG_H #define MY_CONFIG_H #if HAVE_CONFIG_H #define NODUMP_LINUX 0 #define NODUMP_EXT2FS 1 #include "../config.h" // workaround for autoconf 2.59 #undef mbstate_t #endif #include "gettext.h" #endif dar-2.5.3/src/README0000644000175000017430000000210712610404647010665 00000000000000What will you find here? Source code for dar suite program. libdar directory contains all code of dar that have been moved since version 2.0.0 to a separated library known as libdar. dar_suite directory contains all the rest of the code of dar, which is command-line specific examples directory contains few programs that illustrate the use of infinint, they are built when using --enable-examples with the configure script. testing directory contains a plethora of very simple program that helped validate each C++ module of dar. They are to be used in step by step debugging and in conjunction with variable watch. Theses programs are intended to be used only by developers, they are built when using --enable-examples with the configure script. check contains the global validation routine that are run when calling "make check". Note that running 'make check' may take several days to complete depending on the power of your computer, this is also due to the fact that these routine are very basic but robust, they are not especially optimized for speed. dar-2.5.3/src/dar_suite/0000755000175000017520000000000012642474572012055 500000000000000dar-2.5.3/src/dar_suite/line_tools.cpp0000644000175000017430000005070612641772777014667 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #ifdef HAVE_STRING_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_FCNTL_H #include #endif #include "getopt_decision.h" } #include #include #include #include #include "line_tools.hpp" #include "deci.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "fichier_local.hpp" using namespace std; using namespace libdar; //// argc_argv::argc_argv(S_I size) { x_argc = size; if(x_argc > 0) { x_argv = new (nothrow) char *[size]; if(x_argv == nullptr) throw Ememory("argc_argv::argc_argv"); for(S_I i = 0; i < x_argc; i++) x_argv[i] = nullptr; } else x_argv = nullptr; } argc_argv::~argc_argv() { if(x_argv == nullptr && x_argc > 0) throw SRC_BUG; for(S_I i = 0; i < x_argc; i++) if(x_argv[i] != nullptr) { delete [] x_argv[i]; x_argv[i] = nullptr; } if(x_argc > 0) delete [] x_argv; } void argc_argv::set_arg(const string & arg, S_I index) { if(index >= x_argc) throw Erange("argc_argv::set_arg", gettext("Index out of range")); if(x_argv[index] != nullptr) { delete [] x_argv[index]; x_argv[index] = nullptr; } x_argv[index] = new (nothrow) char[arg.size() + 1]; if(x_argv[index] == nullptr) throw Ememory("argc_argv::set_arg"); strncpy(x_argv[index], arg.c_str(), arg.size()); x_argv[index][arg.size()] = '\0'; } void argc_argv::set_arg(generic_file & f, U_I size, S_I index) { if(index >= x_argc) throw Erange("argc_argv::set_arg", gettext("Index out of range")); if(x_argv[index] != nullptr) { delete [] x_argv[index]; x_argv[index] = nullptr; } x_argv[index] = new (nothrow) char [size+1]; if(x_argv[index] == nullptr) throw Ememory("argc_argv::set_arg"); x_argv[index][f.read(x_argv[index], size)] = '\0'; } void argc_argv::resize(S_I size) { char **tmp = nullptr; if(size == x_argc) return; if(size < x_argc) for(S_I i = size; i < x_argc; i++) if(x_argv[i] != nullptr) { delete [] x_argv[i]; x_argv[i] = nullptr; } tmp = new (nothrow) char*[size]; if(tmp == nullptr) throw Ememory("argc_argv::resize"); try { S_I min = size < x_argc ? size : x_argc; for(S_I i = 0; i < min; i++) tmp[i] = x_argv[i]; for(S_I i = min; i < size; i++) tmp[i] = nullptr; if(x_argc > 0) delete [] x_argv; x_argv = tmp; tmp = nullptr; x_argc = size; } catch(...) { if(tmp != nullptr) delete [] tmp; throw; } } //// static string build(string::iterator a, string::iterator b); void line_tools_slice_ownership(const string & cmd, string & slice_permission, string & slice_user_ownership, string & slice_group_ownership) { string::iterator s1, s2; s1 = const_cast(&cmd)->begin(); // looking for the first ':' while(s1 != cmd.end() && *s1 != ':') s1++; s2 = s1; if(s2 != cmd.end()) s2++; // looking for the second ':' while(s2 != cmd.end() && *s2 != ':') s2++; if(s1 == cmd.begin()) slice_permission = ""; else slice_permission = build(const_cast(&cmd)->begin(), s1); if(s1 == cmd.end()) slice_user_ownership = ""; else slice_user_ownership = build(s1+1, s2); if(s2 == cmd.end()) slice_group_ownership = ""; else slice_group_ownership = build(s2+1, const_cast(&cmd)->end()); } void line_tools_repeat_param(const string & cmd, infinint & repeat_count, infinint & repeat_byte) { string::iterator s1; string tmp1, tmp2; s1 = const_cast(&cmd)->begin(); // looking for the first ':' while(s1 != cmd.end() && *s1 != ':') s1++; if(s1 != cmd.end()) // thus *s1 == ':' { tmp1 = build(const_cast(&cmd)->begin(), s1); tmp2 = build(s1+1, const_cast(&cmd)->end()); } else { tmp1 = cmd; tmp2 = "0"; } try { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci x1 = tmp1; libdar::deci x2 = tmp2; repeat_count = x1.computer(); repeat_byte = x2.computer(); } catch(Edeci & e) { throw Erange("line_tools_repeat_param", string(gettext("Syntax error in --retry-on-change argument: ")) + e.get_message()); } } void line_tools_tlv_list2argv(user_interaction & dialog, tlv_list & list, argc_argv & arg) { memory_file mem = memory_file(); U_I transfert = 0; infinint size; arg.resize(list.size()); for(S_I i = 0; i < arg.argc() ; i++) { if(list[i].get_type() != 0) // we only use type 0 here throw Erange("line_tools_tlv_list2argv", gettext("Unknown TLV record type")); size = list[i].size(); transfert = 0; size.unstack(transfert); if(!size.is_zero()) throw Erange("line_tools_tlv_list2argv", "Too long argument found in TLV to be handled by standard library routine"); list[i].skip(0); arg.set_arg(list[i], transfert, i); } } S_I line_tools_reset_getopt() { S_I ret = optind; #if HAVE_OPTRESET optreset = 1; optind = 1; #else optind = 0; #endif return ret; } string::const_iterator line_tools_find_first_char_out_of_parenth(const string & argument, unsigned char to_find) { string::const_iterator it = argument.begin(); U_I parenth = 0; while(it != argument.end() && (*it != to_find || parenth > 0)) { switch(*it) { case '(': ++parenth; break; case ')': if(parenth > 0) --parenth; else throw Erange("line_tools_find_first_char_out_of_parenth", string(gettext("Unbalanced parenthesis in expression: ")) + argument); break; // no default: statement needed } ++it; } return it; } string::const_iterator line_tools_find_last_char_out_of_parenth(const string & argument, unsigned char to_find) { string::const_iterator it = argument.begin(); string::const_iterator back = it; U_I parenth = 0; while(it != argument.end()) { if(*it == to_find && parenth == 0) back = it; switch(*it) { case '(': ++parenth; break; case ')': if(parenth > 0) --parenth; else throw Erange("line_tools_find_first_char_out_of_parenth", string(gettext("Unbalanced parenthesis in expression: ")) + argument); break; // no default: statement needed } ++it; } if(back == argument.begin()) if(back != argument.end() && *back != to_find) back = argument.end(); return back; } string line_tools_expand_user_comment(const string & user_comment, S_I argc, char *const argv[]) { string::const_iterator it = user_comment.begin(); string::const_iterator st = it; string ret = ""; while(it != user_comment.end()) { if(*it == '%') { it++; if(it != user_comment.end()) { ret += string(st, it - 1); st = it+1; switch(*it) { case 'c': ret += string("\"") + argv[0] + "\""; for(S_I i = 1; i < argc; ++i) if(strcmp(argv[i], "-K") == 0 || strcmp(argv[i], "-J") == 0 || strcmp(argv[i], "-$") == 0 || strcmp(argv[i], "-#") == 0 || strcmp(argv[i], "-*") == 0 || strcmp(argv[i], "-%") == 0 || strcmp(argv[i], "--key") == 0 || strcmp(argv[i], "--ref-key") == 0 || strcmp(argv[i], "--aux-key") == 0 || strcmp(argv[i], "--crypto-block") == 0 || strcmp(argv[i], "--ref-crypto-block") == 0 || strcmp(argv[i], "--aux-crypto-block") == 0) ++i; else ret += string(" \"") + argv[i] + "\""; break; case 'd': ret += tools_get_date_utc(); break; case 'u': ret += tools_get_euid(); break; case 'g': ret += tools_get_egid(); break; case 'h': ret += tools_get_hostname(); break; case '%': ret += "%"; break; default: throw Erange("line_tools_expand_user_comment", tools_printf(gettext("Unknown macro %%%d in user comment"), *it)); } } } it++; } if(st != user_comment.end()) ret += string(st, user_comment.end()); return ret; } vector line_tools_explode_PATH(const char *the_path) { vector ret; const char *it = the_path; const char *last = it; ret.clear(); if(it == nullptr) return ret; while(*it != '\0') { if(*it == ':') { ret.push_back(string(last, it)); ++it; last = it; } else ++it; } ret.push_back(string(last, it)); return ret; } string line_tools_get_full_path_from_PATH(const vector & the_path, const char * filename) { string ret; bool no_path = false; if(filename == nullptr) throw SRC_BUG; else { try { path tmp = filename; if(!tmp.is_relative()) no_path = false; // no need to check if file exist using the_path, path is absolute else if(tmp.degre() != 1) no_path = false; // this is a composed path, we must not inspect the_path else no_path = true; // this is just the filename without path indication, so we check the_path } catch(Erange & e) { if(e.get_source() == "path::path") no_path = false; // not a valid path else throw; } } if(!no_path) ret = filename; else { vector::const_iterator it = the_path.begin(); bool found = false; while(!found && it != the_path.end()) { try { string where = (path(*it) + filename).display(); fichier_local tmp = fichier_local(where, false); found = true; ret = where; } catch(...) { ++it; } } if(!found) ret = filename; } return ret; } void line_tools_split_at_first_space(const char *field, string & before_space, string & after_space) { const char *ptr = field; if(field == nullptr) throw SRC_BUG; while(*ptr != ' ' && *ptr != '\0') ++ptr; if(*ptr == '\0') { before_space = field; after_space = ""; } else { before_space = string(field, ptr); after_space = string(ptr + 1); } } void line_tools_get_min_digits(string the_arg, infinint & num, infinint & ref_num, infinint & aux_num) { num = ref_num = aux_num = 0; string::iterator it1, it2; if(the_arg == "") return; try { it1 = tools_find_first_char_of(the_arg, ','); if(it1 == the_arg.end()) // a single number is provided { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci tmp = the_arg; num = tmp.computer(); } else // at least two numbers are provided { if(the_arg.begin() != it1) { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci convert = string(the_arg.begin(), it1); num = convert.computer(); } // else we ignore the leading ',' ++it1; if(it1 == the_arg.end()) return; // trailing ',' has to be ignored string tmp2 = string(it1, the_arg.end()); it2 = tools_find_first_char_of(tmp2, ','); if(it2 == tmp2.end()) // just two number have been provided { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci convert = tmp2; ref_num = convert.computer(); } else { if(tmp2.begin() != it2) { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci convert = string(tmp2.begin(), it2); ref_num = convert.computer(); } ++it2; if(it2 != tmp2.end()) { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci convert = string(it2, tmp2.end()); aux_num = convert.computer(); } } } } catch(Edeci & e) { throw Erange("line_tools_get_min_digits", tools_printf(gettext("Invalid number in string: %S"), &the_arg)); } } void line_tools_look_for(const vector & arguments, S_I argc, char *const argv[], const char *getopt_string, #if HAVE_GETOPT_LONG const struct option *long_options, #endif char stop_scan, vector & presence) { S_I lu; presence.clear(); (void)line_tools_reset_getopt(); #if HAVE_GETOPT_LONG const struct option *ptr_long_opt = long_options; const struct option voided = { nullptr, 0, nullptr, 0 }; if(long_options == nullptr) ptr_long_opt = &voided; while((lu = getopt_long(argc, argv, getopt_string, ptr_long_opt, nullptr)) != EOF && stop_scan != lu) #else while((lu = getopt(argc, argv, getopt_string)) != EOF && stop_scan != lu) #endif { vector::const_iterator it = find(arguments.begin(), arguments.end(), (char)lu); if(it != arguments.end()) presence.push_back(lu); } (void)line_tools_reset_getopt(); } void line_tools_look_for_Q(S_I argc, char *const argv[], const char *getopt_string, #if HAVE_GETOPT_LONG const struct option *long_options, #endif char stop_scan, bool & Q_is_present) { vector arguments; vector presence; vector::const_iterator it; Q_is_present = false; arguments.push_back('j'); arguments.push_back('Q'); line_tools_look_for(arguments, argc, argv, getopt_string, #if HAVE_GETOPT_LONG long_options, #endif stop_scan, presence); it = find(presence.begin(), presence.end(), 'Q'); if(it != presence.end()) Q_is_present = true; } vector line_tools_split(const string & val, char sep) { vector ret; string::const_iterator be = val.begin(); string::const_iterator ne = val.begin(); while(ne != val.end()) { if(*ne != sep) ++ne; else { ret.push_back(string(be, ne)); ++ne; be = ne; } } if(be != val.end()) ret.push_back(string(be, ne)); return ret; } void line_tools_4_4_build_compatible_overwriting_policy(bool allow_over, bool detruire, bool more_recent, const infinint & hourshift, bool ea_erase, const crit_action * & overwrite) { crit_action *tmp1 = nullptr; crit_action *tmp2 = nullptr; // tmp1 and tmp2 are used for construction of the overwriting policy overwrite = nullptr; try { if(allow_over) { if(ea_erase) overwrite = new crit_constant_action(data_overwrite, EA_overwrite); else overwrite = new crit_constant_action(data_overwrite, EA_merge_overwrite); if(overwrite == nullptr) throw Ememory("tools_build_compatible_overwriting_policy"); tmp1 = new crit_constant_action(data_preserve, EA_preserve); if(tmp1 == nullptr) throw Ememory("tools_build_compatible_overwriting_policy"); if(more_recent) { tmp2 = new testing(crit_invert(crit_in_place_data_more_recent(hourshift)), *overwrite, *tmp1); if(tmp2 == nullptr) throw Ememory("tools_build_compatible_overwriting_policy"); delete overwrite; overwrite = tmp2; tmp2 = nullptr; } if(!detruire) { tmp2 = new testing(crit_invert(crit_in_place_is_inode()), *overwrite, *tmp1); if(tmp2 == nullptr) throw Ememory("tools_build_compatible_overwriting_policy"); delete overwrite; overwrite = tmp2; tmp2 = nullptr; } delete tmp1; tmp1 = nullptr; } else { overwrite = new crit_constant_action(data_preserve, EA_preserve); if(overwrite == nullptr) throw Ememory("tools_build_compatible_overwriting_policy"); } if(overwrite == nullptr) throw SRC_BUG; if(tmp1 != nullptr) throw SRC_BUG; if(tmp2 != nullptr) throw SRC_BUG; } catch(...) { if(tmp1 != nullptr) delete tmp1; if(tmp2 != nullptr) delete tmp2; if(overwrite != nullptr) { delete overwrite; overwrite = nullptr; } throw; } } void line_tools_crypto_split_algo_pass(const secu_string & all, crypto_algo & algo, secu_string & pass, bool & no_cipher_given, vector & recipients) { // split from "algo:pass" "algo" "pass" "algo:" ":pass" syntaxes const char *it = all.c_str(); const char *fin = all.c_str() + all.get_size(); // points past the last byte of the secu_string "all" secu_string tmp; recipients.clear(); if(all.get_size() == 0) { algo = crypto_none; pass.clear(); } else { while(it != fin && *it != ':') ++it; if(it != fin) // a ':' is present in the given string { // tmp holds the string before ':' tmp = secu_string(all.c_str(), it - all.c_str()); ++it; // pass holds the string after ':' pass = secu_string(it, fin - it); no_cipher_given = (tmp == ""); if(tmp == "scrambling" || tmp == "scram") algo = crypto_scrambling; else if(tmp == "none") algo = crypto_none; else if(tmp == "blowfish" || tmp == "bf" || tmp == "") algo = crypto_blowfish; // blowfish is the default cypher ("") else if(tmp == "aes" || tmp == "aes256") algo = crypto_aes256; else if(tmp == "twofish" || tmp == "twofish256") algo = crypto_twofish256; else if(tmp == "serpent" || tmp == "serpent256") algo = crypto_serpent256; else if(tmp == "camellia" || tmp == "camellia256") algo = crypto_camellia256; else if(tmp == "gnupg") { secu_string emails; line_tools_crypto_split_algo_pass(pass, algo, emails, no_cipher_given, recipients); recipients = line_tools_split(emails.c_str(), ','); pass.clear(); } else throw Erange("crypto_split_algo_pass", string(gettext("unknown cryptographic algorithm: ")) + tmp.c_str()); } else // no ':' using blowfish as default cypher { no_cipher_given = true; algo = crypto_blowfish; pass = all; } } } void line_tools_display_signatories(user_interaction & ui, const list & gnupg_signed) { list::const_iterator it = gnupg_signed.begin(); string tmp; if(gnupg_signed.empty()) return; ui.printf( "+-----------------+----------------+----------------------------------------+-------------------------+"); ui.printf(gettext("| Signature Status| Key Status | Finger Print | Signature Date |")); ui.printf( "+-----------------+----------------+----------------------------------------+-------------------------+"); while(it != gnupg_signed.end()) { tmp = ""; switch(it->result) { case signator::good: tmp += "| Good |"; break; case signator::bad: tmp += "| BAD !!! |"; break; case signator::unknown_key: tmp += "| Unknown Key |"; break; case signator::error: tmp += "| System Error |"; break; default: throw SRC_BUG; } switch(it->key_validity) { case signator::valid: tmp += " Valid |"; break; case signator::expired: tmp += " EXPIRED |"; break; case signator::revoked: tmp += " REVOKED |"; break; default: throw SRC_BUG; } tmp += it->fingerprint + "|"; tmp += tools_display_date(it->signing_date) + " |"; ui.warning(tmp); if(it->key_validity == signator::expired) { tmp = " |" + tools_display_date(it->signature_expiration_date); ui.warning(tmp); } ++it; } ui.printf("------------------+----------------+----------------------------------------+-------------------------+"); ui.printf(" For more information about a key, use the command: gpg --list-key "); } /////////////////// static string build(string::iterator a, string::iterator b) { string ret = ""; while(a != b) ret += *a++; return ret; } dar-2.5.3/src/dar_suite/hide_file.cpp0000644000175000017430000001126012641772777014420 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "hide_file.hpp" #include "infinint.hpp" using namespace libdar; #define CHECK_INIT if(!is_init) init() hide_file::hide_file(generic_file &f) : generic_file(gf_read_only) { if(f.get_mode() == gf_write_only) throw Erange("hide_file::hide_file", gettext("hide_file cannot be initialized with write-only file")); ref = &f; if(ref == nullptr) throw SRC_BUG; // nullptr argument given is_init = false; pos_index = 0; pos_relicat = 0; } bool hide_file::skip(const infinint & pos) { CHECK_INIT; if(is_terminated()) throw SRC_BUG; U_I it = 0; while(it < morceau.size() && morceau[it].offset + morceau[it].longueur - 1 < pos) ++it; if(it >= morceau.size()) return false; if(morceau[it].offset > pos) throw SRC_BUG; // morceau has a hole in it. pos_index = it; pos_relicat = pos - morceau[it].offset; return true; } bool hide_file::skip_to_eof() { CHECK_INIT; if(is_terminated()) throw SRC_BUG; pos_index = morceau.size(); return true; } bool hide_file::skip_relative(S_I x) { CHECK_INIT; if(is_terminated()) throw SRC_BUG; if(x > 0) { infinint my_x = x; while(my_x > 0 && pos_index < morceau.size()) { if(pos_relicat + my_x >= morceau[pos_index].longueur) { my_x -= morceau[pos_index].longueur - pos_relicat; pos_relicat = 0; ++pos_index; } else { pos_relicat += my_x; my_x = 0; } } return pos_index < morceau.size(); } else if(x < 0) { infinint my_x = -x; // make x a positive value while(my_x > 0 && (pos_index < morceau.size() || pos_relicat > 0)) { if(my_x > pos_relicat) { --pos_index; if(pos_index < morceau.size()) { my_x -= pos_relicat; pos_relicat = morceau[pos_index].longueur; } else { pos_index = 0; return false; } } else pos_relicat -= my_x; return true; } } return true; } infinint hide_file::get_position() const { CHECK_INIT; if(is_terminated()) throw SRC_BUG; if(pos_index >= morceau.size()) if(morceau.empty()) return 0; // empty virtual file else return morceau.back().offset + morceau.back().longueur; else return morceau[pos_index].offset + pos_relicat; } U_I hide_file::inherited_read(char *a, U_I size) { CHECK_INIT; if(is_terminated()) throw SRC_BUG; U_I lu = 0, tmp_lu = 0; size_t maxlire; size_t reste; while(lu < size && pos_index < morceau.size()) { maxlire = 0; (morceau[pos_index].longueur - pos_relicat).unstack(maxlire); reste = size - lu; maxlire = maxlire > reste ? reste : maxlire; ref->skip(morceau[pos_index].debut+pos_relicat); tmp_lu = ref->read(a+lu, maxlire); if(tmp_lu == 0 && maxlire > 0) throw SRC_BUG; lu += tmp_lu; pos_relicat += lu; if(pos_relicat >= morceau[pos_index].longueur) { pos_index++; pos_relicat = 0; } } return lu; } void hide_file::inherited_write(const char *a, size_t size) { CHECK_INIT; throw SRC_BUG; // hide_file alsways is read-only ! } void hide_file::init() const { hide_file *me = const_cast(this); if(me == nullptr) throw SRC_BUG; me->fill_morceau(); me->is_init = true; } dar-2.5.3/src/dar_suite/my_getopt_long.h0000644000175000017430000000506412610405012015153 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file my_getopt_long.h /// \brief may lead to the definition of getopt_long to solve declaration conflicts in and /// \ingroup CMDLINE #ifndef MY_GETOPT_LONG_H #define MY_GETOPT_LONG_H // getopt may be declated in on systems like FreeBSD. // if you want to use libgnugetopt you need to include // on this system. Thus a conflict appear because the getopt is // declared twice. To avoid you either have not to include // or not to include . But neither the first nor the // second is acceptable, because we need other stuf declared in // (open() & so on) and stuf declared in // (like getopt_long which is gnu typical). // // to solve this problem, I have extracted the gnu getopt_long // as declared under Linux in the present file. When getopt is // declared in it is still possible to include the // current file in place of , to get getopt_long available // // at linking time, if libgnugetopt is available we use it // // see getopt_decision.hpp # define no_argument 0 # define required_argument 1 # define optional_argument 2 struct option { # if defined __STDC__ && __STDC__ const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); #endif dar-2.5.3/src/dar_suite/Makefile.am0000644000175000017430000000635412641772777014050 00000000000000# # conditionnal part: --enable-build-static # if BUILD_DAR_STATIC ALSO_BUILD = dar_static else ALSO_BUILD = endif # # Conditionnal part : Profiling # if PROFILING LD_PROF = -pg CPP_PROF = -pg clean-local: rm -f gmon.out else LD_PROF = CPP_PROF = clean-local: endif # # conditionnal part: --enable-mode=... # localedir = @localedir@ system_path = @sysconfdir@ if BUILD_MODE32 MYLIB=libdar32 AM_CPPFLAGS=-DLIBDAR_MODE=32 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" -DDAR_SYS_DIR=\"$(system_path)\" $(CPP_PROF) $(GPGME_CFLAGS) else if BUILD_MODE64 MYLIB=libdar64 AM_CPPFLAGS=-DLIBDAR_MODE=64 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" -DDAR_SYS_DIR=\"$(system_path)\" $(CPP_PROF) $(GPGME_CFLAGS) else MYLIB=libdar AM_CPPFLAGS=-I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" -DDAR_SYS_DIR=\"$(system_path)\" $(CPP_PROF) $(GPGME_CFLAGS) endif endif # # conditionnal part UPX # if USE_UPX UPX = @UPX_PROG@ if BUILD_DAR_STATIC ALSO_BUILD_INST = $(ALSO_BUILD)$(EXEEXT) else ALSO_BUILD_INST = endif install-exec-hook : cd $(DESTDIR)$(bindir) ; $(UPX) -9 dar$(EXEEXT) dar_xform$(EXEEXT) dar_slave$(EXEEXT) dar_manager$(EXEEXT) dar_cp$(EXEEXT) $(ALSO_BUILD_INST) else install-exec-hook: echo "no executable packing, UPX not found or disabled" endif # # unconditionnal part # bin_PROGRAMS = dar dar_xform dar_slave dar_manager dar_cp dar_split $(ALSO_BUILD) LDADD = ../libdar/$(MYLIB).la $(GPGME_LIBS) if DEBUG_STATIC AM_LDFLAGS = -all-static @LTLIBINTL@ $(LD_PROF) else AM_LDFLAGS = @LTLIBINTL@ $(LD_PROF) endif dar_SOURCES = command_line.cpp command_line.hpp config_file.cpp config_file.hpp dar.cpp dar.hpp dar_suite.cpp dar_suite.hpp hide_file.cpp hide_file.hpp no_comment.cpp no_comment.hpp shell_interaction.cpp shell_interaction.hpp getopt_decision.h my_getopt_long.h line_tools.hpp line_tools.cpp crit_action_cmd_line.cpp crit_action_cmd_line.hpp dar_DEPENDENCIES = ../libdar/$(MYLIB).la dar_xform_SOURCES = dar_suite.cpp dar_suite.hpp dar_xform.cpp shell_interaction.cpp shell_interaction.hpp line_tools.hpp line_tools.cpp dar_xform_DEPENDENCIES = ../libdar/$(MYLIB).la dar_slave_SOURCES = dar_suite.cpp dar_suite.hpp dar_slave.cpp shell_interaction.cpp shell_interaction.hpp line_tools.hpp line_tools.cpp dar_slave_DEPENDENCIES = ../libdar/$(MYLIB).la dar_manager_SOURCES = dar_suite.cpp dar_suite.hpp dar_manager.cpp shell_interaction.cpp shell_interaction.hpp getopt_decision.h my_getopt_long.h line_tools.hpp line_tools.cpp no_comment.cpp no_comment.hpp hide_file.cpp hide_file.hpp dar_manager_DEPENDENCIES = ../libdar/$(MYLIB).la dar_cp_SOURCES = dar_suite.cpp dar_suite.hpp dar_cp.cpp shell_interaction.cpp shell_interaction.hpp line_tools.hpp line_tools.cpp dar_cp_DEPENDENCIES = ../libdar/$(MYLIB).la dar_split_SOURCES = dar_split.c # # dar_static ( --enable-dar-static ) # dar_static_SOURCES = command_line.cpp command_line.hpp config_file.cpp config_file.hpp dar.cpp dar.hpp dar_suite.cpp dar_suite.hpp hide_file.cpp hide_file.hpp no_comment.cpp no_comment.hpp shell_interaction.cpp shell_interaction.hpp getopt_decision.h my_getopt_long.h line_tools.hpp line_tools.cpp crit_action_cmd_line.cpp crit_action_cmd_line.hpp dar_static_DEPENDENCIES = ../libdar/$(MYLIB).la dar_static_LDFLAGS = -all-static @LTLIBINTL@ dar-2.5.3/src/dar_suite/Makefile.in0000644000175000017520000006547612642474520014055 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # conditionnal part: --enable-build-static # VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = dar$(EXEEXT) dar_xform$(EXEEXT) dar_slave$(EXEEXT) \ dar_manager$(EXEEXT) dar_cp$(EXEEXT) dar_split$(EXEEXT) \ $(am__EXEEXT_1) subdir = src/dar_suite DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @BUILD_DAR_STATIC_TRUE@am__EXEEXT_1 = dar_static$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_dar_OBJECTS = command_line.$(OBJEXT) config_file.$(OBJEXT) \ dar.$(OBJEXT) dar_suite.$(OBJEXT) hide_file.$(OBJEXT) \ no_comment.$(OBJEXT) shell_interaction.$(OBJEXT) \ line_tools.$(OBJEXT) crit_action_cmd_line.$(OBJEXT) dar_OBJECTS = $(am_dar_OBJECTS) dar_LDADD = $(LDADD) am__DEPENDENCIES_1 = am_dar_cp_OBJECTS = dar_suite.$(OBJEXT) dar_cp.$(OBJEXT) \ shell_interaction.$(OBJEXT) line_tools.$(OBJEXT) dar_cp_OBJECTS = $(am_dar_cp_OBJECTS) dar_cp_LDADD = $(LDADD) am_dar_manager_OBJECTS = dar_suite.$(OBJEXT) dar_manager.$(OBJEXT) \ shell_interaction.$(OBJEXT) line_tools.$(OBJEXT) \ no_comment.$(OBJEXT) hide_file.$(OBJEXT) dar_manager_OBJECTS = $(am_dar_manager_OBJECTS) dar_manager_LDADD = $(LDADD) am_dar_slave_OBJECTS = dar_suite.$(OBJEXT) dar_slave.$(OBJEXT) \ shell_interaction.$(OBJEXT) line_tools.$(OBJEXT) dar_slave_OBJECTS = $(am_dar_slave_OBJECTS) dar_slave_LDADD = $(LDADD) am_dar_split_OBJECTS = dar_split.$(OBJEXT) dar_split_OBJECTS = $(am_dar_split_OBJECTS) dar_split_LDADD = $(LDADD) dar_split_DEPENDENCIES = ../libdar/$(MYLIB).la $(am__DEPENDENCIES_1) am_dar_static_OBJECTS = command_line.$(OBJEXT) config_file.$(OBJEXT) \ dar.$(OBJEXT) dar_suite.$(OBJEXT) hide_file.$(OBJEXT) \ no_comment.$(OBJEXT) shell_interaction.$(OBJEXT) \ line_tools.$(OBJEXT) crit_action_cmd_line.$(OBJEXT) dar_static_OBJECTS = $(am_dar_static_OBJECTS) dar_static_LDADD = $(LDADD) dar_static_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(dar_static_LDFLAGS) $(LDFLAGS) -o $@ am_dar_xform_OBJECTS = dar_suite.$(OBJEXT) dar_xform.$(OBJEXT) \ shell_interaction.$(OBJEXT) line_tools.$(OBJEXT) dar_xform_OBJECTS = $(am_dar_xform_OBJECTS) dar_xform_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(dar_SOURCES) $(dar_cp_SOURCES) $(dar_manager_SOURCES) \ $(dar_slave_SOURCES) $(dar_split_SOURCES) \ $(dar_static_SOURCES) $(dar_xform_SOURCES) DIST_SOURCES = $(dar_SOURCES) $(dar_cp_SOURCES) $(dar_manager_SOURCES) \ $(dar_slave_SOURCES) $(dar_split_SOURCES) \ $(dar_static_SOURCES) $(dar_xform_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXSTDFLAGS = @CXXSTDFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PROG = @DOXYGEN_PROG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPX_PROG = @UPX_PROG@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen = @doxygen@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ groff = @groff@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ # # conditionnal part: --enable-mode=... # localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmp = @tmp@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ upx = @upx@ @BUILD_DAR_STATIC_FALSE@ALSO_BUILD = @BUILD_DAR_STATIC_TRUE@ALSO_BUILD = dar_static @PROFILING_FALSE@LD_PROF = # # Conditionnal part : Profiling # @PROFILING_TRUE@LD_PROF = -pg @PROFILING_FALSE@CPP_PROF = @PROFILING_TRUE@CPP_PROF = -pg system_path = @sysconfdir@ @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@MYLIB = libdar @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@MYLIB = libdar64 @BUILD_MODE32_TRUE@MYLIB = libdar32 @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@AM_CPPFLAGS = -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" -DDAR_SYS_DIR=\"$(system_path)\" $(CPP_PROF) $(GPGME_CFLAGS) @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=64 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" -DDAR_SYS_DIR=\"$(system_path)\" $(CPP_PROF) $(GPGME_CFLAGS) @BUILD_MODE32_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=32 -I../libdar -DDAR_LOCALEDIR=\"$(localedir)\" -DDAR_SYS_DIR=\"$(system_path)\" $(CPP_PROF) $(GPGME_CFLAGS) # # conditionnal part UPX # @USE_UPX_TRUE@UPX = @UPX_PROG@ @BUILD_DAR_STATIC_FALSE@@USE_UPX_TRUE@ALSO_BUILD_INST = @BUILD_DAR_STATIC_TRUE@@USE_UPX_TRUE@ALSO_BUILD_INST = $(ALSO_BUILD)$(EXEEXT) LDADD = ../libdar/$(MYLIB).la $(GPGME_LIBS) @DEBUG_STATIC_FALSE@AM_LDFLAGS = @LTLIBINTL@ $(LD_PROF) @DEBUG_STATIC_TRUE@AM_LDFLAGS = -all-static @LTLIBINTL@ $(LD_PROF) dar_SOURCES = command_line.cpp command_line.hpp config_file.cpp config_file.hpp dar.cpp dar.hpp dar_suite.cpp dar_suite.hpp hide_file.cpp hide_file.hpp no_comment.cpp no_comment.hpp shell_interaction.cpp shell_interaction.hpp getopt_decision.h my_getopt_long.h line_tools.hpp line_tools.cpp crit_action_cmd_line.cpp crit_action_cmd_line.hpp dar_DEPENDENCIES = ../libdar/$(MYLIB).la dar_xform_SOURCES = dar_suite.cpp dar_suite.hpp dar_xform.cpp shell_interaction.cpp shell_interaction.hpp line_tools.hpp line_tools.cpp dar_xform_DEPENDENCIES = ../libdar/$(MYLIB).la dar_slave_SOURCES = dar_suite.cpp dar_suite.hpp dar_slave.cpp shell_interaction.cpp shell_interaction.hpp line_tools.hpp line_tools.cpp dar_slave_DEPENDENCIES = ../libdar/$(MYLIB).la dar_manager_SOURCES = dar_suite.cpp dar_suite.hpp dar_manager.cpp shell_interaction.cpp shell_interaction.hpp getopt_decision.h my_getopt_long.h line_tools.hpp line_tools.cpp no_comment.cpp no_comment.hpp hide_file.cpp hide_file.hpp dar_manager_DEPENDENCIES = ../libdar/$(MYLIB).la dar_cp_SOURCES = dar_suite.cpp dar_suite.hpp dar_cp.cpp shell_interaction.cpp shell_interaction.hpp line_tools.hpp line_tools.cpp dar_cp_DEPENDENCIES = ../libdar/$(MYLIB).la dar_split_SOURCES = dar_split.c # # dar_static ( --enable-dar-static ) # dar_static_SOURCES = command_line.cpp command_line.hpp config_file.cpp config_file.hpp dar.cpp dar.hpp dar_suite.cpp dar_suite.hpp hide_file.cpp hide_file.hpp no_comment.cpp no_comment.hpp shell_interaction.cpp shell_interaction.hpp getopt_decision.h my_getopt_long.h line_tools.hpp line_tools.cpp crit_action_cmd_line.cpp crit_action_cmd_line.hpp dar_static_DEPENDENCIES = ../libdar/$(MYLIB).la dar_static_LDFLAGS = -all-static @LTLIBINTL@ all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/dar_suite/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/dar_suite/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list dar$(EXEEXT): $(dar_OBJECTS) $(dar_DEPENDENCIES) $(EXTRA_dar_DEPENDENCIES) @rm -f dar$(EXEEXT) $(CXXLINK) $(dar_OBJECTS) $(dar_LDADD) $(LIBS) dar_cp$(EXEEXT): $(dar_cp_OBJECTS) $(dar_cp_DEPENDENCIES) $(EXTRA_dar_cp_DEPENDENCIES) @rm -f dar_cp$(EXEEXT) $(CXXLINK) $(dar_cp_OBJECTS) $(dar_cp_LDADD) $(LIBS) dar_manager$(EXEEXT): $(dar_manager_OBJECTS) $(dar_manager_DEPENDENCIES) $(EXTRA_dar_manager_DEPENDENCIES) @rm -f dar_manager$(EXEEXT) $(CXXLINK) $(dar_manager_OBJECTS) $(dar_manager_LDADD) $(LIBS) dar_slave$(EXEEXT): $(dar_slave_OBJECTS) $(dar_slave_DEPENDENCIES) $(EXTRA_dar_slave_DEPENDENCIES) @rm -f dar_slave$(EXEEXT) $(CXXLINK) $(dar_slave_OBJECTS) $(dar_slave_LDADD) $(LIBS) dar_split$(EXEEXT): $(dar_split_OBJECTS) $(dar_split_DEPENDENCIES) $(EXTRA_dar_split_DEPENDENCIES) @rm -f dar_split$(EXEEXT) $(LINK) $(dar_split_OBJECTS) $(dar_split_LDADD) $(LIBS) dar_static$(EXEEXT): $(dar_static_OBJECTS) $(dar_static_DEPENDENCIES) $(EXTRA_dar_static_DEPENDENCIES) @rm -f dar_static$(EXEEXT) $(dar_static_LINK) $(dar_static_OBJECTS) $(dar_static_LDADD) $(LIBS) dar_xform$(EXEEXT): $(dar_xform_OBJECTS) $(dar_xform_DEPENDENCIES) $(EXTRA_dar_xform_DEPENDENCIES) @rm -f dar_xform$(EXEEXT) $(CXXLINK) $(dar_xform_OBJECTS) $(dar_xform_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command_line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crit_action_cmd_line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dar_cp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dar_manager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dar_slave.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dar_split.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dar_suite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dar_xform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hide_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_tools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/no_comment.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_interaction.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-local ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS @PROFILING_TRUE@clean-local: @PROFILING_TRUE@ rm -f gmon.out @PROFILING_FALSE@clean-local: @USE_UPX_TRUE@install-exec-hook : @USE_UPX_TRUE@ cd $(DESTDIR)$(bindir) ; $(UPX) -9 dar$(EXEEXT) dar_xform$(EXEEXT) dar_slave$(EXEEXT) dar_manager$(EXEEXT) dar_cp$(EXEEXT) $(ALSO_BUILD_INST) @USE_UPX_FALSE@install-exec-hook: @USE_UPX_FALSE@ echo "no executable packing, UPX not found or disabled" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/src/dar_suite/command_line.hpp0000644000175000017430000002644012642474445015140 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file command_line.hpp /// \brief contains routing in charge of the command-line and included files parsing /// \ingroup CMDLINE #ifndef COMMAND_LINE_HPP #define COMMAND_LINE_HPP #include "../my_config.h" #include #include #include "infinint.hpp" #include "compressor.hpp" #include "mask.hpp" #include "path.hpp" #include "catalogue.hpp" #include "archive.hpp" #include "criterium.hpp" #include "shell_interaction.hpp" using namespace std; using namespace libdar; /// \addtogroup CMDLINE /// @{ enum operation { noop, extract, create, diff, test, listing, isolate, merging, version_or_help }; // noop stands for no-operation. get_args() never returns such value, // it is just necessary within the command_line module enum dirty_behavior { dirtyb_ignore, dirtyb_warn, dirtyb_ok }; // all parameters retreived from command-line struct line_param { operation op; //< which operation to perform path * fs_root; //< filesystem root path * sauv_root; //< where is the archive to operate on (create, read, etc.) string filename; //< basename of the archive to operate on path * ref_root; //< where is the archive of reference string * ref_filename; //< basename of the archive of reference (nullptr => no archive of reference) infinint file_size; //< size of the slices to create (except the first) infinint first_file_size; //< sice of the first slice to create mask * selection; //< filter files for the operation based on filename only mask * subtree; //< filter files for the operation based on path+filename bool allow_over; //< whether to allow slice overwriting bool warn_over; //< whether to warn before overwriting files or slices bool info_details; //< whether to show processing messages bool display_treated; //< whether to show treated files bool display_treated_only_dir;//< whether to show treated files's current working directory bool display_skipped; //< whether to display skipped files bool display_finished; //< whether to display summary (space/compression ratio) for each completed directory compression algo; //< compression algorithm to use when generating an archive U_I compression_level; //< compression level to use when generating an archive infinint pause; //< whether to pause between slices bool beep; //< whether to ring the terminal upon user interaction request bool empty_dir; //< whether to store skipped directories as empty, whether to avoid restoring directory where no data is to be restored mask * ea_mask; //< which EA to work on string input_pipe; //< if not an empty string, name of the pipe through which to read data from dar_slave string output_pipe; //< if not an empty string, name of the pipe through which to write orders to dar_slave cat_inode::comparison_fields what_to_check; //< what fields to take into account when comparing/restoring files, string execute; //< if not an empty string, the command to execute between slices string execute_ref; //< if not an empty string, the command to execute between slices of the archive of reference secu_string pass; //< if not an empty string, encrypt the archive with the given algo:pass string vector signatories; //< list of email's key to use to sign the archive bool blind_signatures; //< whether to ignore signature check failures secu_string pass_ref; //< if not an empty string, use the provided encryption scheme to read the archive of reference mask * compress_mask; //< which file to compress bool flat; //< whether to ignore directory structure when restoring data infinint min_compr_size; //< below which size to never try compressing files bool nodump; //< whether to ignore files having the "nodump" flag set when performing a backup bool exclude_by_ea; //< whether inode have to be check against a given EA before backup string ea_name_for_exclusion; //< EA name to use for file exclusion, or empty string for the default EA name infinint hourshift; //< consider equal two dates that have an integer hour of difference equal or less than hourshift bool warn_remove_no_match; //< whether to warn file about to be removed during a restoration, when they to no match the expected type of file bool filter_unsaved; //< whether to not list files that are not saved in the archive bool empty; //< whether to do a dry-run execution bool alter_atime; //< whether to reset the atime of file read during backup to their original value (resetting atime does modify ctime) bool same_fs; //< whether to stick to a same filesystem bool snapshot; //< whether to perform a snapshot backup bool cache_directory_tagging; //< whether to ignore directory contents where a the cache directory tagging files is found U_32 crypto_size; //< block size by which to cypher data U_32 crypto_size_ref; //< block size by which to uncypher data from the archive of reference archive_options_listing::listformat list_mode; //< type of listing to follow path * aux_root; //< where is the auxiliary archive of reference [used for merging but also when creating an archive, for the on-fly isolation] string * aux_filename; //< basename of the auxiliary archive if reference (nullptr => no auxiliary of reference) secu_string aux_pass; //< crypto to use for the auxiliary archive string aux_execute; //< command to be run between the slice of the auxiliary archive of reference U_32 aux_crypto_size; //< block size by which to cypher/uncypher data to/from the auxiliary archive of reference bool keep_compressed; //< when merging, whether to not uncompress/re-compress data in the process infinint fixed_date; //< the data for the snapshot backup bool quiet; //< whether to display final summary for the operation const crit_action * overwrite;//< the overwriting policy string slice_perm; //< permission to set when creating a slice string slice_user; //< user to set when creating a slice string slice_group; //< group to set when creating a slice infinint repeat_count; //< number of time to try saving a file if it changes at the time it is read for backup infinint repeat_byte; //< archive total maximum amount of byte to waste re-saving changing files bool decremental; //< whether to produce a decremental backup (when merging) bool furtive_read_mode; //< whether to use the furtive read mode bool lax; //< whether to activate the last chance recovery mode (use with caution!) bool use_sequential_marks; //< whether to add escape sequential marks in the archive bool sequential_read; //< whether to follow escape sequential marks to achieve a sequential reading of the archive infinint sparse_file_min_size;//< minimum size of a zeroed byte sequence to be considered as a hole and stored this way in the archive dirty_behavior dirty; //< what to do when comes the time to restore a file that is flagged as dirty bool security_check; //< whether to signal possible root-kit presence string user_comment; //< user comment to add to the archive hash_algo hash; //< whether to produce a hash file, and which algoritm to use for that hash infinint num_digits; //< minimum number of decimal for the slice number infinint ref_num_digits; //< minimum number of decimal for the slice number of the archive of reference infinint aux_num_digits; //< minimum number of decimal for the slice number of the auxiliary archive of reference bool only_deleted; //< whether to only consider deleted files bool not_deleted; //< whether to ignore deleted files mask * backup_hook_mask; //< which file have to considered for backup hook string backup_hook_execute; //< which command to execute as backup hook bool list_ea; //< whether to list Extended Attribute of files bool ignore_unknown_inode; //< whether to ignore unknown inode types bool no_compare_symlink_date; //< whether to report difference in dates of symlinks while diffing an archive with filesystem fsa_scope scope; //< FSA scope to consider for the operation bool multi_threaded; //< allows libdar to use multiple threads (requires libthreadar) // constructor for line_param line_param() { fs_root= nullptr; sauv_root = nullptr; ref_root = nullptr; selection = nullptr; subtree = nullptr; ref_filename = nullptr; ea_mask = nullptr; compress_mask = nullptr; aux_root = nullptr; aux_filename = nullptr; overwrite = nullptr; backup_hook_mask = nullptr; }; // destructor for line_param ~line_param() { if(fs_root != nullptr) delete fs_root; if(sauv_root != nullptr) delete sauv_root; if(ref_root != nullptr) delete ref_root; if(selection != nullptr) delete selection; if(subtree != nullptr) delete subtree; if(ref_filename != nullptr) delete ref_filename; if(ea_mask != nullptr) delete ea_mask; if(compress_mask != nullptr) delete compress_mask; if(aux_root != nullptr) delete aux_root; if(aux_filename != nullptr) delete aux_filename; if(overwrite != nullptr) delete overwrite; if(backup_hook_mask != nullptr) delete backup_hook_mask; }; }; /// main routine to extract parameters from command-line and included files extern bool get_args(shell_interaction & dialog, const char *home, const vector & dar_dcf_path, const vector & dar_duc_path, S_I argc, char * const argv[], line_param & param); /// @} #if HAVE_GETOPT_LONG const struct option *get_long_opt(); #endif const char *get_short_opt(); #endif dar-2.5.3/src/dar_suite/getopt_decision.h0000644000175000017430000000322612610405012015302 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file getopt_decision.h /// \brief switch routine to define which file to include based on the result of the configure script /// \ingroup CMDLINE #ifndef GETOPT_DECISION_H #define GETOPT_DECISION_H #include "../my_config.h" #if HAVE_GETOPT_LONG #if HAVE_GETOPT_IN_UNISTD_H #if HAVE_GETOPT_LONG_IN_UNISTD_H // we do not need to include #else // we miss getopt_long but have getopt #include "my_getopt_long.h" #endif #else // no getopt() in unistd.h // we assume that if unistd.h does not know getopt() it does nor know getopt_long() #include #endif #endif #ifndef EOF #define EOF -1 #endif #endif dar-2.5.3/src/dar_suite/line_tools.hpp0000644000175000017430000001526012641772777014670 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file line_tools.hpp /// \brief a set of general command line targeted routines /// \ingroup CMDLINE #ifndef LINE_TOOLS_HPP #define LINE_TOOLS_HPP #include "../my_config.h" #include #include #include "infinint.hpp" #include "tlv_list.hpp" #include "integers.hpp" #include "criterium.hpp" using namespace libdar; /// \addtogroup CMDLINE /// @{ class argc_argv { public: argc_argv(S_I size = 0); argc_argv(const argc_argv & ref) { throw Efeature("argc_argv"); }; const argc_argv & operator = (const argc_argv & ref) { throw Efeature("argc_argv"); }; ~argc_argv(); void resize(S_I size); void set_arg(const std::string & arg, S_I index); void set_arg(generic_file & f, U_I size, S_I index); S_I argc() const { return x_argc; }; char* const * argv() const { return x_argv; }; // well, the const method is a bit silly, as the caller has the possibility to modify what is pointed to by the returned value... private: S_I x_argc; char **x_argv; }; extern void line_tools_slice_ownership(const std::string & cmd, std::string & slice_permission, std::string & slice_user_ownership, std::string & slice_group_ownership); extern void line_tools_repeat_param(const std::string & cmd, infinint & repeat_count, infinint & repeat_byte); extern void line_tools_tlv_list2argv(user_interaction & dialog, tlv_list & list, argc_argv & arg); /// returns the old position of parsing (next argument to parse) extern S_I line_tools_reset_getopt(); std::string::const_iterator line_tools_find_first_char_out_of_parenth(const std::string & argument, unsigned char to_find); std::string::const_iterator line_tools_find_last_char_out_of_parenth(const std::string & argument, unsigned char to_find); std::string line_tools_expand_user_comment(const std::string & user_comment, S_I argc, char *const argv[]); /// split a PATH environement variable string into its components (/usr/lib:/lib => /usr/lib /lib) std::vector line_tools_explode_PATH(const char *the_path); /// return the full path of the given filename (eventually unchanged of pointing to the first file of that name present in the_path directories std::string line_tools_get_full_path_from_PATH(const std::vector & the_path, const char * filename); /// return split at the first space met the string given as first argument, and provide the two splitted string as second and third argument void line_tools_split_at_first_space(const char *field, std::string & before_space, std::string & after_space); void line_tools_get_min_digits(std::string arg, infinint & num, infinint & ref_num, infinint & aux_num); /// test the presence of a set of argument on the command line /// /// \param[in] arguments is the list of options to look for /// \param[in] argc is the number of argument on the command line /// \param[in] argv is the list of arguments on the command line /// \param[in] getopt_string is the parsing string to pass to getopt #if HAVE_GETOPT_LONG /// \param[in] long_options is the optional list of long options (an nullptr pointer is acceptable for no long option) #endif /// \param[in] stop_scan if this (char) option is met, stop scanning for wanted options /// \param[out] presence is a subset of arguments containing the option found on command-line extern void line_tools_look_for(const std::vector & arguments, S_I argc, char *const argv[], const char *getopt_string, #if HAVE_GETOPT_LONG const struct option *long_options, #endif char stop_scan, std::vector & presence); /// test the presence of -Q and -j options on the command line /// /// \param[in] argc is the number of argument on the command line /// \param[in] argv is the list of arguments on the command line /// \param[in] getopt_string is the parsing string to pass to getopt #if HAVE_GETOPT_LONG /// \param[in] long_options is the optional list of long options (an nullptr pointer is acceptable for no long option) #endif /// \param[in] stop_scan if this (char) option is met, stop scanning for -j and -Q options /// \param[out] Q_is_present is set to true if -Q option or its equivalent long option has been found on command-line extern void line_tools_look_for_Q(S_I argc, char *const argv[], const char *getopt_string, #if HAVE_GETOPT_LONG const struct option *long_options, #endif char stop_scan, bool & Q_is_present); /// split a line in words given the separator character (sep) extern std::vector line_tools_split(const std::string & val, char sep); extern void line_tools_4_4_build_compatible_overwriting_policy(bool allow_over, bool detruire, bool more_recent, const libdar::infinint & hourshift, bool ea_erase, const libdar::crit_action * & overwrite); /// split the argument to -K, -J and -$ in their different parts /// \param[in] all is what the user provided on command-line /// \param[out] algo is the symmetrical algorithm to use /// \param[out] pass is either the passphrase /// \param[out] no_cipher_given is true if the use did not specified the cipher (which defaults to blowfish) /// \param[out] recipients emails recipients to use (empty list if gnupg has not to be used) extern void line_tools_crypto_split_algo_pass(const secu_string & all, crypto_algo & algo, secu_string & pass, bool & no_cipher_given, std::vector & recipients); /// display information about the signatories extern void line_tools_display_signatories(user_interaction & ui, const std::list & gnupg_signed); /// @} #endif dar-2.5.3/src/dar_suite/dar_cp.cpp0000644000175000017430000002466412641772777013754 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_STRIN_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STDLIB_H #include #endif } #include #include "dar_suite.hpp" #include "tools.hpp" #include "cygwin_adapt.hpp" #include "dar_suite.hpp" #include "thread_cancellation.hpp" #define DAR_CP_VERSION "1.2.10" using namespace libdar; using namespace std; static void show_usage(shell_interaction & dialog, char *argv0); static void show_version(shell_interaction & dialog, char *argv0); static int open_files(shell_interaction & dialog, char *src, char *dst, int *fds, int *fdd); static int copy_max(shell_interaction & dialog, int src, int dst); static int little_main(shell_interaction & dialog, int argc, char * const argv[], const char **env); static void xfer_before_error(int block, char *buffer, int src, int dst); static int skip_to_next_readable(int block, char *buffer, int src, int dst, off_t & missed); /* return 0 if not found any more readable data, else return 1 */ static int normal_copy(int block, char *buffer, int src, int dst); /* return the number of copied bytes (negative value upon error, zero at end of file) */ static int little_main(shell_interaction & dialog, int argc, char * const argv[], const char **env); int main(int argc, char * const argv[], const char **env) { return dar_suite_global(argc, argv, env, "h", #if HAVE_GETOPT_LONG nullptr, #endif '\0', // should never be met as option, thus early read the whole command-line for -j and -Q options &little_main); } static int little_main(shell_interaction & dialog, int argc, char * const argv[], const char **env) { int fds, fdd; int ret = EXIT_OK; if(argc > 1 && strcmp(argv[1],"-V") == 0) { show_version(dialog, argv[0]); ret = EXIT_OK; } else if(argc != 3 || string(argv[1]) == string("-h")) { show_usage(dialog, argv[0]); ret = EXIT_SYNTAX; } else if(open_files(dialog, argv[1], argv[2], &fds, &fdd)) { try { ret = copy_max(dialog, fds, fdd); close(fds); close(fdd); } catch(Erange & e) { ret = EXIT_BUG; // not the same meaning for dar_cp } } else ret = EXIT_ERROR; return ret; } static void show_usage(shell_interaction & dialog, char *argv0) { dialog.warning(tools_printf(gettext("usage : %s \n"), argv0)); } static void show_version(shell_interaction & dialog, char *argv0) { /* C++ syntax used*/ try { string cmd; tools_extract_basename(argv0, cmd); // never return a nullptr pointer but dialog.warning(tools_printf("\n %s version %s Copyright (C) 2002-2052 Denis Corbin\n\n\n", cmd.c_str(), DAR_CP_VERSION)); dialog.warning(tools_printf(gettext(" compiled the %s with %s version %s\n"), __DATE__, CC_NAT, __VERSION__)); dialog.warning(tools_printf(gettext(" %s is part of the Disk ARchive suite (Release %s)\n"), cmd.c_str(), PACKAGE_VERSION)); dialog.warning(tools_printf(gettext(" %s comes with ABSOLUTELY NO WARRANTY; for details type `dar -W'."), cmd.c_str())); dialog.warning(tools_printf(gettext(" This is free software, and you are welcome to redistribute it under"))); dialog.warning(tools_printf(gettext(" certain conditions; type `dar -L | more' for details.\n\n"))); } catch(...) { dialog.warning(tools_printf(gettext("Unexpected exception from libdar"))); throw SRC_BUG; } /* END of C++ syntax used*/ } static int open_files(shell_interaction & dialog, char *src, char *dst, int *fds, int *fdd) { struct stat buf; int val = stat(dst, &buf); char *tmp = nullptr; if(val == 0 && S_ISDIR(buf.st_mode)) { tmp = (char *)malloc(strlen(src)+strlen(dst)+1+1); if(tmp == nullptr) { dialog.warning(tools_printf(gettext("Memory allocation failed : %s"), strerror(errno))); return 0; } string tmp2; tools_extract_basename(src, tmp2); strcpy(tmp, dst); strcat(tmp, "/"); strcat(tmp, tmp2.c_str()); dst = tmp; // dst is not dynamically allocated, thus we can // loose its reference. } *fds = ::open(src, O_RDONLY|O_BINARY); if(*fds < 0) { dialog.warning(tools_printf(gettext("Cannot open source file : %s"), strerror(errno))); if(tmp != nullptr) free(tmp); return 0; // error } *fdd = ::open(dst, O_WRONLY|O_CREAT|O_EXCL|O_BINARY, 0666); if(tmp != nullptr) free(tmp); if(*fdd < 0) { dialog.warning(tools_printf(gettext("Cannot open destination file : %s"), strerror(errno))); close(*fds); *fds = -1; return 0; } else return 1; } static int copy_max(shell_interaction & dialog, int src, int dst) { thread_cancellation thr; #define BUF_SIZE 1024 // choosing the correct value for BUF_SIZE // too long makes I/O error very long to recover // too small makes copying under normal condition a bit slow // 1024 seems a balanced choice. // char buffer[BUF_SIZE]; int lu = 0; off_t missed = 0; off_t taille = lseek(src, 0, SEEK_END); lseek(src, 0, SEEK_SET); dialog.warning(tools_printf(gettext("Starting the copy of %u byte(s)"), taille)); do { thr.check_self_cancellation(); lu = normal_copy(BUF_SIZE, buffer, src, dst); if(lu < 0) { off_t local_missed; off_t current = lseek(src, 0, SEEK_CUR); printf(gettext("Error reading source file (we are at %.2f %% of data copied), trying to read further: %s\n"), (float)(current)/(float)(taille)*100, strerror(errno)); xfer_before_error(BUF_SIZE/2, buffer, src, dst); if(skip_to_next_readable(BUF_SIZE/2, buffer, src, dst, local_missed)) { printf(gettext("Skipping done (missing %.0f byte(s)), found correct data to read, continuing the copy...\n"), (float)local_missed); missed += local_missed; lu = 1; } else { dialog.warning(tools_printf(gettext("Reached End of File, no correct data could be found after the last error\n"))); missed += (taille - current); lu = 0; } } } while(lu > 0); printf(gettext("Copy finished. Missing %.0f byte(s) of data\n"), (float)missed); printf(gettext("Which is %.2f %% of the total amount of data\n"), (float)(missed)/((float)(taille))*100); return missed == 0 ? EXIT_OK : EXIT_DATA_ERROR; } static void xfer_before_error(int block, char *buffer, int src, int dst) { if(read(src, buffer, 1) == 1) { if(lseek(src, -1, SEEK_CUR) < 0) throw Erange("xfer_before_error", gettext("Cannot seek back one char")); } else return; // the error is just next char to read while(block > 1) { int lu = read(src, buffer, block); if(lu > 0) { if(write(dst, buffer, lu) < 0) throw Erange("xfer_before_error", gettext("Cannot write to destination, aborting")); } else block /= 2; } } static int skip_to_next_readable(int block, char *buffer, int src, int dst, off_t & missed) { int lu = 0; off_t min = lseek(src, 0, SEEK_CUR), max; missed = min; thread_cancellation thr; ////////////////////////// // first step: looking for a next readable (maybe not the very next readable) // we put its position in "max" ////////////////////////// do { thr.check_self_cancellation(); lu = read(src, buffer, 1); // once we will read after the end of file, read() will return 0 if(lu < 0) { if(block*2 > block) // avoid integer overflow block *= 2; lseek(src, block, SEEK_CUR); } } while(lu < 0); max = lseek(src, 0, SEEK_CUR); // the current position ////////////////////////// // second step: looking for the very next readable char between offsets min and max ////////////////////////// while(max - min > 1) { thr.check_self_cancellation(); off_t mid = (max + min) / 2; if(lseek(src, mid, SEEK_SET) < 0) { perror(gettext("Cannot seek in file")); return 0; } lu = read(src, buffer, 1); switch(lu) { case 1: // valid character read case 0: // still after EOF max = mid; break; default: // no character could be read min = mid; break; } } lseek(src, max, SEEK_SET); lu = read(src, buffer, 1); lseek(src, max, SEEK_SET); lseek(dst, max, SEEK_SET); // we eventually make a hole in dst, // which will be full of zero // see lseek man page. missed = max - missed; if(lu != 1) return 0; // could not find valid char to read else return 1; // there is valid char to read return 1; } static int normal_copy(int block, char *buffer, int src, int dst) { int lu = read(src, buffer, block); if(lu > 0) { int ecrit = 0; while(ecrit < lu) { int tmp = write(dst, buffer+ecrit, lu-ecrit); if(tmp < 0) throw Erange("normal_copy", gettext("Cannot write to destination, aborting")); else if(tmp == 0) printf(gettext("Non fatal error while writing to destination file, retrying\n")); else ecrit += tmp; } } return lu; } dar-2.5.3/src/dar_suite/dar_suite.cpp0000644000175000017430000002163312641772777014474 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_LOCALE_H #include #endif #if HAVE_SIGNAL_H #include #endif #if HAVE_STDLIB_H #include #endif #if MUTEX_WORKS #if HAVE_PTHREAD_H #include #else #define pthread_t U_I #endif #endif } #include #include #include "integers.hpp" #include "dar_suite.hpp" #include "erreurs.hpp" #include "libdar.hpp" #include "thread_cancellation.hpp" #include "memory_check.hpp" #include "line_tools.hpp" #ifdef HAVE_LIBTHREADAR_LIBTHREADAR_HPP #include #endif #define GENERAL_REPORT(msg) if(ui != nullptr) \ { \ ui->change_non_interactive_output(&cerr); \ ui->warning(msg); \ } \ else \ cerr << msg << endl; using namespace libdar; static shell_interaction *ui = nullptr; static void signals_abort(int l, bool now); static void signal_abort_delayed(int l); static void signal_abort_now(int l); void dar_suite_reset_signal_handler() { #if HAVE_SIGNAL_H signal(SIGTERM, &signal_abort_delayed); signal(SIGINT, &signal_abort_delayed); signal(SIGQUIT, &signal_abort_delayed); signal(SIGHUP, &signal_abort_delayed); signal(SIGUSR1, &signal_abort_delayed); signal(SIGUSR2, &signal_abort_now); #if GPGME_SUPPORT // for GPGME: signal(SIGPIPE, SIG_IGN); #endif #endif } int dar_suite_global(int argc, char * const argv[], const char **env, const char *getopt_string, #if HAVE_GETOPT_LONG const struct option *long_options, #endif char stop_scan, int (*call)(shell_interaction & dialog, int, char * const [], const char **env)) { int ret = EXIT_OK; memory_check_snapshot(); dar_suite_reset_signal_handler(); #ifdef ENABLE_NLS // gettext settings try { if(string(DAR_LOCALEDIR) != string("")) if(bindtextdomain(PACKAGE, DAR_LOCALEDIR) == nullptr) throw Erange("", "Cannot open the translated messages directory, native language support will not work"); if(setlocale(LC_MESSAGES, "") == nullptr || setlocale(LC_CTYPE, "") == nullptr) throw Erange("", "Cannot set locale category, native language support will not work"); if(textdomain(PACKAGE) == nullptr) throw Erange("", "Cannot find dar's catalogue, native language support will not work"); } catch(Erange & e) { cerr << e.get_message() << endl; } #endif try { U_I min, med, maj; bool silent; line_tools_look_for_Q(argc, argv, getopt_string, #if HAVE_GETOPT_LONG long_options, #endif stop_scan, silent); ui = new (nothrow) shell_interaction(&cerr, &cerr, silent); if(ui == nullptr) throw Ememory("dar_suite_global"); get_version(maj, med, min); if(maj != LIBDAR_COMPILE_TIME_MAJOR || med < LIBDAR_COMPILE_TIME_MEDIUM) { GENERAL_REPORT(tools_printf(gettext("We have linked with an incompatible version of libdar. Expecting version %d.%d.x but having linked with version %d.%d.%d"), LIBDAR_COMPILE_TIME_MAJOR, LIBDAR_COMPILE_TIME_MEDIUM, maj, med, min)); ret = EXIT_ERROR; } else ret = (*call)(*ui, argc, argv, env); // closing libdar close_and_clean(); } catch(Efeature & e) { GENERAL_REPORT(string(gettext("NOT YET IMPLEMENTED FEATURE has been used: ")) + e.get_message()); GENERAL_REPORT(string(gettext("Please check documentation or upgrade your software if available"))); ret = EXIT_SYNTAX; } catch(Ehardware & e) { GENERAL_REPORT(string(gettext("SEEMS TO BE A HARDWARE PROBLEM: "))+e.get_message()); GENERAL_REPORT(string(gettext("Please check your hardware"))); ret = EXIT_ERROR; } catch(Esecu_memory & e) { GENERAL_REPORT(string(gettext("Lack of SECURED memory to achieve the operation, aborting operation"))); ret = EXIT_ERROR; } catch(Ememory & e) { GENERAL_REPORT(string(gettext("Lack of memory to achieve the operation, aborting operation"))); ret = EXIT_ERROR; } catch(std::bad_alloc & e) { GENERAL_REPORT(string(gettext("Lack of memory to achieve the operation, aborting operation"))); ret = EXIT_ERROR; } catch(Erange & e) { GENERAL_REPORT(string(gettext("FATAL error, aborting operation"))); GENERAL_REPORT(e.get_message()); ret = EXIT_ERROR; } catch(Euser_abort & e) { GENERAL_REPORT(string(gettext("Aborting program. User refused to continue while asking: ")) + e.get_message()); ret = EXIT_USER_ABORT; } catch(Ethread_cancel & e) { GENERAL_REPORT(string(gettext("Program has been aborted for the following reason: ")) + e.get_message()); ret = EXIT_USER_ABORT; } catch(Edata & e) { GENERAL_REPORT(e.get_message()); ret = EXIT_DATA_ERROR; } catch(Escript & e) { GENERAL_REPORT(string(gettext("Aborting program. An error occurred concerning user command execution: ")) + e.get_message()); ret = EXIT_SCRIPT_ERROR; } catch(Elibcall & e) { GENERAL_REPORT(string(gettext("Aborting program. An error occurred while calling libdar: ")) + e.get_message()); ret = EXIT_LIBDAR; } catch(Einfinint & e) { GENERAL_REPORT(string(gettext("Aborting program. ")) + e.get_message()); ret = EXIT_BUG; } catch(Elimitint & e) { GENERAL_REPORT(string(gettext("Aborting program. ")) + e.get_message()); ret = EXIT_LIMITINT; } catch(Ecompilation & e) { GENERAL_REPORT(string(gettext("Aborting program. The requested operation needs a feature that has been disabled at compilation time: ")) + e.get_message()); ret = EXIT_COMPILATION; } catch(Esystem & e) { GENERAL_REPORT(string(gettext("FATAL error, aborting operation"))); GENERAL_REPORT(e.get_message()); ret = EXIT_ERROR; } catch(Egeneric & e) { cerr << e.dump_str(); GENERAL_REPORT(string(gettext("INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINER"))); ret = EXIT_BUG; } #ifdef LIBTHREADAR_AVAILABLE catch(libthreadar::exception_base & e) { string msg = ""; for(unsigned int i = 0; i < e.size() ; ++i) msg += e[i]; cerr << msg << endl; ret = EXIT_BUG; } #endif catch(...) { Ebug x = SRC_BUG; cerr << x.dump_str(); GENERAL_REPORT(string(gettext("CAUGHT A NON (LIB)DAR EXCEPTION"))); GENERAL_REPORT(string(gettext("INTERNAL ERROR, PLEASE REPORT THE PREVIOUS OUTPUT TO MAINTAINER"))); ret = EXIT_BUG; } if(thread_cancellation::count() != 0) { GENERAL_REPORT(string(gettext("SANITY CHECK: AT LEAST ONE THREAD_CANCELLATION OBJECT HAS NOT BEEN DESTROYED AND REMAINS IN MEMORY WHILE THE PROGRAM REACHED ITS END"))); } // restoring terminal settings try { if(ui != nullptr) delete ui; ui = nullptr; } catch(...) { ret = EXIT_UNKNOWN_ERROR; } memory_check_snapshot(); return ret; } string dar_suite_command_line_features() { #if HAVE_GETOPT_LONG const char *long_opt = gettext("YES"); #else const char *long_opt = gettext("NO"); #endif return tools_printf(gettext("Long options support : %s\n"), long_opt); } static void signal_abort_delayed(int l) { signals_abort(l, false); } static void signal_abort_now(int l) { signals_abort(l, true); } static void signals_abort(int l, bool now) { #if HAVE_DECL_SYS_SIGLIST GENERAL_REPORT(tools_printf(gettext("Received signal: %s"), sys_siglist[l])); #else GENERAL_REPORT(tools_printf(gettext("Received signal: %d"), l)); #endif #if MUTEX_WORKS if(now) { GENERAL_REPORT(string(gettext("Archive fast termination engaged"))); } else { GENERAL_REPORT(string(gettext("Archive delayed termination engaged"))); } #if HAVE_SIGNAL_H signal(l, SIG_DFL); GENERAL_REPORT(string(gettext("Disabling signal handler, the next time this signal is received the program will abort immediately"))); #endif cancel_thread(pthread_self(), now); #else GENERAL_REPORT(string(gettext("Cannot cleanly abort the operation, thread-safe support is missing, will thus abruptly stop the program, generated archive may be unusable"))); exit(EXIT_USER_ABORT); #endif } dar-2.5.3/src/dar_suite/config_file.cpp0000644000175000017430000001051212641772777014753 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if STDC_HEADERS #include #endif } // end extern "C" #include "config_file.hpp" #include "tools.hpp" using namespace libdar; config_file::config_file(const vector & target, generic_file &f) : hide_file(f) { vector::const_iterator it = target.begin(); cibles.clear(); while(it != target.end()) { cibles.push_back(t_cible(*it)); ++it; } } vector config_file::get_read_targets() const { vector ret; vector::const_iterator it = cibles.begin(); while(it != cibles.end()) { if(it->seen) ret.push_back(it->target); ++it; } return ret; } void config_file::fill_morceau() { string read_target; partie tmp; infinint last_offset = 0; infinint first, last; enum { debut, fin } status = fin; // we read any text put before the first condition tmp.debut = 0; tmp.offset = 0; morceau.clear(); if(ref == nullptr) throw SRC_BUG; ref->skip(0); while(find_next_target(*ref, first, read_target, last)) { switch(status) { case fin: if(first < tmp.debut) throw SRC_BUG; // first byte of the line where next target // resides is before where we started looking for new target ! tmp.longueur = first - tmp.debut; last_offset += tmp.longueur; if(tmp.longueur > 0) morceau.push_back(tmp); status = debut; // no break ! case debut: if(is_a_target(read_target)) { tmp.debut = last; tmp.offset = last_offset; status = fin; } break; default: throw SRC_BUG; } } if(status == fin) { if(ref->get_position() < tmp.debut) throw SRC_BUG; tmp.longueur = ref->get_position() - tmp.debut; if(tmp.longueur > 0) morceau.push_back(tmp); } } bool config_file::is_a_target(const string & val) { vector::iterator it = cibles.begin(); while(it != cibles.end() && it->target != val) ++it; if(it != cibles.end()) { it->seen = true; return true; } else return false; } bool config_file::find_next_target(generic_file &f, infinint & debut, string & nature, infinint & fin) { char a; bool found = false; enum { init, search, end, purge } status = init; debut = f.get_position(); while(!found && f.read(&a, 1) == 1) { switch(status) { case init: // looking for next word beginning switch(a) { case ' ': case '\t': break; case '\n': debut = f.get_position(); break; default: if(isalpha(a)) { nature = a; status = search; } else status = purge; } break; case search: // reading the current word if(isalnum(a) || a == '_' || a == '-') nature += a; else if(a == ':') status = end; else if(a == '\n') { status = init; debut = f.get_position(); } else status = purge; break; case end: // got a target word (= word + `:' ) switch(a) { case ' ': case '\t': case '\r': break; case '\n': fin = f.get_position(); found = true; break; default: status = purge; } break; case purge: // just read word is not a target, resetting to the next line if(a == '\n') { status = init; debut = f.get_position(); } break; default: throw SRC_BUG; } } return found; } dar-2.5.3/src/dar_suite/dar_suite.hpp0000644000175000017430000001002612641772777014473 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file dar_suite.hpp /// \brief contains routine to manage CLI's common initialization and ultimate exception catching /// \ingroup CMDLINE #ifndef DAR_SUITE_HPP #define DAR_SUITE_HPP #include "../my_config.h" #include "shell_interaction.hpp" #define EXIT_OK 0 // all that was asked is done #define EXIT_SYNTAX 1 // syntax error on command line #define EXIT_ERROR 2 // error not related to the data treated // (lack of memory, hardware problem, etc.) #define EXIT_BUG 3 // detected a condition that should never happen #define EXIT_USER_ABORT 4 // user asked to abort (or question in non // interactive mode) #define EXIT_DATA_ERROR 5 // error in data treated (could not save/restore/ // compare all data due for example to bad access permission. Comparison // mismatch of some files, archive testing failed etc...) #define EXIT_SCRIPT_ERROR 6 // error around the execution of a user command // using -E or -F options #define EXIT_LIBDAR 7 // error calling libdar. Arguments given to libdar // do not match those expected (sanity checks warning). #define EXIT_LIMITINT 8 // limitinit overflow // fixed using full infinint version of the program #define EXIT_UNKNOWN_ERROR 9 // error not possible to report by other mean no access to stdout/stderr) #define EXIT_COMPILATION 10 // feature not activated at compilation time #define EXIT_SAVED_MODIFIED 11 // some files have been modified at the time they were saved #define EXTENSION "dar" /// the compiler version MACRO #ifndef __VERSION__ #define __VERSION__ "unknown" #endif /// the compiler Nature MACRO #ifdef __GNUC__ #define CC_NAT "GNUC" #else #define CC_NAT "unknown" #endif using namespace libdar; /// \addtogroup CMDLINE /// @{ extern void dar_suite_reset_signal_handler(); /// common routine for all dar command-line tools to initialize environment and convert uncaught exceptions to exit status code /// \param[in] argc is the number of argument on the command line /// \param[in] argv is the list of arguments on the command line /// \param[in] env is the environment variables table obtained from main() /// \param[in] getopt_string is the parsing string to pass to getopt #if HAVE_GETOPT_LONG /// \param[in] long_options is the optional list of long options (an nullptr pointer is acceptable for no long option) #endif /// \param[in] stop_scan while looking early for -j and -Q option will ignore all that follows stop_scan option if met /// \param[in] call is a callback function to run once user interaction is initialized and to catch from the exceptions /// \return the application exist status to use extern int dar_suite_global(int argc, char * const argv[], const char **env, const char *getopt_string, #if HAVE_GETOPT_LONG const struct option *long_options, #endif char stop_scan, int (*call)(shell_interaction & dialog, int, char *const [], const char **env)); extern std::string dar_suite_command_line_features(); /// @} #endif dar-2.5.3/src/dar_suite/dar_slave.cpp0000644000175000017430000002273612641772777014462 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #include "getopt_decision.h" } // end extern "C" #include #include #include #include "user_interaction.hpp" #include "zapette.hpp" #include "sar.hpp" #include "path.hpp" #include "tuyau.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "dar_suite.hpp" #include "integers.hpp" #include "libdar.hpp" #include "shell_interaction.hpp" #include "line_tools.hpp" #include "entrepot_local.hpp" #define ONLY_ONCE "Only one -%c is allowed, ignoring this extra option" #define OPT_STRING "i:o:hVE:Qj9:" using namespace libdar; using namespace std; #define DAR_SLAVE_VERSION "1.4.8" static bool command_line(shell_interaction & dialog, S_I argc, char * const argv[], path * &chemin, string & filename, string &input_pipe, string &output_pipe, string & execute, infinint & min_digits); static void show_usage(shell_interaction & dialog, const char *command); static void show_version(shell_interaction & dialog, const char *command); static S_I little_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env); int main(S_I argc, char * const argv[], const char **env) { return dar_suite_global(argc, argv, env, OPT_STRING, #if HAVE_GETOPT_LONG nullptr, #endif '\0', // should never be met as option, thus early read the whole command-line for -j and -Q options &little_main); } static S_I little_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env) { path *chemin = nullptr; string filename; string input_pipe; string output_pipe; string execute; infinint min_digits; if(command_line(dialog, argc, argv, chemin, filename, input_pipe, output_pipe, execute, min_digits)) { tuyau *input = nullptr; tuyau *output = nullptr; sar *source = nullptr; entrepot_local entrep = entrepot_local("", "", false); if(chemin == nullptr) throw SRC_BUG; entrep.set_location(*chemin); try { source = new (nothrow) sar(dialog, filename, EXTENSION, entrep, true, min_digits, false, execute); if(source == nullptr) throw Ememory("little_main"); tools_open_pipes(dialog, input_pipe, output_pipe, input, output); slave_zapette zap = slave_zapette(input, output, source); input = output = nullptr; // now managed by zap; source = nullptr; // now managed by zap; try { zap.action(); } catch(Erange &e) { dialog.warning(e.get_message()); throw Edata(e.get_message()); } } catch(...) { delete chemin; if(input != nullptr) delete input; if(output != nullptr) delete output; if(source != nullptr) delete source; throw; } delete chemin; if(input != nullptr) delete input; if(output != nullptr) delete output; if(source != nullptr) delete source; return EXIT_OK; } else return EXIT_SYNTAX; } static bool command_line(shell_interaction & dialog, S_I argc,char * const argv[], path * &chemin, string & filename, string &input_pipe, string &output_pipe, string & execute, infinint & min_digits) { S_I lu; execute = ""; if(argc < 1) { dialog.warning(gettext("Cannot read arguments on command line, aborting")); return false; } while((lu = getopt(argc, argv, OPT_STRING)) != EOF) { switch(lu) { case 'i': if(optarg == nullptr) throw Erange("command_line", gettext("Missing argument to -i option")); if(input_pipe == "") input_pipe = optarg; else dialog.warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case 'o': if(optarg == nullptr) throw Erange("command_line", gettext("Missing argument to -o option")); if(output_pipe == "") output_pipe = optarg; else dialog.warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case 'h': show_usage(dialog, argv[0]); return false; case 'V': show_version(dialog, argv[0]); return false; case 'E': if(optarg == nullptr) throw Erange("command_line", gettext("Missing argument to -E option")); if(execute == "") execute = optarg; else execute += string(" ; ") + optarg; break; case 'Q': break; // ignore this option already parsed during initialization (dar_suite.cpp) case '9': if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext("Missing argument to --min-digits"), char(lu))); else { infinint tmp2, tmp3; line_tools_get_min_digits(optarg, min_digits, tmp2, tmp3); } break; case ':': throw Erange("command_line", tools_printf(gettext("Missing parameter to option -%c"), char(optopt))); case '?': dialog.warning(tools_printf(gettext("Ignoring unknown option -%c"), char(optopt))); break; default: dialog.warning(tools_printf(gettext("Ignoring unknown option -%c"), char(lu))); } } if(optind + 1 > argc) { dialog.warning(gettext("Missing archive basename, see -h option for help")); return false; } if(optind + 1 < argc) { dialog.warning(gettext("Too many argument on command line, see -h option for help")); return false; } tools_split_path_basename(argv[optind], chemin, filename); tools_check_basename(dialog, *chemin, filename, EXTENSION); return true; } static void show_usage(shell_interaction & dialog, const char *command) { string cmd; tools_extract_basename(command, cmd); dialog.change_non_interactive_output(&cout); dialog.printf("\nusage : \n"); dialog.printf(" command1 | %s [options] [/]basename | command2\n", cmd.c_str()); dialog.printf(" %s [options] [-i input_pipe] [-o output_pipe] [/]basename\n", cmd.c_str()); dialog.printf(" %s -h\n", cmd.c_str()); dialog.printf(" %s -V\n\n", cmd.c_str()); dialog.printf(gettext("\n")); dialog.printf(gettext("Common options:\n")); dialog.printf(gettext(" -i pipe to use instead of std input to read orders from dar\n")); dialog.printf(gettext(" -o pipe to use instead of std output to write data to dar\n")); dialog.printf(gettext(" -E \t command line to execute between slices of the archive\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("See man page for more options.\n")); } static void show_version(shell_interaction & dialog, const char *command) { string cmd; tools_extract_basename(command, cmd); U_I maj, med, min; get_version(maj, med, min); dialog.change_non_interactive_output(&cout); dialog.printf("\n %s version %s Copyright (C) 2002-2052 Denis Corbin\n\n", cmd.c_str(), DAR_SLAVE_VERSION); if(maj > 2) dialog.printf(gettext(" Using libdar %u.%u.%u built with compilation time options:\n"), maj, med, min); else dialog.printf(gettext(" Using libdar %u.%u built with compilation time options:\n"), maj, min); tools_display_features(dialog); dialog.printf("\n"); dialog.printf(gettext(" compiled the %s with %s version %s\n"), __DATE__, CC_NAT, __VERSION__); dialog.printf(gettext(" %s is part of the Disk ARchive suite (Release %s)\n"), cmd.c_str(), PACKAGE_VERSION); dialog.warning(tools_printf(gettext(" %s comes with ABSOLUTELY NO WARRANTY;"), cmd.c_str()) + tools_printf(gettext(" for details\n type `dar -W'.")) + tools_printf(gettext(" This is free software, and you are welcome\n to redistribute it under certain conditions;")) + tools_printf(gettext(" type `dar -L | more'\n for details.\n\n"))); } dar-2.5.3/src/dar_suite/hide_file.hpp0000644000175000017430000000464112641772777014432 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file hide_file.hpp /// \brief contains class of base to split files in words /// \ingroup CMDLINE #ifndef HIDE_FILE_HPP #define HIDE_FILE_HPP #include "../my_config.h" #include #include "infinint.hpp" #include "generic_file.hpp" using namespace libdar; using namespace std; /// \addtogroup CMDLINE /// @{ class hide_file : public generic_file { public: hide_file(generic_file &f); bool skippable(skippability direction, const infinint & amount) { return true; }; bool skip(const infinint & pos); bool skip_to_eof(); bool skip_relative(S_I x); infinint get_position() const; protected: struct partie { infinint debut, longueur; // debut is the offset in ref file infinint offset; // offset in the resulting file }; vector morceau; generic_file *ref; void inherited_read_ahead(const infinint & amount) { ref->read_ahead(amount); }; U_I inherited_read(char *a, U_I size); void inherited_write(const char *a, size_t size); void inherited_sync_write() {}; void inherited_flush_read() {}; void inherited_terminate() {}; virtual void fill_morceau() = 0; // the inherited classes have with this method // to fill the "morceau" variable that defines // the portions private: U_I pos_index; infinint pos_relicat; bool is_init; void init() const; }; /// @} #endif dar-2.5.3/src/dar_suite/crit_action_cmd_line.cpp0000644000175000017430000003246712642474445016644 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "crit_action_cmd_line.hpp" #include "tools.hpp" #include "deci.hpp" #include "line_tools.hpp" using namespace std; using namespace libdar; static const criterium * criterium_create_from_string(user_interaction & dialog, const string & argument, const infinint & hourshift); string crit_action_canonize_string(const std::string & argument) { string ret = ""; string::const_iterator it = argument.begin(); while(it != argument.end()) { if(*it != ' ' && *it != '\r' && *it != '\n' && *it != '\t') ret += *it; ++it; } return ret; } const crit_action * crit_action_create_from_string(user_interaction & dialog, const string & argument, const infinint & hourshift) { string::const_iterator it; const crit_action *ret = nullptr; if(argument.begin() == argument.end()) throw Erange("crit_action_create_from_string","Unexpected empty string in expression"); // looking for ';' (chain actions) try { it = line_tools_find_first_char_out_of_parenth(argument, ';'); if(it != argument.end()) { const crit_action *tmp = nullptr; const crit_chain *tmp_chain = nullptr; crit_chain *ret_chain = nullptr; try { if(*it != ';') throw SRC_BUG; ret = ret_chain = new (nothrow) crit_chain(); if(ret == nullptr) throw Ememory("crit_action_create_from_string"); tmp = crit_action_create_from_string(dialog, string(argument.begin(), it), hourshift); if(tmp == nullptr) throw SRC_BUG; ret_chain->add(*tmp); delete tmp; tmp = nullptr; tmp = crit_action_create_from_string(dialog, string(it+1, argument.end()), hourshift); tmp_chain = dynamic_cast(tmp); if(tmp_chain != nullptr) ret_chain->gobe(*(const_cast(tmp_chain))); else ret_chain->add(*tmp); delete tmp; tmp = nullptr; } catch(...) { if(tmp != nullptr) delete tmp; throw; } return ret; } if(*argument.begin() == '{') { string::const_iterator fin; const criterium *crit = nullptr; const crit_action *go_true = nullptr, *go_false = nullptr; it = line_tools_find_first_char_out_of_parenth(argument, '}'); if(it == argument.end()) throw Erange("crit_action_create_from_string", string(gettext("Missing } in conditional statement: ")) + argument); if(*it != '}') throw SRC_BUG; if(it + 1 == argument.end() || *(it + 1) != '[' ) throw Erange("crit_action_create_from_string", string(gettext("Missing [ after } in conditional statement: ")) + argument); fin = line_tools_find_first_char_out_of_parenth(argument, ']'); if(fin == argument.end()) throw Erange("crit_action_create_from_string", string(gettext("Missing ] in conditional statement: ")) + argument); if(*fin != ']') throw SRC_BUG; try { crit = criterium_create_from_string(dialog, string(argument.begin()+1, it), hourshift); if(crit == nullptr) throw SRC_BUG; go_true = crit_action_create_from_string(dialog, string(it + 2, fin), hourshift); if(go_true == nullptr) throw SRC_BUG; if(fin + 1 == argument.end()) { go_false = new (nothrow) crit_constant_action(data_undefined, EA_undefined); if(go_false == nullptr) throw Ememory("crit_action_create_from_string"); } else { go_false = crit_action_create_from_string(dialog, string(fin + 1, argument.end()), hourshift); if(go_false == nullptr) throw SRC_BUG; } ret = new (nothrow) testing(*crit, *go_true, *go_false); if(ret == nullptr) throw Ememory("crit_action_create_from_string"); delete crit; crit = nullptr; delete go_true; go_true = nullptr; delete go_false; go_false = nullptr; } catch(...) { if(crit != nullptr) delete crit; if(go_true != nullptr) delete go_true; if(go_false != nullptr) delete go_false; throw; } return ret; } if(argument.size() == 2) { over_action_data data; over_action_ea ea; switch(*argument.begin()) { case 'P': data = data_preserve; break; case 'O': data = data_overwrite; break; case 'S': data = data_preserve_mark_already_saved; break; case 'T': data = data_overwrite_mark_already_saved; break; case 'R': data = data_remove; break; case '*': data = data_undefined; break; case 'A': data = data_ask; break; default: throw Erange("crit_action_create_from_string", tools_printf(gettext("Unknown policy for data '%c' in expression %S"), *argument.begin(), &argument)); } switch(*(argument.begin() +1)) { case 'p': ea = EA_preserve; break; case 'o': ea = EA_overwrite; break; case 's': ea = EA_preserve_mark_already_saved; break; case 't': ea = EA_overwrite_mark_already_saved; break; case 'm': ea = EA_merge_preserve; break; case 'n': ea = EA_merge_overwrite; break; case 'r': ea = EA_clear; break; case '*': ea = EA_undefined; break; case 'a': ea = EA_ask; break; default: throw Erange("crit_action_create_from_string", tools_printf(gettext("Unknown policy for EA '%c' in expression %S"), *(argument.begin() +1), &argument)); } ret = new (nothrow) crit_constant_action(data, ea); if(ret == nullptr) throw Ememory("crit_action_create_from_string"); else return ret; } throw Erange("crit_action_create_from_string", string(gettext("Unknown expression in overwriting policy: ")) + argument); } catch(...) { if(ret != nullptr) delete ret; throw; } throw SRC_BUG; // we should never reach this statement } static const criterium * criterium_create_from_string(user_interaction &dialog, const string & argument, const infinint & hourshift) { string::const_iterator it; const criterium *ret = nullptr; if(argument.begin() == argument.end()) throw Erange("criterium_create_from_string","Unexpected empty string in expression"); try { // looking for '|' operator first it = line_tools_find_first_char_out_of_parenth(argument, '|'); if(it != argument.end()) { const criterium * tmp = nullptr; const crit_or *tmp_or = nullptr; crit_or *ret_or = nullptr; try { if(*it != '|') throw SRC_BUG; ret = ret_or = new (nothrow) crit_or(); if(ret == nullptr) throw Ememory("criterium_create_from_string"); tmp = criterium_create_from_string(dialog, string(argument.begin(), it), hourshift); if(tmp == nullptr) throw SRC_BUG; ret_or->add_crit(*tmp); delete tmp; tmp = nullptr; tmp = criterium_create_from_string(dialog, string(it+1, argument.end()), hourshift); tmp_or = dynamic_cast(tmp); if(tmp_or != nullptr) ret_or->gobe(*(const_cast(tmp_or))); else ret_or->add_crit(*tmp); delete tmp; tmp = nullptr; } catch(...) { if(tmp != nullptr) delete tmp; throw; } return ret; } // if no '|' is found, looking for '&' operator it = line_tools_find_first_char_out_of_parenth(argument, '&'); if(it != argument.end()) { const criterium *tmp = nullptr; const crit_and *tmp_and = nullptr; crit_and *ret_and = nullptr; try { if(*it != '&') throw SRC_BUG; ret = ret_and = new (nothrow) crit_and(); if(ret == nullptr) throw Ememory("criterium_create_from_string"); tmp = criterium_create_from_string(dialog, string(argument.begin(), it), hourshift); if(tmp == nullptr) throw SRC_BUG; ret_and->add_crit(*tmp); delete tmp; tmp = nullptr; tmp = criterium_create_from_string(dialog, string(it+1, argument.end()), hourshift); tmp_and = dynamic_cast(tmp); if(tmp_and != nullptr) ret_and->gobe(*(const_cast(tmp_and))); else ret_and->add_crit(*tmp); delete tmp; tmp = nullptr; } catch(...) { if(tmp != nullptr) delete tmp; throw; } return ret; } // else looking whether we have global parenthesis around the expresion if(*argument.begin() == '(' && *(argument.end() - 1) == ')') return criterium_create_from_string(dialog, string(argument.begin() + 1, argument.end() - 1), hourshift); else // well, this "else" statment is not necessary, I just found cleaner to add it to have a block in which to declare a temporary pointer { // else looking for unary operators const criterium *tmp = nullptr; try { switch(*argument.begin()) { case '!': tmp = criterium_create_from_string(dialog, string(argument.begin() + 1, argument.end()), hourshift); if(tmp == nullptr) throw SRC_BUG; ret = new (nothrow) crit_not(*tmp); delete tmp; tmp = nullptr; if(ret == nullptr) throw Ememory("criterium_create_from_string"); return ret; case '~': tmp = criterium_create_from_string(dialog, string(argument.begin() + 1, argument.end()), hourshift); if(tmp == nullptr) throw SRC_BUG; ret = new (nothrow) crit_invert(*tmp); delete tmp; tmp = nullptr; if(ret == nullptr) throw Ememory("criterium_create_from_string"); return ret; } } catch(...) { if(tmp != nullptr) delete tmp; throw; } } // else looking for atomic operator with argument if(argument.size() >= 4) // minimum size is "X(a)" thus 4 chars { if(*(argument.begin() + 1) == '(' && *(argument.end() - 1) == ')') { infinint date; string sub_arg = string(argument.begin() + 2, argument.end() - 1); // parsing and converting the argument of the atomic operator switch(*argument.begin()) { case 'R': case 'r': try { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci tmp = sub_arg; date = tmp.computer(); } catch(Edeci & e) { date = tools_convert_date(sub_arg); } break; default: throw Erange("criterium_create_from_string", string(gettext("Unknown atomic operator, or atomic not allowed with an argument: ") + argument)); } // creating the criterium with its parameter switch(*argument.begin()) { case 'R': ret = new (nothrow) crit_in_place_data_more_recent_or_equal_to(date, hourshift); break; case 'r': ret = new (nothrow) crit_in_place_EA_more_recent_or_equal_to(date, hourshift); break; default: throw SRC_BUG; } if(ret == nullptr) throw Ememory("criterium_create_from_string"); else return ret; } } // else looking for atomic operator if(argument.size() == 1) { switch(*argument.begin()) { case 'I': ret = new (nothrow) crit_in_place_is_inode(); break; case 'D': ret = new (nothrow) crit_in_place_is_dir(); break; case 'F': ret = new (nothrow) crit_in_place_is_file(); break; case 'H': ret = new (nothrow) crit_in_place_is_hardlinked_inode(); break; case 'A': ret = new (nothrow) crit_in_place_is_new_hardlinked_inode(); break; case 'R': ret = new (nothrow) crit_in_place_data_more_recent(hourshift); break; case 'B': ret = new (nothrow) crit_in_place_data_bigger(); break; case 'S': ret = new (nothrow) crit_in_place_data_saved(); break; case 'Y': ret = new (nothrow) crit_in_place_data_dirty(); break; case 'X': ret = new (nothrow) crit_in_place_data_sparse(); break; case 'e': ret = new (nothrow) crit_in_place_EA_present(); break; case 'r': ret = new (nothrow) crit_in_place_EA_more_recent(hourshift); break; case 'm': ret = new (nothrow) crit_in_place_more_EA(); break; case 'b': ret = new (nothrow) crit_in_place_EA_bigger(); break; case 's': ret = new (nothrow) crit_in_place_EA_saved(); break; case 'T': ret = new (nothrow) crit_same_type(); break; default: throw Erange("criterium_create_from_string", string(gettext("Unknown character found while parsing conditional string: ")) + argument); } if(ret == nullptr) throw Ememory("criterium_create_from_string"); else return ret; } throw Erange("criterium_create_from_string", string(gettext("Unknown expression found while parsing conditional string: ")) + argument); } catch(...) { if(ret != nullptr) delete ret; throw; } throw SRC_BUG; // we should never reach this statement. } dar-2.5.3/src/dar_suite/dar_xform.cpp0000644000175000017430000004472412641772777014504 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #include "getopt_decision.h" } // end extern "C" #include #include #include "sar.hpp" #include "trivial_sar.hpp" #include "user_interaction.hpp" #include "tools.hpp" #include "tuyau.hpp" #include "dar_suite.hpp" #include "integers.hpp" #include "shell_interaction.hpp" #include "libdar.hpp" #include "thread_cancellation.hpp" #include "header.hpp" #include "line_tools.hpp" #include "entrepot_local.hpp" #include "macro_tools.hpp" using namespace libdar; #define DAR_XFORM_VERSION "1.5.8" #define OPT_STRING "s:S:p::wnhbVE:F:a::Qj^:3:9:" static bool command_line(shell_interaction & dialog, S_I argc, char * const argv[], path * & src_dir, string & src, path * & dst_dir, string & dst, infinint & first_file_size, infinint & file_size, bool & warn, bool & allow, infinint & pause, bool & beep, string & execute_src, string & execute_dst, string & slice_perm, string & slice_user, string & slice_group, hash_algo & hash, infinint & src_min_digits, infinint & dst_min_digits); static void show_usage(shell_interaction & dialog, const char *command_name); static void show_version(shell_interaction & dialog, const char *command_name); static S_I sub_main(shell_interaction & dialog, S_I argc, char *const argv[], const char **env); int main(S_I argc, char *const argv[], const char **env) { return dar_suite_global(argc, argv, env, OPT_STRING, #if HAVE_GETOPT_LONG nullptr, #endif '\0', // should never be met as option, thus early read the whole command-line for -j and -Q options &sub_main); } static S_I sub_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env) { path *src_dir = nullptr; path *dst_dir = nullptr; string src, dst; infinint first, size; bool warn, allow, beep; infinint pause; string execute_src, execute_dst; thread_cancellation thr; string slice_perm; string slice_user; string slice_group; hash_algo hash; infinint src_min_digits; infinint dst_min_digits; S_I ret = EXIT_OK; try { if(command_line(dialog, argc, argv, src_dir, src, dst_dir, dst, first, size, warn, allow, pause, beep, execute_src, execute_dst, slice_perm, slice_user, slice_group, hash, src_min_digits, dst_min_digits)) { generic_file *dst_sar = nullptr; generic_file *src_sar = nullptr; label data_name; label internal_name; entrepot_local entrep = entrepot_local(slice_user, slice_group, false); bool format_07_compatible = false; bool force_perm = slice_perm != ""; U_I perm = force_perm ? tools_octal2int(slice_perm) : 0; data_name.clear(); internal_name.generate_internal_filename(); try { if(dst != "-") { dialog.change_non_interactive_output(&cout); tools_avoid_slice_overwriting_regex(dialog, dst_dir->display(), string("^")+dst+"\\.[0-9]+\\."+EXTENSION+"(\\.(md5|sha1))?$", false, allow, warn, false); } thr.check_self_cancellation(); dialog.set_beep(beep); if(src == "-") { trivial_sar *tmp_sar = new (nothrow) trivial_sar(dialog, src, false); if(tmp_sar == nullptr) throw Ememory("sub_main"); format_07_compatible = tmp_sar->is_an_old_start_end_archive(); src_sar = tmp_sar; if(src_sar != nullptr) data_name = tmp_sar->get_data_name(); else throw SRC_BUG; } else // source not from a pipe { if(src_dir != nullptr) entrep.set_location(*src_dir); else throw SRC_BUG; sar *tmp_sar = new (nothrow) sar(dialog, src, EXTENSION, entrep, false, src_min_digits, false, execute_src); if(tmp_sar == nullptr) throw Ememory("main"); else tmp_sar->set_info_status(CONTEXT_OP); format_07_compatible = tmp_sar->is_an_old_start_end_archive(); src_sar = tmp_sar; if(src_sar != nullptr) data_name = tmp_sar->get_data_name(); else throw SRC_BUG; } if(size.is_zero()) if(dst == "-") dst_sar = macro_tools_open_archive_tuyau(dialog, nullptr, 1, gf_write_only, internal_name, data_name, format_07_compatible, execute_dst); else { if(dst_dir != nullptr) entrep.set_location(*dst_dir); else throw SRC_BUG; dst_sar = new (nothrow) trivial_sar(dialog, gf_write_only, dst, EXTENSION, entrep, internal_name, data_name, execute_dst, allow, warn, force_perm, perm, hash, dst_min_digits, format_07_compatible); } else { if(dst_dir != nullptr) entrep.set_location(*dst_dir); else throw SRC_BUG; dst_sar = new (nothrow) sar(dialog, gf_write_only, dst, EXTENSION, size, first, warn, allow, pause, entrep, internal_name, data_name, force_perm, perm, hash, dst_min_digits, format_07_compatible, execute_dst); } if(dst_sar == nullptr) throw Ememory("main"); thr.check_self_cancellation(); try { src_sar->copy_to(*dst_sar); } catch(Escript & e) { throw; } catch(Euser_abort & e) { throw; } catch(Ebug & e) { throw; } catch(Ethread_cancel & e) { throw; } catch(Egeneric & e) { string msg = string(gettext("Error transforming the archive :"))+e.get_message(); dialog.warning(msg); throw Edata(msg); } } catch(...) { if(dst_sar != nullptr) delete dst_sar; if(src_sar != nullptr) delete src_sar; throw; } if(src_sar != nullptr) delete src_sar; if(dst_sar != nullptr) delete dst_sar; ret = EXIT_OK; } else ret = EXIT_SYNTAX; } catch(...) { if(src_dir != nullptr) delete src_dir; if(dst_dir != nullptr) delete dst_dir; throw; } if(src_dir != nullptr) delete src_dir; if(dst_dir != nullptr) delete dst_dir; return ret; } static bool command_line(shell_interaction & dialog, S_I argc, char * const argv[], path * & src_dir, string & src, path * & dst_dir, string & dst, infinint & first_file_size, infinint & file_size, bool & warn, bool & allow, infinint & pause, bool & beep, string & execute_src, string & execute_dst, string & slice_perm, string & slice_user, string & slice_group, hash_algo & hash, infinint & src_min_digits, infinint & dst_min_digits) { S_I lu; src_dir = nullptr; dst_dir = nullptr; warn = true; allow = true; pause = 0; beep = false; first_file_size = 0; file_size = 0; src = dst = ""; execute_src = execute_dst = ""; U_I suffix_base = TOOLS_BIN_SUFFIX; slice_perm = ""; slice_user = ""; slice_group = ""; hash = hash_none; src_min_digits = 0; dst_min_digits = 0; try { while((lu = getopt(argc, argv, OPT_STRING)) != EOF) { switch(lu) { case 's': if(!file_size.is_zero()) throw Erange("command_line", gettext("Only one -s option is allowed")); if(optarg == nullptr) throw Erange("command_line", gettext("Missing argument to -s")); else { try { file_size = tools_get_extended_size(optarg, suffix_base); if(first_file_size.is_zero()) first_file_size = file_size; } catch(Edeci &e) { dialog.warning(gettext("Invalid size for option -s")); return false; } } break; case 'S': if(optarg == nullptr) throw Erange("command_line", gettext("Missing argument to -S")); if(first_file_size.is_zero()) first_file_size = tools_get_extended_size(optarg, suffix_base); else if(file_size.is_zero()) throw Erange("command_line", gettext("Only one -S option is allowed")); else if(file_size == first_file_size) { try { first_file_size = tools_get_extended_size(optarg, suffix_base); if(first_file_size == file_size) dialog.warning(gettext("Giving -S option the same value as the one given to -s is useless")); } catch(Egeneric &e) { dialog.warning(gettext("Invalid size for option -S")); return false; } } else throw Erange("command_line", gettext("Only one -S option is allowed")); break; case 'p': if(optarg != nullptr) { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci conv = string(optarg); pause = conv.computer(); } else pause = 1; break; case 'w': warn = false; break; case 'n': allow = false; break; case 'b': beep = true; break; case 'h': show_usage(dialog, argv[0]); return false; case 'V': show_version(dialog, argv[0]); return false; case 'E': if(optarg == nullptr) throw Erange("command_line", gettext("Missing argument to -E")); if(execute_dst == "") execute_dst = optarg; else execute_dst += string(" ; ") + optarg; break; case 'F': if(optarg == nullptr) throw Erange("command_line", gettext("Missing argument to -F")); if(execute_src == "") execute_src = optarg; else execute_src += string(" ; ") + optarg; break; case 'a': if(optarg == nullptr) throw Erange("command_line", gettext("-a option requires an argument")); if(strcasecmp("SI-unit", optarg) == 0 || strcasecmp("SI", optarg) == 0 || strcasecmp("SI-units", optarg) == 0) suffix_base = TOOLS_SI_SUFFIX; else if(strcasecmp("binary-unit", optarg) == 0 || strcasecmp("binary", optarg) == 0 || strcasecmp("binary-units", optarg) == 0) suffix_base = TOOLS_BIN_SUFFIX; else throw Erange("command_line", string(gettext("Unknown parameter given to -a option: ")) + optarg); break; case 'Q': break; // ignore this option already parsed during initialization (dar_suite.cpp) case '^': if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext("Missing argument to -^"), char(lu))); line_tools_slice_ownership(string(optarg), slice_perm, slice_user, slice_group); break; case '3': if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext("Missing argument to --hash"), char(lu))); if(strcasecmp(optarg, "md5") == 0) hash = hash_md5; else if(strcasecmp(optarg, "sha1") == 0) hash = hash_sha1; else throw Erange("command_line", string(gettext("Unknown parameter given to --hash option: ")) + optarg); break; case '9': if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext("Missing argument to --min-digits"), char(lu))); else { infinint tmp2; line_tools_get_min_digits(optarg, src_min_digits, dst_min_digits, tmp2); } break; case ':': throw Erange("command_line", tools_printf(gettext("Missing parameter to option -%c"), char(optopt))); case '?': dialog.warning(tools_printf(gettext("Ignoring unknown option -%c"), char(optopt))); break; default: throw SRC_BUG; } } // reading arguments remain on the command line if(optind + 2 > argc) { dialog.warning(gettext("Missing source or destination argument on command line, see -h option for help")); return false; } if(optind + 2 < argc) { dialog.warning(gettext("Too many argument on command line, see -h option for help")); return false; } if(string(argv[optind]) != string("")) { tools_split_path_basename(argv[optind], src_dir, src); tools_check_basename(dialog, *src_dir, src, EXTENSION); } else { dialog.warning(gettext("Invalid argument as source archive")); return false; } if(string(argv[optind+1]) != string("")) tools_split_path_basename(argv[optind+1], dst_dir, dst); else { dialog.warning(gettext("Invalid argument as destination archive")); return false; } // sanity checks if(dst == "-" && !file_size.is_zero()) throw Erange("dar_xform::command_line", gettext("Archive on stdout is not compatible with slicing (-s option)")); } catch(...) { if(src_dir != nullptr) delete src_dir; src_dir = nullptr; if(dst_dir != nullptr) delete dst_dir; dst_dir = nullptr; throw; } return true; } static void show_usage(shell_interaction & dialog, const char *command_name) { string name; tools_extract_basename(command_name, name); dialog.change_non_interactive_output(&cout); dialog.printf("usage :\t %s [options] [/] [/]\n", name.c_str()); dialog.printf(" \t %s -h\n",name.c_str()); dialog.printf(" \t %s -V\n",name.c_str()); dialog.printf(gettext("\n")); dialog.printf(gettext("\t\t the first non options argument is the archive to read\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("\t\t the second non option argument is the archive to create\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("Common options:\n")); dialog.printf(gettext(" -h\t\t displays this help information\n")); dialog.printf(gettext(" -V\t\t displays version information\n")); dialog.printf(gettext(" -s split the archive in several files of size \n")); dialog.printf(gettext(" -S first file size\n")); dialog.printf(gettext(" -p\t\t pauses before writing to a new file\n")); dialog.printf(gettext(" -n\t\t don't overwrite files\n")); dialog.printf(gettext(" -w\t\t don't warn before overwriting files\n")); dialog.printf(gettext(" -b\t\t ring the terminal bell when user action is required\n")); dialog.printf(gettext(" -E \t command to execute between slices of destination archive\n")); dialog.printf(gettext(" -F \t command to execute between slice of source archive\n")); dialog.printf(gettext(" -aSI \t slice size suffixes k, M, T, G, etc. are power of 10\n")); dialog.printf(gettext(" -abinary\t slice size suffixes k, M, T, G, etc. are power of 2\n")); dialog.printf(gettext(" -^ \t permission[:user[:group]] of created slices\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("See man page for more options.\n")); } static void show_version(shell_interaction & dialog, const char *command_name) { string name; tools_extract_basename(command_name, name); U_I maj, med, min; get_version(maj, med, min); dialog.change_non_interactive_output(&cout); dialog.printf("\n %s version %s, Copyright (C) 2002-2052 Denis Corbin\n\n", name.c_str(), DAR_XFORM_VERSION); if(maj > 2) dialog.printf(gettext(" Using libdar %u.%u.%u built with compilation time options:\n"), maj, med, min); else dialog.printf(gettext(" Using libdar %u.%u built with compilation time options:\n"), maj, min); tools_display_features(dialog); dialog.printf("\n"); dialog.printf(gettext(" compiled the %s with %s version %s\n"), __DATE__, CC_NAT, __VERSION__); dialog.printf(gettext(" %s is part of the Disk ARchive suite (Release %s)\n"), name.c_str(), PACKAGE_VERSION); dialog.warning(tools_printf(gettext(" %s comes with ABSOLUTELY NO WARRANTY; for details\n type `%s -W'."), name.c_str(), "dar") + tools_printf(gettext(" This is free software, and you are welcome\n to redistribute it under certain conditions;")) + tools_printf(gettext(" type `%s -L | more'\n for details.\n\n"), "dar")); } dar-2.5.3/src/dar_suite/config_file.hpp0000644000175000017430000000354712641772777014772 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file config_file.hpp /// \brief specific routines to manages included files's targets /// \ingroup CMDLINE #ifndef CONFIG_FILE_HPP #define CONFIG_FILE_HPP #include "../my_config.h" #include #include "hide_file.hpp" using namespace libdar; /// \addtogroup CMDLINE /// @{ class config_file : public hide_file { public: config_file(const vector & target, generic_file &f); vector get_read_targets() const; protected: void fill_morceau(); private: struct t_cible { string target; bool seen; t_cible(const string & val) { target = val; seen = false; }; t_cible() { target = ""; seen = false; }; }; vector cibles; bool is_a_target(const string & val); bool find_next_target(generic_file &f, infinint & debut, string & nature, infinint & fin); }; /// @} #endif dar-2.5.3/src/dar_suite/no_comment.hpp0000644000175000017430000000273012610405012014620 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file no_comment.hpp /// \brief contains class that transparently strips out the comments from configuration file /// \ingroup CMDLINE #ifndef NO_COMMENT_HPP #define NO_COMMENT_HPP #include "../my_config.h" #include "hide_file.hpp" using namespace libdar; /// \addtogroup CMDLINE /// @{ class no_comment : public hide_file { public: no_comment(generic_file &f) : hide_file(f) {}; protected: void fill_morceau(); }; // @} #endif dar-2.5.3/src/dar_suite/dar.cpp0000644000175000017430000011444012642474445013252 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include #include #include #include "erreurs.hpp" #include "user_interaction.hpp" #include "command_line.hpp" #include "tools.hpp" #include "dar.hpp" #include "dar_suite.hpp" #include "integers.hpp" #include "deci.hpp" #include "libdar.hpp" #include "shell_interaction.hpp" #include "criterium.hpp" #include "line_tools.hpp" #ifndef DAR_VERSION #define DAR_VERSION "unknown (BUG at compilation time?)" #endif using namespace std; using namespace libdar; static void display_sauv_stat(user_interaction & dialog, const statistics & st); static void display_rest_stat(user_interaction & dialog, const statistics & st); static void display_diff_stat(user_interaction & dialog, const statistics &st); static void display_test_stat(user_interaction & dialog, const statistics & st); static void display_merge_stat(user_interaction & dialog, const statistics & st); static S_I little_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env); int main(S_I argc, char * const argv[], const char **env) { return dar_suite_global(argc, argv, env, get_short_opt(), #if HAVE_GETOPT_LONG get_long_opt(), #endif '\0', // should never be met as option, thus early read the whole command-line for -j and -Q options &little_main); } static S_I little_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env) { S_I ret = EXIT_OK; line_param param; const char *home = tools_get_from_env(env, "HOME"); vector dar_dcf_path = line_tools_explode_PATH(tools_get_from_env(env, "DAR_DCF_PATH")); vector dar_duc_path = line_tools_explode_PATH(tools_get_from_env(env, "DAR_DUC_PATH")); if(home == nullptr) home = "/"; if(! get_args(dialog, home, dar_dcf_path, dar_duc_path, argc, argv, param)) { if(param.op == version_or_help) return EXIT_OK; else return EXIT_SYNTAX; } else // get_args is OK, we've got a valid command line { archive *arch = nullptr; archive *aux = nullptr; archive *cur = nullptr; dialog.set_beep(param.beep); if(param.filename != "-" || (param.output_pipe != "" && param.op != create && param.op != isolate && param.op != merging)) dialog.change_non_interactive_output(&cout); // standart output can be used to send non interactive // messages try { statistics st = false; secu_string tmp_pass; crypto_algo crypto, aux_crypto; archive_options_read read_options; archive_options_create create_options; archive_options_isolate isolate_options; archive_options_merge merge_options; archive_options_extract extract_options; archive_options_listing listing_options; archive_options_diff diff_options; archive_options_test test_options; bool no_cipher_given; vector recipients; switch(param.op) { case create: case merging: if(param.ref_filename != nullptr && param.ref_root != nullptr) { line_tools_crypto_split_algo_pass(param.pass_ref, crypto, tmp_pass, no_cipher_given, recipients); if(param.op == merging && param.aux_root != nullptr && param.info_details) dialog.warning(gettext("Considering the (first) archive of reference:")); read_options.clear(); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_crypto_algo(libdar::crypto_none); else read_options.set_crypto_algo(crypto); read_options.set_crypto_pass(tmp_pass); read_options.set_crypto_size(param.crypto_size_ref); read_options.set_input_pipe(param.input_pipe); read_options.set_output_pipe(param.output_pipe); read_options.set_execute(param.execute_ref); read_options.set_info_details(param.info_details); read_options.set_lax(param.lax); read_options.set_slice_min_digits(param.ref_num_digits); read_options.set_ignore_signature_check_failure(param.blind_signatures); read_options.set_multi_threaded(param.multi_threaded); if(param.sequential_read) { if(param.op == merging) throw Erange("little_main", gettext("Using sequential reading mode for archive source is not possible for merging operation")); else read_options.set_sequential_read(true); } arch = new (nothrow) archive(dialog, *param.ref_root, *param.ref_filename, EXTENSION, read_options); if(arch == nullptr) throw Ememory("little_main"); } if(param.aux_root != nullptr && param.aux_filename != nullptr) { if(param.op != merging && param.op != create) throw SRC_BUG; if(param.op == merging) { if(param.info_details) dialog.warning(gettext("Considering the second (alias auxiliary) archive of reference:")); line_tools_crypto_split_algo_pass(param.aux_pass, aux_crypto, tmp_pass, no_cipher_given, recipients); read_options.clear(); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_crypto_algo(libdar::crypto_none); else read_options.set_crypto_algo(aux_crypto); read_options.set_crypto_pass(tmp_pass); read_options.set_crypto_size(param.aux_crypto_size); read_options.set_execute(param.aux_execute); read_options.set_info_details(param.info_details); read_options.set_lax(param.lax); read_options.set_slice_min_digits(param.aux_num_digits); read_options.set_ignore_signature_check_failure(param.blind_signatures); read_options.set_multi_threaded(param.multi_threaded); if(param.sequential_read) throw Erange("little_main", gettext("Using sequential reading mode for archive source is not possible for merging operation")); aux = new (nothrow) archive(dialog, *param.aux_root, *param.aux_filename, EXTENSION, read_options); if(aux == nullptr) throw Ememory("little_main"); } } line_tools_crypto_split_algo_pass(param.pass, crypto, tmp_pass, no_cipher_given, recipients); switch(param.op) { case create: create_options.clear(); if(arch != nullptr) { arch->drop_all_filedescriptors(dialog); create_options.set_reference(arch); } create_options.set_selection(*param.selection); create_options.set_subtree(*param.subtree); create_options.set_allow_over(param.allow_over); create_options.set_warn_over(param.warn_over); create_options.set_info_details(param.info_details); create_options.set_display_treated(param.display_treated, param.display_treated_only_dir); create_options.set_display_skipped(param.display_skipped); create_options.set_display_finished(param.display_finished); create_options.set_pause(param.pause); create_options.set_empty_dir(param.empty_dir); create_options.set_compression(param.algo); create_options.set_compression_level(param.compression_level); create_options.set_slicing(param.file_size, param.first_file_size); create_options.set_ea_mask(*param.ea_mask); create_options.set_execute(param.execute); create_options.set_crypto_algo(crypto); create_options.set_crypto_pass(tmp_pass); create_options.set_crypto_size(param.crypto_size); create_options.set_gnupg_recipients(recipients); if(recipients.empty() && !param.signatories.empty()) throw Erange("little_main", gettext("Archive signature is only possible with gnupg encryption")); create_options.set_gnupg_signatories(param.signatories); create_options.set_compr_mask(*param.compress_mask); create_options.set_min_compr_size(param.min_compr_size); create_options.set_nodump(param.nodump); if(param.exclude_by_ea) create_options.set_exclude_by_ea(param.ea_name_for_exclusion); create_options.set_what_to_check(param.what_to_check); create_options.set_hourshift(param.hourshift); create_options.set_empty(param.empty); create_options.set_alter_atime(param.alter_atime); create_options.set_furtive_read_mode(param.furtive_read_mode); create_options.set_same_fs(param.same_fs); create_options.set_snapshot(param.snapshot); create_options.set_cache_directory_tagging(param.cache_directory_tagging); create_options.set_fixed_date(param.fixed_date); create_options.set_slice_permission(param.slice_perm); create_options.set_slice_user_ownership(param.slice_user); create_options.set_slice_group_ownership(param.slice_group); create_options.set_retry_on_change(param.repeat_count, param.repeat_byte); create_options.set_sequential_marks(param.use_sequential_marks); create_options.set_sparse_file_min_size(param.sparse_file_min_size); create_options.set_security_check(param.security_check); create_options.set_user_comment(param.user_comment); create_options.set_hash_algo(param.hash); create_options.set_slice_min_digits(param.num_digits); create_options.set_fsa_scope(param.scope); create_options.set_multi_threaded(param.multi_threaded); if(param.backup_hook_mask != nullptr) create_options.set_backup_hook(param.backup_hook_execute, *param.backup_hook_mask); create_options.set_ignore_unknown_inode_type(param.ignore_unknown_inode); cur = new (nothrow) archive(dialog, *param.fs_root, *param.sauv_root, param.filename, EXTENSION, create_options, &st); if(cur == nullptr) throw Ememory("little_main"); if(!param.quiet) display_sauv_stat(dialog, st); break; case merging: merge_options.clear(); merge_options.set_auxilliary_ref(aux); merge_options.set_selection(*param.selection); merge_options.set_subtree(*param.subtree); merge_options.set_allow_over(param.allow_over); merge_options.set_overwriting_rules(*param.overwrite); merge_options.set_warn_over(param.warn_over); merge_options.set_info_details(param.info_details); merge_options.set_display_treated(param.display_treated, param.display_treated_only_dir); merge_options.set_display_skipped(param.display_skipped); merge_options.set_pause(param.pause); merge_options.set_empty_dir(param.empty_dir); merge_options.set_compression(param.algo); merge_options.set_compression_level(param.compression_level); merge_options.set_slicing(param.file_size, param.first_file_size); merge_options.set_ea_mask(*param.ea_mask); merge_options.set_execute(param.execute); merge_options.set_crypto_algo(crypto); merge_options.set_crypto_pass(tmp_pass); merge_options.set_crypto_size(param.crypto_size); merge_options.set_gnupg_recipients(recipients); if(recipients.empty() && !param.signatories.empty()) throw Erange("little_main", gettext("Archive signature is only possible with gnupg encryption")); merge_options.set_gnupg_signatories(param.signatories); merge_options.set_compr_mask(*param.compress_mask); merge_options.set_min_compr_size(param.min_compr_size); merge_options.set_empty(param.empty); merge_options.set_keep_compressed(param.keep_compressed); merge_options.set_slice_permission(param.slice_perm); merge_options.set_slice_user_ownership(param.slice_user); merge_options.set_slice_group_ownership(param.slice_group); merge_options.set_decremental_mode(param.decremental); merge_options.set_sequential_marks(param.use_sequential_marks); merge_options.set_sparse_file_min_size(param.sparse_file_min_size); merge_options.set_user_comment(param.user_comment); merge_options.set_hash_algo(param.hash); merge_options.set_slice_min_digits(param.num_digits); merge_options.set_fsa_scope(param.scope); merge_options.set_multi_threaded(param.multi_threaded); cur = new (nothrow) archive(dialog, // user_interaction & *param.sauv_root, //const path & arch, // archive * param.filename, // const string & EXTENSION, // const string & merge_options, &st); // statistics* if(cur == nullptr) throw Ememory("little_main"); if(!param.quiet) display_merge_stat(dialog, st); break; default: throw SRC_BUG; } // making some room in memory if(param.info_details) dialog.warning(gettext("Making room in memory (releasing memory used by archive of reference)...")); if(arch != nullptr) { delete arch; arch = nullptr; } if(aux != nullptr) { delete aux; aux = nullptr; } // checking for onfly isolation if(!st.get_errored().is_zero()) ret = EXIT_DATA_ERROR; if(!st.get_tooold().is_zero()) ret = EXIT_SAVED_MODIFIED; if(param.op == create) if(param.aux_root != nullptr && param.aux_filename != nullptr) { if(param.op != merging && param.op != create) throw SRC_BUG; if(param.op == create) { if(!param.quiet) dialog.warning(gettext("Now performing on-fly isolation...")); if(cur == nullptr) throw SRC_BUG; line_tools_crypto_split_algo_pass(param.aux_pass, aux_crypto, tmp_pass, no_cipher_given, recipients); isolate_options.clear(); isolate_options.set_allow_over(param.allow_over); isolate_options.set_warn_over(param.warn_over); isolate_options.set_info_details(param.info_details); isolate_options.set_pause(param.pause); if(compile_time::libbz2()) isolate_options.set_compression(bzip2); else if(compile_time::libz()) isolate_options.set_compression(gzip); else if(compile_time::liblzo()) isolate_options.set_compression(lzo); else // no compression isolate_options.set_compression(none); isolate_options.set_execute(param.aux_execute); isolate_options.set_crypto_algo(aux_crypto); isolate_options.set_crypto_pass(tmp_pass); isolate_options.set_crypto_size(param.aux_crypto_size); isolate_options.set_gnupg_recipients(recipients); if(recipients.empty() && !param.signatories.empty()) throw Erange("little_main", gettext("Archive signature is only possible with gnupg encryption")); isolate_options.set_gnupg_signatories(param.signatories); isolate_options.set_empty(param.empty); isolate_options.set_slice_permission(param.slice_perm); isolate_options.set_slice_user_ownership(param.slice_user); isolate_options.set_slice_group_ownership(param.slice_group); isolate_options.set_hash_algo(param.hash); isolate_options.set_slice_min_digits(param.aux_num_digits); isolate_options.set_user_comment(param.user_comment); isolate_options.set_sequential_marks(param.use_sequential_marks); isolate_options.set_multi_threaded(param.multi_threaded); cur->op_isolate(dialog, *param.aux_root, *param.aux_filename, EXTENSION, isolate_options); } } break; case isolate: line_tools_crypto_split_algo_pass(param.pass_ref, crypto, tmp_pass, no_cipher_given, recipients); read_options.clear(); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_crypto_algo(libdar::crypto_none); else read_options.set_crypto_algo(crypto); read_options.set_crypto_pass(tmp_pass); read_options.set_crypto_size(param.crypto_size_ref); read_options.set_input_pipe(param.input_pipe); read_options.set_output_pipe(param.output_pipe); read_options.set_execute(param.execute_ref); read_options.set_info_details(param.info_details); read_options.set_lax(param.lax); read_options.set_sequential_read(param.sequential_read); read_options.set_slice_min_digits(param.ref_num_digits); read_options.set_ignore_signature_check_failure(param.blind_signatures); read_options.set_multi_threaded(param.multi_threaded); arch = new (nothrow) archive(dialog, *param.ref_root, *param.ref_filename, EXTENSION, read_options); if(arch == nullptr) throw Ememory("little_main"); else arch->drop_all_filedescriptors(dialog); line_tools_crypto_split_algo_pass(param.pass, crypto, tmp_pass, no_cipher_given, recipients); isolate_options.clear(); isolate_options.set_allow_over(param.allow_over); isolate_options.set_warn_over(param.warn_over); isolate_options.set_info_details(param.info_details); isolate_options.set_pause(param.pause); isolate_options.set_compression(param.algo); isolate_options.set_compression_level(param.compression_level); isolate_options.set_slicing(param.file_size, param.first_file_size); isolate_options.set_execute(param.execute); isolate_options.set_crypto_algo(crypto); isolate_options.set_crypto_pass(tmp_pass); isolate_options.set_crypto_size(param.crypto_size); isolate_options.set_gnupg_recipients(recipients); if(recipients.empty() && !param.signatories.empty()) throw Erange("little_main", gettext("Archive signature is only possible with gnupg encryption")); isolate_options.set_gnupg_signatories(param.signatories); isolate_options.set_empty(param.empty); isolate_options.set_slice_permission(param.slice_perm); isolate_options.set_slice_user_ownership(param.slice_user); isolate_options.set_slice_group_ownership(param.slice_group); isolate_options.set_user_comment(param.user_comment); isolate_options.set_hash_algo(param.hash); isolate_options.set_slice_min_digits(param.num_digits); isolate_options.set_sequential_marks(param.use_sequential_marks); isolate_options.set_multi_threaded(param.multi_threaded); arch->op_isolate(dialog, *param.sauv_root, param.filename, EXTENSION, isolate_options); break; case extract: line_tools_crypto_split_algo_pass(param.pass, crypto, tmp_pass, no_cipher_given, recipients); read_options.clear(); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_crypto_algo(libdar::crypto_none); else read_options.set_crypto_algo(crypto); read_options.set_crypto_pass(tmp_pass); read_options.set_crypto_size(param.crypto_size); read_options.set_input_pipe(param.input_pipe); read_options.set_output_pipe(param.output_pipe); read_options.set_execute(param.execute); read_options.set_info_details(param.info_details); read_options.set_lax(param.lax); read_options.set_sequential_read(param.sequential_read); read_options.set_slice_min_digits(param.num_digits); read_options.set_ignore_signature_check_failure(param.blind_signatures); read_options.set_multi_threaded(param.multi_threaded); if(param.ref_filename != nullptr && param.ref_root != nullptr) { secu_string ref_tmp_pass; crypto_algo ref_crypto; line_tools_crypto_split_algo_pass(param.pass_ref, ref_crypto, ref_tmp_pass, no_cipher_given, recipients); read_options.set_external_catalogue(*param.ref_root, *param.ref_filename); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_ref_crypto_algo(libdar::crypto_none); else read_options.set_ref_crypto_algo(ref_crypto); read_options.set_ref_crypto_pass(ref_tmp_pass); read_options.set_ref_crypto_size(param.crypto_size_ref); read_options.set_ref_execute(param.execute_ref); read_options.set_ref_slice_min_digits(param.ref_num_digits); } arch = new (nothrow) archive(dialog, *param.sauv_root, param.filename, EXTENSION, read_options); if(arch == nullptr) throw Ememory("little_main"); extract_options.clear(); extract_options.set_selection(*param.selection); extract_options.set_subtree(*param.subtree); extract_options.set_warn_over(param.warn_over); extract_options.set_info_details(param.info_details); extract_options.set_display_treated(param.display_treated, param.display_treated_only_dir); extract_options.set_display_skipped(param.display_skipped); extract_options.set_ea_mask(*param.ea_mask); extract_options.set_flat(param.flat); extract_options.set_what_to_check(param.what_to_check); extract_options.set_warn_remove_no_match(param.warn_remove_no_match); extract_options.set_empty(param.empty); extract_options.set_empty_dir(!param.empty_dir); // the inversion above (!) is due to the fact this option is // set with the same -D option that is used at backup time to // save as empty directories those which have been excluded // by filters, option, which default is 'false', but here // in a restoration context, unless -D is provided (which set the // option to "true"), we want that all directories, empty or not, be restored extract_options.set_overwriting_rules(*param.overwrite); switch(param.dirty) { case dirtyb_ignore: extract_options.set_dirty_behavior(true, false); break; case dirtyb_warn: extract_options.set_dirty_behavior(false, true); break; case dirtyb_ok: extract_options.set_dirty_behavior(false, false); break; default: throw SRC_BUG; } extract_options.set_only_deleted(param.only_deleted); extract_options.set_ignore_deleted(param.not_deleted); extract_options.set_fsa_scope(param.scope); st = arch->op_extract(dialog, *param.fs_root, extract_options, nullptr); if(!param.quiet) display_rest_stat(dialog, st); if(st.get_errored() > 0) throw Edata(gettext("All files asked could not be restored")); break; case diff: line_tools_crypto_split_algo_pass(param.pass, crypto, tmp_pass, no_cipher_given, recipients); read_options.clear(); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_crypto_algo(libdar::crypto_none); else read_options.set_crypto_algo(crypto); read_options.set_crypto_pass(tmp_pass); read_options.set_crypto_size(param.crypto_size); read_options.set_input_pipe(param.input_pipe); read_options.set_output_pipe(param.output_pipe); read_options.set_execute(param.execute); read_options.set_info_details(param.info_details); read_options.set_lax(param.lax); read_options.set_sequential_read(param.sequential_read); read_options.set_slice_min_digits(param.num_digits); read_options.set_ignore_signature_check_failure(param.blind_signatures); read_options.set_multi_threaded(param.multi_threaded); if(param.ref_filename != nullptr && param.ref_root != nullptr) { secu_string ref_tmp_pass; crypto_algo ref_crypto; line_tools_crypto_split_algo_pass(param.pass_ref, ref_crypto, ref_tmp_pass, no_cipher_given, recipients); read_options.set_external_catalogue(*param.ref_root, *param.ref_filename); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_ref_crypto_algo(libdar::crypto_none); else read_options.set_ref_crypto_algo(ref_crypto); read_options.set_ref_crypto_pass(ref_tmp_pass); read_options.set_ref_crypto_size(param.crypto_size_ref); read_options.set_ref_execute(param.execute_ref); read_options.set_ref_slice_min_digits(param.ref_num_digits); } arch = new (nothrow) archive(dialog, *param.sauv_root, param.filename, EXTENSION, read_options); if(arch == nullptr) throw Ememory("little_main"); diff_options.clear(); diff_options.set_selection(*param.selection); diff_options.set_subtree(*param.subtree); diff_options.set_info_details(param.info_details); diff_options.set_display_treated(param.display_treated, param.display_treated_only_dir); diff_options.set_display_skipped(param.display_skipped); diff_options.set_ea_mask(*param.ea_mask); diff_options.set_what_to_check(param.what_to_check); diff_options.set_alter_atime(param.alter_atime); diff_options.set_furtive_read_mode(param.furtive_read_mode); diff_options.set_hourshift(param.hourshift); diff_options.set_compare_symlink_date(param.no_compare_symlink_date); diff_options.set_fsa_scope(param.scope); st = arch->op_diff(dialog, *param.fs_root, diff_options, nullptr); if(!param.quiet) display_diff_stat(dialog, st); if(st.get_errored() > 0 || st.get_deleted() > 0) throw Edata(gettext("Some file comparisons failed")); break; case test: line_tools_crypto_split_algo_pass(param.pass, crypto, tmp_pass, no_cipher_given, recipients); read_options.clear(); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_crypto_algo(libdar::crypto_none); else read_options.set_crypto_algo(crypto); read_options.set_crypto_pass(tmp_pass); read_options.set_crypto_size(param.crypto_size); read_options.set_input_pipe(param.input_pipe); read_options.set_output_pipe(param.output_pipe); read_options.set_execute(param.execute); read_options.set_info_details(param.info_details); read_options.set_lax(param.lax); read_options.set_sequential_read(param.sequential_read); read_options.set_slice_min_digits(param.num_digits); read_options.set_ignore_signature_check_failure(param.blind_signatures); read_options.set_multi_threaded(param.multi_threaded); if(param.ref_filename != nullptr && param.ref_root != nullptr) { secu_string ref_tmp_pass; crypto_algo ref_crypto; line_tools_crypto_split_algo_pass(param.pass_ref, ref_crypto, ref_tmp_pass, no_cipher_given, recipients); read_options.set_external_catalogue(*param.ref_root, *param.ref_filename); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_ref_crypto_algo(libdar::crypto_none); else read_options.set_ref_crypto_algo(ref_crypto); read_options.set_ref_crypto_pass(ref_tmp_pass); read_options.set_ref_crypto_size(param.crypto_size_ref); read_options.set_ref_execute(param.execute_ref); read_options.set_ref_slice_min_digits(param.ref_num_digits); } arch = new (nothrow) archive(dialog, *param.sauv_root, param.filename, EXTENSION, read_options); if(arch == nullptr) throw Ememory("little_main"); test_options.clear(); test_options.set_selection(*param.selection); test_options.set_subtree(*param.subtree); test_options.set_info_details(param.info_details); test_options.set_display_treated(param.display_treated, param.display_treated_only_dir); test_options.set_display_skipped(param.display_skipped); test_options.set_empty(param.empty); st = arch->op_test(dialog, test_options, nullptr); if(!param.quiet) display_test_stat(dialog, st); if(st.get_errored() > 0) throw Edata(gettext("Some files are corrupted in the archive and it will not be possible to restore them")); break; case listing: line_tools_crypto_split_algo_pass(param.pass, crypto, tmp_pass, no_cipher_given, recipients); read_options.clear(); if(no_cipher_given) // since archive format 9 crypto algo used // is stored in the archive, it will be used // unless we specify explicitely the cipher to use read_options.set_crypto_algo(libdar::crypto_none); else read_options.set_crypto_algo(crypto); read_options.set_crypto_pass(tmp_pass); read_options.set_crypto_size(param.crypto_size); read_options.set_input_pipe(param.input_pipe); read_options.set_output_pipe(param.output_pipe); read_options.set_execute(param.execute); read_options.set_info_details(param.info_details); read_options.set_lax(param.lax); read_options.set_sequential_read(param.sequential_read); read_options.set_slice_min_digits(param.num_digits); read_options.set_ignore_signature_check_failure(param.blind_signatures); read_options.set_multi_threaded(param.multi_threaded); arch = new (nothrow) archive(dialog, *param.sauv_root, param.filename, EXTENSION, read_options); if(arch == nullptr) throw Ememory("little_main"); if(param.quiet) { const list & gnupg_signed = arch->get_signatories(); arch->summary(dialog); line_tools_display_signatories(dialog, gnupg_signed); } else { if(param.info_details) { const list & gnupg_signed = arch->get_signatories(); arch->summary(dialog); line_tools_display_signatories(dialog, gnupg_signed); dialog.pause(gettext("Continue listing archive contents?")); } listing_options.clear(); listing_options.set_info_details(param.info_details); listing_options.set_list_mode(param.list_mode); listing_options.set_selection(*param.selection); listing_options.set_subtree(*param.subtree); listing_options.set_filter_unsaved(param.filter_unsaved); listing_options.set_display_ea(param.list_ea); if(!param.file_size.is_zero() && param.list_mode == archive_options_listing::slicing) listing_options.set_user_slicing(param.first_file_size, param.file_size); arch->op_listing(dialog, listing_options); } break; default: throw SRC_BUG; } } catch(...) { if(!param.quiet) dialog.warning(gettext("Final memory cleanup...")); if(arch != nullptr) { delete arch; arch = nullptr; } if(cur != nullptr) { delete cur; cur = nullptr; } if(aux != nullptr) { delete aux; aux = nullptr; } throw; } if(param.info_details) dialog.warning(gettext("Final memory cleanup...")); string mesg; if(arch != nullptr) { mesg = arch->free_and_check_memory(); if(!mesg.empty()) cerr << mesg << endl; } if(aux != nullptr) { mesg = aux->free_and_check_memory(); if(!mesg.empty()) cerr << mesg << endl; } if(cur != nullptr) { mesg = cur->free_and_check_memory(); if(!mesg.empty()) cerr << mesg << endl; } if(arch != nullptr) { delete arch; arch = nullptr; } if(cur != nullptr) { delete cur; cur = nullptr; } if(aux != nullptr) { delete aux; aux = nullptr; } return ret; } } static void display_sauv_stat(user_interaction & dialog, const statistics & st) { infinint total = st.total(); infinint treated = st.get_treated(); infinint hard_links = st.get_hard_links(); infinint tooold = st.get_tooold(); infinint skipped = st.get_skipped(); infinint ignored = st.get_ignored(); infinint errored = st.get_errored(); infinint deleted = st.get_deleted(); infinint ea_treated = st.get_ea_treated(); infinint fsa_treated = st.get_fsa_treated(); infinint byte_count = st.get_byte_amount(); dialog.printf("\n\n --------------------------------------------\n"); dialog.printf(gettext(" %i inode(s) saved\n"), &treated); dialog.printf(gettext(" including %i hard link(s) treated\n"), &hard_links); dialog.printf(gettext(" %i inode(s) changed at the moment of the backup and could not be saved properly\n"), &tooold); dialog.printf(gettext(" %i byte(s) have been wasted in the archive to resave changing files"), & byte_count); dialog.printf(gettext(" %i inode(s) not saved (no inode/file change)\n"), &skipped); dialog.printf(gettext(" %i inode(s) failed to be saved (filesystem error)\n"), &errored); dialog.printf(gettext(" %i inode(s) ignored (excluded by filters)\n"), &ignored); dialog.printf(gettext(" %i inode(s) recorded as deleted from reference backup\n"), &deleted); dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" Total number of inode(s) considered: %i\n"), &total); #ifdef EA_SUPPORT dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" EA saved for %i inode(s)\n"), &ea_treated); #endif dialog.printf(gettext(" FSA saved for %i inode(s)\n"), &fsa_treated); dialog.printf(" --------------------------------------------\n"); } static void display_rest_stat(user_interaction & dialog, const statistics & st) { infinint total = st.total(); infinint treated = st.get_treated(); infinint hard_links = st.get_hard_links(); infinint tooold = st.get_tooold(); infinint skipped = st.get_skipped(); infinint ignored = st.get_ignored(); infinint errored = st.get_errored(); infinint deleted = st.get_deleted(); infinint ea_treated = st.get_ea_treated(); infinint fsa_treated = st.get_fsa_treated(); dialog.printf("\n\n --------------------------------------------\n"); dialog.printf(gettext(" %i inode(s) restored\n"), &treated); dialog.printf(gettext(" including %i hard link(s)\n"), &hard_links); dialog.printf(gettext(" %i inode(s) not restored (not saved in archive)\n"), &skipped); dialog.printf(gettext(" %i inode(s) not restored (overwriting policy decision)\n"), &tooold); dialog.printf(gettext(" %i inode(s) ignored (excluded by filters)\n"), &ignored); dialog.printf(gettext(" %i inode(s) failed to restore (filesystem error)\n"), &errored); dialog.printf(gettext(" %i inode(s) deleted\n"), &deleted); dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" Total number of inode(s) considered: %i\n"), &total); #ifdef EA_SUPPORT dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" EA restored for %i inode(s)\n"), &ea_treated); #endif dialog.printf(gettext(" FSA restored for %i inode(s)\n"), &fsa_treated); dialog.printf(" --------------------------------------------\n"); } static void display_diff_stat(user_interaction & dialog, const statistics &st) { infinint total = st.total(); infinint treated = st.get_treated(); infinint ignored = st.get_ignored(); infinint errored = st.get_errored(); dialog.printf("\n\n --------------------------------------------\n"); dialog.printf(gettext(" %i item(s) treated\n"), &treated); dialog.printf(gettext(" %i item(s) do not match those on filesystem\n"), &errored); dialog.printf(gettext(" %i item(s) ignored (excluded by filters)\n"), &ignored); dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" Total number of items considered: %i\n"), &total); dialog.printf(" --------------------------------------------\n"); } static void display_test_stat(user_interaction & dialog, const statistics & st) { infinint total = st.total(); infinint treated = st.get_treated(); infinint errored = st.get_errored(); infinint skipped = st.get_skipped(); dialog.printf("\n\n --------------------------------------------\n"); dialog.printf(gettext(" %i item(s) treated\n"), &treated); dialog.printf(gettext(" %i item(s) with error\n"), &errored); dialog.printf(gettext(" %i item(s) ignored (excluded by filters)\n"), &skipped); dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" Total number of items considered: %i\n"), &total); dialog.printf(" --------------------------------------------\n"); } static void display_merge_stat(user_interaction & dialog, const statistics & st) { infinint total = st.total(); infinint treated = st.get_treated(); infinint hard_links = st.get_hard_links(); infinint deleted = st.get_deleted(); infinint ignored = st.get_ignored(); infinint ea_treated = st.get_ea_treated(); infinint fsa_treated = st.get_fsa_treated(); dialog.printf("\n\n --------------------------------------------\n"); dialog.printf(gettext(" %i inode(s) added to archive\n"), &treated); dialog.printf(gettext(" with %i hard link(s) recorded\n"), &hard_links); dialog.printf(gettext(" %i inode(s) ignored (excluded by filters)\n"), &ignored); dialog.printf(gettext(" %i inode(s) recorded as deleted\n"), &deleted); #ifdef EA_SUPPORT dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" EA saved for %i inode(s)\n"), &ea_treated); #endif dialog.printf(gettext(" FSA saved for %i inode(s)\n"), &fsa_treated); dialog.printf(" --------------------------------------------\n"); dialog.printf(gettext(" Total number of inode(s) considered: %i\n"), &total); dialog.printf(" --------------------------------------------\n"); } const char *dar_version() { return DAR_VERSION; } dar-2.5.3/src/dar_suite/shell_interaction.hpp0000644000175000017430000000745312641772777016234 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file shell_interaction.hpp /// \brief user_interaction class for command_line tools /// \ingroup CMDLINE #ifndef SHELL_INTERACTION_HPP #define SHELL_INTERACTION_HPP extern "C" { #if HAVE_TERMIOS_H #include #endif } // end extern "C" #include "../my_config.h" #include #include "user_interaction.hpp" using namespace std; using namespace libdar; /// \addtogroup CMDLINE /// @{ class shell_interaction : public user_interaction_callback { public: /// constructor /// /// \param[in] out defines where are sent non interactive messages (informative messages) /// \param[in] interact defines where are sent interactive messages (those requiring an answer or confirmation) from the user /// \param[in] silent whether to send a warning message if the process is not attached to a terminal /// \note out and interact must exist during the whole life of the shell_interaction object, it's the duty /// of the caller to releases these ostream objects if necessary. shell_interaction(ostream *out, ostream *interact, bool silent); /// copy constructor shell_interaction(const shell_interaction & ref); /// destructor ~shell_interaction(); void change_non_interactive_output(ostream *out); void read_char(char & a); void set_beep(bool mode) { beep = mode; }; /// overwritting method from parent class. virtual user_interaction *clone() const { user_interaction *ret = new (get_pool()) shell_interaction(*this); if(ret == nullptr) throw Ememory("shell_interaction::clone"); return ret; }; private: // data type enum mode { m_initial, m_inter, m_noecho }; // object fields and methods S_I input; //< filedescriptor to read from the user's answers ostream *output; //< holds the destination for non interactive messages ostream *inter; //< holds the destination for interactive messages bool beep; //< whether to issue bell char before displaying a new interactive message termios initial; //< controlling terminal configuration when the object has been created termios interaction; //< controlling terminal configuration to use when requiring user interaction termios initial_noecho; //< controlling terminal configuration to use when noecho has been requested bool has_terminal; //< true if a terminal could be found void set_term_mod(mode m); // class fields and methods static const U_I bufsize; static bool interaction_pause(const string &message, void *context); static void interaction_warning(const string & message, void *context); static string interaction_string(const string & message, bool echo, void *context); static secu_string interaction_secu_string(const string & message, bool echo, void *context); }; /// @} #endif dar-2.5.3/src/dar_suite/dar_manager.cpp0000644000175000017430000013305612641772777014760 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif #include "getopt_decision.h" } // end extern "C" #include #include #include #include "dar_suite.hpp" #include "macro_tools.hpp" #include "data_tree.hpp" #include "database.hpp" #include "user_interaction.hpp" #include "integers.hpp" #include "libdar.hpp" #include "shell_interaction.hpp" #include "tools.hpp" #include "thread_cancellation.hpp" #include "archive.hpp" #include "cygwin_adapt.hpp" #include "no_comment.hpp" #include "line_tools.hpp" #include "fichier_local.hpp" #include "deci.hpp" using namespace libdar; #define DAR_MANAGER_VERSION "1.7.10" #define ONLY_ONCE "Only one -%c is allowed, ignoring this extra option" #define MISSING_ARG "Missing argument to -%c" #define INVALID_ARG "Invalid argument given to -%c (requires integer)" #define OPT_STRING "C:B:A:lD:b:p:od:ru:f:shVm:vQjw:ie:c@:N;:ka:9:" enum operation { none_op, create, add, listing, del, chbase, where, options, dar, restore, used, files, stats, moving, interactive, check, batch }; static S_I little_main(shell_interaction & dialog, S_I argc, char *const argv[], const char **env); static bool command_line(shell_interaction & dialog, S_I argc, char * const argv[], operation & op, string & base, string & arg, S_I & num, vector & rest, archive_num & num2, infinint & date, bool & verbose, bool & ignore_dat_options, bool & even_when_removed, bool & check_order, bool recursive); // true if called from op_batch static void show_usage(shell_interaction & dialog, const char *command); static void show_version(shell_interaction & dialog, const char *command); #if HAVE_GETOPT_LONG static const struct option *get_long_opt(); #endif static void op_create(shell_interaction & dialog, const string & base, bool info_details); static void op_add(shell_interaction & dialog, database *dat, const string &arg, string fake, const infinint & min_digits, bool info_details); static void op_listing(shell_interaction & dialog, const database *dat, bool info_details); static void op_del(shell_interaction & dialog, database *dat, S_I min, archive_num max, bool info_details); static void op_chbase(shell_interaction & dialog, database *dat, S_I num, const string & arg, bool info_details); static void op_where(shell_interaction & dialog, database *dat, S_I num, const string & arg, bool info_details); static void op_options(shell_interaction & dialog, database *dat, const vector & rest, bool info_details); static void op_dar(shell_interaction & dialog, database *dat, const string & arg, bool info_details); static void op_restore(shell_interaction & dialog, database *dat, const vector & rest, const infinint & date, const string & options_for_dar, bool info_details, bool early_release, bool ignore_dar_options_in_base, bool even_when_removed); static void op_used(shell_interaction & dialog, const database *dat, S_I num, bool info_details); static void op_files(shell_interaction & dialog, const database *dat, const string & arg, bool info_details); static void op_stats(shell_interaction & dialog, const database *dat, bool info_details); static void op_move(shell_interaction & dialog, database *dat, S_I src, archive_num dst, bool info_details); static void op_interactive(shell_interaction & dialog, database *dat, string base); static void op_check(shell_interaction & dialog, const database *dat, bool info_details); static void op_batch(shell_interaction & dialog, database *dat, const string & filename, bool info_details); static database *read_base(shell_interaction & dialog, const string & base, bool partial, bool partial_read_only, bool check_order); static void write_base(shell_interaction & dialog, const string & filename, const database *base, bool overwrite); static vector read_vector(shell_interaction & dialog); static void finalize(shell_interaction & dialog, operation op, database *dat, const string & base, bool info_details); static void action(shell_interaction & dialog, operation op, database *dat, const string & arg, S_I num, const vector & rest, archive_num num2, const infinint & date, const string & base, bool info_details, bool early_release, bool ignore_database_options, bool even_when_removed); static void signed_int_to_archive_num(S_I input, archive_num &num, bool & positive); int main(S_I argc, char *const argv[], const char **env) { return dar_suite_global(argc, argv, env, OPT_STRING, #if HAVE_GETOPT_LONG get_long_opt(), #endif 'o', // stop looking for -j and -Q once -o option is met on command-line &little_main); } S_I little_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env) { operation op; string base; string arg; S_I num; archive_num num2; vector rest; bool info_details; infinint date; database *dat = nullptr; bool partial_read = false; bool partial_read_only = false; bool ignore_dat_options; bool even_when_removed; bool check_order; dialog.change_non_interactive_output(&cout); if(!command_line(dialog, argc, argv, op, base, arg, num, rest, num2, date, info_details, ignore_dat_options, even_when_removed, check_order, false)) return EXIT_SYNTAX; if(op == none_op) throw SRC_BUG; switch(op) { case create: break; case add: case del: case restore: case used: case files: case stats: case moving: case interactive: case check: case batch: partial_read = false; break; case listing: partial_read_only = true; break; case chbase: case where: case options: case dar: partial_read = true; break; default: throw SRC_BUG; } if(op == create) op_create(dialog, base, info_details); else { if(info_details) { if(partial_read) dialog.warning(gettext("Decompressing and loading database header to memory...")); else dialog.warning(gettext("Decompressing and loading database to memory...")); } dat = read_base(dialog, base, partial_read, partial_read_only, check_order); try { try { action(dialog, op, dat, arg, num, rest, num2, date, base, info_details, true, ignore_dat_options, even_when_removed); finalize(dialog, op, dat, base, info_details); } catch(Edata & e) { dialog.warning(string(gettext("Error met while processing operation: ")) + e.get_message()); finalize(dialog, op, dat, base, info_details); throw; } } catch(...) { if(dat != nullptr) delete dat; throw; } if(dat != nullptr) delete dat; } return EXIT_OK; } static bool command_line(shell_interaction & dialog, S_I argc, char *const argv[], operation & op, string & base, string & arg, S_I & num, vector & rest, archive_num & num2, infinint & date, bool & verbose, bool & ignore_dat_options, bool & even_when_removed, bool & check_order, bool recursive) { S_I lu, min; U_I max; base = arg = ""; num = num2 = 0; rest.clear(); op = none_op; verbose = false; string chem, filename; date = 0; ignore_dat_options = false; even_when_removed = false; check_order = true; string extra = ""; try { (void)line_tools_reset_getopt(); #if HAVE_GETOPT_LONG while((lu = getopt_long(argc, argv, OPT_STRING, get_long_opt(), nullptr)) != EOF) #else while((lu = getopt(argc, argv, OPT_STRING)) != EOF) #endif { switch(lu) { case 'C': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = create; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); base = optarg; break; case 'B': if(recursive) throw Erange("command_line", tools_printf(gettext("-B option cannot be given inside a batch file"))); if(base != "") throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); base = optarg; break; case 'A': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = add; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); tools_split_path_basename(optarg, chem, filename); tools_check_basename(dialog, chem, filename, EXTENSION); arg = (path(chem)+filename).display(); break; case 'l': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = listing; break; case 'D': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = del; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); try { tools_read_range(string(optarg), min, max); } catch(Edeci & e) { throw Erange("command_line", tools_printf(gettext(INVALID_ARG), char(lu))); } num = min; num2 = max; break; case 'b': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = chbase; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); num = tools_str2signed_int(optarg); break; case 'p': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = where; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); num = tools_str2signed_int(optarg); break; case 'o': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = options; break; case 'd': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = dar; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); arg = optarg; break; case 'r': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = restore; break; case 'u': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = used; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); num = tools_str2signed_int(optarg); break; case 'f': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = files; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); arg = optarg; break; case 's': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = stats; break; case 'm': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = moving; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); num = tools_str2int(optarg); break; case 'h': show_usage(dialog, argv[0]); return false; case 'V': show_version(dialog, argv[0]); return false; case 'v': verbose = true; break; case 'Q': break; // ignore this option already parsed during initialization (dar_suite.cpp) case 'w': if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); date = tools_convert_date(optarg); break; case 'i': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = interactive; break; case 'c': if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = check; break; case 'e': if(extra != "") throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); extra = optarg; break; case '@': if(recursive) throw Erange("command_line", tools_printf(gettext("Running batch file from a batch file is not allowed"))); if(op != none_op) throw Erange("command_line", tools_printf(gettext(ONLY_ONCE), char(lu))); op = batch; if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); arg = optarg; break; case 'N': ignore_dat_options = true; break; case 'k': even_when_removed = true; break; case '9': if(op != add) dialog.warning(gettext("-9 option is only valid after -A option, ignoring it")); else { try { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci tmp = string(optarg); date = tmp.computer(); } catch(Edeci & e) { throw Erange("command_line", tools_printf(gettext("invalid number give to -; option: %s"), optarg)); } } break; case 'a': if(optarg == nullptr) throw Erange("command_line", tools_printf(gettext(MISSING_ARG), char(lu))); if(strcasecmp("i", optarg) == 0 || strcasecmp("ignore-order", optarg) == 0) check_order = false; else throw Erange("command_line", tools_printf(gettext(INVALID_ARG), char(lu))); break; case ':': throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(optopt))); case '?': dialog.warning(tools_printf(gettext("Ignoring unknown option -%c"), char(optopt))); break; default: dialog.warning(tools_printf(gettext("Ignoring unknown option -%c"), char(lu))); } if(lu == 'o' || lu == 'r') break; // stop reading arguments } // related to bug #1598138 on sourceforge // when providing -o'-B dar.dcf' on command line getopt // finds -o option with no argument and keep optind pointing on // the -o'B dar dcf' argument. We must thus tail out the leading -o // from this argument before feeding the 'rest' list variable if(optind < argc && strncmp(argv[optind], "-o", 2) == 0) { rest.push_back(argv[optind]+2); // argv[optind] is a 'char *' applying '+2' to it skips the 2 leading char '-o'. optind++; } for(S_I i = optind; i < argc; ++i) rest.push_back(argv[i]); // sanity checks if(extra != "" && op != restore) { dialog.warning(gettext("-e option is only available when using -r option, aborting")); return false; } switch(op) { case none_op: dialog.warning(gettext("No action specified, aborting")); return false; case create: case listing: case del: case dar: case used: case files: case stats: case interactive: case check: if(!rest.empty()) dialog.warning(gettext("Ignoring extra arguments on command line")); break; case add: if(rest.size() > 1) dialog.warning(gettext("Ignoring extra arguments on command line")); break; case chbase: case where: if(rest.size() != 1) { dialog.warning(gettext("Missing argument to command line, aborting")); return false; } arg = rest[0]; rest.clear(); break; case restore: for(unsigned int i = 0; i < rest.size(); ++i) if(!path(rest[i]).is_relative()) throw Erange("command_line", gettext("Arguments to -r must be relative path (never begin by '/')")); arg = extra; break; case options: break; case moving: if(rest.size() != 1) { dialog.warning(gettext("Missing argument to command line, aborting")); return false; } num2 = tools_str2int(rest[0]); rest.clear(); break; case batch: break; default: throw SRC_BUG; } if(base == "" && !recursive) { dialog.warning(gettext("No database specified, aborting")); return false; } } catch(Erange & e) { dialog.warning(string(gettext("Parse error on command line (or included files): ")) + e.get_message()); return false; } return true; } static void op_create(shell_interaction & dialog, const string & base, bool info_details) { database dat; // created empty; if(info_details) { dialog.warning(gettext("Creating file...")); dialog.warning(gettext("Formatting file as an empty database...")); } write_base(dialog, base, &dat, false); if(info_details) dialog.warning(gettext("Database has been successfully created empty.")); } static void op_add(shell_interaction & dialog, database *dat, const string &arg, string fake, const infinint & min_digits, bool info_details) { thread_cancellation thr; string arch_path, arch_base; bool date_order_problem = false; archive_options_read read_options; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Reading catalogue of the archive to add...")); tools_split_path_basename(arg, arch_path, arch_base); read_options.set_info_details(info_details); read_options.set_slice_min_digits(min_digits); archive *arch = new (nothrow) archive(dialog, path(arch_path), arch_base, EXTENSION, read_options); if(arch == nullptr) throw Ememory("dar_manager.cpp:op_add"); try { string chemin, b; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Updating database with catalogue...")); if(fake == "") fake = arg; tools_split_path_basename(fake, chemin, b); dat->add_archive(*arch, chemin, b, database_add_options()); thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Checking date ordering of files between archives...")); date_order_problem = dat->check_order(dialog); thr.check_self_cancellation(); } catch(...) { if(arch != nullptr) delete arch; throw; } delete arch; if(!date_order_problem) throw Edata(gettext("Some files do not follow chronological order when archive index increases withing the database, this can lead dar_manager to restored a wrong version of these files")); } static void op_listing(shell_interaction & dialog, const database *dat, bool info_details) { if(dat == nullptr) throw SRC_BUG; dat->show_contents(dialog); } static void op_del(shell_interaction & dialog, database *dat, S_I min, archive_num max, bool info_details) { thread_cancellation thr; database_remove_options opt; bool sign_plus; archive_num rmin; signed_int_to_archive_num(min, rmin, sign_plus); opt.set_revert_archive_numbering(!sign_plus); if(!sign_plus) max = rmin; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Removing information from the database...")); dat->remove_archive(rmin, max, opt); thr.check_self_cancellation(); } static void op_chbase(shell_interaction & dialog, database *dat, S_I num, const string & arg, bool info_details) { thread_cancellation thr; database_change_basename_options opt; bool sign_plus; archive_num rnum; signed_int_to_archive_num(num, rnum, sign_plus); opt.set_revert_archive_numbering(!sign_plus); if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Changing database header information...")); dat->change_name(rnum, arg, opt); thr.check_self_cancellation(); } static void op_where(shell_interaction & dialog, database *dat, S_I num, const string & arg, bool info_details) { thread_cancellation thr; database_change_path_options opt; bool sign_plus; archive_num rnum; signed_int_to_archive_num(num, rnum, sign_plus); opt.set_revert_archive_numbering(!sign_plus); if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Changing database header information...")); dat->set_path(rnum, arg, opt); thr.check_self_cancellation(); } static void op_options(shell_interaction & dialog, database *dat, const vector & rest, bool info_details) { thread_cancellation thr; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Changing database header information...")); dat->set_options(rest); thr.check_self_cancellation(); } static void op_dar(shell_interaction & dialog, database *dat, const string & arg, bool info_details) { thread_cancellation thr; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Changing database header information...")); dat->set_dar_path(arg); thr.check_self_cancellation(); } static void op_restore(shell_interaction & dialog, database *dat, const vector & rest, const infinint & date, const string & options_for_dar, bool info_details, bool early_release, bool ignore_dar_options_in_base, bool even_when_removed) { thread_cancellation thr; vector options = tools_split_in_words(options_for_dar); database_restore_options dat_opt; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Looking in archives for requested files, classifying files archive by archive...")); dat_opt.set_early_release(early_release); dat_opt.set_info_details(info_details); dat_opt.set_date(date); dat_opt.set_extra_options_for_dar(options); dat_opt.set_ignore_dar_options_in_database(ignore_dar_options_in_base); dat_opt.set_even_when_removed(even_when_removed); dat->restore(dialog, rest, dat_opt); } static void op_used(shell_interaction & dialog, const database *dat, S_I num, bool info_details) { thread_cancellation thr; database_used_options opt; bool sign_plus; archive_num rnum; signed_int_to_archive_num(num, rnum, sign_plus); opt.set_revert_archive_numbering(!sign_plus); if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); dat->show_files(dialog, rnum, opt); } static void op_files(shell_interaction & dialog, const database *dat, const string & arg, bool info_details) { thread_cancellation thr; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); dat->show_version(dialog, arg); } static void op_stats(shell_interaction & dialog, const database *dat, bool info_details) { thread_cancellation thr; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Computing statistics...")); dat->show_most_recent_stats(dialog); } static void op_move(shell_interaction & dialog, database *dat, S_I src, archive_num dst, bool info_details) { thread_cancellation thr; bool date_order_problem = false; if(src <= 0) throw Erange("op_move", gettext("Negative number or zero not allowed when moving an archive inside a database")); if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Changing database information...")); dat->set_permutation(src, dst); thr.check_self_cancellation(); if(info_details) dialog.warning(gettext("Checking date ordering of files between archives...")); date_order_problem = dat->check_order(dialog); thr.check_self_cancellation(); if(date_order_problem) throw Edata(gettext("Some files do not follow chronological order when archive index increases withing the database, this can lead dar_manager to restored a wrong version of these files")); } static void show_usage(shell_interaction & dialog, const char *command) { dialog.printf("usage :\n\n"); dialog.printf("\tdar_manager [options] -C [/]\n"); dialog.printf("\tdar_manager [options] -B [/] -A [/] [[/]]\n"); dialog.printf("\tdar_manager [options] -B [/] -l\n"); dialog.printf("\tdar_manager [options] -B [/] -D \n"); dialog.printf("\tdar_manager [options] -B [/] -b \n"); dialog.printf("\tdar_manager [options] -B [/] -p \n"); dialog.printf("\tdar_manager [options] -B [/] -o [list of options to pass to dar]\n"); dialog.printf("\tdar_manager [options] -B [/] -d []\n"); dialog.printf("\tdar_manager [options] -B [/] [-w ] [-e \"\"] -r [list of files to restore]\n"); dialog.printf("\tdar_manager [options] -B [/] -u \n"); dialog.printf("\tdar_manager [options] -B [/] -f file\n"); dialog.printf("\tdar_manager [options] -B [/] -s\n"); dialog.printf("\tdar_manager [options] -B [/] -m \n"); dialog.printf("\tdar_manager [options] -B [/] -i\n"); dialog.printf("\tdar_manager [options] -B [/] -c\n"); dialog.printf("\tdar_manager [options] -B [/] -@ \n"); dialog.printf("\tdar_manager -h\n"); dialog.printf("\tdar_manager -V\n"); dialog.printf("\n"); dialog.printf(gettext("\n")); dialog.printf(gettext("Commands:\n")); dialog.printf(gettext(" -C creates an empty database\n")); dialog.printf(gettext(" -B specify the database to use (read or modify)\n")); dialog.printf(gettext(" -A add an archive to the database\n")); dialog.printf(gettext(" -l\t\t gives information about the archive compiled in the database\n")); dialog.printf(gettext(" -D delete an archive from the database\n")); dialog.printf(gettext(" -b \t change the basename to use for the give archive number\n")); dialog.printf(gettext(" -p \t change the path to use for the given archive number\n")); dialog.printf(gettext(" -o specify a list of option to always pass to dar\n")); dialog.printf(gettext(" -d specify the path to dar\n")); dialog.printf(gettext(" -r \t restores the given files\n")); dialog.printf(gettext(" -w \t only with -r, restores in state just before the given date\n")); dialog.printf(gettext(" -u \t list the most recent files contained in the given archive\n")); dialog.printf(gettext(" -f \t list the archives where the given file is present\n")); dialog.printf(gettext(" -s\t\t shows the number of most recent file by archive\n")); dialog.printf(gettext(" -m \t move an archive within a given database.\n")); dialog.printf(gettext(" -i\t\t user interactive mode\n")); dialog.printf(gettext(" -c\t\t check database for dates order\n")); dialog.printf(gettext(" -L execute on a given database a batch of action as defined by\n")); dialog.printf(gettext("\t\t the provided file.\n")); dialog.printf(gettext(" -h\t\t displays this help information\n")); dialog.printf(gettext(" -V\t\t displays software version\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("Options:\n")); dialog.printf(gettext(" -v\t\t display more information about what is going on\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("See man page for more options.\n")); } static void show_version(shell_interaction & dialog, const char *command_name) { string name; tools_extract_basename(command_name, name); U_I maj, med, min; get_version(maj, med, min); dialog.change_non_interactive_output(&cout); dialog.printf("\n %s version %s, Copyright (C) 2002-2052 Denis Corbin\n", name.c_str(), DAR_MANAGER_VERSION); dialog.warning(string(" ") + dar_suite_command_line_features() + "\n"); if(maj > 2) dialog.printf(gettext(" Using libdar %u.%u.%u built with compilation time options:\n"), maj, med, min); else dialog.printf(gettext(" Using libdar %u.%u built with compilation time options:\n"), maj, min); tools_display_features(dialog); dialog.printf("\n"); dialog.printf(gettext(" compiled the %s with %s version %s\n"), __DATE__, CC_NAT, __VERSION__); dialog.printf(gettext(" %s is part of the Disk ARchive suite (Release %s)\n"), name.c_str(), PACKAGE_VERSION); dialog.warning(tools_printf(gettext(" %s comes with ABSOLUTELY NO WARRANTY; for details\n type `%s -W'."), name.c_str(), "dar") + tools_printf(gettext(" This is free software, and you are welcome\n to redistribute it under certain conditions;")) + tools_printf(gettext(" type `%s -L | more'\n for details.\n\n"), "dar")); dialog.printf(""); } #if HAVE_GETOPT_LONG static const struct option *get_long_opt() { static const struct option ret[] = { {"create", required_argument, nullptr, 'C'}, {"base", required_argument, nullptr, 'B'}, {"add", required_argument, nullptr, 'A'}, {"list", no_argument, nullptr, 'l'}, {"delete", required_argument, nullptr, 'D'}, {"basename", required_argument, nullptr, 'b'}, {"path", required_argument, nullptr, 'p'}, {"options", no_argument, nullptr, 'o'}, {"dar", no_argument, nullptr, 'd'}, {"restore", no_argument, nullptr, 'r'}, {"used", required_argument, nullptr, 'u'}, {"file", required_argument, nullptr, 'f'}, {"stats", no_argument, nullptr, 's'}, {"help", no_argument, nullptr, 'h'}, {"version", no_argument, nullptr, 'V'}, {"verbose", no_argument, nullptr, 'v'}, {"jog", no_argument, nullptr, 'j'}, {"when", required_argument, nullptr, 'w'}, {"interactive", no_argument, nullptr, 'i'}, {"extra", required_argument, nullptr, 'e'}, {"check", no_argument, nullptr, 'c'}, {"batch", required_argument, nullptr, '@'}, {"ignore-options-in-base", no_argument, nullptr, 'N'}, {"min-digits", required_argument, nullptr, '9'}, {"ignore-when-removed", no_argument, nullptr, 'k'}, {"alter", required_argument, nullptr, 'a'}, { nullptr, 0, nullptr, 0 } }; return ret; } #endif static database *read_base(shell_interaction & dialog, const string & base, bool partial, bool partial_read_only, bool check_order) { database *ret = nullptr; try { database_open_options dat_opt; dat_opt.set_warn_order(check_order); dat_opt.set_partial(partial); dat_opt.set_partial_read_only(partial_read_only); ret = new (nothrow) database(dialog, base, dat_opt); if(ret == nullptr) throw Ememory("read_base"); } catch(Erange & e) { string msg = string(gettext("Corrupted database :"))+e.get_message(); dialog.warning(msg); throw Edata(msg); } return ret; } static void write_base(shell_interaction & dialog, const string & filename, const database *base, bool overwrite) { thread_cancellation thr; database_dump_options dat_opt; dat_opt.set_overwrite(overwrite); thr.block_delayed_cancellation(true); base->dump(dialog, filename, dat_opt); thr.block_delayed_cancellation(false); } static void op_interactive(shell_interaction & dialog, database *dat, string base) { char choice; bool saved = true; thread_cancellation thr; archive_num num, num2; S_I tmp_si; bool tmp_sign; string input, input2; archive *arch = nullptr; vector vectinput; U_I more = 25; database_change_basename_options opt_change_name; database_change_path_options opt_change_path; database_remove_options opt_remove; database_used_options opt_used; if(dat == nullptr) throw SRC_BUG; thr.check_self_cancellation(); do { try { archive_options_read read_options; // diplay choice message dialog.warning_with_more(0); dialog.printf(gettext("\n\n\t Dar Manager Database used [%s] : %S\n"), saved ? gettext("Saved") : gettext("Not Saved"), &base); if(more > 0) dialog.printf(gettext("\t Pause each %d line of output\n\n"), more); else dialog.printf(gettext("\t No pause in output\n\n")); dialog.printf(gettext(" l : list database contents \t A : Add an archive\n")); dialog.printf(gettext(" u : list archive contents \t D : Remove an archive\n")); dialog.printf(gettext(" f : give file localization \t m : modify archive order\n")); dialog.printf(gettext(" p : modify path of archives \t b : modify basename of archives\n")); dialog.printf(gettext(" d : path to dar \t o : options to dar\n")); dialog.printf(gettext(" w : write changes to file \t s : database statistics\n")); dialog.printf(gettext(" a : Save as \t n : pause each 'n' line (zero for no pause)\n")); dialog.printf(gettext(" c : check date order\n\n")); dialog.printf(gettext(" q : quit\n\n")); dialog.printf(gettext(" Choice: ")); // user's choice selection dialog.read_char(choice); thr.check_self_cancellation(); dialog.printf("\n\n"); // performing requested action dialog.warning_with_more(more); switch(choice) { case 'l': dat->show_contents(dialog); break; case 'u': input = dialog.get_string(gettext("Archive number: "), true); tmp_si = tools_str2signed_int(input); signed_int_to_archive_num(tmp_si, num, tmp_sign); opt_used.set_revert_archive_numbering(!tmp_sign); dat->show_files(dialog, num, opt_used); break; case 'f': input = dialog.get_string(gettext("File to look for: "), true); dat->show_version(dialog, input); break; case 'b': input = dialog.get_string(gettext("Archive number to modify: "), true); tmp_si = tools_str2signed_int(input); signed_int_to_archive_num(tmp_si, num, tmp_sign); opt_change_name.set_revert_archive_numbering(!tmp_sign); input = dialog.get_string(tools_printf(gettext("New basename for archive number %d: "), tmp_si), true); dat->change_name(num, input, opt_change_name); saved = false; break; case 'd': input = dialog.get_string(gettext("Path to dar (empty string to use the default from PATH variable): "), true); dat->set_dar_path(input); saved = false; break; case 'w': dialog.warning(gettext("Compressing and writing back database to file...")); write_base(dialog, base, dat, true); saved = true; break; case 'a': input = dialog.get_string(gettext("New database name: "), true); dialog.warning(gettext("Compressing and writing back database to file...")); write_base(dialog, input, dat, false); base = input; saved = true; break; case 'A': input = dialog.get_string(gettext("Archive basename (or extracted catalogue basename) to add: "), true); dialog.warning(gettext("Reading catalogue of the archive to add...")); tools_split_path_basename(input, input, input2); read_options.clear(); read_options.set_info_details(true); arch = new (nothrow) archive(dialog, path(input), input2, EXTENSION, read_options); if(arch == nullptr) throw Ememory("dar_manager.cpp:op_interactive"); try { dialog.warning(gettext("Updating database with catalogue...")); dat->add_archive(*arch, input, input2, database_add_options()); thr.check_self_cancellation(); dialog.warning(gettext("Checking date ordering of files between archives...")); (void)dat->check_order(dialog); } catch(...) { delete arch; arch = nullptr; throw; } delete arch; arch = nullptr; saved = false; break; case 'D': input = dialog.get_string(gettext("Archive number to remove: "), true); tmp_si = tools_str2signed_int(input); signed_int_to_archive_num(tmp_si, num, tmp_sign); opt_remove.set_revert_archive_numbering(!tmp_sign); dialog.pause(tools_printf(gettext("Are you sure to remove archive number %d ?"), tmp_si)); dialog.warning(gettext("Removing information from the database...")); dat->remove_archive(num, num, opt_remove); saved = false; break; case 'm': input = dialog.get_string(gettext("Archive number to move: "), true); num = tools_str2int(input); input = dialog.get_string(gettext("In which position to insert this archive: "), true); num2 = tools_str2int(input); dat->set_permutation(num, num2); thr.check_self_cancellation(); dialog.warning(gettext("Checking date ordering of files between archives...")); dat->check_order(dialog); saved = false; break; case 'p': input = dialog.get_string(gettext("Archive number who's path to modify: "), true); tmp_si = tools_str2signed_int(input); signed_int_to_archive_num(tmp_si, num, tmp_sign); opt_change_path.set_revert_archive_numbering(!tmp_sign); input = dialog.get_string(tools_printf(gettext("New path to give to archive number %d: "), tmp_si), true); dat->set_path(num, input, opt_change_path); saved = false; break; case 'o': vectinput = read_vector(dialog); dat->set_options(vectinput); saved = false; break; case 's': dialog.warning(gettext("Computing statistics...")); dat->show_most_recent_stats(dialog); break; case 'n': input = dialog.get_string(gettext("How much line to display at once: "), true); more = tools_str2int(input); break; case 'c': dialog.warning(gettext("Checking file's dates ordering...")); (void)dat->check_order(dialog); break; case 'q': if(!saved) { try { dialog.pause(gettext("Database not saved, Do you really want to quit ?")); dialog.printf(gettext("Continuing the action under process which is to exit... so we exit!")); } catch(Euser_abort & e) { choice = ' '; } } break; default: dialog.printf(gettext("Unknown choice\n")); } } catch(Ethread_cancel & e) { bool quit = false; if(!saved) { try { dialog.pause(gettext("Database not saved, Do you really want to quit ?")); dialog.printf(gettext("Continuing the action under process which is to exit... so we exit!")); quit = true; } catch(Euser_abort & e) { quit = false; } } else quit = true; if(quit) throw; else { dialog.printf(gettext("re-enabling all signal handlers and continuing\n")); dar_suite_reset_signal_handler(); } } catch(Egeneric & e) { string tmp = e.get_message(); dialog.warning(tools_printf(gettext("Error performing the requested action: %S"), &tmp)); } } while(choice != 'q'); if(arch != nullptr) throw SRC_BUG; } static void op_check(shell_interaction & dialog, const database *dat, bool info_details) { thread_cancellation thr; if(dat == nullptr) throw SRC_BUG; if(info_details) dialog.warning(gettext("Checking date ordering of files between archives...")); if(!dat->check_order(dialog)) throw Edata(gettext("Some files do not follow chronological order when archive index increases withing the database, this can lead dar_manager to restored a wrong version of these files")); else dialog.warning(gettext("No problem found")); thr.check_self_cancellation(); } static void op_batch(shell_interaction & dialog, database *dat, const string & filename, bool info_details) { const string pseudo_cmd = "dar_manager"; // to take the place of the command on the simulated command-line string line; char tmp; bool sub_info_details; vector mots; argc_argv cmdline; operation sub_op; string faked_base; archive_num num2; S_I num; vector rest; infinint date; string arg; bool ignore_dat_options; bool even_when_removed; bool check_order; // not used here if(dat == nullptr) throw SRC_BUG; // openning the batch file if(info_details) dialog.warning(gettext("Opening and reading the batch file...")); fichier_local batch_file = fichier_local(filename, false); no_comment proper = no_comment(batch_file); // removing the comments from file // reading it line by line and executing corresponding action try { do { line = ""; tmp = 'x'; // something different from '\n' for the end of current loop be properly detected // extracting the next line while(proper.read(&tmp, 1) == 1 && tmp != '\n') line += tmp; mots = tools_split_in_words(line); if(mots.size() == 0) continue; if(info_details) dialog.printf(gettext("\n\tExecuting batch file line: %S\n "), &line); cmdline.resize(mots.size() + 1); // +1 of pseudo_command cmdline.set_arg(pseudo_cmd, 0); for(U_I i = 0; i < mots.size(); ++i) cmdline.set_arg(mots[i], i+1); if(!command_line(dialog, cmdline.argc(), cmdline.argv(), sub_op, faked_base, arg, num, rest, num2, date, sub_info_details, ignore_dat_options, even_when_removed, check_order, true)) throw Erange("op_batch", tools_printf(gettext("Syntax error in batch file: %S"), &line)); if(sub_op == create) throw Erange("op_batch", gettext("Syntax error in batch file: -C option not allowed")); if(sub_op == interactive) throw Erange("op_batch", gettext("Syntax error in batch file: -i option not allowed")); action(dialog, sub_op, dat, arg, num, rest, num2, date, faked_base, sub_info_details, false, ignore_dat_options, even_when_removed); } while(tmp == '\n'); } catch(Edata & e) { e.prepend_message(gettext("Aborting batch operation: ")); throw; } } static vector read_vector(shell_interaction & dialog) { vector ret; string tmp; ret.clear(); dialog.printf(gettext("Enter each argument line by line, press return at the end\n")); dialog.printf(gettext("To terminate enter an empty line\n")); do { tmp = dialog.get_string(" > ", true); if(tmp != "") ret.push_back(tmp); } while(tmp != ""); return ret; } static void finalize(shell_interaction & dialog, operation op, database *dat, const string & base, bool info_details) { switch(op) { case create: case listing: case restore: case used: case files: case stats: case interactive: case check: break; case add: case del: case chbase: case where: case options: case dar: case moving: case batch: if(info_details) dialog.warning(gettext("Compressing and writing back database to file...")); write_base(dialog, base, dat, true); break; default: throw SRC_BUG; } } static void action(shell_interaction & dialog, operation op, database *dat, const string & arg, S_I num, const vector & rest, archive_num num2, const infinint & date, const string & base, bool info_details, bool early_release, bool ignore_database_options, bool even_when_removed) { switch(op) { case none_op: throw SRC_BUG; case create: throw SRC_BUG; case add: op_add(dialog, dat, arg, rest.empty() ? "" : rest[0], date, info_details); break; case listing: op_listing(dialog, dat, info_details); break; case del: op_del(dialog, dat, num, num2, info_details); break; case chbase: op_chbase(dialog, dat, num, arg, info_details); break; case where: op_where(dialog, dat, num, arg, info_details); break; case options: op_options(dialog, dat, rest, info_details); break; case dar: op_dar(dialog, dat, arg, info_details); break; case restore: op_restore(dialog, dat, rest, date, arg, info_details, early_release, ignore_database_options, even_when_removed); break; case used: op_used(dialog, dat, num, info_details); break; case files: op_files(dialog, dat, arg, info_details); break; case stats: op_stats(dialog, dat, info_details); break; case moving: op_move(dialog, dat, num, num2, info_details); break; case interactive: op_interactive(dialog, dat, base); break; case check: op_check(dialog, dat, info_details); break; case batch: op_batch(dialog, dat, arg, info_details); break; default: throw SRC_BUG; } } static void signed_int_to_archive_num(S_I input, archive_num &num, bool & positive) { if(input < 0) { positive = false; input = -input; } else positive = true; if(input < 0) throw SRC_BUG; if(input >= ARCHIVE_NUM_MAX) throw Erange("signed_int_to_archive_name", tools_printf(gettext("Absolute value too high for an archive number: %d"), input)); else num = input; } dar-2.5.3/src/dar_suite/crit_action_cmd_line.hpp0000644000175000017430000000514612610405011016615 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file crit_action_cmd_line.hpp /// \brief contains routines to convert command-line overwriting criterium to their crit_action counterparts /// \ingroup CMDLINE #ifndef CRIT_ACTION_CMD_LINE_HPP #define CRIT_ACTION_CMD_LINE_HPP #include "../my_config.h" #include "criterium.hpp" #include "user_interaction.hpp" /// \addtogroup CMDLINE /// @{ /// canonizes a criterium description string /// \param[in] argument is a not canonized criterium description string /// \return a canonized description string /// \note criterium description strings when not canonized may include spaces /// tabs and carriage return for readability. Canonizing a criterium description string /// is to remove all these non significant characters. extern std::string crit_action_canonize_string(const std::string & argument); /// creates a criterium object as defined by the command line's given string /// \param[in] dialog for user interaction /// \param[in] argument is a *canonized* criterium argument /// \param[in] hourshift the hourshift used to compare dates "more recent than" /// \return a criterium object /// \note this function is recursive, it may throw Erange exception in case of syntaxical error /// \note second point, the returned object is dynamically allocated, this is the duty of the caller /// to release its memory calling the delete operator. extern const libdar::crit_action * crit_action_create_from_string(libdar::user_interaction & dialog, const std::string & argument, const libdar::infinint & hourshift); /// @} #endif dar-2.5.3/src/dar_suite/dar.hpp0000644000175000017430000000302512641772777013263 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ /// \file dar.hpp /// \brief main module for dar command-line tool /// \ingroup CMDLINE /// \defgroup CMDLINE Command-line /// \brief command-line interface /// /// this module contains all the command-line specific routines, classes and datastructures. The intention of /// documenting that part is for illustration and example of libdar usage. #ifndef DAR_HPP #define DAR_HPP #include "../my_config.h" /// \addtogroup CMDLINE /// @{ extern const char *dar_version(); /// @} #endif dar-2.5.3/src/dar_suite/shell_interaction.cpp0000644000175000017430000002607212641772777016225 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_ERRNO_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_STDIO_H #include #endif #if HAVE_LIMITS_H #include #endif #if HAVE_ERRNO_H #include #endif } // end extern "C" // L_ctermid should be defined from stdio.h but this is not // the case under cygwin! So we define it ourself with a // somehow arbitrarily large value taking the risk it to be // too short and having ctermid() writing over the reserved buffer // space #ifndef L_ctermid #define L_ctermid 200 #endif #include "integers.hpp" #include "shell_interaction.hpp" #include "erreurs.hpp" #include "tools.hpp" #include "integers.hpp" #include "cygwin_adapt.hpp" #include "tools.hpp" using namespace std; using namespace libdar; #ifdef SSIZE_MAX const U_I shell_interaction::bufsize = 1024 > SSIZE_MAX ? SSIZE_MAX : 1024; #else const U_I shell_interaction::bufsize = 1024; #endif shell_interaction::shell_interaction(ostream *out, ostream *interact, bool silent): user_interaction_callback(interaction_warning, interaction_pause, interaction_string, interaction_secu_string, (void *)this) { has_terminal = false; beep = false; // updating object fields if(out != nullptr) output = out; else throw SRC_BUG; if(interact != nullptr) inter = interact; else throw SRC_BUG; // looking for an input terminal // // we do not use anymore standart input but open a new descriptor // from the controlling terminal. This allow in some case to keep use // standart input for piping data while still having user interaction // possible. // terminal settings try { char tty[L_ctermid+1]; struct termios term; (void)ctermid(tty); tty[L_ctermid] = '\0'; input = ::open(tty, O_RDONLY|O_TEXT); if(input < 0) throw Erange("",""); // used locally else { if(silent) has_terminal = false; // force non interactive mode else // preparing input for swaping between char mode and line mode (terminal settings) if(tcgetattr(input, &term) >= 0) { initial = term; initial_noecho = term; initial_noecho.c_lflag &= ~ECHO; term.c_lflag &= ~ICANON; term.c_lflag &= ~ECHO; term.c_cc[VTIME] = 0; term.c_cc[VMIN] = 1; interaction = term; // checking now that we can change to character mode set_term_mod(m_inter); set_term_mod(m_initial); // but we don't need it right now, so swapping back to line mode has_terminal = true; } else // failed to retrieve parameters from tty throw Erange("",""); // used locally } } catch(Erange & e) { if(e.get_message() == "") { if(!silent) warning(gettext("No terminal found for user interaction. All questions will be assumed a negative answer (less destructive choice), which most of the time will abort the program.")); } else throw; } } /// copy constructor shell_interaction::shell_interaction(const shell_interaction & ref) : user_interaction_callback(ref) { change_context_value((void *)this); if(ref.input >= 0) { input = dup(ref.input); if(input < 0) throw Erange("shell_interaction::shell_interaction", string("Failed dup()-licating file descriptor: ") + tools_strerror_r(errno)); } else input = ref.input; output = ref.output; inter = ref.inter; beep = ref.beep; initial = ref.initial; interaction = ref.interaction; initial_noecho = ref.initial_noecho; has_terminal = ref.has_terminal; } shell_interaction::~shell_interaction() { if(has_terminal) set_term_mod(m_initial); if(input >= 0) { close(input); input = -1; } } void shell_interaction::change_non_interactive_output(ostream *out) { if(out != nullptr) output = out; else throw SRC_BUG; } void shell_interaction::read_char(char & a) { sigset_t old_mask; if(input < 0) throw SRC_BUG; tools_block_all_signals(old_mask); set_term_mod(m_inter); if(read(input, &a, 1) < 0) throw Erange("shell_interaction_read_char", string(gettext("Error reading character: ")) + strerror(errno)); tools_blocking_read(input, true); set_term_mod(m_initial); tools_set_back_blocked_signals(old_mask); } void shell_interaction::set_term_mod(shell_interaction::mode m) { termios *ptr = nullptr; switch(m) { case m_initial: ptr = &initial; break; case m_inter: ptr = &interaction; break; case m_noecho: ptr = &initial_noecho; break; default: throw SRC_BUG; } if(tcsetattr(input, TCSANOW, ptr) < 0) throw Erange("shell_interaction : set_term_mod", string(gettext("Error while changing user terminal properties: ")) + strerror(errno)); } bool shell_interaction::interaction_pause(const string &message, void *context) { shell_interaction *obj = (shell_interaction *)(context); char buffer[bufsize]; char & a = buffer[0]; char & b = buffer[1]; bool ret; if(obj == nullptr) throw SRC_BUG; if(!obj->has_terminal) return false; if(obj->input < 0) throw SRC_BUG; obj->set_term_mod(shell_interaction::m_inter); try { sigset_t old_mask; S_I tmp_ret, errno_bk, tmp_sup, errno_sup; do { // flushing any character remaining in the input stream tools_blocking_read(obj->input, false); while(read(obj->input, buffer, bufsize) >= 0) ; tools_blocking_read(obj->input, true); // now asking the user *(obj->inter) << message << gettext(" [return = YES | Esc = NO]") << (obj->beep ? "\007\007\007" : "") << endl; tools_block_all_signals(old_mask); tmp_ret = read(obj->input, &a, 1); errno_bk = errno; // checking if another character is available in the pipe tools_blocking_read(obj->input, false); errno_sup = EAGAIN+1; // = something different from EAGAIN, whatever it is... usleep(10000); // let a change for any other typed character to reach the input device tmp_sup = read(obj->input, &b, 1); errno_sup = errno; tools_blocking_read(obj->input, true); // checking error conditions tools_set_back_blocked_signals(old_mask); if(tmp_ret < 0) if(errno_bk != EINTR) throw Erange("shell_interaction:interaction_pause", string(gettext("Error while reading user answer from terminal: ")) + strerror(errno_bk)); } while((a != 27 && a != '\n') || tmp_sup != -1 || errno_sup != EAGAIN); if(a != 27) *(obj->inter) << gettext("Continuing...") << endl; else *(obj->inter) << gettext("Escaping...") << endl; ret = a != 27; // 27 is escape key } catch(...) { obj->set_term_mod(shell_interaction::m_initial); throw; } obj->set_term_mod(shell_interaction::m_initial); return ret; } void shell_interaction::interaction_warning(const string & message, void *context) { shell_interaction *obj = (shell_interaction *)(context); if(obj == nullptr) throw SRC_BUG; if(obj->output == nullptr) throw SRC_BUG; // shell_interaction has not been properly initialized *(obj->output) << message; } string shell_interaction::interaction_string(const string & message, bool echo, void *context) { string ret; const U_I expected_taille = 100; #ifdef SSIZE_MAX const U_I taille = expected_taille > SSIZE_MAX ? SSIZE_MAX : expected_taille; #else const U_I taille = expected_taille; #endif U_I lu, i; char buffer[taille+1]; bool fin = false; shell_interaction *obj = (shell_interaction *)(context); if(obj == nullptr) throw SRC_BUG; if(!echo) obj->set_term_mod(shell_interaction::m_initial); if(obj->output == nullptr || obj->input < 0) throw SRC_BUG; // shell_interaction has not been properly initialized *(obj->inter) << message; do { lu = ::read(obj->input, buffer, taille); i = 0; while(i < lu && buffer[i] != '\n') ++i; if(i < lu) fin = true; buffer[i] = '\0'; ret += string(buffer); } while(!fin); if(!echo) *(obj->inter) << endl; obj->set_term_mod(shell_interaction::m_initial); return ret; } secu_string shell_interaction::interaction_secu_string(const string & message, bool echo, void *context) { const U_I expected_taille = 1000; #ifdef SSIZE_MAX const U_I taille = expected_taille > SSIZE_MAX ? SSIZE_MAX : expected_taille; #else const U_I taille = expected_taille; #endif secu_string ret = taille; bool fin = false; U_I last = 0, i = 0; shell_interaction *obj = (shell_interaction *)(context); if(obj == nullptr) throw SRC_BUG; if(!obj->has_terminal) throw Erange("shell_interaction::interaction_secu_string", gettext("Secured string can only be read from a terminal")); if(!echo) obj->set_term_mod(shell_interaction::m_noecho); try { if(obj->output == nullptr || obj->input < 0) throw SRC_BUG; // shell_interaction has not been properly initialized *(obj->inter) << message; do { ret.append(obj->input, taille - ret.get_size()); i = last; while(i < ret.get_size() && ret.c_str()[i] != '\n') ++i; if(i < ret.get_size()) // '\n' found so we stop here but remove this last char { fin = true; ret.reduce_string_size_to(i); } else last = i; if(ret.get_size() == taille && !fin) throw Erange("interaction_secu_string", gettext("provided password is too long for the allocated memory")); } while(!fin); if(!echo) *(obj->inter) << endl; } catch(...) { obj->set_term_mod(shell_interaction::m_initial); throw; } obj->set_term_mod(shell_interaction::m_initial); return ret; } dar-2.5.3/src/dar_suite/dar_split.c0000644000175000017430000002007412641772777014134 00000000000000/********************************************************************* // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html ******************************************************************** */ #include "../my_config.h" #if HAVE_STDIO_H #include #endif #if HAVE_SIGNAL_H #include #endif #if HAVE_TERMIOS_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_SYS_TYPE_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_STDLIB_H #include #endif /// the compiler Nature MACRO #ifdef __GNUC__ #define CC_NAT "GNUC" #else #define CC_NAT "unknown" #endif #define BUFSIZE 102400 #define KEY_INPUT "split_input" #define KEY_OUTPUT "split_output" #define DAR_SPLIT_VERSION "1.0.0" static void usage(char *a); static void show_version(char *a); static int init(); static void stop_and_wait(); static void pipe_handle_pause(int x); static void pipe_handle_end(int x); static void normal_read_to_multiple_write(char *filename); static void multi_read_to_normal_write(char *filename); static int open_read(char *filemane); /* returns the filedescriptor */ static int open_write(char *filename); /* returns the filedescriptor */ static int fd_inter = -1; int main(int argc, char *argv[]) { if(argc == 2) { if(strcmp("-v", argv[1]) == 0 || strcmp("--version", argv[1]) == 0 || strcmp("-V", argv[1]) == 0) { show_version(argv[0]); return 0; } else { usage(argv[0]); return 1; } } if(argc != 3) { usage(argv[0]); return 1; } if(!init()) return 2; if(strcmp(KEY_OUTPUT, argv[1]) == 0) normal_read_to_multiple_write(argv[2]); else if(strcmp(KEY_INPUT, argv[1]) == 0) multi_read_to_normal_write(argv[2]); else usage(argv[0]); return 0; } static void usage(char *a) { fprintf(stderr, "usage: %s { %s | %s } \n", a, KEY_INPUT, KEY_OUTPUT); fprintf(stderr, "- in %s mode, the data sent to %s's input is copied to the given filename\nwhich may possibly be a non permanent output (retrying to write in case of failure)\n", KEY_OUTPUT, a); fprintf(stderr, "- in %s mode, the data is read from the given filename which may possibly\nbe non permanent input (retrying to read in case of failure) and copied to %s's output\n", KEY_INPUT, a); } static void show_version(char *a) { fprintf(stderr, "\n %s version %s, Copyright (C) 2015 Denis Corbin\n", a, DAR_SPLIT_VERSION); fprintf(stderr, " compiled the %s with %s version %s\n", __DATE__, CC_NAT, __VERSION__); fprintf(stderr, " %s is part of the Disk ARchive suite (Release %s)\n", a, PACKAGE_VERSION); fprintf(stderr, " %s comes with ABSOLUTELY NO WARRANTY; for details\n type `dar -W'.", a); fprintf(stderr, " This is free software, and you are welcome\n to redistribute it under certain conditions;"); fprintf(stderr, " type `dar -L | more'\n for details.\n\n"); } static int init() { char tty[L_ctermid+1]; (void)ctermid(tty); tty[L_ctermid] = '\0'; fd_inter = open(tty, O_RDONLY); if(fd_inter < 0) { fprintf(stderr, "Cannot open filedscriptor to provide user interaction: %s\n", strerror(errno)); return 0; /* false */ } else return 1; /* true */ } static void stop_and_wait() { char tmp[10]; fprintf(stderr, "Press return when ready to continue\n"); read(fd_inter, tmp, 3); } static void pipe_handle_pause(int x) { fprintf(stderr, "No reader to pipe we output data to, do something!\n"); stop_and_wait(); } static void pipe_handle_end(int x) { exit(0); } static void normal_read_to_multiple_write(char *filename) { char buffer[BUFSIZE]; int lu; int ecru; int offset; int fd = open_write(filename); signal(SIGPIPE, pipe_handle_pause); /* handling case when writing to pipe that has no reader */ while(1) { lu = read(0, buffer, BUFSIZE); if(lu == 0) /* reached EOF */ break; /* exiting the while loop, end of processing */ if(lu < 0) { if(errno == EAGAIN || errno == EINTR) continue; /* start over the while loop */ else { fprintf(stderr, "Error reading data: %s\n", strerror(errno)); break; /* exiting the while loop, end of processing */ } } /* now we have data to write down */ offset = 0; do { ecru = write(fd, buffer + offset, lu); if(ecru < 0) /* an error occured */ { switch(errno) { case EAGAIN: case EINTR: break; case ENOSPC: close(fd); fprintf(stderr, "No space left on destination, please to something!\n"); stop_and_wait(); fd = open_write(filename); break; default: fprintf(stderr, "Error writing data: %s\n", strerror(errno)); stop_and_wait(); break; } continue; /* starting over the while do - while loop */ } if(ecru > lu) { fprintf(stderr, "BUG MET at line %d\n", __LINE__); break; /* end or processing */ } /* starting from here no error occurred and ecru >= 0 */ offset += ecru; lu -= ecru; } while(lu > 0); if(lu > 0) break; /* not all data could be written, aborting */ } } static void multi_read_to_normal_write(char *filename) { char buffer[BUFSIZE]; int lu; int ecru; int offset; int fd = open_read(filename); signal(SIGPIPE, pipe_handle_end); /* handling case when writing to pipe that has no reader */ while(1) { lu = read(fd, buffer, BUFSIZE); if(lu == 0) // EOF { close(fd); fprintf(stderr, "No more data available from source, please do something!\n"); stop_and_wait(); open_read(filename); continue; /* start over the while loop */ } else { if(lu < 0) { switch(errno) { case EAGAIN: case EINTR: break; default: fprintf(stderr, "Error reading data: %s\n", strerror(errno)); stop_and_wait(); break; } continue; /* start over the while loop */ } } /* now we have data to write down */ offset = 0; do { ecru = write(1, buffer + offset, lu); if(ecru < 0) /* an error occured */ { int loop = 0; switch(errno) { case EAGAIN: case EINTR: loop = 1; break; default: fprintf(stderr, "Error writing data: %s\n", strerror(errno)); break; } if(loop) continue; /* start over the do - while loop */ else break; /* exiting the do - while loop, aborting the process */ } if(ecru > lu) { fprintf(stderr, "BUG MET at line %d\n", __LINE__); break; /* end or processing */ } /* starting from here no error occurred and lu >= ecru >= 0 */ offset += ecru; lu -= ecru; } while(lu > 0); if(lu > 0) break; /* not all data could be written, aborting */ } } static int open_write(char *filename) { int fd; do { fd = open(filename, O_WRONLY|O_SYNC); if(fd < 0) { fprintf(stderr,"Error opening output: %s\n", strerror(errno)); stop_and_wait(); } } while(fd < 0); return fd; } static int open_read(char *filename) { int fd; do { fd = open(filename, O_RDONLY); if(fd < 0) { fprintf(stderr,"Error opening input: %s\n", strerror(errno)); stop_and_wait(); } } while(fd < 0); return fd; } dar-2.5.3/src/dar_suite/command_line.cpp0000644000175000017430000041176412642474445015142 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #include "getopt_decision.h" #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_ERRNO_H #include #endif } // end extern "C" #include #include #include #include #include #include #include "deci.hpp" #include "command_line.hpp" #include "user_interaction.hpp" #include "tools.hpp" #include "line_tools.hpp" #include "dar.hpp" #include "dar_suite.hpp" #include "integers.hpp" #include "no_comment.hpp" #include "config_file.hpp" #include "shell_interaction.hpp" #include "dar.hpp" #include "libdar.hpp" #include "cygwin_adapt.hpp" #include "mask_list.hpp" #include "crit_action_cmd_line.hpp" #include "criterium.hpp" #include "fichier_local.hpp" #define OPT_STRING "c:A:x:d:t:l:v::z::y::nw::p::k::R:s:S:X:I:P:bhLWDru:U:VC:i:o:OT::E:F:K:J:Y:Z:B:fm:NH::a::eQGMg:#:*:,[:]:+:@:$:~:%:q/:^:_:01:2:.:3:9:<:>:=:4:5::7:" #define ONLY_ONCE "Only one -%c is allowed, ignoring this extra option" #define MISSING_ARG "Missing argument to -%c option" #define INVALID_ARG "Invalid argument given to -%c option" #define INVALID_SIZE "Invalid size given with option -%c" #define DEFAULT_CRYPTO_SIZE 10240 using namespace std; using namespace libdar; struct pre_mask { bool included; // whether it is a include or exclude entry string mask; // the string (either a mask or a filename) bool case_sensit; // whether comparison is case sensitive bool file_listing; // whether the corresponding string is a filename containing a list of file to match to bool glob_exp; // whether this is a glob (not regex) expression }; struct mask_opt { bool case_sensit; bool file_listing; const path & prefix; bool glob_exp; mask_opt(const path & ref) : prefix(ref) {}; void read_from(struct pre_mask m) { case_sensit = m.case_sensit; file_listing = m.file_listing; glob_exp = m.glob_exp; }; }; static const U_I min_compr_size_default = 100; // the default value for --mincompr static const U_I sparse_file_min_size_default = 15; // the default value for --sparse-file-min-size static const char * AUXILIARY_TARGET = "auxiliary"; static const char * REFERENCE_TARGET = "reference"; // return a newly allocated memory (to be deleted by the caller) static void show_license(shell_interaction & dialog); static void show_warranty(shell_interaction & dialog); static void show_version(shell_interaction & dialog, const char *command_name); static void usage(shell_interaction & dialog, const char *command_name); static void split_compression_algo(const char *arg, compression & algo, U_I & level); static fsa_scope string_to_fsa(const string & arg); #if HAVE_GETOPT_LONG const struct option *get_long_opt(); #endif struct recursive_param { // input parameters shell_interaction *dialog; const char *home; const vector dar_dcf_path; const vector dar_duc_path; // output parameters vector inclusions; deque name_include_exclude; deque path_include_exclude; deque ea_include_exclude; deque compr_include_exclude; deque backup_hook_include_exclude; bool readconfig; bool glob_mode; vector non_options; // list of user targets bool ordered_filters; bool case_sensit; bool fixed_date_mode; bool sparse_file_reactivation; U_I suffix_base; bool ea_erase; bool only_more_recent; bool detruire; bool no_inter; vector read_targets; // list of not found uset targets so far recursive_param(shell_interaction & x_dialog, const char *x_home, const vector & x_dar_dcf_path, const vector & x_dar_duc_path): dar_dcf_path(x_dar_dcf_path), dar_duc_path(x_dar_duc_path) { dialog = new (nothrow) shell_interaction(x_dialog); if(dialog == nullptr) throw Ememory("recursive_param::recursive_param"); home = x_home; // readconfig = true; glob_mode = true; // defaults to glob expressions ordered_filters = false; case_sensit = true; fixed_date_mode = false; sparse_file_reactivation = false; suffix_base = TOOLS_BIN_SUFFIX; ea_erase = false; only_more_recent = false; detruire = true; no_inter = false; }; recursive_param(const recursive_param & ref): dar_dcf_path(ref.dar_dcf_path), dar_duc_path(ref.dar_duc_path) { throw SRC_BUG; } ~recursive_param() { if(dialog != nullptr) delete dialog; } }; static bool get_args_recursive(recursive_param & rec, line_param & p, S_I argc, char * const argv[]); static void make_args_from_file(user_interaction & dialog, operation op, const vector & targets, const string & filename, S_I & argc, char **&argv, vector & read_targets, // read targets are removed from this argument bool info_details); static void destroy(S_I argc, char **argv); static void skip_getopt(S_I argc, char *const argv[], S_I next_to_read); static bool update_with_config_files(recursive_param & rec, line_param & p); static mask *make_include_exclude_name(const string & x, mask_opt opt); static mask *make_exclude_path_ordered(const string & x, mask_opt opt); static mask *make_exclude_path_unordered(const string & x, mask_opt opt); static mask *make_include_path(const string & x, mask_opt opt); static mask *make_ordered_mask(deque & listing, mask *(*make_include_mask) (const string & x, mask_opt opt), mask *(*make_exclude_mask)(const string & x, mask_opt opt), const path & prefix); static mask *make_unordered_mask(deque & listing, mask *(*make_include_mask) (const string & x, mask_opt opt), mask *(*make_exclude_mask)(const string & x, mask_opt opt), const path & prefix); static void add_non_options(S_I argc, char * const argv[], vector & non_options); // #define DEBOGGAGE #ifdef DEBOGGAGE static void show_args(S_I argc, char *argv[]); #endif bool get_args(shell_interaction & dialog, const char *home, const vector & dar_dcf_path, const vector & dar_duc_path, S_I argc, char *const argv[], line_param & p) { string cmd = path(argv[0]).basename(); recursive_param rec = recursive_param(dialog, home, dar_dcf_path, dar_duc_path); // initializing parameters to their default values p.op = noop; p.file_size = 0; p.first_file_size = 0; p.filename = ""; p.allow_over = true; p.warn_over = true; p.info_details = false; p.display_treated = false; p.display_treated_only_dir = false; p.display_skipped = false; p.display_finished = false; p.algo = none; p.compression_level = 9; p.pause = 0; p.beep = false; p.empty_dir = false; p.input_pipe = ""; p.output_pipe = ""; p.what_to_check = cat_inode::cf_all; p.execute = ""; p.execute_ref = ""; p.pass.clear(); p.signatories.clear(); p.blind_signatures = false; p.pass_ref.clear(); p.flat = false; p.min_compr_size = min_compr_size_default; p.nodump = false; p.exclude_by_ea = false; p.ea_name_for_exclusion = ""; p.hourshift = 0; p.warn_remove_no_match = true; p.filter_unsaved = false; p.empty = false; p.alter_atime = true; p.same_fs = false; p.snapshot = false; p.cache_directory_tagging = false; p.crypto_size = DEFAULT_CRYPTO_SIZE; p.crypto_size_ref = DEFAULT_CRYPTO_SIZE; p.list_mode = archive_options_listing::normal; p.aux_pass.clear(); p.aux_execute = ""; p.aux_crypto_size = DEFAULT_CRYPTO_SIZE; p.keep_compressed = false; p.fixed_date = 0; p.quiet = false; p.slice_perm = ""; p.slice_user = ""; p.slice_group = ""; p.repeat_count = 3; // 3 retry by default p.repeat_byte = 1; // 1 wasted byte allowed by default p.decremental = false; #if FURTIVE_READ_MODE_AVAILABLE p.furtive_read_mode = true; #else p.furtive_read_mode = false; #endif p.lax = false; p.use_sequential_marks = true; p.sequential_read = false; p.sparse_file_min_size = sparse_file_min_size_default; p.dirty = dirtyb_warn; p.security_check = true; p.user_comment = ""; p.hash = hash_none; p.num_digits = 0; p.ref_num_digits = 0; p.aux_num_digits = 0; p.only_deleted = false; p.not_deleted = false; p.backup_hook_mask = nullptr; p.backup_hook_execute = ""; p.list_ea = false; p.ignore_unknown_inode = false; p.no_compare_symlink_date = true; p.scope = all_fsa_families(); p.multi_threaded = true; try { opterr = 0; if(!get_args_recursive(rec, p, argc, argv)) return false; // checking and updating options with configuration file if any if(rec.readconfig) if(! update_with_config_files(rec, p)) return false; // this cannot be done sooner, because "info_details" would always be equal to false // as command-line would not have been yet parsed. if(p.info_details) { if(!rec.non_options.empty()) { vector::iterator it = rec.non_options.begin(); bool init_message_done = false; while(it != rec.non_options.end()) { if(*it != AUXILIARY_TARGET && *it != REFERENCE_TARGET) // theses two targets are stored as "user targets" but are reserved targets not user's { if(!init_message_done) { dialog.warning(gettext("User target found on command line or included file(s):")); init_message_done = true; } dialog.printf("\t%S", &(*it)); // yes, strange syntax, where "&(*it)" is not equal to "it" ... :-) } ++it; } if(!init_message_done) dialog.warning(gettext("No user target found on command line")); } } // some sanity checks vector unseen = tools_substract_from_vector(rec.non_options, rec.read_targets); vector special_targets; special_targets.push_back(AUXILIARY_TARGET); special_targets.push_back(REFERENCE_TARGET); unseen = tools_substract_from_vector(unseen, special_targets); if(!unseen.empty()) { string not_seen; for(vector::iterator it = unseen.begin(); it != unseen.end(); ++it) not_seen += *it + " "; throw Erange("get_args", tools_printf(gettext("Given user target(s) could not be found: %S"), ¬_seen)); } if(p.filename == "" || p.sauv_root == nullptr || p.op == noop) throw Erange("get_args", tools_printf(gettext("Missing -c -x -d -t -l -C -+ option, see `%S -h' for help"), &cmd)); if(p.filename == "-" && !p.file_size.is_zero()) throw Erange("get_args", gettext("Slicing (-s option), is not compatible with archive on standard output (\"-\" as filename)")); if(p.filename != "-" && (p.op != create && p.op != isolate && p.op != merging)) if(p.sauv_root == nullptr) throw SRC_BUG; if(p.filename != "-") tools_check_basename(dialog, *p.sauv_root, p.filename, EXTENSION); if((p.op == merging || p.op == create) && p.aux_filename != nullptr) { if(p.aux_root == nullptr) throw SRC_BUG; else tools_check_basename(dialog, *p.aux_root, *p.aux_filename, EXTENSION); } if(p.fs_root == nullptr) { p.fs_root = new (nothrow) path("."); if(p.fs_root == nullptr) throw Ememory("get_args"); } if(rec.fixed_date_mode && p.op != create) throw Erange("get_args", gettext("-af option is only available with -c")); if(p.ref_filename != nullptr && p.op == listing) dialog.warning(gettext("-A option is not available with -l")); if(p.op == isolate && p.ref_filename == nullptr) throw Erange("get_args", gettext("with -C option, -A option is mandatory")); if(p.op == merging && p.ref_filename == nullptr) throw Erange("get_args", gettext("with -+ option, -A option is mandatory")); if(p.op != extract && !p.warn_remove_no_match) dialog.warning(gettext("-wa is only useful with -x option")); if(p.filename == "-" && p.ref_filename != nullptr && *p.ref_filename == "-" && p.output_pipe == "" && !p.sequential_read) throw Erange("get_args", gettext("-o is mandatory when using \"-A -\" with \"-c -\" \"-C -\" or \"-+ -\"")); if(p.ref_filename != nullptr && *p.ref_filename != "-") { if(p.ref_root == nullptr) throw SRC_BUG; else tools_check_basename(dialog, *p.ref_root, *p.ref_filename, EXTENSION); } if(p.algo != none && p.op != create && p.op != isolate && p.op != merging) dialog.warning(gettext("-z option needs only to be used with -c -C or -+ options")); if(!p.first_file_size.is_zero() && p.file_size.is_zero()) throw Erange("get_args", gettext("-S option requires the use of -s")); if(p.what_to_check != cat_inode::cf_all && (p.op == isolate || (p.op == create && p.ref_root == nullptr) || p.op == test || p.op == listing || p.op == merging)) dialog.warning(gettext("ignoring -O option, as it is useless in this situation")); if(p.what_to_check == cat_inode::cf_all && p.op == extract && capability_CHOWN(dialog, p.info_details) && getuid() != 0) // uid == 0 for root { p.what_to_check = cat_inode::cf_ignore_owner; string msg = tools_printf(gettext("File ownership will not be restored as %s has not the CHOWN capability nor is running as root. to avoid this message use -O option"), cmd.c_str()); dialog.pause(msg); } if(p.furtive_read_mode && capability_FOWNER(dialog, p.info_details) != libdar::capa_set && getuid() != 0) { if(p.op == create || p.op == diff) dialog.printf(gettext("Furtive read mode has been disabled as %s has not the FOWNER capability nor is running as root"), cmd.c_str()); p.furtive_read_mode = false; } if(p.execute_ref != "" && p.ref_filename == nullptr) dialog.warning(gettext("-F is only useful with -A option, for the archive of reference")); if(p.pass_ref != "" && p.ref_filename == nullptr) { dialog.warning(gettext("-J is only useful with -A option, for the archive of reference")); } if(p.flat && p.op != extract) dialog.warning(gettext("-f in only available with -x option, ignoring")); if(p.min_compr_size != min_compr_size_default && p.op != create && p.op != merging) dialog.warning(gettext("-m is only useful with -c")); if(!p.hourshift.is_zero()) { if(p.op == create) { if(p.ref_filename == nullptr) dialog.warning(gettext("-H is only useful with -A option when making a backup")); } else if(p.op == extract) { if(!rec.only_more_recent) dialog.warning(gettext("-H is only useful with -r option when extracting")); } else if(p.op != diff) dialog.warning(gettext("-H is only useful with -c, -d or -x")); } if(p.filter_unsaved && p.op != listing) dialog.warning(gettext("-as is only available with -l, ignoring -as option")); if(p.empty && p.op != create && p.op != extract && p.op != merging && p.op != test) dialog.warning(gettext("-e is only useful with -x, -c or -+ options")); if(!p.alter_atime && p.op != create && p.op != diff) dialog.warning(gettext("-ac is only useful with -c or -d")); if(p.same_fs && p.op != create) dialog.warning(gettext("-M is only useful with -c")); if(p.snapshot && p.op != create) dialog.warning(gettext("The snapshot backup (-A +) is only available with -c option, ignoring")); if(p.cache_directory_tagging && p.op != create) dialog.warning(gettext("The Cache Directory Tagging Standard is only useful while performing a backup, ignoring it here")); if((p.aux_root != nullptr || p.aux_filename != nullptr) && p.op != merging && p.op != create) throw Erange("get_args", gettext("-@ is only available with -+ and -c options")); if(p.aux_pass != "" && p.op != merging && p.op != create) throw Erange("get_args", gettext("-$ is only available with -+ option and -c options")); if(p.aux_execute != "" && p.op != merging && p.op != create) throw Erange("get_args", gettext("-~ is only available with -+ and -c options")); if(p.aux_crypto_size != DEFAULT_CRYPTO_SIZE && p.op != merging && p.op != create) throw Erange("get_args", tools_printf(gettext("-%% is only available with -+ option"))); if(p.aux_pass != "" && p.aux_filename == nullptr) dialog.warning(gettext("-$ is only useful with -@ option, for the auxiliary archive of reference")); if(p.aux_crypto_size != DEFAULT_CRYPTO_SIZE && p.aux_filename == nullptr) dialog.printf(gettext("-%% is only useful with -@ option, for the auxiliary archive of reference")); if(p.aux_execute != "" && p.aux_filename == nullptr) dialog.warning(gettext("-~ is only useful with -@ option, for the auxiliary archive of reference")); if(p.keep_compressed && p.op != merging) { dialog.warning(gettext("-ak is only available while merging (operation -+), ignoring -ak")); p.keep_compressed = false; } if(p.algo != none && p.op == merging && p.keep_compressed) dialog.warning(gettext("Compression option (-z option) is useless and ignored when using -ak option")); // sparse files handling if(p.sparse_file_min_size != sparse_file_min_size_default) { if(p.op != merging && p.op != create) dialog.warning(gettext("--sparse-file-min-size only available while saving or merging archives, ignoring")); else if(p.op == merging && !rec.sparse_file_reactivation) dialog.warning(gettext("To use --sparse-file-min-size while merging archive, you need to use -ah option too, please check man page for details")); } if(p.op == merging && !rec.sparse_file_reactivation) p.sparse_file_min_size = 0; // disabled by default for archive merging if((p.not_deleted || p.only_deleted) && p.op != extract) dialog.warning(gettext("-k option is only useful with -x option")); if(p.not_deleted && p.only_deleted) throw Erange("get_args", gettext("-konly and -kignore cannot be used at the same time")); if(rec.no_inter && !p.pause.is_zero()) throw Erange("get_args", gettext("-p and -Q options are mutually exclusives")); if(p.display_finished && p.op != create) dialog.warning(gettext("-vf is only useful with -c option")); ////////////////////// // generating masks // for filenames // if(rec.ordered_filters) p.selection = make_ordered_mask(rec.name_include_exclude, &make_include_exclude_name, &make_include_exclude_name, tools_relative2absolute_path(*p.fs_root, tools_getcwd())); else // unordered filters p.selection = make_unordered_mask(rec.name_include_exclude, &make_include_exclude_name, &make_include_exclude_name, tools_relative2absolute_path(*p.fs_root, tools_getcwd())); ///////////////////////// // generating masks for // directory tree // if(rec.ordered_filters) p.subtree = make_ordered_mask(rec.path_include_exclude, &make_include_path, &make_exclude_path_ordered, p.op != test && p.op != merging && p.op != listing ? tools_relative2absolute_path(*p.fs_root, tools_getcwd()) : ""); else // unordered filters p.subtree = make_unordered_mask(rec.path_include_exclude, &make_include_path, &make_exclude_path_unordered, p.op != test && p.op != merging && p.op != listing ? tools_relative2absolute_path(*p.fs_root, tools_getcwd()) : ""); //////////////////////////////// // generating mask for // compression selected files // if(p.algo == none) { if(!rec.compr_include_exclude.empty()) dialog.warning(gettext("-Y and -Z are only useful with compression (-z option), ignoring any -Y and -Z option")); if(p.min_compr_size != min_compr_size_default) dialog.warning(gettext("-m is only useful with compression (-z option), ignoring -m")); } if(p.algo != none) if(rec.ordered_filters) p.compress_mask = make_ordered_mask(rec.compr_include_exclude, &make_include_exclude_name, &make_include_exclude_name, tools_relative2absolute_path(*p.fs_root, tools_getcwd())); else p.compress_mask = make_unordered_mask(rec.compr_include_exclude, &make_include_exclude_name, &make_include_exclude_name, tools_relative2absolute_path(*p.fs_root, tools_getcwd())); else { p.compress_mask = new (nothrow) bool_mask(true); if(p.compress_mask == nullptr) throw Ememory("get_args"); } //////////////////////////////// // generating mask for EA // // if(rec.ordered_filters) p.ea_mask = make_ordered_mask(rec.ea_include_exclude, &make_include_exclude_name, &make_include_exclude_name, tools_relative2absolute_path(*p.fs_root, tools_getcwd())); else // unordered filters p.ea_mask = make_unordered_mask(rec.ea_include_exclude, &make_include_exclude_name, &make_include_exclude_name, tools_relative2absolute_path(*p.fs_root, tools_getcwd())); //////////////////////////////// // generating mask for backup hook // // if(rec.backup_hook_include_exclude.size() == 0) { p.backup_hook_mask = nullptr; if(p.backup_hook_execute != "") { p.backup_hook_execute = ""; if(p.op != create) dialog.warning(gettext("-= option is valid only while saving files, thus in conjunction with -c option, ignoring")); else dialog.warning(gettext("-= option will be ignored as it is useless if you do not specify to which files or directories this backup hook is to be applied, thanks to -< and -> options. See man page for more details.")); } } else if(p.op != create) { dialog.warning(gettext("backup hook feature (-<, -> or -= options) is only available when saving files, ignoring")); p.backup_hook_mask = nullptr; p.backup_hook_execute = ""; } else if(rec.ordered_filters) p.backup_hook_mask = make_ordered_mask(rec.backup_hook_include_exclude, &make_exclude_path_unordered, // no mistake here about *exclude*, nor *unordered* &make_exclude_path_unordered, // no mistake here about *exclude*, nor *unordered* tools_relative2absolute_path(*p.fs_root, tools_getcwd())); else p.backup_hook_mask = make_unordered_mask(rec.backup_hook_include_exclude, &make_exclude_path_unordered,// no mistake here about *exclude* &make_exclude_path_unordered, tools_relative2absolute_path(*p.fs_root, tools_getcwd())); //////////////////////////////// // overwriting policy // switch(p.op) { case merging: if(p.overwrite == nullptr) { p.overwrite = new (nothrow) crit_constant_action(data_preserve, EA_merge_preserve); if(p.overwrite == nullptr) throw Ememory("get_args"); } break; case extract: if(p.overwrite == nullptr) { line_tools_4_4_build_compatible_overwriting_policy(p.allow_over, rec.detruire, rec.only_more_recent, p.hourshift, rec.ea_erase, p.overwrite); if(p.overwrite == nullptr) throw Ememory("get_args"); } break; default: if(p.overwrite != nullptr) { delete p.overwrite; p.overwrite = nullptr; dialog.warning(gettext("-/ option is only useful with -+ option, ignoring")); } } //////////////////////////////// // user comment // // if(p.user_comment != "") if(p.op != create && p.op != merging && p.op != isolate) dialog.warning(gettext("-. option is only useful when merging, creating or isolating an archive, ignoring")); else { p.user_comment = line_tools_expand_user_comment(p.user_comment, argc, argv); if(p.info_details) dialog.printf(gettext("The following user comment will be placed in clear text in the archive: %S"), &p.user_comment); } else p.user_comment = "N/A"; //////////////////////////////// // security check // // if(!p.alter_atime) p.security_check = false; } catch(Erange & e) { dialog.warning(string(gettext("Parse error: ")) + e.get_message()); return false; } return true; } const char *get_short_opt() { return OPT_STRING; } static bool get_args_recursive(recursive_param & rec, line_param & p, S_I argc, char * const argv[]) { S_I lu; S_I rec_c; char **rec_v = nullptr; pre_mask tmp_pre_mask; U_I tmp; string tmp_string, tmp_string2; // fetching first the targets (non optional argument of command line) add_non_options(argc, argv, rec.non_options); #if HAVE_GETOPT_LONG while((lu = getopt_long(argc, argv, OPT_STRING, get_long_opt(), nullptr)) != EOF) #else while((lu = getopt(argc, argv, OPT_STRING)) != EOF) #endif { switch(lu) { case 'c': case 'x': case 'd': case 't': case 'l': case 'C': case '+': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.filename != "" || p.sauv_root != nullptr) throw Erange("get_args", gettext(" Only one option of -c -d -t -l -C -x or -+ is allowed")); if(string(optarg) != string("")) tools_split_path_basename(optarg, p.sauv_root, p.filename); else throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); switch(lu) { case 'c': p.op = create; break; case 'x': p.op = extract; break; case 'd': p.op = diff; break; case 't': p.op = test; break; case 'l': p.op = listing; break; case 'C': p.op = isolate; break; case '+': p.op = merging; break; default: throw SRC_BUG; } break; case 'A': if(p.ref_filename != nullptr || p.ref_root != nullptr || p.snapshot || !p.fixed_date.is_zero()) throw Erange("get_args", gettext("Only one -A option is allowed")); if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(strcmp("", optarg) == 0) throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); if(rec.fixed_date_mode) { try { try { // trying to read a simple integer // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci tmp = string(optarg); p.fixed_date = tmp.computer(); } catch(Edeci & e) { // fallback to human readable string p.fixed_date = tools_convert_date(optarg); } } catch(Egeneric & e) { throw Erange("get_args", string(gettext("Error while parsing -A argument as a date: ")+ e.get_message())); } } else if(strcmp("+", optarg) == 0) p.snapshot = true; else { p.ref_filename = new (nothrow) string(); if(p.ref_filename == nullptr) throw Ememory("get_args"); try { tools_split_path_basename(optarg, p.ref_root, *p.ref_filename); rec.non_options.push_back("reference"); } catch(...) { delete p.ref_filename; p.ref_filename = nullptr; throw; } } break; case 'v': if(optarg == nullptr) { p.info_details = true; p.display_treated = true; p.display_treated_only_dir = false; } else if(strcasecmp("skipped", optarg) == 0 || strcasecmp("s", optarg) == 0) p.display_skipped = true; else if(strcasecmp("treated", optarg) == 0 || strcasecmp("t", optarg) == 0) { p.display_treated = true; p.display_treated_only_dir = false; } else if(strcasecmp("messages", optarg) == 0 || strcasecmp("m", optarg) == 0) p.info_details = true; else if(strcasecmp("dir", optarg) == 0 || strcasecmp("d", optarg) == 0) { p.display_treated = true; p.display_treated_only_dir = true; } else if(strcasecmp("finished", optarg) == 0 || strcasecmp("f", optarg) == 0) p.display_finished = true; else if(strcasecmp("all", optarg) == 0 || strcasecmp("a", optarg) == 0) { p.info_details = true; p.display_skipped = true; p.display_treated = true; p.display_treated_only_dir = false; } else throw Erange("command_line.cpp:get_args_recursive", tools_printf(gettext(INVALID_ARG), char(lu))); break; case 'z': if(optarg != nullptr) split_compression_algo(optarg, p.algo, p.compression_level); else if(p.algo == none) p.algo = gzip; else throw Erange("get_args", gettext("Choose only one compression algorithm")); break; case 'n': p.allow_over = false; if(!p.warn_over) { rec.dialog->warning(gettext("-w option is useless with -n")); p.warn_over = false; } break; case 'w': p.warn_over = false; if(optarg != nullptr) { if(strcmp(optarg, "a") == 0 || strcmp(optarg, "all") == 0) p.warn_remove_no_match = false; else if(strcmp(optarg, "d") != 0 && strcmp(optarg, "default") != 0) throw Erange("get_args", string(gettext("Unknown argument given to -w: ")) + optarg); // else this is the default -w } break; case 'p': if(optarg != nullptr) { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) libdar::deci conv = string(optarg); p.pause = conv.computer(); } else p.pause = 1; break; case 'k': if(optarg == nullptr) // -k without argument { if(p.only_deleted) throw Erange("command_line.cpp:get_args_recursive", string(gettext("\"-k\" (or \"-kignore\") and \"-konly\" are not compatible"))); p.not_deleted = true; } else if(strcasecmp(optarg, "ignore") == 0) { if(p.only_deleted) throw Erange("command_line.cpp:get_args_recursive", string(gettext("\"-k\" (or \"-kignore\") and \"-konly\" are not compatible"))); p.not_deleted = true; } else if(strcasecmp(optarg, "only") == 0) { if(p.not_deleted) throw Erange("command_line.cpp:get_args_recursive", string(gettext("\"-k\" (or \"-kignore\") and \"-konly\" are not compatible"))); p.only_deleted = true; } else throw Erange("command_line.cpp:get_args_recursive", tools_printf(gettext("Unknown argument given to -k : %s"), optarg)); break; case 'R': if(p.fs_root != nullptr) throw Erange("get_args", gettext("Only one -R option is allowed")); if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); else p.fs_root = new (nothrow) path(optarg, true); if(p.fs_root == nullptr) throw Ememory("get_args"); break; case 's': if(!p.file_size.is_zero()) throw Erange("get_args", gettext("Only one -s option is allowed")); if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); else { try { p.file_size = tools_get_extended_size(optarg, rec.suffix_base); if(p.first_file_size.is_zero()) p.first_file_size = p.file_size; } catch(Edeci &e) { rec.dialog->warning(tools_printf(gettext(INVALID_SIZE), char(lu))); return false; } } break; case 'S': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.first_file_size.is_zero()) p.first_file_size = tools_get_extended_size(optarg, rec.suffix_base); else if(p.file_size.is_zero()) throw Erange("get_args", gettext("Only one -S option is allowed")); else if(p.file_size == p.first_file_size) { try { p.first_file_size = tools_get_extended_size(optarg, rec.suffix_base); if(p.first_file_size == p.file_size) rec.dialog->warning(gettext("Giving to -S option the same value as the one given to -s option is useless")); } catch(Egeneric &e) { rec.dialog->warning(tools_printf(gettext(INVALID_SIZE), char(lu))); return false; } } else throw Erange("get_args", gettext("Only one -S option is allowed")); break; case 'X': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = false; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = false; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.name_include_exclude.push_back(tmp_pre_mask); break; case 'I': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = false; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = true; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.name_include_exclude.push_back(tmp_pre_mask); break; case 'P': case ']': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = lu == ']'; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = false; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.path_include_exclude.push_back(tmp_pre_mask); break; case 'g': case '[': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = lu == '['; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = true; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.path_include_exclude.push_back(tmp_pre_mask); break; case 'b': p.beep = true; break; case 'h': usage(*rec.dialog, argv[0]); p.op = version_or_help; return false; case 'L': show_license(*rec.dialog); return false; case 'W': show_warranty(*rec.dialog); return false; case 'D': if(p.empty_dir) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else p.empty_dir = true; break; case 'r': if(!p.allow_over) rec.dialog->warning(gettext("-r is useless with -n")); if(rec.only_more_recent) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else rec.only_more_recent = true; break; case 'u': case 'U': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = false; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = lu == 'U'; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.ea_include_exclude.push_back(tmp_pre_mask); break; case 'V': show_version(*rec.dialog, argv[0]); p.op = version_or_help; return false; case 'i': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.input_pipe == "") p.input_pipe = optarg; else rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case 'o': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.output_pipe == "") p.output_pipe = optarg; else rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case 'O': if(p.what_to_check != cat_inode::cf_all) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else if(optarg == nullptr) p.what_to_check = cat_inode::cf_ignore_owner; else if(strcasecmp(optarg, "ignore-owner") == 0) p.what_to_check = cat_inode::cf_ignore_owner; else if(strcasecmp(optarg, "mtime") == 0) p.what_to_check = cat_inode::cf_mtime; else if(strcasecmp(optarg, "inode-type") == 0) p.what_to_check = cat_inode::cf_inode_type; else throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); break; case 'T': if(optarg == nullptr) p.list_mode = archive_options_listing::tree; else if(strcasecmp("normal", optarg) == 0) p.list_mode = archive_options_listing::normal; else if(strcasecmp("tree", optarg) == 0) p.list_mode = archive_options_listing::tree; else if(strcasecmp("xml", optarg) == 0) p.list_mode = archive_options_listing::xml; else if(strcasecmp("slicing", optarg) == 0 || strcasecmp("slice", optarg) == 0) p.list_mode = archive_options_listing::slicing; else throw Erange("command_line.cpp:get_args_recursive", tools_printf(gettext(INVALID_ARG), char(lu))); break; case 'E': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); line_tools_split_at_first_space(optarg, tmp_string, tmp_string2); tmp_string = line_tools_get_full_path_from_PATH(rec.dar_duc_path, tmp_string.c_str()) + " " + tmp_string2; if(p.execute == "") p.execute = tmp_string; else p.execute += string(" ; ") + tmp_string; break; case 'F': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.execute_ref == "") p.execute_ref = optarg; else p.execute_ref += string(" ; ") + optarg; break; case 'J': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.pass_ref == "") p.pass_ref = secu_string(optarg, strlen(optarg)); else rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case 'K': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.pass == "") p.pass = secu_string(optarg, strlen(optarg)); else rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case 'Y': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = false; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = true; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.compr_include_exclude.push_back(tmp_pre_mask); break; case 'Z': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = false; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = false; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.compr_include_exclude.push_back(tmp_pre_mask); break; case 'B': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_string = line_tools_get_full_path_from_PATH(rec.dar_dcf_path, optarg); if(find(rec.inclusions.begin(), rec.inclusions.end(), tmp_string) != rec.inclusions.end()) throw Erange("get_args", tools_printf(gettext("File inclusion loop detected. The file %s includes itself directly or through other files (-B option)"), optarg)); else { bool ret; try { make_args_from_file(*rec.dialog, p.op, rec.non_options, tmp_string, rec_c, rec_v, rec.read_targets, p.info_details); } catch(Esystem & e) { Erange modif = Erange("get_args", tools_printf(gettext("Error reading included file (%s): "), optarg) + e.get_message()); throw modif; } catch(Erange & e) { Erange modif = Erange("get_args", tools_printf(gettext("Error in included file (%s): "), optarg) + e.get_message()); throw modif; } #if DEBOGGAGE show_args(rec_c, rec_v); #endif S_I optind_mem = line_tools_reset_getopt(); // save the external variable to use recursivity (see getopt) // reset getopt module try { rec.inclusions.push_back(tmp_string); try { ret = get_args_recursive(rec, p, rec_c, rec_v); } catch(Erange & e) { Erange more = Erange(e.get_source(), tools_printf(gettext("In included file %S: "), &tmp_string) + e.get_message()); rec.inclusions.pop_back(); throw more; } catch(...) { rec.inclusions.pop_back(); throw; } rec.inclusions.pop_back(); } catch(...) { destroy(rec_c, rec_v); rec_v = nullptr; rec_c = 0; skip_getopt(argc, argv, optind_mem); throw; } destroy(rec_c, rec_v); rec_v = nullptr; rec_c = 0; skip_getopt(argc, argv, optind_mem); // restores getopt after recursion if(!ret) return false; } break; case 'f': if(p.flat) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else p.flat = true; break; case 'm': if(p.min_compr_size != min_compr_size_default) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else { if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); p.min_compr_size = tools_get_extended_size(optarg, rec.suffix_base); if(p.min_compr_size == min_compr_size_default) rec.dialog->warning(tools_printf(gettext("%d is the default value for -m, no need to specify it on command line, ignoring"), min_compr_size_default)); break; } case 'N': if(!rec.readconfig) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else rec.readconfig = false; break; case ' ': #ifdef LIBDAR_NODUMP_FEATURE if(p.nodump) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else p.nodump = true; break; #else throw Ecompilation(gettext("--nodump feature has not been activated at compilation time, it is thus not available")); #endif case 'H': if(optarg == nullptr) p.hourshift = 1; else { try { // note that the namespace specification is necessary // due to similar existing name in std namespace under // certain OS (FreeBSD 10.0) p.hourshift = libdar::deci(string(optarg)).computer(); } catch(Edeci & e) { throw Erange("command_line.cpp:get_args_recursive", gettext("Argument given to -H is not a positive integer number")); } } break; case 'a': if(optarg == nullptr) throw Erange("command_line.cpp:get_args_recursive", gettext("-a option requires an argument")); if(strcasecmp("SI-unit", optarg) == 0 || strcasecmp("SI", optarg) == 0 || strcasecmp("SI-units", optarg) == 0) rec.suffix_base = TOOLS_SI_SUFFIX; else if(strcasecmp("binary-unit", optarg) == 0 || strcasecmp("binary", optarg) == 0 || strcasecmp("binary-units", optarg) == 0) rec.suffix_base = TOOLS_BIN_SUFFIX; else if(strcasecmp("atime", optarg) == 0 || strcasecmp("a", optarg) == 0) { p.alter_atime = true; p.furtive_read_mode = false; } else if(strcasecmp("ctime", optarg) == 0 || strcasecmp("c", optarg) == 0) { p.alter_atime = false; p.furtive_read_mode = false; } else if(strcasecmp("m", optarg) == 0 || strcasecmp("mask", optarg) == 0) { if(rec.ordered_filters) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else rec.ordered_filters = true; } else if(strcasecmp("n", optarg) == 0 || strcasecmp("no-case", optarg) == 0 || strcasecmp("no_case", optarg) == 0) rec.case_sensit = false; else if(strcasecmp("case", optarg) == 0) rec.case_sensit = true; else if(strcasecmp("s", optarg) == 0 || strcasecmp("saved", optarg) == 0) { if(p.filter_unsaved) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else p.filter_unsaved = true; } else if(strcasecmp("e", optarg) == 0 || strcasecmp("erase_ea", optarg) == 0) { if(rec.ea_erase) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else rec.ea_erase = true; } else if(strcasecmp("g", optarg) == 0 || strcasecmp("glob", optarg) == 0) rec.glob_mode = true; else if(strcasecmp("r", optarg) == 0 || strcasecmp("regex", optarg) == 0) rec.glob_mode = false; else if(strcasecmp("k", optarg) == 0 || strcasecmp("keep-compressed", optarg) == 0) { if(p.keep_compressed) rec.dialog->warning(gettext("-ak option need not be specified more than once, ignoring extra -ak options")); p.keep_compressed = true; } else if(strcasecmp("f", optarg) == 0 || strcasecmp("fixed-date", optarg) == 0) { if(p.ref_filename != nullptr || p.ref_root != nullptr || p.snapshot) throw Erange("get_args", gettext("-af must be present before -A option not after!")); if(rec.fixed_date_mode) rec.dialog->warning(gettext("-af option need not be specified more than once, ignoring extra -af options")); rec.fixed_date_mode = true; } else if(strcasecmp("d", optarg) == 0 || strcasecmp("decremental", optarg) == 0) p.decremental = true; else if(strcasecmp("l", optarg) == 0 || strcasecmp("lax", optarg) == 0) p.lax = true; else if(strcasecmp("t", optarg) == 0 || strcasecmp("tape-marks", optarg) == 0) p.use_sequential_marks = false; else if(strcasecmp("h", optarg) == 0 || strcasecmp("holes-recheck", optarg) == 0) rec.sparse_file_reactivation = true; else if(strcasecmp("secu", optarg) == 0) p.security_check = false; else if(strcasecmp("list-ea", optarg) == 0) p.list_ea = true; else if(strcasecmp("i", optarg) == 0 || strcasecmp("ignore-unknown-inode-type", optarg) == 0) p.ignore_unknown_inode = true; else if(strcasecmp("do-not-compare-symlink-mtime", optarg) == 0) p.no_compare_symlink_date = false; else if(strcasecmp("test-self-reported-bug", optarg) == 0) throw SRC_BUG; // testing the way a internal error is reported else if(strcasecmp("b", optarg) == 0 || strcasecmp("blind-to-signatures", optarg) == 0) p.blind_signatures = true; else throw Erange("command_line.cpp:get_args_recursive", tools_printf(gettext("Unknown argument given to -a : %s"), optarg)); break; case 'e': if(p.empty) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else p.empty = true; break; case 'Q': rec.no_inter = true; break; case 'G': if(optarg != nullptr) throw Erange("command_line.cpp:get_arg_recursive", tools_printf(gettext(INVALID_ARG), char(lu))); if(compile_time::libthreadar() && !rec.no_inter) rec.dialog->pause(gettext("Warning: -G option is an experimental and unsupported feature, read man page about -G option for more information")); p.multi_threaded = false; break; case 'M': if(p.same_fs) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else p.same_fs = true; break; case '#': if(! tools_my_atoi(optarg, tmp)) throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); else p.crypto_size = (U_32)tmp; break; case '*': if(! tools_my_atoi(optarg, tmp)) throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); else p.crypto_size_ref = (U_32)tmp; break; case ',': if(p.cache_directory_tagging) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else p.cache_directory_tagging = true; break; case '@': if(p.aux_filename != nullptr || p.aux_root != nullptr) throw Erange("get_args", gettext("Only one -@ option is allowed")); if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(strcmp("", optarg) == 0) throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); else { p.aux_filename = new (nothrow) string(); if(p.aux_filename == nullptr) throw Ememory("get_args"); try { tools_split_path_basename(optarg, p.aux_root, *p.aux_filename); rec.non_options.push_back("auxiliary"); } catch(...) { delete p.aux_filename; p.aux_filename = nullptr; throw; } } break; case '~': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.aux_execute == "") p.aux_execute = optarg; else p.aux_execute += string(" ; ") + optarg; break; case '$': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.aux_pass == "") p.aux_pass = secu_string(optarg, strlen(optarg)); else rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case '%': if(! tools_my_atoi(optarg, tmp)) throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); else p.aux_crypto_size = (U_32)tmp; break; case '/': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.overwrite == nullptr) { try { p.overwrite = crit_action_create_from_string(*rec.dialog, crit_action_canonize_string(optarg), p.hourshift); } catch(Erange & e) { throw Erange(e.get_source(), string(gettext("Syntax error in overwriting policy: ") + e.get_message())); } } else rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); break; case '^': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); line_tools_slice_ownership(string(optarg), p.slice_perm, p.slice_user, p.slice_group); break; case '_': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); line_tools_repeat_param(string(optarg), p.repeat_count, p.repeat_byte); break; case '0': if(optarg == nullptr) p.sequential_read = true; else throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); break; case '1': if(p.sparse_file_min_size != sparse_file_min_size_default) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else { if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); try { p.sparse_file_min_size = tools_get_extended_size(optarg, rec.suffix_base); if(p.sparse_file_min_size == sparse_file_min_size_default) rec.dialog->warning(tools_printf(gettext("%d is the default value for --sparse-file-min-size, no need to specify it on command line, ignoring"), sparse_file_min_size_default)); } catch(Edeci & e) { throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); } } break; case '2': if(p.dirty != dirtyb_warn) rec.dialog->warning(tools_printf(gettext(ONLY_ONCE), char(lu))); else { if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(strcasecmp("ignore", optarg) == 0) p.dirty = dirtyb_ignore; else if(strcasecmp("no-warn", optarg) == 0) p.dirty = dirtyb_ok; else throw Erange("command_line.cpp:get_args_recursive", tools_printf(gettext("Unknown argument given to -2 : %s"), optarg)); } break; case '"': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); else { tlv_list tmp; argc_argv arg; bool ret; tools_read_from_pipe(*rec.dialog, tools_str2int(optarg), tmp); line_tools_tlv_list2argv(*rec.dialog, tmp, arg); S_I optind_mem = line_tools_reset_getopt(); // save the external variable to use recursivity (see getopt) // reset getopt module ret = get_args_recursive(rec, p, arg.argc(), arg.argv()); skip_getopt(argc, argv, optind_mem); // restores getopt after recursion if(!ret) return false; } break; case 'q': p.quiet = true; break; case '.': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); if(p.user_comment != "") p.user_comment += " "; p.user_comment += optarg; break; case '3': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext("Missing argument to --hash"), char(lu))); if(strcasecmp(optarg, "md5") == 0) p.hash = hash_md5; else if(strcasecmp(optarg, "sha1") == 0) p.hash = hash_sha1; else if(strcasecmp(optarg, "sha512") == 0) p.hash = hash_sha512; else throw Erange("get_args", string(gettext("Unknown parameter given to --hash option: ")) + optarg); break; case '9': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext("Missing argument to --min-digits"), char(lu))); else { try { line_tools_get_min_digits(optarg, p.num_digits, p.ref_num_digits, p.aux_num_digits); } catch(Erange & e) { throw Erange("get_args", string(gettext("Error while parsing --min-digits option: ")) + e.get_message()); } } break; case '=': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext("Missing argument to --backup-hook-execute"), char(lu))); line_tools_split_at_first_space(optarg, tmp_string, tmp_string2); tmp_string = line_tools_get_full_path_from_PATH(rec.dar_duc_path, tmp_string.c_str()) + " " + tmp_string2; if(p.backup_hook_execute == "") p.backup_hook_execute = tmp_string; else p.backup_hook_execute += string(" ; ") + tmp_string; break; case '>': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = false; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = false; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.backup_hook_include_exclude.push_back(tmp_pre_mask); break; case '<': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); tmp_pre_mask.file_listing = false; tmp_pre_mask.case_sensit = rec.case_sensit; tmp_pre_mask.included = true; tmp_pre_mask.mask = string(optarg); tmp_pre_mask.glob_exp = rec.glob_mode; rec.backup_hook_include_exclude.push_back(tmp_pre_mask); break; case '4': if(optarg == nullptr) throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); p.scope = string_to_fsa(optarg); if(p.info_details) { string list; set::iterator it = p.scope.begin(); while(it != p.scope.end()) { list += " "; list += fsa_family_to_string(*it); ++it; } rec.dialog->warning(string("FSA family in scope:") + list); } break; case '5': p.exclude_by_ea = true; if(optarg != nullptr) p.ea_name_for_exclusion = optarg; else p.ea_name_for_exclusion = ""; break; case '7': if(optarg != nullptr) { if(strlen(optarg) != 0) p.signatories = line_tools_split(optarg, ','); else throw Erange("get_args", tools_printf(gettext(INVALID_ARG), char(lu))); } else throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(lu))); break; case ':': throw Erange("get_args", tools_printf(gettext(MISSING_ARG), char(optopt))); case '?': rec.dialog->warning(tools_printf(gettext("Ignoring unknown option -%c"),char(optopt))); break; default: rec.dialog->warning(tools_printf(gettext("Ignoring unknown option -%c"),char(lu))); } } return true; } static void usage(shell_interaction & dialog, const char *command_name) { string name; tools_extract_basename(command_name, name); dialog.change_non_interactive_output(&cout); dialog.printf(gettext("usage: %s [ -c | -x | -d | -t | -l | -C | -+ ] [/] [options...]\n"), name.c_str()); dialog.printf(" %s -h\n", name.c_str()); dialog.printf(" %s -V\n", name.c_str()); dialog.printf(gettext("\n")); dialog.printf(gettext("Commands are:\n")); dialog.printf(gettext(" -c creates an archive\n")); dialog.printf(gettext(" -x extracts files from the archive\n")); dialog.printf(gettext(" -d compares the archive with the existing filesystem\n")); dialog.printf(gettext(" -t tests the archive integrity\n")); dialog.printf(gettext(" -l lists the contents of the archive\n")); dialog.printf(gettext(" -C isolates the catalogue from an archive\n")); dialog.printf(gettext(" -+ merge two archives / create a sub archive\n")); dialog.printf(gettext("\n")); dialog.printf(gettext(" -h displays this help information\n")); dialog.printf(gettext(" -V displays version information\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("Common options:\n")); dialog.printf(gettext(" -v\t\t verbose output\n")); dialog.printf(gettext(" -q\t\t suppress final statistics report\n")); dialog.printf(gettext(" -vs\t\t display skipped files\n")); dialog.printf(gettext(" -R \t filesystem root directory (current dir by default)\n")); dialog.printf(gettext(" -X \t files to exclude from the operation (none by default)\n")); dialog.printf(gettext(" -I \t files to include in the operation (all by default)\n")); dialog.printf(gettext(" -P \t subdirectory to exclude from the operation\n")); dialog.printf(gettext(" -g \t subdirectory to include in the operation\n")); dialog.printf(gettext(" -[ filename contains a list of files to include\n")); dialog.printf(gettext(" -] \t filename contains a list of files to exclude\n")); dialog.printf(gettext(" -n\t\t don't overwrite files\n")); dialog.printf(gettext(" -w\t\t don't warn before overwriting files\n")); dialog.printf(gettext(" -wa\t\t don't warn before overwriting and removing files\n")); dialog.printf(gettext(" -b\t\t ring the terminal bell when user action is required\n")); dialog.printf(gettext(" -O[ignore-owner | mtime | inode-type] do not consider user and group\n")); dialog.printf(gettext("\t\t ownership\n")); dialog.printf(gettext(" -H [N]\t ignore shift in dates of an exact number of hours\n")); dialog.printf(gettext(" -E \t command to execute between slices\n")); dialog.printf(gettext(" -F \t same as -E but for the archive of reference\n")); dialog.printf(gettext(" -u \t mask to ignore certain EA\n")); dialog.printf(gettext(" -U \t mask to allow certain EA\n")); dialog.printf(gettext(" -K \t use as key to encrypt/decrypt\n")); dialog.printf(gettext(" -J \t same as -K but it does concern the archive of reference\n")); dialog.printf(gettext(" -# encryption block size\n")); dialog.printf(gettext(" -* same as -# but for archive of reference\n")); dialog.printf(gettext(" -B read options from given file\n")); dialog.printf(gettext(" -N\t\t do not read ~/.darrc nor /etc/darrc configuration file\n")); dialog.printf(gettext(" -e\t\t dry run, fake execution, nothing is produced\n")); dialog.printf(gettext(" -Q\t\t suppress the initial warning when not launched from a tty\n")); dialog.printf(gettext(" -aa\t\t do not try to preserve atime of file open for reading.\n")); dialog.printf(gettext(" -ac\t\t do not try to preserve ctime (default behavior).\n")); dialog.printf(gettext(" -am\t\t set ordered mode for all filters\n")); dialog.printf(gettext(" -an\t\t the masks that follow are now case insensitive\n")); dialog.printf(gettext(" -acase\t the masks that follow are now case sensitive\n")); dialog.printf(gettext(" -ar\t\t set the following masks to be regex expressions\n")); dialog.printf(gettext(" -ag\t\t set the following masks to be glob expressions\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("Saving / Isolation / merging options (to use with -c, -C or -+):\n")); dialog.printf(gettext(" -A [path/] archive to take as reference\n")); dialog.printf(gettext(" -@ [path/] auxiliary archive of reference for merging\n")); dialog.printf(gettext(" -$ \t encryption key for auxiliary archive\n")); dialog.printf(gettext(" -~ \t command between slices of the auxiliary archive\n")); dialog.printf(gettext(" -z [[algo:]level]\t compress data in archive. -z = -z9 = -zgzip:9\n")); dialog.printf(gettext(" Available algo: gzip,bzip2,lzo,xz. Exemples: -zlzo -zxz:5 -z1 -z\n")); dialog.printf(gettext(" -s split the archive in several files of size \n")); dialog.printf(gettext(" -S first file size (if different from following ones)\n")); dialog.printf(gettext(" -aSI \t slice size suffixes k, M, T, G, etc. are power of 10\n")); dialog.printf(gettext(" -abinary\t slice size suffixes k, M, T, G, etc. are power of 2\n")); dialog.printf(gettext(" -p\t\t pauses before writing to a new file\n")); dialog.printf(gettext(" -D\t\t excluded directories are stored as empty directories\n")); dialog.printf(gettext(" -Z \t do not compress the matching filenames\n")); dialog.printf(gettext(" -Y \t do only compress the matching filenames\n")); dialog.printf(gettext(" -m \t do not compress file smaller than \n")); dialog.printf(gettext(" --nodump\t do not backup, files having the nodump 'd' flag set\n")); dialog.printf(gettext(" -@ [path/] Do on-fly catalogue isolation of the resulting archive\n")); dialog.printf(gettext(" -M\t\t stay in the same filesystem while scanning directories\n")); dialog.printf(gettext(" -,\t\t ignore directories that follow the Directory Tagging\n")); dialog.printf(gettext("\t\t Standard\n")); dialog.printf(gettext(" -/ \t which way dar can overwrite files at archive merging or\n")); dialog.printf(gettext("\t\t extraction time\n")); dialog.printf(gettext(" -^ \t permission[:user[:group]] of created slices\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("Restoring options (to use with -x) :\n")); dialog.printf(gettext(" -k\t\t do not remove files destroyed since the reference backup\n")); dialog.printf(gettext(" -r\t\t do not restore file older than those on filesystem\n")); dialog.printf(gettext(" -f\t\t do not restore directory structure\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("Reading options (to use with -x, -d, -t, -l, -A)\n")); dialog.printf(gettext(" -i pipe to use instead of std input to read data from dar_slave\n")); dialog.printf(gettext(" -o pipe to use instead of std output to orders dar_slave\n")); dialog.printf(gettext("\n")); dialog.printf(gettext("Listing options (to use with -l):\n")); dialog.printf(gettext(" -T\t\t tree output format\n")); dialog.printf(gettext(" -as\t\t only list files saved in the archive\n")); dialog.printf(gettext("\n\n")); dialog.printf(gettext("Type \"man dar\" for more details and for all other available options.\n")); } static void show_warranty(shell_interaction & dialog) { dialog.change_non_interactive_output(&cout); dialog.printf(" NO WARRANTY\n"); dialog.printf("\n"); dialog.printf(" 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"); dialog.printf("FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n"); dialog.printf("OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"); dialog.printf("PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"); dialog.printf("OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"); dialog.printf("MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n"); dialog.printf("TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n"); dialog.printf("PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"); dialog.printf("REPAIR OR CORRECTION.\n"); dialog.printf("\n"); dialog.printf(" 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"); dialog.printf("WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"); dialog.printf("REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"); dialog.printf("INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"); dialog.printf("OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"); dialog.printf("TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"); dialog.printf("YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"); dialog.printf("PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"); dialog.printf("POSSIBILITY OF SUCH DAMAGES.\n"); dialog.printf("\n"); } static void show_license(shell_interaction & dialog) { dialog.change_non_interactive_output(&cout); dialog.printf(" GNU GENERAL PUBLIC LICENSE\n"); dialog.printf(" Version 2, June 1991\n"); dialog.printf("\n"); dialog.printf(" Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n"); dialog.printf(" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"); dialog.printf(" Everyone is permitted to copy and distribute verbatim copies\n"); dialog.printf(" of this license document, but changing it is not allowed.\n"); dialog.printf("\n"); dialog.printf(" Preamble\n"); dialog.printf("\n"); dialog.printf(" The licenses for most software are designed to take away your\n"); dialog.printf("freedom to share and change it. By contrast, the GNU General Public\n"); dialog.printf("License is intended to guarantee your freedom to share and change free\n"); dialog.printf("software--to make sure the software is free for all its users. This\n"); dialog.printf("General Public License applies to most of the Free Software\n"); dialog.printf("Foundation's software and to any other program whose authors commit to\n"); dialog.printf("using it. (Some other Free Software Foundation software is covered by\n"); dialog.printf("the GNU Library General Public License instead.) You can apply it to\n"); dialog.printf("your programs, too.\n"); dialog.printf("\n"); dialog.printf(" When we speak of free software, we are referring to freedom, not\n"); dialog.printf("price. Our General Public Licenses are designed to make sure that you\n"); dialog.printf("have the freedom to distribute copies of free software (and charge for\n"); dialog.printf("this service if you wish), that you receive source code or can get it\n"); dialog.printf("if you want it, that you can change the software or use pieces of it\n"); dialog.printf("in new free programs; and that you know you can do these things.\n"); dialog.printf("\n"); dialog.printf(" To protect your rights, we need to make restrictions that forbid\n"); dialog.printf("anyone to deny you these rights or to ask you to surrender the rights.\n"); dialog.printf("These restrictions translate to certain responsibilities for you if you\n"); dialog.printf("distribute copies of the software, or if you modify it.\n"); dialog.printf("\n"); dialog.printf(" For example, if you distribute copies of such a program, whether\n"); dialog.printf("gratis or for a fee, you must give the recipients all the rights that\n"); dialog.printf("you have. You must make sure that they, too, receive or can get the\n"); dialog.printf("source code. And you must show them these terms so they know their\n"); dialog.printf("rights.\n"); dialog.printf("\n"); dialog.printf(" We protect your rights with two steps: (1) copyright the software, and\n"); dialog.printf("(2) offer you this license which gives you legal permission to copy,\n"); dialog.printf("distribute and/or modify the software.\n"); dialog.printf("\n"); dialog.printf(" Also, for each author's protection and ours, we want to make certain\n"); dialog.printf("that everyone understands that there is no warranty for this free\n"); dialog.printf("software. If the software is modified by someone else and passed on, we\n"); dialog.printf("want its recipients to know that what they have is not the original, so\n"); dialog.printf("that any problems introduced by others will not reflect on the original\n"); dialog.printf("authors' reputations.\n"); dialog.printf("\n"); dialog.printf(" Finally, any free program is threatened constantly by software\n"); dialog.printf("patents. We wish to avoid the danger that redistributors of a free\n"); dialog.printf("program will individually obtain patent licenses, in effect making the\n"); dialog.printf("program proprietary. To prevent this, we have made it clear that any\n"); dialog.printf("patent must be licensed for everyone's free use or not licensed at all.\n"); dialog.printf("\n"); dialog.printf(" The precise terms and conditions for copying, distribution and\n"); dialog.printf("modification follow.\n"); dialog.printf(" \n"); dialog.printf(" GNU GENERAL PUBLIC LICENSE\n"); dialog.printf(" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"); dialog.printf("\n"); dialog.printf(" 0. This License applies to any program or other work which contains\n"); dialog.printf("a notice placed by the copyright holder saying it may be distributed\n"); dialog.printf("under the terms of this General Public License. The \"Program\", below,\n"); dialog.printf("refers to any such program or work, and a \"work based on the Program\"\n"); dialog.printf("means either the Program or any derivative work under copyright law:\n"); dialog.printf("that is to say, a work containing the Program or a portion of it,\n"); dialog.printf("either verbatim or with modifications and/or translated into another\n"); dialog.printf("language. (Hereinafter, translation is included without limitation in\n"); dialog.printf("the term \"modification\".) Each licensee is addressed as \"you\".\n"); dialog.printf("\n"); dialog.printf("Activities other than copying, distribution and modification are not\n"); dialog.printf("covered by this License; they are outside its scope. The act of\n"); dialog.printf("running the Program is not restricted, and the output from the Program\n"); dialog.printf("is covered only if its contents constitute a work based on the\n"); dialog.printf("Program (independent of having been made by running the Program).\n"); dialog.printf("Whether that is true depends on what the Program does.\n"); dialog.printf("\n"); dialog.printf(" 1. You may copy and distribute verbatim copies of the Program's\n"); dialog.printf("source code as you receive it, in any medium, provided that you\n"); dialog.printf("conspicuously and appropriately publish on each copy an appropriate\n"); dialog.printf("copyright notice and disclaimer of warranty; keep intact all the\n"); dialog.printf("notices that refer to this License and to the absence of any warranty;\n"); dialog.printf("and give any other recipients of the Program a copy of this License\n"); dialog.printf("along with the Program.\n"); dialog.printf("\n"); dialog.printf("You may charge a fee for the physical act of transferring a copy, and\n"); dialog.printf("you may at your option offer warranty protection in exchange for a fee.\n"); dialog.printf("\n"); dialog.printf(" 2. You may modify your copy or copies of the Program or any portion\n"); dialog.printf("of it, thus forming a work based on the Program, and copy and\n"); dialog.printf("distribute such modifications or work under the terms of Section 1\n"); dialog.printf("above, provided that you also meet all of these conditions:\n"); dialog.printf("\n"); dialog.printf(" a) You must cause the modified files to carry prominent notices\n"); dialog.printf(" stating that you changed the files and the date of any change.\n"); dialog.printf("\n"); dialog.printf(" b) You must cause any work that you distribute or publish, that in\n"); dialog.printf(" whole or in part contains or is derived from the Program or any\n"); dialog.printf(" part thereof, to be licensed as a whole at no charge to all third\n"); dialog.printf(" parties under the terms of this License.\n"); dialog.printf("\n"); dialog.printf(" c) If the modified program normally reads commands interactively\n"); dialog.printf(" when run, you must cause it, when started running for such\n"); dialog.printf(" interactive use in the most ordinary way, to print or display an\n"); dialog.printf(" announcement including an appropriate copyright notice and a\n"); dialog.printf(" notice that there is no warranty (or else, saying that you provide\n"); dialog.printf(" a warranty) and that users may redistribute the program under\n"); dialog.printf(" these conditions, and telling the user how to view a copy of this\n"); dialog.printf(" License. (Exception: if the Program itself is interactive but\n"); dialog.printf(" does not normally print such an announcement, your work based on\n"); dialog.printf(" the Program is not required to print an announcement.)\n"); dialog.printf(" \n"); dialog.printf("These requirements apply to the modified work as a whole. If\n"); dialog.printf("identifiable sections of that work are not derived from the Program,\n"); dialog.printf("and can be reasonably considered independent and separate works in\n"); dialog.printf("themselves, then this License, and its terms, do not apply to those\n"); dialog.printf("sections when you distribute them as separate works. But when you\n"); dialog.printf("distribute the same sections as part of a whole which is a work based\n"); dialog.printf("on the Program, the distribution of the whole must be on the terms of\n"); dialog.printf("this License, whose permissions for other licensees extend to the\n"); dialog.printf("entire whole, and thus to each and every part regardless of who wrote it.\n"); dialog.printf("\n"); dialog.printf("Thus, it is not the intent of this section to claim rights or contest\n"); dialog.printf("your rights to work written entirely by you; rather, the intent is to\n"); dialog.printf("exercise the right to control the distribution of derivative or\n"); dialog.printf("collective works based on the Program.\n"); dialog.printf("\n"); dialog.printf("In addition, mere aggregation of another work not based on the Program\n"); dialog.printf("with the Program (or with a work based on the Program) on a volume of\n"); dialog.printf("a storage or distribution medium does not bring the other work under\n"); dialog.printf("the scope of this License.\n"); dialog.printf("\n"); dialog.printf(" 3. You may copy and distribute the Program (or a work based on it,\n"); dialog.printf("under Section 2) in object code or executable form under the terms of\n"); dialog.printf("Sections 1 and 2 above provided that you also do one of the following:\n"); dialog.printf("\n"); dialog.printf(" a) Accompany it with the complete corresponding machine-readable\n"); dialog.printf(" source code, which must be distributed under the terms of Sections\n"); dialog.printf(" 1 and 2 above on a medium customarily used for software interchange; or,\n"); dialog.printf("\n"); dialog.printf(" b) Accompany it with a written offer, valid for at least three\n"); dialog.printf(" years, to give any third party, for a charge no more than your\n"); dialog.printf(" cost of physically performing source distribution, a complete\n"); dialog.printf(" machine-readable copy of the corresponding source code, to be\n"); dialog.printf(" distributed under the terms of Sections 1 and 2 above on a medium\n"); dialog.printf(" customarily used for software interchange; or,\n"); dialog.printf("\n"); dialog.printf(" c) Accompany it with the information you received as to the offer\n"); dialog.printf(" to distribute corresponding source code. (This alternative is\n"); dialog.printf(" allowed only for noncommercial distribution and only if you\n"); dialog.printf(" received the program in object code or executable form with such\n"); dialog.printf(" an offer, in accord with Subsection b above.)\n"); dialog.printf("\n"); dialog.printf("The source code for a work means the preferred form of the work for\n"); dialog.printf("making modifications to it. For an executable work, complete source\n"); dialog.printf("code means all the source code for all modules it contains, plus any\n"); dialog.printf("associated interface definition files, plus the scripts used to\n"); dialog.printf("control compilation and installation of the executable. However, as a\n"); dialog.printf("special exception, the source code distributed need not include\n"); dialog.printf("anything that is normally distributed (in either source or binary\n"); dialog.printf("form) with the major components (compiler, kernel, and so on) of the\n"); dialog.printf("operating system on which the executable runs, unless that component\n"); dialog.printf("itself accompanies the executable.\n"); dialog.printf("\n"); dialog.printf("If distribution of executable or object code is made by offering\n"); dialog.printf("access to copy from a designated place, then offering equivalent\n"); dialog.printf("access to copy the source code from the same place counts as\n"); dialog.printf("distribution of the source code, even though third parties are not\n"); dialog.printf("compelled to copy the source along with the object code.\n"); dialog.printf(" \n"); dialog.printf(" 4. You may not copy, modify, sublicense, or distribute the Program\n"); dialog.printf("except as expressly provided under this License. Any attempt\n"); dialog.printf("otherwise to copy, modify, sublicense or distribute the Program is\n"); dialog.printf("void, and will automatically terminate your rights under this License.\n"); dialog.printf("However, parties who have received copies, or rights, from you under\n"); dialog.printf("this License will not have their licenses terminated so long as such\n"); dialog.printf("parties remain in full compliance.\n"); dialog.printf("\n"); dialog.printf(" 5. You are not required to accept this License, since you have not\n"); dialog.printf("signed it. However, nothing else grants you permission to modify or\n"); dialog.printf("distribute the Program or its derivative works. These actions are\n"); dialog.printf("prohibited by law if you do not accept this License. Therefore, by\n"); dialog.printf("modifying or distributing the Program (or any work based on the\n"); dialog.printf("Program), you indicate your acceptance of this License to do so, and\n"); dialog.printf("all its terms and conditions for copying, distributing or modifying\n"); dialog.printf("the Program or works based on it.\n"); dialog.printf("\n"); dialog.printf(" 6. Each time you redistribute the Program (or any work based on the\n"); dialog.printf("Program), the recipient automatically receives a license from the\n"); dialog.printf("original licensor to copy, distribute or modify the Program subject to\n"); dialog.printf("these terms and conditions. You may not impose any further\n"); dialog.printf("restrictions on the recipients' exercise of the rights granted herein.\n"); dialog.printf("You are not responsible for enforcing compliance by third parties to\n"); dialog.printf("this License.\n"); dialog.printf("\n"); dialog.printf(" 7. If, as a consequence of a court judgment or allegation of patent\n"); dialog.printf("infringement or for any other reason (not limited to patent issues),\n"); dialog.printf("conditions are imposed on you (whether by court order, agreement or\n"); dialog.printf("otherwise) that contradict the conditions of this License, they do not\n"); dialog.printf("excuse you from the conditions of this License. If you cannot\n"); dialog.printf("distribute so as to satisfy simultaneously your obligations under this\n"); dialog.printf("License and any other pertinent obligations, then as a consequence you\n"); dialog.printf("may not distribute the Program at all. For example, if a patent\n"); dialog.printf("license would not permit royalty-free redistribution of the Program by\n"); dialog.printf("all those who receive copies directly or indirectly through you, then\n"); dialog.printf("the only way you could satisfy both it and this License would be to\n"); dialog.printf("refrain entirely from distribution of the Program.\n"); dialog.printf("\n"); dialog.printf("If any portion of this section is held invalid or unenforceable under\n"); dialog.printf("any particular circumstance, the balance of the section is intended to\n"); dialog.printf("apply and the section as a whole is intended to apply in other\n"); dialog.printf("circumstances.\n"); dialog.printf("\n"); dialog.printf("It is not the purpose of this section to induce you to infringe any\n"); dialog.printf("patents or other property right claims or to contest validity of any\n"); dialog.printf("such claims; this section has the sole purpose of protecting the\n"); dialog.printf("integrity of the free software distribution system, which is\n"); dialog.printf("implemented by public license practices. Many people have made\n"); dialog.printf("generous contributions to the wide range of software distributed\n"); dialog.printf("through that system in reliance on consistent application of that\n"); dialog.printf("system; it is up to the author/donor to decide if he or she is willing\n"); dialog.printf("to distribute software through any other system and a licensee cannot\n"); dialog.printf("impose that choice.\n"); dialog.printf("\n"); dialog.printf("This section is intended to make thoroughly clear what is believed to\n"); dialog.printf("be a consequence of the rest of this License.\n"); dialog.printf(" \n"); dialog.printf(" 8. If the distribution and/or use of the Program is restricted in\n"); dialog.printf("certain countries either by patents or by copyrighted interfaces, the\n"); dialog.printf("original copyright holder who places the Program under this License\n"); dialog.printf("may add an explicit geographical distribution limitation excluding\n"); dialog.printf("those countries, so that distribution is permitted only in or among\n"); dialog.printf("countries not thus excluded. In such case, this License incorporates\n"); dialog.printf("the limitation as if written in the body of this License.\n"); dialog.printf("\n"); dialog.printf(" 9. The Free Software Foundation may publish revised and/or new versions\n"); dialog.printf("of the General Public License from time to time. Such new versions will\n"); dialog.printf("be similar in spirit to the present version, but may differ in detail to\n"); dialog.printf("address new problems or concerns.\n"); dialog.printf("\n"); dialog.printf("Each version is given a distinguishing version number. If the Program\n"); dialog.printf("specifies a version number of this License which applies to it and \"any\n"); dialog.printf("later version\", you have the option of following the terms and conditions\n"); dialog.printf("either of that version or of any later version published by the Free\n"); dialog.printf("Software Foundation. If the Program does not specify a version number of\n"); dialog.printf("this License, you may choose any version ever published by the Free Software\n"); dialog.printf("Foundation.\n"); dialog.printf("\n"); dialog.printf(" 10. If you wish to incorporate parts of the Program into other free\n"); dialog.printf("programs whose distribution conditions are different, write to the author\n"); dialog.printf("to ask for permission. For software which is copyrighted by the Free\n"); dialog.printf("Software Foundation, write to the Free Software Foundation; we sometimes\n"); dialog.printf("make exceptions for this. Our decision will be guided by the two goals\n"); dialog.printf("of preserving the free status of all derivatives of our free software and\n"); dialog.printf("of promoting the sharing and reuse of software generally.\n"); dialog.printf("\n"); show_warranty(dialog); dialog.printf(" END OF TERMS AND CONDITIONS\n"); dialog.printf(" \n"); dialog.printf(" How to Apply These Terms to Your New Programs\n"); dialog.printf("\n"); dialog.printf(" If you develop a new program, and you want it to be of the greatest\n"); dialog.printf("possible use to the public, the best way to achieve this is to make it\n"); dialog.printf("free software which everyone can redistribute and change under these terms.\n"); dialog.printf("\n"); dialog.printf(" To do so, attach the following notices to the program. It is safest\n"); dialog.printf("to attach them to the start of each source file to most effectively\n"); dialog.printf("convey the exclusion of warranty; and each file should have at least\n"); dialog.printf("the \"copyright\" line and a pointer to where the full notice is found.\n"); dialog.printf("\n"); dialog.printf(" \n"); dialog.printf(" Copyright (C) \n"); dialog.printf("\n"); dialog.printf(" This program is free software; you can redistribute it and/or modify\n"); dialog.printf(" it under the terms of the GNU General Public License as published by\n"); dialog.printf(" the Free Software Foundation; either version 2 of the License, or\n"); dialog.printf(" (at your option) any later version.\n"); dialog.printf("\n"); dialog.printf(" This program is distributed in the hope that it will be useful,\n"); dialog.printf(" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); dialog.printf(" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); dialog.printf(" GNU General Public License for more details.\n"); dialog.printf("\n"); dialog.printf(" You should have received a copy of the GNU General Public License\n"); dialog.printf(" along with this program; if not, write to the Free Software\n"); dialog.printf(" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"); dialog.printf("\n"); dialog.printf("\n"); dialog.printf("Also add information on how to contact you by electronic and paper mail.\n"); dialog.printf("\n"); dialog.printf("If the program is interactive, make it output a short notice like this\n"); dialog.printf("when it starts in an interactive mode:\n"); dialog.printf("\n"); dialog.printf(" Gnomovision version 69, Copyright (C) year name of author\n"); dialog.printf(" Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n"); dialog.printf(" This is free software, and you are welcome to redistribute it\n"); dialog.printf(" under certain conditions; type `show c' for details.\n"); dialog.printf("\n"); dialog.printf("The hypothetical commands `show w' and `show c' should show the appropriate\n"); dialog.printf("parts of the General Public License. Of course, the commands you use may\n"); dialog.printf("be called something other than `show w' and `show c'; they could even be\n"); dialog.printf("mouse-clicks or menu items--whatever suits your program.\n"); dialog.printf("\n"); dialog.printf("You should also get your employer (if you work as a programmer) or your\n"); dialog.printf("school, if any, to sign a \"copyright disclaimer\" for the program, if\n"); dialog.printf("necessary. Here is a sample; alter the names:\n"); dialog.printf("\n"); dialog.printf(" Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n"); dialog.printf(" `Gnomovision' (which makes passes at compilers) written by James Hacker.\n"); dialog.printf("\n"); dialog.printf(" , 1 April 1989\n"); dialog.printf(" Ty Coon, President of Vice\n"); dialog.printf("\n"); dialog.printf("This General Public License does not permit incorporating your program into\n"); dialog.printf("proprietary programs. If your program is a subroutine library, you may\n"); dialog.printf("consider it more useful to permit linking proprietary applications with the\n"); dialog.printf("library. If this is what you want to do, use the GNU Library General\n"); dialog.printf("Public License instead of this License.\n"); dialog.printf("\n"); } static void show_version(shell_interaction & dialog, const char *command_name) { string name; tools_extract_basename(command_name, name); U_I maj, med, min; get_version(maj, med, min); dialog.change_non_interactive_output(&cout); dialog.warning(tools_printf("\n %s version %s, Copyright (C) 2002-2052 Denis Corbin\n", name.c_str(), ::dar_version()) + " " + dar_suite_command_line_features() + "\n" + (maj > 2 ? tools_printf(gettext(" Using libdar %u.%u.%u built with compilation time options:"), maj, med, min) : tools_printf(gettext(" Using libdar %u.%u built with compilation time options:"), maj, min))); tools_display_features(dialog); dialog.printf("\n"); dialog.warning(tools_printf(gettext(" compiled the %s with %s version %s\n"), __DATE__, CC_NAT, __VERSION__) + tools_printf(gettext(" %s is part of the Disk ARchive suite (Release %s)\n"), name.c_str(), PACKAGE_VERSION) + tools_printf(gettext(" %s comes with ABSOLUTELY NO WARRANTY; for details\n type `%s -W'."), name.c_str(), name.c_str()) + tools_printf(gettext(" This is free software, and you are welcome\n to redistribute it under certain conditions;")) + tools_printf(gettext(" type `%s -L | more'\n for details.\n\n"), name.c_str())); } #if HAVE_GETOPT_LONG const struct option *get_long_opt() { static const struct option ret[] = { {"beep", no_argument, nullptr, 'b' }, {"create", required_argument, nullptr, 'c'}, {"diff", required_argument, nullptr, 'd'}, {"help", no_argument, nullptr, 'h'}, {"input", required_argument, nullptr, 'i'}, {"deleted", optional_argument, nullptr, 'k'}, {"no-delete", no_argument, nullptr, 'k'}, // backward compatiblity {"list", required_argument, nullptr, 'l'}, {"no-overwrite", no_argument, nullptr, 'n'}, {"output", required_argument, nullptr, 'o'}, {"pause", optional_argument, nullptr, 'p'}, {"recent", no_argument, nullptr, 'r'}, {"slice", required_argument, nullptr, 's'}, {"test", required_argument, nullptr, 't'}, {"exclude-ea", required_argument, nullptr, 'u'}, {"verbose", optional_argument, nullptr, 'v'}, {"no-warn", optional_argument, nullptr, 'w'}, {"extract", required_argument, nullptr, 'x'}, {"gzip", optional_argument, nullptr, 'z'}, // backward compatibility {"compression", required_argument, nullptr, 'z'}, {"ref", required_argument, nullptr, 'A'}, {"isolate", required_argument, nullptr, 'C'}, {"empty-dir", no_argument, nullptr, 'D'}, {"include", required_argument, nullptr, 'I'}, {"prune", required_argument, nullptr, 'P'}, {"fs-root", required_argument, nullptr, 'R'}, {"first-slice", required_argument, nullptr, 'S'}, {"include-ea", required_argument, nullptr, 'U'}, {"version", no_argument, nullptr, 'V'}, {"exclude", required_argument, nullptr, 'X'}, {"ignore-owner", no_argument, nullptr, 'O'}, {"comparison-field", optional_argument, nullptr, 'O'}, {"tree-format", no_argument, nullptr, 'T'}, {"list-format", required_argument, nullptr, 'T'}, {"execute", required_argument, nullptr, 'E'}, {"execute-ref",required_argument, nullptr, 'F'}, {"ref-execute",required_argument, nullptr, 'F'}, {"key", required_argument, nullptr, 'K'}, {"key-ref", required_argument, nullptr, 'J'}, {"ref-key", required_argument, nullptr, 'J'}, {"include-compression", required_argument, nullptr, 'Y'}, {"exclude-compression", required_argument, nullptr, 'Z'}, {"batch", required_argument, nullptr, 'B'}, {"flat", no_argument, nullptr, 'f'}, {"mincompr", required_argument, nullptr, 'm'}, {"noconf", no_argument, nullptr, 'N'}, {"nodump", no_argument, nullptr, ' '}, {"hour", optional_argument, nullptr, 'H'}, {"alter", optional_argument, nullptr, 'a'}, {"empty", no_argument, nullptr, 'e'}, {"dry-run", no_argument, nullptr, 'e'}, {"on-fly-isolate", required_argument, nullptr, '@'}, {"no-mount-points", no_argument, nullptr, 'M'}, {"go-into", required_argument, nullptr, 'g'}, {"crypto-block", required_argument, nullptr, '#'}, {"ref-crypto-block", required_argument, nullptr, '*'}, {"crypto-block-ref", required_argument, nullptr, '*'}, {"cache-directory-tagging", no_argument, nullptr, ','}, {"include-from-file", required_argument, nullptr, '['}, {"exclude-from-file", required_argument, nullptr, ']'}, {"merge", required_argument, nullptr, '+'}, {"aux", required_argument, nullptr, '@'}, {"aux-ref", required_argument, nullptr, '@'}, {"aux-key", required_argument, nullptr, '$'}, {"aux-execute", required_argument, nullptr, '~'}, {"aux-crypto-block", required_argument, nullptr, '%'}, {"quiet", no_argument, nullptr, 'q'}, {"overwriting-policy", required_argument, nullptr, '/' }, {"slice-mode", required_argument, nullptr, '^' }, {"retry-on-change", required_argument, nullptr, '_' }, {"pipe-fd", required_argument, nullptr, '"' }, {"sequential-read", no_argument, nullptr, '0'}, {"sparse-file-min-size", required_argument, nullptr, '1'}, {"dirty-behavior", required_argument, nullptr, '2'}, {"user-comment", required_argument, nullptr, '.'}, {"hash", required_argument, nullptr, '3'}, {"min-digits", required_argument, nullptr, '9'}, {"backup-hook-include", required_argument, nullptr, '<'}, {"backup-hook-exclude", required_argument, nullptr, '>'}, {"backup-hook-execute", required_argument, nullptr, '='}, {"fsa-scope", required_argument, nullptr, '4'}, {"exclude-by-ea", optional_argument, nullptr, '5'}, {"sign", required_argument, nullptr, '7'}, {"single-thread", no_argument, nullptr, 'G'}, { nullptr, 0, nullptr, 0 } }; return ret; } #endif static void make_args_from_file(user_interaction & dialog, operation op, const vector & targets, const string & filename, S_I & argc, char **&argv, vector & read_targets, bool info_details) { vector cibles; vector locally_unread_targets; argv = nullptr; argc = 0; fichier_local conf = fichier_local(filename, false); // the object conf will close fd //////// // removing the comments from file // no_comment sousconf = no_comment(conf); //////// // defining the conditional syntax targets // that will be considered in the file cibles = targets; cibles.push_back("all"); switch(op) { case noop: cibles.push_back("default"); break; case create: cibles.push_back("create"); break; case extract: cibles.push_back("extract"); break; case diff: cibles.push_back("diff"); break; case test: cibles.push_back("test"); break; case listing: cibles.push_back("listing"); cibles.push_back("list"); break; case merging: cibles.push_back("merge"); break; case isolate: cibles.push_back("isolate"); break; default: throw SRC_BUG; } ////// // hide the targets we don't want to see // config_file surconf = config_file(cibles, sousconf); ////// // now we have surconf -> sousconf -> conf -> fd // which makes the job to remove comments // and hide unwanted conditional statements on the fly // surconf can be used as a normal file. // const char *command = "dar"; char *pseudo_command = nullptr; try { vector mots; // now parsing the file and cutting words // taking care of quotes // mots = tools_split_in_words(surconf); // now converting the mots of type vector to argc/argv arguments // argc = mots.size()+1; if(argc < 0) throw SRC_BUG; // integer overflow occurred argv = new (nothrow) char *[argc]; if(argv == nullptr) throw Ememory("make_args_from_file"); for(S_I i = 0; i < argc; ++i) argv[i] = nullptr; // adding a fake "dar" word as first argument (= argv[0]) // char *pseudo_command = new (nothrow) char[strlen(command)+1]; if(pseudo_command == nullptr) throw Ememory("make_args_from_file"); strncpy(pseudo_command, command, strlen(command)); pseudo_command[strlen(command)] = '\0'; argv[0] = pseudo_command; pseudo_command = nullptr; if(info_details) dialog.printf(gettext("Arguments read from %S :"), &filename); for(U_I i = 0; i < mots.size(); ++i) { argv[i+1] = tools_str2charptr(mots[i]); // mots[i] goes to argv[i+1] ! if(info_details) dialog.printf(" \"%s\"", argv[i+1]); } if(info_details) dialog.printf("\n"); } catch(...) { if(argv != nullptr) { for(S_I i = 0; i < argc; ++i) if(argv[i] != nullptr) delete[] argv[i]; delete[] argv; argv = nullptr; } argc = 0; if(pseudo_command != nullptr) { delete[] pseudo_command; pseudo_command = nullptr; } throw; } tools_merge_to_vector(read_targets, surconf.get_read_targets()); } static void destroy(S_I argc, char **argv) { S_I i = 0; for(i = 0; i < argc; ++i) delete [] argv[i]; delete [] argv; } static void skip_getopt(S_I argc, char * const argv[], S_I next_to_read) { (void)line_tools_reset_getopt(); #if HAVE_GETOPT_LONG while(getopt_long(argc, argv, OPT_STRING, get_long_opt(), nullptr) != EOF && optind < next_to_read) ; #else while(getopt(argc, argv, OPT_STRING) != EOF && optind < next_to_read) ; #endif } #ifdef DEBOGGAGE static void show_args(S_I argc, char *argv[]) { S_I i; for(i = 0; i < argc; ++i) dialog.printf("[%s]\n", argv[i]); } #endif static bool update_with_config_files(recursive_param & rec, line_param & p) { string buffer; enum { syntax, ok, unknown } retour = unknown; S_I rec_c = 0; char **rec_v = nullptr; (void)line_tools_reset_getopt(); // trying to open $HOME/.darrc buffer = string(rec.home) + "/.darrc"; try { make_args_from_file(*rec.dialog, p.op, rec.non_options, buffer, rec_c, rec_v, rec.read_targets, p.info_details); try { try { if(! get_args_recursive(rec, p, rec_c, rec_v)) retour = syntax; else retour = ok; } catch(Erange & e) { Erange more = Erange(e.get_source(), tools_printf(gettext("In included file %S: "), &buffer) + e.get_message()); throw more; } } catch(...) { if(rec_v != nullptr) { destroy(rec_c, rec_v); rec_v = nullptr; rec_c = 0; } throw; } if(rec_v != nullptr) { destroy(rec_c, rec_v); rec_v = nullptr; rec_c = 0; } } catch(Esystem & e) { switch(e.get_code()) { case Esystem::io_absent: // failed openning the file, // nothing to do, // we will try the other config file // below break; case Esystem::io_exist: throw SRC_BUG; default: throw SRC_BUG; } } catch(Erange & e) { if(e.get_source() != "make_args_from_file") throw; } rec_c = 0; rec_v = nullptr; if(retour == unknown) { // trying to open DAR_SYS_DIR/darrc buffer = string(DAR_SYS_DIR) + "/darrc"; try { make_args_from_file(*rec.dialog, p.op, rec.non_options, buffer, rec_c, rec_v, rec.read_targets, p.info_details); try { (void)line_tools_reset_getopt(); // reset getopt call try { if(! get_args_recursive(rec, p, rec_c, rec_v)) retour = syntax; else retour = ok; } catch(Erange & e) { Erange more = Erange(e.get_source(), tools_printf(gettext("In included file %S: "), &buffer) + e.get_message()); throw more; } } catch(...) { if(rec_v != nullptr) { destroy(rec_c, rec_v); rec_v = nullptr; rec_c = 0; } throw; } if(rec_v != nullptr) { destroy(rec_c, rec_v); rec_v = nullptr; rec_c = 0; } } catch(Esystem & e) { switch(e.get_code()) { case Esystem::io_absent: // failed openning the file, // nothing to do, break; case Esystem::io_exist: throw SRC_BUG; default: throw SRC_BUG; } } catch(Erange & e) { if(e.get_source() != "make_args_from_file") throw; } } return retour != syntax; } static mask *make_include_exclude_name(const string & x, mask_opt opt) { mask *ret = nullptr; if(opt.glob_exp) ret = new (nothrow) simple_mask(x, opt.case_sensit); else ret = new (nothrow) regular_mask(x, opt.case_sensit); if(ret == nullptr) throw Ememory("make_include_exclude_name"); else return ret; } static mask *make_exclude_path_ordered(const string & x, mask_opt opt) { mask *ret = nullptr; if(opt.file_listing) { ret = new (nothrow) mask_list(x, opt.case_sensit, opt.prefix, false); if(ret == nullptr) throw Ememory("make_exclude_path"); } else // not file listing mask { if(opt.glob_exp) { ou_mask *val = new (nothrow) ou_mask(); if(val == nullptr) throw Ememory("make_exclude_path"); val->add_mask(simple_mask((opt.prefix + x).display(), opt.case_sensit)); val->add_mask(simple_mask((opt.prefix + x).display() + "/*", opt.case_sensit)); ret = val; } else // regex { ret = new (nothrow) regular_mask(tools_build_regex_for_exclude_mask(opt.prefix.display(), x), opt.case_sensit); if(ret == nullptr) throw Ememory("make_exclude_path"); } } return ret; } static mask *make_exclude_path_unordered(const string & x, mask_opt opt) { mask *ret = nullptr; if(opt.file_listing) ret = new (nothrow) mask_list(x, opt.case_sensit, opt.prefix, false); else if(opt.glob_exp) ret = new (nothrow) simple_mask((opt.prefix + x).display(), opt.case_sensit); else ret = new (nothrow) regular_mask(tools_build_regex_for_exclude_mask(opt.prefix.display(), x), opt.case_sensit); if(ret == nullptr) throw Ememory("make_exclude_path"); return ret; } static mask *make_include_path(const string & x, mask_opt opt) { mask *ret = nullptr; if(opt.file_listing) ret = new (nothrow) mask_list(x, opt.case_sensit, opt.prefix, true); else ret = new (nothrow) simple_path_mask(opt.prefix +x, opt.case_sensit); if(ret == nullptr) throw Ememory("make_include_path"); return ret; } static mask *make_ordered_mask(deque & listing, mask *(*make_include_mask) (const string & x, mask_opt opt), mask *(*make_exclude_mask)(const string & x, mask_opt opt), const path & prefix) { mask *ret_mask = nullptr; ou_mask *tmp_ou_mask = nullptr; et_mask *tmp_et_mask = nullptr; mask *tmp_mask = nullptr; mask_opt opt = prefix; try { while(!listing.empty()) { opt.read_from(listing.front()); if(listing.front().included) if(ret_mask == nullptr) // first mask { ret_mask = (*make_include_mask)(listing.front().mask, opt); if(ret_mask == nullptr) throw Ememory("make_ordered_mask"); } else // ret_mask != nullptr (need to chain to existing masks) { if(tmp_ou_mask != nullptr) { tmp_mask = (*make_include_mask)(listing.front().mask, opt); tmp_ou_mask->add_mask(*tmp_mask); delete tmp_mask; tmp_mask = nullptr; } else // need to create ou_mask { tmp_mask = (*make_include_mask)(listing.front().mask, opt); tmp_ou_mask = new (nothrow) ou_mask(); if(tmp_ou_mask == nullptr) throw Ememory("make_ordered_mask"); tmp_ou_mask->add_mask(*ret_mask); tmp_ou_mask->add_mask(*tmp_mask); delete tmp_mask; tmp_mask = nullptr; delete ret_mask; ret_mask = tmp_ou_mask; tmp_et_mask = nullptr; } } else // exclude mask if(ret_mask == nullptr) { tmp_mask = (*make_exclude_mask)(listing.front().mask, opt); ret_mask = new (nothrow) not_mask(*tmp_mask); if(ret_mask == nullptr) throw Ememory("make_ordered_mask"); delete tmp_mask; tmp_mask = nullptr; } else // ret_mask != nullptr { if(tmp_et_mask != nullptr) { tmp_mask = (*make_exclude_mask)(listing.front().mask, opt); tmp_et_mask->add_mask(not_mask(*tmp_mask)); delete tmp_mask; tmp_mask = nullptr; } else // need to create et_mask { tmp_mask = (*make_exclude_mask)(listing.front().mask, opt); tmp_et_mask = new (nothrow) et_mask(); if(tmp_et_mask == nullptr) throw Ememory("make_ordered_mask"); tmp_et_mask->add_mask(*ret_mask); tmp_et_mask->add_mask(not_mask(*tmp_mask)); delete tmp_mask; tmp_mask = nullptr; delete ret_mask; ret_mask = tmp_et_mask; tmp_ou_mask = nullptr; } } listing.pop_front(); } if(ret_mask == nullptr) { ret_mask = new (nothrow) bool_mask(true); if(ret_mask == nullptr) throw Ememory("get_args"); } } catch(...) { if(ret_mask != nullptr) { delete tmp_mask; tmp_mask = nullptr; } if(tmp_ou_mask != nullptr && tmp_ou_mask != ret_mask) { delete tmp_ou_mask; tmp_ou_mask = nullptr; } if(tmp_et_mask != nullptr && tmp_et_mask != ret_mask) { delete tmp_et_mask; tmp_et_mask = nullptr; } if(tmp_mask != nullptr) { delete tmp_mask; tmp_mask = nullptr; } throw; } return ret_mask; } static mask *make_unordered_mask(deque & listing, mask *(*make_include_mask) (const string & x, mask_opt opt), mask *(*make_exclude_mask)(const string & x, mask_opt opt), const path & prefix) { et_mask *ret_mask = new (nothrow) et_mask(); ou_mask tmp_include, tmp_exclude; mask *tmp_mask = nullptr; mask_opt opt = prefix; if(ret_mask == nullptr) throw Ememory("make_unordered_mask"); try { while(!listing.empty()) { opt.read_from(listing.front()); if(listing.front().included) { tmp_mask = (*make_include_mask)(listing.front().mask, opt); tmp_include.add_mask(*tmp_mask); delete tmp_mask; tmp_mask = nullptr; } else // excluded mask { tmp_mask = (*make_exclude_mask)(listing.front().mask, opt); tmp_exclude.add_mask(*tmp_mask); delete tmp_mask; tmp_mask = nullptr; } listing.pop_front(); } if(tmp_include.size() > 0) ret_mask->add_mask(tmp_include); else ret_mask->add_mask(bool_mask(true)); if(tmp_exclude.size() > 0) ret_mask->add_mask(not_mask(tmp_exclude)); } catch(...) { delete ret_mask; ret_mask = nullptr; throw; } return ret_mask; } static void split_compression_algo(const char *arg, compression & algo, U_I & level) { if(arg == nullptr) throw SRC_BUG; else { string working = arg; string::iterator it = working.begin(); while(it != working.end() && *it != ':') it++; if(it == working.end()) // no ':' found in string { if(!tools_my_atoi(working.c_str(), level)) { // argument to -z is not an integer, testing whether this is an algorithm try { algo = string2compression(working.c_str()); level = 9; // argument is a compression algo, level is 9 by default } catch(Erange & e) { throw Erange("split_compression_algo", tools_printf(gettext("%s does not name a compression \"[algorithm][:][level]\" , like for examples \"gzip\", \"lzo\", \"bzip2\", \"lzo:3\", \"gzip:2\", \"8\" or \"1\". Please review the man page about -z option"), working.c_str())); } } else // argument is a compression level, algorithm is gzip by default algo = gzip; } else // a ':' has been found and "it" points to it { string first_part = string(working.begin(), it); string second_part = string(it+1, working.end()); if(first_part != "") algo = string2compression(first_part); else algo = gzip; // default algorithm if(second_part != "") { if(!tools_my_atoi(second_part.c_str(), level) || level > 9 || level < 1) throw Erange("split_compression_algo", gettext("Compression level must be between 1 and 9, included")); } else level = 9; // default compression level } } } static fsa_scope string_to_fsa(const string & arg) { fsa_scope ret; vector fams = line_tools_split(arg, ','); ret.clear(); if(arg != "none") { for(vector::iterator it = fams.begin(); it != fams.end(); ++it) { if(*it == "extX" || *it == "ext" || *it == "extx") ret.insert(fsaf_linux_extX); else if(*it == "HFS+" || *it == "hfs+") ret.insert(fsaf_hfs_plus); else throw Erange("string_to_fsa", string(gettext("unknown FSA family: ")) + (*it)); } } return ret; } static void add_non_options(S_I argc, char * const argv[], vector & non_options) { (void)line_tools_reset_getopt(); #if HAVE_GETOPT_LONG while(getopt_long(argc, argv, OPT_STRING, get_long_opt(), nullptr) != EOF) ; #else while(getopt(argc, argv, OPT_STRING) != EOF) ; #endif for(S_I i = optind ; i < argc ; ++i) if(strcmp(argv[i],"create") == 0 || strcmp(argv[i], "extract") == 0 || strcmp(argv[i], "listing") == 0 || strcmp(argv[i], "list") == 0 || strcmp(argv[i], "test") == 0 || strcmp(argv[i], "diff") == 0 || strcmp(argv[i], "isolate") == 0 || strcmp(argv[i], "merge") == 0 || strcmp(argv[i], "reference") == 0 || strcmp(argv[i], "auxiliary") == 0 || strcmp(argv[i], "all") == 0 || strcmp(argv[i], "default") == 0) throw Erange("add_non_options", tools_printf(gettext("User target named \"%s\" is not allowed (reserved word for conditional syntax)"), argv[i])); else non_options.push_back(argv[i]); (void)line_tools_reset_getopt(); } dar-2.5.3/src/dar_suite/no_comment.cpp0000644000175000017430000000614712641772777014656 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "no_comment.hpp" #include "infinint.hpp" using namespace libdar; void no_comment::fill_morceau() { partie tmp; infinint last_offset = 0; char a = ' '; enum { st_unknown, st_command, st_comment } status = st_unknown; bool stop = false; bool last_block_is_comment = true; morceau.clear(); if(ref == nullptr) throw SRC_BUG; ref->skip(0); tmp.longueur = 0; while(!stop) { stop = ref->read(&a, 1) != 1; switch(status) { case st_unknown: switch(a) { case ' ': case '\t': ++tmp.longueur; break; case '\n': // cannot treat empty lines as command, because too short to fit in loop/switch tmp.longueur = 0; break; case '#': status = st_comment; break; default: status = st_command; tmp.debut = ref->get_position() - 1; tmp.offset = last_offset; tmp.longueur = 1; } break; case st_comment: if(a == '\n') { status = st_unknown; last_block_is_comment = true; tmp.longueur = 0; } break; case st_command: if(!stop) ++tmp.longueur; if(a == '\n' || stop) { status = st_unknown; if(last_block_is_comment) { morceau.push_back(tmp); last_offset = tmp.offset+tmp.longueur; } else { if(morceau.empty()) throw SRC_BUG; morceau.back().longueur = ref->get_position() - morceau.back().debut; last_offset = morceau.back().offset+morceau.back().longueur; } last_block_is_comment = false; tmp.longueur = 0; } break; default: throw SRC_BUG; } } } dar-2.5.3/src/testing/0000755000175000017520000000000012642474572011553 500000000000000dar-2.5.3/src/testing/test_filesystem.cpp0000644000175000017430000001263312642474445015426 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_STAT_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_SOCKET_H #include #endif #if HAVE_SYS_UN_H #include #endif #if MAJOR_IN_MKDEV #include #if !defined(makedev) && defined(mkdev) #define makedev(a,b) mkdev((a),(b)) #endif #else #if MAJOR_IN_SYSMACROS #include #endif #endif } // end extern "C" #include #include #include "libdar.hpp" #include "filesystem.hpp" #include "user_interaction.hpp" #include "integers.hpp" #include "shell_interaction.hpp" #include "cygwin_adapt.hpp" #include "label.hpp" #include "fichier_local.hpp" #include "tuyau.hpp" static user_interaction *ui = nullptr; static void build(); static void test(); static void del(); static void re_test(); using namespace libdar; static catalogue *cat; int main() { U_I maj, med, min; label data_name; get_version(maj, med, min); user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; cat = new catalogue(*ui, datetime(120), data_name); build(); test(); { re_test(); del(); } delete cat; if(ui != nullptr) delete ui; } static void build() { S_I fd; char phrase[] = "bonjour les amis il fait chaud il fait beau !"; struct sockaddr_un name; name.sun_family = AF_UNIX; strcpy(name.sun_path, "arbo/sub/prise"); mkdir("arbo", 0777); mknod("arbo/dev1", 0777 | S_IFCHR, makedev(20, 30)); mkdir("arbo/sub", 0777); fd = socket(PF_UNIX, SOCK_STREAM, 0); if(fd >= 0) { bind(fd, (const sockaddr *)&name, sizeof(name)); close(fd); } mknod("arbo/sub/tube", 0777 | S_IFIFO, 0); fd = ::open("arbo/sub/fichier", O_WRONLY|O_CREAT|O_BINARY, 0777); if(fd >= 0) { write(fd, phrase, strlen(phrase)); close(fd); } mknod("arbo/dev2", 0777 | S_IFBLK, makedev(20, 30)); symlink("/yoyo/crotte", "arbo/lien"); } static void del() { unlink("arbo/sub/fichier"); unlink("arbo/sub/tube"); unlink("arbo/sub/prise"); rmdir("arbo/sub"); unlink("arbo/dev1"); unlink("arbo/dev2"); unlink("arbo/lien"); rmdir("arbo"); } static void test() { cat_entree *p; infinint root_fs_device; infinint errors, skipped_dump; bool_mask all = true; fsa_scope sc; filesystem_backup fs = filesystem_backup(*ui, path("arbo"), true, bool_mask(true), false, false, false,false, root_fs_device, false, sc); while(fs.read(p, errors, skipped_dump)) { cat_file *f = dynamic_cast(p); cat->add(p); if(f != nullptr) { generic_file *entree = f->get_data(cat_file::normal); try { crc *val = nullptr; infinint crc_size = 1; tuyau sortie = tuyau(*ui, dup(1)); entree->copy_to(sortie, crc_size, val); if(val == nullptr) throw SRC_BUG; try { f->set_crc(*val); } catch(...) { delete val; throw; } delete val; } catch(...) { delete entree; throw; } delete entree; } } cat->listing(false, all, all, false, false, ""); } static void re_test() { try { const cat_entree *e; cat_detruit det1 = cat_detruit("lien", 'l' | 0x80, datetime(129)); cat_detruit det2 = cat_detruit("dev1", 'd', datetime(192)); path where = "algi"; bool_mask all = true; crit_constant_action todo = crit_constant_action(data_preserve, EA_preserve); fsa_scope sc; filesystem_restore fs = filesystem_restore(*ui, where, true, true, all, cat_inode::cf_all, true, false, &todo, false, sc); bool hasbeencreated, ea_restored, hard_link, fsa_restored; libdar::filesystem_restore::action_done_for_data data_restored; cat->reset_read(); while(cat->read(e)) fs.write(e, data_restored, ea_restored, hasbeencreated, hard_link, fsa_restored); fs.reset_write(); fs.write(&det1, data_restored, ea_restored, hasbeencreated, hard_link, fsa_restored); fs.write(&det2, data_restored, ea_restored, hasbeencreated, hard_link, fsa_restored); } catch(Egeneric & e) { cerr << e.dump_str(); } } dar-2.5.3/src/testing/hashsum.c0000644000175000017430000001127112641773000013274 00000000000000#include "../my_config.h" #include #include #include #if CRYPTO_AVAILABLE #ifndef GCRYPT_NO_DEPRECATED #define GCRYPT_NO_DEPRECATED #endif #include #endif #include #include #include #include #define EXIT_OK 0 #define EXIT_SYNTAX 1 #define EXIT_LIBGCRYPT 2 #define EXIT_BUG 3 #define EXIT_SYSTEM 4 #define BUFSIZE 102400 #define MIN_VERSION_GCRYPT "1.4.0" void usage(const char *cmd); #if CRYPTO_AVAILABLE int init_libgcrypt(); int get_hash_algo(const char *algo); int set_hash_handle(int algo, gcry_md_hd_t *hash_handle); void feed_hash_from(int fd, gcry_md_hd_t *hash_handle); void show_hash(int algo, gcry_md_hd_t *hash_handle, const char *filename); void release_hash(gcry_md_hd_t *hash_handle); #endif int main(int argc, char *argv[]) { #if CRYPTO_AVAILABLE int fd = -1; if(argc != 3) { usage(argv[0]); return EXIT_SYNTAX; } if(!init_libgcrypt()) return EXIT_LIBGCRYPT; fd = open(argv[1], O_RDONLY); if(fd < 0) return EXIT_SYSTEM; else { int algo = get_hash_algo(argv[2]); gcry_md_hd_t hash_handle; if(algo != 0) { if(set_hash_handle(algo, &hash_handle)) { feed_hash_from(fd, &hash_handle); close(fd); show_hash(algo, &hash_handle, argv[1]); release_hash(&hash_handle); return EXIT_OK; } else { close(fd); return EXIT_LIBGCRYPT; } } else { close(fd); return EXIT_SYNTAX; } } #else return 0; #endif } void usage(const char *cmd) { printf("usage: %s {sha1|md5}\n", cmd); } #if CRYPTO_AVAILABLE int init_libgcrypt() { if(!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P)) { gcry_error_t err; // no multi-thread support activated for gcrypt // this must be done from the application as stated // by the libgcrypt documentation if(!gcry_check_version(MIN_VERSION_GCRYPT)) { fprintf(stderr, "Too old version for libgcrypt, minimum required version is %s\n", MIN_VERSION_GCRYPT); return 0; } // initializing default sized secured memory for libgcrypt (void)gcry_control(GCRYCTL_INIT_SECMEM, 65536); // if secured memory could not be allocated, further request of secured memory will fail // and a warning will show at that time (we cannot send a warning (just failure notice) at that time). err = gcry_control(GCRYCTL_ENABLE_M_GUARD); if(err != GPG_ERR_NO_ERROR) { fprintf(stderr, "Error while activating libgcrypt's memory guard: %s/%s", gcry_strsource(err), gcry_strerror(err)); return 0; } err = gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); if(err != GPG_ERR_NO_ERROR) { fprintf(stderr, "Error while telling libgcrypt that initialization is finished: %s/%s", gcry_strsource(err), gcry_strerror(err)); return 0; } } else if(!gcry_check_version(MIN_VERSION_GCRYPT)) { fprintf(stderr, "Too old version for libgcrypt, minimum required version is %s\n", MIN_VERSION_GCRYPT); return 0; } return 1; } int get_hash_algo(const char *algo) { if(strcmp("md5", algo) == 0) return GCRY_MD_MD5; else if(strcmp("sha1", algo) == 0) return GCRY_MD_SHA1; else { fprintf(stderr, "Unknown algorithm: %s\n", algo); return 0; } } int set_hash_handle(int algo, gcry_md_hd_t *hash_handle) { gcry_error_t err; err = gcry_md_test_algo(algo); if(err != GPG_ERR_NO_ERROR) { fprintf(stderr, "Error while initializing hash: Hash algorithm not available in libgcrypt: %s/%s", gcry_strsource(err), gcry_strerror(err)); return 0; } err = gcry_md_open(hash_handle, algo, 0); if(err != GPG_ERR_NO_ERROR) { fprintf(stderr, "Error while creating hash handle: %s/%s", gcry_strsource(err), gcry_strerror(err)); return 0; } else return 1; } void feed_hash_from(int fd, gcry_md_hd_t *hash_handle) { char buffer[BUFSIZE]; int lu; do { lu = read(fd, buffer, BUFSIZE); if(lu > 0) gcry_md_write(*hash_handle, (const void *)buffer, lu); } while(lu > 0 || (lu == -1 && (errno == EINTR))); } void show_hash(int algo, gcry_md_hd_t *hash_handle, const char *filename) { const unsigned char *digest = gcry_md_read(*hash_handle, algo); const unsigned int digest_size = gcry_md_get_algo_dlen(algo); unsigned int i; if(digest == NULL) { fprintf(stderr, "Failed to obtain digest from libgcrypt\n"); return; } for(i = 0; i < digest_size; ++i) printf("%02x", digest[i]); printf(" %s\n", filename); } void release_hash(gcry_md_hd_t *hash_handle) { gcry_md_close(*hash_handle); } void convert_to_hexa(const char *digest, const unsigned int digest_size, char *hexa, const unsigned int hexa_size) { } #endif dar-2.5.3/src/testing/test_limitint.cpp0000644000175000017430000001037112641773000015054 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif } // end extern "C" #include #include "integers.hpp" #include "infinint.hpp" #include "deci.hpp" #include "user_interaction.hpp" #include "shell_interaction.hpp" #include "cygwin_adapt.hpp" #include "erreurs.hpp" #include "generic_file.hpp" #include "fichier_local.hpp" static void routine_limitint(user_interaction & dialog); static void routine_real_infinint(user_interaction & dialog); using namespace libdar; user_interaction *ui = nullptr; int main() { user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; try { ui->pause("Esc = generating dump of large real_integer, OK = testing limitint"); routine_limitint(*ui); } catch(Euser_abort & e) { routine_real_infinint(*ui); } if(ui != nullptr) delete ui; } static void routine_real_infinint(user_interaction & dialog) { fichier_local fic = fichier_local(*ui, "toto", gf_read_write, 0666, false, true, false); infinint r1 = 1; r1 <<= 32; r1--; r1.dump(fic); r1++; r1.dump(fic); } static void routine_limitint(user_interaction & dialog) { ///////////////////////////////////////// // testing construction overflow // // fichier_local fic = fichier_local("toto", false); infinint r1 = infinint(fic); infinint r2; r1 = r1+1 ; // avoid warning of unused variable r2.read(fic); U_32 twopower32_1 = ~0; U_32 twopower31 = 1 << 31; infinint a = (U_32)(twopower32_1); infinint b = twopower32_1; try { unsigned long long tmp = twopower32_1; tmp++; infinint c = tmp; c = c+1; // avoid warning of unused variable } catch(Elimitint & e) { dialog.warning(e.get_message()); } try { infinint c = (long long)(twopower32_1+1); c = c+1; // avoid warning of unused variable } catch(Elimitint & e) { dialog.warning(e.get_message()); } ////////////////////////////////////////////// // testing addition overflow // // try { a++; } catch(Elimitint & e) { dialog.warning(e.get_message()); } infinint c = twopower31; infinint d; infinint e = c-1; try { d = c+e; d = c+c; } catch(Elimitint & e) { dialog.warning(e.get_message()); } ////////////////////////////////////////// // testing multiplication overflow // // const unsigned int twopower16 = 65536; a = twopower16 - 1; b = twopower16; c = twopower16 + 1; try { d = a; d *= a; // OK d = a; d *= c; // OK d = b; d *=b; // NOK } catch(Elimitint & e) { dialog.warning(e.get_message()); } // testing left shift overflow a = 1; try { a <<= 31; // OK a <<= 1; // NOK; } catch(Elimitint & e) { dialog.warning(e.get_message()); } } dar-2.5.3/src/testing/test_mask_list.cpp0000644000175000017430000000510712641773000015212 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif } #include #include "libdar.hpp" #include "erreurs.hpp" #include "shell_interaction.hpp" #include "deci.hpp" #include "mask_list.hpp" using namespace libdar; using namespace std; void f1(user_interaction *dialog, const char *filename); int main(int argc, char *argv[]) { user_interaction *dialog = new (nothrow) shell_interaction(&cout, &cerr, false); U_I maj, med, min; get_version(maj, med, min); if(dialog == nullptr) cout << "ERREUR !" << endl; try { if(argc != 2) throw Erange("mask_list", tools_printf("usage: %s \n", argv[0])); f1(dialog, argv[1]); } catch(Egeneric & e) { cout << "exception caught : " + e.get_message() << endl; } catch(...) { cout << "unknown exception caught" << endl; } if(dialog != nullptr) delete dialog; } void f1(user_interaction *dialog, const char *filename) { mask_list m = mask_list(filename, true, "/toto/tutu", true); string tester; U_I count = 10; cout << "taille : " << m.size() << endl; while(--count) { cin >> tester; cout << (m.is_covered(tester) ? string("COVERED") : string("not covered")) << endl; } m = mask_list(filename, false, "/toto/tutu", false); count = 10; while(--count) { cin >> tester; cout << (m.is_covered(tester) ? string("COVERED") : string("not covered")) << endl; } } dar-2.5.3/src/testing/Makefile.am0000644000175000017430000001377712642474445013545 00000000000000localedir = @localedir@ if BUILD_MODE32 MYLIB=dar32 AM_CPPFLAGS=-DLIBDAR_MODE=32 -I../libdar -I../dar_suite -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) else if BUILD_MODE64 MYLIB=dar64 AM_CPPFLAGS=-DLIBDAR_MODE=64 -I../libdar -I../dar_suite -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) else MYLIB=dar AM_CPPFLAGS=-I../libdar -I../dar_suite -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) endif endif if WITH_LIBTHREADAR LIBTHREADAR_TEST_MODULES=test_generic_thread else LIBTHREADAR_TEST_MODULES= endif noinst_PROGRAMS = test_hide_file test_terminateur test_catalogue test_infinint test_tronc test_compressor test_mask test_tuyau test_deci test_path test_erreurs test_sar test_filesystem test_scrambler test_generic_file test_storage test_special_alloc test_limitint test_libdar test_cache test_tronconneuse test_elastic test_blowfish test_mask_list test_escape test_hash_fichier moving_file make_sparse_file hashsum test_crypto_asym test_range $(LIBTHREADAR_TEST_MODULES) #test_rsync has been removed from noinst_PROGRAMS due to a bug in librsync... feature postponed to branch 2.6.x AM_LDFLAGS = -all-static @LTLIBINTL@ LDADD = -L../libdar -l$(MYLIB) $(GPGME_LIBS) noinst_HEADERS = testtools.hpp test_hide_file_SOURCES = test_hide_file.cpp test_hide_file_LDADD = ../dar_suite/no_comment.o ../dar_suite/hide_file.o ../dar_suite/config_file.o ../dar_suite/shell_interaction.o $(LDADD) test_hide_file_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_terminateur_SOURCES = test_terminateur.cpp test_terminateur_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_terminateur_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_catalogue_SOURCES = test_catalogue.cpp test_catalogue_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_catalogue_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_infinint_SOURCES = test_infinint.cpp test_infinint_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_infinint_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_tronc_SOURCES = test_tronc.cpp testtools.cpp test_tronc_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_tronc_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_compressor_SOURCES = test_compressor.cpp test_compressor_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_compressor_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_mask_SOURCES = test_mask.cpp test_mask_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_tuyau_SOURCES = test_tuyau.cpp test_tuyau_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/line_tools.o $(LDADD) test_tuyau_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_deci_SOURCES = test_deci.cpp test_deci_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_path_SOURCES = test_path.cpp test_path_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_erreurs_SOURCES = test_erreurs.cpp testtools.cpp test_erreurs_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_sar_SOURCES = test_sar.cpp testtools.cpp test_sar_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_sar_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_filesystem_SOURCES = test_filesystem.cpp test_filesystem_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_filesystem_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_scrambler_SOURCES = test_scrambler.cpp test_scrambler_LDADD = ../dar_suite/dar_suite.o ../dar_suite/shell_interaction.o ../dar_suite/line_tools.o $(LDADD) test_scrambler_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_generic_file_SOURCES = test_generic_file.cpp test_generic_file_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_generic_file_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_storage_SOURCES = test_storage.cpp test_storage_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_special_alloc_SOURCES = test_special_alloc.cpp test_special_alloc_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_limitint_SOURCES = test_limitint.cpp test_limitint_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_limitint_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_limitint_CXXFLAGS = -Wno-long-long test_libdar_SOURCES = test_libdar.cpp test_libdar_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_libdar_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../libdar/libdar.hpp ../libdar/tools.hpp test_cache_SOURCES = test_cache.cpp test_cache_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_cache_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../libdar/libdar.hpp ../libdar/tools.hpp test_tronconneuse_SOURCES = test_tronconneuse.cpp test_tronconneuse_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_tronconneuse_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_elastic_SOURCES = test_elastic.cpp test_elastic_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_elastic_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_blowfish_SOURCES = test_blowfish.cpp test_blowfish_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_blowfish_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_mask_list_SOURCES = test_mask_list.cpp test_mask_list_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_mask_list_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_escape_SOURCES = test_escape.cpp test_escape_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_escape_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_hash_fichier_SOURCES = test_hash_fichier.cpp test_hash_fichier_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_hash_fichier_DEPENDENCIES = ../libdar/lib$(MYLIB).la moving_file_SOURCES = moving_file.cpp make_sparse_file_SOURCES = make_sparse_file.c hashsum_SOURCES = hashsum.c test_crypto_asym_SOURCES = test_crypto_asym.cpp test_crypto_asym_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_crypto_asym_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_range_SOURCES = test_range.cpp test_range_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_range_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_generic_thread_SOURCES = test_generic_thread.cpp test_generic_thread_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_generic_thread_DEPENDENCIES = ../libdar/lib$(MYLIB).la #test_rsync_SOURCES = test_rsync.cpp #test_rsync_LDADD = ../dar_suite/shell_interaction.o $(LDADD) #test_rsync_DEPENDENCIES = ../libdar/lib$(MYLIB).la dar-2.5.3/src/testing/Makefile.in0000644000175000017520000012042412642474521013535 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = test_hide_file$(EXEEXT) test_terminateur$(EXEEXT) \ test_catalogue$(EXEEXT) test_infinint$(EXEEXT) \ test_tronc$(EXEEXT) test_compressor$(EXEEXT) \ test_mask$(EXEEXT) test_tuyau$(EXEEXT) test_deci$(EXEEXT) \ test_path$(EXEEXT) test_erreurs$(EXEEXT) test_sar$(EXEEXT) \ test_filesystem$(EXEEXT) test_scrambler$(EXEEXT) \ test_generic_file$(EXEEXT) test_storage$(EXEEXT) \ test_special_alloc$(EXEEXT) test_limitint$(EXEEXT) \ test_libdar$(EXEEXT) test_cache$(EXEEXT) \ test_tronconneuse$(EXEEXT) test_elastic$(EXEEXT) \ test_blowfish$(EXEEXT) test_mask_list$(EXEEXT) \ test_escape$(EXEEXT) test_hash_fichier$(EXEEXT) \ moving_file$(EXEEXT) make_sparse_file$(EXEEXT) \ hashsum$(EXEEXT) test_crypto_asym$(EXEEXT) test_range$(EXEEXT) \ $(am__EXEEXT_1) subdir = src/testing DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @WITH_LIBTHREADAR_TRUE@am__EXEEXT_1 = test_generic_thread$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_hashsum_OBJECTS = hashsum.$(OBJEXT) hashsum_OBJECTS = $(am_hashsum_OBJECTS) hashsum_LDADD = $(LDADD) am__DEPENDENCIES_1 = hashsum_DEPENDENCIES = $(am__DEPENDENCIES_1) am_make_sparse_file_OBJECTS = make_sparse_file.$(OBJEXT) make_sparse_file_OBJECTS = $(am_make_sparse_file_OBJECTS) make_sparse_file_LDADD = $(LDADD) make_sparse_file_DEPENDENCIES = $(am__DEPENDENCIES_1) am_moving_file_OBJECTS = moving_file.$(OBJEXT) moving_file_OBJECTS = $(am_moving_file_OBJECTS) moving_file_LDADD = $(LDADD) moving_file_DEPENDENCIES = $(am__DEPENDENCIES_1) am_test_blowfish_OBJECTS = test_blowfish.$(OBJEXT) test_blowfish_OBJECTS = $(am_test_blowfish_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am_test_cache_OBJECTS = test_cache.$(OBJEXT) test_cache_OBJECTS = $(am_test_cache_OBJECTS) am_test_catalogue_OBJECTS = test_catalogue.$(OBJEXT) test_catalogue_OBJECTS = $(am_test_catalogue_OBJECTS) am_test_compressor_OBJECTS = test_compressor.$(OBJEXT) test_compressor_OBJECTS = $(am_test_compressor_OBJECTS) am_test_crypto_asym_OBJECTS = test_crypto_asym.$(OBJEXT) test_crypto_asym_OBJECTS = $(am_test_crypto_asym_OBJECTS) am_test_deci_OBJECTS = test_deci.$(OBJEXT) test_deci_OBJECTS = $(am_test_deci_OBJECTS) test_deci_LDADD = $(LDADD) am_test_elastic_OBJECTS = test_elastic.$(OBJEXT) test_elastic_OBJECTS = $(am_test_elastic_OBJECTS) am_test_erreurs_OBJECTS = test_erreurs.$(OBJEXT) testtools.$(OBJEXT) test_erreurs_OBJECTS = $(am_test_erreurs_OBJECTS) test_erreurs_LDADD = $(LDADD) am_test_escape_OBJECTS = test_escape.$(OBJEXT) test_escape_OBJECTS = $(am_test_escape_OBJECTS) am_test_filesystem_OBJECTS = test_filesystem.$(OBJEXT) test_filesystem_OBJECTS = $(am_test_filesystem_OBJECTS) am_test_generic_file_OBJECTS = test_generic_file.$(OBJEXT) test_generic_file_OBJECTS = $(am_test_generic_file_OBJECTS) am_test_generic_thread_OBJECTS = test_generic_thread.$(OBJEXT) test_generic_thread_OBJECTS = $(am_test_generic_thread_OBJECTS) am_test_hash_fichier_OBJECTS = test_hash_fichier.$(OBJEXT) test_hash_fichier_OBJECTS = $(am_test_hash_fichier_OBJECTS) am_test_hide_file_OBJECTS = test_hide_file.$(OBJEXT) test_hide_file_OBJECTS = $(am_test_hide_file_OBJECTS) am_test_infinint_OBJECTS = test_infinint.$(OBJEXT) test_infinint_OBJECTS = $(am_test_infinint_OBJECTS) am_test_libdar_OBJECTS = test_libdar.$(OBJEXT) test_libdar_OBJECTS = $(am_test_libdar_OBJECTS) am_test_limitint_OBJECTS = test_limitint-test_limitint.$(OBJEXT) test_limitint_OBJECTS = $(am_test_limitint_OBJECTS) test_limitint_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(test_limitint_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_test_mask_OBJECTS = test_mask.$(OBJEXT) test_mask_OBJECTS = $(am_test_mask_OBJECTS) test_mask_LDADD = $(LDADD) am_test_mask_list_OBJECTS = test_mask_list.$(OBJEXT) test_mask_list_OBJECTS = $(am_test_mask_list_OBJECTS) am_test_path_OBJECTS = test_path.$(OBJEXT) test_path_OBJECTS = $(am_test_path_OBJECTS) test_path_LDADD = $(LDADD) am_test_range_OBJECTS = test_range.$(OBJEXT) test_range_OBJECTS = $(am_test_range_OBJECTS) am_test_sar_OBJECTS = test_sar.$(OBJEXT) testtools.$(OBJEXT) test_sar_OBJECTS = $(am_test_sar_OBJECTS) am_test_scrambler_OBJECTS = test_scrambler.$(OBJEXT) test_scrambler_OBJECTS = $(am_test_scrambler_OBJECTS) am_test_special_alloc_OBJECTS = test_special_alloc.$(OBJEXT) test_special_alloc_OBJECTS = $(am_test_special_alloc_OBJECTS) test_special_alloc_LDADD = $(LDADD) am_test_storage_OBJECTS = test_storage.$(OBJEXT) test_storage_OBJECTS = $(am_test_storage_OBJECTS) test_storage_LDADD = $(LDADD) am_test_terminateur_OBJECTS = test_terminateur.$(OBJEXT) test_terminateur_OBJECTS = $(am_test_terminateur_OBJECTS) am_test_tronc_OBJECTS = test_tronc.$(OBJEXT) testtools.$(OBJEXT) test_tronc_OBJECTS = $(am_test_tronc_OBJECTS) am_test_tronconneuse_OBJECTS = test_tronconneuse.$(OBJEXT) test_tronconneuse_OBJECTS = $(am_test_tronconneuse_OBJECTS) am_test_tuyau_OBJECTS = test_tuyau.$(OBJEXT) test_tuyau_OBJECTS = $(am_test_tuyau_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(hashsum_SOURCES) $(make_sparse_file_SOURCES) \ $(moving_file_SOURCES) $(test_blowfish_SOURCES) \ $(test_cache_SOURCES) $(test_catalogue_SOURCES) \ $(test_compressor_SOURCES) $(test_crypto_asym_SOURCES) \ $(test_deci_SOURCES) $(test_elastic_SOURCES) \ $(test_erreurs_SOURCES) $(test_escape_SOURCES) \ $(test_filesystem_SOURCES) $(test_generic_file_SOURCES) \ $(test_generic_thread_SOURCES) $(test_hash_fichier_SOURCES) \ $(test_hide_file_SOURCES) $(test_infinint_SOURCES) \ $(test_libdar_SOURCES) $(test_limitint_SOURCES) \ $(test_mask_SOURCES) $(test_mask_list_SOURCES) \ $(test_path_SOURCES) $(test_range_SOURCES) $(test_sar_SOURCES) \ $(test_scrambler_SOURCES) $(test_special_alloc_SOURCES) \ $(test_storage_SOURCES) $(test_terminateur_SOURCES) \ $(test_tronc_SOURCES) $(test_tronconneuse_SOURCES) \ $(test_tuyau_SOURCES) DIST_SOURCES = $(hashsum_SOURCES) $(make_sparse_file_SOURCES) \ $(moving_file_SOURCES) $(test_blowfish_SOURCES) \ $(test_cache_SOURCES) $(test_catalogue_SOURCES) \ $(test_compressor_SOURCES) $(test_crypto_asym_SOURCES) \ $(test_deci_SOURCES) $(test_elastic_SOURCES) \ $(test_erreurs_SOURCES) $(test_escape_SOURCES) \ $(test_filesystem_SOURCES) $(test_generic_file_SOURCES) \ $(test_generic_thread_SOURCES) $(test_hash_fichier_SOURCES) \ $(test_hide_file_SOURCES) $(test_infinint_SOURCES) \ $(test_libdar_SOURCES) $(test_limitint_SOURCES) \ $(test_mask_SOURCES) $(test_mask_list_SOURCES) \ $(test_path_SOURCES) $(test_range_SOURCES) $(test_sar_SOURCES) \ $(test_scrambler_SOURCES) $(test_special_alloc_SOURCES) \ $(test_storage_SOURCES) $(test_terminateur_SOURCES) \ $(test_tronc_SOURCES) $(test_tronconneuse_SOURCES) \ $(test_tuyau_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CXXSTDFLAGS = @CXXSTDFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN_PROG = @DOXYGEN_PROG@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GPGME_CFLAGS = @GPGME_CFLAGS@ GPGME_CONFIG = @GPGME_CONFIG@ GPGME_LIBS = @GPGME_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPX_PROG = @UPX_PROG@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ doxygen = @doxygen@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ groff = @groff@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ tmp = @tmp@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ upx = @upx@ @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@MYLIB = dar @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@MYLIB = dar64 @BUILD_MODE32_TRUE@MYLIB = dar32 @BUILD_MODE32_FALSE@@BUILD_MODE64_FALSE@AM_CPPFLAGS = -I../libdar -I../dar_suite -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) @BUILD_MODE32_FALSE@@BUILD_MODE64_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=64 -I../libdar -I../dar_suite -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) @BUILD_MODE32_TRUE@AM_CPPFLAGS = -DLIBDAR_MODE=32 -I../libdar -I../dar_suite -DDAR_LOCALEDIR=\"$(localedir)\" $(GPGME_CFLAGS) @WITH_LIBTHREADAR_FALSE@LIBTHREADAR_TEST_MODULES = @WITH_LIBTHREADAR_TRUE@LIBTHREADAR_TEST_MODULES = test_generic_thread #test_rsync has been removed from noinst_PROGRAMS due to a bug in librsync... feature postponed to branch 2.6.x AM_LDFLAGS = -all-static @LTLIBINTL@ LDADD = -L../libdar -l$(MYLIB) $(GPGME_LIBS) noinst_HEADERS = testtools.hpp test_hide_file_SOURCES = test_hide_file.cpp test_hide_file_LDADD = ../dar_suite/no_comment.o ../dar_suite/hide_file.o ../dar_suite/config_file.o ../dar_suite/shell_interaction.o $(LDADD) test_hide_file_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_terminateur_SOURCES = test_terminateur.cpp test_terminateur_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_terminateur_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_catalogue_SOURCES = test_catalogue.cpp test_catalogue_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_catalogue_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_infinint_SOURCES = test_infinint.cpp test_infinint_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_infinint_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_tronc_SOURCES = test_tronc.cpp testtools.cpp test_tronc_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_tronc_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_compressor_SOURCES = test_compressor.cpp test_compressor_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_compressor_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_mask_SOURCES = test_mask.cpp test_mask_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_tuyau_SOURCES = test_tuyau.cpp test_tuyau_LDADD = ../dar_suite/shell_interaction.o ../dar_suite/dar_suite.o ../dar_suite/line_tools.o $(LDADD) test_tuyau_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_deci_SOURCES = test_deci.cpp test_deci_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_path_SOURCES = test_path.cpp test_path_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_erreurs_SOURCES = test_erreurs.cpp testtools.cpp test_erreurs_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_sar_SOURCES = test_sar.cpp testtools.cpp test_sar_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_sar_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_filesystem_SOURCES = test_filesystem.cpp test_filesystem_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_filesystem_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_scrambler_SOURCES = test_scrambler.cpp test_scrambler_LDADD = ../dar_suite/dar_suite.o ../dar_suite/shell_interaction.o ../dar_suite/line_tools.o $(LDADD) test_scrambler_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_generic_file_SOURCES = test_generic_file.cpp test_generic_file_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_generic_file_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_storage_SOURCES = test_storage.cpp test_storage_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_special_alloc_SOURCES = test_special_alloc.cpp test_special_alloc_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_limitint_SOURCES = test_limitint.cpp test_limitint_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_limitint_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_limitint_CXXFLAGS = -Wno-long-long test_libdar_SOURCES = test_libdar.cpp test_libdar_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_libdar_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../libdar/libdar.hpp ../libdar/tools.hpp test_cache_SOURCES = test_cache.cpp test_cache_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_cache_DEPENDENCIES = ../libdar/lib$(MYLIB).la ../libdar/libdar.hpp ../libdar/tools.hpp test_tronconneuse_SOURCES = test_tronconneuse.cpp test_tronconneuse_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_tronconneuse_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_elastic_SOURCES = test_elastic.cpp test_elastic_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_elastic_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_blowfish_SOURCES = test_blowfish.cpp test_blowfish_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_blowfish_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_mask_list_SOURCES = test_mask_list.cpp test_mask_list_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_mask_list_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_escape_SOURCES = test_escape.cpp test_escape_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_escape_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_hash_fichier_SOURCES = test_hash_fichier.cpp test_hash_fichier_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_hash_fichier_DEPENDENCIES = ../libdar/lib$(MYLIB).la moving_file_SOURCES = moving_file.cpp make_sparse_file_SOURCES = make_sparse_file.c hashsum_SOURCES = hashsum.c test_crypto_asym_SOURCES = test_crypto_asym.cpp test_crypto_asym_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_crypto_asym_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_range_SOURCES = test_range.cpp test_range_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_range_DEPENDENCIES = ../libdar/lib$(MYLIB).la test_generic_thread_SOURCES = test_generic_thread.cpp test_generic_thread_LDADD = ../dar_suite/shell_interaction.o $(LDADD) test_generic_thread_DEPENDENCIES = ../libdar/lib$(MYLIB).la all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/testing/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/testing/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list hashsum$(EXEEXT): $(hashsum_OBJECTS) $(hashsum_DEPENDENCIES) $(EXTRA_hashsum_DEPENDENCIES) @rm -f hashsum$(EXEEXT) $(LINK) $(hashsum_OBJECTS) $(hashsum_LDADD) $(LIBS) make_sparse_file$(EXEEXT): $(make_sparse_file_OBJECTS) $(make_sparse_file_DEPENDENCIES) $(EXTRA_make_sparse_file_DEPENDENCIES) @rm -f make_sparse_file$(EXEEXT) $(LINK) $(make_sparse_file_OBJECTS) $(make_sparse_file_LDADD) $(LIBS) moving_file$(EXEEXT): $(moving_file_OBJECTS) $(moving_file_DEPENDENCIES) $(EXTRA_moving_file_DEPENDENCIES) @rm -f moving_file$(EXEEXT) $(CXXLINK) $(moving_file_OBJECTS) $(moving_file_LDADD) $(LIBS) test_blowfish$(EXEEXT): $(test_blowfish_OBJECTS) $(test_blowfish_DEPENDENCIES) $(EXTRA_test_blowfish_DEPENDENCIES) @rm -f test_blowfish$(EXEEXT) $(CXXLINK) $(test_blowfish_OBJECTS) $(test_blowfish_LDADD) $(LIBS) test_cache$(EXEEXT): $(test_cache_OBJECTS) $(test_cache_DEPENDENCIES) $(EXTRA_test_cache_DEPENDENCIES) @rm -f test_cache$(EXEEXT) $(CXXLINK) $(test_cache_OBJECTS) $(test_cache_LDADD) $(LIBS) test_catalogue$(EXEEXT): $(test_catalogue_OBJECTS) $(test_catalogue_DEPENDENCIES) $(EXTRA_test_catalogue_DEPENDENCIES) @rm -f test_catalogue$(EXEEXT) $(CXXLINK) $(test_catalogue_OBJECTS) $(test_catalogue_LDADD) $(LIBS) test_compressor$(EXEEXT): $(test_compressor_OBJECTS) $(test_compressor_DEPENDENCIES) $(EXTRA_test_compressor_DEPENDENCIES) @rm -f test_compressor$(EXEEXT) $(CXXLINK) $(test_compressor_OBJECTS) $(test_compressor_LDADD) $(LIBS) test_crypto_asym$(EXEEXT): $(test_crypto_asym_OBJECTS) $(test_crypto_asym_DEPENDENCIES) $(EXTRA_test_crypto_asym_DEPENDENCIES) @rm -f test_crypto_asym$(EXEEXT) $(CXXLINK) $(test_crypto_asym_OBJECTS) $(test_crypto_asym_LDADD) $(LIBS) test_deci$(EXEEXT): $(test_deci_OBJECTS) $(test_deci_DEPENDENCIES) $(EXTRA_test_deci_DEPENDENCIES) @rm -f test_deci$(EXEEXT) $(CXXLINK) $(test_deci_OBJECTS) $(test_deci_LDADD) $(LIBS) test_elastic$(EXEEXT): $(test_elastic_OBJECTS) $(test_elastic_DEPENDENCIES) $(EXTRA_test_elastic_DEPENDENCIES) @rm -f test_elastic$(EXEEXT) $(CXXLINK) $(test_elastic_OBJECTS) $(test_elastic_LDADD) $(LIBS) test_erreurs$(EXEEXT): $(test_erreurs_OBJECTS) $(test_erreurs_DEPENDENCIES) $(EXTRA_test_erreurs_DEPENDENCIES) @rm -f test_erreurs$(EXEEXT) $(CXXLINK) $(test_erreurs_OBJECTS) $(test_erreurs_LDADD) $(LIBS) test_escape$(EXEEXT): $(test_escape_OBJECTS) $(test_escape_DEPENDENCIES) $(EXTRA_test_escape_DEPENDENCIES) @rm -f test_escape$(EXEEXT) $(CXXLINK) $(test_escape_OBJECTS) $(test_escape_LDADD) $(LIBS) test_filesystem$(EXEEXT): $(test_filesystem_OBJECTS) $(test_filesystem_DEPENDENCIES) $(EXTRA_test_filesystem_DEPENDENCIES) @rm -f test_filesystem$(EXEEXT) $(CXXLINK) $(test_filesystem_OBJECTS) $(test_filesystem_LDADD) $(LIBS) test_generic_file$(EXEEXT): $(test_generic_file_OBJECTS) $(test_generic_file_DEPENDENCIES) $(EXTRA_test_generic_file_DEPENDENCIES) @rm -f test_generic_file$(EXEEXT) $(CXXLINK) $(test_generic_file_OBJECTS) $(test_generic_file_LDADD) $(LIBS) test_generic_thread$(EXEEXT): $(test_generic_thread_OBJECTS) $(test_generic_thread_DEPENDENCIES) $(EXTRA_test_generic_thread_DEPENDENCIES) @rm -f test_generic_thread$(EXEEXT) $(CXXLINK) $(test_generic_thread_OBJECTS) $(test_generic_thread_LDADD) $(LIBS) test_hash_fichier$(EXEEXT): $(test_hash_fichier_OBJECTS) $(test_hash_fichier_DEPENDENCIES) $(EXTRA_test_hash_fichier_DEPENDENCIES) @rm -f test_hash_fichier$(EXEEXT) $(CXXLINK) $(test_hash_fichier_OBJECTS) $(test_hash_fichier_LDADD) $(LIBS) test_hide_file$(EXEEXT): $(test_hide_file_OBJECTS) $(test_hide_file_DEPENDENCIES) $(EXTRA_test_hide_file_DEPENDENCIES) @rm -f test_hide_file$(EXEEXT) $(CXXLINK) $(test_hide_file_OBJECTS) $(test_hide_file_LDADD) $(LIBS) test_infinint$(EXEEXT): $(test_infinint_OBJECTS) $(test_infinint_DEPENDENCIES) $(EXTRA_test_infinint_DEPENDENCIES) @rm -f test_infinint$(EXEEXT) $(CXXLINK) $(test_infinint_OBJECTS) $(test_infinint_LDADD) $(LIBS) test_libdar$(EXEEXT): $(test_libdar_OBJECTS) $(test_libdar_DEPENDENCIES) $(EXTRA_test_libdar_DEPENDENCIES) @rm -f test_libdar$(EXEEXT) $(CXXLINK) $(test_libdar_OBJECTS) $(test_libdar_LDADD) $(LIBS) test_limitint$(EXEEXT): $(test_limitint_OBJECTS) $(test_limitint_DEPENDENCIES) $(EXTRA_test_limitint_DEPENDENCIES) @rm -f test_limitint$(EXEEXT) $(test_limitint_LINK) $(test_limitint_OBJECTS) $(test_limitint_LDADD) $(LIBS) test_mask$(EXEEXT): $(test_mask_OBJECTS) $(test_mask_DEPENDENCIES) $(EXTRA_test_mask_DEPENDENCIES) @rm -f test_mask$(EXEEXT) $(CXXLINK) $(test_mask_OBJECTS) $(test_mask_LDADD) $(LIBS) test_mask_list$(EXEEXT): $(test_mask_list_OBJECTS) $(test_mask_list_DEPENDENCIES) $(EXTRA_test_mask_list_DEPENDENCIES) @rm -f test_mask_list$(EXEEXT) $(CXXLINK) $(test_mask_list_OBJECTS) $(test_mask_list_LDADD) $(LIBS) test_path$(EXEEXT): $(test_path_OBJECTS) $(test_path_DEPENDENCIES) $(EXTRA_test_path_DEPENDENCIES) @rm -f test_path$(EXEEXT) $(CXXLINK) $(test_path_OBJECTS) $(test_path_LDADD) $(LIBS) test_range$(EXEEXT): $(test_range_OBJECTS) $(test_range_DEPENDENCIES) $(EXTRA_test_range_DEPENDENCIES) @rm -f test_range$(EXEEXT) $(CXXLINK) $(test_range_OBJECTS) $(test_range_LDADD) $(LIBS) test_sar$(EXEEXT): $(test_sar_OBJECTS) $(test_sar_DEPENDENCIES) $(EXTRA_test_sar_DEPENDENCIES) @rm -f test_sar$(EXEEXT) $(CXXLINK) $(test_sar_OBJECTS) $(test_sar_LDADD) $(LIBS) test_scrambler$(EXEEXT): $(test_scrambler_OBJECTS) $(test_scrambler_DEPENDENCIES) $(EXTRA_test_scrambler_DEPENDENCIES) @rm -f test_scrambler$(EXEEXT) $(CXXLINK) $(test_scrambler_OBJECTS) $(test_scrambler_LDADD) $(LIBS) test_special_alloc$(EXEEXT): $(test_special_alloc_OBJECTS) $(test_special_alloc_DEPENDENCIES) $(EXTRA_test_special_alloc_DEPENDENCIES) @rm -f test_special_alloc$(EXEEXT) $(CXXLINK) $(test_special_alloc_OBJECTS) $(test_special_alloc_LDADD) $(LIBS) test_storage$(EXEEXT): $(test_storage_OBJECTS) $(test_storage_DEPENDENCIES) $(EXTRA_test_storage_DEPENDENCIES) @rm -f test_storage$(EXEEXT) $(CXXLINK) $(test_storage_OBJECTS) $(test_storage_LDADD) $(LIBS) test_terminateur$(EXEEXT): $(test_terminateur_OBJECTS) $(test_terminateur_DEPENDENCIES) $(EXTRA_test_terminateur_DEPENDENCIES) @rm -f test_terminateur$(EXEEXT) $(CXXLINK) $(test_terminateur_OBJECTS) $(test_terminateur_LDADD) $(LIBS) test_tronc$(EXEEXT): $(test_tronc_OBJECTS) $(test_tronc_DEPENDENCIES) $(EXTRA_test_tronc_DEPENDENCIES) @rm -f test_tronc$(EXEEXT) $(CXXLINK) $(test_tronc_OBJECTS) $(test_tronc_LDADD) $(LIBS) test_tronconneuse$(EXEEXT): $(test_tronconneuse_OBJECTS) $(test_tronconneuse_DEPENDENCIES) $(EXTRA_test_tronconneuse_DEPENDENCIES) @rm -f test_tronconneuse$(EXEEXT) $(CXXLINK) $(test_tronconneuse_OBJECTS) $(test_tronconneuse_LDADD) $(LIBS) test_tuyau$(EXEEXT): $(test_tuyau_OBJECTS) $(test_tuyau_DEPENDENCIES) $(EXTRA_test_tuyau_DEPENDENCIES) @rm -f test_tuyau$(EXEEXT) $(CXXLINK) $(test_tuyau_OBJECTS) $(test_tuyau_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashsum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/make_sparse_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moving_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_blowfish.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cache.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_catalogue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_compressor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto_asym.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_deci.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_elastic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_erreurs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_escape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_filesystem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_generic_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_generic_thread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hash_fichier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hide_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_infinint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_libdar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_limitint-test_limitint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_mask_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_range.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_scrambler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_special_alloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_storage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_terminateur.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tronc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tronconneuse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tuyau.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testtools.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< test_limitint-test_limitint.o: test_limitint.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_limitint_CXXFLAGS) $(CXXFLAGS) -MT test_limitint-test_limitint.o -MD -MP -MF $(DEPDIR)/test_limitint-test_limitint.Tpo -c -o test_limitint-test_limitint.o `test -f 'test_limitint.cpp' || echo '$(srcdir)/'`test_limitint.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/test_limitint-test_limitint.Tpo $(DEPDIR)/test_limitint-test_limitint.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='test_limitint.cpp' object='test_limitint-test_limitint.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_limitint_CXXFLAGS) $(CXXFLAGS) -c -o test_limitint-test_limitint.o `test -f 'test_limitint.cpp' || echo '$(srcdir)/'`test_limitint.cpp test_limitint-test_limitint.obj: test_limitint.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_limitint_CXXFLAGS) $(CXXFLAGS) -MT test_limitint-test_limitint.obj -MD -MP -MF $(DEPDIR)/test_limitint-test_limitint.Tpo -c -o test_limitint-test_limitint.obj `if test -f 'test_limitint.cpp'; then $(CYGPATH_W) 'test_limitint.cpp'; else $(CYGPATH_W) '$(srcdir)/test_limitint.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/test_limitint-test_limitint.Tpo $(DEPDIR)/test_limitint-test_limitint.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='test_limitint.cpp' object='test_limitint-test_limitint.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_limitint_CXXFLAGS) $(CXXFLAGS) -c -o test_limitint-test_limitint.obj `if test -f 'test_limitint.cpp'; then $(CYGPATH_W) 'test_limitint.cpp'; else $(CYGPATH_W) '$(srcdir)/test_limitint.cpp'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am #test_rsync_SOURCES = test_rsync.cpp #test_rsync_LDADD = ../dar_suite/shell_interaction.o $(LDADD) #test_rsync_DEPENDENCIES = ../libdar/lib$(MYLIB).la # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dar-2.5.3/src/testing/test_sar.cpp0000644000175000017430000001200112641773000014000 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "sar.hpp" #include "deci.hpp" #include "testtools.hpp" #include "user_interaction.hpp" #include "integers.hpp" #include "shell_interaction.hpp" #include "libdar.hpp" #include "fichier_local.hpp" #include "entrepot_local.hpp" using namespace libdar; static user_interaction *ui = nullptr; static label data_name; static label internal_name; static void f1(); static void f2(); static void f3(); static void f4(); int main() { U_I major, medium, minor; get_version(major, medium, minor); user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; data_name.clear(); internal_name.generate_internal_filename(); f1(); f2(); f3(); f4(); if(ui != nullptr) delete ui; } static void f1() { entrepot_local where = entrepot_local("", "", false); where.set_location("./test"); try { sar sar1 = sar(*ui, gf_write_only, "destination", "txt", 100, 110, true, false, 0, where, internal_name, data_name, false, 0, hash_none, false, 0); fichier_local src = fichier_local(*ui, "./test/source.txt", gf_read_only, 0666, false, false, false); src.copy_to(sar1); } catch(Egeneric &e) { cerr << e.dump_str(); } } static void f2() { entrepot_local where = entrepot_local("", "", false); where.set_location("./test"); try { sar sar2 = sar(*ui, "destination", "txt", where, 0, false); fichier_local dst = fichier_local(*ui, "./test/destination.txt", gf_write_only, 0777, false, true, false); sar2.copy_to(dst); } catch(Egeneric &e) { cerr << e.dump_str(); } } static void f3() { entrepot_local where = entrepot_local("", "", false); where.set_location("./test"); try { sar sar3 = sar(*ui, "destination", "txt", where, 0, false); fichier_local src = fichier_local(*ui, "./test/source.txt", gf_read_only, 0666, false, false, false); display(sar3.get_position()); display(src.get_position()); sar3.skip(210); src.skip(210); display(sar3.get_position()); display(src.get_position()); display_read(*ui, sar3); display_read(*ui, src); display(sar3.get_position()); display(src.get_position()); sar3.skip_to_eof(); src.skip_to_eof(); display(sar3.get_position()); display(src.get_position()); display_read(*ui, sar3); display_read(*ui, src); display_back_read(*ui, sar3); display_back_read(*ui, src); display(sar3.get_position()); display(src.get_position()); sar3.skip_relative(-20); src.skip_relative(-20); display(sar3.get_position()); display(src.get_position()); display_read(*ui, sar3); display_read(*ui, src); display_back_read(*ui, sar3); display_back_read(*ui, src); display(sar3.get_position()); display(src.get_position()); sar3.skip(3); src.skip(3); display_back_read(*ui, sar3); display_back_read(*ui, src); display(sar3.get_position()); display(src.get_position()); display_read(*ui, sar3); display_read(*ui, src); display(sar3.get_position()); display(src.get_position()); sar3.skip(0); src.skip(0); display_back_read(*ui, sar3); display_back_read(*ui, src); display_read(*ui, sar3); display_read(*ui, src); } catch(Egeneric & e) { cerr << e.dump_str(); } } void f4() { entrepot_local where = entrepot_local("", "", false); where.set_location("./test"); try { sar sar2 = sar(*ui, "destination", "txt", where, 0, true, "echo SLICE %n"); display(sar2.get_position()); display_back_read(*ui, sar2); sar2.skip_relative(-1); display(sar2.get_position()); sar2.skip(0); display_read(*ui, sar2); } catch(Egeneric & e) { cerr << e.dump_str(); } } dar-2.5.3/src/testing/test_cache.cpp0000644000175000017430000000614212641773000014267 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_STDIO_H #include #endif #if HAVE_ERRNO_H #include #endif } #include "libdar.hpp" #include "cache.hpp" #include "shell_interaction.hpp" #include "erreurs.hpp" #include "generic_file.hpp" #include "shell_interaction.hpp" #include "cygwin_adapt.hpp" #include "fichier_local.hpp" using namespace libdar; using namespace std; void f1(); void f2(); static user_interaction *ui = nullptr; int main() { U_I maj, med, min; get_version(maj, med, min); ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; try { f1(); f2(); } catch(Ebug & e) { ui->warning(e.dump_str()); } catch(Egeneric & e) { ui->warning(string("Aborting on exception: ") + e.get_message()); } if(ui != nullptr) delete ui; } void f1() { fichier_local f = fichier_local(*ui, "toto", gf_read_only, 0, false, false, false); cache c = cache(f, false, 20); char buffer[200]; c.read(buffer, 3); c.read(buffer+3, 22); c.skip(0); c.read(buffer, 5); c.skip(10); c.read(buffer, 5); c.skip(20); c.read(buffer, 30); c.read(buffer+30, 5); c.read(buffer+35, 50); } void f2() { int fd = open("titi", O_RDWR|O_TRUNC|O_CREAT|O_BINARY, 0666); if(fd < 0) { printf("%s\n", strerror(errno)); return; } fichier_local g = fichier_local(*ui, "titi", gf_read_write, 0666, false, true, false); cache c = cache(g, false, 20); const char *buf = "coucou les amis"; c.write(buf, strlen(buf)); c.write(" ", 1); c.write("!", 1); c.write(" ", 1); c.write(buf, strlen(buf)); c.skip(0); c.write("C", 1); char buffer[100]; c.read(buffer, 3); c.skip(0); c.read(buffer, 99); buffer[99] = '\0'; c.skip_to_eof(); c.write("*",1); } dar-2.5.3/src/testing/test_mask.cpp0000644000175000017430000000733112610405012014147 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "mask.hpp" #include "integers.hpp" using namespace libdar; using namespace std; static void display_res(mask *m, string s) { cout << s << " : " << (m->is_covered(s) ? "OUI" : "non") << endl; } int main() { simple_mask m1 = simple_mask(string("*.toto"), true); simple_mask m2 = simple_mask(string("a?.toto"), true); simple_mask m3 = simple_mask(string("a?.toto"), true); simple_mask m4 = simple_mask(string("*.toto"), true); simple_mask m5 = simple_mask(string("*.toto"), false); display_res(&m1, "tutu.toto"); display_res(&m2, "a1.toto"); display_res(&m3, "b1.toto"); display_res(&m4, "toto"); display_res(&m4, "a.TOTO"); display_res(&m5, "a.TOTO"); bool_mask m6 = true; bool_mask m7 = false; display_res(&m6, "totot"); display_res(&m7, "totot"); regular_mask m8 = regular_mask("^toto", true); regular_mask m9 = regular_mask("titi$", false); display_res(&m8, "totola"); display_res(&m8, "tOTOla"); display_res(&m8, "ttotola"); display_res(&m9, "latiti"); display_res(&m9, "laTiTI"); m8 = regular_mask(".+\\.[1-9][0-9]*\\.dar", true); display_res(&m8, "acapulco"); display_res(&m8, ".1928.dar"); display_res(&m8, "toto.182dar"); display_res(&m8, "toto..dar"); display_res(&m8, "tutu.1.dar"); display_res(&m8, "tutu.0.dar"); display_res(&m8, "t.1928.dar"); m8 = regular_mask("^etc/rc.d/.*\\.", true); display_res(&m8, "etc/rc.d/toto.aiai"); display_res(&m8, "etc/rc.d/totoaiai"); display_res(&m8, "etc/rc.d/toto/titi.du"); same_path_mask m10 = same_path_mask("Zorro", true); same_path_mask m11 = same_path_mask("Zorro", false); display_res(&m10, "Zorro"); display_res(&m10, "zorro"); display_res(&m10, "toto"); display_res(&m11, "Zorro"); display_res(&m11, "zorro"); display_res(&m11, "toto"); exclude_dir_mask m12 = exclude_dir_mask("/tmp/crotte", true); exclude_dir_mask m13 = exclude_dir_mask("/tmp/croTte", false); display_res(&m12, "/tmp/crotte"); display_res(&m12, "/tmp/crotte/de/bique"); display_res(&m12, "/tmp"); display_res(&m12, "/toto/crotte"); display_res(&m13, "/tmp/crotte"); display_res(&m13, "/tmp/CrOtte"); display_res(&m13, "/tMp/cRoTTE/seche"); simple_path_mask m14 = simple_path_mask("/tmp/crotte", true); simple_path_mask m15 = simple_path_mask("/tmp/croTte", false); display_res(&m14, "/tmp/crotte"); display_res(&m14, "/tmp/crotte/de/bique"); display_res(&m14, "/tmp"); display_res(&m14, "/toto/crotte"); display_res(&m15, "/tmp/crotte"); display_res(&m15, "/tmp/CrOtte"); display_res(&m15, "/tMp/cRoTTE/seche"); display_res(&m15, "/tMp"); } dar-2.5.3/src/testing/test_deci.cpp0000644000175000017430000000304112641773000014123 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "deci.hpp" using namespace libdar; using namespace std; static void f1(); int main() { f1(); } static void f1() { libdar::deci d1 = string("00001"); infinint t = 3; libdar::deci d2 = t; libdar::deci d3 = infinint(125); U_I c; cout << d1.human() << endl; cout << d2.human() << endl; cout << d3.human() << endl; c = d1.computer() % 200; c = d2.computer() % 200; c = d3.computer() % 200; c = c+1; // avoid warning of unused variable } dar-2.5.3/src/testing/test_elastic.cpp0000644000175000017430000001377512641773000014662 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_STRING_H #include #endif } #include #include "libdar.hpp" #include "elastic.hpp" #include "erreurs.hpp" #include "shell_interaction.hpp" #include "deci.hpp" #include "cygwin_adapt.hpp" #include "macro_tools.hpp" #include "fichier_local.hpp" using namespace libdar; using namespace std; void f1(); void f2(); void f3(); int main() { try { U_I maj, med, min; get_version(maj, med, min); f1(); f2(); f3(); } catch(Egeneric & e) { cout << "exception caught : " + e.get_message() << endl; } catch(...) { cout << "unknown exception caught" << endl; } } void f1() { elastic stic = 10; const unsigned int taille = 100; unsigned char buffer[taille]; unsigned char biffir[taille]; stic.dump(buffer, taille); // check the resulting buffer thanks to debugger cout << stic.get_size() << endl; elastic stoc = elastic(buffer, taille, elastic_forward, macro_tools_supported_version); cout << stoc.get_size() << endl; stoc.dump(biffir, taille); elastic stuc = elastic(biffir, 10, elastic_backward, macro_tools_supported_version); cout << stuc.get_size() << endl; } void f2() { const unsigned int taille = 500; unsigned char buffer[taille]; // testing the elastic of size 1 and 2 elastic stic = 1; stic.dump(buffer, taille); cout << stic.get_size() << endl; elastic stuc = elastic(buffer, taille, elastic_forward, macro_tools_supported_version); cout << stuc.get_size() << endl; stuc = elastic(buffer, 1, elastic_backward, macro_tools_supported_version); cout << stuc.get_size() << endl; stic = 2; stic.dump(buffer, taille); cout << stic.get_size() << endl; stuc = elastic(buffer, taille, elastic_forward, macro_tools_supported_version); cout << stuc.get_size() << endl; stuc = elastic(buffer, 2, elastic_backward, macro_tools_supported_version); cout << stuc.get_size() << endl; // testing the elastic buffers of size larger than 255 stic = 256; stic.dump(buffer, taille); cout << stic.get_size() << endl; stuc = elastic(buffer, taille, elastic_forward, macro_tools_supported_version); cout << stuc.get_size() << endl; stuc = elastic(buffer, 256, elastic_backward, macro_tools_supported_version); cout << stuc.get_size() << endl; } void f3() { user_interaction *dialog = new (nothrow) shell_interaction(&cout, &cerr, false); if(dialog == nullptr) cout << "ERREUR !" << endl; try { fichier_local fic = fichier_local(*dialog, "toto", gf_read_write, 0666, false, true, false); const unsigned int taille = 500; unsigned char buffer[taille]; const char *ttt = "Bonjour les amis comment ca va ? "; elastic tic = 1, toc = 1; fic.write(ttt, strlen(ttt)); tic = 1; fic.skip(3); tic.dump(buffer, taille); fic.write((char *)buffer, 1); fic.skip(3); toc = elastic(fic, elastic_forward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; fic.skip(4); toc = elastic(fic, elastic_backward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; tic = 2; fic.skip(3); tic.dump(buffer, taille); fic.write((char *)buffer, 2); fic.skip(3); toc = elastic(fic, elastic_forward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; fic.skip(5); toc = elastic(fic, elastic_backward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; tic = 3; fic.skip(3); tic.dump(buffer, taille); fic.write((char *)buffer, 3); fic.skip(3); toc = elastic(fic, elastic_forward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; fic.skip(6); toc = elastic(fic, elastic_backward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; tic = 3; fic.skip(0); tic.dump(buffer, taille); fic.write((char *)buffer, 3); fic.skip(0); toc = elastic(fic, elastic_forward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; fic.skip(3); toc = elastic(fic, elastic_backward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; tic = 257; fic.skip(3); tic.dump(buffer, taille); fic.write((char *)buffer, 257); fic.skip(3); toc = elastic(fic, elastic_forward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; fic.skip(260); toc = elastic(fic, elastic_backward, macro_tools_supported_version); cout << toc.get_size() << " " << fic.get_position() << endl; } catch(Egeneric & e) { cout << "exception caught : " + e.get_message() << endl; } catch(...) { cout << "unknown exception caught" << endl; } if(dialog != nullptr) delete dialog; } dar-2.5.3/src/testing/test_libdar.cpp0000644000175000017430000002006012641773000014454 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDIO_H #include #endif #if MUTEX_WORKS #if HAVE_PTHREAD_H #include #endif #endif } // end extern "C" #include "libdar.hpp" #include "tools.hpp" #include "null_file.hpp" #include "shell_interaction.hpp" using namespace std; using namespace libdar; void f1(); void warning(const string &x, void *context); bool question(const string &x, void *context); string getstring(const string &x, bool echo, void *context); secu_string getsecustring(const string &x, bool echo, void *context); void f2(); void f3(); void f4(); void f5(); static user_interaction_callback ui = user_interaction_callback(warning, question, getstring, getsecustring,(void *)1000); int main() { f1(); f2(); f3(); f4(); f5(); } #define BOOL2STR(val) ( val ? "yes" : "no" ) void f1() { U_I maj, med, min; bool ea, large, nodump, special, thread, libz, libbz2, liblzo2, libcrypto, furtive; U_I bits; libdar::compile_time::endian endy; get_version(maj, med, min); ui.printf("version %u.%u.%u\n", maj, med, min); ea = libdar::compile_time::ea(); large = libdar::compile_time::largefile(); nodump = libdar::compile_time::nodump(); special = libdar::compile_time::special_alloc(); bits = libdar::compile_time::bits(); thread = libdar::compile_time::thread_safe(); libz = libdar::compile_time::libz(); libbz2 = libdar::compile_time::libbz2(); liblzo2 = libdar::compile_time::liblzo(); libcrypto = libdar::compile_time::libgcrypt(); furtive = libdar::compile_time::furtive_read(); endy = libdar::compile_time::system_endian(); ui.printf("features:\nEA = %s\nLARGE = %s\nNODUMP = %s\nSPECIAL = %s\nbits = %u\nthread = %s\nlibz =%s\nlibbz2 = %s\nliblzo = %s\nlibcrypto = %s\nfurtive = %s\nendian = %c\n", BOOL2STR(ea), BOOL2STR(large), BOOL2STR(nodump), BOOL2STR(special), bits, BOOL2STR(thread), BOOL2STR(libz), BOOL2STR(libbz2), BOOL2STR(liblzo2), BOOL2STR(libcrypto), BOOL2STR(furtive), endy); } void warning(const string &x, void *context) { cout << "[" << context << "]" << x.c_str() << endl; } bool question(const string & x, void *context) { bool rep = false; char r; printf("[%p]%s\n", context, x.c_str()); scanf("%c", &r); rep = r == 'y'; return rep; } string getstring(const string &x, bool echo, void *context) { throw SRC_BUG; } secu_string getsecustring(const string &x, bool echo, void *context) { throw SRC_BUG; } void listing(const std::string & flag, const std::string & perm, const std::string & uid, const std::string & gid, const std::string & size, const std::string & date, const std::string & filename, bool is_dir, bool has_children, void *context) { ui.printf("[[%p]][%S][%S][%S][%S][%S][%S][%S][%s][%s]\n", context, &flag, &perm, &uid, &gid, &size, &date, &filename, is_dir ? "dir" : "not_dir", has_children ? "has children" : "no children"); } void f2() { U_16 code; string msg; statistics st; archive_options_read read_options; archive_options_create create_options; create_options.set_subtree(simple_path_mask("/etc", true)); archive *toto = create_archive_noexcept(ui, "/", ".", "toto", "dar", create_options, &st, code, msg); if(code != LIBDAR_NOEXCEPT && code != LIBDAR_EUSER_ABORT) { ui.printf("exception creating archive: %S\n", &msg); return; } if(toto != nullptr) { archive_options_listing options; options.clear(); options.set_info_details(true); options.set_list_mode(archive_options_listing::normal); options.set_selection(bool_mask(true)); options.set_filter_unsaved(false); op_listing_noexcept(ui, toto, options, code, msg); if(code != LIBDAR_NOEXCEPT && code != LIBDAR_EUSER_ABORT) { ui.printf("exception creating archive: %S\n", &msg); } close_archive_noexcept(toto, code, msg); } read_options.clear(); read_options.set_info_details(true); archive *arch = open_archive_noexcept(ui, ".", "toto", "dar", read_options, code, msg); if(code != LIBDAR_NOEXCEPT) { ui.printf("exception openning archive: %S\n", &msg); return; } ui.set_listing_callback(&listing); bool ret = get_children_of_noexcept(ui, arch, "etc/rc.d", code, msg); if(code != LIBDAR_NOEXCEPT) { ui.printf("exception looking for children: %S\n", &msg); return; } if(ret) ui.printf("found children\n"); else ui.printf("no found children\n"); ret = get_children_of_noexcept(ui, arch, "", code, msg); if(code != LIBDAR_NOEXCEPT) { ui.printf("exception looking for children of root: %S\n", &msg); return; } if(ret) ui.printf("found children\n"); else ui.printf("no found children\n"); close_archive_noexcept(arch, code, msg); if(code != LIBDAR_NOEXCEPT) { ui.printf("exception closing: %S\n", &msg); return; } } void f3() { archive_options_read read_options; // need to create an archive named "titi" with file recorded as removed since reference backup U_16 code; string msg; read_options.clear(); read_options.set_info_details(true); archive *arch = open_archive_noexcept(ui, ".", "toto", "dar", read_options, code, msg); if(code != LIBDAR_NOEXCEPT) { ui.printf("exception openning archive: %S\n", &msg); return; } ui.set_listing_callback(&listing); bool ret = get_children_of_noexcept(ui, arch, "etc/rc.d", code, msg); if(code != LIBDAR_NOEXCEPT) { ui.printf("exception looking for children: %S\n", &msg); return; } if(ret) ui.printf("found children\n"); else ui.printf("no found children\n"); arch->init_catalogue(ui); vector contents = arch->get_children_in_table("etc"); vector::iterator it = contents.begin(); while(it != contents.end()) { string line = it->get_name() + " " + (it->has_data_present_in_the_archive() ? "SAVED" : "not saved") + "\n"; cout << line; ++it; } close_archive_noexcept(arch, code, msg); if(code != LIBDAR_NOEXCEPT) { ui.printf("exception closing: %S\n", &msg); return; } } void f4() { #if MUTEX_WORKS try { pthread_t tid = pthread_self(); pthread_t tod = 0; bool ret = cancel_status(tod); cancel_clear(tid); cancel_thread(tid); ret = cancel_status(tod); cancel_clear(tod); ret = cancel_status(tod); null_file fake = null_file(gf_read_write); fake.write("coucouc les amsi", 10); cancel_thread(tid); fake.write("coucouc les amsi", 10); ui.printf("this statement should never be reached\n"); ret = ret+1; // avoid warning of unused variable } catch(Egeneric & e) { cout << "Exception caught: " << e.get_message() << endl; } catch(...) { ui.printf("unknown expcetion caught\n"); } #endif } void f5() { string ret; ret = ui.get_string("Mot de passe svp :", false); cout << "---[" << ret << "]---" << endl; ret = ui.get_string("Mot de passe svp :", true); cout << "---[" << ret << "]---" << endl; } dar-2.5.3/src/testing/moving_file.cpp0000644000175000017430000000367412641773000014472 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include #include extern "C" { #if HAVE_UNISTD_H #include #endif #if HAVE_STDLIB_H #include #endif } using namespace std; void show_usage(const string & cmd); void modify(const string & arg); int main(int argc, char *argv[]) { if(argc != 2) { show_usage(argv[0]); return 1; } else { try { modify(argv[1]); } catch(...) { cerr << "Error met during treatment" << endl; return 2; } return 0; } } void show_usage(const string & cmd) { cout << "usage: " << cmd << " " << endl; } void modify(const string & arg) { ofstream fic; fic.open(arg.c_str(), ios::out); while(1) // loop that never ends, unless program is killed { usleep(50000); // sleep 50 ms int rnd = rand(); cout << "seeking at : " << rnd << endl; fic.seekp(rnd); // seek at a random place fic << "coucou " << endl; } } dar-2.5.3/src/testing/test_catalogue.cpp0000644000175000017430000003044512641773000015173 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_UNISTD_H #include #endif } // end extern "C" #include #include "libdar.hpp" #include "testtools.hpp" #include "catalogue.hpp" #include "cat_all_entrees.hpp" #include "user_interaction.hpp" #include "integers.hpp" #include "macro_tools.hpp" #include "shell_interaction.hpp" #include "deci.hpp" #include "label.hpp" #include "fichier_local.hpp" #include "pile.hpp" using namespace libdar; #define FIC1 "test/dump.bin" #define FIC2 "test/dump2.bin" static user_interaction *ui = nullptr; void f1(); void f2(); void f3(); void f4(); int main() { U_I maj, med, min; get_version(maj, med, min); user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; try { f1(); f2(); f3(); f4(); } catch(Egeneric & e) { throw SRC_BUG; } if(ui != nullptr) delete ui; return 0; } void f1() { // // test save/backup of each inode type // unlink(FIC1); unlink(FIC2); try { fichier_local *dump = new fichier_local(*ui, FIC1, gf_read_write, 0644, false, false, false); compressor *comp = new compressor(none, *dump, 1); pile stack; pile_descriptor pdesc; std::map corres; stack.push(dump); dump = nullptr; stack.push(comp); comp = nullptr; pdesc = &stack; cat_eod *v_eod = new cat_eod(); cat_file *v_file = new cat_file(1024, 102, 0644, datetime(1), datetime(2), datetime(3), "fichier", "." , 1024, 0, false); cat_lien *v_lien = new cat_lien(1025, 103, 0645, datetime(4), datetime(5), datetime(6), "lien", "fichier", 0); cat_directory *v_dir = new cat_directory(1026, 104, 0646, datetime(7), datetime(8), datetime(9), "repertoire", 0); cat_chardev *v_char = new cat_chardev(1027, 105, 0647, datetime(10), datetime(11), datetime(12), "char device", 104, 202, 0); cat_blockdev *v_block = new cat_blockdev(1028, 106, 0651, datetime(13), datetime(14), datetime(15), "block device", 105, 203, 0); cat_tube *v_tube = new cat_tube(1029, 107, 0652, datetime(16), datetime(17), datetime(18), "tuyau", 0); cat_prise *v_prise = new cat_prise(1030, 108, 0650, datetime(19), datetime(20), datetime(21), "prise", 0); cat_detruit *v_detruit = new cat_detruit("ancien fichier", 'f', datetime(192)); cat_directory *v_sub_dir = new cat_directory(200,20, 0777, datetime(100), datetime(101), datetime(102), "sous-repertoire", 0); cat_mirage *v_mir = new cat_mirage("Zorro mirage", new cat_etoile(dynamic_cast(v_prise->clone()), 10)); cat_entree *liste[] = { v_eod, v_file, v_lien, v_dir, v_char, v_block, v_tube, v_prise, v_detruit, v_sub_dir, v_mir, nullptr }; for(S_I i = 0; liste[i] != nullptr; ++i) { cat_inode *ino = dynamic_cast(liste[i]); if(ino != nullptr) ino->set_saved_status(s_saved); liste[i]->dump(pdesc, false); } stack.skip(0); entree_stats stats; stats.clear(); cat_entree *ref = (cat_entree *)1; // != nullptr for(S_I i = 0; ref != nullptr; ++i) { ref = cat_entree::read(*ui, nullptr, pdesc, macro_tools_supported_version, stats, corres, none, false, false, false); if(ref != nullptr) delete ref; } stats.listing(*ui); stack.clear(); v_dir->add_children(v_file); v_dir->add_children(v_lien); v_sub_dir->add_children(v_char); v_dir->add_children(v_sub_dir); v_sub_dir->add_children(v_block); v_dir->add_children(v_tube); v_dir->add_children(v_detruit); v_dir->add_children(v_prise); unlink(FIC1); unlink(FIC2); stats.clear(); dump = new fichier_local(*ui, FIC1, gf_read_write, 0644, false, true, false); comp = new compressor(none, *dump, 1); stack.push(dump); dump = nullptr; stack.push(comp); comp = nullptr; pdesc = &stack; v_dir->dump(pdesc, false); stack.skip(0); ref = cat_entree::read(*ui, nullptr, pdesc, macro_tools_supported_version, stats, corres, none, false, false, false); v_sub_dir = dynamic_cast(ref); delete ref; stack.clear(); } catch(Egeneric & e) { cerr << e.dump_str(); } } void f2() { // // test catalogue a proprement parler // try { label data_name; catalogue cat = catalogue(*ui, datetime(12), data_name); const cat_entree *ref; bool_mask tmp = true; label lax_label; lax_label.clear(); cat.listing(false, tmp, tmp, false, false, ""); cat.reset_add(); try { cat.add(new cat_eod()); } catch(Egeneric & e) { cerr << e.dump_str(); } cat.add(new cat_file(1024, 102, 0644, datetime(1), datetime(2), datetime(3), "fichier", ".", 1024, 0, false)); cat.add(new cat_lien(1025, 103, 0645, datetime(4), datetime(5), datetime(6), "lien", "fichier", 0)); cat.add(new cat_directory(1026, 104, 0646, datetime(7), datetime(8), datetime(9), "repertoire", 0)); cat.add(new cat_chardev(1027, 105, 0647, datetime(10), datetime(11), datetime(12), "char device", 104, 202, 0)); cat.add(new cat_blockdev(1028, 106, 0651, datetime(13), datetime(14), datetime(15), "block device", 105, 203, 0)); cat.add(new cat_eod()); cat.add(new cat_tube(1029, 107, 0652, datetime(16), datetime(17), datetime(18), "tuyau", 0)); cat.add(new cat_prise(1030, 108, 0650, datetime(19), datetime(20), datetime(21), "prise", 0)); cat.add(new cat_detruit("ancien fichier", 'f', datetime(102))); cat.listing(false, tmp, tmp, false, false, ""); cat.reset_read(); while(cat.read(ref)) { const cat_eod *e = dynamic_cast(ref); const cat_nomme *n = dynamic_cast(ref); const cat_directory *d = dynamic_cast(ref); string type = "file"; if(e != nullptr) cout << " EOF "<< endl; if(d != nullptr) type = "directory"; if(n != nullptr) cout << type << " name = " << n->get_name() << endl; } unlink(FIC1); fichier_local *f = new fichier_local(*ui, FIC1, gf_read_write, 0644, false, true, false); compressor *comp = new compressor(none, f, 1); pile stack; pile_descriptor pdesc; stack.push(f); f = nullptr; stack.push(comp); comp = nullptr; pdesc = & stack; cat.dump(pdesc); stack.skip(0); catalogue lst = catalogue(*ui, pdesc, macro_tools_supported_version, none, false, lax_label); lst.listing(false, tmp, tmp, false, false, ""); bool ok; lst.reset_read(); cat.reset_compare(); while(lst.read(ref)) { const cat_eod *e = dynamic_cast(ref); const cat_detruit *d = dynamic_cast(ref); const cat_inode *i = dynamic_cast(ref); const cat_entree *was; if(e != nullptr) ok = cat.compare(e, was); else if(d != nullptr) cout << "fichier detruit ["<< d->get_signature() << "] name = " << d->get_name() << endl; else if(i != nullptr) { ok = cat.compare(i, was); const cat_inode *w; if(ok) w = dynamic_cast(was); if(ok && w != nullptr) { if(i->same_as(*w)) if(i->is_more_recent_than(*w, 0)) { cout << "plus recent" << endl; cout << "new is " << tools_display_date(w->get_last_modif()) << " ref " << tools_display_date(i->get_last_modif()) << endl; } else cout << "pas plus recent" << endl; else cout << "pas meme ou pas inode" << endl; } } else cout << "objet inconnu" << endl; } } catch(Egeneric &e) { cerr << e.dump_str(); } } void f3() { label data_name; catalogue cat = catalogue(*ui, datetime(180), data_name); catalogue dif = catalogue(*ui, datetime(190), data_name); bool_mask tmp = true; cat.reset_add(); dif.reset_add(); cat.add(new cat_file(1024, 102, 0644, datetime(1), datetime(2), datetime(3), "fichier", ".", 1024, 0, false)); cat.add(new cat_lien(1025, 103, 0645, datetime(4), datetime(5), datetime(6), "lien", "fichier", 0)); cat.add(new cat_directory(1026, 104, 0646, datetime(7), datetime(8), datetime(9), "repertoire", 0)); cat.add(new cat_chardev(1027, 105, 0647, datetime(10), datetime(11), datetime(12), "char device", 104, 202, 0)); cat.add(new cat_blockdev(1028, 106, 0651, datetime(13), datetime(14), datetime(15), "block device", 105, 203, 0)); cat.add(new cat_eod()); cat.add(new cat_tube(1029, 107, 0652, datetime(16), datetime(17), datetime(18), "tuyau", 0)); cat.add(new cat_prise(1030, 108, 0650, datetime(19), datetime(20), datetime(21), "prise", 0)); cat.add(new cat_detruit("ancien fichier", 'f', datetime(190))); dif.add(new cat_file(1024, 102, 0644, datetime(1), datetime(2), datetime(3), "fichier", ".", 1024, 0, false)); dif.add(new cat_lien(1025, 103, 0645, datetime(4), datetime(5), datetime(6), "lien", "fichier", 0)); dif.add(new cat_tube(1029, 107, 0652, datetime(16), datetime(17), datetime(18), "tuyau", 0)); dif.add(new cat_prise(1030, 108, 0650, datetime(19), datetime(20), datetime(21), "prise", 0)); dif.add(new cat_detruit("ancien fichier", 'f', datetime(12))); dif.update_destroyed_with(cat); cat.listing(false, tmp, tmp, false, false, ""); dif.listing(false, tmp, tmp, false, false, ""); } void f4() { // // hard link testing // cat_tube *v_tube = new cat_tube(1029, 107, 0652, datetime(16), datetime(17), datetime(18), "tuyau", 0); cat_etoile *deneb = new cat_etoile(v_tube, 100); cout << deneb->get_ref_count() << endl; cout << deneb->get_etiquette() << endl; cout << deneb->is_wrote() << endl; cat_mirage *abell = new cat_mirage("Zorro et Bernardo", deneb); cout << deneb->get_ref_count() << endl; cout << deneb->get_etiquette() << endl; cout << deneb->is_wrote() << endl; cout << abell->is_inode_wrote() << endl; cout << abell->get_etiquette() << endl; cat_entree *tmp = abell->clone(); cat_mirage *trefle = dynamic_cast(tmp); cout << deneb->get_ref_count() << endl; cout << deneb->get_etiquette() << endl; cout << deneb->is_wrote() << endl; cout << trefle->is_inode_wrote() << endl; cout << trefle->get_etiquette() << endl; abell->set_inode_wrote(true); cout << trefle->is_inode_wrote() << endl; delete trefle; cout << deneb->get_ref_count() << endl; cout << deneb->get_etiquette() << endl; cout << deneb->is_wrote() << endl; cout << abell->is_inode_wrote() << endl; cout << abell->get_etiquette() << endl; delete abell; } dar-2.5.3/src/testing/testtools.cpp0000644000175000017430000000365412610405012014221 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include #include "deci.hpp" #include "tools.hpp" #include "testtools.hpp" #include "user_interaction.hpp" #include "integers.hpp" using namespace libdar; using namespace std; void display(const infinint & x) { libdar::deci vu = x; cout << vu.human() << endl; } void display_read(user_interaction & dialog, generic_file & f) { const S_I size = 10; char buffer[size]; S_I lu = f.read(buffer, size); if(lu < size) buffer[lu] = '\0'; else buffer[size-1] = '\0'; dialog.warning(tools_printf("lu = %d : [%s]\n", lu, buffer)); } void display_back_read(user_interaction & dialog, generic_file & f) { const S_I size = 10; char buffer[size]; S_I lu = 0; while(lu < size && f.read_back(buffer[lu]) == 1 ) lu++; if(lu < size) buffer[lu] = '\0'; else buffer[size-1] = '\0'; dialog.warning(tools_printf("lu = %d : [%s]\n", lu, buffer)); } dar-2.5.3/src/testing/test_tronc.cpp0000644000175000017430000001217412641773000014353 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_ERRNO_H #include #endif #if HAVE_STRING_H #include #endif } // end extern "C" #include #include "libdar.hpp" #include "tronc.hpp" #include "deci.hpp" #include "testtools.hpp" #include "user_interaction.hpp" #include "integers.hpp" #include "shell_interaction.hpp" #include "cygwin_adapt.hpp" #include "fichier_local.hpp" using namespace libdar; void f1(); void f2(); int main() { f1(); f2(); } void f1() { U_I maj, med, min; try { get_version(maj, med, min); string p = "test/source.txt"; shell_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; fichier_local h = fichier_local(*ui, p, gf_read_only, 0777, false, true, false); display_read(*ui, h); try { fichier_local f = fichier_local(*ui, "test/source.txt", gf_read_only, 0777, false, false, false); tronc *t; t = new tronc(&f, 0, infinint(10)); t->skip(0); cout << t->get_position() << endl; cout << f.get_position() << endl; display_read(*ui, *t); cout << t->get_position() << endl; cout << f.get_position() << endl; display_read(*ui, *t); cout << t->get_position() << endl; cout << f.get_position() << endl; delete t; t = new tronc(&f, 50, infinint(5)); cout << t->get_position() << endl; cout << f.get_position() << endl; display_read(*ui, *t); cout << t->get_position() << endl; cout << f.get_position() << endl; delete t; fichier_local g = fichier_local(*ui, "test/destination.txt", gf_read_write, 0666, false, true, false); f.skip(0); f.copy_to(g); t = new tronc(&g, 10, infinint(10)); try { f.skip(0); f.copy_to(*t); } catch(Egeneric & e) { cerr << e.dump_str(); } t->skip_to_eof(); display_back_read(*ui, *t); display_back_read(*ui, *t); g.skip(0); display_read(*ui, g); display_read(*ui, g); t->skip_relative(-5); display_read(*ui, *t); t->skip(3); display_read(*ui, *t); t->skip_relative(2); display_read(*ui, *t); delete t; } catch(Egeneric &f) { cerr << f.dump_str(); } if(ui != nullptr) delete ui; } catch(Egeneric & f) { cerr << f.dump_str(); } } void f2() { try { string p = "test/source.txt"; user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; try { fichier_local f = fichier_local(*ui, "test/source.txt", gf_read_only, 0666, false, false, false); tronc *t; t = new tronc(&f, 1); t->skip(0); cout << t->get_position() << endl; cout << f.get_position() << endl; display_read(*ui, *t); cout << t->get_position() << endl; cout << f.get_position() << endl; display_read(*ui, *t); cout << t->get_position() << endl; cout << f.get_position() << endl; t->skip_to_eof(); cout << t->get_position() << endl; cout << f.get_position() << endl; display_read(*ui, *t); t->skip_relative(1); cout << t->get_position() << endl; cout << f.get_position() << endl; t->skip_relative(-3); cout << t->get_position() << endl; cout << f.get_position() << endl; display_read(*ui, *t); delete t; /////// now testing writing mode fichier_local g = fichier_local(*ui, "test/destination.txt", gf_read_write, 0666, false, true, false); g.skip(0); display_read(*ui, g); t = new tronc(&g, 2); f.skip(0); f.copy_to(*t); cout << t->get_position() << endl; cout << f.get_position() << endl; cout << g.get_position() << endl; g.skip(0); display_read(*ui, g); g.skip(1); display_read(*ui, g); g.skip(2); display_read(*ui, g); } catch(Egeneric &e) { cerr << e.dump_str(); } if(ui != nullptr) delete ui; } catch(Egeneric & f) { cerr << f.dump_str(); } } dar-2.5.3/src/testing/test_escape.cpp0000644000175000017430000000667512641773000014477 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STRING_H #include #endif } // end extern "C" #include "libdar.hpp" #include "escape.hpp" #include "cygwin_adapt.hpp" #include "shell_interaction.hpp" #include "fichier_local.hpp" using namespace libdar; using namespace std; static user_interaction *ui = nullptr; void f1(); void f2(); int main() { U_I maj, med, min; get_version(maj, med, min); ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; f1(); f2(); } void f1() { set nojump; fichier_local below = fichier_local(*ui, "escape_below", gf_write_only, 0666, false, true, false); escape tested = escape(&below, nojump); const char *seq1 = "bonjour les amis"; const char *seq2 = "il fait beau il fait chaud"; tested.write(seq1, strlen(seq1)); tested.add_mark_at_current_position(escape::seqt_file); tested.write(seq2, strlen(seq2)); const U_I buf_size = 6; const unsigned char buffer[] = { 0xAD, 0xFD, 0xEA, 0x77, 0x21, 0x19 }; tested.write((const char *)buffer, buf_size); tested.write((const char *)buffer, 3); tested.write((const char *)buffer+3, 3); tested.add_mark_at_current_position(escape::seqt_ea); } void f2() { set nojump; const U_I buf_size = 100; unsigned char buffer[buf_size]; fichier_local below = fichier_local(*ui, "escape_below", gf_read_only, 0666, false, false, false); escape tested = escape(&below, nojump); S_I lu = 0; tested.skip(0); lu = tested.read((char *)buffer, buf_size); buffer[lu] = '\0'; cout << "[" << buffer << "]" << endl; lu = tested.read((char *)buffer, buf_size); buffer[lu] = '\0'; cout << "[" << buffer << "]" << endl; tested.skip_to_next_mark(escape::seqt_ea, true); lu = tested.read((char *)buffer, buf_size); buffer[lu] = '\0'; cout << "[" << buffer << "]" << endl; tested.skip(0); tested.skip_to_next_mark(escape::seqt_file, true); lu = tested.read((char *)buffer, buf_size); buffer[lu] = '\0'; cout << "[" << buffer << "]" << endl; lu = tested.read((char *)buffer, buf_size); buffer[lu] = '\0'; cout << "[" << buffer << "]" << endl; tested.skip(0); if(tested.skip_to_next_mark(escape::seqt_ea, false)) cout << "OK" << endl; else cout << "NOK" << endl; cout << libdar::deci(tested.get_position()).human() << endl; } dar-2.5.3/src/testing/test_compressor.cpp0000644000175000017430000001120312641773000015412 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif } // end extern "C" #include "libdar.hpp" #include "compressor.hpp" #include "integers.hpp" #include "cygwin_adapt.hpp" #include "shell_interaction.hpp" #include "fichier_local.hpp" using namespace libdar; static user_interaction *ui = nullptr; static void f1(); int main() { U_I maj, med, min; get_version(maj, med, min); ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; f1(); if(ui != nullptr) delete ui; } static void f1() { infinint pos2, pos3; try { fichier_local src1 = fichier_local(*ui, "toto", gf_read_only, 0666, false, false, false); fichier_local src2 = fichier_local(*ui, "toto", gf_read_only, 0666, false, false, false); fichier_local src3 = fichier_local(*ui, "toto", gf_read_only, 0666, false, false, false); fichier_local dst1 = fichier_local(*ui, "tutu.none", gf_write_only, 0666, false, true, false); fichier_local dst2 = fichier_local(*ui, "tutu.gz", gf_write_only, 0666, false, true, false); fichier_local dst3 = fichier_local(*ui, "tutu.bz", gf_write_only, 0666, false, true, false); compressor c1 = compressor(none, dst1); compressor c2 = compressor(gzip, dst2); compressor c3 = compressor(bzip2, dst3); src1.copy_to(c1); src2.copy_to(c2); src3.copy_to(c3); // ajout d'un deuxieme block de donnees indentiques c2.sync_write(); pos2 = c2.get_position(); src2.skip(0); src2.copy_to(c2); // ajout d'un deuxieme block de donnees indentiques c3.sync_write(); pos3 = c3.get_position(); src3.skip(0); src3.copy_to(c3); // alteration du premier block de donnees compresses c2.sync_write(); // to be sure all data is written to file dst2.skip(pos2 / 2); dst2.write("A", 1); // alteration du premier block de donnees compresses c3.sync_write(); // to be sure all data is written to file dst3.skip(pos3 / 2); dst3.write("A", 1); } catch(Egeneric & e) { cerr << e.dump_str(); } try { fichier_local src1 = fichier_local(*ui, "tutu.none", gf_read_only, 0666, false, false, false); fichier_local src2 = fichier_local(*ui, "tutu.gz", gf_read_only, 0666, false, false, false); fichier_local src3 = fichier_local(*ui, "tutu.bz", gf_read_only, 0666, false, false, false); fichier_local dst1 = fichier_local(*ui, "tutu.none.bak", gf_write_only, 0666, false, true, false); fichier_local dst2 = fichier_local(*ui, "tutu.gz.bak", gf_write_only, 0666, false, true, false); fichier_local dst3 = fichier_local(*ui, "tutu.bz.bak", gf_write_only, 0666, false, true, false); compressor c1 = compressor(none, src1); compressor c2 = compressor(gzip, src2); compressor c3 = compressor(bzip2, src3); c1.copy_to(dst1); try { c2.copy_to(dst2); } catch(Erange &e) { cerr << e.dump_str(); c2.skip(pos2); dst2.skip(0); c2.copy_to(dst2); } try { c3.copy_to(dst3); } catch(Erange &e) { cerr << e.dump_str(); c3.skip(pos3); dst3.skip(0); c3.copy_to(dst3); } } catch(Egeneric & e) { cerr << e.dump_str(); } unlink("tutu.none"); unlink("tutu.gz"); unlink("tutu.none.bak"); unlink("tutu.gz.bak"); unlink("tutu.bz"); unlink("tutu.bz.bak"); } dar-2.5.3/src/testing/test_tronconneuse.cpp0000644000175000017430000001442712641773000015753 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STRINGS_H #include #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } #include "libdar.hpp" #include "tronconneuse.hpp" #include "shell_interaction.hpp" #include "deci.hpp" #include "cygwin_adapt.hpp" #include "macro_tools.hpp" #include "fichier_local.hpp" class test : public tronconneuse { public: test(user_interaction & dialog, U_32 block_size, generic_file & encrypted_size, bool no_is = false): tronconneuse(block_size, encrypted_size, no_is, macro_tools_supported_version) {}; protected: U_32 encrypted_block_size_for(U_32 clear_block_size) { return clear_block_size + 1; }; U_32 clear_block_allocated_size_for(U_32 clear_block_size) { return clear_block_size + 2; }; U_32 encrypt_data(const infinint & block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size); U_32 decrypt_data(const infinint & block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size); }; U_32 test::encrypt_data(const infinint & block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size) { if(crypt_size < clear_size + 1) throw SRC_BUG; memcpy(crypt_buf, clear_buf, clear_size); crypt_buf[clear_size] = '#'; return clear_size + 1; } U_32 test::decrypt_data(const infinint & block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size) { if(crypt_size > clear_size + 1) throw SRC_BUG; if(crypt_size == 0) return 0; memcpy(clear_buf, crypt_buf, crypt_size - 1); return crypt_size - 1; } void f1(user_interaction *dialog); void f2(user_interaction *dialog); void f3(user_interaction *dialog); int main() { U_I maj, med, min; get_version(maj, med, min); user_interaction *dialog = new (nothrow) shell_interaction(&cout, &cerr, false); try { f1(dialog); f2(dialog); f3(dialog); } catch(Egeneric & e) { cout << "exception caught : " + e.get_message() << endl; } catch(...) { cout << "unknown exception caught" << endl; } if(dialog != nullptr) delete dialog; } void f1(user_interaction *dialog) { fichier_local fic = fichier_local(*dialog, "toto", gf_write_only, 0666, false, true, false); test *toto = new test(*dialog, 10, fic); if(toto == nullptr) throw Ememory("test"); #define TEST_WRITE(x) toto->write(x, strlen(x)) #define WRITE_TO(x, y) x.write(y, strlen(y)) TEST_WRITE("[|]"); cout << string("pos = ") << toto->get_position() << endl; TEST_WRITE("bonjour les amis comment ca va ?"); cout << string("pos = ") << toto->get_position() << endl; TEST_WRITE("a"); cout << string("pos = ") << toto->get_position() << endl; toto->write_end_of_file(); delete toto; } void f2(user_interaction *dialog) { fichier_local fic = fichier_local(*dialog, "toto", gf_read_only, 0666, false, false, false); test *toto = new test(*dialog, 10, fic); if(toto == nullptr) throw Ememory("test"); const int taille = 100; char buffer[taille]; buffer[toto->read(buffer, 5)] = '\0'; cout << buffer << " | " << toto->get_position() << endl; buffer[toto->read(buffer, taille)] = '\0'; cout << buffer << " | " << toto->get_position() << endl; toto->skip(5); cout << toto->get_position() << endl; buffer[toto->read(buffer, 5)] = '\0'; cout << buffer << " | " << toto->get_position() << endl; toto->skip(11); cout << toto->get_position() << endl; buffer[toto->read(buffer, 5)] = '\0'; cout << buffer << " | " << toto->get_position() << endl; toto->skip_to_eof(); cout << toto->get_position() << endl; buffer[toto->read(buffer, 5)] = '\0'; cout << buffer << " | " << toto->get_position() << endl; int i; for(i = 0; i < taille && toto->read_back(buffer[i]) == 1; ++i) cout << toto->get_position() << endl; buffer[i] = '\0'; cout << buffer << " | " << toto->get_position() << endl; delete toto; } void f3(user_interaction *dialog) { fichier_local foc = fichier_local(*dialog, "toto", gf_write_only, 0666, false, false, false); fichier_local fic = fichier_local(*dialog, "titi", gf_write_only, 0666, false, true, false); WRITE_TO(foc, "Hello les amis"); WRITE_TO(fic, "Hello les amis"); cout << "pos = " << fic.get_position() << endl; cout << "pos = " << foc.get_position() << endl; test fuc = test(*dialog, 10, fic); cout << "pos = " << fuc.get_position() << endl; WRITE_TO(foc, "Il fait chaud il fait beau les mouches pettent et les cailloux fleurissent"); WRITE_TO(fuc, "Il fait chaud il fait beau les mouches pettent et les cailloux fleurissent"); cout << "pos = " << fuc.get_position() << endl; cout << "pos = " << foc.get_position() << endl; fuc.write_end_of_file(); cout << "pos = " << fuc.get_position() << endl; } dar-2.5.3/src/testing/test_special_alloc.cpp0000644000175000017430000000506612641773000016022 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "libdar.hpp" #include "user_interaction.hpp" #include "on_pool.hpp" #include #include using namespace libdar; using namespace std; class example : public on_pool { public: example() { val = 0; }; example(int x): val(x) {}; int get_val() const { return val; }; void set_val(int x) { val = x; }; memory_pool *my_get_pool() { return get_pool(); }; private: int val; }; void f1(); int main() { U_I maj, med, min; get_version(maj, med, min); try { f1(); } catch(Egeneric & e) { cerr << e.dump_str(); } catch(...) { cout << "unknown exception caught" << endl; } return 0; } void f1() { memory_pool mem; example a = 1; example *ptr1 = new (nothrow) example; example *ptr2 = new (&mem) example; try { if(ptr1 == nullptr || ptr2 == nullptr) throw Ememory("f1"); cout << a.get_val() << endl; cout << ptr1->get_val() << endl; cout << ptr2->get_val() << endl; if(a.my_get_pool() != nullptr) cout << "Strange!" << endl; if(ptr1->my_get_pool() != nullptr) cout << "Very strange!" << endl; if(ptr2->my_get_pool() != &mem) cout << "Extremely strange!" << endl; } catch(...) { if(ptr1 != nullptr) delete ptr1; if(ptr2 != nullptr) delete ptr2; throw; } if(ptr1 != nullptr) delete ptr1; if(ptr2 != nullptr) delete ptr2; if(! mem.is_empty()) cout << mem.dump() << endl; else { cout << mem.dump() << endl; cout << "ALL memory has been released" << endl; } } dar-2.5.3/src/testing/test_hide_file.cpp0000644000175000017430000000443712641773000015141 00000000000000//*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_FCNTL_H #include #endif } // end extern "C" #include "libdar.hpp" #include "no_comment.hpp" #include "config_file.hpp" #include "cygwin_adapt.hpp" #include "shell_interaction.hpp" #include "user_interaction.hpp" #include "fichier_local.hpp" using namespace libdar; void f1(); void f2(); static user_interaction *ui = nullptr; int main() { U_I maj, med, min; get_version(maj, med, min); user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; f1(); f2(); if(ui != nullptr) delete ui; } void f1() { fichier_local src = fichier_local(*ui, "toto", gf_read_only, 0666, false, false, false); no_comment strip = no_comment(src); fichier_local dst = fichier_local(*ui, "titi", gf_write_only, 0666, false, true, false); strip.copy_to(dst); } void f2() { vector cibles; cibles.push_back("coucou"); cibles.push_back("all"); cibles.push_back("default"); fichier_local src = fichier_local(*ui, "toto", gf_read_only, 0666, false, false, false); config_file strip = config_file(cibles, src); fichier_local dst = fichier_local(*ui, "tutu", gf_write_only, 0666, false, true, false); strip.copy_to(dst); } dar-2.5.3/src/testing/testtools.hpp0000644000175000017430000000252712610405012014224 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #ifndef TESTTOOLS_HPP #define TESTTOOLS_HPP #include "../my_config.h" #include "infinint.hpp" #include "generic_file.hpp" using namespace libdar; extern void display(const infinint & x); extern void display_read(user_interaction & dialog, generic_file & f); extern void display_back_read(user_interaction & dialog, generic_file & f); #endif dar-2.5.3/src/testing/test_scrambler.cpp0000644000175000017430000000506312641773000015177 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDIO_H #include #endif } // end extern "C" #include #include "scrambler.hpp" #include "dar_suite.hpp" #include "generic_file.hpp" #include "integers.hpp" #include "fichier_local.hpp" #include "tools.hpp" using namespace libdar; S_I little_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env); int main(S_I argc, char * const argv[]) { return dar_suite_global(argc, argv, nullptr, "", nullptr, '\0', &little_main); } S_I little_main(shell_interaction & dialog, S_I argc, char * const argv[], const char **env) { if(argc != 4) { printf("usage: %s \n", argv[0]); return EXIT_SYNTAX; } fichier_local *src = new fichier_local(dialog, argv[1], gf_read_only, 0, false, false, false); fichier_local *dst = new fichier_local(dialog, argv[2], gf_write_only, 0666, false, true, false); std::string pass = "bonjour"; scrambler *scr = new scrambler(secu_string(pass.c_str(), pass.size()), *dst); src->copy_to(*scr); delete scr; scr = nullptr; delete dst; dst = nullptr; delete src; src = nullptr; src = new fichier_local(dialog, argv[2], gf_read_only, 0, false, false, false); scr = new scrambler(secu_string(pass.c_str(), pass.size()), *src); dst = new fichier_local(dialog, argv[3], gf_write_only, 0666, false, true, false); scr->copy_to(*dst); delete scr; delete src; delete dst; return EXIT_OK; } dar-2.5.3/src/testing/test_generic_thread.cpp0000644000175000017430000000570012641773000016166 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "libdar.hpp" #include "shell_interaction.hpp" #include "fichier_local.hpp" #include "generic_thread.hpp" #include "memory_file.hpp" extern "C" { } using namespace std; using namespace libdar; static shell_interaction ui = shell_interaction(&cout, &cerr, false); void f1(); void f2(const string & src, const string & dst); int main(int argc, char *argv[]) { U_I maj, med, min; get_version(maj, med, min); try { // f1(); if(argc != 3) cout << "usage: " << argv[0] << " " << endl; else f2(argv[1], argv[2]); } catch(Egeneric & e) { ui.printf("Exception caught: %S", &(e.get_message())); cout << e.dump_str() << endl; } catch(libthreadar::exception_base & e) { std::string msg; for(unsigned int i = 0; i < e.size(); ++i) msg = e[i] + ": " + msg; ui.printf("libthreadar exception: %S", &msg); } catch(...) { ui.printf("unknown exception caught"); } return 0; } void f1() { generic_file *src = new fichier_local("toto.txt"); memory_file dst; generic_thread *t1 = new generic_thread(src, 9, 3); infinint tmp; t1->copy_to(dst); tmp = dst.size(); ui.printf("dst size = %i\n", &tmp); t1->skip(0); dst.reset(); t1->read_ahead(1000); t1->copy_to(dst); t1->skip(0); dst.reset(); t1->read_ahead(1000); tmp = t1->get_position(); ui.printf("t1 posiiton = %i\n", &tmp); t1->copy_to(dst); delete t1; src = new memory_file(); t1 = new generic_thread(src, 9, 3); dst.skip(0); dst.copy_to(*t1); tmp = t1->get_position(); ui.printf("t1 position = %i\n", &tmp); delete t1; } void f2(const string & src, const string & dst) { generic_file *src_f = new fichier_local(src); generic_file *dst_f = new fichier_local(ui, dst, gf_write_only, 0600, false, true, false); generic_thread t1 = generic_thread(dst_f, 10, 20); src_f->copy_to(t1); } dar-2.5.3/src/testing/test_erreurs.cpp0000644000175000017430000000510412641773000014710 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "erreurs.hpp" #include "integers.hpp" using namespace libdar; using namespace std; void f1(S_I i); void f2(S_I i, S_I j); void f1(S_I i) { try { if(i < 0) throw Erange("f1", "i < 0"); if(i == 0) throw Edeci("f1", "i == 0"); } catch(Egeneric & e) { e.stack("f1", "essai"); throw; } } void f2(S_I i, S_I j) { try { if(j > 0) f2(i, j-1); else f1(i); } catch(Erange & e) { e.stack("f2", "calling f1"); throw; } catch(Egeneric & e) { e.stack("f2", "unexpected"); throw; // Can throw an Unexpected exception (see englobing function declaration) } } void f3() { try { Ememory *x; Ebug y = SRC_BUG; string s; x = new Ememory("f3"); delete x; } catch(Egeneric & e) { e.stack("f3", ""); throw; } } void f4() { Erange *y; Erange x = Erange("essai", "coucou"); Edeci dec = Edeci("f4", "essai"); x.stack("ajout", "par ici"); x.stack("crotte", "par ila"); cerr << dec.dump_str(); y = new Erange(x); cerr << y->dump_str(); cerr << y->dump_str(); delete y; } int main() { f4(); f4(); f4(); try { f3(); f2(3, 3); f2(-3, 3); } catch(Egeneric & e) { cerr << e.dump_str(); } try { f2(0, 10); } catch(Egeneric & e) { cerr << e.dump_str(); } } dar-2.5.3/src/testing/test_generic_file.cpp0000644000175000017430000000607112641773000015640 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif } // end extern "C" #include #include "libdar.hpp" #include "infinint.hpp" #include "generic_file.hpp" #include "null_file.hpp" #include "integers.hpp" #include "cygwin_adapt.hpp" #include "shell_interaction.hpp" #include "crc.hpp" #include "fichier_local.hpp" using namespace libdar; using namespace std; static user_interaction *ui = nullptr; int main(S_I argc, char *argv[]) { U_I maj, med, min; get_version(maj, med, min); ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; if(argc < 3) { cout << "usage " << argv[0] << " " << endl; return -1; } fichier_local f1 = fichier_local(*ui, argv[1], gf_read_only, 0, false, false, false); S_I fd = ::open(argv[2], O_WRONLY|O_CREAT|O_TRUNC|O_BINARY); if(fd < 0) { cout << "cannot open "<< argv[2] << endl; return -1; } fichier_local f2 = fichier_local(*ui, argv[2], gf_write_only, 0666, false, true, false); f1.reset_crc(crc::OLD_CRC_SIZE); f2.reset_crc(crc::OLD_CRC_SIZE); f1.copy_to(f2); crc *crc1 = f1.get_crc(); crc *crc2 = f2.get_crc(); crc *crc3 = nullptr; try { if(crc1 == nullptr || crc2 == nullptr) throw SRC_BUG; if(*crc1 == *crc2) cout << "CRC OK" << endl; else cout << "CRC PROBLEM" << endl; f1.skip(0); null_file f3 = null_file(gf_write_only); f1.copy_to(f3, crc::OLD_CRC_SIZE, crc3); if(crc3 == nullptr) throw SRC_BUG; if(*crc1 == *crc3) cout << "CRC OK" << endl; else cout << "CRC PROBLEM" << endl; if(ui != nullptr) delete ui; } catch(...) { if(crc1 != nullptr) delete crc1; if(crc2 != nullptr) delete crc2; if(crc3 != nullptr) delete crc3; throw; } if(crc1 != nullptr) delete crc1; if(crc2 != nullptr) delete crc2; if(crc3 != nullptr) delete crc3; } dar-2.5.3/src/testing/test_terminateur.cpp0000644000175000017430000000447612641773000015573 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif } // end extern "C" #include #include "libdar.hpp" #include "terminateur.hpp" #include "generic_file.hpp" #include "deci.hpp" #include "integers.hpp" #include "cygwin_adapt.hpp" #include "shell_interaction.hpp" #include "user_interaction.hpp" #include "macro_tools.hpp" #include "fichier_local.hpp" using namespace libdar; using namespace std; static void f1(); static user_interaction *ui = nullptr; int main() { U_I maj, med, min; get_version(maj, med, min); user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; f1(); if(ui != nullptr) delete ui; } static void f1() { fichier_local toto = fichier_local(*ui, "toto", gf_read_write, 0666, false, true, false); terminateur term; infinint grand = 1; for(S_I i=2;i<30;i++) grand *= i; libdar::deci conv = grand; cout << conv.human() << endl; term.set_catalogue_start(grand); term.dump(toto); toto.skip(0); term.read_catalogue(toto, false, macro_tools_supported_version); conv = term.get_catalogue_start(); cout << conv.human() << endl; } dar-2.5.3/src/testing/test_infinint.cpp0000644000175000017430000001133412641773000015041 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif } // end extern "C" #include #include "libdar.hpp" #include "integers.hpp" #include "infinint.hpp" #include "deci.hpp" #include "cygwin_adapt.hpp" #include "macro_tools.hpp" #include "shell_interaction.hpp" #include "generic_file.hpp" #include "fichier_local.hpp" using namespace libdar; using namespace std; static void routine1(); static void routine2(); static user_interaction *ui = nullptr; int main() { U_I maj, med, min; get_version(maj, med, min); user_interaction *ui = new (nothrow) shell_interaction(&cout, &cerr, false); if(ui == nullptr) cout << "ERREUR !" << endl; routine1(); routine2(); if(ui != nullptr) delete ui; } static void routine1() { infinint f1 = 123; infinint f2 = f1; infinint f3 = 0; libdar::deci d1 = f1; libdar::deci d2 = f2; libdar::deci d3 = f3; ui->warning(d1.human() + " " + d2.human() + " " + d3.human()); fichier_local *fic = new (nothrow) fichier_local(*ui, "toto", gf_write_only, 0600, false, true, false); if(fic == nullptr) throw Ememory("routine1"); f1.dump(*fic); delete fic; fic = nullptr; fic = new (nothrow) fichier_local("toto", false); if(fic == nullptr) throw Ememory("routine1"); f3 = infinint(*fic); d3 = libdar::deci(f3); ui->warning(d3.human()); delete fic; fic = nullptr; f1 += 3; d1 = libdar::deci(f1); ui->warning(d1.human()); f1 -= 2; d1 = libdar::deci(f1); ui->warning(d1.human()); f1 *= 10; d1 = libdar::deci(f1); ui->warning(d1.human()); f2 = f1; f1 /= 3; d1 = libdar::deci(f1); ui->warning(d1.human()); f2 %= 3; d2 = libdar::deci(f2); ui->warning(d2.human()); f2 >>= 12; d2 = libdar::deci(f2); ui->warning(d2.human()); f1 = 4; f2 >>= f1; d2 = libdar::deci(f2); ui->warning(d2.human()); f1 = 4+12; f2 = f3; cout << f3 << endl; cout << f1 << endl; f3 <<= f1; cout << f3 << endl; cout << (123 << 16) << endl; f2 <<= 4+12; d2 = libdar::deci(f2); ui->warning(d2.human()); d3 = libdar::deci(f3); ui->warning(d3.human()); try { f1 = 1024; f2 = 2048; f2 -= f1; cout << f2 << endl; f1 = 4; f2 = 1; f1 <<= f2; f3 = 8; cout << f1 << endl; cout << f3 << endl; f3 -= f1; cout << f3 << endl; f1 = 4; f1 <<= (U_I)1; cout << f1 << endl; f1 = 1000; f2 = 1; f1 <<= f2; cout << f1 << endl; f1 = 1000; f1 <<= (U_32)1; cout << f1 << endl; } catch(Egeneric & e) { cerr << e.dump_str(); } f1 = 21; f2 = 1; try { for(f3 = 2; f3 <= f1; f3++) { d1 = libdar::deci(f1); d2 = libdar::deci(f2); d3 = libdar::deci(f3); ui->warning(d1.human() + " " + d2.human() + " " + d3.human()); f2 *= f3; d2 = libdar::deci(f2); ui->warning(d2.human()); } } catch(Elimitint & e) { ui->warning(e.get_message()); } d2 = libdar::deci(f2); d1 = libdar::deci(f1); ui->warning(string("factoriel(") + d1.human() + ") = " + d2.human()); } static void routine2() { ui->warning(libdar::deci(infinint(2).power((U_I)0)).human()); ui->warning(libdar::deci(infinint(2).power(infinint(0))).human()); ui->warning(libdar::deci(infinint(2).power((U_I)1)).human()); ui->warning(libdar::deci(infinint(2).power(infinint(1))).human()); ui->warning(libdar::deci(infinint(2).power((U_I)2)).human()); ui->warning(libdar::deci(infinint(2).power(infinint(2))).human()); } dar-2.5.3/src/testing/test_tuyau.cpp0000644000175000017430000001052312641773000014371 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if STDC_HEADERS #include #endif #if HAVE_UNISTD_H #include #endif #include #if HAVE_SIGNAL_H #endif #if STDC_HEADERS # include #else # if !HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # if !HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif } // end extern "C" #include #include "tuyau.hpp" #include "tools.hpp" #include "user_interaction.hpp" #include "dar_suite.hpp" #include "shell_interaction.hpp" using namespace libdar; static const unsigned int buffer_size = 10000; static bool xmit = true; static int little_main(shell_interaction & dialog, int argc, char * const argv[], const char **env); static void action_xmit(user_interaction & dialog, tuyau *in, tuyau *out, U_32 duration); static void action_loop(tuyau *in, tuyau *out); static void stop_xmit(int l); int main(int argc, char * const argv[]) { return dar_suite_global(argc, argv, nullptr, "", nullptr, '\0', &little_main); } static int little_main(shell_interaction & dialog, int argc, char * const argv[], const char **env) { tuyau *in = nullptr, *out = nullptr; U_32 duration; dialog.change_non_interactive_output(&cout); if(argc != 4) { dialog.printf("usage : %s \n", argv[0]); dialog.printf("usage : %s loop\n", argv[0]); return 0; } tools_open_pipes(dialog, argv[1], argv[2], in, out); if(strcmp(argv[3],"loop") == 0) action_loop(in, out); else { duration = atol(argv[3]); action_xmit(dialog, in, out, duration); } return 0; } static void action_xmit(user_interaction & dialog, tuyau *in, tuyau *out, U_32 duration) { char out_buffer[buffer_size]; char in_buffer[buffer_size]; unsigned int lu; bool xmit_error = false; signal(SIGALRM, &stop_xmit); alarm(duration); srand((unsigned int)getpid()); while(xmit) { // generate data to send; for(unsigned int i = 0; i < buffer_size; i++) out_buffer[i] = rand() % 256; // sending data out->write(out_buffer, buffer_size); // reading it through pipes lu = 0; while(lu < buffer_size) lu += in->read(in_buffer+lu, buffer_size-lu); // compairing received data with sent one lu = 0; for(unsigned int i = 0; i < buffer_size; i++) if(out_buffer[i] != in_buffer[i]) lu++; if(lu > 0) { dialog.printf("ERROR: on %d bytes transfered %d byte(s) had error\n", buffer_size, lu); xmit_error = true; } } if(xmit_error) dialog.printf("TEST FAILED: some transmission error occured\n"); else dialog.printf("TEST PASSED SUCCESSFULLY\n"); dialog.printf("you can stop the loop instance with Control-C\n"); } static void stop_xmit(int l) { xmit = false; } static void action_loop(tuyau *in, tuyau *out) { char buffer[buffer_size]; U_32 lu; while(1) { lu = 0; while(lu < buffer_size) lu += in->read(buffer+lu, buffer_size-lu); out->write(buffer, buffer_size); } } dar-2.5.3/src/testing/test_hash_fichier.cpp0000644000175000017430000000670212641773000015642 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_FCNTL_H #include #endif } // end extern "C" #include #include "libdar.hpp" #include "hash_fichier.hpp" #include "shell_interaction.hpp" #include "fichier_local.hpp" using namespace libdar; void f1(const string & src_filename, const string & dst_filename, hash_algo algo); void error(const string & argv0); libdar::hash_algo str2hash(const string & val); static user_interaction *ui = nullptr; int main(int argc, char *argv[]) { U_I maj, med, min; get_version(maj, med, min); ui = new (nothrow) shell_interaction(&cout, &cerr, true); if(ui == nullptr) cout << "ERREUR !" << endl; try { try { try { if(argc != 4) error(argv[0]); else f1(argv[1], argv[2], str2hash(argv[3])); } catch(Egeneric & e) { ui->warning(e.get_message()); e.dump(); } } catch(...) { if(ui != nullptr) delete ui; throw; } if(ui != nullptr) delete ui; } catch(Egeneric & e) { cout << e.dump_str() << endl; } } void f1(const string & src_filename, const string & dst_filename, hash_algo algo) { fichier_local *dst_hash = new (nothrow) fichier_local(*ui, src_filename + "." + hash_algo_to_string(algo), gf_write_only, tools_octal2int("0777"), true, // fail if exsts false, // erase false); // furtive read mode fichier_local *dst_data = new (nothrow) fichier_local(*ui, dst_filename, gf_write_only, tools_octal2int("0777"), false, false, false); try { if(dst_hash == nullptr || dst_data == nullptr) throw Ememory("f1"); else { hash_fichier dst = hash_fichier(*ui, dst_data, src_filename, dst_hash, algo); dst_hash = nullptr; // now owned by dst dst_data = nullptr; // now owned by dst fichier_local src = fichier_local(src_filename); dst.set_only_hash(); src.copy_to(dst); } } catch(...) { if(dst_hash != nullptr) delete dst_hash; if(dst_data != nullptr) delete dst_data; throw; } } void error(const string & argv0) { ui->printf("usage: %S ", &argv0); } libdar::hash_algo str2hash(const string & val) { if(val == "md5") return libdar::hash_md5; if(val == "sha1") return libdar::hash_sha1; throw Erange("str2hash", "unknown hash algorithm"); } dar-2.5.3/src/testing/test_path.cpp0000644000175000017430000000613512641773000014162 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "path.hpp" using namespace libdar; using namespace std; void f2(); int main() { try { path p1 = "/"; path p2 = "toto"; path p3 = "/titi"; path p4 = "toto/titi/tutu/tata"; path p5 = "/zozo/zizi/zuzu/zaza"; cout << p2.display() << endl; path *p[5] = { &p1, &p2, &p3, &p4, &p5 }; for(S_I i = 0; i < 5; i++) { string s; cout << "base name = " << p[i]->basename() << endl; p[i]->reset_read(); cout << "reading : "; while(p[i]->read_subdir(s)) cout << " | " << s; cout << endl; cout << (p[i]->is_relative() ? "relative" : "absolute") << endl; cout << "display = [" << p[i]->display() << "]" << endl; if(p[i]->pop(s)) cout << "pop = [" << p[i]->display() << "] [" << s << "]" << endl; else cout << "no popable" << endl; } path tmp = p1 + p2; cout << tmp.display() << endl; tmp = p5 + p4; cout << tmp.display() << endl; bool res = p1 == p2; res = p1 == p1; res = p4 == p5; res = p5 == p5; res = !res; // avoid warning of unused variable } catch(Egeneric & e) { cerr << e.dump_str(); } try { path tmp = ""; } catch(Egeneric & e) { cerr << e.dump_str(); } try { path t1 = "/toto/tutu"; path t2 = "zozo/zuzu"; path t3 = t2 + t1; } catch(Egeneric & e) { cerr << e.dump_str(); } f2(); } void f2() { const char *src[] = { "toto", "/titi", "toto/./titi", "/./titi", "toto/titi/tutu/../../..", "/toto/titi/tutu/../../..", "././././toto/././././..", "/././././toto/././././..", "../../../titi/./tutu", "/../../../../toto/../../tutu", nullptr }; path conv = "/"; for(S_I i = 0; src[i] != nullptr; i++) { conv = path(src[i]); cout << string(src[i]) << " --> " << conv.display() << endl; } } dar-2.5.3/src/testing/test_blowfish.cpp0000644000175000017430000000656412641773000015051 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" extern "C" { #if HAVE_STDIO_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_STRING_H #include #endif } #include #include "libdar.hpp" #include "erreurs.hpp" #include "crypto_sym.hpp" #include "shell_interaction.hpp" #include "deci.hpp" #include "cygwin_adapt.hpp" #include "macro_tools.hpp" #include "fichier_local.hpp" using namespace libdar; using namespace std; void f1(user_interaction *dialog); void f2(user_interaction *dialog); int main() { user_interaction *dialog = new (nothrow) shell_interaction(&cout, &cerr, false); U_I maj, med, min; get_version(maj, med, min); if(dialog == nullptr) cout << "ERREUR !" << endl; try { f1(dialog); f2(dialog); } catch(Egeneric & e) { cout << "exception caught : " + e.get_message() << endl; } catch(...) { cout << "unknown exception caught" << endl; } if(dialog != nullptr) delete dialog; } void f1(user_interaction *dialog) { fichier_local fic = fichier_local(*dialog, "toto", gf_write_only, 0666, false, true, false); string pass = "bonjour"; crypto_sym bf = crypto_sym(10, secu_string(pass.c_str(), pass.size()), fic, false, macro_tools_supported_version, crypto_blowfish, true); char buffer[100] = "bonjour les amis il fait chaud il fait beau ! "; bf.write(buffer, strlen(buffer)); bf.write("toto", 4); bf.write(" a !", 4); bf.write_end_of_file(); } void f2(user_interaction *dialog) { fichier_local fic = fichier_local(*dialog, "toto", gf_read_only, 0666, false, false, false); string pass = "bonjour"; crypto_sym bf = crypto_sym(10, secu_string(pass.c_str(), pass.size()), fic, false, macro_tools_supported_version, crypto_blowfish, true); char buffer[100]; S_I lu; bool ret; cout << bf.get_position() << endl; lu = bf.read(buffer, 100); cout << bf.get_position() << endl; ret = bf.skip(0); cout << bf.get_position() << endl; lu = bf.read(buffer, 100); cout << bf.get_position() << endl; ret = bf.skip_to_eof(); cout << bf.get_position() << endl; lu = bf.read(buffer, 100); cout << bf.get_position() << endl; lu = lu+1; // avoid warning of unused variable ret = !ret; // avoid warning of unused variable } dar-2.5.3/src/testing/make_sparse_file.c0000644000175000017430000000240112610405012015077 00000000000000#include #include #include #include #include #include #include #include void error(const char *argv0); int create_file(const char *filename, unsigned long int size_byte); int main(int argc, char *argv[]) { if(argc != 3) { error(argv[0]); return 1; } else return create_file(argv[1], atol(argv[2])); } void error(const char *argv0) { fprintf(stderr, "usage: %s \n", argv0); } int create_file(const char *filename, unsigned long int size_byte) { int fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0644); if(fd < 0) { fprintf(stderr, "open() failed: %s\n", strerror(errno)); return 2; } --size_byte; if(lseek(fd, size_byte, SEEK_SET) != size_byte) { fprintf(stderr, "lseek() failed: %s\n", strerror(errno)); close(fd); return 2; } switch(write(fd, "\0", 1)) { case -1: fprintf(stderr, "write() failed: %s\n", strerror(errno)); close(fd); return 2; case 0: fprintf(stderr, "write() failed writing one byte, returning 0\n"); close(fd); return 2; case 1: close(fd); return 0; default: fprintf(stderr, "write() returned unexpected value\n"); close(fd); return 3; } } dar-2.5.3/src/testing/test_crypto_asym.cpp0000644000175000017430000000612412641773000015575 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include "libdar.hpp" #include "shell_interaction.hpp" #include "fichier_local.hpp" #include "crypto_asym.hpp" extern "C" { #if HAVE_STRING_H #include #endif } #include #include using namespace std; using namespace libdar; static shell_interaction ui = shell_interaction(&cout, &cerr, false); void encrypt(vector recipients, const string & src, const string & dst); void decrypt(const string & src, const string & dst); int main(int argc, char *argv[]) { U_I maj, med, min; if(argc < 3) { cout << "usage: " << argv[0] << " crypt [... ]" << endl; cout << " " << argv[0] << " decrypt " << endl; return 1; } get_version(maj, med, min); try { if(strcmp(argv[1], "crypt") == 0) { vector recip; for(signed int i = 4; i < argc; ++i) recip.push_back(argv[i]); if(recip.empty()) cout << "ERROR: need at least one email in the recipient list" << endl; else encrypt(recip, argv[2], argv[3]); } else if(strcmp(argv[1], "decrypt") == 0) { decrypt(argv[2], argv[3]); } else cout << "ERROR: first argument must either be 'crypt' or 'decrypt'" << endl; } catch(Egeneric & e) { ui.printf("Exception caught: %S", &(e.get_message())); cout << e.dump_str() << endl; } catch(...) { ui.printf("unknown exception caught"); } return 0; } void encrypt(vector recipients, const string & src, const string & dst) { fichier_local fsrc = fichier_local(ui, src, gf_read_only, 0, false, false, false); fichier_local fdst = fichier_local(ui, dst, gf_write_only, 0644, false, true, false); crypto_asym engine = ui; engine.encrypt(recipients, fsrc, fdst); } void decrypt(const string & src, const string & dst) { fichier_local fsrc = fichier_local(ui, src, gf_read_only, 0, false, false, false); fichier_local fdst = fichier_local(ui, dst, gf_write_only, 0644, false, true, false); crypto_asym engine = ui; engine.decrypt(fsrc, fdst); } dar-2.5.3/src/testing/test_range.cpp0000644000175000017430000000301612641773000014315 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "libdar.hpp" using namespace libdar; using namespace std; static void f1(); int main() { U_I major, medium, minor; get_version(major, medium, minor); f1(); } static void f1() { range r1(1, 5); range r2(7, 10); cout << r1.display() << " " << r2.display() << endl; range r3 = r1 + r2; range r4 = r2 + r1; cout << r3.display() << " " << r4.display() << endl; range r5(6,6); r3 += r5; cout << r5.display() << endl; } dar-2.5.3/src/testing/test_storage.cpp0000644000175000017430000001034412610405012014656 00000000000000/*********************************************************************/ // dar - disk archive - a backup/restoration program // Copyright (C) 2002-2052 Denis Corbin // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // to contact the author : http://dar.linux.free.fr/email.html /*********************************************************************/ #include "../my_config.h" #include #include "storage.hpp" #include "infinint.hpp" #include "erreurs.hpp" #include "integers.hpp" using namespace libdar; using namespace std; void f1(); void f2(); void affiche(infinint x) { U_32 l = 0; x.unstack(l); do { cout << "+" << (U_I)l ; l = 0; x.unstack(l); } while( l > 0); cout << endl; } void affiche(const storage & ref) { storage::iterator it = ref.begin(); while(it != ref.end()) cout << *(it++); cout << endl; } int main(S_I argc, char *argv[]) { f1(); f2(); } void f1() { try { storage st1(10), st2(12); storage *test; infinint u; test = new storage(st1); delete test; u = 10; affiche(u); test = new storage(u); u = test->size(); affiche(u); if(*test < st1) cout << "vrai" << endl; else cout << "faux" << endl; if(*test == st2) cout << "vrai" << endl; else cout << "faux" << endl; if(*test == st1) cout << "vrai" << endl; else cout << "faux" << endl; if(st2 < *test) cout << "vrai" << endl; else cout << "faux" << endl; unsigned char b = 'a' + 3; cout << b << endl; for(S_I i = 0; infinint(i) < st1.size(); i++) st1[i] = 'a' + i; affiche(st1); storage::iterator it = st1.begin(); while(it != st1.end()) cout << *(it++); cout << endl; it = st1.rbegin(); while(it != st1.rend()) cout << *(it--); cout << endl; const storage cst = st1; cout << cst[3] << endl; st2 = st1; st1.clear(); affiche(st1); affiche(st2); it = st2.rbegin(); affiche(it.get_position()); it = st2.begin(); st2.write(it, (unsigned char *)"coucou les amis il fait chaud il fait beau, les mouches pettent et les cailloux fleurissent", st2.size() % 100); affiche(st2); char buffer[100]; it = ++(st2.begin()); st2.read(it, (unsigned char *)buffer, st2.size() % 100); delete test; it = st2.begin() + 3; affiche(it.get_position()); st2.insert_null_bytes_at_iterator(it, 5); affiche(st2); it = st2.rbegin() - 5; st2.remove_bytes_at_iterator(it, 10); affiche(st2); it = st2.rbegin() - 5; st2.insert_bytes_at_iterator(it,(unsigned char *)buffer, st2.size() % 100); affiche(st2); } catch(Egeneric &r) { cout << "exception connue attrappee" << endl; } catch(...) { cout << "exception NON connue attrappee" << endl; } } void f2() { infinint u = 1; infinint s, size; S_I i; for(i = 2; i < 10; i++) u *= i; affiche(u); storage x = u; storage::iterator it; it = x.begin(); i = 0; while(it != x.end()) *(it++) = (unsigned char)('A' + (i++ % 70)); affiche(x); size = x.size(); u = size / 2; it.skip_to(x, u); x.remove_bytes_at_iterator(it, 2000); u = x.size(); affiche(u); affiche(x); } dar-2.5.3/src/check/0000755000175000017520000000000012642474572011153 500000000000000dar-2.5.3/src/check/routine.sh0000755000175000017430000003371612641772777013140 00000000000000#!/bin/bash if [ $# -lt 1 ]; then echo "usage: $0 " echo "example: $0 A1 B1 B2 B3" exit 1 fi ## environement required: # OPT environment variable (DCF file for common parameters) if [ "$OPT" = "" ]; then echo '$OPT not set' exit 2 fi if [ "$DAR" = "" ]; then echo '$DAR not set' exit 2 fi if [ ! -z "$ROUTINE_DEBUG" -a "$ROUTINE_DEBUG" != "debug" ] ; then echo 'unvalid value given to environment variable ROUTINE_DEBUG' exit 2 fi # DAR environment variable points to dar # ## relies on: # ./build_tree.sh # ./modif_tree.sh src=SRC dst=DST src2=SRC2 full=full catf=catf catf_fly=catf_fly double_catf=double_catf double_catf_fly=double_catf_fly diff=diff catd=catd catd_fly=catd_fly double_catd=double_catd double_catd_fly=double_catd_fly diff_fly=diff_fly diff_double=diff_double diff_double_fly=diff_double_fly merge_full=merge_full merge_diff=merge_diff full2=full2 diff2=diff2 full3=full3 decr=decr todar=todar toslave=toslave piped=piped piped_fly=piped_fly xformed1=xformed1 xformed2=xformed2 xformed3=xformed3 hash="`sed -r -n -e 's/--hash (.*)/\1/p' tmp.file | tail -n 1`" hash_xform="-3 $hash" if [ "$hash" = "" ] ; then hash="none" hash_xform="" fi function my_diff { if [ "$1" = "" -o "$2" = "" ] ; then echo "usage: $0 " return 1 fi cd "$1" tar -cf "../$1.tmp.tar" . cd "../$2" tar -df "../$1.tmp.tar" local ret1=$? tar -cf "../$2.tmp.tar" . cd "../$1" tar -df "../$2.tmp.tar" local ret2=$? cd .. rm "$1.tmp.tar" "$2.tmp.tar" return `[ $ret1 -eq 0 -a $ret2 -eq 0 ]` } function GO { if [ "$1" == "" ] ; then echo "usage: $0