diff --git a/Makefile-ostree.am b/Makefile-ostree.am index 33875dc4..9f2119dc 100644 --- a/Makefile-ostree.am +++ b/Makefile-ostree.am @@ -80,9 +80,12 @@ ostree_SOURCES += \ ostree_SOURCES += \ src/ostree/ot-remote-builtins.h \ src/ostree/ot-remote-builtin-add.c \ + src/ostree/ot-remote-builtin-add-cookie.c \ src/ostree/ot-remote-builtin-delete.c \ + src/ostree/ot-remote-builtin-delete-cookie.c \ src/ostree/ot-remote-builtin-gpg-import.c \ src/ostree/ot-remote-builtin-list.c \ + src/ostree/ot-remote-builtin-list-cookies.c \ src/ostree/ot-remote-builtin-show-url.c \ src/ostree/ot-remote-builtin-refs.c \ src/ostree/ot-remote-builtin-summary.c \ diff --git a/Makefile-tests.am b/Makefile-tests.am index 7d3f4011..6c2301ce 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -22,6 +22,8 @@ include $(top_srcdir)/buildutil/glib-tap.mk EXTRA_DIST += \ buildutil/tap-driver.sh \ buildutil/tap-test \ + tests/glib.supp \ + tests/ostree.supp \ $(NULL) # We should probably consider flipping the default for DEBUG. Also, @@ -43,6 +45,7 @@ dist_test_scripts = \ tests/test-pull-subpath.sh \ tests/test-archivez.sh \ tests/test-remote-add.sh \ + tests/test-remote-cookies.sh \ tests/test-remote-gpg-import.sh \ tests/test-commit-sign.sh \ tests/test-export.sh \ @@ -94,11 +97,16 @@ dist_test_scripts = \ if BUILDOPT_FUSE dist_test_scripts += tests/test-rofiles-fuse.sh +else +EXTRA_DIST += tests/test-rofiles-fuse.sh endif # This one uses corrupt-repo-ref.js +js_tests = tests/test-corruption.sh if BUILDOPT_GJS dist_test_scripts += tests/test-corruption.sh +else +EXTRA_DIST += $(js_tests) endif dist_installed_test_data = tests/archive-test.sh \ @@ -133,11 +141,16 @@ dist_gpgvinsttest_DATA = $(addprefix tests/gpg-verify-data/, \ gpg.conf lgpl2 lgpl2.sig pubring.gpg secring.gpg trustdb.gpg) endif -if BUILDOPT_GJS -dist_installed_test_scripts = tests/test-core.js \ +js_installed_tests = \ + tests/test-core.js \ tests/test-sizes.js \ tests/test-sysroot.js \ $(NULL) + +if BUILDOPT_GJS +dist_installed_test_scripts = $(js_installed_tests) +else +EXTRA_DIST += $(js_installed_tests) endif test_ltlibraries = libreaddir-rand.la diff --git a/Makefile.in b/Makefile.in index f60a3d1b..9509dfcb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -417,22 +417,22 @@ check_PROGRAMS = $(am__EXEEXT_5) @ENABLE_INSTALLED_TESTS_TRUE@am__append_40 = $(test_ltlibraries) $(installed_test_ltlibraries) @ENABLE_INSTALLED_TESTS_TRUE@am__append_41 = $(installed_test_meta_DATA) @BUILDOPT_FUSE_TRUE@am__append_42 = tests/test-rofiles-fuse.sh - -# This one uses corrupt-repo-ref.js -@BUILDOPT_GJS_TRUE@am__append_43 = tests/test-corruption.sh -@ENABLE_INSTALLED_TESTS_FALSE@am__append_44 = -rpath $(abs_builddir) -@USE_LIBARCHIVE_TRUE@am__append_45 = tests/test-libarchive-import -@ENABLE_INSTALLED_TESTS_TRUE@am__append_46 = install-test-data-file-path-hack +@BUILDOPT_FUSE_FALSE@am__append_43 = tests/test-rofiles-fuse.sh +@BUILDOPT_GJS_TRUE@am__append_44 = tests/test-corruption.sh +@BUILDOPT_GJS_FALSE@am__append_45 = $(js_tests) $(js_installed_tests) +@ENABLE_INSTALLED_TESTS_FALSE@am__append_46 = -rpath $(abs_builddir) +@USE_LIBARCHIVE_TRUE@am__append_47 = tests/test-libarchive-import +@ENABLE_INSTALLED_TESTS_TRUE@am__append_48 = install-test-data-file-path-hack # Allow the distcheck install under $prefix test to pass -@BUILDOPT_SYSTEMD_TRUE@am__append_47 = --with-systemdsystemunitdir='$${libdir}/systemd/system' +@BUILDOPT_SYSTEMD_TRUE@am__append_49 = --with-systemdsystemunitdir='$${libdir}/systemd/system' # We're using the system grub2-mkconfig generator -@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_48 = src/boot/grub2/grub2-15_ostree -@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_49 = install-grub2-config-hook -@BUILDOPT_FUSE_TRUE@@ENABLE_MAN_TRUE@am__append_50 = rofiles-fuse.1 -@ENABLE_MAN_TRUE@am__append_51 = $(man1_MANS) $(man5_MANS) $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml) -@ENABLE_MAN_TRUE@am__append_52 = \ +@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_50 = src/boot/grub2/grub2-15_ostree +@BUILDOPT_BUILTIN_GRUB2_MKCONFIG_FALSE@am__append_51 = install-grub2-config-hook +@BUILDOPT_FUSE_TRUE@@ENABLE_MAN_TRUE@am__append_52 = rofiles-fuse.1 +@ENABLE_MAN_TRUE@am__append_53 = $(man1_MANS) $(man5_MANS) $(man1_MANS:.1=.xml) $(man5_MANS:.5=.xml) +@ENABLE_MAN_TRUE@am__append_54 = \ @ENABLE_MAN_TRUE@ $(man1_MANS) \ @ENABLE_MAN_TRUE@ $(man5_MANS) \ @ENABLE_MAN_TRUE@ $(NULL) @@ -792,9 +792,12 @@ am__ostree_SOURCES_DIST = src/ostree/main.c \ src/ostree/ot-admin-functions.c \ src/ostree/ot-remote-builtins.h \ src/ostree/ot-remote-builtin-add.c \ + src/ostree/ot-remote-builtin-add-cookie.c \ src/ostree/ot-remote-builtin-delete.c \ + src/ostree/ot-remote-builtin-delete-cookie.c \ src/ostree/ot-remote-builtin-gpg-import.c \ src/ostree/ot-remote-builtin-list.c \ + src/ostree/ot-remote-builtin-list-cookies.c \ src/ostree/ot-remote-builtin-show-url.c \ src/ostree/ot-remote-builtin-refs.c \ src/ostree/ot-remote-builtin-summary.c \ @@ -849,9 +852,12 @@ am_ostree_OBJECTS = src/ostree/ostree-main.$(OBJEXT) \ src/ostree/ostree-ot-admin-functions.$(OBJEXT) \ $(am__objects_1) \ src/ostree/ostree-ot-remote-builtin-add.$(OBJEXT) \ + src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-delete.$(OBJEXT) \ + src/ostree/ostree-ot-remote-builtin-delete-cookie.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-gpg-import.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-list.$(OBJEXT) \ + src/ostree/ostree-ot-remote-builtin-list-cookies.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-show-url.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-refs.$(OBJEXT) \ src/ostree/ostree-ot-remote-builtin-summary.$(OBJEXT) \ @@ -1321,12 +1327,12 @@ RECHECK_LOGS = $(TEST_LOGS) am__EXEEXT_10 = am__EXEEXT_11 = tests/test-basic.sh tests/test-pull-subpath.sh \ tests/test-archivez.sh tests/test-remote-add.sh \ - tests/test-remote-gpg-import.sh tests/test-commit-sign.sh \ - tests/test-export.sh tests/test-help.sh \ - tests/test-libarchive.sh tests/test-parent.sh \ - tests/test-pull-archive-z.sh tests/test-pull-commit-only.sh \ - tests/test-pull-corruption.sh tests/test-pull-depth.sh \ - tests/test-pull-mirror-summary.sh \ + tests/test-remote-cookies.sh tests/test-remote-gpg-import.sh \ + tests/test-commit-sign.sh tests/test-export.sh \ + tests/test-help.sh tests/test-libarchive.sh \ + tests/test-parent.sh tests/test-pull-archive-z.sh \ + tests/test-pull-commit-only.sh tests/test-pull-corruption.sh \ + tests/test-pull-depth.sh tests/test-pull-mirror-summary.sh \ tests/test-pull-large-metadata.sh tests/test-pull-metalink.sh \ tests/test-pull-summary-sigs.sh tests/test-pull-resume.sh \ tests/test-pull-repeated.sh tests/test-pull-untrusted.sh \ @@ -1351,7 +1357,7 @@ am__EXEEXT_11 = tests/test-basic.sh tests/test-pull-subpath.sh \ tests/test-refs.sh tests/test-demo-buildsystem.sh \ tests/test-switchroot.sh tests/test-pull-contenturl.sh \ tests/test-pull-mirrorlist.sh $(am__EXEEXT_10) \ - $(am__append_42) $(am__append_43) + $(am__append_42) $(am__append_44) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) @@ -1627,7 +1633,7 @@ AM_CPPFLAGS = -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"' \ -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_2_48 AM_CFLAGS = -std=gnu99 $(WARN_CFLAGS) AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man \ - --disable-maintainer-mode $(NULL) $(am__append_47) + --disable-maintainer-mode $(NULL) $(am__append_49) SUBDIRS = . $(am__append_1) NULL = BUILT_SOURCES = $(am__append_3) @@ -1639,7 +1645,7 @@ CLEANFILES = $(BUILT_SOURCES) $(am__append_20) \ tests/ostree-remount-symlink-stamp \ tests/rofiles-fuse-symlink-stamp tests/ostree \ tests/ostree-prepare-root tests/ostree-remount \ - tests/rofiles-fuse $(am__append_52) + tests/rofiles-fuse $(am__append_54) EXTRA_DIST = autogen.sh COPYING README.md libglnx/README.md \ libglnx/COPYING libglnx/libglnx.m4 $(NULL) \ libglnx/Makefile-libglnx.am bsdiff/bsdiff.h bsdiff/bspatch.h \ @@ -1652,16 +1658,17 @@ EXTRA_DIST = autogen.sh COPYING README.md libglnx/README.md \ src/libostree/ostree-repo-deprecated.h \ src/ostree/parse-datetime.y $(all_dist_test_scripts) \ $(all_dist_test_data) buildutil/tap-driver.sh \ - buildutil/tap-test $(NULL) tests/libostreetest.h \ + buildutil/tap-test tests/glib.supp tests/ostree.supp $(NULL) \ + $(am__append_43) $(am__append_45) tests/libostreetest.h \ tests/libtest.sh tests/gpg-verify-data/README.md $(NULL) \ src/boot/dracut/module-setup.sh src/boot/dracut/ostree.conf \ src/boot/mkinitcpio/ostree \ src/boot/ostree-prepare-root.service \ src/boot/ostree-remount.service src/boot/grub2/grub2-15_ostree \ - src/boot/grub2/ostree-grub-generator $(NULL) $(am__append_51) + src/boot/grub2/ostree-grub-generator $(NULL) $(am__append_53) bin_SCRIPTS = lib_LTLIBRARIES = libostree-1.la -pkglibexec_SCRIPTS = $(am__append_48) +pkglibexec_SCRIPTS = $(am__append_50) noinst_LTLIBRARIES = libglnx.la libbsdiff.la libotutil.la \ libostree-kernel-args.la libbupsplit.la $(am__append_29) \ libostreetest.la @@ -1678,8 +1685,8 @@ gsettings_SCHEMAS = ostree_bootdir = $(prefix)/lib/ostree # This is a special facility to chain together hooks easily -INSTALL_DATA_HOOKS = install-mkdir-remotes-d-hook $(am__append_46) \ - $(am__append_49) +INSTALL_DATA_HOOKS = install-mkdir-remotes-d-hook $(am__append_48) \ + $(am__append_51) ALL_LOCAL_RULES = tests/libreaddir-rand.so shortened_sysconfdir = $$(echo "$(sysconfdir)" | sed -e 's|^$(prefix)||' -e 's|^/||') ACLOCAL_AMFLAGS = -I buildutil -I libglnx ${ACLOCAL_FLAGS} @@ -1934,9 +1941,12 @@ ostree_SOURCES = src/ostree/main.c src/ostree/ot-builtin-admin.c \ src/ostree/ot-admin-functions.c $(NULL) \ src/ostree/ot-remote-builtins.h \ src/ostree/ot-remote-builtin-add.c \ + src/ostree/ot-remote-builtin-add-cookie.c \ src/ostree/ot-remote-builtin-delete.c \ + src/ostree/ot-remote-builtin-delete-cookie.c \ src/ostree/ot-remote-builtin-gpg-import.c \ src/ostree/ot-remote-builtin-list.c \ + src/ostree/ot-remote-builtin-list-cookies.c \ src/ostree/ot-remote-builtin-show-url.c \ src/ostree/ot-remote-builtin-refs.c \ src/ostree/ot-remote-builtin-summary.c $(NULL) \ @@ -2031,12 +2041,12 @@ uninstalled_test_data = tests/ostree-symlink-stamp tests/ostree-prepare-root-sym dist_uninstalled_test_scripts = tests/test-symbols.sh dist_test_scripts = tests/test-basic.sh tests/test-pull-subpath.sh \ tests/test-archivez.sh tests/test-remote-add.sh \ - tests/test-remote-gpg-import.sh tests/test-commit-sign.sh \ - tests/test-export.sh tests/test-help.sh \ - tests/test-libarchive.sh tests/test-parent.sh \ - tests/test-pull-archive-z.sh tests/test-pull-commit-only.sh \ - tests/test-pull-corruption.sh tests/test-pull-depth.sh \ - tests/test-pull-mirror-summary.sh \ + tests/test-remote-cookies.sh tests/test-remote-gpg-import.sh \ + tests/test-commit-sign.sh tests/test-export.sh \ + tests/test-help.sh tests/test-libarchive.sh \ + tests/test-parent.sh tests/test-pull-archive-z.sh \ + tests/test-pull-commit-only.sh tests/test-pull-corruption.sh \ + tests/test-pull-depth.sh tests/test-pull-mirror-summary.sh \ tests/test-pull-large-metadata.sh tests/test-pull-metalink.sh \ tests/test-pull-summary-sigs.sh tests/test-pull-resume.sh \ tests/test-pull-repeated.sh tests/test-pull-untrusted.sh \ @@ -2061,7 +2071,10 @@ dist_test_scripts = tests/test-basic.sh tests/test-pull-subpath.sh \ tests/test-refs.sh tests/test-demo-buildsystem.sh \ tests/test-switchroot.sh tests/test-pull-contenturl.sh \ tests/test-pull-mirrorlist.sh $(NULL) $(am__append_42) \ - $(am__append_43) + $(am__append_44) + +# This one uses corrupt-repo-ref.js +js_tests = tests/test-corruption.sh dist_installed_test_data = tests/archive-test.sh \ tests/pull-test.sh \ tests/libtest.sh \ @@ -2093,11 +2106,13 @@ dist_test_extra_scripts = tests/bootloader-entries-crosscheck.py \ @ENABLE_INSTALLED_TESTS_TRUE@dist_gpgvinsttest_DATA = $(addprefix tests/gpg-verify-data/, \ @ENABLE_INSTALLED_TESTS_TRUE@ gpg.conf lgpl2 lgpl2.sig pubring.gpg secring.gpg trustdb.gpg) -@BUILDOPT_GJS_TRUE@dist_installed_test_scripts = tests/test-core.js \ -@BUILDOPT_GJS_TRUE@ tests/test-sizes.js \ -@BUILDOPT_GJS_TRUE@ tests/test-sysroot.js \ -@BUILDOPT_GJS_TRUE@ $(NULL) +js_installed_tests = \ + tests/test-core.js \ + tests/test-sizes.js \ + tests/test-sysroot.js \ + $(NULL) +@BUILDOPT_GJS_TRUE@dist_installed_test_scripts = $(js_installed_tests) test_ltlibraries = libreaddir-rand.la libreaddir_rand_la_SOURCES = tests/readdir-rand.c libreaddir_rand_la_CFLAGS = $(AM_CFLAGS) $(OT_INTERNAL_GIO_UNIX_CFLAGS) @@ -2107,14 +2122,14 @@ libreaddir_rand_la_LIBADD = \ $(NULL) libreaddir_rand_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version \ - $(am__append_44) + $(am__append_46) test_programs = tests/test-varint tests/test-ot-unix-utils \ tests/test-bsdiff tests/test-mutable-tree \ tests/test-keyfile-utils tests/test-ot-opt-utils \ tests/test-ot-tool-util tests/test-gpg-verify-result \ tests/test-checksum tests/test-lzma tests/test-rollsum \ tests/test-basic-c tests/test-sysroot-c tests/test-pull-c \ - $(am__append_45) + $(am__append_47) common_tests_cflags = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx common_tests_ldadd = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS) libostreetest_la_SOURCES = tests/libostreetest.c @@ -2198,7 +2213,7 @@ tests_test_gpg_verify_result_LDADD = $(TESTS_LDADD) $(OT_INTERNAL_GPGME_LIBS) @ENABLE_MAN_TRUE@ ostree-reset.1 ostree-rev-parse.1 \ @ENABLE_MAN_TRUE@ ostree-show.1 ostree-summary.1 \ @ENABLE_MAN_TRUE@ ostree-static-delta.1 ostree-trivial-httpd.1 \ -@ENABLE_MAN_TRUE@ $(am__append_50) +@ENABLE_MAN_TRUE@ $(am__append_52) @ENABLE_MAN_TRUE@man5_files = ostree.repo.5 ostree.repo-config.5 @ENABLE_MAN_TRUE@man1_MANS = $(addprefix man/,$(man1_files)) @ENABLE_MAN_TRUE@man5_MANS = $(addprefix man/,$(man5_files)) @@ -3051,15 +3066,24 @@ src/ostree/ostree-ot-admin-functions.$(OBJEXT): \ src/ostree/ostree-ot-remote-builtin-add.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) +src/ostree/ostree-ot-remote-builtin-add-cookie.$(OBJEXT): \ + src/ostree/$(am__dirstamp) \ + src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-delete.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) +src/ostree/ostree-ot-remote-builtin-delete-cookie.$(OBJEXT): \ + src/ostree/$(am__dirstamp) \ + src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-gpg-import.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-list.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) +src/ostree/ostree-ot-remote-builtin-list-cookies.$(OBJEXT): \ + src/ostree/$(am__dirstamp) \ + src/ostree/$(DEPDIR)/$(am__dirstamp) src/ostree/ostree-ot-remote-builtin-show-url.$(OBJEXT): \ src/ostree/$(am__dirstamp) \ src/ostree/$(DEPDIR)/$(am__dirstamp) @@ -3581,9 +3605,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-editor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-gpg-import.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-refs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Po@am__quote@ @@ -4755,6 +4782,20 @@ src/ostree/ostree-ot-remote-builtin-add.obj: src/ostree/ot-remote-builtin-add.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add.obj `if test -f 'src/ostree/ot-remote-builtin-add.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add.c'; fi` +src/ostree/ostree-ot-remote-builtin-add-cookie.o: src/ostree/ot-remote-builtin-add-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-add-cookie.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.o `test -f 'src/ostree/ot-remote-builtin-add-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-add-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-add-cookie.c' object='src/ostree/ostree-ot-remote-builtin-add-cookie.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.o `test -f 'src/ostree/ot-remote-builtin-add-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-add-cookie.c + +src/ostree/ostree-ot-remote-builtin-add-cookie.obj: src/ostree/ot-remote-builtin-add-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-add-cookie.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-add-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add-cookie.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-add-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-add-cookie.c' object='src/ostree/ostree-ot-remote-builtin-add-cookie.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-add-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-add-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-add-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-add-cookie.c'; fi` + src/ostree/ostree-ot-remote-builtin-delete.o: src/ostree/ot-remote-builtin-delete.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete.o `test -f 'src/ostree/ot-remote-builtin-delete.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete.Po @@ -4769,6 +4810,20 @@ src/ostree/ostree-ot-remote-builtin-delete.obj: src/ostree/ot-remote-builtin-del @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete.obj `if test -f 'src/ostree/ot-remote-builtin-delete.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete.c'; fi` +src/ostree/ostree-ot-remote-builtin-delete-cookie.o: src/ostree/ot-remote-builtin-delete-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete-cookie.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.o `test -f 'src/ostree/ot-remote-builtin-delete-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-delete-cookie.c' object='src/ostree/ostree-ot-remote-builtin-delete-cookie.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.o `test -f 'src/ostree/ot-remote-builtin-delete-cookie.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-delete-cookie.c + +src/ostree/ostree-ot-remote-builtin-delete-cookie.obj: src/ostree/ot-remote-builtin-delete-cookie.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-delete-cookie.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-delete-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete-cookie.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-delete-cookie.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-delete-cookie.c' object='src/ostree/ostree-ot-remote-builtin-delete-cookie.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-delete-cookie.obj `if test -f 'src/ostree/ot-remote-builtin-delete-cookie.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-delete-cookie.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-delete-cookie.c'; fi` + src/ostree/ostree-ot-remote-builtin-gpg-import.o: src/ostree/ot-remote-builtin-gpg-import.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-gpg-import.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-gpg-import.Tpo -c -o src/ostree/ostree-ot-remote-builtin-gpg-import.o `test -f 'src/ostree/ot-remote-builtin-gpg-import.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-gpg-import.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-gpg-import.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-gpg-import.Po @@ -4797,6 +4852,20 @@ src/ostree/ostree-ot-remote-builtin-list.obj: src/ostree/ot-remote-builtin-list. @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list.obj `if test -f 'src/ostree/ot-remote-builtin-list.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list.c'; fi` +src/ostree/ostree-ot-remote-builtin-list-cookies.o: src/ostree/ot-remote-builtin-list-cookies.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-list-cookies.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.o `test -f 'src/ostree/ot-remote-builtin-list-cookies.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-list-cookies.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-list-cookies.c' object='src/ostree/ostree-ot-remote-builtin-list-cookies.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.o `test -f 'src/ostree/ot-remote-builtin-list-cookies.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-list-cookies.c + +src/ostree/ostree-ot-remote-builtin-list-cookies.obj: src/ostree/ot-remote-builtin-list-cookies.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-list-cookies.obj -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.obj `if test -f 'src/ostree/ot-remote-builtin-list-cookies.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list-cookies.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list-cookies.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-list-cookies.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/ostree/ot-remote-builtin-list-cookies.c' object='src/ostree/ostree-ot-remote-builtin-list-cookies.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -c -o src/ostree/ostree-ot-remote-builtin-list-cookies.obj `if test -f 'src/ostree/ot-remote-builtin-list-cookies.c'; then $(CYGPATH_W) 'src/ostree/ot-remote-builtin-list-cookies.c'; else $(CYGPATH_W) '$(srcdir)/src/ostree/ot-remote-builtin-list-cookies.c'; fi` + src/ostree/ostree-ot-remote-builtin-show-url.o: src/ostree/ot-remote-builtin-show-url.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ostree_CFLAGS) $(CFLAGS) -MT src/ostree/ostree-ot-remote-builtin-show-url.o -MD -MP -MF src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Tpo -c -o src/ostree/ostree-ot-remote-builtin-show-url.o `test -f 'src/ostree/ot-remote-builtin-show-url.c' || echo '$(srcdir)/'`src/ostree/ot-remote-builtin-show-url.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Tpo src/ostree/$(DEPDIR)/ostree-ot-remote-builtin-show-url.Po @@ -6004,6 +6073,13 @@ tests/test-remote-add.sh.log: tests/test-remote-add.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +tests/test-remote-cookies.sh.log: tests/test-remote-cookies.sh + @p='tests/test-remote-cookies.sh'; \ + b='tests/test-remote-cookies.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test-remote-gpg-import.sh.log: tests/test-remote-gpg-import.sh @p='tests/test-remote-gpg-import.sh'; \ b='tests/test-remote-gpg-import.sh'; \ diff --git a/apidoc/html/index.html b/apidoc/html/index.html index 16a2dbaf..78f899bc 100644 --- a/apidoc/html/index.html +++ b/apidoc/html/index.html @@ -14,7 +14,7 @@
-

