core icon indicating copy to clipboard operation
core copied to clipboard

occ files:scan The dates of creation of folders are changed to the date of the scan

Open fabianbur opened this issue 7 years ago • 5 comments

Steps to reproduce

  1. access to server via ssh
  2. /var/www/owncloud
  3. sudo -u www-data php occ files:scan --all

Expected behaviour

Files with problems are indexed and appear in the web and desktop client. The original creation date of files and folders are maintained.

Actual behaviour

Files with problems are indexed and appear in the web and desktop client. The dates of creation of folders are changed to the date of the scan. The dates of the files are maintained.

Server configuration

Operating system: Ubuntu 16.04

Web server: Apache 2.4.18

Database: MariaDB-10.2.23

PHP version: 7.0.33-0ubuntu0.16.04.4

ownCloud version: ownCloud 10.1.1 (production)

Updated from an older ownCloud or fresh install: Updated from an older ownCloud

Where did you install ownCloud from: https://owncloud.org/download/

Signing status (ownCloud 9.0 and above):

https://gist.github.com/fabianbur/999f24113889890613a995580eb05f0a

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

Enabled:
  - activity: 2.4.2
  - announcementcenter: 1.2.1
  - audioplayer: 2.7.0
  - brute_force_protection: 1.0.1
  - calendar: 1.6.2
  - comments: 0.3.0
  - configreport: 0.1.2
  - contacts: 1.5.5
  - dav: 0.4.0
  - external: 1.2.1
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.2
  - files_external: 0.7.1
  - files_pdfviewer: 0.11.0
  - files_primary_s3: 1.0.3
  - files_sharing: 0.11.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.9
  - firstrunwizard: 1.1.1
  - gallery: 16.1.1
  - guests: 0.8.1
  - market: 0.4.0
  - notes: 2.0.4
  - notifications: 0.4.1
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - tasks: 0.9.7
  - templateeditor: 0.4.0
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - user_external

Are you using external storage, if yes which one: local/smb/sftp/... No

Are you using encryption: no

Referenced: https://github.com/nextcloud/server/issues/1583

fabianbur avatar May 04 '19 17:05 fabianbur

folder creation is not relevant for ownCloud, it's not used anywhere.

does the modification time change ?

I'm not aware of any process that would touch the date/times of folders directly on disk. The scanner is not supposed to touch the storage in general.

PVince81 avatar May 06 '19 13:05 PVince81

folder creation is not relevant for ownCloud, it's not used anywhere.

does the modification time change ?

I'm not aware of any process that would touch the date/times of folders directly on disk. The scanner is not supposed to touch the storage in general.

Dear @PVince81

The modification occurs in the database, the files and folders on the hard disk remain intact. In the desktop client nothing is modified at all.

The modification appears in the web version of owncloud and in the client for Android that I use, I fear that it will also happen in the other cell phone clients.

Yes it is relevant because all folders appear in such clients as recently created and it is impossible to sort by date to quickly access the last created, which is a function that I use often and I think many users.

If this is not relevant to the developers of ownloud, I am sorry to read it and I hope it is a misinterpretation. I repeat that for me as a user it is a relevant problem.

I would like to inform you that I found the inelegant solution in this link that refers to Nextcloud:

https://github.com/nextcloud/server/issues/1583

Basically by accessing the database and executing the query:

UPDATE oc_filecache SET mtime=storage_mtime

I would expect a more elegant solution from the owncloud developers

fabianbur avatar May 06 '19 16:05 fabianbur

ok, so it's not creation date but mtime of folders.

I don't think the scanner is supposed to touch these mtimes in the database so would consider it a bug.

PVince81 avatar May 07 '19 08:05 PVince81

ok, so it's not creation date but mtime of folders.

I don't think the scanner is supposed to touch these mtimes in the database so would consider it a bug.

Ok, it is the creation date of the folders that are changed. mtimes of folders make them look that way in the web and mobile version.

fabianbur avatar May 07 '19 14:05 fabianbur

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 19 '21 23:09 stale[bot]