diff options
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Makefile.in | 16 | ||||
-rw-r--r-- | tests/lib/etl_add_passphrase_key_to_keyring.c | 4 | ||||
-rw-r--r-- | tests/lib/etl_funcs.sh | 44 |
3 files changed, 47 insertions, 17 deletions
diff --git a/tests/lib/Makefile.in b/tests/lib/Makefile.in index 2a431ae..e6866a6 100644 --- a/tests/lib/Makefile.in +++ b/tests/lib/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.13.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. @@ -87,9 +87,9 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pkg_swig.m4 \ $(top_srcdir)/m4/ac_python_devel.m4 \ - $(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/swig_python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -388,9 +388,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/lib/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign tests/lib/Makefile + $(AUTOMAKE) --gnu tests/lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -436,14 +436,14 @@ distclean-compile: @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/tests/lib/etl_add_passphrase_key_to_keyring.c b/tests/lib/etl_add_passphrase_key_to_keyring.c index 2a9c265..b0e6843 100644 --- a/tests/lib/etl_add_passphrase_key_to_keyring.c +++ b/tests/lib/etl_add_passphrase_key_to_keyring.c @@ -36,6 +36,10 @@ int main(int argc, char *argv[]) return EINVAL; } + rc = ecryptfs_validate_keyring(); + if (rc) + return errno; + from_hex(salt, argv[2], ECRYPTFS_SALT_SIZE); rc = ecryptfs_add_passphrase_key_to_keyring(auth_tok_sig_hex, argv[1], salt); diff --git a/tests/lib/etl_funcs.sh b/tests/lib/etl_funcs.sh index 7803008..e8261e0 100644 --- a/tests/lib/etl_funcs.sh +++ b/tests/lib/etl_funcs.sh @@ -447,6 +447,38 @@ etl_lmax_filesize() echo $blks } +_etl_init_mount_opts() +{ + if [ -z "$ETL_MOUNT_OPTS" ]; then + opts=$default_mount_opts + + if [ -n "$ETL_FNEK_SIG" ]; then + opts="$default_fne_mount_opts" + fi + + if [ -n "$ETL_APPENDED_MOUNT_OPTS" ]; then + opts="${opts},${ETL_APPENDED_MOUNT_OPTS}" + fi + + export ETL_MOUNT_OPTS=$(eval "echo $opts") + fi +} + +etl_is_mount_opt_set() +{ + if [ -z "$1" ]; then + return 1 + fi + + _etl_init_mount_opts + + if [[ ! $ETL_MOUNT_OPTS =~ (^|,)$1($|,) ]]; then + return 1 + fi + + return 0 +} + # # etl_mount_i # @@ -461,15 +493,9 @@ etl_mount_i() if [ -z "$ETL_MOUNT_SRC" ] || [ -z "$ETL_MOUNT_DST" ]; then return 1 fi - if [ -z "$ETL_MOUNT_OPTS" ]; then - if [ -n "ETL_FNEK_SIG" ]; then - export ETL_MOUNT_OPTS=$(eval \ - "echo $default_fne_mount_opts") - else - export ETL_MOUNT_OPTS=$(eval "echo $default_mount_opts") - fi - fi - + + _etl_init_mount_opts + mount -it ecryptfs -o "$ETL_MOUNT_OPTS" \ "$ETL_MOUNT_SRC" "$ETL_MOUNT_DST" } |