Commit Graph

3146 Commits

Author SHA1 Message Date
Colin Walters
58e318d678 [ASAN] sysroot: Squash a leak in lockfile acquisition
I installed `parallel` in my dev container, which got me
the sysroot locking tests, which caught this leak when
built with ASAN.

Closes: #623
Approved by: jlebon
2016-12-08 16:18:19 +00:00
Colin Walters
7f2830cb4e build: Make libsoup optional again
The "remote cookies" code broke this.  While I'm not sure anyone is
actually using ostree-without-http, it isn't too hard to keep the
build time conditional going.  Further, this work is preparatory for
libcurl porting.

Closes: #621
Approved by: jlebon
2016-12-08 16:04:16 +00:00
Colin Walters
7519457382 fetcher: Define an abstraction over SoupURI
This is preparatory work for a potential libcurl backend.

Closes: #616
Approved by: jlebon
2016-12-07 23:00:58 +00:00
Colin Walters
099576ee4a lib: Ensure we use _GNU_SOURCE in enum templates
Due to the way glib-mkenums runs the preprocessor itself, it
doesn't pick up the `AC_USE_SYSTEM_EXTENSIONS()` that we have in
`configure.ac`.

This blew up in an obscure way when I later wanted to `#include
"libglnx.h"` in one of the headers, since it needs the `basename()`
from `string.h` which is only available with `_GNU_SOURCE`.

Closes: #616
Approved by: jlebon
2016-12-07 23:00:58 +00:00
Colin Walters
a2d627352d build: Add more default errors
Newer gcc has `-Wincompatible-pointer-types`, hooray!
Add a few others that we pass today.

Closes: #618
Approved by: jlebon
2016-12-07 16:44:15 +00:00
Colin Walters
daf01b27d4 ci: Make all ci tests gating for Homu
See the rhci docs.

Closes: #617
Approved by: jlebon
2016-12-07 15:42:14 +00:00
Colin Walters
37965644ff tree-wide: Use g_hash_table_add() where applicable
Just noticed a few while reading some code, decided to do a quick
cleanup.  It's shorter and clearer.

Closes: #614
Approved by: jlebon
2016-12-06 17:45:23 +00:00
Colin Walters
247a8718bb lib: Remove unused ostree_metalink_get_uri()
While doing something else I noticed it was unused.

Closes: #615
Approved by: jlebon
2016-12-06 16:27:52 +00:00
Colin Walters
0fb3645fed pull: Write .commitpartial for local pulls first too
This is what we do for non-local (i.e. HTTP) pulls; we wnat to
correctly handle being interrupted during partial pulls.

Closes: https://github.com/ostreedev/ostree/issues/579

Closes: #613
Approved by: jlebon
2016-12-06 16:13:53 +00:00
Colin Walters
4c8fc92aa0 lib: Always checksum content in deltas
This is a follow up to conversation on list - in practice, if we're
backing away from summary signing, then it makes sense to remove the
special casing for checksums in deltas around summary signatures.

This is also related to the recent change to enable GPG checking for
commits in deltas - now we have a more coherent story between the
previous pull path and deltas.

I didn't do any performance checking, and while it's slightly annoying
that we're now doing sha256 on the delta content twice (once for the
part and once per object)...sha256 is pretty fast, I think most users
are I/O bound anyways, and it'd drop even farther if we started using
openssl.

Closes: #612
Approved by: jlebon
2016-12-06 15:59:35 +00:00
Colin Walters
66da1199f0 tests/keyfile-utils: Drop tests covering preconditions
The spam in stderr was bothering me, and further at some eventual
point in the future we want to annotate the functions with
`__attribute__((nonnull))` which would then cause tests like these to
become undefined behavior.

The coverage of this isn't worth the log spam basically.

Closes: #611
Approved by: jlebon
2016-12-06 14:50:08 +00:00
Colin Walters
555f1fb03d tests: Use G_DEBUG=fatal-warnings here too
I am trying to track down a warning I see in `test-keyfile-utils`
which turned out to be the installed case only, but let's inject
this here too.

(The GLib default is broken, but it's hard to fix upstream without
 breaking the world)

