1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-12-21 13:26:30 +00:00
Commit graph

341 commits

Author SHA1 Message Date
Aleksa Sarai
f9adee80f4
keywords: encode xattr.* keywords with Vis
This allows for xattr keywords to include spaces and other such options
(which is perfectly valid according to the definition of Lsetxattr --
any character except '\x00' is fair game).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-01-17 00:46:24 +11:00
94d7041e8e Merge pull request #108 from cyphar/107-xattr-always-diff
compare: always diff "xattr" keys
2017-01-16 07:32:03 -05:00
Aleksa Sarai
ad35cae482
compare: always diff "xattr" keys
Because of how xattr works (it will not be set on all files, but it's
possible for it to be added to a file without changing any other key)
it's necessary that we _always_ compute a diff when we hit an inode that
has xattr keys set.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-17 20:14:17 +11:00
0dc720e861 Merge pull request #96 from cyphar/add-unpriv-walking
walk: implement "unprivileged manifest generation"
2016-12-14 13:32:14 -05:00
Aleksa Sarai
08004a9a8c
fseval: add tests for FsEval
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-14 17:14:51 +11:00
Aleksa Sarai
e22043cb86
walk: implement FsEval hooks
In certain circumstances (such as the manifest generation of a
filesystem as an unprivileged user) it is important to provide hooks
that override the default os.* implementation of filesystem-related
functions.

In order to avoid merging too much code from outside projects (such as
umoci) this is implemented by providing FsEval hooks to Walk() and
Check(). This allows for users of go-mtree to modify how filesystem
checks are done, without compromising the simplicity of go-mtree's code.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-14 16:26:31 +11:00
Aleksa Sarai
98824a87da
check: simplify Compare
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-12-14 16:26:14 +11:00
d42d5761a6
version: back to dev
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-08 15:16:57 -05:00
58660bbd83
version: make this v0.3.0
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-08 15:15:21 -05:00
556bb352d2 Merge pull request #105 from vbatts/compare_test_openbsd
compare: make the test output more readable
2016-12-08 09:59:00 -05:00
d857d58104 compare: make the test output more readable
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-08 08:26:05 -05:00
26ccc7a48c Merge pull request #104 from vbatts/multiple_builds_test
make: build for several platfom/arches
2016-12-07 22:17:11 -05:00
f15c0ad821 keywords: fix keyword failure for windows
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-07 22:10:00 -05:00
9fc0375857 make: build for several platfom/arches
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-07 21:59:17 -05:00
0b88377e28 Merge pull request #103 from vbatts/xattr_lint
xattr: the unsupported features weren't linted
2016-12-07 20:11:26 -05:00
1f7a3d3784 xattr: the unsupported features weren't linted
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-07 20:07:59 -05:00
ca8faa91ae Merge pull request #102 from vbatts/tags_target
make: add a specific target for tags
2016-12-07 20:07:52 -05:00
83dff044b3 make: add a specific target for tags
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-07 20:03:41 -05:00
e2575bffa5 Merge pull request #101 from vbatts/golang_vis
Golang implementation of vis() and unvis()
2016-12-07 16:28:06 -05:00
05a295f267
test: discovered vet issue, masked by tags
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-07 16:26:04 -05:00
812981d95d
vis: switch to the golang vis by default
and have the C vis()/unvis() available as a 'cvis' build tag.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-07 16:16:30 -05:00
08b1000418
vis: adding a pure golang Vis()
The current Vis() and Unvis() are using the C implementation from
MTREE(8).

But that means that cgo is used, which is not always desired.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-12-07 16:12:28 -05:00
e42c679e89 Merge pull request #100 from vbatts/test
cli.test: add case from #90
2016-11-30 21:50:47 -05:00
e2640e6dfa
cli.test: add case from #90
Closes #90

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-30 21:41:39 -05:00
efe17f56ae Merge pull request #99 from vbatts/cli.test
cli.test: fail on cli tests
2016-11-29 13:59:59 +00:00
f49f66f61e
cli.test: fail on cli tests
This cleans up the Makefile target, and drops the dependency to point to
the $root path of the repo.

Fixes https://github.com/vbatts/go-mtree/issues/98

