Bug 878660 - Review Request: openshift-origin-node-util - Utility scripts for the OpenShift Origin node
Review Request: openshift-origin-node-util - Utility scripts for the OpenShif...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Michael Scherer
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-20 16:35 EST by Troy Dawson
Modified: 2013-01-11 18:22 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-11 18:21:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
misc: fedora‑review+
limburgher: fedora‑cvs+


Attachments (Terms of Use)

  None (edit)
Description Troy Dawson 2012-11-20 16:35:27 EST
Spec URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util.spec
SRPM URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util-1.1.6-2.fc18.src.rpm
Description: This package contains a set of utility scripts for a openshift node.
They must be run on a openshift node instance.

Fedora Account System Username: tdawson maxamillion
Comment 1 Troy Dawson 2012-11-20 16:39:50 EST
RPMLINT OUTPUT:
$ rpmlint openshift-origin-node-util.spec openshift-origin-node-util-1.1.6-2.fc18.src.rpm openshift-origin-node-util-1.1.6-2.fc18.noarch.rpm
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-restorer-wrapper.sh 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-idler-stats 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-list-access 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-init-quota 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-last-access 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-app-idle 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-restorer 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-idler 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-admin-ctl-gears 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-setup-node 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-accept-node 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-list-stale 0754L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-autoidler 0754L
2 packages and 1 specfiles checked; 13 errors, 0 warnings.

