Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143635978
D15904.id44149.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D15904.id44149.diff
View Options
Index: Mk/Scripts/security-check.awk
===================================================================
--- Mk/Scripts/security-check.awk
+++ Mk/Scripts/security-check.awk
@@ -1,9 +1,5 @@
BEGIN {
file = "";
- if (audit != "")
- stupid_functions_regexp="^(gets|mktemp|tempnam|tmpnam|strcpy|strcat|sprintf)$";
- else
- stupid_functions_regexp="^(gets|mktemp|tempnam|tmpnam)$";
split("", stupid_binaries);
split("", network_binaries);
split("", setuid_binaries);
@@ -15,18 +11,17 @@
if ($0 ~ /(^|\/)etc\/rc\.d\//)
startup_scripts[$0] = 1;
}
-FILENAME ~ /\.objdump$/ {
- if (match($0, /: +file format [^ ]+$/)) {
- file = substr($0, 1, RSTART - 1);
- stupid_functions = "";
+FILENAME ~ /\.readelf$/ {
+ if (match($0, /^File:/)) {
+ file = substr($0, 7);
next;
}
if (file == "")
next;
- if ($3 ~ /^(gets|mktemp|tempnam|tmpnam)$/ ||
- ($3 ~ /^(strcpy|strcat|sprintf)$/ && audit != ""))
- stupid_binaries[file] = stupid_binaries[file] " " $3;
- if ($3 ~ /^(accept|recvfrom)$/)
+ if ($5 ~ /^(gets|mktemp|tempnam|tmpnam)$/ ||
+ ($5 ~ /^(strcpy|strcat|sprintf)$/ && audit != ""))
+ stupid_binaries[file] = stupid_binaries[file] " " $5;
+ if ($5 ~ /^(accept|recvfrom)$/)
network_binaries[file] = 1;
}
FILENAME ~ /\.setuid$/ { setuid_binaries[$0] = 1; }
Index: Mk/bsd.port.mk
===================================================================
--- Mk/bsd.port.mk
+++ Mk/bsd.port.mk
@@ -3588,7 +3588,11 @@
# 4. startup scripts, in conjunction with 2.
# 5. world-writable files/dirs
#
- -@${RM} ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.objdump; \
+# The ${NONEXISTENT} argument of ${READELF} is there so that there are always
+# at least two file arguments, and forces it to always output the "File: foo"
+# header lines.
+#
+ -@${RM} ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.readelf; \
${AWK} -v prefix='${PREFIX}' ' \
match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
/^@/ { next; } \
@@ -3601,10 +3605,10 @@
| ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
| ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
- | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
+ | ${XARGS} -0 ${READELF} -r ${NONEXISTENT} 2> /dev/null > ${WRKDIR}/.PLIST.readelf; \
if \
! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${SCRIPTSDIR}/security-check.awk \
- ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
+ ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.readelf ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
then \
www_site=$$(cd ${.CURDIR} && ${MAKE} www-site); \
if [ ! -z "$${www_site}" ]; then \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 1, 3:22 AM (10 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28261329
Default Alt Text
D15904.id44149.diff (2 KB)
Attached To
Mode
D15904: As objdump is being phased out for 12.0, convert the small bit using it to using readelf.
Attached
Detach File
Event Timeline
Log In to Comment