Closes: #610
Approved by: jlebon
2016-12-06 14:36:06 +00:00
Colin Walters
e1c48c8adb [ASAN] tests: Cleanup all current remaining leaks
We now run fully through ASAN here.

Closes: #609
Approved by: jlebon
2016-12-05 15:20:56 +00:00
Colin Walters
7bb0ff46a4 Define and use cleanup helpers for libarchive
This should fix some of the ASAN leaks around libarchive usage,
and is generally better.

Closes: #609
Approved by: jlebon
2016-12-05 15:20:56 +00:00
Simon McVittie
c733e21a84 Terminate individual tests after (10 * $TEST_TIMEOUT_FACTOR) minutes
While using the Automake parallel test harness, if a test hangs for
long enough for an external watchdog to kill the entire build process
(as happens in Debian sbuild after 150 minutes with no activity on
stdout/stderr), the logs will not be shown. If we make an individual
test time out sooner, logs are more likely to be shown.

We use SIGABRT so that the process(es) under test will dump core,
allowing the point at which ostree is blocking to be analyzed.
After 1 minute, if any have not died, we kill them again with SIGKILL.

To support slow platforms and slow debugging tools, if
TEST_TIMEOUT_FACTOR is set, multiply the 10 minute timeout by that.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #607
Approved by: cgwalters
2016-12-01 18:22:51 +00:00
Simon McVittie
8162463956 tests: prepend to an existing LD_LIBRARY_PATH, GI_TYPELIB_PATH
If we're using LD_LIBRARY_PATH for some locally-built library, we want
to search those after OSTree's own libraries.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #606
Approved by: cgwalters
2016-12-01 14:23:40 +00:00
Colin Walters
62b94635bc [ASAN] tests: Fix leaks
Just for cleaner sanitizer output.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
667b734c79 [ASAN] set-origin: Squash a leak
Just a minor leak in the commandline.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
161193966c [ASAN] bootconfig: Drop a pointless strdup in parser
Not entirely sure how this was leaking, but anyways it showed
up in ASAN, and it's pointless to strdup here.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
d83d5b4a29 [ASAN] metalink: Fix leaks of buffer
We should be religious about the "only set output variables on
success", otherwise it makes leaks more likely.

But the real leak was us simply not using autoptr in one place.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
1bb6e51486 [ASAN] sysroot: Fix leak/double free of keyfile origin
Use autoptr rather than manual cleanup.  The double free isn't a
security problem, since we trust origin files.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
3a459bac2d traverse: Use g_hash_table_add
And "move semantics" via `g_steal_pointer()`.  Just a minor code
cleanup I noticed when I was hunting for a leak, which ended up being
elsewhere.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
a1224e2de7 [ASAN] cmdline: Fix minor leak in delta cmdline entrypoint
Small, but it's important to stay clean.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
ab0400b722 [ASAN] deltas: Fix minor memory leak
We were leaking the checksum, ensure we free it in both normal and
error paths.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Colin Walters
79cb421ee2 [ASAN] delta compilation: More leak fixes
Now that I remembered to do `env G_SLICE=always-malloc`, lots more
leaks become apparent.  Nothing major.

Closes: #598
Approved by: jlebon
2016-11-30 18:51:26 +00:00
Mario Sanchez Prada
340376e7b1 man: Mention bare-user in manpages, along with the other modes
Closes: #602

Closes: #603
Approved by: cgwalters
2016-11-30 15:47:24 +00:00
Simon McVittie
d1c7eba82c travis-ci: document parameter variables
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
9cbe23f4b7 travis-ci: Enable stretch (the future Debian 9), replacing unstable
My goal in building ostree for Debian unstable was that we would
have good coverage of "new code" paths. However, it was removed
for #571 as too much of a moving target. Debian testing is less of
a moving target, and in particular is always internally consistent
(packages are co-installable), which Debian unstable is not guaranteed
to be.

