Skip to content

Commit

Permalink
Fix 100.chksetuid and 110.neggrpperm for mountpoints with spaces
Browse files Browse the repository at this point in the history
Also, fix them for mountpoints with tabs.

PR:		48325
Reported by:	[email protected], [email protected]
MFC after:	3 weeks
  • Loading branch information
asomers committed Aug 25, 2017
1 parent 81191b7 commit b31ace7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion etc/periodic/security/100.chksetuid
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ if check_yesno_period security_status_chksetuid_enable
then
echo ""
echo 'Checking setuid files and devices:'
MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'`
IFS=$'\n' # Don't split mount points with spaces or tabs
MP=`mount -t ufs,zfs | awk '
$0 !~ /no(suid|exec)/ {
sub(/^.* on \//, "/");
sub(/ \(.*\)/, "");
print $0
}'`
find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \
\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
\( -perm -u+s -or -perm -g+s \) -exec ls -liTd \{\} \+ |
Expand Down
8 changes: 7 additions & 1 deletion etc/periodic/security/110.neggrpperm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ if check_yesno_period security_status_neggrpperm_enable
then
echo ""
echo 'Checking negative group permissions:'
MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'`
IFS=$'\n' # Don't split mount points with spaces or tabs
MP=`mount -t ufs,zfs | awk '
$0 !~ /no(suid|exec)/ {
sub(/^.* on \//, "/");
sub(/ \(.*\)/, "");
print $0
}'`
n=$(find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \
\( \( ! -perm +010 -and -perm +001 \) -or \
\( ! -perm +020 -and -perm +002 \) -or \
Expand Down
1 change: 1 addition & 0 deletions etc/periodic/security/security.functions
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ rc=0
# LABEL is the base name of the ${LOG}/${label}.{today,yesterday} files.

check_diff() {
unset IFS
rc=0
if [ "$1" = "new_only" ]; then
shift
Expand Down

0 comments on commit b31ace7

Please sign in to comment.