for OSTree 2016.11

+

for OSTree 2016.12


diff --git a/apidoc/version.xml b/apidoc/version.xml index 641d1735..106e625c 100644 --- a/apidoc/version.xml +++ b/apidoc/version.xml @@ -1 +1 @@ -2016.11 \ No newline at end of file +2016.12 \ No newline at end of file diff --git a/configure b/configure index 9d7df117..9a24850c 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ostree 2016.12. +# Generated by GNU Autoconf 2.69 for ostree 2016.13. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ostree' PACKAGE_TARNAME='ostree' -PACKAGE_VERSION='2016.12' -PACKAGE_STRING='ostree 2016.12' +PACKAGE_VERSION='2016.13' +PACKAGE_STRING='ostree 2016.13' PACKAGE_BUGREPORT='walters@verbum.org' PACKAGE_URL='' @@ -1480,7 +1480,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ostree 2016.12 to adapt to many kinds of systems. +\`configure' configures ostree 2016.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ostree 2016.12:";; + short | recursive ) echo "Configuration of ostree 2016.13:";; esac cat <<\_ACEOF @@ -1759,7 +1759,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ostree configure 2016.12 +ostree configure 2016.13 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2174,7 +2174,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ostree $as_me 2016.12, which was +It was created by ostree $as_me 2016.13, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3041,7 +3041,7 @@ fi # Define the identity of the package. PACKAGE='ostree' - VERSION='2016.12' + VERSION='2016.13' # Some tools Automake needs. @@ -17092,7 +17092,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ostree $as_me 2016.12, which was +This file was extended by ostree $as_me 2016.13, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17158,7 +17158,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ostree config.status 2016.12 +ostree config.status 2016.13 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 7a6fdf13..ffa86295 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.63]) dnl If incrementing the version here, remember to update libostree.sym too -AC_INIT([ostree], [2016.12], [walters@verbum.org]) +AC_INIT([ostree], [2016.13], [walters@verbum.org]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([buildutil]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/libglnx/glnx-dirfd.c b/libglnx/glnx-dirfd.c index 95d7fe17..3a02bb0a 100644 --- a/libglnx/glnx-dirfd.c +++ b/libglnx/glnx-dirfd.c @@ -142,6 +142,7 @@ glnx_dirfd_iterator_init_take_fd (int dfd, real_dfd_iter->fd = dfd; real_dfd_iter->d = d; + real_dfd_iter->initialized = TRUE; ret = TRUE; out: @@ -169,6 +170,7 @@ glnx_dirfd_iterator_next_dent (GLnxDirFdIterator *dfd_iter, GLnxRealDirfdIterator *real_dfd_iter = (GLnxRealDirfdIterator*) dfd_iter; g_return_val_if_fail (out_dent, FALSE); + g_return_val_if_fail (dfd_iter->initialized, FALSE); if (g_cancellable_set_error_if_cancelled (cancellable, error)) goto out; @@ -250,6 +252,8 @@ glnx_dirfd_iterator_clear (GLnxDirFdIterator *dfd_iter) { GLnxRealDirfdIterator *real_dfd_iter = (GLnxRealDirfdIterator*) dfd_iter; /* fd is owned by dfd_iter */ + if (!real_dfd_iter->initialized) + return; (void) closedir (real_dfd_iter->d); real_dfd_iter->initialized = FALSE; } diff --git a/libglnx/glnx-fdio.h b/libglnx/glnx-fdio.h index 982545ab..111df9d5 100644 --- a/libglnx/glnx-fdio.h +++ b/libglnx/glnx-fdio.h @@ -130,9 +130,9 @@ int glnx_loop_write (int fd, const void *buf, size_t nbytes); typedef enum { - GLNX_FILE_COPY_OVERWRITE, - GLNX_FILE_COPY_NOXATTRS, - GLNX_FILE_COPY_DATASYNC + GLNX_FILE_COPY_OVERWRITE = (1 << 0), + GLNX_FILE_COPY_NOXATTRS = (1 << 1), + GLNX_FILE_COPY_DATASYNC = (1 << 2) } GLnxFileCopyFlags; gboolean diff --git a/man/ostree-admin-cleanup.1 b/man/ostree-admin-cleanup.1 index 952dba5c..69429cba 100644 --- a/man/ostree-admin-cleanup.1 +++ b/man/ostree-admin-cleanup.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin cleanup .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin cleanup .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-config-diff.1 b/man/ostree-admin-config-diff.1 index 8c34ecf4..a5fe7eae 100644 --- a/man/ostree-admin-config-diff.1 +++ b/man/ostree-admin-config-diff.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin config-diff .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin config-diff .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-deploy.1 b/man/ostree-admin-deploy.1 index e23ace37..978409d4 100644 --- a/man/ostree-admin-deploy.1 +++ b/man/ostree-admin-deploy.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin deploy .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin deploy .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-init-fs.1 b/man/ostree-admin-init-fs.1 index 4aa454f4..2bcff108 100644 --- a/man/ostree-admin-init-fs.1 +++ b/man/ostree-admin-init-fs.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin init-fs .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin init-fs .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-instutil.1 b/man/ostree-admin-instutil.1 index 625e07e7..f6b837e1 100644 --- a/man/ostree-admin-instutil.1 +++ b/man/ostree-admin-instutil.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin instutil .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin instutil .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-os-init.1 b/man/ostree-admin-os-init.1 index d7141f29..699d505e 100644 --- a/man/ostree-admin-os-init.1 +++ b/man/ostree-admin-os-init.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin os-init .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin os-init .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-set-origin.1 b/man/ostree-admin-set-origin.1 index 5d39f74c..c06100c6 100644 --- a/man/ostree-admin-set-origin.1 +++ b/man/ostree-admin-set-origin.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin set-origin .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin set-origin .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-status.1 b/man/ostree-admin-status.1 index 2d0540b0..9f8e7dc9 100644 --- a/man/ostree-admin-status.1 +++ b/man/ostree-admin-status.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin status .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin status .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-switch.1 b/man/ostree-admin-switch.1 index 374addd8..cead83b5 100644 --- a/man/ostree-admin-switch.1 +++ b/man/ostree-admin-switch.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin switch .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin switch .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-undeploy.1 b/man/ostree-admin-undeploy.1 index 9db26f5a..bb81c978 100644 --- a/man/ostree-admin-undeploy.1 +++ b/man/ostree-admin-undeploy.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin undeploy .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin undeploy .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-unlock.1 b/man/ostree-admin-unlock.1 index 98a721db..e6b302ba 100644 --- a/man/ostree-admin-unlock.1 +++ b/man/ostree-admin-unlock.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin unlock .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin unlock .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin-upgrade.1 b/man/ostree-admin-upgrade.1 index 543b29e4..8394a57b 100644 --- a/man/ostree-admin-upgrade.1 +++ b/man/ostree-admin-upgrade.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin upgrade .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin upgrade .\" Source: OSTree .\" Language: English diff --git a/man/ostree-admin.1 b/man/ostree-admin.1 index fd63efe1..4ff2251f 100644 --- a/man/ostree-admin.1 +++ b/man/ostree-admin.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree admin .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree admin .\" Source: OSTree .\" Language: English diff --git a/man/ostree-cat.1 b/man/ostree-cat.1 index 18a30191..79136515 100644 --- a/man/ostree-cat.1 +++ b/man/ostree-cat.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree cat .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree cat .\" Source: OSTree .\" Language: English diff --git a/man/ostree-checkout.1 b/man/ostree-checkout.1 index afb8cb3d..431b2b8c 100644 --- a/man/ostree-checkout.1 +++ b/man/ostree-checkout.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree checkout .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree checkout .\" Source: OSTree .\" Language: English diff --git a/man/ostree-checksum.1 b/man/ostree-checksum.1 index b617a2b6..008bd1b5 100644 --- a/man/ostree-checksum.1 +++ b/man/ostree-checksum.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree checksum .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree checksum .\" Source: OSTree .\" Language: English diff --git a/man/ostree-commit.1 b/man/ostree-commit.1 index 80b33e7e..6fc6d5f4 100644 --- a/man/ostree-commit.1 +++ b/man/ostree-commit.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree commit .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree commit .\" Source: OSTree .\" Language: English diff --git a/man/ostree-config.1 b/man/ostree-config.1 index a2712eb6..3848f060 100644 --- a/man/ostree-config.1 +++ b/man/ostree-config.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree config .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree config .\" Source: OSTree .\" Language: English diff --git a/man/ostree-diff.1 b/man/ostree-diff.1 index 56749588..ea338208 100644 --- a/man/ostree-diff.1 +++ b/man/ostree-diff.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree diff .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree diff .\" Source: OSTree .\" Language: English diff --git a/man/ostree-export.1 b/man/ostree-export.1 index 00bec72f..8be2b9d1 100644 --- a/man/ostree-export.1 +++ b/man/ostree-export.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree export .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree export .\" Source: OSTree .\" Language: English diff --git a/man/ostree-fsck.1 b/man/ostree-fsck.1 index 9116171a..d462f4aa 100644 --- a/man/ostree-fsck.1 +++ b/man/ostree-fsck.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree fsck .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree fsck .\" Source: OSTree .\" Language: English diff --git a/man/ostree-gpg-sign.1 b/man/ostree-gpg-sign.1 index 6d16833f..ceed986e 100644 --- a/man/ostree-gpg-sign.1 +++ b/man/ostree-gpg-sign.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree gpg-sign .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree gpg-sign .\" Source: OSTree .\" Language: English diff --git a/man/ostree-init.1 b/man/ostree-init.1 index 42cfb741..9cb66110 100644 --- a/man/ostree-init.1 +++ b/man/ostree-init.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree init .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree init .\" Source: OSTree .\" Language: English diff --git a/man/ostree-log.1 b/man/ostree-log.1 index 70fac675..4b9a1889 100644 --- a/man/ostree-log.1 +++ b/man/ostree-log.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree log .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree log .\" Source: OSTree .\" Language: English diff --git a/man/ostree-ls.1 b/man/ostree-ls.1 index 2aa91c2d..e38daa72 100644 --- a/man/ostree-ls.1 +++ b/man/ostree-ls.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree ls .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree ls .\" Source: OSTree .\" Language: English diff --git a/man/ostree-prune.1 b/man/ostree-prune.1 index befb3b3b..df3bfb4e 100644 --- a/man/ostree-prune.1 +++ b/man/ostree-prune.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree prune .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree prune .\" Source: OSTree .\" Language: English diff --git a/man/ostree-pull-local.1 b/man/ostree-pull-local.1 index e3d23491..05437600 100644 --- a/man/ostree-pull-local.1 +++ b/man/ostree-pull-local.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree pull-local .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree pull-local .\" Source: OSTree .\" Language: English diff --git a/man/ostree-pull.1 b/man/ostree-pull.1 index 3fd72024..f5902218 100644 --- a/man/ostree-pull.1 +++ b/man/ostree-pull.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree pull .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree pull .\" Source: OSTree .\" Language: English diff --git a/man/ostree-refs.1 b/man/ostree-refs.1 index 035777a6..030e85ca 100644 --- a/man/ostree-refs.1 +++ b/man/ostree-refs.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree refs .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree refs .\" Source: OSTree .\" Language: English diff --git a/man/ostree-remote.1 b/man/ostree-remote.1 index b78aaba1..f347bad4 100644 --- a/man/ostree-remote.1 +++ b/man/ostree-remote.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree remote .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/10/2016 .\" Manual: ostree remote .\" Source: OSTree .\" Language: English @@ -44,6 +44,12 @@ ostree-remote \- Control remote repository configuration \fBostree remote refs\fR {NAME} .HP \w'\fBostree\ remote\ summary\fR\ 'u \fBostree remote summary\fR [OPTIONS...] {NAME} +.HP \w'\fBostree\ remote\ add\-cookie\fR\ 'u +\fBostree remote add\-cookie\fR {NAME} {DOMAIN} {PATH} {COOKIE_NAME} {VALUE} +.HP \w'\fBostree\ remote\ delete\-cookie\fR\ 'u +\fBostree remote delete\-cookie\fR {NAME} {DOMAIN} {PATH} {COOKIE_NAME} {VALUE} +.HP \w'\fBostree\ remote\ list\-cookies\fR\ 'u +\fBostree remote list\-cookies\fR {NAME} .SH "DESCRIPTION" .PP Changes remote repository configurations\&. The NAME refers to the name of the remote\&. @@ -59,7 +65,9 @@ list can restrict which keys are imported from a keyring file or input stream\&. nor \fB\-\-stdin\fR options are given, then keys are imported from the user\*(Aqs personal GPG keyring\&. -.SH "'ADD' OPTIONS" +.PP +The various cookie related command allow management of a remote specific cookie jar\&. +.SH "\*(AQADD\*(AQ OPTIONS" .PP \fB\-\-set\fR="KEY=VALUE" .RS 4 @@ -78,13 +86,13 @@ Import one or more GPG keys from a file\&. Equivalent to \fBostree remote gpg\-import \-\-keyring=FILE\fR\&. .RE -.SH "'LIST' OPTIONS" +.SH "\*(AQLIST\*(AQ OPTIONS" .PP \fB\-u, \-\-show\-urls\fR .RS 4 Show remote URLs in list .RE -.SH "'GPG-IMPORT' OPTIONS" +.SH "\*(AQGPG\-IMPORT\*(AQ OPTIONS" .PP \fB\-k, \-\-keyring\fR=FILE .RS 4 @@ -101,7 +109,7 @@ Import one or more keys from standard input\&. This option may not be used in combination with \fB\-\-keyring\fR\&. .RE -.SH "'SUMMARY' OPTIONS" +.SH "\*(AQSUMMARY\*(AQ OPTIONS" .PP \fB\-\-raw\fR .RS 4 diff --git a/man/ostree-remote.xml b/man/ostree-remote.xml index 2e600845..88e61ac0 100644 --- a/man/ostree-remote.xml +++ b/man/ostree-remote.xml @@ -69,6 +69,25 @@ Boston, MA 02111-1307, USA. ostree remote summary OPTIONS NAME + + ostree remote add-cookie + NAME + DOMAIN + PATH + COOKIE_NAME + VALUE + + + ostree remote delete-cookie + NAME + DOMAIN + PATH + COOKIE_NAME + VALUE + + + ostree remote list-cookies NAME + @@ -83,6 +102,9 @@ Boston, MA 02111-1307, USA. The GPG keys to import may be in binary OpenPGP format or ASCII armored. The optional KEY-ID list can restrict which keys are imported from a keyring file or input stream. All keys are imported if this list is omitted. If neither nor options are given, then keys are imported from the user's personal GPG keyring. + + The various cookie related command allow management of a remote specific cookie jar. + diff --git a/man/ostree-reset.1 b/man/ostree-reset.1 index 4e6aa483..0091b0a1 100644 --- a/man/ostree-reset.1 +++ b/man/ostree-reset.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree reset .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree reset .\" Source: OSTree .\" Language: English diff --git a/man/ostree-rev-parse.1 b/man/ostree-rev-parse.1 index 649b501c..728cf340 100644 --- a/man/ostree-rev-parse.1 +++ b/man/ostree-rev-parse.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree rev-parse .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree rev-parse .\" Source: OSTree .\" Language: English diff --git a/man/ostree-show.1 b/man/ostree-show.1 index bbfecc90..99a01eca 100644 --- a/man/ostree-show.1 +++ b/man/ostree-show.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree show .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree show .\" Source: OSTree .\" Language: English diff --git a/man/ostree-static-delta.1 b/man/ostree-static-delta.1 index 13b9d7fc..1583cc17 100644 --- a/man/ostree-static-delta.1 +++ b/man/ostree-static-delta.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree static-delta .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree static-delta .\" Source: OSTree .\" Language: English @@ -43,7 +43,7 @@ ostree-static-delta \- Manage static delta files .SH "DESCRIPTION" .PP List and manipulate static delta files\&. -.SH "'GENERATE' OPTIONS" +.SH "\*(AQGENERATE\*(AQ OPTIONS" .PP \fB\-\-from\fR="REV" .RS 4 diff --git a/man/ostree-summary.1 b/man/ostree-summary.1 index 5b6ded26..668a780f 100644 --- a/man/ostree-summary.1 +++ b/man/ostree-summary.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree summary .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree summary .\" Source: OSTree .\" Language: English diff --git a/man/ostree-trivial-httpd.1 b/man/ostree-trivial-httpd.1 index ac849aa8..635981f4 100644 --- a/man/ostree-trivial-httpd.1 +++ b/man/ostree-trivial-httpd.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree trivial-httpd .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree trivial-httpd .\" Source: OSTree .\" Language: English diff --git a/man/ostree.1 b/man/ostree.1 index 0a38688b..f77a3aaa 100644 --- a/man/ostree.1 +++ b/man/ostree.1 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree .\" Source: OSTree .\" Language: English diff --git a/man/ostree.repo-config.5 b/man/ostree.repo-config.5 index bbdfd76c..988f8a11 100644 --- a/man/ostree.repo-config.5 +++ b/man/ostree.repo-config.5 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree.repo-config .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/10/2016 .\" Manual: ostree.repo-config .\" Source: OSTree .\" Language: English @@ -125,7 +125,7 @@ Path to file containing client\-side certificate key, to present when making req .RS 4 Path to file containing trusted anchors instead of the system CA database\&. .RE -.SH "/ETC/OSTREE/REMOTES.D" +.SH "/ETC/OSTREE/REMOTES\&.D" .PP In addition to the /ostree/repo/config @@ -134,11 +134,19 @@ file, remotes may also be specified in \&.conf; files whose name does not end in \&.conf will be ignored\&. -.SH "PER-REMOTE GPG KEYRINGS AND VERIFICATION" +.SH "PER\-REMOTE GPG KEYRINGS AND VERIFICATION" .PP OSTree supports a per\-remote GPG keyring\&. For more information see \fBostree\fR(1)\&. in the section GPG verification\&. +.SH "PER\-REMOTE HTTP COOKIES" +.PP +Some content providers may want to control access to remote repositories via HTTP cookies\&. The +\fBostree remote add\-cookie\fR +and +\fBostree remote delete\-cookie\fR +commands will update a per\-remote lookaside cookie jar, named +$remotename\&.cookies\&.txt\&. .SH "SEE ALSO" .PP \fBostree\fR(1), diff --git a/man/ostree.repo-config.xml b/man/ostree.repo-config.xml index 0c421ba4..1182aa93 100644 --- a/man/ostree.repo-config.xml +++ b/man/ostree.repo-config.xml @@ -204,6 +204,18 @@ Boston, MA 02111-1307, USA. in the section GPG verification. + + + Per-remote HTTP cookies + + Some content providers may want to control access to remote + repositories via HTTP cookies. The ostree remote + add-cookie and ostree remote + delete-cookie commands will update a per-remote + lookaside cookie jar, named + $remotename.cookies.txt. + + See Also diff --git a/man/ostree.repo.5 b/man/ostree.repo.5 index 72421c73..5c7286c9 100644 --- a/man/ostree.repo.5 +++ b/man/ostree.repo.5 @@ -1,8 +1,8 @@ '\" t .\" Title: ostree.repo .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: ostree.repo .\" Source: OSTree .\" Language: English diff --git a/man/rofiles-fuse.1 b/man/rofiles-fuse.1 index e0fcd501..fe6ec453 100644 --- a/man/rofiles-fuse.1 +++ b/man/rofiles-fuse.1 @@ -1,8 +1,8 @@ '\" t .\" Title: rofiles-fuse .\" Author: Colin Walters -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 10/05/2016 +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 11/03/2016 .\" Manual: rofiles-fuse .\" Source: rofiles-fuse .\" Language: English diff --git a/src/libostree/libostree.sym b/src/libostree/libostree.sym index ddb87e7b..fb7e5848 100644 --- a/src/libostree/libostree.sym +++ b/src/libostree/libostree.sym @@ -357,14 +357,15 @@ global: /* No new symbols in 2016.10 */ /* No new symbols in 2016.11 */ /* No new symbols in 2016.12 */ +/* No new symbols in 2016.13 */ /* NOTE NOTE NOTE * Versions above here are released. Only add symbols below this line. * NOTE NOTE NOTE */ -/* Remove comment when first new symbol is added -LIBOSTREE_2016.12 +/* Remove comment when first new symbol is added, replace XX with new stable version. +LIBOSTREE_2016.XX global: someostree_symbol_deleteme; } LIBOSTREE_2016.8; diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c index f3dc8e16..0fbb098e 100644 --- a/src/libostree/ostree-bootloader-grub2.c +++ b/src/libostree/ostree-bootloader-grub2.c @@ -54,7 +54,6 @@ _ostree_bootloader_grub2_query (OstreeBootloader *bootloader, gboolean ret = FALSE; OstreeBootloaderGrub2 *self = OSTREE_BOOTLOADER_GRUB2 (bootloader); g_autoptr(GFile) efi_basedir = NULL; - g_autoptr(GFileInfo) file_info = NULL; if (g_file_query_exists (self->config_path_bios, NULL)) { @@ -290,8 +289,6 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader, { OstreeBootloaderGrub2 *self = OSTREE_BOOTLOADER_GRUB2 (bootloader); gboolean ret = FALSE; - g_autoptr(GFile) efi_new_config_temp = NULL; - g_autoptr(GFile) efi_orig_config = NULL; g_autoptr(GFile) new_config_path = NULL; GSubprocessFlags subp_flags = 0; glnx_unref_object GSubprocessLauncher *launcher = NULL; diff --git a/src/libostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c index c2dc8ea4..18794ce1 100644 --- a/src/libostree/ostree-fetcher.c +++ b/src/libostree/ostree-fetcher.c @@ -326,6 +326,16 @@ session_thread_set_proxy_cb (ThreadClosure *thread_closure, } } +static void +session_thread_set_cookie_jar_cb (ThreadClosure *thread_closure, + gpointer data) +{ + SoupCookieJar *jar = data; + + soup_session_add_feature (thread_closure->session, + SOUP_SESSION_FEATURE (jar)); +} + #ifdef HAVE_LIBSOUP_CLIENT_CERTS static void session_thread_set_tls_interaction_cb (ThreadClosure *thread_closure, @@ -746,6 +756,23 @@ _ostree_fetcher_set_proxy (OstreeFetcher *self, } } +void +_ostree_fetcher_set_cookie_jar (OstreeFetcher *self, + const char *jar_path) +{ + SoupCookieJar *jar; + + g_return_if_fail (OSTREE_IS_FETCHER (self)); + g_return_if_fail (jar_path != NULL); + + jar = soup_cookie_jar_text_new (jar_path, TRUE); + + session_thread_idle_add (self->thread_closure, + session_thread_set_cookie_jar_cb, + jar, /* takes ownership */ + (GDestroyNotify) g_object_unref); +} + void _ostree_fetcher_set_client_cert (OstreeFetcher *self, GTlsCertificate *cert) @@ -1030,6 +1057,7 @@ on_request_sent (GObject *object, switch (msg->status_code) { case 404: + case 403: case 410: code = G_IO_ERROR_NOT_FOUND; break; @@ -1282,7 +1310,6 @@ _ostree_fetcher_mirrored_request_to_membuf (OstreeFetcher *fetcher, { gboolean ret = FALSE; const guint8 nulchar = 0; - g_autofree char *ret_contents = NULL; g_autoptr(GMemoryOutputStream) buf = NULL; g_autoptr(GMainContext) mainctx = NULL; FetchUriSyncData data; diff --git a/src/libostree/ostree-fetcher.h b/src/libostree/ostree-fetcher.h index 8cceca51..ae20edaa 100644 --- a/src/libostree/ostree-fetcher.h +++ b/src/libostree/ostree-fetcher.h @@ -59,6 +59,9 @@ OstreeFetcher *_ostree_fetcher_new (int tmpdir_dfd, int _ostree_fetcher_get_dfd (OstreeFetcher *fetcher); +void _ostree_fetcher_set_cookie_jar (OstreeFetcher *self, + const char *jar_path); + void _ostree_fetcher_set_proxy (OstreeFetcher *fetcher, const char *proxy); diff --git a/src/libostree/ostree-kernel-args.c b/src/libostree/ostree-kernel-args.c index 4c9ff147..22b5caa7 100644 --- a/src/libostree/ostree-kernel-args.c +++ b/src/libostree/ostree-kernel-args.c @@ -53,6 +53,23 @@ split_keyeq (char *arg) } } +static gboolean +_arg_has_prefix (const char *arg, + char **prefixes) +{ + char **strviter; + + for (strviter = prefixes; strviter && *strviter; strviter++) + { + const char *prefix = *strviter; + + if (g_str_has_prefix (arg, prefix)) + return TRUE; + } + + return FALSE; +} + OstreeKernelArgs * _ostree_kernel_args_new (void) { @@ -87,12 +104,21 @@ _ostree_kernel_args_replace_take (OstreeKernelArgs *kargs, gboolean existed; GPtrArray *values = g_ptr_array_new_with_free_func (g_free); const char *value = split_keyeq (arg); + gpointer old_key; - existed = g_hash_table_remove (kargs->table, arg); - if (!existed) - g_ptr_array_add (kargs->order, arg); g_ptr_array_add (values, g_strdup (value)); - g_hash_table_replace (kargs->table, arg, values); + existed = g_hash_table_lookup_extended (kargs->table, arg, &old_key, NULL); + + if (existed) + { + g_hash_table_replace (kargs->table, old_key, values); + g_free (arg); + } + else + { + g_ptr_array_add (kargs->order, arg); + g_hash_table_replace (kargs->table, arg, values); + } } void @@ -145,18 +171,28 @@ _ostree_kernel_args_replace_argv (OstreeKernelArgs *kargs, } void -_ostree_kernel_args_append_argv (OstreeKernelArgs *kargs, - char **argv) +_ostree_kernel_args_append_argv_filtered (OstreeKernelArgs *kargs, + char **argv, + char **prefixes) { char **strviter; for (strviter = argv; strviter && *strviter; strviter++) { const char *arg = *strviter; - _ostree_kernel_args_append (kargs, arg); + + if (!_arg_has_prefix (arg, prefixes)) + _ostree_kernel_args_append (kargs, arg); } } +void +_ostree_kernel_args_append_argv (OstreeKernelArgs *kargs, + char **argv) +{ + _ostree_kernel_args_append_argv_filtered (kargs, argv, NULL); +} + gboolean _ostree_kernel_args_append_proc_cmdline (OstreeKernelArgs *kargs, GCancellable *cancellable, @@ -166,6 +202,13 @@ _ostree_kernel_args_append_proc_cmdline (OstreeKernelArgs *kargs, g_autofree char *proc_cmdline = NULL; gsize proc_cmdline_len = 0; g_auto(GStrv) proc_cmdline_args = NULL; + /* When updating the filter list don't forget to update the list in the tests + * e.g. tests/test-admin-deploy-karg.sh and + * tests/test-admin-instutil-set-kargs.sh + */ + char *filtered_prefixes[] = { "BOOT_IMAGE=", /* GRUB 2 */ + "initrd=", /* sd-boot */ + NULL }; if (!g_file_load_contents (proc_cmdline_path, cancellable, &proc_cmdline, &proc_cmdline_len, @@ -175,7 +218,8 @@ _ostree_kernel_args_append_proc_cmdline (OstreeKernelArgs *kargs, g_strchomp (proc_cmdline); proc_cmdline_args = g_strsplit (proc_cmdline, " ", -1); - _ostree_kernel_args_append_argv (kargs, proc_cmdline_args); + _ostree_kernel_args_append_argv_filtered (kargs, proc_cmdline_args, + filtered_prefixes); return TRUE; } diff --git a/src/libostree/ostree-kernel-args.h b/src/libostree/ostree-kernel-args.h index 18710d78..ceaa1ca7 100644 --- a/src/libostree/ostree-kernel-args.h +++ b/src/libostree/ostree-kernel-args.h @@ -39,6 +39,9 @@ void _ostree_kernel_args_append (OstreeKernelArgs *kargs, const char *key); void _ostree_kernel_args_append_argv (OstreeKernelArgs *kargs, char **argv); +void _ostree_kernel_args_append_argv_filtered (OstreeKernelArgs *kargs, + char **argv, + char **prefixes); gboolean _ostree_kernel_args_append_proc_cmdline (OstreeKernelArgs *kargs, GCancellable *cancellable, diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 42e06400..7d78a19b 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -592,7 +592,6 @@ write_object (OstreeRepo *self, gboolean do_commit; OstreeRepoMode repo_mode; g_autofree char *temp_filename = NULL; - g_autoptr(GFile) stored_path = NULL; g_autofree guchar *ret_csum = NULL; glnx_unref_object OstreeChecksumInputStream *checksum_input = NULL; g_autoptr(GInputStream) file_input = NULL; @@ -1093,9 +1092,6 @@ ostree_repo_prepare_transaction (OstreeRepo *self, { gboolean ret = FALSE; gboolean ret_transaction_resume = FALSE; - g_autofree char *stagedir_name = NULL; - glnx_fd_close int stagedir_fd = -1; - g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; g_return_val_if_fail (self->in_transaction == FALSE, FALSE); @@ -2529,7 +2525,6 @@ write_directory_to_mtree_internal (OstreeRepo *self, gboolean ret = FALSE; OstreeRepoCommitFilterResult filter_result; OstreeRepoFile *repo_dir = NULL; - g_autoptr(GFileEnumerator) dir_enum = NULL; g_autoptr(GFileInfo) child_info = NULL; if (dir) diff --git a/src/libostree/ostree-repo-libarchive.c b/src/libostree/ostree-repo-libarchive.c index d05b34ea..3a58d106 100644 --- a/src/libostree/ostree-repo-libarchive.c +++ b/src/libostree/ostree-repo-libarchive.c @@ -300,7 +300,6 @@ aic_apply_modifier_filter (OstreeRepoArchiveImportContext *ctx, const char *relpath, GFileInfo **out_file_info) { - g_autofree char *hardlink = aic_get_final_entry_hardlink (ctx); g_autoptr(GFileInfo) file_info = NULL; g_autofree char *abspath = NULL; const char *cb_path = NULL; @@ -915,7 +914,6 @@ ostree_repo_write_archive_to_mtree (OstreeRepo *self, #ifdef HAVE_LIBARCHIVE gboolean ret = FALSE; struct archive *a = NULL; - g_autoptr(GFileInfo) tmp_dir_info = NULL; OstreeRepoImportArchiveOptions opts = { 0, }; a = archive_read_new (); diff --git a/src/libostree/ostree-repo-prune.c b/src/libostree/ostree-repo-prune.c index 66170d4d..22bff915 100644 --- a/src/libostree/ostree-repo-prune.c +++ b/src/libostree/ostree-repo-prune.c @@ -311,29 +311,11 @@ ostree_repo_prune (OstreeRepo *self, while (g_hash_table_iter_next (&hash_iter, &key, &value)) { const char *checksum = value; - OstreeRepoCommitState commitstate; - GError *local_error = NULL; - - if (!ostree_repo_load_commit (self, checksum, NULL, &commitstate, - error)) - goto out; g_debug ("Finding objects to keep for commit %s", checksum); if (!ostree_repo_traverse_commit_union (self, checksum, depth, data.reachable, - cancellable, &local_error)) - { - /* Don't fail traversing a partial commit */ - if ((commitstate & OSTREE_REPO_COMMIT_STATE_PARTIAL) > 0 && - g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) - { - g_clear_error (&local_error); - } - else - { - g_propagate_error (error, local_error); - goto out; - } - } + cancellable, error)) + goto out; } } @@ -349,34 +331,16 @@ ostree_repo_prune (OstreeRepo *self, GVariant *serialized_key = key; const char *checksum; OstreeObjectType objtype; - OstreeRepoCommitState commitstate; - GError *local_error = NULL; ostree_object_name_deserialize (serialized_key, &checksum, &objtype); if (objtype != OSTREE_OBJECT_TYPE_COMMIT) continue; - if (!ostree_repo_load_commit (self, checksum, NULL, &commitstate, - error)) - goto out; - g_debug ("Finding objects to keep for commit %s", checksum); if (!ostree_repo_traverse_commit_union (self, checksum, depth, data.reachable, - cancellable, &local_error)) - { - /* Don't fail traversing a partial commit */ - if ((commitstate & OSTREE_REPO_COMMIT_STATE_PARTIAL) > 0 && - g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) - { - g_clear_error (&local_error); - } - else - { - g_propagate_error (error, local_error); - goto out; - } - } + cancellable, error)) + goto out; } } diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 52455ed4..8facf8cb 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -608,10 +608,8 @@ lookup_commit_checksum_from_summary (OtPullData *pull_data, g_autoptr(GVariant) refs = g_variant_get_child_value (pull_data->summary, 0); g_autoptr(GVariant) refdata = NULL; g_autoptr(GVariant) reftargetdata = NULL; - g_autoptr(GVariant) commit_data = NULL; guint64 commit_size; g_autoptr(GVariant) commit_csum_v = NULL; - g_autoptr(GBytes) commit_bytes = NULL; int i; if (!ot_variant_bsearch_str (refs, ref, &i)) @@ -973,7 +971,6 @@ static_deltapart_fetch_on_complete (GObject *object, OstreeFetcher *fetcher = (OstreeFetcher *)object; FetchStaticDeltaData *fetch_data = user_data; OtPullData *pull_data = fetch_data->pull_data; - g_autoptr(GVariant) metadata = NULL; g_autofree char *temp_path = NULL; g_autoptr(GInputStream) in = NULL; g_autoptr(GVariant) part = NULL; @@ -1430,8 +1427,6 @@ request_static_delta_superblock_sync (OtPullData *pull_data, g_autofree char *delta_name = _ostree_get_relative_static_delta_superblock_path (from_revision, to_revision); g_autoptr(GBytes) delta_superblock_data = NULL; - g_autoptr(GBytes) delta_meta_data = NULL; - g_autoptr(GVariant) delta_superblock = NULL; if (!_ostree_fetcher_mirrored_request_to_membuf (pull_data->fetcher, pull_data->content_mirrorlist, @@ -1969,6 +1964,19 @@ _ostree_repo_remote_new_fetcher (OstreeRepo *self, _ostree_fetcher_set_proxy (fetcher, http_proxy); } + { + g_autofree char *jar_path = NULL; + g_autofree char *cookie_file = g_strdup_printf ("%s.cookies.txt", + remote_name); + + jar_path = g_build_filename (g_file_get_path (self->repodir), cookie_file, + NULL); + + if (g_file_test(jar_path, G_FILE_TEST_IS_REGULAR)) + _ostree_fetcher_set_cookie_jar (fetcher, jar_path); + + } + success = TRUE; out: @@ -2335,8 +2343,6 @@ ostree_repo_pull_with_options (OstreeRepo *self, gboolean opt_gpg_verify_set = FALSE; gboolean opt_gpg_verify_summary_set = FALSE; const char *url_override = NULL; - g_autofree char *base_meta_url = NULL; - g_autofree char *base_content_url = NULL; gboolean mirroring_into_archive; gboolean inherit_transaction = FALSE; int i; @@ -2641,7 +2647,6 @@ ostree_repo_pull_with_options (OstreeRepo *self, { g_autoptr(GBytes) bytes_sig = NULL; - g_autofree char *ret_contents = NULL; gsize i, n; g_autoptr(GVariant) refs = NULL; g_autoptr(GVariant) deltas = NULL; @@ -2934,7 +2939,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, &from_revision, error)) goto out; - if (!disable_static_deltas && !mirroring_into_archive && + if (!(disable_static_deltas || mirroring_into_archive || pull_data->is_commit_only) && (from_revision == NULL || g_strcmp0 (from_revision, to_revision) != 0)) { if (!request_static_delta_superblock_sync (pull_data, from_revision, to_revision, @@ -3131,6 +3136,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, g_clear_pointer (&pull_data->requested_content, (GDestroyNotify) g_hash_table_unref); g_clear_pointer (&pull_data->requested_metadata, (GDestroyNotify) g_hash_table_unref); g_clear_pointer (&pull_data->idle_src, (GDestroyNotify) g_source_destroy); + g_clear_pointer (&pull_data->dirs, (GDestroyNotify) g_ptr_array_unref); g_clear_pointer (&remote_config, (GDestroyNotify) g_key_file_unref); return ret; } diff --git a/src/libostree/ostree-repo-static-delta-compilation-analysis.c b/src/libostree/ostree-repo-static-delta-compilation-analysis.c index ae5b8dec..c1990591 100644 --- a/src/libostree/ostree-repo-static-delta-compilation-analysis.c +++ b/src/libostree/ostree-repo-static-delta-compilation-analysis.c @@ -189,18 +189,30 @@ build_content_sizenames_filtered (OstreeRepo *repo, static gboolean string_array_nonempty_intersection (GPtrArray *a, - GPtrArray *b) + GPtrArray *b, + gboolean fuzzy) { guint i; for (i = 0; i < a->len; i++) { guint j; const char *a_str = a->pdata[i]; + const char *a_dot = strchr (a_str, '.'); for (j = 0; j < b->len; j++) { const char *b_str = b->pdata[j]; - if (strcmp (a_str, b_str) == 0) - return TRUE; + const char *b_dot = strchr (b_str, '.'); + /* When doing fuzzy comparison, just compare the part before the '.' if it exists. */ + if (fuzzy && a_dot && b_dot && b_dot - b_str && b_dot - b_str == a_dot - a_str) + { + if (strncmp (a_str, b_str, a_dot - a_str) == 0) + return TRUE; + } + else + { + if (strcmp (a_str, b_str) == 0) + return TRUE; + } } } return FALSE; @@ -258,6 +270,8 @@ _ostree_delta_compute_similar_objects (OstreeRepo *repo, upper = from_sizes->len; for (i = 0; i < to_sizes->len; i++) { + int fuzzy; + gboolean found = FALSE; OstreeDeltaContentSizeNames *to_sizenames = to_sizes->pdata[i]; const guint64 min_threshold = to_sizenames->size * (1.0-similarity_percent_threshold/100.0); @@ -268,31 +282,41 @@ _ostree_delta_compute_similar_objects (OstreeRepo *repo, if (to_sizenames->size == 0) continue; - for (j = lower; j < upper; j++) + for (fuzzy = 0; fuzzy < 2 && !found; fuzzy++) { - OstreeDeltaContentSizeNames *from_sizenames = from_sizes->pdata[j]; - - /* Don't build candidates for the empty object */ - if (from_sizenames->size == 0) - continue; - - if (from_sizenames->size < min_threshold) + for (j = lower; j < upper; j++) { - lower++; - continue; + OstreeDeltaContentSizeNames *from_sizenames = from_sizes->pdata[j]; + + /* Don't build candidates for the empty object */ + if (from_sizenames->size == 0) + { + continue; + } + + if (from_sizenames->size < min_threshold) + { + lower++; + continue; + } + + if (from_sizenames->size > max_threshold) + break; + + if (!string_array_nonempty_intersection (from_sizenames->basenames, + to_sizenames->basenames, + fuzzy == 1)) + { + continue; + } + + /* Only one candidate right now */ + g_hash_table_insert (ret_modified_regfile_content, + g_strdup (to_sizenames->checksum), + g_strdup (from_sizenames->checksum)); + found = TRUE; + break; } - - if (from_sizenames->size > max_threshold) - break; - - if (!string_array_nonempty_intersection (from_sizenames->basenames, to_sizenames->basenames)) - continue; - - /* Only one candidate right now */ - g_hash_table_insert (ret_modified_regfile_content, - g_strdup (to_sizenames->checksum), - g_strdup (from_sizenames->checksum)); - break; } } diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c index acface61..286c74e1 100644 --- a/src/libostree/ostree-repo-static-delta-compilation.c +++ b/src/libostree/ostree-repo-static-delta-compilation.c @@ -32,6 +32,7 @@ #include "ostree-diff.h" #include "ostree-rollsum.h" #include "otutil.h" +#include "libglnx.h" #include "ostree-varint.h" #include "bsdiff/bsdiff.h" @@ -413,15 +414,11 @@ process_one_object (OstreeRepo *repo, typedef struct { char *from_checksum; - GBytes *tmp_from; - GBytes *tmp_to; } ContentBsdiff; typedef struct { char *from_checksum; OstreeRollsumMatches *matches; - GBytes *tmp_from; - GBytes *tmp_to; } ContentRollsum; static void @@ -429,8 +426,6 @@ content_rollsums_free (ContentRollsum *rollsum) { g_free (rollsum->from_checksum); _ostree_rollsum_matches_free (rollsum->matches); - g_clear_pointer (&rollsum->tmp_from, g_bytes_unref); - g_clear_pointer (&rollsum->tmp_to, g_bytes_unref); g_free (rollsum); } @@ -438,8 +433,6 @@ static void content_bsdiffs_free (ContentBsdiff *bsdiff) { g_free (bsdiff->from_checksum); - g_clear_pointer (&bsdiff->tmp_from, g_bytes_unref); - g_clear_pointer (&bsdiff->tmp_to, g_bytes_unref); g_free (bsdiff); } @@ -450,50 +443,40 @@ static gboolean get_unpacked_unlinked_content (OstreeRepo *repo, const char *checksum, GBytes **out_content, - GFileInfo **out_finfo, GCancellable *cancellable, GError **error) { - gboolean ret = FALSE; - g_autofree char *tmpname = g_strdup ("/var/tmp/tmpostree-deltaobj-XXXXXX"); + g_autofree char *tmpname = NULL; glnx_fd_close int fd = -1; g_autoptr(GBytes) ret_content = NULL; g_autoptr(GInputStream) istream = NULL; - g_autoptr(GFileInfo) ret_finfo = NULL; g_autoptr(GOutputStream) out = NULL; - fd = g_mkstemp (tmpname); - if (fd == -1) - { - glnx_set_error_from_errno (error); - goto out; - } - /* Doesn't need a name */ - (void) unlink (tmpname); + if (!glnx_open_tmpfile_linkable_at (AT_FDCWD, "/tmp", O_RDWR | O_CLOEXEC, + &fd, &tmpname, error)) + return FALSE; + /* We don't need the file name */ + if (tmpname) + (void) unlinkat (AT_FDCWD, tmpname, 0); - if (!ostree_repo_load_file (repo, checksum, &istream, &ret_finfo, NULL, + if (!ostree_repo_load_file (repo, checksum, &istream, NULL, NULL, cancellable, error)) - goto out; + return FALSE; - g_assert (g_file_info_get_file_type (ret_finfo) == G_FILE_TYPE_REGULAR); - out = g_unix_output_stream_new (fd, FALSE); if (g_output_stream_splice (out, istream, G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, cancellable, error) < 0) - goto out; - - { GMappedFile *mfile = g_mapped_file_new_from_fd (fd, FALSE, error); + return FALSE; + + { g_autoptr(GMappedFile) mfile = g_mapped_file_new_from_fd (fd, FALSE, error); if (!mfile) - goto out; + return FALSE; ret_content = g_mapped_file_get_bytes (mfile); - g_mapped_file_unref (mfile); } - ret = TRUE; if (out_content) *out_content = g_steal_pointer (&ret_content); - out: - return ret; + return TRUE; } static gboolean @@ -506,24 +489,20 @@ try_content_bsdiff (OstreeRepo *repo, GError **error) { gboolean ret = FALSE; - g_autoptr(GHashTable) from_bsdiff = NULL; - g_autoptr(GHashTable) to_bsdiff = NULL; - g_autoptr(GBytes) tmp_from = NULL; - g_autoptr(GBytes) tmp_to = NULL; g_autoptr(GFileInfo) from_finfo = NULL; g_autoptr(GFileInfo) to_finfo = NULL; ContentBsdiff *ret_bsdiff = NULL; *out_bsdiff = NULL; - if (!get_unpacked_unlinked_content (repo, from, &tmp_from, &from_finfo, - cancellable, error)) - goto out; - if (!get_unpacked_unlinked_content (repo, to, &tmp_to, &to_finfo, - cancellable, error)) - goto out; + if (!ostree_repo_load_file (repo, from, NULL, &from_finfo, NULL, + cancellable, error)) + return FALSE; + if (!ostree_repo_load_file (repo, to, NULL, &to_finfo, NULL, + cancellable, error)) + return FALSE; - if (g_bytes_get_size (tmp_to) + g_bytes_get_size (tmp_from) > max_bsdiff_size_bytes) + if (g_file_info_get_size (to_finfo) + g_file_info_get_size (from_finfo) > max_bsdiff_size_bytes) { ret = TRUE; goto out; @@ -531,8 +510,6 @@ try_content_bsdiff (OstreeRepo *repo, ret_bsdiff = g_new0 (ContentBsdiff, 1); ret_bsdiff->from_checksum = g_strdup (from); - ret_bsdiff->tmp_from = tmp_from; tmp_from = NULL; - ret_bsdiff->tmp_to = tmp_to; tmp_to = NULL; ret = TRUE; if (out_bsdiff) @@ -551,12 +528,8 @@ try_content_rollsum (OstreeRepo *repo, GError **error) { gboolean ret = FALSE; - g_autoptr(GHashTable) from_rollsum = NULL; - g_autoptr(GHashTable) to_rollsum = NULL; g_autoptr(GBytes) tmp_from = NULL; g_autoptr(GBytes) tmp_to = NULL; - g_autoptr(GFileInfo) from_finfo = NULL; - g_autoptr(GFileInfo) to_finfo = NULL; OstreeRollsumMatches *matches = NULL; ContentRollsum *ret_rollsum = NULL; @@ -565,11 +538,9 @@ try_content_rollsum (OstreeRepo *repo, /* Load the content objects, splice them to uncompressed temporary files that * we can just mmap() and seek around in conveniently. */ - if (!get_unpacked_unlinked_content (repo, from, &tmp_from, &from_finfo, - cancellable, error)) + if (!get_unpacked_unlinked_content (repo, from, &tmp_from, cancellable, error)) goto out; - if (!get_unpacked_unlinked_content (repo, to, &tmp_to, &to_finfo, - cancellable, error)) + if (!get_unpacked_unlinked_content (repo, to, &tmp_to, cancellable, error)) goto out; matches = _ostree_compute_rollsum_matches (tmp_from, tmp_to); @@ -596,10 +567,8 @@ try_content_rollsum (OstreeRepo *repo, ret_rollsum = g_new0 (ContentRollsum, 1); ret_rollsum->from_checksum = g_strdup (from); - ret_rollsum->matches = matches; matches = NULL; - ret_rollsum->tmp_from = tmp_from; tmp_from = NULL; - ret_rollsum->tmp_to = tmp_to; tmp_to = NULL; - + ret_rollsum->matches = g_steal_pointer (&matches); + ret = TRUE; if (out_rollsum) *out_rollsum = g_steal_pointer (&ret_rollsum); @@ -655,7 +624,7 @@ process_one_rollsum (OstreeRepo *repo, { gboolean ret = FALSE; guint64 content_size; - g_autoptr(GInputStream) content_stream = NULL; + g_autoptr(GBytes) tmp_to = NULL; g_autoptr(GFileInfo) content_finfo = NULL; g_autoptr(GVariant) content_xattrs = NULL; OstreeStaticDeltaPartBuilder *current_part = *current_part_val; @@ -669,9 +638,13 @@ process_one_rollsum (OstreeRepo *repo, *current_part_val = current_part = allocate_part (builder); } - tmp_to_buf = g_bytes_get_data (rollsum->tmp_to, &tmp_to_len); + if (!get_unpacked_unlinked_content (repo, to_checksum, &tmp_to, + cancellable, error)) + goto out; - if (!ostree_repo_load_file (repo, to_checksum, &content_stream, + tmp_to_buf = g_bytes_get_data (tmp_to, &tmp_to_len); + + if (!ostree_repo_load_file (repo, to_checksum, NULL, &content_finfo, &content_xattrs, cancellable, error)) goto out; @@ -758,9 +731,6 @@ process_one_rollsum (OstreeRepo *repo, g_string_append_c (current_part->operations, (gchar)OSTREE_STATIC_DELTA_OP_CLOSE); } - g_clear_pointer (&rollsum->tmp_from, g_bytes_unref); - g_clear_pointer (&rollsum->tmp_to, g_bytes_unref); - ret = TRUE; out: return ret; @@ -777,10 +747,11 @@ process_one_bsdiff (OstreeRepo *repo, { gboolean ret = FALSE; guint64 content_size; - g_autoptr(GInputStream) content_stream = NULL; g_autoptr(GFileInfo) content_finfo = NULL; g_autoptr(GVariant) content_xattrs = NULL; OstreeStaticDeltaPartBuilder *current_part = *current_part_val; + g_autoptr(GBytes) tmp_from = NULL; + g_autoptr(GBytes) tmp_to = NULL; const guint8 *tmp_to_buf; gsize tmp_to_len; const guint8 *tmp_from_buf; @@ -793,10 +764,17 @@ process_one_bsdiff (OstreeRepo *repo, *current_part_val = current_part = allocate_part (builder); } - tmp_to_buf = g_bytes_get_data (bsdiff_content->tmp_to, &tmp_to_len); - tmp_from_buf = g_bytes_get_data (bsdiff_content->tmp_from, &tmp_from_len); + if (!get_unpacked_unlinked_content (repo, bsdiff_content->from_checksum, &tmp_from, + cancellable, error)) + goto out; + if (!get_unpacked_unlinked_content (repo, to_checksum, &tmp_to, + cancellable, error)) + goto out; - if (!ostree_repo_load_file (repo, to_checksum, &content_stream, + tmp_to_buf = g_bytes_get_data (tmp_to, &tmp_to_len); + tmp_from_buf = g_bytes_get_data (tmp_from, &tmp_from_len); + + if (!ostree_repo_load_file (repo, to_checksum, NULL, &content_finfo, &content_xattrs, cancellable, error)) goto out; @@ -857,9 +835,6 @@ process_one_bsdiff (OstreeRepo *repo, g_string_append_c (current_part->operations, (gchar)OSTREE_STATIC_DELTA_OP_UNSET_READ_SOURCE); - g_clear_pointer (&bsdiff_content->tmp_from, g_bytes_unref); - g_clear_pointer (&bsdiff_content->tmp_to, g_bytes_unref); - ret = TRUE; out: return ret; @@ -884,14 +859,12 @@ generate_delta_lowlatency (OstreeRepo *repo, g_autoptr(GVariant) to_commit = NULL; g_autoptr(GHashTable) to_reachable_objects = NULL; g_autoptr(GHashTable) from_reachable_objects = NULL; - g_autoptr(GHashTable) from_regfile_content = NULL; g_autoptr(GHashTable) new_reachable_metadata = NULL; g_autoptr(GHashTable) new_reachable_regfile_content = NULL; g_autoptr(GHashTable) new_reachable_symlink_content = NULL; g_autoptr(GHashTable) modified_regfile_content = NULL; g_autoptr(GHashTable) rollsum_optimized_content_objects = NULL; g_autoptr(GHashTable) bsdiff_optimized_content_objects = NULL; - g_autoptr(GHashTable) content_object_to_size = NULL; if (from != NULL) { @@ -1261,7 +1234,7 @@ ostree_repo_static_delta_generate (OstreeRepo *self, guint min_fallback_size; guint max_bsdiff_size; guint max_chunk_size; - g_auto(GVariantBuilder) metadata_builder = {{0,}}; + g_auto(GVariantBuilder) metadata_builder = OT_VARIANT_BUILDER_INITIALIZER; DeltaOpts delta_opts = DELTAOPT_FLAG_NONE; guint64 total_compressed_size = 0; guint64 total_uncompressed_size = 0; @@ -1273,7 +1246,6 @@ ostree_repo_static_delta_generate (OstreeRepo *self, const char *opt_filename; g_autofree char *descriptor_name = NULL; glnx_fd_close int descriptor_dfd = -1; - g_autoptr(GVariant) tmp_metadata = NULL; g_autoptr(GVariant) fallback_headers = NULL; g_autoptr(GVariant) detached = NULL; gboolean inline_parts; @@ -1387,7 +1359,6 @@ ostree_repo_static_delta_generate (OstreeRepo *self, GBytes *payload_b; GBytes *operations_b; g_autofree guchar *part_checksum = NULL; - g_autoptr(GChecksum) checksum = NULL; g_autoptr(GBytes) objtype_checksum_array = NULL; g_autoptr(GBytes) checksum_bytes = NULL; g_autoptr(GOutputStream) part_temp_outstream = NULL; @@ -1399,8 +1370,8 @@ ostree_repo_static_delta_generate (OstreeRepo *self, g_autoptr(GVariant) delta_part_content = NULL; g_autoptr(GVariant) delta_part = NULL; g_autoptr(GVariant) delta_part_header = NULL; - g_auto(GVariantBuilder) mode_builder = {{0,}}; - g_auto(GVariantBuilder) xattr_builder = {{0,}}; + g_auto(GVariantBuilder) mode_builder = OT_VARIANT_BUILDER_INITIALIZER; + g_auto(GVariantBuilder) xattr_builder = OT_VARIANT_BUILDER_INITIALIZER; guint8 compression_type_char; g_variant_builder_init (&mode_builder, G_VARIANT_TYPE ("a(uuu)")); diff --git a/src/libostree/ostree-repo-static-delta-core.c b/src/libostree/ostree-repo-static-delta-core.c index 82c80a2a..0b0d7067 100644 --- a/src/libostree/ostree-repo-static-delta-core.c +++ b/src/libostree/ostree-repo-static-delta-core.c @@ -356,7 +356,6 @@ ostree_repo_static_delta_execute_offline (OstreeRepo *self, char checksum[OSTREE_SHA256_STRING_LEN+1]; gboolean have_all; g_autoptr(GInputStream) part_in = NULL; - g_autoptr(GBytes) delta_data = NULL; g_autoptr(GVariant) inline_part_data = NULL; g_autoptr(GVariant) header = NULL; g_autoptr(GVariant) csum_v = NULL; @@ -765,7 +764,7 @@ _ostree_delta_get_endianness (GVariant *superblock, } } - return G_BYTE_ORDER; + return OSTREE_DELTA_ENDIAN_INVALID; } } @@ -864,7 +863,6 @@ _ostree_repo_static_delta_dump (OstreeRepo *self, g_autofree char *from = NULL; g_autofree char *to = NULL; g_autofree char *superblock_path = NULL; - glnx_fd_close int superblock_fd = -1; g_autoptr(GVariant) delta_superblock = NULL; guint64 total_size = 0, total_usize = 0; guint64 total_fallback_size = 0, total_fallback_usize = 0; diff --git a/src/libostree/ostree-repo-static-delta-processing.c b/src/libostree/ostree-repo-static-delta-processing.c index 304d7b4a..95f9ddba 100644 --- a/src/libostree/ostree-repo-static-delta-processing.c +++ b/src/libostree/ostree-repo-static-delta-processing.c @@ -188,7 +188,6 @@ _ostree_static_delta_part_execute (OstreeRepo *repo, { gboolean ret = FALSE; guint8 *checksums_data; - g_autoptr(GVariant) checksums = NULL; g_autoptr(GVariant) mode_dict = NULL; g_autoptr(GVariant) xattr_dict = NULL; g_autoptr(GVariant) payload = NULL; @@ -471,7 +470,6 @@ dispatch_bspatch (OstreeRepo *repo, { gboolean ret = FALSE; guint64 offset, length; - g_autoptr(GInputStream) in_stream = NULL; g_autoptr(GMappedFile) input_mfile = NULL; g_autofree guchar *buf = NULL; struct bspatch_stream stream; diff --git a/src/libostree/ostree-repo-traverse.c b/src/libostree/ostree-repo-traverse.c index 516f39f5..5d994763 100644 --- a/src/libostree/ostree-repo-traverse.c +++ b/src/libostree/ostree-repo-traverse.c @@ -301,6 +301,7 @@ static gboolean traverse_dirtree (OstreeRepo *repo, const char *checksum, GHashTable *inout_reachable, + gboolean ignore_missing_dirs, GCancellable *cancellable, GError **error); @@ -308,6 +309,7 @@ static gboolean traverse_iter (OstreeRepo *repo, OstreeRepoCommitTraverseIter *iter, GHashTable *inout_reachable, + gboolean ignore_missing_dirs, GCancellable *cancellable, GError **error) { @@ -316,11 +318,26 @@ traverse_iter (OstreeRepo *repo, while (TRUE) { g_autoptr(GVariant) key = NULL; + g_autoptr(GError) local_error = NULL; OstreeRepoCommitIterResult iterres = - ostree_repo_commit_traverse_iter_next (iter, cancellable, error); - + ostree_repo_commit_traverse_iter_next (iter, cancellable, &local_error); + if (iterres == OSTREE_REPO_COMMIT_ITER_RESULT_ERROR) - goto out; + { + /* There is only one kind of not-found error, which is + failing to load the dirmeta itself, if so, we ignore that + (and the whole subtree) if told to. */ + if (ignore_missing_dirs && + g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) + { + g_debug ("Ignoring not-found dirmeta"); + ret = TRUE; + } + else + g_propagate_error (error, g_steal_pointer (&local_error)); + + goto out; + } else if (iterres == OSTREE_REPO_COMMIT_ITER_RESULT_END) break; else if (iterres == OSTREE_REPO_COMMIT_ITER_RESULT_FILE) @@ -357,7 +374,7 @@ traverse_iter (OstreeRepo *repo, key = NULL; if (!traverse_dirtree (repo, content_checksum, inout_reachable, - cancellable, error)) + ignore_missing_dirs, cancellable, error)) goto out; } } @@ -374,6 +391,7 @@ static gboolean traverse_dirtree (OstreeRepo *repo, const char *checksum, GHashTable *inout_reachable, + gboolean ignore_missing_dirs, GCancellable *cancellable, GError **error) { @@ -381,10 +399,22 @@ traverse_dirtree (OstreeRepo *repo, g_autoptr(GVariant) dirtree = NULL; ostree_cleanup_repo_commit_traverse_iter OstreeRepoCommitTraverseIter iter = { 0, }; + g_autoptr(GError) local_error = NULL; if (!ostree_repo_load_variant (repo, OSTREE_OBJECT_TYPE_DIR_TREE, checksum, - &dirtree, error)) - goto out; + &dirtree, &local_error)) + { + if (ignore_missing_dirs && + g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) + { + g_print ("Ignoring not-found dirmeta %s", checksum); + ret = TRUE; + } + else + g_propagate_error (error, g_steal_pointer (&local_error)); + + goto out; + } g_debug ("Traversing dirtree %s", checksum); if (!ostree_repo_commit_traverse_iter_init_dirtree (&iter, repo, dirtree, @@ -392,7 +422,7 @@ traverse_dirtree (OstreeRepo *repo, error)) goto out; - if (!traverse_iter (repo, &iter, inout_reachable, cancellable, error)) + if (!traverse_iter (repo, &iter, inout_reachable, ignore_missing_dirs, cancellable, error)) goto out; ret = TRUE; @@ -430,6 +460,8 @@ ostree_repo_traverse_commit_union (OstreeRepo *repo, g_autoptr(GVariant) commit = NULL; ostree_cleanup_repo_commit_traverse_iter OstreeRepoCommitTraverseIter iter = { 0, }; + OstreeRepoCommitState commitstate; + gboolean ignore_missing_dirs = FALSE; key = ostree_object_name_serialize (commit_checksum, OSTREE_OBJECT_TYPE_COMMIT); @@ -440,13 +472,21 @@ ostree_repo_traverse_commit_union (OstreeRepo *repo, commit_checksum, &commit, error)) goto out; - + /* Just return if the parent isn't found; we do expect most * people to have partial repositories. */ if (!commit) break; + /* See if the commit is partial, if so it's not an error to lack objects */ + if (!ostree_repo_load_commit (repo, commit_checksum, NULL, &commitstate, + error)) + goto out; + + if ((commitstate & OSTREE_REPO_COMMIT_STATE_PARTIAL) != 0) + ignore_missing_dirs = TRUE; + g_hash_table_add (inout_reachable, key); key = NULL; @@ -456,9 +496,9 @@ ostree_repo_traverse_commit_union (OstreeRepo *repo, error)) goto out; - if (!traverse_iter (repo, &iter, inout_reachable, cancellable, error)) + if (!traverse_iter (repo, &iter, inout_reachable, ignore_missing_dirs, cancellable, error)) goto out; - + if (maxdepth == -1 || maxdepth > 0) { g_free (tmp_checksum); diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index d4b1f1d6..ad629421 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -936,7 +936,7 @@ keyfile_set_from_vardict (GKeyFile *keyfile, else if (g_variant_is_of_type (child, G_VARIANT_TYPE_STRING_ARRAY)) { gsize len; - const char *const*strv_child = g_variant_get_strv (child, &len); + g_autofree const gchar **strv_child = g_variant_get_strv (child, &len); g_key_file_set_string_list (keyfile, section, key, strv_child, len); } else @@ -2593,7 +2593,7 @@ load_metadata_internal (OstreeRepo *self, } else { - GBytes *data = glnx_fd_readall_bytes (fd, cancellable, error); + g_autoptr(GBytes) data = glnx_fd_readall_bytes (fd, cancellable, error); if (!data) goto out; ret_variant = g_variant_new_from_bytes (ostree_metadata_variant_type (objtype), @@ -3164,7 +3164,7 @@ ostree_repo_delete_object (OstreeRepo *self, if (tombstone_commits) { - g_auto(GVariantBuilder) builder = {{0,}}; + g_auto(GVariantBuilder) builder = OT_VARIANT_BUILDER_INITIALIZER; g_autoptr(GVariant) variant = NULL; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); @@ -4653,7 +4653,7 @@ ostree_repo_regenerate_summary (OstreeRepo *self, g_autoptr(GVariant) summary = NULL; GList *ordered_keys = NULL; GList *iter = NULL; - g_auto(GVariantDict) additional_metadata_builder = {{0,}}; + g_auto(GVariantDict) additional_metadata_builder = OT_VARIANT_BUILDER_INITIALIZER; if (!ostree_repo_list_refs (self, NULL, &refs, cancellable, error)) goto out; @@ -4668,10 +4668,18 @@ ostree_repo_regenerate_summary (OstreeRepo *self, { const char *ref = iter->data; const char *commit = g_hash_table_lookup (refs, ref); + g_autofree char *remotename = NULL; g_autoptr(GVariant) commit_obj = NULL; g_assert (commit); + if (!ostree_parse_refspec (ref, &remotename, NULL, NULL)) + g_assert_not_reached (); + + /* Don't put remote refs in the summary */ + if (remotename != NULL) + continue; + if (!ostree_repo_load_variant (self, OSTREE_OBJECT_TYPE_COMMIT, commit, &commit_obj, error)) goto out; @@ -4686,8 +4694,7 @@ ostree_repo_regenerate_summary (OstreeRepo *self, { guint i; g_autoptr(GPtrArray) delta_names = NULL; - g_auto(GVariantDict) deltas_builder = {{0,}}; - g_autoptr(GVariant) deltas = NULL; + g_auto(GVariantDict) deltas_builder = OT_VARIANT_BUILDER_INITIALIZER; if (!ostree_repo_list_static_delta_names (self, &delta_names, cancellable, error)) goto out; @@ -4890,7 +4897,6 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd, { g_autofree char *tmpdir_name_template = g_strconcat (tmpdir_prefix, "XXXXXX", NULL); glnx_fd_close int new_tmpdir_fd = -1; - g_autoptr(GError) local_error = NULL; /* No existing tmpdir found, create a new */ diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index a14f6005..cb5a4615 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -534,7 +534,6 @@ checkout_deployment_tree (OstreeSysroot *sysroot, const char *csum = ostree_deployment_get_csum (deployment); g_autofree char *checkout_target_name = NULL; g_autofree char *osdeploy_path = NULL; - g_autoptr(GFile) ret_deploy_target_path = NULL; glnx_fd_close int osdeploy_dfd = -1; int ret_fd; @@ -1199,7 +1198,6 @@ swap_bootlinks (OstreeSysroot *self, gboolean ret = FALSE; int old_subbootversion, new_subbootversion; glnx_fd_close int ostree_dfd = -1; - glnx_fd_close int ostree_subbootdir_dfd = -1; g_autofree char *ostree_bootdir_name = NULL; g_autofree char *ostree_subbootdir_name = NULL; @@ -1749,7 +1747,7 @@ _ostree_sysroot_write_deployments_internal (OstreeSysroot *self, /* Assign a bootserial to each new deployment. */ - assign_bootserials (new_deployments); + g_hash_table_unref (assign_bootserials (new_deployments)); /* Determine whether or not we need to touch the bootloader * configuration. If we have an equal number of deployments with @@ -2148,7 +2146,10 @@ ostree_sysroot_deploy_tree (OstreeSysroot *self, goto out; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" { ostree_cleanup_sepolicy_fscreatecon gpointer dummy = NULL; +#pragma GCC diagnostic pop /* Explicitly override the label for the origin file to ensure * it's system_conf_t. diff --git a/src/libostree/ostree-sysroot-upgrader.c b/src/libostree/ostree-sysroot-upgrader.c index 92b8dc83..b0061c87 100644 --- a/src/libostree/ostree-sysroot-upgrader.c +++ b/src/libostree/ostree-sysroot-upgrader.c @@ -188,6 +188,7 @@ ostree_sysroot_upgrader_finalize (GObject *object) g_free (self->origin_remote); g_free (self->origin_ref); g_free (self->override_csum); + g_free (self->new_revision); G_OBJECT_CLASS (ostree_sysroot_upgrader_parent_class)->finalize (object); } @@ -530,7 +531,6 @@ ostree_sysroot_upgrader_pull_one_dir (OstreeSysrootUpgrader *self, glnx_unref_object OstreeRepo *repo = NULL; char *refs_to_fetch[] = { NULL, NULL }; const char *from_revision = NULL; - g_autofree char *new_revision = NULL; g_autofree char *origin_refspec = NULL; if (self->override_csum != NULL) diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c index 97f00c4e..608d4cff 100644 --- a/src/libostree/ostree-sysroot.c +++ b/src/libostree/ostree-sysroot.c @@ -689,7 +689,6 @@ parse_deployment (OstreeSysroot *self, glnx_fd_close int deployment_dfd = -1; const char *deploy_basename; g_autofree char *treebootserial_target = NULL; - g_autofree char *deploy_dir = NULL; GKeyFile *origin = NULL; g_autofree char *unlocked_development_path = NULL; struct stat stbuf; diff --git a/src/libotutil/ot-gpg-utils.c b/src/libotutil/ot-gpg-utils.c index 9414088d..9042d88b 100644 --- a/src/libotutil/ot-gpg-utils.c +++ b/src/libotutil/ot-gpg-utils.c @@ -73,9 +73,6 @@ ot_gpgme_ctx_tmp_home_dir (gpgme_ctx_t gpgme_ctx, GCancellable *cancellable, GError **error) { - g_autoptr(GFile) pubring_file = NULL; - g_autoptr(GOutputStream) target_stream = NULL; - g_autofree char *pubring_path = NULL; g_autofree char *tmp_home_dir = NULL; gpgme_error_t gpg_error; gboolean ret = FALSE; diff --git a/src/libotutil/ot-log-utils.h b/src/libotutil/ot-log-utils.h index 5e0502ab..8d9786de 100644 --- a/src/libotutil/ot-log-utils.h +++ b/src/libotutil/ot-log-utils.h @@ -26,6 +26,6 @@ G_BEGIN_DECLS void ot_log_structured_print_id_v (const char *message_id, const char *format, - ...); + ...) G_GNUC_PRINTF(2, 3); G_END_DECLS diff --git a/src/libotutil/ot-variant-utils.c b/src/libotutil/ot-variant-utils.c index 315bbeb2..1c4c5efa 100644 --- a/src/libotutil/ot-variant-utils.c +++ b/src/libotutil/ot-variant-utils.c @@ -33,8 +33,7 @@ GVariant * ot_gvariant_new_empty_string_dict (void) { - g_auto(GVariantBuilder) builder = {{0,}}; - + g_auto(GVariantBuilder) builder = OT_VARIANT_BUILDER_INITIALIZER; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); return g_variant_builder_end (&builder); } diff --git a/src/libotutil/otutil.h b/src/libotutil/otutil.h index ec516f65..c66d5634 100644 --- a/src/libotutil/otutil.h +++ b/src/libotutil/otutil.h @@ -26,6 +26,13 @@ #include /* Yeah...let's just do that here. */ #include +/* https://bugzilla.gnome.org/show_bug.cgi?id=766370 */ +#if !GLIB_CHECK_VERSION(2, 49, 3) +#define OT_VARIANT_BUILDER_INITIALIZER {{0,}} +#else +#define OT_VARIANT_BUILDER_INITIALIZER {{{0,}}} +#endif + #define ot_gobject_refz(o) (o ? g_object_ref (o) : o) #define ot_transfer_out_value(outp, srcp) G_STMT_START { \ diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c index c66c9b3f..3039cf0d 100644 --- a/src/ostree/ot-admin-builtin-deploy.c +++ b/src/ostree/ot-admin-builtin-deploy.c @@ -58,7 +58,6 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro glnx_unref_object OstreeSysroot *sysroot = NULL; GKeyFile *origin = NULL; glnx_unref_object OstreeRepo *repo = NULL; - g_autoptr(GPtrArray) new_deployments = NULL; glnx_unref_object OstreeDeployment *new_deployment = NULL; glnx_unref_object OstreeDeployment *merge_deployment = NULL; g_autofree char *revision = NULL; diff --git a/src/ostree/ot-admin-builtin-set-origin.c b/src/ostree/ot-admin-builtin-set-origin.c index be88aa6c..0e79ab5e 100644 --- a/src/ostree/ot-admin-builtin-set-origin.c +++ b/src/ostree/ot-admin-builtin-set-origin.c @@ -96,6 +96,7 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G { char **iter; g_autoptr(GVariantBuilder) optbuilder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}")); + g_autoptr(GVariant) options = NULL; for (iter = opt_set; iter && *iter; iter++) { @@ -109,18 +110,19 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G g_variant_builder_add (optbuilder, "{s@v}", subkey, g_variant_new_variant (g_variant_new_string (subvalue))); } - + + options = g_variant_ref_sink (g_variant_builder_end (optbuilder)); + if (!ostree_repo_remote_change (repo, NULL, OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS, remotename, url, - g_variant_builder_end (optbuilder), + options, cancellable, error)) goto out; } { GKeyFile *old_origin = ostree_deployment_get_origin (target_deployment); g_autofree char *origin_refspec = g_key_file_get_string (old_origin, "origin", "refspec", NULL); - g_autofree char *new_refspec = NULL; g_autofree char *origin_remote = NULL; g_autofree char *origin_ref = NULL; @@ -129,7 +131,6 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G { g_autofree char *new_refspec = g_strconcat (remotename, ":", branch ? branch : origin_ref, NULL); g_autoptr(GKeyFile) new_origin = NULL; - g_autoptr(GFile) origin_path = NULL; new_origin = ostree_sysroot_origin_new_from_refspec (sysroot, new_refspec); diff --git a/src/ostree/ot-admin-builtin-switch.c b/src/ostree/ot-admin-builtin-switch.c index 895538aa..485e6cd4 100644 --- a/src/ostree/ot-admin-builtin-switch.c +++ b/src/ostree/ot-admin-builtin-switch.c @@ -53,11 +53,6 @@ ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GErro g_autofree char *new_remote = NULL; g_autofree char *new_ref = NULL; g_autofree char *new_refspec = NULL; - g_autofree char *new_revision = NULL; - g_autoptr(GFile) deployment_path = NULL; - g_autoptr(GFile) deployment_origin_path = NULL; - glnx_unref_object OstreeDeployment *merge_deployment = NULL; - glnx_unref_object OstreeDeployment *new_deployment = NULL; glnx_unref_object OstreeSysrootUpgrader *upgrader = NULL; glnx_unref_object OstreeAsyncProgress *progress = NULL; gboolean changed; diff --git a/src/ostree/ot-admin-builtin-undeploy.c b/src/ostree/ot-admin-builtin-undeploy.c index e048729d..dd41950e 100644 --- a/src/ostree/ot-admin-builtin-undeploy.c +++ b/src/ostree/ot-admin-builtin-undeploy.c @@ -41,7 +41,6 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr const char *deploy_index_str; int deploy_index; g_autoptr(GPtrArray) current_deployments = NULL; - glnx_unref_object OstreeDeployment *booted_deployment = NULL; glnx_unref_object OstreeDeployment *target_deployment = NULL; context = g_option_context_new ("INDEX - Delete deployment INDEX"); diff --git a/src/ostree/ot-admin-builtin-unlock.c b/src/ostree/ot-admin-builtin-unlock.c index 9d265325..a1789377 100644 --- a/src/ostree/ot-admin-builtin-unlock.c +++ b/src/ostree/ot-admin-builtin-unlock.c @@ -44,9 +44,6 @@ ot_admin_builtin_unlock (int argc, char **argv, GCancellable *cancellable, GErro gboolean ret = FALSE; GOptionContext *context; glnx_unref_object OstreeSysroot *sysroot = NULL; - glnx_unref_object OstreeRepo *repo = NULL; - g_autoptr(GPtrArray) new_deployments = NULL; - glnx_unref_object OstreeDeployment *merge_deployment = NULL; OstreeDeployment *booted_deployment = NULL; OstreeDeploymentUnlockedState target_state; diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c index 81f9bb6f..2ad74fc6 100644 --- a/src/ostree/ot-admin-builtin-upgrade.c +++ b/src/ostree/ot-admin-builtin-upgrade.c @@ -52,8 +52,6 @@ ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GErr GOptionContext *context; glnx_unref_object OstreeSysroot *sysroot = NULL; glnx_unref_object OstreeSysrootUpgrader *upgrader = NULL; - g_autoptr(GFile) deployment_path = NULL; - g_autoptr(GFile) deployment_origin_path = NULL; g_autoptr(GKeyFile) origin = NULL; glnx_unref_object OstreeAsyncProgress *progress = NULL; gboolean changed; diff --git a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c index ee7fe702..7d837ff4 100644 --- a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c +++ b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c @@ -38,12 +38,8 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c { gboolean ret = FALSE; guint bootversion; - g_autoptr(GFile) subpath = NULL; - glnx_unref_object OstreeSePolicy *sepolicy = NULL; - g_autoptr(GPtrArray) deployments = NULL; GOptionContext *context = NULL; glnx_unref_object OstreeSysroot *sysroot = NULL; - g_autoptr(GFile) deployment_path = NULL; context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries"); diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c index 5401a281..58a653ff 100644 --- a/src/ostree/ot-builtin-pull-local.c +++ b/src/ostree/ot-builtin-pull-local.c @@ -60,7 +60,6 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr g_autofree char *src_repo_uri = NULL; glnx_unref_object OstreeAsyncProgress *progress = NULL; g_autoptr(GPtrArray) refs_to_fetch = NULL; - g_autoptr(GHashTable) source_objects = NULL; OstreeRepoPullFlags pullflags = 0; context = g_option_context_new ("SRC_REPO [REFS...] - Copy data from SRC_REPO"); diff --git a/src/ostree/ot-builtin-pull.c b/src/ostree/ot-builtin-pull.c index 9f48c2e0..7981f18a 100644 --- a/src/ostree/ot-builtin-pull.c +++ b/src/ostree/ot-builtin-pull.c @@ -198,7 +198,7 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError ** else { char *ref_to_fetch; - refs_to_fetch = g_ptr_array_new (); + refs_to_fetch = g_ptr_array_new_with_free_func (g_free); if (!ostree_parse_refspec (argv[1], &remote, &ref_to_fetch, error)) goto out; /* Transfer ownership */ @@ -208,6 +208,7 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError ** { GVariantBuilder builder; + g_autoptr(GVariant) options = NULL; g_auto(GLnxConsoleRef) console = { 0, }; g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); @@ -265,7 +266,9 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError ** &console); } - if (!ostree_repo_pull_with_options (repo, remote, g_variant_builder_end (&builder), + options = g_variant_ref_sink (g_variant_builder_end (&builder)); + + if (!ostree_repo_pull_with_options (repo, remote, options, progress, cancellable, error)) goto out; diff --git a/src/ostree/ot-builtin-remote.c b/src/ostree/ot-builtin-remote.c index 7809dd67..31924eb1 100644 --- a/src/ostree/ot-builtin-remote.c +++ b/src/ostree/ot-builtin-remote.c @@ -33,9 +33,12 @@ typedef struct { static OstreeRemoteCommand remote_subcommands[] = { { "add", ot_remote_builtin_add }, + { "add-cookie", ot_remote_builtin_add_cookie }, { "delete", ot_remote_builtin_delete }, + { "delete-cookie", ot_remote_builtin_delete_cookie }, { "show-url", ot_remote_builtin_show_url }, { "list", ot_remote_builtin_list }, + { "list-cookies", ot_remote_builtin_list_cookies }, { "gpg-import", ot_remote_builtin_gpg_import }, { "refs", ot_remote_builtin_refs }, { "summary", ot_remote_builtin_summary }, diff --git a/src/ostree/ot-builtin-static-delta.c b/src/ostree/ot-builtin-static-delta.c index a1c220bb..ca29911a 100644 --- a/src/ostree/ot-builtin-static-delta.c +++ b/src/ostree/ot-builtin-static-delta.c @@ -399,7 +399,6 @@ ostree_builtin_static_delta (int argc, char **argv, GCancellable *cancellable, G gboolean ret = FALSE; OstreeCommand *command = NULL; const char *cmdname = NULL; - glnx_unref_object OstreeRepo *repo = NULL; int i; gboolean want_help = FALSE; diff --git a/src/ostree/ot-builtin-trivial-httpd.c b/src/ostree/ot-builtin-trivial-httpd.c index 2b6bda25..6e6415dd 100644 --- a/src/ostree/ot-builtin-trivial-httpd.c +++ b/src/ostree/ot-builtin-trivial-httpd.c @@ -44,6 +44,8 @@ static int opt_random_500s_percentage; static int opt_random_500s_max = 100; static gint opt_port = 0; +static gchar **opt_expected_cookies; + static guint emitted_random_500s_count = 0; typedef struct { @@ -61,6 +63,7 @@ static GOptionEntry options[] = { { "random-500s", 0, 0, G_OPTION_ARG_INT, &opt_random_500s_percentage, "Generate random HTTP 500 errors approximately for PERCENTAGE requests", "PERCENTAGE" }, { "random-500s-max", 0, 0, G_OPTION_ARG_INT, &opt_random_500s_max, "Limit HTTP 500 errors to MAX (default 100)", "MAX" }, { "log-file", 0, 0, G_OPTION_ARG_FILENAME, &opt_log, "Put logs here", "PATH" }, + { "expected-cookies", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_expected_cookies, "Expect given cookies in the http request", "KEY=VALUE" }, { NULL } }; @@ -199,6 +202,42 @@ do_get (OtTrivialHttpd *self, struct stat stbuf; httpd_log (self, "serving %s\n", path); + + if (opt_expected_cookies) + { + GSList *cookies = soup_cookies_from_request (msg); + GSList *l; + int i; + + for (i = 0 ; opt_expected_cookies[i] != NULL; i++) + { + gboolean found = FALSE; + gchar *k = opt_expected_cookies[i]; + gchar *v = strchr (k, '=') + 1; + + for (l = cookies; l != NULL ; l = g_slist_next (l)) + { + SoupCookie *c = l->data; + + if (!strncmp (k, soup_cookie_get_name (c), v - k - 1) && + !strcmp (v, soup_cookie_get_value (c))) + { + found = TRUE; + break; + } + } + + if (!found) + { + httpd_log (self, "Expected cookie not found %s\n", k); + soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN); + soup_cookies_free (cookies); + goto out; + } + } + soup_cookies_free (cookies); + } + if (strstr (path, "../") != NULL) { soup_message_set_status (msg, SOUP_STATUS_FORBIDDEN); diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c index 18c13239..5080e8c6 100644 --- a/src/ostree/ot-main.c +++ b/src/ostree/ot-main.c @@ -366,6 +366,13 @@ ostree_admin_option_context_parse (GOptionContext *context, g_print ("%s\n", deployment_path); + /* The g_autoptr, g_autofree etc. don't happen when we explicitly + * exit, making valgrind complain about leaks */ + g_clear_object (&sysroot); + g_clear_object (&sysroot_path); + g_clear_object (&deployment_file); + g_clear_pointer (&deployments, g_ptr_array_unref); + g_clear_pointer (&deployment_path, g_free); exit (EXIT_SUCCESS); } diff --git a/src/ostree/ot-remote-builtin-add-cookie.c b/src/ostree/ot-remote-builtin-add-cookie.c new file mode 100644 index 00000000..439e7503 --- /dev/null +++ b/src/ostree/ot-remote-builtin-add-cookie.c @@ -0,0 +1,84 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2015 Red Hat, Inc. + * Copyright (C) 2016 Sjoerd Simons + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include "otutil.h" + +#include "ot-main.h" +#include "ot-remote-builtins.h" +#include "ostree-repo-private.h" + + +static GOptionEntry option_entries[] = { + { NULL } +}; + +gboolean +ot_remote_builtin_add_cookie (int argc, char **argv, GCancellable *cancellable, GError **error) +{ + GOptionContext *context; + glnx_unref_object OstreeRepo *repo = NULL; + const char *remote_name; + const char *domain; + const char *path; + const char *cookie_name; + const char *value; + g_autofree char *jar_path = NULL; + g_autofree char *cookie_file = NULL; + glnx_unref_object SoupCookieJar *jar = NULL; + SoupCookie *cookie; + + context = g_option_context_new ("NAME DOMAIN PATH COOKIE_NAME VALUE - Add a cookie to remote"); + + if (!ostree_option_context_parse (context, option_entries, &argc, &argv, + OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) + return FALSE; + + if (argc < 6) + { + ot_util_usage_error (context, "NAME, DOMAIN, PATH, COOKIE_NAME and VALUE must be specified", error); + return FALSE; + } + + remote_name = argv[1]; + domain = argv[2]; + path = argv[3]; + cookie_name = argv[4]; + value = argv[5]; + + cookie_file = g_strdup_printf ("%s.cookies.txt", remote_name); + jar_path = g_build_filename (g_file_get_path (repo->repodir), cookie_file, NULL); + + jar = soup_cookie_jar_text_new (jar_path, FALSE); + + /* Pick a silly long expire time, we're just storing the cookies in the + * jar and on pull the jar is read-only so expiry has little actual value */ + cookie = soup_cookie_new (cookie_name, value, domain, path, + SOUP_COOKIE_MAX_AGE_ONE_YEAR * 25); + + /* jar takes ownership of cookie */ + soup_cookie_jar_add_cookie (jar, cookie); + + return TRUE; +} diff --git a/src/ostree/ot-remote-builtin-add.c b/src/ostree/ot-remote-builtin-add.c index 76b0c75a..9d275cb5 100644 --- a/src/ostree/ot-remote-builtin-add.c +++ b/src/ostree/ot-remote-builtin-add.c @@ -49,9 +49,8 @@ ot_remote_builtin_add (int argc, char **argv, GCancellable *cancellable, GError const char *remote_name; const char *remote_url; char **iter; - g_autofree char *target_name = NULL; - g_autoptr(GFile) target_conf = NULL; g_autoptr(GVariantBuilder) optbuilder = NULL; + g_autoptr(GVariant) options = NULL; gboolean ret = FALSE; context = g_option_context_new ("NAME [metalink=|mirrorlist=]URL [BRANCH...] - Add a remote repository"); @@ -111,11 +110,13 @@ ot_remote_builtin_add (int argc, char **argv, GCancellable *cancellable, GError "gpg-verify", g_variant_new_variant (g_variant_new_boolean (FALSE))); + options = g_variant_ref_sink (g_variant_builder_end (optbuilder)); + if (!ostree_repo_remote_change (repo, NULL, opt_if_not_exists ? OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS : OSTREE_REPO_REMOTE_CHANGE_ADD, remote_name, remote_url, - g_variant_builder_end (optbuilder), + options, cancellable, error)) goto out; diff --git a/src/ostree/ot-remote-builtin-delete-cookie.c b/src/ostree/ot-remote-builtin-delete-cookie.c new file mode 100644 index 00000000..9f05a564 --- /dev/null +++ b/src/ostree/ot-remote-builtin-delete-cookie.c @@ -0,0 +1,96 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2015 Red Hat, Inc. + * Copyright (C) 2016 Sjoerd Simons + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include "otutil.h" + +#include "ot-main.h" +#include "ot-remote-builtins.h" +#include "ostree-repo-private.h" + + +static GOptionEntry option_entries[] = { + { NULL } +}; + +gboolean +ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellable, GError **error) +{ + GOptionContext *context; + glnx_unref_object OstreeRepo *repo = NULL; + const char *remote_name; + const char *domain; + const char *path; + const char *cookie_name; + g_autofree char *jar_path = NULL; + g_autofree char *cookie_file = NULL; + glnx_unref_object SoupCookieJar *jar = NULL; + GSList *cookies; + gboolean found = FALSE; + + context = g_option_context_new ("NAME DOMAIN PATH COOKIE_NAME- Remote one cookie from remote"); + + if (!ostree_option_context_parse (context, option_entries, &argc, &argv, + OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) + return FALSE; + + if (argc < 5) + { + ot_util_usage_error (context, "NAME, DOMAIN, PATH and COOKIE_NAME must be specified", error); + return FALSE; + } + + remote_name = argv[1]; + domain = argv[2]; + path = argv[3]; + cookie_name = argv[4]; + + cookie_file = g_strdup_printf ("%s.cookies.txt", remote_name); + jar_path = g_build_filename (g_file_get_path (repo->repodir), cookie_file, NULL); + + jar = soup_cookie_jar_text_new (jar_path, FALSE); + cookies = soup_cookie_jar_all_cookies (jar); + + while (cookies != NULL) + { + SoupCookie *cookie = cookies->data; + + if (!strcmp (domain, soup_cookie_get_domain (cookie)) && + !strcmp (path, soup_cookie_get_path (cookie)) && + !strcmp (cookie_name, soup_cookie_get_name (cookie))) + { + soup_cookie_jar_delete_cookie (jar, cookie); + + found = TRUE; + } + + soup_cookie_free (cookie); + cookies = g_slist_delete_link (cookies, cookies); + } + + if (!found) + g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Cookie not found in jar"); + + return found; +} diff --git a/src/ostree/ot-remote-builtin-list-cookies.c b/src/ostree/ot-remote-builtin-list-cookies.c new file mode 100644 index 00000000..5ccc5d8d --- /dev/null +++ b/src/ostree/ot-remote-builtin-list-cookies.c @@ -0,0 +1,86 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2015 Red Hat, Inc. + * Copyright (C) 2016 Sjoerd Simons + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include "otutil.h" + +#include "ot-main.h" +#include "ot-remote-builtins.h" +#include "ostree-repo-private.h" + + +static GOptionEntry option_entries[] = { + { NULL } +}; + +gboolean +ot_remote_builtin_list_cookies (int argc, char **argv, GCancellable *cancellable, GError **error) +{ + GOptionContext *context; + glnx_unref_object OstreeRepo *repo = NULL; + const char *remote_name; + g_autofree char *jar_path = NULL; + g_autofree char *cookie_file = NULL; + glnx_unref_object SoupCookieJar *jar = NULL; + GSList *cookies; + + context = g_option_context_new ("NAME - Show remote repository cookies"); + + if (!ostree_option_context_parse (context, option_entries, &argc, &argv, + OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error)) + return FALSE; + + if (argc < 2) + { + ot_util_usage_error (context, "NAME must be specified", error); + return FALSE; + } + + remote_name = argv[1]; + + cookie_file = g_strdup_printf ("%s.cookies.txt", remote_name); + jar_path = g_build_filename (g_file_get_path (repo->repodir), cookie_file, NULL); + + jar = soup_cookie_jar_text_new (jar_path, TRUE); + cookies = soup_cookie_jar_all_cookies (jar); + + while (cookies != NULL) + { + SoupCookie *cookie = cookies->data; + SoupDate *expiry = soup_cookie_get_expires (cookie); + + g_print ("--\n"); + g_print ("Domain: %s\n", soup_cookie_get_domain (cookie)); + g_print ("Path: %s\n", soup_cookie_get_path (cookie)); + g_print ("Name: %s\n", soup_cookie_get_name (cookie)); + g_print ("Secure: %s\n", soup_cookie_get_secure (cookie) ? "yes" : "no"); + g_print ("Expires: %s\n", soup_date_to_string (expiry, SOUP_DATE_COOKIE)); + g_print ("Value: %s\n", soup_cookie_get_value (cookie)); + + soup_cookie_free (cookie); + cookies = g_slist_delete_link (cookies, cookies); + } + + return TRUE; +} diff --git a/src/ostree/ot-remote-builtin-refs.c b/src/ostree/ot-remote-builtin-refs.c index da3bcbb9..4317c45f 100644 --- a/src/ostree/ot-remote-builtin-refs.c +++ b/src/ostree/ot-remote-builtin-refs.c @@ -29,6 +29,7 @@ static char* opt_cache_dir; static GOptionEntry option_entries[] = { { "cache-dir", 0, 0, G_OPTION_ARG_STRING, &opt_cache_dir, "Use custom cache dir", NULL }, + { NULL } }; gboolean diff --git a/src/ostree/ot-remote-builtin-show-url.c b/src/ostree/ot-remote-builtin-show-url.c index a4b447c8..401dfb0b 100644 --- a/src/ostree/ot-remote-builtin-show-url.c +++ b/src/ostree/ot-remote-builtin-show-url.c @@ -32,7 +32,7 @@ static GOptionEntry option_entries[] = { gboolean ot_remote_builtin_show_url (int argc, char **argv, GCancellable *cancellable, GError **error) { - GOptionContext *context; + g_autoptr(GOptionContext) context = NULL; glnx_unref_object OstreeRepo *repo = NULL; const char *remote_name; g_autofree char *remote_url = NULL; diff --git a/src/ostree/ot-remote-builtins.h b/src/ostree/ot-remote-builtins.h index 0e65092f..289e2e0d 100644 --- a/src/ostree/ot-remote-builtins.h +++ b/src/ostree/ot-remote-builtins.h @@ -25,9 +25,12 @@ G_BEGIN_DECLS gboolean ot_remote_builtin_add (int argc, char **argv, GCancellable *cancellable, GError **error); +gboolean ot_remote_builtin_add_cookie (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_delete (int argc, char **argv, GCancellable *cancellable, GError **error); +gboolean ot_remote_builtin_delete_cookie (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_gpg_import (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error); +gboolean ot_remote_builtin_list_cookies (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_show_url (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_refs (int argc, char **argv, GCancellable *cancellable, GError **error); gboolean ot_remote_builtin_summary (int argc, char **argv, GCancellable *cancellable, GError **error); diff --git a/src/ostree/parse-datetime.c b/src/ostree/parse-datetime.c index 1e4c224d..b96201fd 100644 --- a/src/ostree/parse-datetime.c +++ b/src/ostree/parse-datetime.c @@ -2620,7 +2620,7 @@ time_zone_hhmm (parser_control *pc, textint s, long int mm) /* If the absolute number of minutes is larger than 24 hours, arrange to reject it by incrementing pc->zones_seen. Thus, we allow only values in the range UTC-24:00 to UTC+24:00. */ - if (24 * 60 < abs (n_minutes)) + if (24 * 60 < labs (n_minutes)) pc->zones_seen++; return n_minutes; diff --git a/src/ostree/parse-datetime.y b/src/ostree/parse-datetime.y index d05bb55b..f5688d30 100644 --- a/src/ostree/parse-datetime.y +++ b/src/ostree/parse-datetime.y @@ -896,7 +896,7 @@ time_zone_hhmm (parser_control *pc, textint s, long int mm) /* If the absolute number of minutes is larger than 24 hours, arrange to reject it by incrementing pc->zones_seen. Thus, we allow only values in the range UTC-24:00 to UTC+24:00. */ - if (24 * 60 < abs (n_minutes)) + if (24 * 60 < labs (n_minutes)) pc->zones_seen++; return n_minutes; diff --git a/tests/glib.supp b/tests/glib.supp new file mode 100644 index 00000000..7ac6ed87 --- /dev/null +++ b/tests/glib.supp @@ -0,0 +1,562 @@ +# This GLib suppressions file is known to be used at least by: +# +# - rpm-software-management/libhif +# +# Please use the upstream verison in libhif for changes. +{ + gobject_init_1 + Memcheck:Leak + ... + fun:gobject_init +} +{ + g_type_register_static_1 + Memcheck:Leak + ... + fun:g_type_register_static +} +{ + g_type_register_dynamic + Memcheck:Leak + ... + fun:g_type_register_dynamic +} +{ + g_type_register_fundamental + Memcheck:Leak + ... + fun:g_type_register_fundamental +} +{ + g_type_init_with_debug_flags + Memcheck:Leak + ... + fun:g_type_init_with_debug_flags +} +{ + g_type_class_ref_1 + Memcheck:Leak + ... + fun:type_iface_vtable_base_init_Wm + ... + fun:g_type_class_ref +} +{ + g_type_class_ref_2 + Memcheck:Leak + ... + fun:type_class_init_Wm + ... + fun:g_type_class_ref +} +{ + g_type_add_interface_static + Memcheck:Leak + ... + fun:g_type_add_interface_static +} +{ + g_type_add_interface_dynamic + Memcheck:Leak + ... + fun:g_type_add_interface_dynamic +} +{ + g_param_spec_internal + Memcheck:Leak + ... + fun:g_type_class_ref + fun:g_type_create_instance + fun:g_param_spec_internal +} +{ + g_param_spec_enum + Memcheck:Leak + ... + fun:g_type_class_ref + fun:g_param_spec_enum +} +{ + g_param_spec_flags + Memcheck:Leak + ... + fun:g_type_class_ref + fun:g_param_spec_flags +} +{ + g_quark_from_static_string + Memcheck:Leak + ... + fun:g_quark_from_static_string +} +{ + g_quark_from_string + Memcheck:Leak + ... + fun:g_quark_from_string +} +{ + g_value_register_transform_func + Memcheck:Leak + ... + fun:g_value_register_transform_func +} +{ + test_run_seed + Memcheck:Leak + ... + fun:g_rand_new_with_seed_array + fun:test_run_seed + ... + fun:g_test_run_suite +} +{ + g_test_init + Memcheck:Leak + ... + fun:g_rand_new_with_seed_array + ... + fun:g_test_init +} +{ + g_intern_static_string + Memcheck:Leak + ... + fun:g_intern_static_string +} +{ + g_main_context_push_thread_default + Memcheck:Leak + ... + fun:g_queue_new + fun:g_main_context_push_thread_default +} +{ + g_main_context_push_thread_default_inlined + Memcheck:Leak + ... + fun:g_slice_alloc0 + fun:g_main_context_push_thread_default +} +{ + g_dbus_error_register_error + Memcheck:Leak + ... + fun:g_dbus_error_register_error +} +{ + g_param_spec_pool_insert + Memcheck:Leak + ... + fun:g_param_spec_pool_insert +} +{ + g_main_context_default + Memcheck:Leak + ... + fun:g_main_context_default +} +{ + g_main_context_check + Memcheck:Leak + ... + fun:g_ptr_array_add + fun:g_main_context_check +} +{ + g_test_run_suite + Memcheck:Leak + ... + fun:g_slist_copy + fun:g_test_run_suite_internal + fun:g_test_run_suite +} +{ + g_dbus_interface_info_cache_build + Memcheck:Leak + ... + fun:g_dbus_interface_info_cache_build +} +{ + g_cancellable_push_current + Memcheck:Leak + ... + fun:thread_memory_from_self + ... + fun:g_cancellable_push_current +} +{ + _g_io_module_get_default + Memcheck:Leak + ... + fun:g_io_module_new + fun:g_io_modules_scan_all_in_directory_with_scope + fun:_g_io_modules_ensure_loaded + fun:_g_io_module_get_default +} +{ + g_io_scheduler_push_job + Memcheck:Leak + ... + fun:init_scheduler + fun:g_once_impl + fun:g_io_scheduler_push_job +} +{ + g_io_scheduler_push_job_2 + Memcheck:Leak + ... + fun:g_system_thread_new + ... + fun:g_io_scheduler_push_job +} +{ + g_bus_get_sync__available_connections + Memcheck:Leak + ... + fun:g_hash_table_new + fun:initable_init + fun:g_initable_init + fun:g_bus_get_sync +} +{ + g_socket_connection_factory_register_type + Memcheck:Leak + ... + fun:g_socket_connection_factory_register_type +} +{ + g_test_add_vtable + Memcheck:Leak + ... + fun:g_test_add_vtable +} +{ + g_mutex_lock + Memcheck:Leak + ... + fun:g_mutex_impl_new + fun:g_mutex_get_impl + fun:g_mutex_lock +} +{ + g_thread_self + Memcheck:Leak + ... + fun:g_thread_self +} +{ + g_rec_mutex_lock + Memcheck:Leak + ... + fun:g_rec_mutex_impl_new + fun:g_rec_mutex_get_impl + fun:g_rec_mutex_lock +} +{ + test_case_run + Memcheck:Leak + ... + fun:g_malloc0 + fun:test_case_run + ... + fun:g_test_run_suite +} +{ + g_get_charset + Memcheck:Leak + ... + fun:g_get_charset +} +{ + g_test_run_suite__timer_new + Memcheck:Leak + ... + fun:g_timer_new + fun:test_case_run + ... + fun:g_test_run_suite +} +{ + g_test_run_suite__timer_new2 + Memcheck:Leak + ... + fun:g_timer_new + fun:test_case_run_suite_internal + ... + fun:g_test_run_suite +} +{ + g_test_run_suite__strconcat + Memcheck:Leak + ... + fun:g_strconcat + fun:test_case_run + ... + fun:g_test_run_suite + fun:g_test_run +} +{ + g_type_interface_add_prerequisite + Memcheck:Leak + ... + fun:g_type_interface_add_prerequisite +} +{ + + Memcheck:Leak + ... + fun:g_slist_copy + fun:g_test_run_suite_internal + ... + fun:g_test_run_suite +} +{ + g_set_prgname + Memcheck:Leak + ... + fun:g_set_prgname +} +{ + g_test_run_suite__strconcat_2 + Memcheck:Leak + ... + fun:g_strconcat + fun:g_test_run_suite_internal +} +{ + g_test_run_suite__strdup + Memcheck:Leak + ... + fun:g_strdup + fun:g_test_run_suite_internal +} +{ + g_private_get + Memcheck:Leak + ... + fun:g_private_get +} +{ + g_private_set + Memcheck:Leak + ... + fun:g_private_set +} +{ + g_static_mutex_get_mutex_impl + Memcheck:Leak + ... + fun:g_static_mutex_get_mutex_impl +} +{ + g_variant_type_info_unref + Memcheck:Leak + ... + fun:g_hash_table_remove + fun:g_variant_type_info_unref +} +{ + g_rw_lock_reader_lock + Memcheck:Leak + ... + fun:g_rw_lock_impl_new + fun:g_rw_lock_get_impl + fun:g_rw_lock_reader_lock +} +{ + g_child_watch_finalize__rt_sigaction + Memcheck:Param + rt_sigaction(act->sa_flags) + fun:__libc_sigaction + ... + fun:g_child_watch_finalize +} +{ + g_dbus_worker_new + Memcheck:Leak + fun:calloc + ... + fun:_g_dbus_worker_new +} +{ + gdbus_shared_thread_func + Memcheck:Leak + match-leak-kinds: definite + ... + fun:g_malloc + ... + fun:gdbus_shared_thread_func +} +{ + g_task_start_task_thread + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_slice_alloc0 + ... + fun:g_thread_pool_push + fun:g_task_start_task_thread +} +{ + g_task_to_pool + Memcheck:Leak + ... + fun:g_thread_pool_start_thread + ... + fun:g_task_run_in_thread +} +{ + g_get_language_names + Memcheck:Leak + match-leak-kinds: definite + fun:calloc + fun:g_malloc0 + fun:g_get_language_names +} +{ + g_get_filename_charsets + Memcheck:Leak + match-leak-kinds: definite + ... + fun:g_get_filename_charsets + fun:g_filename_display_name +} +{ + g_main_current_source + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:g_malloc + ... + fun:g_main_current_source + fun:g_task_return + fun:g_task_thread_pool_thread +} +{ + g_once_init_enter + Memcheck:Leak + match-leak-kinds: definite + ... + fun:g_once_init_enter +} +{ + g_child_watch_source_new + Memcheck:Leak + match-leak-kinds: definite + ... + fun:g_thread_new + ... + fun:g_child_watch_source_new +} +{ + continue_writing_in_idle_cb + Memcheck:Leak + match-leak-kinds: definite + ... + fun:g_task_new + ... + fun:continue_writing_in_idle_cb + fun:g_main_context_dispatch +} +{ + g_main_current_source + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + ... + fun:g_main_current_source +} +{ + g_thread_pool_push + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + ... + fun:g_thread_pool_push +} +{ + leak_test_dbus_dispose + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + ... + fun:g_main_loop_run + fun:g_test_dbus_down +} +{ + leak_test_dbus_down + Memcheck:Leak + match-leak-kinds: definite + fun:calloc + fun:g_malloc0 + fun:g_main_loop_new + fun:g_test_dbus_down +} +{ + leak_socket_client_connect + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:g_malloc + fun:g_slice_alloc + fun:g_slice_alloc0 + fun:g_socket_client_connect_async + fun:g_socket_client_connect_to_uri_async +} +{ + leak_signal_handlers_disconnect_matched + Memcheck:Leak + match-leak-kinds: definite + fun:calloc + fun:g_malloc0 + ... + fun:g_slice_alloc + ... + fun:g_signal_handlers_disconnect_matched +} +{ + g_tls_connection_gnutls_init_priorities + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:g_malloc + fun:g_strdup + fun:g_tls_connection_gnutls_init_priorities +} +{ + g_tls_connection_gnutls_heisenbug_likely_same_as_above + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:g_malloc + fun:g_strdup + ... + fun:g_tls_client_connection_new +} +{ + g_unix_signal_add_full + Memcheck:Leak + match-leak-kinds: definite + fun:malloc + fun:g_malloc + ... + fun:g_thread_new + ... + fun:g_unix_signal_add_full +} +{ + glib_worker_1 + Memcheck:Leak + ... + fun:glib_worker_main +} +{ + glib_worker_2 + Memcheck:Leak + ... + fun:g_thread_new + fun:g_get_worker_context +} diff --git a/tests/libtest.sh b/tests/libtest.sh index bc114bfa..d16aae70 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -35,6 +35,15 @@ assert_not_reached () { test_tmpdir=$(pwd) +# Some tests look for specific English strings. Use a UTF-8 version +# of the C (POSIX) locale if we have one, or fall back to POSIX +# (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8) +if locale -a | grep C.UTF-8 >/dev/null; then + export LC_ALL=C.UTF-8 +else + export LC_ALL=C +fi + # Sanity check that we're in a tmpdir that has # just .testtmp (created by tap-driver for `make check`, # or nothing at all (as ginstest-runner does) diff --git a/tests/ostree.supp b/tests/ostree.supp new file mode 100644 index 00000000..b81ea51b --- /dev/null +++ b/tests/ostree.supp @@ -0,0 +1 @@ +# Use this to suppress "possibly lost" for global statics diff --git a/tests/pull-test.sh b/tests/pull-test.sh index b050e111..408d0539 100755 --- a/tests/pull-test.sh +++ b/tests/pull-test.sh @@ -35,7 +35,7 @@ function verify_initial_contents() { assert_file_has_content baz/cow '^moo$' } -echo "1..12" +echo "1..13" # Try both syntaxes repo_init @@ -63,11 +63,27 @@ $OSTREE --repo=ostree-srv/gnomerepo checkout main checkout-origin-main echo moomoo > checkout-origin-main/baz/cow ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit -b main -s "" --tree=dir=checkout-origin-main ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo fsck ${CMD_PREFIX} ostree --repo=mirrorrepo pull --mirror origin main ${CMD_PREFIX} ostree --repo=mirrorrepo fsck echo "ok pull mirror (should not apply deltas)" +cd ${test_tmpdir} +rm mirrorrepo/refs/remotes/* -rf +${CMD_PREFIX} ostree --repo=mirrorrepo prune --refs-only +${CMD_PREFIX} ostree --repo=mirrorrepo pull origin main +rm checkout-origin-main -rf +$OSTREE --repo=ostree-srv/gnomerepo checkout main checkout-origin-main +echo yetmorecontent > checkout-origin-main/baz/cowtest +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit -b main -s "" --tree=dir=checkout-origin-main +rev=$(${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo rev-parse main) +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u +${CMD_PREFIX} ostree --repo=mirrorrepo pull --commit-metadata-only origin main +assert_has_file mirrorrepo/state/${rev}.commitpartial +echo "ok pull commit metadata only (should not apply deltas)" + cd ${test_tmpdir} mkdir mirrorrepo-local ${CMD_PREFIX} ostree --repo=mirrorrepo-local init --mode=archive-z2 @@ -79,6 +95,7 @@ echo "ok pull local mirror" cd ${test_tmpdir} ${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit -b main -s "Metadata string" --add-detached-metadata-string=SIGNATURE=HANCOCK --tree=ref=main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u ${CMD_PREFIX} ostree --repo=repo pull origin main ${CMD_PREFIX} ostree --repo=repo fsck $OSTREE show --print-detached-metadata-key=SIGNATURE main > main-meta diff --git a/tests/test-admin-deploy-karg.sh b/tests/test-admin-deploy-karg.sh index b7305f4c..643aef78 100755 --- a/tests/test-admin-deploy-karg.sh +++ b/tests/test-admin-deploy-karg.sh @@ -46,6 +46,8 @@ ${CMD_PREFIX} ostree admin deploy --karg-proc-cmdline --os=testos testos:testos/ for arg in $(cat /proc/cmdline); do case "$arg" in ostree=*) # Skip ostree arg that gets stripped out + ;; + initrd=*|BOOT_IMAGE=*) # Skip options set by bootloader that gets filtered out ;; *) assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf "options.*$arg" ;; diff --git a/tests/test-admin-instutil-set-kargs.sh b/tests/test-admin-instutil-set-kargs.sh index 40f4b746..132c9336 100755 --- a/tests/test-admin-instutil-set-kargs.sh +++ b/tests/test-admin-instutil-set-kargs.sh @@ -58,6 +58,8 @@ for arg in $(cat /proc/cmdline); do case "$arg" in ostree=*) # Skip ostree arg that gets stripped out ;; + initrd=*|BOOT_IMAGE=*) # Skip options set by bootloader that gets filtered out + ;; *) assert_file_has_content sysroot/boot/loader/entries/ostree-testos-0.conf "options.*$arg" ;; esac diff --git a/tests/test-core.js b/tests/test-core.js new file mode 100644 index 00000000..e9ace6e9 --- /dev/null +++ b/tests/test-core.js @@ -0,0 +1,55 @@ +#!/usr/bin/env gjs +// +// Copyright (C) 2013 Colin Walters +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +const Gio = imports.gi.Gio; +const OSTree = imports.gi.OSTree; + +function assertEquals(a, b) { + if (a != b) + throw new Error("assertion failed " + JSON.stringify(a) + " == " + JSON.stringify(b)); +} + +let testDataDir = Gio.File.new_for_path('test-data'); +testDataDir.make_directory(null); +testDataDir.get_child('some-file').replace_contents("hello world!", null, false, 0, null); + +let repoPath = Gio.File.new_for_path('repo'); +let repo = OSTree.Repo.new(repoPath); +repo.create(OSTree.RepoMode.ARCHIVE_Z2, null); + +repo.open(null); + +assertEquals(repo.get_mode(), OSTree.RepoMode.ARCHIVE_Z2); + +repo.prepare_transaction(null); + +let mtree = OSTree.MutableTree.new(); +repo.write_directory_to_mtree(testDataDir, mtree, null, null); +let [,dirTree] = repo.write_mtree(mtree, null); +let [,commit] = repo.write_commit(null, 'Some subject', 'Some body', null, dirTree, null); +print("commit => " + commit); + +repo.commit_transaction(null, null); + +let [,root,checksum] = repo.read_commit(commit, null); +let child = root.get_child('some-file'); +let info = child.query_info("standard::name,standard::type,standard::size", 0, null); +assertEquals(info.get_size(), 12); + +print("test-core complete"); diff --git a/tests/test-corruption.sh b/tests/test-corruption.sh new file mode 100755 index 00000000..ef0e94ef --- /dev/null +++ b/tests/test-corruption.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# +# Copyright (C) 2011 Colin Walters +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +set -euo pipefail + +echo "1..2" + +. $(dirname $0)/libtest.sh + +setup_test_repository "bare" +$OSTREE checkout test2 checkout-test2 +cd checkout-test2 +chmod o+x firstfile +$OSTREE fsck -q && (echo 1>&2 "fsck unexpectedly succeeded"; exit 1) +chmod o-x firstfile +$OSTREE fsck -q + +echo "ok chmod" + +cd ${test_tmpdir} +rm checkout-test2 -rf +$OSTREE checkout test2 checkout-test2 +cd checkout-test2 +chmod o+x firstfile +$OSTREE fsck -q --delete && (echo 1>&2 "fsck unexpectedly succeeded"; exit 1) + +echo "ok chmod" diff --git a/tests/test-libarchive-import.c b/tests/test-libarchive-import.c index 3ef379e3..ad2e4c94 100644 --- a/tests/test-libarchive-import.c +++ b/tests/test-libarchive-import.c @@ -501,12 +501,10 @@ test_libarchive_selinux (gconstpointer data) { glnx_unref_object GFile *root = g_file_new_for_path ("/"); - /* creation should always succeed */ - sepol = ostree_sepolicy_new (root, NULL, &error); - g_assert (sepol != NULL); + sepol = ostree_sepolicy_new (root, NULL, NULL); } - if (ostree_sepolicy_get_name (sepol) == NULL) + if (sepol == NULL || ostree_sepolicy_get_name (sepol) == NULL) { g_test_skip ("SELinux disabled"); goto out; diff --git a/tests/test-mutable-tree.c b/tests/test-mutable-tree.c index fa2f68db..b357f691 100644 --- a/tests/test-mutable-tree.c +++ b/tests/test-mutable-tree.c @@ -110,7 +110,6 @@ test_ensure_dir (void) { glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new (); glnx_unref_object OstreeMutableTree *parent = NULL; - g_autoptr(GPtrArray) split_path = NULL; GError *error = NULL; const char *dirname = "foo"; const char *filename = "bar"; @@ -129,8 +128,6 @@ static void test_replace_file (void) { glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new (); - glnx_unref_object OstreeMutableTree *parent = NULL; - g_autoptr(GPtrArray) split_path = NULL; GError *error = NULL; const char *filename = "bar"; const char *checksum = "01234567890123456789012345678901"; diff --git a/tests/test-pull-subpath.sh b/tests/test-pull-subpath.sh index 09145f09..dba8b495 100755 --- a/tests/test-pull-subpath.sh +++ b/tests/test-pull-subpath.sh @@ -23,7 +23,7 @@ set -euo pipefail setup_fake_remote_repo1 "archive-z2" -echo '1..2' +echo '1..4' repopath=${test_tmpdir}/ostree-srv/gnomerepo cp -a ${repopath} ${repopath}.orig @@ -54,5 +54,26 @@ ${CMD_PREFIX} ostree --repo=repo ls origin:main /firstfile ${CMD_PREFIX} ostree --repo=repo pull origin main assert_not_has_file repo/state/${rev}.commitpartial ${CMD_PREFIX} ostree --repo=repo fsck -echo "ok" +echo "ok subpaths" + +rm -rf repo + +${CMD_PREFIX} ostree --repo=repo init +${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin ${remoteurl} + +# Pull a directory which is not the first in the commit (/baz/another is before) +${CMD_PREFIX} ostree --repo=repo pull --subpath=/baz/deeper origin main + +# Ensure it is there +${CMD_PREFIX} ostree --repo=repo ls origin:main /baz/deeper + +# Now prune, this should not prune the /baz/deeper dirmeta even if the +# /baz/another dirmeta is not in the repo. +${CMD_PREFIX} ostree --repo=repo prune --refs-only + +# Ensure it is still there +${CMD_PREFIX} ostree --repo=repo ls origin:main /baz/deeper + +echo "ok prune with commitpartial" + done diff --git a/tests/test-remote-cookies.sh b/tests/test-remote-cookies.sh new file mode 100755 index 00000000..11c201f1 --- /dev/null +++ b/tests/test-remote-cookies.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# +# Copyright (C) 2013 Jeremy Whiting +# Copyright (C) 2016 Sjoerd Simons +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +set -euo pipefail + +echo '1..4' + +. $(dirname $0)/libtest.sh + +setup_fake_remote_repo1 "archive-z2" "" \ + "--expected-cookies foo=bar --expected-cookies baz=badger" + +assert_fail (){ + set +e + $@ + if [ $? = 0 ] ; then + echo 1>&2 "$@ did not fail"; exit 1 + fi + set -euo pipefail +} + +cd ${test_tmpdir} +rm repo -rf +mkdir repo +${CMD_PREFIX} ostree --repo=repo init +${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo + +# Sanity check the setup, without cookies the pull should fail +assert_fail ${CMD_PREFIX} ostree --repo=repo pull origin main + +echo "ok, setup done" + +# Add 2 cookies, pull should succeed now +${CMD_PREFIX} ostree --repo=repo remote add-cookie origin 127.0.0.1 / foo bar +${CMD_PREFIX} ostree --repo=repo remote add-cookie origin 127.0.0.1 / baz badger +${CMD_PREFIX} ostree --repo=repo pull origin main + +echo "ok, initial cookie pull succeeded" + +# Delete one cookie, if successful pulls will fail again +${CMD_PREFIX} ostree --repo=repo remote delete-cookie origin 127.0.0.1 / baz badger +assert_fail ${CMD_PREFIX} ostree --repo=repo pull origin main + +echo "ok, delete succeeded" + +# Re-add the removed cooking and things succeed again, verified the removal +# removed exactly one cookie +${CMD_PREFIX} ostree --repo=repo remote add-cookie origin 127.0.0.1 / baz badger +${CMD_PREFIX} ostree --repo=repo pull origin main + +echo "ok, second cookie pull succeeded" diff --git a/tests/test-sizes.js b/tests/test-sizes.js new file mode 100644 index 00000000..5cf765fc --- /dev/null +++ b/tests/test-sizes.js @@ -0,0 +1,82 @@ +#!/usr/bin/env gjs +// +// Copyright (C) 2013 Colin Walters +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +const GLib = imports.gi.GLib; +const Gio = imports.gi.Gio; +const OSTree = imports.gi.OSTree; + +function assertEquals(a, b) { + if (a != b) + throw new Error("assertion failed " + JSON.stringify(a) + " == " + JSON.stringify(b)); +} + +let testDataDir = Gio.File.new_for_path('test-data'); +testDataDir.make_directory(null); +testDataDir.get_child('some-file').replace_contents("hello world!", null, false, 0, null); +testDataDir.get_child('another-file').replace_contents("hello world again!", null, false, 0, null); + +let repoPath = Gio.File.new_for_path('repo'); +let repo = OSTree.Repo.new(repoPath); +repo.create(OSTree.RepoMode.ARCHIVE_Z2, null); + +repo.open(null); + +let commitModifier = OSTree.RepoCommitModifier.new(OSTree.RepoCommitModifierFlags.GENERATE_SIZES, null); + +assertEquals(repo.get_mode(), OSTree.RepoMode.ARCHIVE_Z2); + +repo.prepare_transaction(null); + +let mtree = OSTree.MutableTree.new(); +repo.write_directory_to_mtree(testDataDir, mtree, commitModifier, null); +let [,dirTree] = repo.write_mtree(mtree, null); +let [,commit] = repo.write_commit(null, 'Some subject', 'Some body', null, dirTree, null); +print("commit => " + commit); + +repo.commit_transaction(null, null); + +// Test the sizes metadata +let [,commitVariant] = repo.load_variant(OSTree.ObjectType.COMMIT, commit); +let metadata = commitVariant.get_child_value(0); +let sizes = metadata.lookup_value('ostree.sizes', GLib.VariantType.new('aay')); +let nSizes = sizes.n_children(); +assertEquals(nSizes, 2); +let expectedUncompressedSizes = [12, 18]; +let foundExpectedUncompressedSizes = 0; +for (let i = 0; i < nSizes; i++) { + let sizeEntry = sizes.get_child_value(i).deep_unpack(); + assertEquals(sizeEntry.length, 34); + let compressedSize = sizeEntry[32]; + let uncompressedSize = sizeEntry[33]; + print("compressed = " + compressedSize); + print("uncompressed = " + uncompressedSize); + for (let j = 0; j < expectedUncompressedSizes.length; j++) { + let expected = expectedUncompressedSizes[j]; + if (expected == uncompressedSize) { + print("Matched expected uncompressed size " + expected); + expectedUncompressedSizes.splice(j, 1); + break; + } + } +} +if (expectedUncompressedSizes.length > 0) { + throw new Error("Failed to match expectedUncompressedSizes: " + JSON.stringify(expectedUncompressedSizes)); +} + +print("test-sizes complete"); diff --git a/tests/test-sysroot.js b/tests/test-sysroot.js new file mode 100644 index 00000000..7e8fcf7a --- /dev/null +++ b/tests/test-sysroot.js @@ -0,0 +1,147 @@ +#!/usr/bin/env gjs +// +// Copyright (C) 2013 Colin Walters +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +const GLib = imports.gi.GLib; +const Gio = imports.gi.Gio; +const OSTree = imports.gi.OSTree; + +function assertEquals(a, b) { + if (a != b) + throw new Error("assertion failed " + JSON.stringify(a) + " == " + JSON.stringify(b)); +} + +function assertNotEquals(a, b) { + if (a == b) + throw new Error("assertion failed " + JSON.stringify(a) + " != " + JSON.stringify(b)); +} + +function libtestExec(shellCode) { + let testdatadir = GLib.getenv("G_TEST_SRCDIR"); + let libtestPath = GLib.build_filenamev([testdatadir, 'libtest.sh']) + let proc = Gio.Subprocess.new(['bash', '-c', 'set -xeuo pipefail; . ' + GLib.shell_quote(libtestPath) + '; ' + shellCode], 0); + proc.wait_check(null); +} + +libtestExec('setup_os_repository archive-z2 syslinux'); + +let upstreamRepo = OSTree.Repo.new(Gio.File.new_for_path('testos-repo')); +upstreamRepo.open(null); + +let runtimeRef = 'testos/buildmaster/x86_64-runtime'; +let [,rev] = upstreamRepo.resolve_rev(runtimeRef, false); + +print("testos => " + rev); + +//// TEST: We should have no deployments + +let sysroot = OSTree.Sysroot.new(Gio.File.new_for_path('sysroot')); +sysroot.load(null); +let deployments = sysroot.get_deployments(); +assertEquals(deployments.length, 0); + +//// Add the remote, and do a pull + +let [,sysrootRepo] = sysroot.get_repo(null); +sysrootRepo.remote_add('testos', 'file://' + upstreamRepo.get_path().get_path(), + GLib.Variant.new('a{sv}', {'gpg-verify': GLib.Variant.new('b', false), + 'branches': GLib.Variant.new('as', [runtimeRef])}), null); +sysrootRepo.pull('testos', null, 0, null, null); + +//// TEST: We can deploy one tree + +let mergeDeployment = sysroot.get_merge_deployment('testos'); + +let origin = sysroot.origin_new_from_refspec(runtimeRef); +let [,deployment] = sysroot.deploy_tree('testos', rev, origin, + mergeDeployment, null, + null); +let newDeployments = deployments; +deployments = null; +newDeployments.unshift(deployment); +sysroot.write_deployments(newDeployments, null); +deployments = sysroot.get_deployments(); +assertEquals(deployments.length, newDeployments.length); +assertEquals(deployments[0].get_csum(), deployment.get_csum()); + +let deploymentPath = sysroot.get_deployment_directory(deployment); +assertEquals(deploymentPath.query_exists(null), true); + +print("OK one deployment"); + +/// TEST: We can delete the deployment, going back to empty +sysroot.write_deployments([], null); + +print("OK empty deployments"); + +assertEquals(deploymentPath.query_exists(null), false); + +//// Ok, redeploy, then add a new revision upstream and pull it + +let [,deployment] = sysroot.deploy_tree('testos', rev, origin, + mergeDeployment, null, + null); +newDeployments = deployments; +deployments = null; +newDeployments.unshift(deployment); +print(JSON.stringify(newDeployments)); +sysroot.write_deployments(newDeployments, null); + +libtestExec('os_repository_new_commit'); + +sysrootRepo.pull('testos', null, 0, null, null); + +let [,newRev] = upstreamRepo.resolve_rev(runtimeRef, false); + +print("testos => " + newRev); +assertNotEquals(rev, newRev); + +mergeDeployment = sysroot.get_merge_deployment('testos'); +assertEquals(mergeDeployment.get_csum(), deployment.get_csum()); +let [,newDeployment] = sysroot.deploy_tree('testos', newRev, origin, + mergeDeployment, null, + null); +newDeployments = [newDeployment, mergeDeployment]; +assertNotEquals(mergeDeployment.get_bootcsum(), newDeployment.get_bootcsum()); +assertNotEquals(mergeDeployment.get_csum(), newDeployment.get_csum()); +sysroot.write_deployments(newDeployments, null); +deployments = sysroot.get_deployments(); +assertEquals(deployments.length, 2); +assertEquals(deploymentPath.query_exists(null), true); +let newDeploymentPath = sysroot.get_deployment_directory(newDeployment); +assertEquals(newDeploymentPath.query_exists(null), true); + +print("OK two deployments"); + +libtestExec('os_repository_new_commit 0 1'); + +sysrootRepo.pull('testos', null, 0, null, null); + +let [,thirdRev] = sysrootRepo.resolve_rev(runtimeRef, false); +assertNotEquals(newRev, thirdRev); + +mergeDeployment = sysroot.get_merge_deployment('testos'); +let [,thirdDeployment] = sysroot.deploy_tree('testos', thirdRev, origin, + mergeDeployment, null, + null); +assertEquals(mergeDeployment.get_bootcsum(), thirdDeployment.get_bootcsum()); +assertNotEquals(mergeDeployment.get_csum(), thirdDeployment.get_csum()); +newDeployments = [deployment, newDeployment, thirdDeployment]; +sysroot.write_deployments(newDeployments, null); +deployments = sysroot.get_deployments(); +assertEquals(deployments.length, 3);