Reported-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-22 10:57:47 -05:00
13131d516b Merge pull request #97 from vbatts/carry_pr91
cmd/gomtree/main.go: Handle Extra and Missing cases
2016-11-18 10:28:15 -05:00
Brent Baude
1b0ba0d70f cmd/gomtree/main.go: Handle Extra and Missing cases
The BSD format needed a slight tweak to handle mtree.Extra
and mtree.Missing cases.  It currently only handled the 'Modified'
cases and therefore was not showing missing or extra files during
validation.
2016-11-18 09:55:27 -05:00
b6ed8e415d Merge pull request #95 from vbatts/carry_pr87
entries: comment with keyword metadata
2016-11-17 23:51:58 -05:00
Aleksa Sarai
408b615c3c entries: comment with keyword metadata
Since not every keyword applies to every type entry, include a comment
with the keywords the manifest was generated with.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-17 23:45:45 -05:00
a6df651d88 Merge pull request #94 from vbatts/readme
README: add info on running the tests
2016-11-17 23:29:08 -05:00
68a1a615b9 README: add info on running the tests
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-18 04:25:16 +00:00
71b81f3ced Merge pull request #88 from vbatts/xattr_bsd
xattr: tests for non-linux
2016-11-17 23:18:44 -05:00
81e5c5c8f0 Merge pull request #93 from vbatts/flags
Exclude non-directories
2016-11-17 22:47:36 -05:00
e76196a6d6 xattr: tests for non-linux
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-18 03:47:11 +00:00
c0a5cb25ec
-d: exclude non-directories
Adding flag, and supporting functionality for exluding entries that are
non-directories

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-17 22:43:02 -05:00
353436a031
main: group flag variables
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-17 22:00:23 -05:00
f51a3381de Merge pull request #92 from vbatts/keyword
Keyword overhaul
2016-11-17 21:58:04 -05:00
21723a3974
*: fix comparison of missing keywords
Adding another test validated from the FreeBSD workflow.

Just because the keywords requested to be validated are not present in
the manifest, it is not an error.
Also, if the keywords from a new manifest are not present in a prior
manifest, then only compare the common keywords.

Fixes https://github.com/vbatts/go-mtree/issues/86

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-17 21:38:10 -05:00
4eec68be4b
*: make Keyword and KeyVal pervasive
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-17 21:38:01 -05:00
5d26726bb1
keyword: unify keyword synonyms
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-16 15:42:53 -05:00
627c6e9ddd
DirectoryHierarchy: UsedKeywords is a of the struct
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-16 14:43:05 -05:00
a8e4475c5e
*: clean up
* Get rid of the isErr func in main()
* put main() logic closer to the top

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-11-16 14:22:12 -05:00
690c85d4e8 Merge pull request #48 from cyphar/core-manifest-diff
mtree: implement manifest comparisons
2016-11-11 12:01:49 -05:00
0fd0d3ed55 Merge pull request #85 from cyphar/fix-symlink-keyword
keywords: safely encode symlink keywords
2016-11-11 11:54:06 -05:00
Aleksa Sarai
704d91fc7c
keywords: safely encode symlink keywords
symlink(2) is a very dumb syscall, and allows you to put any damn value
you please inside a symlink. In addition, spaces are valid path
characters which causes issues with keyword parsing. So use Vis() and
Unvis() to safely store an encoded version of the path.

This also adds a cli test for this behaviour.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-11-12 01:52:37 +11:00
Aleksa Sarai
3bfdecf467
gomtree: add special cases for tar generation checking
Due to several unsolveable problems in tar generation, such as the
size=... keyword, we have to special case quite a few things in the
checking code. We might want to move this to mtree properly (but I'm
hesitant about ignoring errors that only happen for tar DHes).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-11-10 12:41:23 +11:00
Aleksa Sarai
d214ab47e8
check: re-implement *Check() using Compare()
This removes all of the special handling code for both TarCheck() and
Check() so that everything now uses the new (generic) Compare() code. In
addition, the tests had to be modified to reflect the new classes of
errors.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-11-10 11:30:06 +11:00
Aleksa Sarai
c4be8dfe32
compare: implement proper testing with tar
While the full testing is broken due to bugs in the tar DH generator, we
ignore known bugs in the tar generator to at least allow us to test some
of the other semantics of Compare.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-11-10 11:30:06 +11:00
Aleksa Sarai
d7f49531f8
gomtree: switch to using compare
Switch the commandline to use the .Compare() API when checking
specification files against the state of a tar archive or other archive.
The main purpose is to completely remove the check.go code from being
necessary (outside of a wrapper).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-11-10 11:30:06 +11:00