Bug 1062911 - Review Request: srcpd - Simple Railroad Command Protocol (SRCP) server
Summary: Review Request: srcpd - Simple Railroad Command Protocol (SRCP) server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Christopher Meng
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-08 14:40 UTC by Denis Fateyev
Modified: 2014-09-09 22:22 UTC (History)
4 users (show)

Fixed In Version: srcpd-2.1.2-4.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-16 03:52:18 UTC
Type: ---
Embargoed:
i: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)
Changes exclude arch to exclusive arch (1.19 KB, patch)
2014-06-30 09:43 UTC, Jakub Čajka
no flags Details | Diff

Description Denis Fateyev 2014-02-08 14:40:07 UTC
Spec URL: http://www.fateyev.com/RPMS/Fedora20/testing/srcpd.spec
SRPM URL: http://www.fateyev.com/RPMS/Fedora20/testing/SRPMS/srcpd-2.1.2-1.fc20.denf.src.rpm
Description: Simple Railroad Command Protocol (SRCP) is a communication protocol designed to integrate various models of railroad systems. The srcpd acts a gateway between any kind of model railway systems and user interface programs that support SRCP. IANA assigned TCP port 4303 to it.
Fedora Account System Username: dfateyev

Note: I disabled RHEL5 and 6 PPC builds, it seems that the software doesn't build and work correctly on ppc.

Koji scratch builds:
https://koji.fedoraproject.org/koji/taskinfo?taskID=6506767 (Rawhide)
https://koji.fedoraproject.org/koji/taskinfo?taskID=6506761 (EPEL 6)
https://koji.fedoraproject.org/koji/taskinfo?taskID=6506755 (EPEL 5)

Comment 1 Volker Fröhlich 2014-02-09 17:13:27 UTC
Did you leave out README.loconet and README.selectrix on purpose?

You can remove %defattr(-,root,root,-). It's not required in EPEL 5.

I think you can remove the {?el5} constructions. While the covered elements are no longer necessary in later distribution releases, they don't do any harm either.