The scripts marked 754 are owned by root, with a group of root.  It would be best if non-root users were not able to run these.
Although I could not find anything in the Fedora packaging guidelines that stated all scripts must be run by everyone.  I also could not find a way to tell rpmlint to not worry about it.
So, I am commenting here, that those settings are the way upstream wants them.  If anything, they would like 750.
Comment 2 Michael Scherer 2012-11-23 12:17:02 EST
I fail to understand. If the user should not run those script, why are they readable ? ( cause you can just do "ruby /usr/sbin/oo-list-stale" or equivalent to run them as user ). I would even add that you can just get the source code from git and run them.
Comment 3 Michael Scherer 2012-11-23 12:57:44 EST
There is also some missing requires :
- lsof, for rhc-list-ports
- policycoreutils for oo-setup-node 
- system-config-firewall-base for oo-setup-node ( not sure if that's installed by default )
- quota, for oo-setup-node
- curl, for oo-list-access
- git, for oo-idler-stats ( and that also pull perl, needed for some shell script )
- libcgroup-tools, for lscgroup in oo-accept-node
Comment 4 Troy Dawson 2012-11-24 11:18:57 EST
I will work on the dependancies.

It was hard to tell from Comment 2 what you felt the attr settings should be.
Do you feel they should be 0750?  If so, I understand your reasoning.  If the user can see them, they can run them.

I don't mind either way.  I just wish rpmlint wouldn't through those as errors, they should be warnings.
Comment 5 Michael Scherer 2012-11-24 19:54:41 EST
Well, in fact, since that's free software, the user can see them. So I would use a regular 755, but maybe upstream has specific reason that I missed.

If the user can run ruby, we can imagine simply doing cut and paste of the code with ssh or curl or whatever, so even setting that as 750 would not protect against running the code.

Could you see with upstream on why they want to have such permission ?
Comment 6 Troy Dawson 2012-12-04 18:15:22 EST
Spec URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util.spec
SRPM URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util-1.1.6-3.fc18.src.rpm

I think we have everything.

Dependancies:
  lsof - Added
  policycoreutils - Added
  system-config-firewall-base - Added
  quota - Added
  curl - not added (needed by rpm, should be installed by default)
  git - Added
  libcgroup-tools - Added

File Permissions:
Talked to upstream.  They would like the files they previously marked as 0750 to remain that way.  They want those files to only be ran as root and this is to discourage regular users from running them.  True, they can just get the code and try it, but the 0750 settings will discourage someone from just doing a "ruby blah" and running the script.
I have set the file permissions back to what Upstream had.
Comment 7 Michael Scherer 2012-12-15 12:27:10 EST
The files are already in /sbin, so if people do not understand that it would not work, I think there is a problem. Anyway, if upstream want this way.


Now, why is there this in %post :
/sbin/restorecon /usr/sbin/oo-restorer* || :

This look like a work around some selinux integration bug or something like that, and this doesn't belong to the package ( IMHO ). However, I may have missed something, so can you explain ?

There is a few issues :
- it should IMHO be updated to the latest version ( due to bug I reported )
- there is macros missing for systemd integration

Package Review
==============

Key:
[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
- No macro for systemd integration in %post ( https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd )
- Not the latest version ( especially due to https://bugzilla.redhat.com/show_bug.cgi?id=880699 )

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

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.
[x]: Package contains no bundled libraries without FESCO 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 requires other packages for directories it uses.
[x]: Package uses nothing in %doc for runtime.
[x]: Package is not known to require ExcludeArch.
[!]: Package complies to the Packaging Guidelines
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses found:
     "Unknown or generated". 1 files have unknown license. Detailed output of
     licensecheck in /home/misc/checkout/git/FedoraReview/878660-openshift-
     origin-node-util/licensecheck.txt
[x]: Package consistently uses macro is (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
     Note: Package contains no Conflicts: tag(s)
[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]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Large documentation must go in a -doc subpackage.
     Note: Documentation size is 10240 bytes in 2 files.
[x]: All build dependencies are listed in BuildRequires, except for any that
     are listed in the exceptions section of Packaging Guidelines.
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Each %files section contains %defattr if rpm < 4.4
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Package does not contain duplicates in %files.
[x]: Fully versioned dependency in subpackages, if present.
[x]: Spec file lacks Packager, Vendor, PreReq tags.
[x]: 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 %doc.
[x]: Package is named using only allowed ASCII characters.
[x]: Package do not use a name that already exist
[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]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local
[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).

===== 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 (rpm -q --provides and rpm -q
     --requires).
[x]: Package functions as described.
[!]: Latest version is packaged.
[x]: 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.
[x]: 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]: Dist tag is present.
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: SourceX tarball generation or download is documented.
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define.

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

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


Rpmlint
-------
Checking: openshift-origin-node-util-1.1.6-3.fc18.noarch.rpm
openshift-origin-node-util.noarch: E: explicit-lib-dependency libcgroup-tools
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-restorer-wrapper.sh 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-restorer-wrapper.sh 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-idler-stats 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-idler-stats 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-list-access 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-list-access 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-init-quota 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-init-quota 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-last-access 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-last-access 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-app-idle 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-app-idle 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-restorer 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-restorer 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-idler 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-idler 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-admin-ctl-gears 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-admin-ctl-gears 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-setup-node 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-setup-node 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-accept-node 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-accept-node 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-list-stale 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-list-stale 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-autoidler 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-autoidler 0750L
1 packages and 0 specfiles checked; 27 errors, 0 warnings.




Rpmlint (installed packages)
----------------------------
# rpmlint openshift-origin-node-util
openshift-origin-node-util.noarch: E: explicit-lib-dependency libcgroup-tools
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-restorer-wrapper.sh 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-restorer-wrapper.sh 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-idler-stats 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-idler-stats 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-list-access 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-list-access 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-init-quota 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-init-quota 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-last-access 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-last-access 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-app-idle 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-app-idle 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-restorer 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-restorer 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-idler 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-idler 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-admin-ctl-gears 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-admin-ctl-gears 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-setup-node 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-setup-node 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-accept-node 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-accept-node 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-list-stale 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-list-stale 0750L
openshift-origin-node-util.noarch: E: non-readable /usr/sbin/oo-autoidler 0750L
openshift-origin-node-util.noarch: E: non-standard-executable-perm /usr/sbin/oo-autoidler 0750L
1 packages and 0 specfiles checked; 27 errors, 0 warnings.
# echo 'rpmlint-done:'



Requires
--------
openshift-origin-node-util (rpmlib, GLIBC filtered):
    /bin/bash
    /bin/sh
    /usr/bin/env
    config(openshift-origin-node-util)
    git
    httpd
    libcgroup-tools
    lsof
    oddjob
    php
    policycoreutils
    quota
    rng-tools
    rubygem-openshift-origin-node
    system-config-firewall-base



Provides
--------
openshift-origin-node-util:
    config(openshift-origin-node-util)
    openshift-origin-node-util



MD5-sum check
-------------
http://mirror.openshift.com/pub/openshift-origin/source/openshift-origin-node-util/openshift-origin-node-util-1.1.6.tar.gz :
  CHECKSUM(SHA256) this package     : d1482914c791825e6b31f856e3a39b213381e343bd429ad3b95a446f86b2d401
  CHECKSUM(SHA256) upstream package : d1482914c791825e6b31f856e3a39b213381e343bd429ad3b95a446f86b2d401


Generated by fedora-review 0.2.0 (Unknown) last change: Unknown
Buildroot used: fedora-18-x86_64
Command line :./try-fedora-review -b 878660
Comment 8 Troy Dawson 2012-12-18 15:59:35 EST
Spec URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util.spec
SRPM URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util-1.2.7-2.fc18.src.rpm

- Updated to 1.2.7, the latest stable release, which also has your patches in it.
- This release has the systemd macros
- I have verified (as you did) that the %post script 
/sbin/restorecon /usr/sbin/oo-restorer*
  isn't needed on Fedora, and have removed it.  I will check with upstream to see if it is possibly needed in RHEL.  If so, we'll have it in an %if statement.  If not, we'll remove it.
Comment 9 Michael Scherer 2012-12-18 16:36:40 EST
Sorry, I was not clear when i said macro for systemd, i wanted to speak about %post macros :
https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
Comment 10 Troy Dawson 2012-12-18 17:43:57 EST
Spec URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util.spec
SRPM URL: http://tdawson.fedorapeople.org/openshift-origin/openshift-origin-node-util-1.2.7-3.fc18.src.rpm

I had totally forgot about the systemd scripts.  They are in there now, as well as a cleaner %if statement for checking for systemd.
Comment 11 Michael Scherer 2012-12-30 10:18:21 EST
Ok, so forgot this review before leaving for the winter break. The package is good, so it is approved.
Comment 12 Troy Dawson 2013-01-02 10:21:49 EST
New Package SCM Request
=======================
Package Name: openshift-origin-node-util
Short Description: Utility scripts for the OpenShift Origin node
Owners: tdawson maxamillion
Branches: f18 f17
InitialCC:
Comment 13 Jon Ciesla 2013-01-02 10:29:37 EST
Git done (by process-git-requests).
Comment 14 Fedora Update System 2013-01-02 11:07:49 EST
openshift-origin-node-util-1.2.7-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/openshift-origin-node-util-1.2.7-3.fc18
Comment 15 Fedora Update System 2013-01-02 15:20:16 EST
openshift-origin-node-util-1.2.7-3.fc18 has been pushed to the Fedora 18 testing repository.
Comment 16 Fedora Update System 2013-01-11 18:22:00 EST
openshift-origin-node-util-1.2.7-3.fc18 has been pushed to the Fedora 18 stable repository.

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