/var/db/pkg/<category>/<package>/CONTENTS contains 3 object types: dir, obj, sym. For type "dir", it has only a "path" property. For type "obj", which represents a file, it has property "path", "md5 checksum" and "mtime" For type "sym", it has property "path" and "mtime". My request is to add new properties for these object types: 1. "dir": add owner, group, permission 2. "obj": add owner, group, permission 3. "sym": add owner, group Reproducible: Always
What's the use for this? Note that if you use emerge --buildpkg, those file attributes are available in the tbz2 files.
I have a post on gentoo forum about this thought before: https://forums.gentoo.org/viewtopic-t-946868-highlight-fpemud.html I think with these additional properties, CONTENTS file can be a more accurate representation of the package status. I'm willing to contribute. CORRECTION: For type "sym", it has property "path" and "mtime". => For type "sym", it has property "path", "target" and "mtime".
(In reply to Zac Medico from comment #1) > What's the use for this? Note that if you use emerge --buildpkg, those file > attributes are available in the tbz2 files. For me, I want to use these information to check if any of the installed files are modified by mistake, either content, permission or owner/group. It is not enough for intrusion detection, but is enough for misoperation detection. tbz2 files are big.
I'd like to express interest in this as well. Checking integrity of configuration files is (sorta kinda) covered with the md5sums. Checking confidentiality of configuration files is currently hard to do correctly, as there is no way to determine the baseline of what it should be. To me, using buildpkgs doesn't sound very elegant. The point of the CONTENTS file is that you don't have to reconstruct everything, but rather portage exports once allowing for easy access later.