Comment 2 Denis Fateyev 2014-02-09 22:29:06 UTC
(In reply to Volker Fröhlich from comment #1)
> Did you leave out README.loconet and README.selectrix on purpose?

I found them not really informative, don't remember why.. I can add them back though.

> You can remove %defattr(-,root,root,-). It's not required in EPEL 5.

Well, in contrary I think it can be useful for EPEL5. Guidelines says that it's no longer needed for rpm >= 4.4, but it doesn't break things either.
 
> I think you can remove the {?el5} constructions. While the covered elements
> are no longer necessary in later distribution releases, they don't do any
> harm either.

No, I think we can't since I'm planning to package for EPEL5. Such packages require "BuildRoot" tag,"%clean" section, and so on: https://fedoraproject.org/wiki/Packaging:Guidelines#BuildRoot_tag

Comment 3 Volker Fröhlich 2014-02-10 07:00:39 UTC
Ad EL5: You got me the wrong way around: I meant you don't have to make them conditional:

"clean section" instead of "if el5; then clean section; endif"

Comment 4 Christopher Meng 2014-02-10 07:01:56 UTC
I just asked this question in packaging about udev rules:

https://lists.fedoraproject.org/pipermail/packaging/2014-February/010013.html

Comment 5 Denis Fateyev 2014-02-10 14:08:58 UTC
(In reply to Volker Fröhlich from comment #3)
> Ad EL5: You got me the wrong way around: I meant you don't have to make them
> conditional:
> 
> "clean section" instead of "if el5; then clean section; endif"

Achso.. but I don't see what's wrong with the current version with conditionals, anyway. Seems wrapping into conditionals looks more logical for recent Fedora.

(In reply to Christopher Meng from comment #4)
> I just asked this question in packaging about udev rules:
> 
> https://lists.fedoraproject.org/pipermail/packaging/2014-February/010013.html

Yes, thanks, better to clarify this moment. I haven't found any good and recent guideline on that.

Comment 6 Denis Fateyev 2014-02-11 22:16:43 UTC
Missing README files are included, "%find_lang" introduced for all builds but RHEL5. As for "udev", I can unclude that macro but according the discussion in the list seems nobody minds of including this file as is.

Spec URL: http://www.fateyev.com/RPMS/Fedora20/testing/srcpd.spec
SRPM URL: http://www.fateyev.com/RPMS/Fedora20/testing/SRPMS/srcpd-2.1.2-1.fc20.src.rpm

Koji scratch builds:
https://koji.fedoraproject.org/koji/taskinfo?taskID=6519038 (Rawhide)
https://koji.fedoraproject.org/koji/taskinfo?taskID=6519035 (EPEL 6)
https://koji.fedoraproject.org/koji/taskinfo?taskID=6519029 (EPEL 5)

Comment 7 Christopher Meng 2014-02-13 13:53:03 UTC
Taken.

Comment 8 Christopher Meng 2014-02-14 03:38:02 UTC
Package Review
==============

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



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

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[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.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses found:
     "GPL (v2)", "*No copyright* GPL (v2 or later)", "GPL (v2 or later)",
     "Unknown or generated". 46 files have unknown license. Detailed output of
     licensecheck:

*No copyright* GPL (v2 or later)
--------------------------------
srcpd-2.1.2/src/i2c-dev.c
srcpd-2.1.2/src/i2c-dev.h
srcpd-2.1.2/src/syslogmessage.c
srcpd-2.1.2/src/syslogmessage.h

GPL (v2 or later)
-----------------
srcpd-2.1.2/src/config-srcpd.h
srcpd-2.1.2/src/ddl-s88.c
srcpd-2.1.2/src/ddl-s88.h
srcpd-2.1.2/src/hsi-88.c
srcpd-2.1.2/src/hsi-88.h
srcpd-2.1.2/src/ib.c
srcpd-2.1.2/src/ib.h
srcpd-2.1.2/src/io.c
srcpd-2.1.2/src/io.h
srcpd-2.1.2/src/li100-main.c
srcpd-2.1.2/src/li100.c
srcpd-2.1.2/src/li100.h
srcpd-2.1.2/src/srcp-info.c
srcpd-2.1.2/src/srcp-info.h
srcpd-2.1.2/src/srcp-session.c
srcpd-2.1.2/src/srcp-session.h
srcpd-2.1.2/src/srcp-sm.c
srcpd-2.1.2/src/srcp-sm.h
srcpd-2.1.2/src/srcpd.c
srcpd-2.1.2/src/ttycygwin.c
srcpd-2.1.2/src/ttycygwin.h

GPL (v2)
--------
srcpd-2.1.2/src/dcc-address.c
srcpd-2.1.2/src/dcc-address.h
srcpd-2.1.2/src/zimo.c

Unknown or generated
--------------------
srcpd-2.1.2/src/clientservice.c
srcpd-2.1.2/src/clientservice.h
srcpd-2.1.2/src/config-srcpd.c
srcpd-2.1.2/src/ddl.c
srcpd-2.1.2/src/ddl.h
srcpd-2.1.2/src/ddl_maerklin.c
srcpd-2.1.2/src/ddl_maerklin.h
srcpd-2.1.2/src/ddl_nmra.c
srcpd-2.1.2/src/ddl_nmra.h
srcpd-2.1.2/src/loconet.c
srcpd-2.1.2/src/loconet.h
srcpd-2.1.2/src/loopback.c
srcpd-2.1.2/src/loopback.h
srcpd-2.1.2/src/m605x.c
srcpd-2.1.2/src/m605x.h
srcpd-2.1.2/src/netservice.c
srcpd-2.1.2/src/netservice.h
srcpd-2.1.2/src/portio.c
srcpd-2.1.2/src/portio.h
srcpd-2.1.2/src/selectrix.c
srcpd-2.1.2/src/selectrix.h
srcpd-2.1.2/src/srcp-command.c
srcpd-2.1.2/src/srcp-command.h
srcpd-2.1.2/src/srcp-descr.c
srcpd-2.1.2/src/srcp-descr.h
srcpd-2.1.2/src/srcp-error.c
srcpd-2.1.2/src/srcp-error.h
srcpd-2.1.2/src/srcp-fb.c
srcpd-2.1.2/src/srcp-fb.h
srcpd-2.1.2/src/srcp-ga.c
srcpd-2.1.2/src/srcp-ga.h
srcpd-2.1.2/src/srcp-gl.c
srcpd-2.1.2/src/srcp-gl.h
srcpd-2.1.2/src/srcp-gm.c
srcpd-2.1.2/src/srcp-gm.h
srcpd-2.1.2/src/srcp-lock.c
srcpd-2.1.2/src/srcp-lock.h
srcpd-2.1.2/src/srcp-power.c
srcpd-2.1.2/src/srcp-power.h
srcpd-2.1.2/src/srcp-server.c
srcpd-2.1.2/src/srcp-server.h
srcpd-2.1.2/src/srcp-time.c
srcpd-2.1.2/src/srcp-time.h
srcpd-2.1.2/src/toolbox.c
srcpd-2.1.2/src/toolbox.h
srcpd-2.1.2/src/zimo.h

[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.
[x]: Each %files section contains %defattr if rpm < 4.4
     Note: %defattr present but not needed
[-]: Package contains desktop file if it is a GUI application.
[x]: 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.
[-]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 122880 bytes in 10 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]: 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 requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: All build dependencies are listed in BuildRequires, except for any that
     are listed in the exceptions section of Packaging Guidelines.
[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]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install' ' DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: No %config files under /usr.
[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

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

Generic:
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
     Note: %clean present but not required
[x]: 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).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: 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.
[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed files.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Dist tag is present (not strictly required in GL).
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Uses parallel make %{?_smp_mflags} macro.
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

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

Generic:
[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.


Rpmlint
-------
Checking: srcpd-2.1.2-1.fc21.i686.rpm
          srcpd-2.1.2-1.fc21.src.rpm
srcpd.i686: W: invalid-url URL: http://srcpd.sourceforge.net/ <urlopen error timed out>
srcpd.i686: E: missing-call-to-setgroups /usr/sbin/srcpd
srcpd.i686: W: only-non-binary-in-usr-lib
srcpd.src: W: invalid-url URL: http://srcpd.sourceforge.net/ <urlopen error timed out>
srcpd.src: W: strange-permission srcpd.init 0755L
2 packages and 0 specfiles checked; 1 errors, 4 warnings.




Rpmlint (installed packages)
----------------------------
# rpmlint srcpd
srcpd.i686: W: invalid-url URL: http://srcpd.sourceforge.net/ <urlopen error timed out>
srcpd.i686: E: missing-call-to-setgroups /usr/sbin/srcpd
srcpd.i686: W: only-non-binary-in-usr-lib
1 packages and 0 specfiles checked; 1 errors, 2 warnings.
# echo 'rpmlint-done:'



Requires
--------
srcpd (rpmlib, GLIBC filtered):
    /bin/sh
    config(srcpd)
    libc.so.6
    libdl.so.2
    libgcc_s.so.1
    libgcc_s.so.1(GCC_3.0)
    libgcc_s.so.1(GCC_3.3.1)
    libm.so.6
    libpthread.so.0
    libxml2.so.2
    libxml2.so.2(LIBXML2_2.4.30)
    libz.so.1
    rtld(GNU_HASH)
    systemd



Provides
--------
srcpd:
    config(srcpd)
    srcpd
    srcpd(x86-32)



Source checksums
----------------
http://sourceforge.net/projects/srcpd/files/srcpd/2.1.2/srcpd-2.1.2.tar.gz :
  CHECKSUM(SHA256) this package     : fc2770083bb76412ba0746c25b43e25dbcc8c2fd18d63270753f2fde13d755dd
  CHECKSUM(SHA256) upstream package : fc2770083bb76412ba0746c25b43e25dbcc8c2fd18d63270753f2fde13d755dd


Generated by fedora-review 0.5.1 (bb9bf27) last change: 2013-12-13
Command line :/usr/bin/fedora-review -rvn srcpd-2.1.2-1.fc20.src.rpm
Buildroot used: fedora-rawhide-i386
Active plugins: Generic, Shell-api, C/C++
Disabled plugins: Java, Python, fonts, SugarActivity, Ocaml, Perl, Haskell, R, PHP, Ruby
Disabled flags: EXARCH, EPEL5, BATCH, DISTTAG

----------------------------

1. https://fedoraproject.org/wiki/Packaging:SysVInitScript

Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts

2. srcpd.i686: E: missing-call-to-setgroups /usr/sbin/srcpd

This executable is calling setuid and setgid without setgroups or initgroups.
There is a high probability this mean it didn't relinquish all groups, and
this would be a potential security issue to be fixed. Seek POS36-C on the web
for details about the problem.

Potential exploit, please fix.

Others are fine.

Comment 9 Christopher Meng 2014-04-20 10:36:19 UTC
RPM has provided a macro for udev rules:

rpm -E %_udevrulesdir

Please fix all above and I will approve the package.

Thanks.

Comment 10 Denis Fateyev 2014-04-20 10:55:33 UTC
I contacted the program developers regarding the issue:
"2. srcpd.i686: E: missing-call-to-setgroups /usr/sbin/srcpd"
Still uncertain whether this issue is present there. Maybe I'll look at it closer when I find some time.

Comment 11 Denis Fateyev 2014-06-27 11:24:35 UTC
Made some changes in spec, as discussed above. Although, I like it less since RHEL 5 and 6 both don't include %{_udevrulesdir}, and I needed to define it manually.

Spec URL: http://www.fateyev.com/RPMS/Fedora20/testing/srcpd.spec
SRPM URL: http://www.fateyev.com/RPMS/Fedora20/testing/SRPMS/srcpd-2.1.2-2.fc21.src.rpm

Koji scratch builds:
https://koji.fedoraproject.org/koji/taskinfo?taskID=7081182 (Rawhide)
https://koji.fedoraproject.org/koji/taskinfo?taskID=7081199 (EPEL 6)
https://koji.fedoraproject.org/koji/taskinfo?taskID=7081193 (EPEL 5)

As for the "E: missing-call-to-setgroups /usr/sbin/srcpd" I did some investigations. seteuid() / setegid() are used twice in the code:

netservice.c:
------------
...
    if (grp != NULL) {
        if ((group = getgrnam(grp)) != NULL ||
            (group = getgrgid((gid_t) atoi(grp))) != NULL) {
            if (setegid(group->gr_gid) != 0) {
                syslog_bus(0, DBG_WARN, "Could not change to group %s: %s",
                           group->gr_name, strerror(errno));
            }
            else {
                syslog_bus(0, DBG_INFO, "Changed to group %s",
                           group->gr_name);
            }
        }
        else {
            syslog_bus(0, DBG_WARN, "Could not change to group %s", grp);
        }
    }

    if (uid != NULL) {
        if ((passwd = getpwnam(uid)) != NULL ||
            (passwd = getpwuid((uid_t) atoi(uid))) != NULL) {
            if (seteuid(passwd->pw_uid) != 0) {
                syslog_bus(0, DBG_INFO, "Could not change to user %s: %s",
                           passwd->pw_name, strerror(errno));
            }
            else {
                syslog_bus(0, DBG_INFO, "Changed to user %s",
                           passwd->pw_name);
            }
        }
        else {
            syslog_bus(0, DBG_INFO, "Could not change to user %s", uid);
        }
    }
}

I think it's pretty normal usage, and the call order is basically the same as recommended in POS36-C. The second one is:
srpcd.c:
--------
...
    if (seteuid(0) != 0) {
        syslog(LOG_INFO, "seteuid() failed: %s (errno = %d)\n",
               strerror(errno), errno);
    }

    DeletePIDFile();
    closelog();
    exit(EXIT_SUCCESS);

It's invoked only during exit to make cleanup, so I don't think it matters.

Comment 12 Christopher Meng 2014-06-27 11:31:09 UTC
PACKAGE APPROVED.

Comment 13 Denis Fateyev 2014-06-27 11:42:31 UTC
New Package SCM Request
=======================
Package Name: srcpd
Short Description: Simple Railroad Command Protocol (SRCP) server
Owners: dfateyev
Branches: f19 f20 el5 el6 epel7 
InitialCC:

Comment 14 Gwyn Ciesla 2014-06-27 14:52:15 UTC
Git done (by process-git-requests).

Comment 15 Fedora Update System 2014-06-27 19:29:07 UTC
srcpd-2.1.2-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-3.fc20

Comment 16 Fedora Update System 2014-06-27 19:30:27 UTC
srcpd-2.1.2-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-3.fc19

Comment 17 Fedora Update System 2014-06-27 19:31:47 UTC
srcpd-2.1.2-3.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-3.el5

Comment 18 Fedora Update System 2014-06-27 19:33:09 UTC
srcpd-2.1.2-3.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-3.el6

Comment 19 Fedora Update System 2014-06-28 18:41:28 UTC
srcpd-2.1.2-3.el6 has been pushed to the Fedora EPEL 6 testing repository.

Comment 20 Jakub Čajka 2014-06-30 09:43:10 UTC
Created attachment 913287 [details]
Changes exclude arch to exclusive arch

Hello,

this package fails to build on secondary architectures(s390(x), ppc(64(le)) and AArch64). Build fails always the same way as on ppc(missing sys/io.h) So I'm proposing to make this package exclusive to primary architectures. In attachment is patch making this change.

links to failing builds:
http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=2463561
http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=1433631
http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=1917114

Best regards

Jakub Čajka

Comment 21 Denis Fateyev 2014-06-30 20:00:22 UTC
Agreed (I haven't tested it on all scope of secondary arch).
An update will be released soon.

Comment 22 Fedora Update System 2014-06-30 22:04:30 UTC
srcpd-2.1.2-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-4.fc20

Comment 23 Fedora Update System 2014-06-30 22:05:56 UTC
srcpd-2.1.2-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-4.fc19

Comment 24 Fedora Update System 2014-06-30 22:07:56 UTC
srcpd-2.1.2-4.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-4.el6

Comment 25 Fedora Update System 2014-06-30 22:08:59 UTC
srcpd-2.1.2-4.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/srcpd-2.1.2-4.el5

Comment 26 Fedora Update System 2014-07-16 03:52:18 UTC
srcpd-2.1.2-4.el5 has been pushed to the Fedora EPEL 5 stable repository.

Comment 27 Fedora Update System 2014-07-16 03:52:24 UTC
srcpd-2.1.2-4.el6 has been pushed to the Fedora EPEL 6 stable repository.

Comment 28 Fedora Update System 2014-09-09 22:15:30 UTC
srcpd-2.1.2-4.fc20 has been pushed to the Fedora 20 stable repository.

Comment 29 Fedora Update System 2014-09-09 22:22:07 UTC
srcpd-2.1.2-4.fc19 has been pushed to the Fedora 19 stable repository.


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