nextcloud / files_antivirus

👾 Antivirus app for Nextcloud Files
https://apps.nextcloud.com/apps/files_antivirus
GNU Affero General Public License v3.0
88 stars 36 forks source link

Files containing spaces not scanned #133

Open johannespfeiffer opened 5 years ago

johannespfeiffer commented 5 years ago

Hi,

seems files_antivirus cannot scan files with spaces. This is what our logs contain

Fatal   files_antivirus OCA\Files_Antivirus\BackgroundJob\BackgroundScanner::run, exception:
Fatal   files_antivirus Can not open for reading. File: 92161Account: xxx.xxx Path: /xxx.xxx/files/Vorschlag XXXXXXXXXX YYY-ZZZ.pdf
Error   PHP fopen(/var/www/nextcloud/data/xxx.xxx/files/Vorschlag XXXXXXXXXX YYY-ZZZ.pdf): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#301

The file does exist at that location.

Server configuration

Operating system: Linux

Web server: Apache

Database: MySQL

PHP version: PHP 7.2.15-0ubuntu0.18.04.1

Nextcloud version: (see Nextcloud admin page) 16.0.4

List of activated apps:

Enabled:
  - accessibility: 1.2.0
  - bruteforcesettings: 1.4.0
  - calendar: 1.7.1
  - cloud_federation_api: 0.2.0
  - dav: 1.9.2
  - federatedfilesharing: 1.6.0
  - federation: 1.6.0
  - files: 1.11.0
  - files_antivirus: 2.1.1
  - files_external: 1.7.0
  - files_sharing: 1.8.0
  - impersonate: 1.3.0
  - logreader: 2.1.0
  - lookup_server_connector: 1.4.0
  - nextcloud_announcements: 1.5.0
  - notifications: 2.4.1
  - oauth2: 1.4.2
  - password_policy: 1.6.0
  - privacy: 1.0.0
  - provisioning_api: 1.6.0
  - recommendations: 0.4.0
  - serverinfo: 1.6.0
  - sharebymail: 1.6.0
  - theming: 1.7.0
  - twofactor_backupcodes: 1.5.0
  - updatenotification: 1.6.0
  - viewer: 1.1.0
  - workflowengine: 1.6.0
