Date: Wed, 6 Apr 2016 07:03:43 +0000 (UTC) From: Tijl Coosemans <tijl@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r412605 - in branches/2016Q2/security/openvas-manager: . files Message-ID: <201604060703.u3673hTi031460@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tijl Date: Wed Apr 6 07:03:43 2016 New Revision: 412605 URL: https://svnweb.freebsd.org/changeset/ports/412605 Log: MFH: r412585 Port stat(1) calls in several scripts. PR: 208556 Submitted by: kwinkelman@mcclatchy.com Approved by: ports-secteam (junovitch) Added: branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in - copied unchanged from r412585, head/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in - copied unchanged from r412585, head/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in - copied unchanged from r412585, head/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in - copied unchanged from r412585, head/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in Modified: branches/2016Q2/security/openvas-manager/Makefile Directory Properties: branches/2016Q2/ (props changed) Modified: branches/2016Q2/security/openvas-manager/Makefile ============================================================================== --- branches/2016Q2/security/openvas-manager/Makefile Wed Apr 6 06:14:31 2016 (r412604) +++ branches/2016Q2/security/openvas-manager/Makefile Wed Apr 6 07:03:43 2016 (r412605) @@ -2,7 +2,7 @@ PORTNAME= openvas-manager PORTVERSION= 6.0.8 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= http://wald.intevation.org/frs/download.php/2295/ Copied: branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in (from r412585, head/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in Wed Apr 6 07:03:43 2016 (r412605, copy of r412585, head/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in) @@ -0,0 +1,29 @@ +--- tools/greenbone-certdata-sync.in.orig 2015-12-08 07:09:31 UTC ++++ tools/greenbone-certdata-sync.in +@@ -643,7 +643,7 @@ update_cert_db() { + then + for certfile in `ls $CERT_DIR/CB-K*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then +@@ -677,7 +677,7 @@ update_cert_db() { + then + for certfile in `ls $CERT_DIR/dfn-cert-*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then +@@ -886,7 +886,7 @@ then + exit 1 + fi + +-if [ $(id -u) -ne $(stat -c %u $CERT_DB) ] ++if [ $(id -u) -ne $(stat -f %u $CERT_DB) ] + then + log_err "Not synchronizing or updating the database since the current user is not the owner of the database." + echo "Not synchronizing or updating the database since the current user is not the owner of the database." Copied: branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in (from r412585, head/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q2/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in Wed Apr 6 07:03:43 2016 (r412605, copy of r412585, head/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in) @@ -0,0 +1,60 @@ +--- tools/greenbone-scapdata-sync.in.orig 2015-12-08 07:09:31 UTC ++++ tools/greenbone-scapdata-sync.in +@@ -962,7 +962,7 @@ update_scap_db_private () { + then + for ovalfile in $oval_files_sorted_private + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then +@@ -1090,12 +1090,12 @@ update_scap_db() { + CPEBASE="$SCAP_DIR/official-cpe-dictionary_v2.2.xml" + if [ -e $CPEBASE ] + then +- filedate=`stat -c "%Y" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + log_info "Updating CPEs" +- filesize=`stat -c "%s" "$CPEBASE"` ++ filesize=`stat -f "%z" "$CPEBASE"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + log_info "File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1152,13 +1152,13 @@ update_scap_db() { + then + for cvefile in `ls $SCAP_DIR/nvdcve-2.0-*.xml` + do +- filedate=`stat -c "%Y" "$cvefile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$cvefile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + log_info "Updating $cvefile" + +- filesize=`stat -c "%s" "$cvefile"` ++ filesize=`stat -f "%z" "$cvefile"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + log_info "File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1228,7 +1228,7 @@ update_scap_db() { + + for ovalfile in $oval_files_sorted + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then +@@ -1469,7 +1469,7 @@ then + exit 1 + fi + +-if [ $(id -u) -ne $(stat -c %u $SCAP_DB) ] ++if [ $(id -u) -ne $(stat -f %u $SCAP_DB) ] + then + log_err "Not synchronizing or updating the database since the current user is not the owner of the database." + echo "Not synchronizing or updating the database since the current user is not the owner of the database." Copied: branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in (from r412585, head/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in Wed Apr 6 07:03:43 2016 (r412605, copy of r412585, head/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in) @@ -0,0 +1,20 @@ +--- tools/openvas-certdata-sync.in.orig 2015-08-03 05:52:10 UTC ++++ tools/openvas-certdata-sync.in +@@ -575,7 +575,7 @@ update_sec_db () { + then + for certfile in `ls $CERT_DIR/CB-K*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then +@@ -610,7 +610,7 @@ update_sec_db () { + then + for certfile in `ls $CERT_DIR/dfn-cert-*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then Copied: branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in (from r412585, head/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q2/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in Wed Apr 6 07:03:43 2016 (r412605, copy of r412585, head/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in) @@ -0,0 +1,52 @@ +--- tools/openvas-scapdata-sync.in.orig 2015-08-03 05:52:10 UTC ++++ tools/openvas-scapdata-sync.in +@@ -885,7 +885,7 @@ update_sec_db_private () { + then + for ovalfile in $oval_files_sorted_private + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then +@@ -1012,13 +1012,13 @@ update_sec_db () { + CPEBASE="$SCAP_DIR/official-cpe-dictionary_v2.2.xml" + if [ -e $CPEBASE ] + then +- filedate=`stat -c "%Y" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + echo "[i] Updating CPEs" + +- filesize=`stat -c "%s" "$CPEBASE"` ++ filesize=`stat -f "%z" "$CPEBASE"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + echo "[i] File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1075,13 +1075,13 @@ update_sec_db () { + then + for cvefile in `ls $SCAP_DIR/nvdcve-2.0-*.xml` + do +- filedate=`stat -c "%Y" "$cvefile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$cvefile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + echo "[i] Updating $cvefile" + +- filesize=`stat -c "%s" "$cvefile"` ++ filesize=`stat -f "%z" "$cvefile"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + echo "[i] File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1151,7 +1151,7 @@ update_sec_db () { + + for ovalfile in $oval_files_sorted + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604060703.u3673hTi031460>