Skip to content

[Bug]: Changed access rights after deleting and restoring #62233

Description

@mariospendier

⚠️ This issue respects the following points: ⚠️

Bug description

If you delete a file/folder by Web-GUI and restore it, access rights in DB are changed. Mostly of only this folder, sometimes bug will inherit to upper folder.

Steps to reproduce

  1. Open Web-GUI
  2. Delete Folder/File
  3. Goto Deleted Files
  4. Restore Folder/File
  5. Go to all files again
  6. Try to access restored Folder/File --> should not work.
  7. Goto DB: SELECT fileid, path, permissions FROM oc_filecache WHERE path = 'files/';
  8. If file/folder permission is 24 --> buggy, should be 31.

Expected behavior

  1. Open Web-GUI
  2. Delete Folder/File
  3. Goto Deleted Files
  4. Restore Folder/File
  5. Access Folder/File as usual

Nextcloud Server version

34

Operating system

Other

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

# sudo -u www-data php occ config:list system
php occ config:list system
./occ config:list system/bin/sh: 1: sudo: not found
# {
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "bulkupload.enabled": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "upgrade.disable-web": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "34.0.1.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 3,
        "maintenance": false,
        "maintenance_window_start": 1,
        "default_phone_region": "AT",
        "server_id": {
            "\/var\/www\/html\/occ": {
                "config:system:set": {
                    "server_id": "nextcloud-spendier-01"
                }
            }
        },
        "trusted_domains": [
            "127.0.0.1",
            "localhost",
            "nextcloud",
            "nextcloud.lan",
            "nextcloud.lan:30027",
            "nextcloud.spendier.at",
            "nginx"
        ]
    }
}
# 
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "bulkupload.enabled": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "upgrade.disable-web": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "34.0.1.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 3,
        "maintenance": false,
        "maintenance_window_start": 1,
        "default_phone_region": "AT",
        "server_id": {
            "\/var\/www\/html\/occ": {
                "config:system:set": {
                    "server_id": "nextcloud-spendier-01"
                }
            }
        },
        "trusted_domains": [
            "127.0.0.1",
            "localhost",
            "nextcloud",
            "nextcloud.lan",
            "nextcloud.lan:30027",
            "nextcloud.spendier.at",
            "nginx"
        ]
    }
}
#

List of activated Apps

# sudo -u www-data php occ app:list
php occ app:list
./occ app:list/bin/sh: 35: sudo: not found
# Enabled:
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - cloud_federation_api: 1.18.0
  - dav: 1.39.0
  - federatedfilesharing: 1.24.0
  - files: 2.6.0
  - files_lock: 34.0.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - oauth2: 1.22.0
  - office: 1.0.0
  - password_policy: 6.0.0-dev.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - related_resources: 5.0.0-dev.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - viewer: 7.0.0-dev.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - activity: 7.0.0 (installed 6.0.0-dev.0)
  - admin_audit: 1.24.0
  - app_api: 34.0.0 (installed 33.0.0)
  - circles: 34.0.0 (installed 33.0.0)
  - comments: 1.24.0 (installed 1.23.0)
  - contactsinteraction: 1.15.0 (installed 1.14.1)
  - dashboard: 7.14.0 (installed 7.13.0)
  - encryption: 2.22.0
  - federation: 1.24.0 (installed 1.23.0)
  - files_downloadlimit: 5.2.0-dev.0 (installed 5.1.0-dev.0)
  - files_external: 1.26.0
  - files_pdfviewer: 7.0.0-dev.0 (installed 6.0.0-dev.0)
  - files_reminders: 1.7.0 (installed 1.6.0)
  - files_versions: 1.27.0 (installed 1.26.0)
  - firstrunwizard: 7.0.0-dev.0 (installed 6.0.0-dev.0)
  - nextcloud_announcements: 6.0.0 (installed 5.0.0)
  - notifications: 7.0.0-dev.1 (installed 6.0.0)
  - onlyoffice: 10.0.0 (installed 10.0.0)
  - photos: 7.0.0 (installed 6.0.0-dev.0)
  - recommendations: 7.0.0 (installed 6.0.0-dev.0)
  - richdocuments: 10.1.0 (installed 10.1.0)
  - serverinfo: 6.0.0 (installed 5.0.0-dev.0)
  - support: 6.0.0 (installed 5.0.0)
  - survey_client: 6.0.0-dev.0 (installed 5.0.0-dev.0)
  - suspicious_login: 12.0.0-dev.0
  - systemtags: 1.24.0 (installed 1.23.0)
  - text: 8.0.0 (installed 7.0.0-dev.3)
  - twofactor_nextcloud_notification: 8.0.0
  - twofactor_totp: 16.0.0 (installed 15.0.0-dev.0)
  - updatenotification: 1.24.0 (installed 1.23.0)
  - user_ldap: 1.25.0
  - user_status: 1.14.0 (installed 1.13.0)
  - weather_status: 1.14.0 (installed 1.13.0)
# 
Enabled:
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - cloud_federation_api: 1.18.0
  - dav: 1.39.0
  - federatedfilesharing: 1.24.0
  - files: 2.6.0
  - files_lock: 34.0.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - oauth2: 1.22.0
  - office: 1.0.0
  - password_policy: 6.0.0-dev.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - related_resources: 5.0.0-dev.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - viewer: 7.0.0-dev.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - activity: 7.0.0 (installed 6.0.0-dev.0)
  - admin_audit: 1.24.0
  - app_api: 34.0.0 (installed 33.0.0)
  - circles: 34.0.0 (installed 33.0.0)
  - comments: 1.24.0 (installed 1.23.0)
  - contactsinteraction: 1.15.0 (installed 1.14.1)
  - dashboard: 7.14.0 (installed 7.13.0)
  - encryption: 2.22.0
  - federation: 1.24.0 (installed 1.23.0)
  - files_downloadlimit: 5.2.0-dev.0 (installed 5.1.0-dev.0)
  - files_external: 1.26.0
  - files_pdfviewer: 7.0.0-dev.0 (installed 6.0.0-dev.0)
  - files_reminders: 1.7.0 (installed 1.6.0)
  - files_versions: 1.27.0 (installed 1.26.0)
  - firstrunwizard: 7.0.0-dev.0 (installed 6.0.0-dev.0)
  - nextcloud_announcements: 6.0.0 (installed 5.0.0)
  - notifications: 7.0.0-dev.1 (installed 6.0.0)
  - onlyoffice: 10.0.0 (installed 10.0.0)
  - photos: 7.0.0 (installed 6.0.0-dev.0)
  - recommendations: 7.0.0 (installed 6.0.0-dev.0)
  - richdocuments: 10.1.0 (installed 10.1.0)
  - serverinfo: 6.0.0 (installed 5.0.0-dev.0)
  - support: 6.0.0 (installed 5.0.0)
  - survey_client: 6.0.0-dev.0 (installed 5.0.0-dev.0)
  - suspicious_login: 12.0.0-dev.0
  - systemtags: 1.24.0 (installed 1.23.0)
  - text: 8.0.0 (installed 7.0.0-dev.3)
  - twofactor_nextcloud_notification: 8.0.0
  - twofactor_totp: 16.0.0 (installed 15.0.0-dev.0)
  - updatenotification: 1.24.0 (installed 1.23.0)
  - user_ldap: 1.25.0
  - user_status: 1.14.0 (installed 1.13.0)
  - weather_status: 1.14.0 (installed 1.13.0)
#

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    Status
    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions