Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1360199 - Review Request: snap-confine - Confinement system for snap applications
Summary: Review Request: snap-confine - Confinement system for snap applications
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Neal Gompa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1367825
TreeView+ depends on / blocked
 
Reported: 2016-07-26 08:43 UTC by Zygmunt Krynicki
Modified: 2016-08-27 10:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-18 21:18:44 UTC
ngompa13: fedora-review+


Attachments (Terms of Use)

Description Zygmunt Krynicki 2016-07-26 08:43:08 UTC
Spec URL: https://fedorapeople.org/~zyga/snap-confine.spec
SRPM URL: https://fedorapeople.org/~zyga/snap-confine-1.0.38-1.fc24.src.rpm
Description:
The package is used internally by snapd to apply confinement to the started
snap applications.

Fedora Account System Username: zyga

Comment 1 Neal Gompa 2016-07-26 08:44:12 UTC
Taking this review.

Comment 2 Neal Gompa 2016-07-26 08:51:05 UTC
I'd probably suggest that you need to tweak things slightly.

Fedora policy indicates that while private libs can go into %{_libdir}/snapd, helper programs and such should be in %{_libexecdir}/snapd (though %{_libdir}/snapd is allowed if it's not possible to make it work in the preferred path). In Fedora, %{_libexecdir} is defined as /usr/libexec. See the relevant macros for paths here: https://fedoraproject.org/wiki/Packaging:RPMMacros

Relevant guidelines on libexecdir: https://fedoraproject.org/wiki/Packaging:Guidelines#Libexecdir

I suspect that your --libdir is really supposed to be a --libexecdir, since I doubt you're interfacing with snap-confine via a C library to snapd.

Comment 3 Neal Gompa 2016-07-26 08:52:18 UTC
Also, you can replace "make %{?_smp_mflags}" with "%make_build", as it's cleaner and more obvious what it does. :)

Comment 4 Neal Gompa 2016-07-26 08:58:56 UTC
Please fix your file paths to use macros appropriately.

For example, for the udev rules, please use %{_udevrulesdir} instead of /usr/lib/udev/rules.d.

For /usr/lib/udev, just replace /usr with %{_prefix}.

In addition, the inclusion of "systemd" as a BuildRequires is only required when you need to actually run some programs from systemd in the build/test process. Otherwise, systemd-devel should be sufficient.

Comment 5 Zygmunt Krynicki 2016-07-26 09:01:59 UTC
(In reply to Neal Gompa from comment #2)
> I'd probably suggest that you need to tweak things slightly.
> 
> Fedora policy indicates that while private libs can go into
> %{_libdir}/snapd, helper programs and such should be in %{_libexecdir}/snapd
> (though %{_libdir}/snapd is allowed if it's not possible to make it work in
> the preferred path). In Fedora, %{_libexecdir} is defined as /usr/libexec.
> See the relevant macros for paths here:
> https://fedoraproject.org/wiki/Packaging:RPMMacros

I think that *right now* it is irrelevant where snap-confine is, later on snapd will just have to agree as snapd and snap-confine. In other distributions this is done by installing everything to /usr/lib/snapd/*. If that cannot be done due to Fedora policy then it can be anything else as long as the snapd package just agrees on the effective location.

> Relevant guidelines on libexecdir:
> https://fedoraproject.org/wiki/Packaging:Guidelines#Libexecdir
> 
> I suspect that your --libdir is really supposed to be a --libexecdir, since
> I doubt you're interfacing with snap-confine via a C library to snapd.

Yes. Let me tweak this. Thanks for spotting this. I bet it just works because there are no actual libraries and libdir implies setting libexecdir

Comment 6 Zygmunt Krynicki 2016-07-26 09:02:29 UTC
(In reply to Neal Gompa from comment #4)
> Please fix your file paths to use macros appropriately.
> 
> For example, for the udev rules, please use %{_udevrulesdir} instead of
> /usr/lib/udev/rules.d.
> 
> For /usr/lib/udev, just replace /usr with %{_prefix}.

Ack, will do
 
> In addition, the inclusion of "systemd" as a BuildRequires is only required
> when you need to actually run some programs from systemd in the build/test
> process. Otherwise, systemd-devel should be sufficient.

AFAIR I have systemd there because that defines one package config file that contains the location of udev rules directory. Iā€™m sure it is there for a reason.

Comment 7 Neal Gompa 2016-07-26 09:07:39 UTC
If you're depending on pkgconfig things, you can just set BuildRequires to those.

For example: "BuildRequires: pkgconfig(systemd), pkgconfig(libsystemd)" would resolve to the packages containing those pkgconfig files.

Those are the common/canonical names that are the same across all RPM-based distributions. If those don't resolve, they probably don't exist at all.

Comment 8 Neal Gompa 2016-07-26 09:10:08 UTC
(In reply to Zygmunt Krynicki from comment #5)
> (In reply to Neal Gompa from comment #2)
> > I'd probably suggest that you need to tweak things slightly.
> > 
> > Fedora policy indicates that while private libs can go into
> > %{_libdir}/snapd, helper programs and such should be in %{_libexecdir}/snapd
> > (though %{_libdir}/snapd is allowed if it's not possible to make it work in
> > the preferred path). In Fedora, %{_libexecdir} is defined as /usr/libexec.
> > See the relevant macros for paths here:
> > https://fedoraproject.org/wiki/Packaging:RPMMacros
> 
> I think that *right now* it is irrelevant where snap-confine is, later on
> snapd will just have to agree as snapd and snap-confine. In other
> distributions this is done by installing everything to /usr/lib/snapd/*. If
> that cannot be done due to Fedora policy then it can be anything else as
> long as the snapd package just agrees on the effective location.
> 
> > Relevant guidelines on libexecdir:
> > https://fedoraproject.org/wiki/Packaging:Guidelines#Libexecdir
> > 
> > I suspect that your --libdir is really supposed to be a --libexecdir, since
> > I doubt you're interfacing with snap-confine via a C library to snapd.
> 
> Yes. Let me tweak this. Thanks for spotting this. I bet it just works
> because there are no actual libraries and libdir implies setting libexecdir

This stuff is important because the usage of libexecdir automatically marks a package as not multilib safe, which is important for preventing weird things happening when we create the x86_64 repository with multilib support.

Comment 9 Zygmunt Krynicki 2016-07-26 15:01:15 UTC
I've updated packaging to reflect this discussion. I hope I didn't miss anything.

The spec and SRPM file is at the same location as before.

You can have a detailed view of the changes I made here: https://github.com/zyga/snapcore-fedora/commits/master

Comment 10 Neal Gompa 2016-07-26 15:11:55 UTC
If you want, you can also change over the rest of the BRs, too...

glib2-devel -> pkgconfig(glib-2.0)
libseccomp-devel -> pkgconfig(libseccomp)

Otherwise, this looks good to me.

Package approved.

Comment 11 Neal Gompa 2016-07-26 16:12:15 UTC
Actually, there's still something left here...

Comment 12 Neal Gompa 2016-07-26 16:23:20 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- Permissions on files are set properly.
  Note: See rpmlint output
  See: http://fedoraproject.org/wiki/Packaging/Guidelines#FilePermissions
- All build dependencies are listed in BuildRequires, except for any that
  are listed in the exceptions section of Packaging Guidelines.
  See: http://fedoraproject.org/wiki/Packaging/Guidelines#Exceptions_2
- Package uses hardened build flags if required to.
  Note: suid files: snap-confine and not %global _hardened_build
  See:
  http://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Compiler_flags


===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[?]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "MIT/X11 (BSD like)", "GPL (v3)", "Unknown or generated". 30
     files have unknown license. Detailed output of licensecheck in
     /home/makerpm/1360199-snap-confine/licensecheck.txt
[-]: License file installed when any subpackage combination is installed.
[!]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/libexec/snapd
[?]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/lib/udev,
     /usr/libexec/snapd, /usr/lib/udev/rules.d
[-]: Package does not own files or directories owned by other packages.
     Note: Dirs in package are owned also by:
     /usr/share/man/man5(filesystem), /usr/share/man/man1(filesystem)
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 2 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: Package contains systemd file(s) if in need.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[!]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in snap-
     confine-debuginfo
[x]: Package functions as described.
[x]: Latest version is packaged.
[-]: Package does not include license text files separate from upstream.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[?]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Package should not use obsolete m4 macros
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: snap-confine-1.0.38-1.fc23.x86_64.rpm
          snap-confine-debuginfo-1.0.38-1.fc23.x86_64.rpm
          snap-confine-1.0.38-1.fc23.src.rpm
snap-confine.x86_64: E: missing-call-to-setgroups-before-setuid /usr/libexec/snapd/snap-confine
snap-confine.x86_64: W: only-non-binary-in-usr-lib
snap-confine.x86_64: E: setuid-binary /usr/libexec/snapd/snap-confine root 4755
snap-confine.x86_64: E: non-standard-executable-perm /usr/libexec/snapd/snap-confine 4755
snap-confine.x86_64: E: standard-dir-owned-by-package /usr/share/man/man5
snap-confine.x86_64: E: standard-dir-owned-by-package /usr/share/man/man1
snap-confine.src: W: spelling-error %description -l en_US snapd -> snaps, snap, snap d
snap-confine.src:19: W: mixed-use-of-spaces-and-tabs (spaces: line 19, tab: line 1)
snap-confine.src: W: invalid-url Source0: https://github.com/snapcore/snap-confine/releases/download/1.0.38/snap-confine-1.0.38.tar.gz HTTP Error 403: Forbidden
3 packages and 0 specfiles checked; 5 errors, 4 warnings.




Rpmlint (debuginfo)
-------------------
Checking: snap-confine-debuginfo-1.0.38-1.fc23.x86_64.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.





Rpmlint (installed packages)
----------------------------
sh: /usr/bin/python: No such file or directory
snap-confine.x86_64: E: missing-call-to-setgroups-before-setuid /usr/libexec/snapd/snap-confine
snap-confine.x86_64: W: only-non-binary-in-usr-lib
snap-confine.x86_64: E: standard-dir-owned-by-package /usr/share/man/man1
snap-confine.x86_64: E: standard-dir-owned-by-package /usr/share/man/man5
snap-confine.x86_64: E: setuid-binary /usr/libexec/snapd/snap-confine root 4755
snap-confine.x86_64: E: non-standard-executable-perm /usr/libexec/snapd/snap-confine 4755
2 packages and 0 specfiles checked; 5 errors, 1 warnings.



Requires
--------
snap-confine-debuginfo (rpmlib, GLIBC filtered):

snap-confine (rpmlib, GLIBC filtered):
    /bin/sh
    libc.so.6()(64bit)
    libgcc_s.so.1()(64bit)
    libgcc_s.so.1(GCC_3.0)(64bit)
    libgcc_s.so.1(GCC_3.3.1)(64bit)
    libseccomp.so.2()(64bit)
    libudev.so.1()(64bit)
    libudev.so.1(LIBUDEV_183)(64bit)
    rtld(GNU_HASH)



Provides
--------
snap-confine-debuginfo:
    snap-confine-debuginfo
    snap-confine-debuginfo(x86-64)

snap-confine:
    snap-confine
    snap-confine(x86-64)



Source checksums
----------------
https://github.com/snapcore/snap-confine/releases/download/1.0.38/snap-confine-1.0.38.tar.gz :
  CHECKSUM(SHA256) this package     : e50d80ac62ca636a2fbfa45072733d9bd224357c856396f59f67f8ab482a2724
  CHECKSUM(SHA256) upstream package : e50d80ac62ca636a2fbfa45072733d9bd224357c856396f59f67f8ab482a2724


Generated by fedora-review 0.6.1 (f03e4e7) last change: 2016-05-02
Command line :/usr/bin/fedora-review -b 1360199
Buildroot used: fedora-23-x86_64
Active plugins: Generic, Shell-api, C/C++
Disabled plugins: Java, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP
Disabled flags: EXARCH, DISTTAG, EPEL5, BATCH, EPEL6

Comment 13 Zygmunt Krynicki 2016-08-16 11:05:56 UTC
Hey Neal.

I've updated snap-confine, I believe most of the issues are now solved.

The updated spec file is: https://fedorapeople.org/~zyga/snap-confine.spec

SRPM with a patch inside: https://fedorapeople.org/~zyga/snap-confine-1.0.39-1.fc24.src.rpm

Please let me know if I need to adjust anything else.

Comment 14 Neal Gompa 2016-08-16 12:49:12 UTC
Two issues remaining:

* The license file isn't included in the package. The license file must be included using the %license macro. It works the same way as %doc, except since it isn't noted as a doc file, you can't tell RPM/DNF to not install it. So in the case of snap-confine, you need a "%license COPYING" in the file list section.

* Replace the ".gz" with ".*" for man pages in the file list. It is possible in the future that Fedora may change the compression format for man pages (to xz or something like that). Changing this will future-proof it for such changes.

Comment 15 Zygmunt Krynicki 2016-08-16 12:59:16 UTC
Ah, I used %doc out of habit. Updated the .spec file (I didn't push the SRPM again since I'm on capped network).

The updated spec file is: https://fedorapeople.org/~zyga/snap-confine.spec

Comment 16 Neal Gompa 2016-08-16 13:01:15 UTC
Package approved.

Comment 17 Gwyn Ciesla 2016-08-16 13:33:11 UTC
Package request has been approved: https://admin.fedoraproject.org/pkgdb/package/rpms/snap-confine

Comment 18 Fedora Update System 2016-08-17 10:48:41 UTC
snap-confine-1.0.39-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f59098b44e

Comment 19 Fedora Update System 2016-08-17 11:17:46 UTC
snap-confine-1.0.39-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f59098b44e

Comment 20 Fedora Update System 2016-08-17 12:26:18 UTC
snap-confine-1.0.39-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c5556c3bef

Comment 21 Fedora Update System 2016-08-17 12:26:53 UTC
snap-confine-1.0.39-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-939c94b72e

Comment 22 Fedora Update System 2016-08-17 19:53:27 UTC
snap-confine-1.0.39-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c5556c3bef

Comment 23 Fedora Update System 2016-08-18 01:51:15 UTC
snap-confine-1.0.39-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-f59098b44e

Comment 24 Fedora Update System 2016-08-18 01:51:52 UTC
snap-confine-1.0.39-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-939c94b72e

Comment 25 Fedora Update System 2016-08-18 21:18:41 UTC
snap-confine-1.0.39-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2016-08-18 23:18:32 UTC
snap-confine-1.0.39-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2016-08-27 10:26:25 UTC
snap-confine-1.0.39-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.