Commit Graph

21 Commits

Author SHA1 Message Date
Colin Walters
199ef821c8 ci: Add a codestyle.sh
This matches what we do in rpm-ostree.  Move the `glnx_fd_close`
bits out of `make syntax-check` in preparation for dropping that.
2022-05-31 11:42:42 -04:00
Colin Walters
d72f1684a0 cfg.mk: Don't even look at rust-bindings/
It's really tempting to remove `make syntax-check`, it has very
very rarely found any real problems.

But anyways, just exclude all the binding code because it trips
up random problems we simply don't care about like mentions of
`O_NDELAY` in the `GLib-2.0.gir`.
2022-05-06 16:46:46 -04:00
Luca BRUNO
8ece70b207
templates: add release-checklist
This collects all release steps in a release-checklist template.
2020-11-18 13:05:07 +00:00
Colin Walters
2b78df25f4 tests: Add a test case for path traversal in a dirtree
I was reading about a recent security issue with both EMC and VMWare:
https://arstechnica.com/information-technology/2018/01/emc-vmware-security-bugs-throw-gasoline-on-cloud-security-fire/

It's a classic path traversal problem, and that made me think more about our
handling of this in libostree.  Fortunately of course, not being new to
this rodeo, long ago I *did* consider path traversal.  Inside the pull
code, we call `ot_util_filename_validate()`.  Also, `fsck` does this too.

I have further followups here, but let's add some test cases for this. I crafted
a repository with a `../` in a dirtree object by patching libostree to inject
it, and that's included as a tarball.

This patch covers the two cases where we do already have checks; pulling
via HTTP, and in `fsck`.

Closes: #1412
Approved by: jlebon
2018-01-12 19:38:34 +00:00
Colin Walters
9955695da3 syntax-check: Add a rule to enforce glnx_autofd over glnx_fd_close
And fix the one final use.

Closes: #1280
Approved by: jlebon
2017-10-17 16:43:02 +00:00
Colin Walters
da0791f484 tests: add a syntax-check rule for glnx_prefix_error()
Same as the errno variant; the colon-space `: ` thing got me in a different
patch.

Closes: #956
Approved by: jlebon
2017-06-26 15:09:12 +00:00
Colin Walters
f6255763fd cfg.mk: Add a syntax check for a redundant : in glnx_throw
This is going to be an easy bug to make when porting.

Example spotted by jlebon in 435c2dc35c (diff-dbc2359685171239c4708f2a8f6aa921)

Closes: #752
Approved by: jlebon
2017-03-23 19:09:52 +00:00
Jonathan Lebon
41661e47e1 small cleanups
- Revert 'cannot' --> 'can not' (it's the exception!)
- Remove duplicate function
- Squelch compiler warnings

Closes: #248
Approved by: cgwalters
2016-04-08 18:43:18 +00:00
Giuseppe Scrivano
8ff9a48ce3 cfg.mk: ignore syntax-check for git.mk
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #246
Approved by: cgwalters
2016-04-08 13:32:41 +00:00
Colin Walters
d25212f04a tests: Port to glib-tap.mk, make make check run all of the tests
OSTree's code for testing predates the `glib-tap.mk` making its
way into GLib.  Let's switch to it, as it provides a number
of advantages.

By far the biggest advantage is that `make check` can start to run
most of the tests *in addition* to having them work installed.

This commit keeps the installed tests working, but `make check` turns
out to be really broken because...our TAP usage has bitrotted to say
the least.  Fix that all up.

Do some hacks so that the tests work uninstalled as well - in
particular, `glib-tap.mk` and the bits encoded into
`g_test_build_filename()` assume *recursive* Automake (blah).  Work
around that by creating a symlink when installed to loop back.
2016-03-03 08:50:19 -05:00
Giuseppe Scrivano
82d4e7fe68 Fix make syntax-check
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2016-03-01 10:08:25 -05:00
Giuseppe Scrivano
d0278b6407 build: exclude .sig files from syntax-check
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-03 09:57:20 +02:00
Giuseppe Scrivano
6a3959c895 syntax-check: Remove empty lines at the end of file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-02-02 15:07:56 +01:00
Giuseppe Scrivano
10642cd732 Replace "==" with "=" in shell script test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Giuseppe Scrivano
505ce19972 Do not interleave spaces and tabs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Giuseppe Scrivano
e8cbd4b8c5 Remove magic argument numbers to exit(2)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Giuseppe Scrivano
ea4683ba06 Remove unused <dirent.h>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Giuseppe Scrivano
7154193ae0 Remove unused include <assert.h>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Giuseppe Scrivano
e36d3bb25e syntax-check: quote the first argument to AC_DEFINE
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Giuseppe Scrivano
b726796f41 Remove trailing dot from error message
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00
Giuseppe Scrivano
42e8cd2691 Add infrastructure for "make syntax-check"
New files copied from the gnulib project.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-01-30 15:27:36 +01:00