Bug 227376 - net/rtg: fix runtime php errors / add new feature
Summary: net/rtg: fix runtime php errors / add new feature
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Rodrigo Osorio
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2018-04-08 15:57 UTC by Daniel Austin
Modified: 2019-05-31 12:59 UTC (History)
6 users (show)

See Also:
koobs: maintainer-feedback? (freebsd-ports)
freebsd-ports: merge-quarterly?


Attachments
fix various issues (106.62 KB, patch)
2018-04-08 15:57 UTC, Daniel Austin
freebsd-ports: maintainer-approval+
Details | Diff
fix various issues, add flavor support (107.01 KB, patch)
2018-04-08 18:40 UTC, Daniel Austin
freebsd-ports: maintainer-approval+
Details | Diff
fix build with mariadb (107.20 KB, patch)
2018-10-20 17:54 UTC, Daniel Austin
freebsd-ports: maintainer-approval+
Details | Diff
fix build with mariadb (107.21 KB, patch)
2018-10-20 22:06 UTC, Daniel Austin
koobs: maintainer-approval-
Details | Diff
Patch updated without flavours (110.67 KB, patch)
2019-05-02 15:04 UTC, Andrew
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Austin 2018-04-08 15:57:08 UTC
Created attachment 192343 [details]
fix various issues

* Fix runtime PHP errors that stop the code working if short_opentag is disabled (default!)
* Remove most PHP warnings/notices that go to error_log
* Convert patches to new format where needed
* Fix HTML output to be valid
* Fix quoting of SQL objects
* Fix escaping of user-provided SQL data (potential sql injection)
* Widen fields in 95.php and 95.pl for interface and router names
* Fix warnings in perl modules in newer perl versions
* Fix createdb script to use CREATE USER/GRANT not manipulate user db directly
* Add "Update_desc" config entry to auto-update port descriptions from snmp
* Update default SNMP version to 2

Poudriere testport logs for 10.4/11.1 i386/amd64 located at:

https://poudriere.dan.tm/poudriere/data/latest-per-pkg/rtg/0.7.4_15/

Although this doesn't reference any CVE's, it does contain fixes for potential security issues so I've requested merge-quarterly.
Comment 1 Daniel Austin 2018-04-08 18:40:20 UTC
Created attachment 192348 [details]
fix various issues, add flavor support

in addition to previous patch's comments, this also adds flavor support.

Updated logs at:

