truenegative
Verified User
- Joined
- Feb 16, 2006
- Messages
- 153
Recently ran updates on my system for ProFTPD and it removed the CB installed clamav and replaced it with the OS version of clamav (unfortunately removed all of my external freshclam server databases as well ). After that, php uploads were working and first noticed when I couldn't attach anything in Roundcube. I am running PHP 5.6 w/ mod_php/mod_ruid2 on CentOS 7.9 (I know, I will upgrade once I redo one of the sites to a later drupal).
After some digging it appears that the clamdscan binary is moved to /usr/bin/clamdscan, but suhosin looks for it in /usr/local/bin/clamdscan. Running ./build suhosin seemed will not enable upload verification because it cannot find it in /usr/local/bin, however it seems the php_uploadscan.sh file has the correct location of /usr/bin/clamdscan. I tried creating a symlink so it enabled the uploadscan but that breaks the uploading again.
Running the command itself on a temporary file seems to return nothing as assumed:
Running it as the bash script line incorrectly returns 1:
If I remove the quotes from the line, it works and returns 0 appropriately:
However, removing the quotes from the php_uploadscan.sh file, does not allow uploads/attachments to work...
For now, I have the line removed from 10-directadmin.ini so that uploads and attachments work, but I'm thinking it possibly has to do with the user that clamdscan is running under when installed as OS vs compiled via CB.
After some digging it appears that the clamdscan binary is moved to /usr/bin/clamdscan, but suhosin looks for it in /usr/local/bin/clamdscan. Running ./build suhosin seemed will not enable upload verification because it cannot find it in /usr/local/bin, however it seems the php_uploadscan.sh file has the correct location of /usr/bin/clamdscan. I tried creating a symlink so it enabled the uploadscan but that breaks the uploading again.
Code:
# ./php_uploadscan.sh /tmp/ballet-gkLZz4.tmp
1
#
Running the command itself on a temporary file seems to return nothing as assumed:
Code:
# /usr/bin/clamdscan --infected --no-summary /tmp/ballet-gkLZz4.tmp
#
Running it as the bash script line incorrectly returns 1:
Code:
# if [ -n "`/usr/bin/clamdscan --infected --no-summary /tmp/ballet-gkLZz4.tmp`" ]; then echo 0; else echo 1; fi
1
#
If I remove the quotes from the line, it works and returns 0 appropriately:
Code:
# if [ -n `/usr/bin/clamdscan --infected --no-summary /tmp/ballet-gkLZz4.tmp` ]; then echo 0; else echo 1; fi
0
#
# FILE="/tmp/ballet-gkLZz4.tmp";if [ -n `/usr/bin/clamdscan --infected --no-summary ${FILE}` ]; then echo 0; else echo 1; fi
0
#
However, removing the quotes from the php_uploadscan.sh file, does not allow uploads/attachments to work...
For now, I have the line removed from 10-directadmin.ini so that uploads and attachments work, but I'm thinking it possibly has to do with the user that clamdscan is running under when installed as OS vs compiled via CB.