Debian 'stretch' is the future Debian 9, which should be released
next year.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
0261560b35 travis-ci: Use "slim" Debian image for testing
Documentation and similar files are stripped from this image, making
it quicker to install.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
3d6269ebfb travis-ci: Run make distcheck too
ostree is now actively using that mode.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
a1ab6b50f9 travis-ci: cat the test log after successful test runs
This lets us see which tests were skipped.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
db691b5520 travis-ci: Move helper function to before we start building anything
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
49b8ccd8cb travis-ci: Use a non-ostree-specific name for the Docker image
This reduces the diff when comparing these scripts with similar glue
in dbus or elsewhere.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
0473fb8523 travis-ci: put an explicit copyright/license on the scripts
This is deliberately permissive: a lot of it is generic, and I'm
using similar scripts in dbus.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
9026d5806f ci-install: add ci_distro
Otherwise, we'll fail (due to set -u) if this parameter variable isn't
passed.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
54655795c9 ci-build: consistently use yes/no for booleans, not yes/empty
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Simon McVittie
a73fef3eaa build: clean up ostree-remount if building without systemd
This is necessary for "make distcheck" on Travis-CI.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Closes: #600
Approved by: cgwalters
2016-11-29 14:11:50 +00:00
Alexander Larsson
d57036f6a2 delta compilation: Fix leak
We need to ref-sik the new varian for g_autoptr to work

Closes: #597
Approved by: cgwalters
2016-11-28 16:25:29 +00:00
Alexander Larsson
36f7824cb0 pull: Don't leak delta superblock variants
Closes: #596
Approved by: cgwalters
2016-11-28 15:56:22 +00:00
Alexander Larsson
239cb1494f pull_with_options: Don't leak csum_v
Closes: #596
Approved by: cgwalters
2016-11-28 15:56:22 +00:00
Alexander Larsson
fc107e5bb4 ostree-repo-traverse: Don't leak floating GVariant
ostree_object_name_serialize returns a floating ref, so we need
to sink it before putting in the hashtable.

Closes: #595
Approved by: cgwalters
2016-11-28 14:53:50 +00:00
Alexander Larsson
c9b158e9f2 pull: scan_commit_object() - don't load variant twice
ostree_repo_load_commit already loaded the object, no need
to load it twice.

Closes: #595
Approved by: cgwalters
2016-11-28 14:53:50 +00:00
Jasper St. Pierre
70d140d61c ostree-repo-traverse: Remove an accidental print statement
Closes: #594
Approved by: jlebon
2016-11-23 22:21:16 +00:00
Colin Walters
7584dc0f25 Release 2016.14
Closes: #593
Approved by: jlebon
2016-11-23 16:20:49 +00:00
Abhay Kadam
13360cb1c4 Fix broken link in docs/CONTRIBUTING.md
The link for git-rebase manual contains stray character (])
at the end.

Closes: #592
Approved by: jlebon
2016-11-22 14:00:15 +00:00
Jasper St. Pierre
fd6ba80d07 ostree-repo: Make the lock with a long-lasting FD
glnx_make_lock_file requires that the dfd passed in survives the
lifetime of the lock. Since dfd_iter.fd gets cleaned up after the
function returns, this isn't the case. dfd_iter.fd should be equivalent
to tmpdir_dfd, since we iter on ".", and that survives past the
function, so just use that instead.

Closes: #591
Approved by: cgwalters
2016-11-22 02:32:33 +00:00
Jasper St. Pierre
fbce608177 ostree-repo-static-delta-processing: Don't close(-1)
Ultimately harmless, but causes somewhat scary strace messages.

Closes: #591
Approved by: cgwalters
2016-11-22 02:32:33 +00:00
Jasper St. Pierre
a8f5c20209 ostree-repo: Fix parameter name
Closes: #591
Approved by: cgwalters
2016-11-22 02:32:33 +00:00
Colin Walters
49b8a72622 [ASAN] lib: Squash various leaks in library and commandline
The pull one is the most likely to affect users.  Otherwise mostly
just cleaning up `-fsanitize=address`.

Closes: #587
Approved by: jlebon
2016-11-21 16:34:06 +00:00
Colin Walters
eb7ba645af [ASAN] tests: Fix some memleaks in libarchive importer
Caught by `-fsanitize=address`.

Closes: #587
Approved by: jlebon
2016-11-21 16:34:06 +00:00