From 335fe547211752f0aa9fd12aa1910eb25e64bfa9 Mon Sep 17 00:00:00 2001 From: Richard Penney Date: Sun, 4 Sep 2022 09:04:28 +0100 Subject: [PATCH] Baselined against release 5.3.2 (d10aa33b) --- ChangeLog | 8 + Makefile.in | 1001 +++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- RELNOTES | 26 +- armour-luks.c | 4 +- configure.ac | 4 +- cryptmount.c | 6 +- cryptmount.spec | 2 +- debian/changelog | 8 + debian/control | 2 +- debian/docs | 1 - debian/rules | 2 +- fsutils.c | 16 +- looputils.c | 3 +- man/cmtab.5.in | 28 +- po/cryptmount.pot | 85 ++-- po/de.po | 90 ++-- po/fr.po | 88 ++-- testing/mudslinger.in | 188 ++++---- utils.c | 4 +- 20 files changed, 1302 insertions(+), 266 deletions(-) create mode 100644 Makefile.in diff --git a/ChangeLog b/ChangeLog index 1229001..6561ac0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ ChangeLog for cryptmount (http://cryptmount.sourceforge.net) +16Nov19 - Refined handling of passwords in "mudslinger" testing script + +06Oct19 - Improved documentation of default values in cmtab manual page + +28Sep19 - Removed use of 'minix' filesystem in testing script + +06Jan19 - Fixed various memory leaks in mount/unmount pathways + 05Jan19 - Fixed memory cleanup error on closedown when using multiple targets 17Mar18 - *** cryptmount-5.3 released diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..d6ba936 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,1001 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 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@ + +# automake script for 'cryptmount' +# RW Penney, November 2005 + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +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 = cryptmount$(EXEEXT) +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = delegates.h doxygen.conf +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_cryptmount_OBJECTS = cryptmount.$(OBJEXT) armour.$(OBJEXT) \ + armour-builtin.$(OBJEXT) armour-gcry.$(OBJEXT) \ + armour-luks.$(OBJEXT) blowfish.$(OBJEXT) dmutils.$(OBJEXT) \ + fsutils.$(OBJEXT) looputils.$(OBJEXT) tables.$(OBJEXT) \ + utils.$(OBJEXT) cmtesting.$(OBJEXT) +cryptmount_OBJECTS = $(am_cryptmount_OBJECTS) +am__DEPENDENCIES_1 = +@BUILD_LUKSCOMPAT_TRUE@cryptmount_DEPENDENCIES = \ +@BUILD_LUKSCOMPAT_TRUE@ $(am__DEPENDENCIES_1) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = +am__maybe_remake_depfiles = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(cryptmount_SOURCES) +DIST_SOURCES = $(cryptmount_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-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 \ + tags-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 +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/delegates.h.in $(srcdir)/doxygen.conf.in ABOUT-NLS \ + AUTHORS COPYING ChangeLog INSTALL NEWS README compile \ + config.guess config.rpath config.sub install-sh missing \ + mkinstalldirs +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__post_remove_distdir = $(am__remove_distdir) +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 +DIST_TARGETS = dist-gzip +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CFLAGS = @CFLAGS@ +CM_DEFAULT_CIPHER = @CM_DEFAULT_CIPHER@ +CM_DEFAULT_SUPATH = @CM_DEFAULT_SUPATH@ +CM_SYSCONF_DIR = @CM_SYSCONF_DIR@ +CM_SYSRUN_DIR = @CM_SYSRUN_DIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DOXYGEN_DOCDIR = @DOXYGEN_DOCDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ERSATZ_MOUNT = @ERSATZ_MOUNT@ +ERSATZ_UMOUNT = @ERSATZ_UMOUNT@ +EXEEXT = @EXEEXT@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +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@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBS_GCRY = @LIBS_GCRY@ +LIBS_LUKS = @LIBS_LUKS@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +OBJEXT = @OBJEXT@ +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_FSCK = @PATH_FSCK@ +PATH_MKSWAP = @PATH_MKSWAP@ +PATH_MOUNT = @PATH_MOUNT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PATH_UMOUNT = @PATH_UMOUNT@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WITH_CSWAP = @WITH_CSWAP@ +WITH_FSCK = @WITH_FSCK@ +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_CC = @ac_ct_CC@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libcryptsetup_CFLAGS = @libcryptsetup_CFLAGS@ +libcryptsetup_LIBS = @libcryptsetup_LIBS@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = $(datadir)/locale +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +use_doxygen = @use_doxygen@ +AM_CPPFLAGS = -DCM_SYSCONF_DIR="\"$(CM_SYSCONF_DIR)\"" \ + -DCM_SYSRUN_DIR="\"$(CM_SYSRUN_DIR)\"" \ + -DLOCALEDIR=\"$(localedir)\" +cryptmount_SOURCES = cryptmount.c cryptmount.h \ + armour.c armour.h \ + armour-builtin.c armour-gcry.c armour-luks.c \ + blowfish.c blowfish.h \ + dmutils.c dmutils.h \ + fsutils.c fsutils.h \ + looputils.c looputils.h \ + tables.c tables.h \ + utils.c utils.h \ + cmtesting.c cmtesting.h + +cryptmount_NONHEADERS = $(shell echo "${cryptmount_SOURCES}" | sed 's%\<[^ ]*\.h\>%%g') +@BUILD_LUKSCOMPAT_TRUE@cryptmount_LDADD = ${libcryptsetup_LIBS} +EXTRA_DIST = config.rpath mkinstalldirs cmtab.example \ + README.sshfs RELNOTES ToDo cryptmount.spec \ + debian/changelog debian/compat debian/control \ + debian/copyright debian/docs \ + debian/rules debian/cryptmount.lintian-overrides \ + debian/postinst debian/postrm debian/watch debian/source/format \ + debian/upstream/signing-key.asc + +SUBDIRS = man po sysinit testing +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .o .obj +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 --ignore-deps'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu --ignore-deps \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu --ignore-deps 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__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + 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 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +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 +delegates.h: $(top_builddir)/config.status $(srcdir)/delegates.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +doxygen.conf: $(top_builddir)/config.status $(srcdir)/doxygen.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +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 \ + ; 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) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(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: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +cryptmount$(EXEEXT): $(cryptmount_OBJECTS) $(cryptmount_DEPENDENCIES) $(EXTRA_cryptmount_DEPENDENCIES) + @rm -f cryptmount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(cryptmount_OBJECTS) $(cryptmount_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(AM_V_CC)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +# 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. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + 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" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + 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; \ + $(am__define_uniq_tagged_files); \ + 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-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + 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" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(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 + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_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*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(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*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(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/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(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__post_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 $(PROGRAMS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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-binPROGRAMS clean-generic clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr 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-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +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-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: $(am__recursive_targets) all install-am install-exec-am \ + install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-binPROGRAMS \ + clean-cscope clean-generic clean-local cscope cscopelist-am \ + ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ + dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck 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 installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +install-exec-hook: install-etcdir + chown root.root $(DESTDIR)$(bindir)/cryptmount$(EXEEXT) + chmod u+srwx,go-w,go+r $(DESTDIR)$(bindir)/cryptmount$(EXEEXT) + @if test -z "$(DESTDIR)" -o "$(DESTDIR)" = "/"; then \ + modprobe -a loop dm-crypt || true; \ + ( egrep -q '\' /proc/devices \ + && egrep -q '\' /proc/devices ) || \ + echo "Warning: kernel support for /dev/loop and /dev/mapper is needed by cryptmount"; \ + fi + +.PHONY: install-etcdir +install-etcdir: + if test ! -d "${DESTDIR}${CM_SYSCONF_DIR}" ; then \ + ${mkdir_p} "${DESTDIR}${CM_SYSCONF_DIR}" ; \ + ${INSTALL_PROGRAM_ENV} ${INSTALL_DATA} cmtab.example "${DESTDIR}${CM_SYSCONF_DIR}" ; \ + fi + if test ! -f "${DESTDIR}${CM_SYSCONF_DIR}/cmtab" ; then \ + echo -e "# ${CM_SYSCONF_DIR}/cmtab - encrypted filesystem information for cryptmount\n# try 'man 8 cryptmount' or 'man 5 cmtab' for more details\n" >> "${DESTDIR}${CM_SYSCONF_DIR}/cmtab"; \ + fi + +install-setup: setupscript + test -d "${DESTDIR}${sbindir}" || ${mkdir_p} "${DESTDIR}${sbindir}" + ${INSTALL_PROGRAM_ENV} ${INSTALL_SCRIPT} setupscript "${DESTDIR}${sbindir}/cryptmount-setup" + +clean-local: + -rm -f splint.log + +dist-hook: + sed -e "s,^\(Version:\s*\)[0-9].*,\1${VERSION}," cryptmount.spec > cm_spec.new; cmp -q cryptmount.spec cm_spec.new || mv cm_spec.new cryptmount.spec; rm -f cm_spec.new + +pedantic: CFLAGS = -Wall -W -pedantic -g +pedantic: ${bin_PROGRAMS} + +@HAVE_DOXYGEN_TRUE@doxydocs: doxygen.conf +@HAVE_DOXYGEN_TRUE@ doxygen doxygen.conf + +.PHONY: splint +splint: + @echo -n "" > splint.log + for src in ${cryptmount_NONHEADERS}; do \ + echo "==== $${src} ====" >> splint.log; \ + splint ${DEFS} ${DEFAULT_INCLUDES} ${INCLUDES} ${AM_CPFLAGS} ${CPPFLAGS} -D__signed__="" -posix-lib -checks $${src} >> splint.log 2>&1 ; \ + echo -e "\n\n" >> splint.log || true; \ + done + +# 'cmtest' target is for use with 'mudslinger' testing script: +cmtest: CFLAGS = -Wall -g -DTESTING -DCM_SRCDIR=\"${abs_srcdir}\" +cmtest: ${bin_PROGRAMS} + ${MAKE} -C testing autokeys mudslinger + +.PHONY: depend +depend: + ${CC} -MM ${DEFS} ${DEFAULT_INCLUDES} ${INCLUDES} ${AM_CPFLAGS} ${CPPFLAGS} ${cryptmount_NONHEADERS} > .depend +-include .depend + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/README.md b/README.md index 9bee268..9dac71a 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ supplied with cryptmount. cryptmount has been tested (using the "mudslinger" script in the 'testing' sub-directory) on a variety of GNU/Linux platforms including: -Debian 9.0, Ubuntu 16.04, Fedora 27, SuSE 13.2 etc. +Debian 9.0, Ubuntu 18.04, CentOS 7.6, ArchLinux etc. For the most recent version of cryptmount, please see http://www.sourceforge.net/projects/cryptmount diff --git a/RELNOTES b/RELNOTES index 4d48ab0..ccbac89 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,6 +1,6 @@ - Release notes for cryptmount-5.3.1 + Release notes for cryptmount-5.3.2 - RW Penney, January 2019 + RW Penney, November 2019 Introduction ============ @@ -9,9 +9,9 @@ an ordinary user to mount an encrypted filing system without requiring superuser privileges, and which assists the system-administrator in creating and managing encrypted filesystems & swap-partitions. -cryptmount was written to address differences between the capabilities of -the loopback device of the 2.4/2.6 kernel series and the newer, preferred, -device-mapper mechanisms of kernels since linux-2.6. +cryptmount was originally written because of differences between +the capabilities of the loopback device of the 2.4/2.6 kernel series +and the newer, preferred, device-mapper mechanisms of kernels since linux-2.6. cryptmount automatically performs the various stages of configuring any supporting loopback and device-mapper targets needed to access an encrypted filing system before actually mounting it, but @@ -38,21 +38,21 @@ This (stable) release offers the following enhancements: It has been tested on the following systems: - * Arch Linux (early-Jan-2019) (x86_64) + * Arch Linux (mid-Nov-2019) (x86_64) - * CentOS 7.4 (x86_64) + * CentOS 8.0.1905 (x86_64) - * Debian GNU/Linux 10.x ("buster"/"testing", early-Jan-2019) (x86) + * Debian GNU/Linux 11.x ("bullseye"/"testing", mid_Nov-2019) (x86) - * Debian GNU/Linux 9.6 ("stretch") (x86) + * Debian GNU/Linux 10.2 ("buster") (amd64, x86) - * Debian GNU/Linux 8.10 ("jessie") (x86) + * Debian GNU/Linux 9.11 ("stretch") (x86) - * Fedora 27 (x86_64) + * Debian GNU/Linux 8.11 ("jessie") (x86) - * Gentoo (early-Jan-2019) (x86) + * Gentoo (mid-Nov-2019) (x86) - * Ubuntu 18.04 ("bionic") (x86_64) + * Ubuntu 19.10 ("eoan") (x86_64) Summary of new features in cryptmount-5.2 diff --git a/armour-luks.c b/armour-luks.c index eab5747..ba46a6c 100644 --- a/armour-luks.c +++ b/armour-luks.c @@ -213,7 +213,9 @@ static uid_t luks_patch_uid(const bound_tgtdefn_t* boundtgt) if (stat(filename, &sbuff) == 0 && S_ISREG(sbuff.st_mode)) { - (void)setuid(geteuid()); + if (setuid(geteuid()) != 0) { + fprintf(stderr, _("Failed to acquire privileges for LUKS container")); + } } return olduid; diff --git a/configure.ac b/configure.ac index 762d756..3d0a609 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,9 @@ dnl autoconf script for cryptmount -dnl (C)Copyright 2005-2018, RW Penney +dnl (C)Copyright 2005-2019, RW Penney dnl run 'aclocal; autoconf; automake -a -c -i; ./configure; make' -AC_INIT(cryptmount, 5.3.1, cryptmount@rwpenney.uk) +AC_INIT(cryptmount, 5.3.2, cryptmount@rwpenney.uk) AC_PREREQ(2.59) test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc diff --git a/cryptmount.c b/cryptmount.c index 9a7ae95..6c9a733 100644 --- a/cryptmount.c +++ b/cryptmount.c @@ -458,6 +458,7 @@ static int do_devsetup(const km_pw_context_t *pw_ctxt, bail_out: if (killloop) unblockify_file(&tgtdev, isloop); /* mounting failed? */ + if (tgtdev) free((void*)tgtdev); sec_free(dmparams); sec_free(key); @@ -593,8 +594,8 @@ static int do_unmount(const bound_tgtdefn_t *boundtgt) { const tgtdefn_t *tgt = boundtgt->tgt; int eflag=ERR_NOERROR; struct passwd *pwent; - char *mntdev=NULL; - tgtstat_t *tstat; + char *mntdev = NULL; + tgtstat_t *tstat = NULL; /* Check if filing system has been configured at all: */ if (!is_mounted(tgt) || (tstat = get_tgtstatus(tgt)) == NULL) { @@ -637,6 +638,7 @@ static int do_unmount(const bound_tgtdefn_t *boundtgt) bail_out: if (mntdev != NULL) free((void*)mntdev); + if (tstat != NULL) free_tgtstatus(tstat); return eflag; } diff --git a/cryptmount.spec b/cryptmount.spec index 9287c21..9ec8b7e 100644 --- a/cryptmount.spec +++ b/cryptmount.spec @@ -4,7 +4,7 @@ # Summary: Let ordinary users mount an encrypted file system Name: cryptmount -Version: 5.3.1 +Version: 5.3.2 Release: 1%{?dist} License: GPL URL: http://cryptmount.sourceforge.net diff --git a/debian/changelog b/debian/changelog index 85f1c77..be5bd92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +cryptmount (5.3.2-1) unstable; urgency=low + + * New upstream release + - various documentation cleanups + - fixed (benign) memory leak + + -- RW Penney Sun, 17 Nov 2019 16:20:00 +0000 + cryptmount (5.3.1-1) unstable; urgency=low * New upstream release: diff --git a/debian/control b/debian/control index 2371dbc..dfbf73d 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Homepage: http://cryptmount.sourceforge.net Build-Depends: automake, debhelper (>= 10), libcryptsetup-dev (>= 1.6), libdevmapper-dev, libgcrypt20-dev (>= 1.5), pkg-config Rules-Requires-Root: binary-targets -Standards-Version: 4.3.0 +Standards-Version: 4.4.1 Package: cryptmount Architecture: linux-any diff --git a/debian/docs b/debian/docs index 960de36..9102d86 100644 --- a/debian/docs +++ b/debian/docs @@ -1,4 +1,3 @@ -NEWS README.md README.sshfs RELNOTES diff --git a/debian/rules b/debian/rules index 30409e5..7bd8a29 100755 --- a/debian/rules +++ b/debian/rules @@ -9,7 +9,7 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk # see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_BUILD_MAINT_OPTIONS = hardening=+all # see ENVIRONMENT in dpkg-buildflags(1) # package maintainers to append CFLAGS diff --git a/fsutils.c b/fsutils.c index 8ab05e2..eaddb43 100644 --- a/fsutils.c +++ b/fsutils.c @@ -447,8 +447,8 @@ int do_rmvmntent(const tgtdefn_t *tgt) * to swap partitions, even if they are active. */ int is_mounted(const tgtdefn_t *tgt) -{ int mounted=0; - char *mntdev=NULL; +{ int mounted = 0; + char *mntdev = NULL; struct mntent *mntinfo; struct stat st_mtb, st_tgt; FILE *fp; @@ -458,12 +458,17 @@ int is_mounted(const tgtdefn_t *tgt) /* find path to device that would have been mounted & device info: */ devmap_path(&mntdev, tgt->ident); - if (stat(mntdev, &st_tgt) != 0) return 0; + if (stat(mntdev, &st_tgt) != 0) { + mounted = 0; + goto bail_out; + } /* check entries in /etc/mtab: */ fp = setmntent(ETCMTAB, "r"); if (fp == NULL) { - return 0; /* indeterminate case - assume not mounted */ + /* indeterminate case - assume not mounted */ + mounted = 0; + goto bail_out; } while ((mntinfo = getmntent(fp)) != NULL && !mounted) { if (stat(mntinfo->mnt_fsname, &st_mtb) != 0) continue; @@ -476,6 +481,9 @@ int is_mounted(const tgtdefn_t *tgt) } endmntent(fp); + bail_out: + if (mntdev) free((void*)mntdev); + return mounted; } diff --git a/looputils.c b/looputils.c index 374d627..014cda8 100644 --- a/looputils.c +++ b/looputils.c @@ -47,6 +47,7 @@ #include "cryptmount.h" #include "looputils.h" +char *cm_strdup(const char *orig); /** @@ -248,7 +249,7 @@ int blockify_file(const char *filename, int fmode, const char *prefdev, if (S_ISBLK(sbuff.st_mode)) { /* Keyfile is block-special already: */ - *devname = filename; + *devname = cm_strdup(filename); *isloop = 0; } else if (S_ISREG(sbuff.st_mode)) { /* Create loopback device around ordinary file: */ diff --git a/man/cmtab.5.in b/man/cmtab.5.in index db90a8c..d0a50a9 100644 --- a/man/cmtab.5.in +++ b/man/cmtab.5.in @@ -12,7 +12,7 @@ .. -.TH CMTAB 5 "2019-01-05" "@PACKAGE_VERSION@" "User commands" +.TH CMTAB 5 "2019-10-06" "@PACKAGE_VERSION@" "User commands" .SH NAME cmtab \- static information about filesystems managed by cryptmount @@ -25,11 +25,16 @@ Information about the encrypted filesystems managed by is contained in the file @CM_SYSCONF_DIR@/cmtab. Each filesystem is labelled by a target name which can be used as an argument to .B cryptmount -and which appears in @CM_SYSCONF_DIR@/cmtab in front of a list of parameters describing where that filesystem is stored, and how it is encrypted. +and which appears in @CM_SYSCONF_DIR@/cmtab in front of a list of parameters +describing where that filesystem is stored, and how it is encrypted. -The format of the cmtab is flexible, with the description of each target being delimited by braces, parameters being specified by KEY=VALUE pairs, and white-space being freely usable. -Comments are prefixed by a `#' character, and can start at any point in a line, lasting to the end of the line. -The backslash character `\\' can be used to ignore any special significance of the following character, for example to include a space in a filename. +The format of the cmtab is flexible, with the description of each target +being delimited by braces, parameters being specified by KEY=VALUE pairs, +and white-space being freely usable. +Comments are prefixed by a `#' character, and can start at any point in a line, +lasting to the end of the line. +The backslash character `\\' can be used to ignore any special significance +of the following character, for example to include a space in a filename. @CM_SYSCONF_DIR@/cmtab contains entries of the following form: @@ -40,7 +45,7 @@ The backslash character `\\' can be used to ignore any special significance of t startsector=STARTSECTOR numsectors=NUMSECTORS loop=LOOPDEV - dir=MOUNT_POINT + dir=MOUNT_POINT # REQUIRED fstype=TYPE # REQUIRED mountoptions=MOPT,MOPT,... fsckoptions=FOPT;FOPT;... @@ -94,7 +99,7 @@ each will undo the effects of previous default values - i.e. this pseudo-target does not operate incrementally. .\" ---- .TP -.B dev=DEVICE +.B dev=DEVICE\t(required) sets the name of the raw device (e.g. /dev/hdb63) or ordinary file (e.g. /home/secretiveuser/private.fs) that contains the encrypted filesystem. @@ -137,11 +142,11 @@ can be used to specify a particular loopback device (e.g. /dev/loop0) to be used when DEVICE is an ordinary file. This parameter is optional and defaults to "auto". .TP -.B dir=MOUNT_POINT +.B dir=MOUNT_POINT\t(required) specifies the directory onto which the encrypted filesystem will be mounted. .\" ---- .TP -.B fstype=TYPE +.B fstype=TYPE\t(required) sets the filesystem type (as used by .B mount (8)). @@ -175,7 +180,8 @@ By default, this PATH is set to @CM_DEFAULT_SUPATH@. .B bootaction=BOOTACTION indicates what action, if any, should be taken for this target on system bootup. -BOOTACTION can be one of "none", "mount", "swap" or "prepare". +BOOTACTION can be one of "none", "mount", "swap" or "prepare", +with the default being "none". .TP .B cipher=CIPHER sets the encryption algorithm used on the @@ -199,7 +205,7 @@ if absent, "builtin" will be used on first generating the key, with an automatic choice being made when reading a pre-existing key. .\" ---- .TP -.B keyfile=KEYFILE +.B keyfile=KEYFILE\t(required) gives the name of an ordinary file that contains the key used by the .B CIPHER algorithm to decrypt the filesystem. This key is itself encrypted in a way specified by the diff --git a/po/cryptmount.pot b/po/cryptmount.pot index eace863..86b1e65 100644 --- a/po/cryptmount.pot +++ b/po/cryptmount.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: rwpenney@users.sourceforge.net\n" -"POT-Creation-Date: 2019-01-05 14:15+0000\n" +"POT-Creation-Date: 2019-10-19 08:27+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -87,32 +87,37 @@ msgstr "" msgid "Checksum mismatch in keyfile (openssl-compat, ofs=%u,idx=%u)\n" msgstr "" -#: armour-luks.c:308 armour-luks.c:392 +#: armour-luks.c:217 +#, c-format +msgid "Failed to acquire privileges for LUKS container" +msgstr "" + +#: armour-luks.c:310 armour-luks.c:394 #, c-format msgid "Failed to initialize device for LUKS keyfile\n" msgstr "" -#: armour-luks.c:318 +#: armour-luks.c:320 #, c-format msgid "Failed to extract LUKS key for \"%s\" (errno=%d)\n" msgstr "" -#: armour-luks.c:379 +#: armour-luks.c:381 #, c-format msgid "Formatting \"%s\", will probably destroy all existing data" msgstr "" -#: armour-luks.c:408 +#: armour-luks.c:410 #, c-format msgid "Failed to create LUKS header for \"%s\"\n" msgstr "" -#: armour-luks.c:418 +#: armour-luks.c:420 #, c-format msgid "Failed to create LUKS key for \"%s\"\n" msgstr "" -#: armour-luks.c:431 +#: armour-luks.c:433 #, c-format msgid "Setting password on LUKS keyslot-%u\n" msgstr "" @@ -178,32 +183,32 @@ msgstr "" msgid "Device-mapper target-creation failed for \"%s\"\n" msgstr "" -#: cryptmount.c:487 cryptmount.c:720 +#: cryptmount.c:488 cryptmount.c:722 #, c-format msgid "Target \"%s\" does not appear to be configured\n" msgstr "" -#: cryptmount.c:502 +#: cryptmount.c:503 #, c-format msgid "Cannot stat \"%s\"\n" msgstr "" -#: cryptmount.c:510 +#: cryptmount.c:511 #, c-format msgid "Failed to remove device-mapper target \"%s\"\n" msgstr "" -#: cryptmount.c:543 +#: cryptmount.c:544 #, c-format msgid "Target \"%s\" is already mounted\n" msgstr "" -#: cryptmount.c:601 +#: cryptmount.c:602 #, c-format msgid "Target \"%s\" does not appear to be mounted\n" msgstr "" -#: cryptmount.c:611 +#: cryptmount.c:612 #, c-format msgid "Only \"%s\" can unmount \"%s\"\n" msgstr "" @@ -211,122 +216,122 @@ msgstr "" #. TRANSLATORS: the following expands to include #. the *numerical* user-identity in place of '%lu', #. e.g. giving 'only user-16 can unmount "target"': -#: cryptmount.c:617 +#: cryptmount.c:618 #, c-format msgid "Only user-%lu can unmount \"%s\"\n" msgstr "" -#: cryptmount.c:661 +#: cryptmount.c:663 #, c-format msgid "Target \"%s\" is already configured\n" msgstr "" -#: cryptmount.c:684 cryptmount.c:740 +#: cryptmount.c:686 cryptmount.c:742 #, c-format msgid "Crypto-swap is not supported by this installation of cryptmount\n" msgstr "" -#: cryptmount.c:772 +#: cryptmount.c:774 #, c-format msgid "Key-file for \"%s\" isn't password-protected\n" msgstr "" -#: cryptmount.c:798 cryptmount.c:919 +#: cryptmount.c:800 cryptmount.c:921 #, c-format msgid "Cannot open \"%s\" for writing\n" msgstr "" -#: cryptmount.c:813 +#: cryptmount.c:815 #, c-format msgid "Retiring old key (%s -> %s) failed\n" msgstr "" -#: cryptmount.c:821 +#: cryptmount.c:823 #, c-format msgid "Installing new key (%s -> %s) failed\n" msgstr "" -#: cryptmount.c:828 +#: cryptmount.c:830 #, c-format msgid "Backup of previous key is in \"%s\"\n" msgstr "" -#: cryptmount.c:868 cryptmount.c:1545 +#: cryptmount.c:870 cryptmount.c:1547 #, c-format msgid "Target name \"%s\" is not recognized\n" msgstr "" -#: cryptmount.c:874 +#: cryptmount.c:876 #, c-format msgid "Bad key-length parameter" msgstr "" -#: cryptmount.c:886 +#: cryptmount.c:888 #, c-format msgid "Key-file \"%s\" already exists for target \"%s\"\n" msgstr "" -#: cryptmount.c:896 +#: cryptmount.c:898 #, c-format msgid "Generating random key; please be patient...\n" msgstr "" -#: cryptmount.c:900 +#: cryptmount.c:902 #, c-format msgid "Failed to generate new key\n" msgstr "" -#: cryptmount.c:933 +#: cryptmount.c:935 #, c-format msgid "Installation of new keyfile \"%s\" failed" msgstr "" -#: cryptmount.c:1069 +#: cryptmount.c:1071 #, c-format msgid "Only root can use option \"%s\"\n" msgstr "" -#: cryptmount.c:1082 +#: cryptmount.c:1084 #, c-format msgid "Only root can configure \"%s\"\n" msgstr "" -#: cryptmount.c:1146 +#: cryptmount.c:1148 #, c-format msgid "Cannot find key-manager to match target \"%s\"\n" msgstr "" -#: cryptmount.c:1413 +#: cryptmount.c:1415 #, c-format msgid "Multiple operating modes not supported\n" msgstr "" -#: cryptmount.c:1468 +#: cryptmount.c:1470 #, c-format msgid "Memory-locking failed...\n" msgstr "" -#: cryptmount.c:1496 +#: cryptmount.c:1498 #, c-format msgid "Bad file-descriptor (%d)\n" msgstr "" -#: cryptmount.c:1506 +#: cryptmount.c:1508 #, c-format msgid "Security failure\n" msgstr "" -#: cryptmount.c:1525 +#: cryptmount.c:1527 #, c-format msgid "Trailing command-line arguments given with '--all' option\n" msgstr "" -#: cryptmount.c:1557 +#: cryptmount.c:1559 #, c-format msgid "Target security failure for \"%s\"\n" msgstr "" -#: cryptmount.c:1566 +#: cryptmount.c:1568 #, c-format msgid "No targets specified\n" msgstr "" @@ -343,17 +348,17 @@ msgid "" "mkswap manually\n" msgstr "" -#: looputils.c:225 +#: looputils.c:226 #, c-format msgid "Failed to free device (%d,%d)\n" msgstr "" -#: looputils.c:261 +#: looputils.c:262 #, c-format msgid "No available loopback devices\n" msgstr "" -#: looputils.c:275 +#: looputils.c:276 #, c-format msgid "Bad device type (%x) for \"%s\" (need block/file)\n" msgstr "" diff --git a/po/de.po b/po/de.po index 4ab22bd..147d17f 100644 --- a/po/de.po +++ b/po/de.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: cryptmount 4.2-1\n" "Report-Msgid-Bugs-To: rwpenney@users.sourceforge.net\n" -"POT-Creation-Date: 2019-01-05 14:15+0000\n" +"POT-Creation-Date: 2019-10-19 08:27+0100\n" "PO-Revision-Date: 2011-06-12 12:07+0200\n" "Last-Translator: Kai Wasserbäch \n" "Language-Team: German \n" @@ -88,34 +88,40 @@ msgstr "" "Nicht übereinstimmende Prüfsumme in der Schlüsseldatei (openssl-compat, ofs=" "%u, idx=%u).\n" -#: armour-luks.c:308 armour-luks.c:392 +#: armour-luks.c:217 +#, fuzzy, c-format +msgid "Failed to acquire privileges for LUKS container" +msgstr "" +"Erstellen eines neuen Loop-Gerätes für LUKS-Schlüsseldatei schlug fehl.\n" + +#: armour-luks.c:310 armour-luks.c:394 #, fuzzy, c-format msgid "Failed to initialize device for LUKS keyfile\n" msgstr "" "Erstellen eines neuen Loop-Gerätes für LUKS-Schlüsseldatei schlug fehl.\n" -#: armour-luks.c:318 +#: armour-luks.c:320 #, c-format msgid "Failed to extract LUKS key for \"%s\" (errno=%d)\n" msgstr "Auslesen des LUKS-Schlüssels für »%s« schlug fehl (errno=%d).\n" -#: armour-luks.c:379 +#: armour-luks.c:381 #, c-format msgid "Formatting \"%s\", will probably destroy all existing data" msgstr "" "Formatiere »%s«, dies wird wahrscheinlich alle bestehenden Daten zerstören." -#: armour-luks.c:408 +#: armour-luks.c:410 #, c-format msgid "Failed to create LUKS header for \"%s\"\n" msgstr "Erstellen eines neuen LUKS-Headers für »%s« schlug fehl.\n" -#: armour-luks.c:418 +#: armour-luks.c:420 #, c-format msgid "Failed to create LUKS key for \"%s\"\n" msgstr "Erstellen eines neuen LUKS-Schlüssels für »%s« schlug fehl.\n" -#: armour-luks.c:431 +#: armour-luks.c:433 #, c-format msgid "Setting password on LUKS keyslot-%u\n" msgstr "Setze Passwort für den LUKS-Schlüsselplatz »%u«\n" @@ -204,32 +210,32 @@ msgstr "Falsche(r) device-mapper-Beginn/Länge." msgid "Device-mapper target-creation failed for \"%s\"\n" msgstr "Erstellen des device-mapper-Ziels für »%s« schlug fehl.\n" -#: cryptmount.c:487 cryptmount.c:720 +#: cryptmount.c:488 cryptmount.c:722 #, c-format msgid "Target \"%s\" does not appear to be configured\n" msgstr "Ziel »%s« scheint unkonfiguriert zu sein.\n" -#: cryptmount.c:502 +#: cryptmount.c:503 #, c-format msgid "Cannot stat \"%s\"\n" msgstr "Kann Status für »%s« nicht abfragen.\n" -#: cryptmount.c:510 +#: cryptmount.c:511 #, c-format msgid "Failed to remove device-mapper target \"%s\"\n" msgstr "Entfernen des device-mapper-Ziels »%s« schlug fehl.\n" -#: cryptmount.c:543 +#: cryptmount.c:544 #, c-format msgid "Target \"%s\" is already mounted\n" msgstr "Ziel »%s« ist bereits eingehängt.\n" -#: cryptmount.c:601 +#: cryptmount.c:602 #, c-format msgid "Target \"%s\" does not appear to be mounted\n" msgstr "Ziel »%s« scheint noch nicht eingehängt zu sein.\n" -#: cryptmount.c:611 +#: cryptmount.c:612 #, c-format msgid "Only \"%s\" can unmount \"%s\"\n" msgstr "Nur »%s« kann »%s« aushängen.\n" @@ -237,125 +243,125 @@ msgstr "Nur »%s« kann »%s« aushängen.\n" #. TRANSLATORS: the following expands to include #. the *numerical* user-identity in place of '%lu', #. e.g. giving 'only user-16 can unmount "target"': -#: cryptmount.c:617 +#: cryptmount.c:618 #, c-format msgid "Only user-%lu can unmount \"%s\"\n" msgstr "Nur der Benutzer mit der ID »%lu« kann »%s« aushängen.\n" -#: cryptmount.c:661 +#: cryptmount.c:663 #, fuzzy, c-format msgid "Target \"%s\" is already configured\n" msgstr "Ziel »%s« ist bereits eingehängt.\n" -#: cryptmount.c:684 cryptmount.c:740 +#: cryptmount.c:686 cryptmount.c:742 #, c-format msgid "Crypto-swap is not supported by this installation of cryptmount\n" msgstr "" "Crypto-swap wird von dieser cryptmount-Installation nicht unterstützt.\n" -#: cryptmount.c:772 +#: cryptmount.c:774 #, c-format msgid "Key-file for \"%s\" isn't password-protected\n" msgstr "Schlüsseldatei für »%s« ist nicht passwortgeschützt.\n" -#: cryptmount.c:798 cryptmount.c:919 +#: cryptmount.c:800 cryptmount.c:921 #, c-format msgid "Cannot open \"%s\" for writing\n" msgstr "Kann »%s« nicht zum Schreiben öffnen.\n" -#: cryptmount.c:813 +#: cryptmount.c:815 #, c-format msgid "Retiring old key (%s -> %s) failed\n" msgstr "Ausmustern des alten Schlüssels (%s -> %s) schlug fehl.\n" -#: cryptmount.c:821 +#: cryptmount.c:823 #, c-format msgid "Installing new key (%s -> %s) failed\n" msgstr "Installation des neuen Schlüssels (%s -> %s) schlug fehl.\n" -#: cryptmount.c:828 +#: cryptmount.c:830 #, c-format msgid "Backup of previous key is in \"%s\"\n" msgstr "Eine Sicherheitskopie des vorherigen Schlüssels ist in »%s«.\n" -#: cryptmount.c:868 cryptmount.c:1545 +#: cryptmount.c:870 cryptmount.c:1547 #, c-format msgid "Target name \"%s\" is not recognized\n" msgstr "Zielname »%s« wurde nicht erkannt.\n" -#: cryptmount.c:874 +#: cryptmount.c:876 #, c-format msgid "Bad key-length parameter" msgstr "Falscher Schlüssellängen-Parameter" -#: cryptmount.c:886 +#: cryptmount.c:888 #, c-format msgid "Key-file \"%s\" already exists for target \"%s\"\n" msgstr "Schlüsseldatei »%s« existiert für das Ziel »%s« bereits.\n" -#: cryptmount.c:896 +#: cryptmount.c:898 #, c-format msgid "Generating random key; please be patient...\n" msgstr "Erstelle zufälligen Schlüssel; bitte warten Sie ...\n" -#: cryptmount.c:900 +#: cryptmount.c:902 #, c-format msgid "Failed to generate new key\n" msgstr "Generieren des neuen Schlüssels schlug fehl\n" -#: cryptmount.c:933 +#: cryptmount.c:935 #, c-format msgid "Installation of new keyfile \"%s\" failed" msgstr "Installation der neuen Schlüsseldatei »%s« schlug fehl." -#: cryptmount.c:1069 +#: cryptmount.c:1071 #, c-format msgid "Only root can use option \"%s\"\n" msgstr "Nur root kann die Option »%s« verwenden.\n" -#: cryptmount.c:1082 +#: cryptmount.c:1084 #, c-format msgid "Only root can configure \"%s\"\n" msgstr "Nur root kann »%s« konfigurieren.\n" -#: cryptmount.c:1146 +#: cryptmount.c:1148 #, c-format msgid "Cannot find key-manager to match target \"%s\"\n" msgstr "Kann keinen für das Ziel »%s« passenden Schlüsselmanager finden.\n" -#: cryptmount.c:1413 +#: cryptmount.c:1415 #, c-format msgid "Multiple operating modes not supported\n" msgstr "" -#: cryptmount.c:1468 +#: cryptmount.c:1470 #, c-format msgid "Memory-locking failed...\n" msgstr "Sperren des Arbeitsspeichers schlug fehl ...\n" -#: cryptmount.c:1496 +#: cryptmount.c:1498 #, c-format msgid "Bad file-descriptor (%d)\n" msgstr "Fehlerhafter Dateideskriptor (%d)\n" -#: cryptmount.c:1506 +#: cryptmount.c:1508 #, c-format msgid "Security failure\n" msgstr "Sicherheitsfehler\n" -#: cryptmount.c:1525 +#: cryptmount.c:1527 #, c-format msgid "Trailing command-line arguments given with '--all' option\n" msgstr "" "Abschließende Kommandozeilen-Argumente; wurden zusammen mit der Option »--" "all« angegeben.\n" -#: cryptmount.c:1557 +#: cryptmount.c:1559 #, c-format msgid "Target security failure for \"%s\"\n" msgstr "Sicherheitsfehler für Ziel »%s«.\n" -#: cryptmount.c:1566 +#: cryptmount.c:1568 #, c-format msgid "No targets specified\n" msgstr "Keine Ziele angegeben.\n" @@ -374,17 +380,17 @@ msgstr "" "Das Gerät »%s« scheint Daten zu enthalten (Entropie=%.3g,%.3g) – bitte " "führen Sie mkswap manuell aus.\n" -#: looputils.c:225 +#: looputils.c:226 #, c-format msgid "Failed to free device (%d,%d)\n" msgstr "Konnte Gerät (%d,%d) nicht freigeben.\n" -#: looputils.c:261 +#: looputils.c:262 #, c-format msgid "No available loopback devices\n" msgstr "Keine verfügbaren Loopback-Geräte.\n" -#: looputils.c:275 +#: looputils.c:276 #, c-format msgid "Bad device type (%x) for \"%s\" (need block/file)\n" msgstr "Falscher Gerätetyp (%x) für »%s« (Block/Datei benötigt).\n" @@ -748,10 +754,6 @@ msgstr "" msgid "After you have finished using the filesystem, try:" msgstr "Nach der Benutzung des Dateisystems, geben Sie bitte Folgendes ein:" -#~ msgid "Failed to create loop device for LUKS keyfile\n" -#~ msgstr "" -#~ "Erstellen eines neuen Loop-Gerätes für LUKS-Schlüsseldatei schlug fehl.\n" - #~ msgid "Failed to read LUKS header for \"%s\"\n" #~ msgstr "Konnte LUKS-Header von »%s« nicht lesen.\n" diff --git a/po/fr.po b/po/fr.po index 8d42d4e..9f26369 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: cryptmount 4.0-1\n" "Report-Msgid-Bugs-To: rwpenney@users.sourceforge.net\n" -"POT-Creation-Date: 2019-01-05 14:15+0000\n" +"POT-Creation-Date: 2019-10-19 08:27+0100\n" "PO-Revision-Date: 2006-04-21 07:51+0100\n" "Last-Translator: RW Penney \n" "Language-Team: French \n" @@ -86,32 +86,37 @@ msgstr "Mauvais fichier-clef (openssl-compat)\n" msgid "Checksum mismatch in keyfile (openssl-compat, ofs=%u,idx=%u)\n" msgstr "Mauvais fichier-clef (openssl-compat, ofs=%u,idx=%u)\n" -#: armour-luks.c:308 armour-luks.c:392 +#: armour-luks.c:217 +#, fuzzy, c-format +msgid "Failed to acquire privileges for LUKS container" +msgstr "Création du périphérique-loop pour le fichier-clef LUKS a echouée\n" + +#: armour-luks.c:310 armour-luks.c:394 #, fuzzy, c-format msgid "Failed to initialize device for LUKS keyfile\n" msgstr "Création du périphérique-loop pour le fichier-clef LUKS a echouée\n" -#: armour-luks.c:318 +#: armour-luks.c:320 #, c-format msgid "Failed to extract LUKS key for \"%s\" (errno=%d)\n" msgstr "Extraction de la clef LUKS a echouée pour la cible \"%s\" (errno=%d)\n" -#: armour-luks.c:379 +#: armour-luks.c:381 #, c-format msgid "Formatting \"%s\", will probably destroy all existing data" msgstr "Formatage de \"%s\" va detruire tous donnés sur ce conteneur" -#: armour-luks.c:408 +#: armour-luks.c:410 #, c-format msgid "Failed to create LUKS header for \"%s\"\n" msgstr "Génération d'en-tête LUKS pour \"%s\" a echouée\n" -#: armour-luks.c:418 +#: armour-luks.c:420 #, c-format msgid "Failed to create LUKS key for \"%s\"\n" msgstr "Génération de clef LUKS pour \"%s\" a echouée\n" -#: armour-luks.c:431 +#: armour-luks.c:433 #, c-format msgid "Setting password on LUKS keyslot-%u\n" msgstr "" @@ -199,32 +204,32 @@ msgstr "Mauvais debut/taille pour device-mapper" msgid "Device-mapper target-creation failed for \"%s\"\n" msgstr "Création de la cible device-mapper pour \"%s\" a echouée\n" -#: cryptmount.c:487 cryptmount.c:720 +#: cryptmount.c:488 cryptmount.c:722 #, c-format msgid "Target \"%s\" does not appear to be configured\n" msgstr "La cible \"%s\" n'a pas été configurée\n" -#: cryptmount.c:502 +#: cryptmount.c:503 #, c-format msgid "Cannot stat \"%s\"\n" msgstr "Ne pas pouvoir stat \"%s\"\n" -#: cryptmount.c:510 +#: cryptmount.c:511 #, c-format msgid "Failed to remove device-mapper target \"%s\"\n" msgstr "Destruction de la cible device-mapper \"%s\" a echouée\n" -#: cryptmount.c:543 +#: cryptmount.c:544 #, c-format msgid "Target \"%s\" is already mounted\n" msgstr "La cible \"%s\" est déjà montée\n" -#: cryptmount.c:601 +#: cryptmount.c:602 #, c-format msgid "Target \"%s\" does not appear to be mounted\n" msgstr "La cible \"%s\" n'est pas montée\n" -#: cryptmount.c:611 +#: cryptmount.c:612 #, c-format msgid "Only \"%s\" can unmount \"%s\"\n" msgstr "Seulement utilisateur \"%s\" peut démonter \"%s\"\n" @@ -232,123 +237,123 @@ msgstr "Seulement utilisateur \"%s\" peut d #. TRANSLATORS: the following expands to include #. the *numerical* user-identity in place of '%lu', #. e.g. giving 'only user-16 can unmount "target"': -#: cryptmount.c:617 +#: cryptmount.c:618 #, c-format msgid "Only user-%lu can unmount \"%s\"\n" msgstr "Seulement utilisateur-%lu peut démonter \"%s\"\n" -#: cryptmount.c:661 +#: cryptmount.c:663 #, fuzzy, c-format msgid "Target \"%s\" is already configured\n" msgstr "La cible \"%s\" est déjà montée\n" -#: cryptmount.c:684 cryptmount.c:740 +#: cryptmount.c:686 cryptmount.c:742 #, c-format msgid "Crypto-swap is not supported by this installation of cryptmount\n" msgstr "" "Pagination chiffrée n'est pas possible avec cet installation de cryptmount\n" -#: cryptmount.c:772 +#: cryptmount.c:774 #, c-format msgid "Key-file for \"%s\" isn't password-protected\n" msgstr "Le fichier-clef pour \"%s\" n'est pas protèger par mot de passe\n" -#: cryptmount.c:798 cryptmount.c:919 +#: cryptmount.c:800 cryptmount.c:921 #, c-format msgid "Cannot open \"%s\" for writing\n" msgstr "Ne pas pouvoir ecrire à \"%s\"\n" -#: cryptmount.c:813 +#: cryptmount.c:815 #, c-format msgid "Retiring old key (%s -> %s) failed\n" msgstr "Retraitment de vielle fichier-clef (%s -> %s) a echouée\n" -#: cryptmount.c:821 +#: cryptmount.c:823 #, c-format msgid "Installing new key (%s -> %s) failed\n" msgstr "Installation de nouvelle fichier-clef (%s -> %s) a echouée\n" -#: cryptmount.c:828 +#: cryptmount.c:830 #, c-format msgid "Backup of previous key is in \"%s\"\n" msgstr "Une sauvegarde de l'ancienne clef est dans \"%s\"\n" -#: cryptmount.c:868 cryptmount.c:1545 +#: cryptmount.c:870 cryptmount.c:1547 #, c-format msgid "Target name \"%s\" is not recognized\n" msgstr "Nom de cible \"%s\" n'est pas reconnu\n" -#: cryptmount.c:874 +#: cryptmount.c:876 #, c-format msgid "Bad key-length parameter" msgstr "Mauvaise paramètre pour la taille de la clef" -#: cryptmount.c:886 +#: cryptmount.c:888 #, c-format msgid "Key-file \"%s\" already exists for target \"%s\"\n" msgstr "Le fichier-clef \"%s\" existe déjà pour la cible \"%s\"\n" -#: cryptmount.c:896 +#: cryptmount.c:898 #, c-format msgid "Generating random key; please be patient...\n" msgstr "Veuillez attendre pendant la création d'une clef aléatoire...\n" -#: cryptmount.c:900 +#: cryptmount.c:902 #, c-format msgid "Failed to generate new key\n" msgstr "Génération de nouvelle clef a echouée\n" -#: cryptmount.c:933 +#: cryptmount.c:935 #, c-format msgid "Installation of new keyfile \"%s\" failed" msgstr "Installation de novelle fichier-clef \"%s\" a echouée" -#: cryptmount.c:1069 +#: cryptmount.c:1071 #, c-format msgid "Only root can use option \"%s\"\n" msgstr "Seulement le super-utilisateur peut utiliser \"%s\"\n" -#: cryptmount.c:1082 +#: cryptmount.c:1084 #, c-format msgid "Only root can configure \"%s\"\n" msgstr "Seulement le super-utilisateur peut configurer \"%s\"\n" -#: cryptmount.c:1146 +#: cryptmount.c:1148 #, c-format msgid "Cannot find key-manager to match target \"%s\"\n" msgstr "Ne peut pas trouver un diriger-clef pour la cible \"%s\"\n" -#: cryptmount.c:1413 +#: cryptmount.c:1415 #, c-format msgid "Multiple operating modes not supported\n" msgstr "" -#: cryptmount.c:1468 +#: cryptmount.c:1470 #, c-format msgid "Memory-locking failed...\n" msgstr "Verrouillage de la memoire a echoué...\n" -#: cryptmount.c:1496 +#: cryptmount.c:1498 #, c-format msgid "Bad file-descriptor (%d)\n" msgstr "Maivais descripteur de fichier (%d)\n" -#: cryptmount.c:1506 +#: cryptmount.c:1508 #, c-format msgid "Security failure\n" msgstr "Echec de securité\n" -#: cryptmount.c:1525 +#: cryptmount.c:1527 #, c-format msgid "Trailing command-line arguments given with '--all' option\n" msgstr "Arguments donnés après option '--all'\n" -#: cryptmount.c:1557 +#: cryptmount.c:1559 #, c-format msgid "Target security failure for \"%s\"\n" msgstr "Echec de securité pour cible \"%s\"\n" -#: cryptmount.c:1566 +#: cryptmount.c:1568 #, c-format msgid "No targets specified\n" msgstr "Pas de cible donnée\n" @@ -367,17 +372,17 @@ msgstr "" "Périphérique \"%s\" semble contenir des données valable (entropy=%.3g,%.3g) " "- veuillez utiliser mkswap manuellement\n" -#: looputils.c:225 +#: looputils.c:226 #, c-format msgid "Failed to free device (%d,%d)\n" msgstr "Dégagement du périphérique (%d,%d) a echoué\n" -#: looputils.c:261 +#: looputils.c:262 #, c-format msgid "No available loopback devices\n" msgstr "Il n'y a aucun périph-loop disponible\n" -#: looputils.c:275 +#: looputils.c:276 #, c-format msgid "Bad device type (%x) for \"%s\" (need block/file)\n" msgstr "" @@ -761,9 +766,6 @@ msgstr "Lorsque vous avez termin #~ msgid "target name \"%s\" is not recognized\n" #~ msgstr "nom de cible \"%s\" n'est pas reconnu\n" -#~ msgid "Failed to create loop device for LUKS keyfile" -#~ msgstr "Création du périphérique-loop pour le fichier-clef LUKS a echouée\n" - #~ msgid "key-extraction failed for \"%s\"\n" #~ msgstr "extraction de la clef pour \"%s\" a echouée\n" diff --git a/testing/mudslinger.in b/testing/mudslinger.in index 5d6036b..e54014d 100755 --- a/testing/mudslinger.in +++ b/testing/mudslinger.in @@ -7,7 +7,7 @@ LOSETUP=/sbin/losetup SU_p="/bin/su -p" TMPDIR=/tmp/cm-$$ CM=../cryptmount -PASSWD="hopeless" +PASSWD="3normouslyComplexPassw0rd,maybe?" # Pair of users, with valid login-shells: USER1=bin USER2=nobody @@ -109,7 +109,7 @@ function wait_udev() { function mk_ssl_keyfile() { # Syntax: mk_ssl_keyfile ${DD} if=/dev/urandom bs=${1}c count=1 2>/dev/null | \ - openssl enc -e -pass pass:${PASSWD} -md $2 -${3} 2>/dev/null + openssl enc -e -pass pass:"${PASSWD}" -md $2 -${3} 2>/dev/null }; function mkrandshort() { @@ -218,12 +218,12 @@ function test_keygen() { keyfile=${TMPDIR}/keyfile } EOF rm -f ${TMPDIR}/keyfile - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx}" 2>&3; then test_fail "privilege violation"; return; fi - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key ${len} target${idx} 2>&3; then true; else test_fail make-key; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx}" 2>&3; then test_fail "privilege violation"; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key ${len} target${idx} 2>&3; then true; else test_fail make-key; return; fi if [ ! -f ${TMPDIR}/keyfile ]; then test_fail missing-key; return; fi fllen=`wc -c ${TMPDIR}/keyfile | awk '{printf"%d", $1}'` if [ "${fllen}" -lt "${len}" ]; then test_fail "keyfile size"; return; fi - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then test_fail key-overwrite; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then test_fail key-overwrite; return; fi done done test_pass @@ -243,8 +243,8 @@ function test_setup_dev() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi if mke2fs -q /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi @@ -266,8 +266,8 @@ function test_setup_loop() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi if mke2fs -q /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi @@ -297,15 +297,15 @@ function test_setup_roloop() { EOF cleanup="umount ${TMPDIR}/romnt; ${LOSETUP} -d ${LOOPDEV2}; rm ${TMPDIR}/roloopfile; rmdir ${TMPDIR}/romnt" rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation" "${cleanup}"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail "prepare" "${cleanup}" ; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation" "${cleanup}"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail "prepare" "${cleanup}" ; return; fi if mke2fs -q /dev/mapper/target${idx}; then true; else test_fail "mke2fs" "${cleanup}"; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail "release" "${cleanup}"; return; fi mount -o remount,ro ${TMPDIR}/romnt - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx} 2>&3; then true; else test_fail "mount-ro" "${cleanup}" ; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx} 2>&3; then true; else test_fail "mount-ro" "${cleanup}" ; return; fi wait_udev - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --unmount target${idx} 2>&3; then true; else test_fail "unmount-ro" "${cleanup}" ; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --unmount target${idx} 2>&3; then true; else test_fail "unmount-ro" "${cleanup}" ; return; fi # ideally we should try rw-mounting the filesystem, # and checking that the operation fails, but libdevmapper-1.01 apparently # does not deal well with read-only loopback devices @@ -350,18 +350,18 @@ function test_passchange() { ${keyline} } EOF - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 1>&3 2>&3; then true; else test_fail "make-key"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail "prepare"; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 1>&3 2>&3; then true; else test_fail "make-key"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail "prepare"; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail "release"; return; fi rm -f ${TMPDIR}/keyfile-old - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --newpassword ${NEWPASSWD} --change-password target${idx} 1>&3 2>&3; then true; else test_fail "changing password"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --newpassword "${NEWPASSWD}" --change-password target${idx} 1>&3 2>&3; then true; else test_fail "changing password"; return; fi if [ "${mgr}" != "luks" ]; then if [ -f ${TMPDIR}/keyfile-old ]; then rm ${TMPDIR}/keyfile-old; else test_fail "missing backup key"; return; fi fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then test_fail "old password"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${NEWPASSWD} --prepare target${idx} 2>&3; then true; else test_fail "prepare-new"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then test_fail "old password"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${NEWPASSWD}" --prepare target${idx} 2>&3; then true; else test_fail "prepare-new"; return; fi if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail "release-new"; return; fi wait_udev done @@ -372,11 +372,7 @@ EOF function test_mtab() { # Test of updates to mtab if test_start "mtab updates"; then true; else return; fi - if [ -x /sbin/mkfs.minix ]; then - fstype=minix - else - fstype=ext3 - fi + fstype=ext3 rm -f ${TMPDIR}/keyfile ln -s ./mnt ${TMPDIR}/mnt-link0 ln -s mnt ${TMPDIR}/mnt-link1 @@ -397,8 +393,8 @@ function test_mtab() { EOF cleanup="rm ${TMPDIR}/mnt-link0 ${TMPDIR}/mnt-link1" echo "variant=\"${variant}\"" >&3 - test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail "prepare" "${cleanup}" ; return; fi + test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail "prepare" "${cleanup}" ; return; fi if mkfs -t ${fstype} /dev/mapper/target${idx} 1>&3 2>&3; then true; else ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; test_fail "mkfs.${fstype}" "${cleanup}"; return @@ -407,7 +403,7 @@ EOF if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail "release" "${cleanup}" ; return; fi if [ `df -k | grep -c /dev/mapper/target${idx}` -ne 0 ]; then test_fail "pre-existing" "${cleanup}" ; return; fi - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 1>&3 2>&3; then true; else test_fail "mount" "${cleanup}" ; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 1>&3 2>&3; then true; else test_fail "mount" "${cleanup}" ; return; fi if [ `df -k | grep -c "/dev/mapper/target${idx}"` -ne 1 ]; then test_fail "unregistered" "${cleanup}" ; return; fi wait_udev if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail "unmount" "${cleanup}" ; return; fi @@ -435,7 +431,7 @@ function test_listing() { EOF tlist="${tlist} target${idx},/mnt/point-${idx2}" done - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --list" > ${TMPDIR}/tlist 2>&3; then true; else test_fail listing; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --list" > ${TMPDIR}/tlist 2>&3; then true; else test_fail listing; return; fi for marker in ${tlist} do tupelize $marker tgt dir @@ -466,7 +462,7 @@ function test_defaults() { EOF tlist="${tlist} target${idx},/mnt/point-${idx2},fs-${idx3}" done - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --list" > ${TMPDIR}/tlist 2>&3; then true; else test_fail listing; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --list" > ${TMPDIR}/tlist 2>&3; then true; else test_fail listing; return; fi if [ "`echo ${tlist} | wc -w`" -ne "`wc -l < ${TMPDIR}/tlist`" ]; then test_fail "wrong number of targets"; return fi @@ -498,8 +494,8 @@ function test_bad_passwd() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi - if ${CM} --config-dir ${TMPDIR} --password NOT${PASSWD} --prepare target${idx} 2>&3; then + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "NOT${PASSWD}" --prepare target${idx} 2>&3; then ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3 test_fail prepare else @@ -554,9 +550,9 @@ function test_bad_keyfmt() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then test_fail "key-generation"; return; fi ${DD} if=/dev/urandom of=${TMPDIR}/keyfile bs=16c count=1 2>/dev/null - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3 test_fail prepare else @@ -585,7 +581,7 @@ function test_bad_keyhash() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then test_fail "key-generation"; return; fi done done test_pass; @@ -606,9 +602,9 @@ function test_envvars() { keyfile=${TMPDIR}/keyfile-\$(USERNAME) } EOF - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then true; else test_fail "make-key"; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then true; else test_fail "make-key"; return; fi if [ ! -f ${TMPDIR}/keyfile-root ]; then test_fail "missing key"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail "prepare"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail "prepare"; return; fi if mke2fs -q /dev/mapper/target${idx}; then true; else test_fail "mke2fs"; return; fi if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail "release"; return; fi @@ -617,11 +613,11 @@ EOF echo "user=${user}.${group}" >&3 cp ${TMPDIR}/keyfile-root ${TMPDIR}/keyfile-${user} - if ${SU_p} ${user} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --newpassword ${PASSWD}-${user} --change-password target${idx}" 2>&3; then true; else test_fail "changing password"; return; fi + if ${SU_p} ${user} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --newpassword "${PASSWD}"-${user} --change-password target${idx}" 2>&3; then true; else test_fail "changing password"; return; fi wait_udev mkdir ${TMPDIR}/mnt-${group} - if ${SU_p} ${user} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD}-${user} --mount target${idx}" 2>&3; then true; else test_fail "mount-${user}"; return; fi + if ${SU_p} ${user} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}-${user}" --mount target${idx}" 2>&3; then true; else test_fail "mount-${user}"; return; fi if [ ! -d ${TMPDIR}/mnt-${group}/lost+found ]; then test_fail "lost+found ${user}.${group}"; return; fi if ${SU_p} ${user} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail "mount-${user}"; return; fi done @@ -652,11 +648,11 @@ function test_frenzy() { fstype=ext2 mountoptions=defaults cipher=blowfish keyformat=builtin keyfile=${TMPDIR}/keyfile } EOF - test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3 + test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3 pos=`expr ${pos} + ${fsz}` done cleanup="${CM} --config-dir ${TMPDIR} --release --all" - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare --all 2>&3; then true; else test_fail "prepare" "${cleanup}"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare --all 2>&3; then true; else test_fail "prepare" "${cleanup}"; return; fi for tgt in ${tgtlist}; do ${DD} if=/dev/zero of=/dev/mapper/target${idx} bs=1M count=1 2>/dev/null if mke2fs -q /dev/mapper/${tgt}; then true; else test_fail mke2fs; return; fi @@ -667,7 +663,7 @@ EOF done srtlist=`echo ${tgtlist} | awk '{for (i=1; i<=NF; ++i) printf"%s\n",\$i}' | sort` for tgt in ${srtlist}; do - ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount ${tgt}" 2>&3 & + ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount ${tgt}" 2>&3 & done wait cat ${TMPDIR}/cryptmount.status 1>&3 @@ -699,13 +695,13 @@ function test_cipher_algs() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi if mke2fs -q -j /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 1>&3 2>&3; then true; else test_fail "mount"; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 1>&3 2>&3; then true; else test_fail "mount"; return; fi wait_udev if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail "unmount"; return; fi @@ -746,7 +742,7 @@ EOF } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi ${DD} if=/dev/zero of=/dev/mapper/target${idx} bs=1M count=1 2>/dev/null if mke2fs -q /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev @@ -754,7 +750,7 @@ EOF wait_udev if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "not-${PASSWD}" --mount target${idx}" 2>&3; then test_fail "bad-password"; return; fi - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 2>&3; then true; else test_fail "mount"; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 2>&3; then true; else test_fail "mount"; return; fi if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail "unmount"; return; fi wait_udev done @@ -784,13 +780,13 @@ function test_ssl_algs() { keyhash=${keyhash} keycipher=${keycipher} } EOF - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi ${DD} if=/dev/zero of=/dev/mapper/target${idx} bs=1M count=1 2>/dev/null if mke2fs -q -j /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi wait_udev if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail unmount; return; fi @@ -823,14 +819,14 @@ function test_gcry_algs() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi ${DD} if=/dev/zero of=/dev/mapper/target${idx} bs=1M count=1 2>/dev/null if mke2fs -q -j /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi wait_udev if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail "unmount"; return; fi @@ -871,7 +867,7 @@ function test_gcryossl() { } EOF # Configure filesystem with libgcrypt-openssl compatibility layer: - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi ${DD} if=/dev/zero of=/dev/mapper/target${idx} bs=1M count=1 2>/dev/null if mke2fs -q -j /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev @@ -888,7 +884,7 @@ w q EOF fi - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi wait_udev if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail unmount; return; fi @@ -912,13 +908,13 @@ function test_mountlock() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --generate-key 32 --newpassword ${PASSWD} target${idx} 2>&3; then true; else test_fail make-key; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --generate-key 32 --newpassword "${PASSWD}" target${idx} 2>&3; then true; else test_fail make-key; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi if mke2fs -q -j /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 2>&3; then true; else test_fail mount; return; fi if ${SU_p} ${USER2} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then test_fail bad-unmount; return; fi if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail unmount; return; fi @@ -940,8 +936,8 @@ function test_userflags() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --generate-key 16 --newpassword ${PASSWD} target${idx} 2>&3; then true; else test_fail make-key; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --generate-key 16 --newpassword "${PASSWD}" target${idx} 2>&3; then true; else test_fail make-key; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi if mke2fs -q -j /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi @@ -958,14 +954,14 @@ w q EOF echo "config: ${cfg}" 1>&3 - ${SU_p} ${usr} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --mount target${idx}" 1>&3 2>&3 + ${SU_p} ${usr} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --mount target${idx}" 1>&3 2>&3 stat=$? if [ \( "$stat" -eq 0 -a "$exp" != "pass" \) -o \( "$stat" -ne 0 -a "$exp" != "fail" \) ]; then test_fail bad-mount return fi wait_udev - ${SU_p} ${usr} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --unmount target${idx}" 2>&3 + ${SU_p} ${usr} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --unmount target${idx}" 2>&3 stat=$? if [ \( "$stat" -eq 0 -a "$exp" != "pass" \) -o \( "$stat" -ne 0 -a "$exp" != "fail" \) ]; then test_fail bad-unmount @@ -991,8 +987,8 @@ function test_mountsynonyms() { } EOF rm -f ${TMPDIR}/keyfile - if ${CM} --config-dir ${TMPDIR} --generate-key 12 --newpassword ${PASSWD} target${idx} 2>&3; then true; else test_fail make-key; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --generate-key 12 --newpassword "${PASSWD}" target${idx} 2>&3; then true; else test_fail make-key; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi if mke2fs -q -j /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi @@ -1001,7 +997,7 @@ EOF for unmopt in "-u" "--unmount" do echo "mount[${mntopt}] unmount[${unmopt}]" 1>&3 - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} ${mntopt} target${idx}" 2>&3; then true; else test_fail mount; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" ${mntopt} target${idx}" 2>&3; then true; else test_fail mount; return; fi wait_udev if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} ${unmopt} target${idx}" 2>&3; then true; else test_fail unmount; return; fi @@ -1032,10 +1028,10 @@ function test_offsets() { keyfile=${TMPDIR}/keyfile } EOF - test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3 + test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3 ${DD} if=/dev/zero of=${LOOPDEV} 2>/dev/null sync - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then cleanup="${CM} --config-dir ${TMPDIR} --release target${idx}" ${DD} if=/dev/zero of=/dev/mapper/target${idx} bs=1b count=`expr ${length} + 16` 2>&3 wait_udev @@ -1090,9 +1086,9 @@ EOF ${DD} if=$0 of=${LOOPDEV} bs=1M count=4 2>/dev/null ;; esac wait_udev; sync - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} --swapon swap${idx}" 2>&3; then test_fail privilege; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --swapon swap${idx}" 2>&3; then test_fail privilege; return; fi if grep -q swap${idx} /proc/swaps; then test_fail pre-existing; return; fi - ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --swapon swap${idx} 2>&3; + ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --swapon swap${idx} 2>&3; stat=$? echo "stat: $stat" 1>&3 if [ \( "$stat" -eq 0 -a "$exp" != "pass" \) -o \( "$stat" -ne 0 -a "$exp" != "fail" \) ]; then @@ -1105,7 +1101,7 @@ EOF if grep -q "\<${prio}\>" /proc/swaps; then true; else test_fail "proc+swaps"; return; fi # Beware that udev may rename our swap device within /proc/swaps! fi - ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --swapoff swap${idx} 2>&3; + ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --swapoff swap${idx} 2>&3; if [ \( "$stat" -eq 0 -a "$exp" != "pass" \) -o \( "$stat" -ne 0 -a "$exp" != "fail" \) ]; then test_fail swapoff return @@ -1133,16 +1129,16 @@ function test_fdconfig() { keyfile=${TMPDIR}/keyfile } EOF - COMMAND="${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx}" + COMMAND="${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx}" if ${COMMAND} 2>&3; then true; else test_fail "key-generation (priv)"; return; fi cp ${TMPDIR}/cmtab ${TMPDIR}/cmstrm cat /dev/null > ${TMPDIR}/cmtab - COMMAND="${CM} --config-dir ${TMPDIR} --password ${PASSWD} --config-fd 5 --prepare target${idx}" + COMMAND="${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --config-fd 5 --prepare target${idx}" if ${SU_p} ${USER1} -c "${COMMAND}" 5< ${TMPDIR}/cmstrm 2>&3; then test_fail "config-fd"; return; fi if ${COMMAND} 5< ${TMPDIR}/cmstrm 2>&3; then true; else test_fail "config-fd (priv)"; return; fi wait_udev - COMMAND="${CM} --config-dir ${TMPDIR} --password ${PASSWD} --config-fd 7 --release target${idx}" + COMMAND="${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --config-fd 7 --release target${idx}" if ${SU_p} ${USER1} -c "${COMMAND}" 7< ${TMPDIR}/cmstrm 2>&3; then test_fail "config-fd"; return; fi if ${COMMAND} 7< ${TMPDIR}/cmstrm 2>&3; then true; else test_fail "config-fd (priv)"; return; fi rm ${TMPDIR}/cmstrm @@ -1173,7 +1169,7 @@ function test_privblock() { keyfile=${TMPDIR}/keyfile_ keyhash=sha1 keycipher=aes-192-cbc } EOF - COMMAND="${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx}" + COMMAND="${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx}" if ${SU_p} ${USER1} -c "${COMMAND}" 2>&3; then test_fail "key-generation"; return; fi if ${COMMAND} 2>&3; then true; else test_fail "key-generation (priv)"; return; fi COMMAND="${CM} --config-dir ${TMPDIR} --password ${PASSWD} --newpassword ${NEWPASSWD} --reuse-key target${idx} target${idx}_" @@ -1183,7 +1179,7 @@ EOF for action in --prepare --release --swapon --swapoff --safetynet do - COMMAND="${CM} --config-dir ${TMPDIR} --password ${PASSWD} ${action} target${idx}" + COMMAND="${CM} --config-dir ${TMPDIR} --password "${PASSWD}" ${action} target${idx}" if ${SU_p} ${USER1} -c "${COMMAND}" 2>&3; then test_fail "${action}"; return; fi if ${COMMAND} 2>&3; then true; else test_fail "${action} (priv)"; return; fi wait_udev @@ -1210,7 +1206,7 @@ function test_voverride() { keyfile=${TMPDIR}/keyfile } EOF rm -f ${TMPDIR}/keyfile - ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 1>&3 2>&3 + ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 1>&3 2>&3 stat=$? if [ "$stat" -eq 0 -a "${exp}" == "pass" ]; then obsv=`od -j 7 -N 1 -t d1 ${TMPDIR}/keyfile | sed -n '1s/^[0-9]* *//p'` @@ -1233,16 +1229,12 @@ function test_cryptsetup_compat() { if which cryptsetup 1>&3; then true; else test_fail "cryptsetup not available"; return; fi if ${CM} --key-managers 2>/dev/null | grep -q openssl; then true; else test_fail "No OpenSSL support"; return; fi mk_ssl_keyfile 32 md5 aes192 > ${TMPDIR}/keyfile - openssl enc -d -aes192 -md md5 -in ${TMPDIR}/keyfile -pass pass:${PASSWD} -out ${TMPDIR}/keymat 2>/dev/null + openssl enc -d -aes192 -md md5 -in ${TMPDIR}/keyfile -pass pass:"${PASSWD}" -out ${TMPDIR}/keymat 2>/dev/null - for cipher in blowfish serpent - do - for length in 4096 8192 - do - for startsec in 0 32 - do - for ivoffset in 0 172 932 - do + for cipher in blowfish serpent; do + for length in 16384 32768; do + for startsec in 0 32; do + for ivoffset in 0 172 932; do idx=`mkrandshort` echo "${cipher},${length},${startsec},${ivoffset}" 1>&3 cryptsetup --key-file ${TMPDIR}/keymat -c ${cipher} -b ${length} -o ${startsec} -p ${ivoffset} create cstarget${idx} ${LOOPDEV} 2>&3 @@ -1272,9 +1264,9 @@ function test_cryptsetup_compat() { keyhash=md5 keycipher=aes192 } EOF - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} target${idx} 2>&3; then true; else test_fail "mount"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" target${idx} 2>&3; then true; else test_fail "mount"; return; fi wait_udev - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --unmount target${idx} 2>&3; then true; else test_fail "unmount"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --unmount target${idx} 2>&3; then true; else test_fail "unmount"; return; fi done done done @@ -1296,16 +1288,16 @@ function test_luks_loopdev() { fstype=ext3 flags=nofsck } EOF - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 32 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 32 target${idx} 2>&3; then true; else test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi if mke2fs -t ext3 -q /dev/mapper/target${idx}; then true; else test_fail mke2fs; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail release; return; fi wait_udev - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} target${idx}" 2>&3; then true; else test_fail "mount"; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" target${idx}" 2>&3; then true; else test_fail "mount"; return; fi wait_udev; sleep 1 if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail "unmount"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --newpassword ${NEWPASSWD} --change-password target${idx} 1>&3 2>&3; then true; else test_fail "changing password"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --newpassword ${NEWPASSWD} --change-password target${idx} 1>&3 2>&3; then true; else test_fail "changing password"; return; fi test_pass }; @@ -1345,10 +1337,10 @@ function test_luks_compat() { cipher=aes # This should be overridden by LUKS header } EOF - if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password ${PASSWD} target${idx}" 2>&3; then true; else test_fail "mount"; return; fi + if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --password "${PASSWD}" target${idx}" 2>&3; then true; else test_fail "mount"; return; fi wait_udev; sleep 1 if ${SU_p} ${USER1} -c "${CM} --config-dir ${TMPDIR} --unmount target${idx}" 2>&3; then true; else test_fail "unmount"; return; fi - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then test_fail "re-formatting"; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then test_fail "re-formatting"; fi wait_udev done rm ${TMPDIR}/keymat0 ${TMPDIR}/keymat @@ -1378,10 +1370,10 @@ function test_luks_tapmoc() { cipher=${cipher}-${mode} } EOF - if ${DD} if=/dev/zero of=${LOOPDEV} bs=1k count=1 conv=notrunc 2>/dev/null; then true; else test_fail "purging"; return; fi + if ${DD} if=/dev/zero of=${LOOPDEV} bs=4k count=4 conv=notrunc 2>/dev/null; then true; else test_fail "purging"; return; fi sync - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 32 target${idx} 1>&3 2>&3; then true; else test_fail "key-generation"; return; fi - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail "prepare"; return; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 32 target${idx} 1>&3 2>&3; then true; else test_fail "key-generation"; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail "prepare"; return; fi if mke2fs -q /dev/mapper/target${idx}; then true; else test_fail "mke2fs"; return; fi wait_udev if ${CM} --config-dir ${TMPDIR} --release target${idx} 2>&3; then true; else test_fail "release"; return; fi @@ -1402,7 +1394,7 @@ EOF if [ "$mode" != "$luksmode" ]; then test_fail "mode mismatch ($luksmode)"; return; fi # Check that re-formatting is blocked: - if ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3; then test_fail "re-formatting"; fi + if ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3; then test_fail "re-formatting"; fi wait_udev done rm ${TMPDIR}/keymat @@ -1430,13 +1422,13 @@ function test_loopset() { keyfile=${TMPDIR}/keyfile keyformat=raw } EOF - test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword ${PASSWD} --generate-key 16 target${idx} 2>&3 - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi + test -f ${TMPDIR}/keyfile || ${CM} --config-dir ${TMPDIR} --newpassword "${PASSWD}" --generate-key 16 target${idx} 2>&3 + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --prepare target${idx} 2>&3; then true; else test_fail prepare; return; fi wait_udev if ${LOSETUP} $ldev 1>&3 2>&3; then - if ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --release target${idx} 2>&3; then true; else test_fail release; return; fi + if ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --release target${idx} 2>&3; then true; else test_fail release; return; fi else - ${CM} --config-dir ${TMPDIR} --password ${PASSWD} --release target${idx} 2>&3 + ${CM} --config-dir ${TMPDIR} --password "${PASSWD}" --release target${idx} 2>&3 test_fail "loopback unconfigured"; return fi diff --git a/utils.c b/utils.c index a95096b..5aca99e 100644 --- a/utils.c +++ b/utils.c @@ -235,11 +235,11 @@ int cm_path(char **buff, cm_path_prefix_t prefix_code, const char *file) char *cm_strdup(const char *orig) /** Make duplicate of existing string, allocating memory for copy */ -{ char *cpy; +{ char *cpy = NULL; if (orig == NULL) return NULL; - cpy = (char*)malloc((size_t)(strlen(orig) + 1)); + cpy = (char*)malloc(strlen(orig) + 1); return strcpy(cpy, orig); }