Created attachment 204741 [details] patch to avoid race condition / file tampering During the initialization net/rtg uses /tmp/mysql.sql and /tmp/rtg.sql to store the actions to be performed in the database at the end of the script. Using well known files can lead to a race condition between two process who uses the same file names and allow file tampering. This patch introduces the mktemp command to create the temporary file in safer way.
Reporter is committer, assign accordingly
waiting a little bit more for maintainer feedback.
A commit references this bug: Author: rodrigo Date: Tue Jul 23 14:47:15 UTC 2019 New revision: 507219 URL: https://svnweb.freebsd.org/changeset/ports/507219 Log: Patch createdb script to avoid race condition / file tampering During the initialization net/rtg uses the /tmp/mysql.sql and /tmp/rtg.sql to store the SQL commands executed in the database with special user privileges. Using well known files can lead to a race condition between two process who uses the same file names and allow file tampering by a malicious user. This fix uses mktemp command to create temporary files in a safe way PR: 238262 Submitted by: rodrigo Approved by: freebsd-ports@dan.me.uk (maintainer timeout) MFH: 2019Q3 Changes: head/net/rtg/Makefile head/net/rtg/files/patch-etc_createdb.in
Committed after maintainer timeout.
A commit references this bug: Author: rodrigo Date: Sun Aug 18 13:03:58 UTC 2019 New revision: 509206 URL: https://svnweb.freebsd.org/changeset/ports/509206 Log: MFH: r507219 Patch createdb script to avoid race condition / file tampering During the initialization net/rtg uses the /tmp/mysql.sql and /tmp/rtg.sql to store the SQL commands executed in the database with special user privileges. Using well known files can lead to a race condition between two process who uses the same file names and allow file tampering by a malicious user. This fix uses mktemp command to create temporary files in a safe way PR: 238262 Submitted by: rodrigo Approved by: freebsd-ports@dan.me.uk (maintainer timeout) Approved by: ports-secteam (miwi@) Changes: _U branches/2019Q3/ branches/2019Q3/net/rtg/Makefile branches/2019Q3/net/rtg/files/patch-etc_createdb.in