Disabled:
  - activity
  - admin_audit
  - comments
  - encryption
  - files_pdfviewer
  - files_rightclick
  - files_texteditor
  - files_trashbin
  - files_versions
  - files_videoplayer
  - firstrunwizard
  - gallery
  - support
  - survey_client
  - systemtags
  - user_ldap```

**Nextcloud configuration:**

{ "system": { "instanceid": "REMOVED SENSITIVE VALUE", "passwordsalt": "REMOVED SENSITIVE VALUE", "trusteddomains": [ "xxxxxxx.de" ], "datadirectory": "REMOVED SENSITIVE VALUE", "version": "16.0.4.1", "dbtype": "mysql", "dbhost": "REMOVED SENSITIVE VALUE", "dbname": "REMOVED SENSITIVE VALUE", "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "dbtableprefix": "oc", "installed": true, "default_language": "de", "defaultapp": "files", "knowledgebaseenabled": true, "enable_avatars": true, "allow_user_to_change_display_name": true, "remember_login_cookie_lifetime": 1296000, "session_lifetime": 86400, "session_keepalive": true, "skeletondirectory": "", "user_backends": [], "lost_password_link": "", "mail_domain": "REMOVED SENSITIVE VALUE", "mail_from_address": "REMOVED SENSITIVE VALUE", "mail_smtpdebug": false, "mail_smtpmode": "sendmail", "mail_smtphost": "REMOVED SENSITIVE VALUE", "mail_smtpport": "25", "mail_smtptimeout": 10, "mail_smtpauthtype": "LOGIN", "overwritehost": "www.xxxxxxx.de", "overwriteprotocol": "https", "overwritewebroot": "\/cloud", "overwritecondaddr": "", "overwrite.cli.url": "https:\/\/www.xxxxxxx.de\/cloud", "trashbin_retention_obligation": "auto", "versions_retention_obligation": "auto", "appcodechecker": false, "updatechecker": true, "has_internet_connection": true, "check_for_working_webdav": true, "check_for_working_htaccess": true, "htaccess.RewriteBase": "\/cloud", "config_is_read_only": false, "log_type": "file", "logfile": "\/var\/log\/nextcloud.log", "loglevel": 2, "syslog_tag": "nextcloud", "log.condition": { "shared_secret": "REMOVED SENSITIVE VALUE", "users": [ "sample-user" ], "apps": [ "files" ] }, "logdateformat": "F d, Y H:i:s", "logtimezone": "Europe\/Berlin", "log_query": false, "cron_log": true, "cron.lockfile.location": "\/tmp", "log_rotate_size": false, "3rdpartyroot": "", "3rdpartyurl": "", "customclient_desktop": "https:\/\/nextcloud.com\/install\/#install-clients", "customclient_android": "https:\/\/play.google.com\/store\/apps\/details?id=com.nextcloud.client", "customclient_ios": "https:\/\/itunes.apple.com\/us\/app\/nextcloud\/id1125420102?mt=8", "appstoreenabled": true, "appstore.experimental.enabled": false, "apps_paths": [ { "path": "\/var\/www\/nextcloud\/apps", "url": "\/apps", "writable": true } ], "enable_previews": true, "preview_max_x": 2048, "preview_max_y": 2048, "preview_max_scale_factor": 10, "preview_max_filesize_image": 50, "preview_libreoffice_path": "\/usr\/bin\/libreoffice", "preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir ", "enabledPreviewProviders": [ "OC\Preview\PNG", "OC\Preview\JPEG", "OC\Preview\GIF", "OC\Preview\BMP", "OC\Preview\XBitmap", "OC\Preview\MP3", "OC\Preview\TXT", "OC\Preview\MarkDown" ], "ldapUserCleanupInterval": 51, "maintenance": false, "singleuser": false, "openssl": [], "filelocking.enabled": true, "memcache.local": "\OC\Memcache\ArrayCache", "memcache.distributed": "", "cache_path": "", "dbdriveroptions": { "1002": "SET wait_timeout = 28800" }, "sqlite.journal_mode": "DELETE", "supportedDatabases": [ "sqlite", "mysql", "pgsql", "oci" ], "tempdirectory": "\/var\/www\/nextcloud\/data\/tmp", "hashingCost": 10, "blacklisted_files": [ ".htaccess" ], "share_folder": "\/", "theme": "", "cipher": "AES-256-CFB", "minimum.supported.desktop.version": "1.7.0", "quota_include_external_storage": false, "filesystem_check_changes": 0, "part_file_in_storage": true, "asset-pipeline.enabled": false, "assetdirectory": "\/var\/www\/nextcloud", "mount_file": "\/var\/www\/nextcloud\/data\/mount.json", "filesystem_cache_readonly": false, "secret": "REMOVED SENSITIVE VALUE", "trusted_proxies": "REMOVED SENSITIVE VALUE", "forwarded_for_headers": [ "HTTP_X_FORWARDED", "HTTP_FORWARDED_FOR" ], "max_filesize_animated_gifs_public_sharing": 10, "debug": false, "integrity.check.disabled": true, "mail_sendmailmode": "smtp", "mysql.utf8mb4": true, "updater.release.channel": "stable", "app_install_overwrite": [ "calendar" ] } }

kokotko1337 commented 5 years ago

Im facing same issue.

tobiasge commented 4 years ago

The same error also occurs with file names that contain german umlauts.

Quetschwalze commented 4 years ago

I'm having the same issue with both, umlauts and spaces.

Quetschwalze commented 4 years ago

Maybe this issue is related to https://github.com/nextcloud/server/issues/7762 The User endrift over there found out that the normalized version of Unicode that nextcloud uses does not match the filesystem: https://github.com/nextcloud/server/issues/7762#issuecomment-689811732