https://poudriere.dan.tm/poudriere/data/latest-per-pkg/rtg/0.7.4_15/
Comment 2 Matthias Fechner freebsd_committer freebsd_triage 2018-10-20 11:13:54 UTC
Testbuild running.
Comment 3 Matthias Fechner freebsd_committer freebsd_triage 2018-10-20 11:21:06 UTC
I get the following build error:
https://pkg.fechner.net/data/112amd64-gitlab/2018-10-20_13h19m33s/logs/errors/rtg-0.7.4_15.log
Comment 4 Daniel Austin 2018-10-20 11:23:18 UTC
(In reply to Matthias Fechner from comment #3)
hmm i've never tried it linking against mariadb before - only vanilla mysql.
I'll look into it though.
Comment 5 Daniel Austin 2018-10-20 17:54:51 UTC
Created attachment 198406 [details]
fix build with mariadb
Comment 6 Daniel Austin 2018-10-20 17:57:12 UTC
(In reply to Matthias Fechner from comment #3)
ok - it should build now (it would've built before with stock bsd port defaults, but it's good to get it to build with mariadb too!)
Comment 7 Matthias Fechner freebsd_committer freebsd_triage 2018-10-20 18:50:55 UTC
(In reply to Daniel Austin from comment #5)
sry, but see the same error message:
https://pkg.fechner.net/data/112amd64-gitlab/2018-10-20_20h48m11s/logs/errors/rtg-0.7.4_15.log
Comment 8 Daniel Austin 2018-10-20 18:55:20 UTC
(In reply to Matthias Fechner from comment #7)
hmm, you should only get that if your mariadb install is not thread safe.

I'll have to look at it in more detail to get it to work with mariadb :(
It will compile fine against the default freebsd settings (mysql not mariadb)

my poudriere install is busy doing a compile run at the moment, but i'll look into it when it finishes.
Comment 9 Daniel Austin 2018-10-20 22:06:41 UTC
Created attachment 198418 [details]
fix build with mariadb

fix building with non-mysql (e.g. mariadb) by checking for mysql_thread_init() not the ancient my_thread_init() from mysql 4.x (which mysql still aliases!)
Comment 10 Matthias Fechner freebsd_committer freebsd_triage 2018-10-21 15:38:01 UTC
Thanks LGTM.
I created a review for it:
https://reviews.freebsd.org/D17637
Comment 11 commit-hook freebsd_committer freebsd_triage 2018-11-07 19:42:03 UTC
A commit references this bug:

Author: mfechner
Date: Wed Nov  7 19:41:02 UTC 2018
New revision: 484406
URL: https://svnweb.freebsd.org/changeset/ports/484406

Log:
  * Fix runtime PHP errors that stop the code working if short_opentag is disabled (default!)
  * Remove most PHP warnings/notices that go to error_log
  * Convert patches to new format where needed
  * Fix HTML output to be valid
  * Fix quoting of SQL objects
  * Fix escaping of user-provided SQL data (potential sql injection)
  * Widen fields in 95.php and 95.pl for interface and router names
  * Fix warnings in perl modules in newer perl versions
  * Fix createdb script to use CREATE USER/GRANT not manipulate user db directly
  * Add "Update_desc" config entry to auto-update port descriptions from snmp
  * Update default SNMP version to 2
  * Although this doesn't reference any CVE's, it does contain fixes for potential security issues

  PR:		227376
  Submitted by:	freebsd-ports@dan.me.uk (maintainer)
  Reported by:	freebsd-ports@dan.me.uk (maintainer)
  Reviewed by:	mfechner
  Approved by:	mentors (timeout), portmgr (timeout)
  MFC after:	2 days
  Differential Revision:	https://reviews.freebsd.org/D17637

Changes:
  head/net/rtg/Makefile
  head/net/rtg/files/patch-cgilib-0.4_cgi.c
  head/net/rtg/files/patch-cgilib-cgi.c
  head/net/rtg/files/patch-config-config.h.in
  head/net/rtg/files/patch-config_config.h.in
  head/net/rtg/files/patch-etc-95.php
  head/net/rtg/files/patch-etc-Makefile.in
  head/net/rtg/files/patch-etc-rtg.php
  head/net/rtg/files/patch-etc-rtgtargmkr.pl.in
  head/net/rtg/files/patch-etc-view.php
  head/net/rtg/files/patch-etc_95.php
  head/net/rtg/files/patch-etc_95.pl
  head/net/rtg/files/patch-etc_Makefile.in
  head/net/rtg/files/patch-etc_SNMP__util.pm
  head/net/rtg/files/patch-etc_common.php.in
  head/net/rtg/files/patch-etc_createdb.in
  head/net/rtg/files/patch-etc_report.pl
  head/net/rtg/files/patch-etc_rtg.conf
  head/net/rtg/files/patch-etc_rtg.php
  head/net/rtg/files/patch-etc_rtgtargmkr.pl.in
  head/net/rtg/files/patch-etc_view.php
  head/net/rtg/files/patch-man-rtgplot.1
  head/net/rtg/files/patch-man-rtgpoll.1
  head/net/rtg/files/patch-man_rtgplot.1
  head/net/rtg/files/patch-man_rtgpoll.1
  head/net/rtg/files/patch-src-rtg.h
  head/net/rtg/files/patch-src-rtgplot.c
  head/net/rtg/files/patch-src-rtgplot.h
  head/net/rtg/files/patch-src-rtgpoll.c
  head/net/rtg/files/patch-src_rtg.h
  head/net/rtg/files/patch-src_rtgplot.c
  head/net/rtg/files/patch-src_rtgplot.h
  head/net/rtg/files/patch-src_rtgpoll.c
  head/net/rtg/files/patch-src_rtgutil.c
Comment 12 Matthias Fechner freebsd_committer freebsd_triage 2018-11-07 19:42:43 UTC
Committed, thanks for the update.
Comment 13 Matthias Fechner freebsd_committer freebsd_triage 2018-11-08 16:21:48 UTC
Dear Daniel,

the commit was reverted by @mat, please see the comment in the linked review and update your patch accordingly.

Thanks.
Comment 14 Daniel Austin 2018-11-08 21:05:43 UTC
hmm... i'll look into it.

I'd need subpackages AND flavors, as the web subpackage needs to be packaged for each PHP version (flavors).  I don't even know if that's possible or not so will take some work.  I might just drop the non-web version instead.
Comment 15 Rodrigo Osorio freebsd_committer freebsd_triage 2019-03-11 17:11:36 UTC
take PR
Comment 16 Andrew 2019-05-02 15:04:27 UTC
Created attachment 204165 [details]
Patch updated without flavours
Comment 17 Andrew 2019-05-02 15:05:53 UTC
I tried commenting on phabricator, but I'm not sure that's the correct place since I can't upload my new patch without creating a new issue.

RTG has stopped working with modern perl without these patches. I've attempted to contact the maintainer for a few weeks but have had no luck. Can we just get the flavour bits of the patch removed and the rest committed? That way we at least get it back to a working state.

I've uploaded my patch here.
Comment 18 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-31 12:08:11 UTC
@Andrew Can you confirm attachment 204165 [details] passes QA (portlint, poudriere) ?

Also, I'd abandon the review, and stick with patches in bugzilla, as external reviews can confuse people when there's also patches in bugs.

Triage: Assignee timeout: 2 months.

@Rodrigo If you'd still like to take this, please re-assign
Comment 19 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-31 12:09:46 UTC
Comment on attachment 198418 [details]
fix build with mariadb

Obsolete reverted patch
Comment 20 Rodrigo Osorio freebsd_committer freebsd_triage 2019-05-31 12:58:02 UTC
@koobs : I'm in, I just close the review created by mfechner@ to discuss changes. I was performing a final portscheck before the commit.
Comment 21 Rodrigo Osorio freebsd_committer freebsd_triage 2019-05-31 12:59:02 UTC
Committed with minor changes, thanks
Comment 22 commit-hook freebsd_committer freebsd_triage 2019-05-31 12:59:11 UTC
A commit references this bug:

Author: rodrigo
Date: Fri May 31 12:58:31 UTC 2019
New revision: 503172
URL: https://svnweb.freebsd.org/changeset/ports/503172

Log:
  Fix net/rtg with modern perl and php

   * Fix runtime PHP errors if short_opentag is disabled (default)
   * Remove most PHP warnings/notices that go to error_log
   * Fix HTML output to be valid
   * Fix quoting of SQL objects
   * Fix escaping of user-provided SQL data (potential sql injection)
   * Widen fields in 95.php and 95.pl for interface and router names
   * Fix warnings in perl modules in newer perl versions
   * Fix createdb script to use CREATE USER/GRANT not manipulate user db directly
   * Add "Update_desc" config entry to auto-update port descriptions from snmp
   * Update default SNMP version to 2

  PR:		227376
  Submitted by:	<freebsd-ports@dan.me.uk> (maintainer)

Changes:
  head/net/rtg/Makefile
  head/net/rtg/files/patch-cgilib-0.4_cgi.c
  head/net/rtg/files/patch-cgilib-cgi.c
  head/net/rtg/files/patch-config-config.h.in
  head/net/rtg/files/patch-config_config.h.in
  head/net/rtg/files/patch-etc-95.php
  head/net/rtg/files/patch-etc-Makefile.in
  head/net/rtg/files/patch-etc-rtg.php
  head/net/rtg/files/patch-etc-rtgtargmkr.pl.in
  head/net/rtg/files/patch-etc-view.php
  head/net/rtg/files/patch-etc_95.php
  head/net/rtg/files/patch-etc_95.pl
  head/net/rtg/files/patch-etc_Makefile.in
  head/net/rtg/files/patch-etc_SNMP__util.pm
  head/net/rtg/files/patch-etc_common.php.in
  head/net/rtg/files/patch-etc_createdb.in
  head/net/rtg/files/patch-etc_report.pl
  head/net/rtg/files/patch-etc_rtg.conf
  head/net/rtg/files/patch-etc_rtg.php
  head/net/rtg/files/patch-etc_rtgtargmkr.pl.in
  head/net/rtg/files/patch-etc_view.php
  head/net/rtg/files/patch-man-rtgplot.1
  head/net/rtg/files/patch-man-rtgpoll.1
  head/net/rtg/files/patch-man_rtgplot.1
  head/net/rtg/files/patch-man_rtgpoll.1
  head/net/rtg/files/patch-src-rtg.h
  head/net/rtg/files/patch-src-rtgplot.c
  head/net/rtg/files/patch-src-rtgplot.h
  head/net/rtg/files/patch-src-rtgpoll.c
  head/net/rtg/files/patch-src_rtg.h
  head/net/rtg/files/patch-src_rtgplot.c
  head/net/rtg/files/patch-src_rtgplot.h
  head/net/rtg/files/patch-src_rtgpoll.c
  head/net/rtg/files/patch-src_rtgutil.c