Skip to content

SMB/CIFS share breaks when it contains a single entry that can't be accessed #7332

Closed

Description

@eigenphase

Steps to reproduce

  1. Create a share that contains a file (e.g. a symlink) that returns NT_STATUS_ACCESS_DENIED
  2. Try Accessing that share. Via web interface it fails, via WebDAV you get 500. Log file see below

Example:

smb.conf:

[homes]
  comment = Eigene Dateien
  path = /home/%U/daten
  valid users = %S
  browseable = no
  writeable = yes
  public = no
  dont descend = .Linux-Daten/daten,.Linux-Daten/pub_html

Now create:

$ cd ~
$ cd daten
$ ln -s .. .Linux-Daten
$ smbclient //localhost/homes
Enter users's password:
Domain=[LOCAL] OS=[Windows 6.1] Server=[Samba 4.2.14-Debian]
smb: \> stat .Linux-Daten
NT_STATUS_ACCESS_DENIED stat file \.Linux-Daten
smb: \> exit

This is the log entry:

{"reqId":"ht8kMklVE1THGBPFLCWT","level":4,"time":"2017-11-28T23:33:42+00:00","remoteAddr":"X.X.X.X","user":"1s75srs2-7no7-102r-95p7-3929q8475818","app":"webdav","method":"PROPFIND","url":"\/nextcloud\/remote.php\/webdav\/home\/","message":"Exception: {\"Exception\":\"Icewind\\\\SMB\\\\Exception\\\\ForbiddenException\",\"Message\":\"Invalid request for \\\/.Linux-Daten (ForbiddenException)\",\"Code\":13,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeState.php(46): Icewind\\\\SMB\\\\Exception\\\\Exception::fromMap(Array, 13, '\\\/.Linux-Daten')\\n#1 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeState.php(58): Icewind\\\\SMB\\\\NativeState->handleError('\\\/.Linux-Daten')\\n#2 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeState.php(166): Icewind\\\\SMB\\\\NativeState->testResult(false, 'smb:\\\/\\\/localhost\\\/hom...')\\n#3 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeShare.php(107): Icewind\\\\SMB\\\\NativeState->stat('smb:\\\/\\\/localhost\\\/hom...')\\n#4 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeFileInfo.php(70): Icewind\\\\SMB\\\\NativeShare->getStat('\\\/\\\/.Linux-Daten')\\n#5 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/NativeFileInfo.php(87): Icewind\\\\SMB\\\\NativeFileInfo->stat()\\n#6 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/lib\\\/Lib\\\/Storage\\\/SMB.php(226): Icewind\\\\SMB\\\\NativeFileInfo->getMTime()\\n#7 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/lib\\\/Lib\\\/Storage\\\/SMB.php(212): OCA\\\\Files_External\\\\Lib\\\\Storage\\\\SMB->shareMTime()\\n#8 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Common.php(179): OCA\\\\Files_External\\\\Lib\\\\Storage\\\\SMB->stat('')\\n#9 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Common.php(665): OC\\\\Files\\\\Storage\\\\Common->filemtime('')\\n#10 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(577): OC\\\\Files\\\\Storage\\\\Common->getMetaData('')\\n#11 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/PermissionsMask.php(143): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getMetaData('')\\n#12 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(577): OC\\\\Files\\\\Storage\\\\Wrapper\\\\PermissionsMask->getMetaData('')\\n#13 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(460): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getMetaData('')\\n#14 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(577): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->getMetaData('')\\n#15 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/PermissionsMask.php(143): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getMetaData('')\\n#16 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(577): OC\\\\Files\\\\Storage\\\\Wrapper\\\\PermissionsMask->getMetaData('')\\n#17 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(113): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->getMetaData('')\\n#18 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(152): OC\\\\Files\\\\Cache\\\\Scanner->getData('')\\n#19 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(322): OC\\\\Files\\\\Cache\\\\Scanner->scanFile('', 3, -1, NULL, true)\\n#20 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1315): OC\\\\Files\\\\Cache\\\\Scanner->scan('', false)\\n#21 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1356): OC\\\\Files\\\\View->getCacheEntry(Object(OCA\\\\Files_Trashbin\\\\Storage), '', 'home')\\n#22 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php(160): OC\\\\Files\\\\View->getFileInfo('home')\\n#23 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(967): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('home')\\n#24 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1666): Sabre\\\\DAV\\\\Server::getPropertiesIteratorForPath('home', Array, 1)\\n#25 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(355): Sabre\\\\DAV\\\\Server->generateMultiStatus(Object(Generator), false)\\n#26 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPropFind(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#27 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#28 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PROPFIND', Array)\\n#29 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#30 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(76): Sabre\\\\DAV\\\\Server->exec()\\n#31 \\\/var\\\/www\\\/nextcloud\\\/remote.php(162): require_once('\\\/var\\\/www\\\/nextcloud...')\\n#32 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Exception\\\/Exception.php\",\"Line\":30}","userAgent":"ezdavplugin\/2.9 TotalCommander\/9.0 (Windows\/8; en_EN)","version":"12.0.3.3"}

Expected behaviour

The item itself should either be not shown (ignored) or result in a permission denied when it is accessed but not the entire share should break down.

Debugging this took me hours because the log does not even show up for normal access; only for WebDAV access.

Actual behaviour

See above. When enumerating a directory (getFolderContents) and one single entry returns NT_STATUS_ACCESS_DENIED, NativeShare throws a ForbiddenException which is not caught immideately but passed all the way to getFolderContents which makes it seem the folder itself has access denied. But it's just one entry in it.

Server configuration

Operating system: Debian 8.9

Web server: 2.4.10 (Debian)

Database: 5.5.58-0+deb8u1

PHP version: 5.6.30-0+deb8u1

Nextcloud version: 12.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Updated all the way from old ownCloud

Where did you install Nextcloud from: tar.bz2 from command line

Signing status: All files checked with integrity:check-core/integrity:check-app

No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.5.2
  - bruteforcesettings: 1.0.2
  - comments: 1.2.0
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - files: 1.7.2
  - files_external: 1.3.0
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - user_ldap: 1.2.1
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - bookmarks
  - calendar
  - contacts
  - documents
  - encryption
  - federation
  - news
  - notes
  - shorten
  - user_external

Nextcloud configuration:

Config report
{
    "system": {
        "updatechecker": false,
        "instanceid": "ocgu5mcamf2k",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.2.1"
        ],
        "datadirectory": "\/var\/www\/nextcloud\/data",
        "overwrite.cli.url": "http:\/\/192.168.2.1\/nextcloud",
        "dbtype": "mysql",
        "version": "12.0.3.3",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "theme": "",
        "loglevel": 2,
        "maintenance": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

Are you using external storage, if yes which one: See above, SMB

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP

LDAP configuration (delete this part if not used)

LDAP config
+-------------------------------+-------------------------------------------------------------------------+
| Configuration                 |                                                                         |
+-------------------------------+-------------------------------------------------------------------------+
| hasMemberOfFilterSupport      |                                                                         |
| hasPagedResultSupport         |                                                                         |
| homeFolderNamingRule          |                                                                         |
| lastJpegPhotoLookup           | 0                                                                       |
| ldapAgentName                 | uid=reader,dc=local                                                     |
| ldapAgentPassword             | ***                                                                     |
| ldapAttributesForGroupSearch  |                                                                         |
| ldapAttributesForUserSearch   |                                                                         |
| ldapBackupHost                |                                                                         |
| ldapBackupPort                |                                                                         |
| ldapBase                      | dc=local                                                                |
| ldapBaseGroups                | ou=groups,dc=local                                                      |
| ldapBaseUsers                 | ou=users,dc=local                                                       |
| ldapCacheTTL                  | 600                                                                     |
| ldapConfigurationActive       | 1                                                                       |
| ldapDefaultPPolicyDN          |                                                                         |
| ldapDynamicGroupMemberURL     |                                                                         |
| ldapEmailAttribute            |                                                                         |
| ldapExperiencedAdmin          | 0                                                                       |
| ldapExpertUUIDGroupAttr       |                                                                         |
| ldapExpertUUIDUserAttr        |                                                                         |
| ldapExpertUsernameAttr        |                                                                         |
| ldapGidNumber                 | gidNumber                                                               |
| ldapGroupDisplayName          | cn                                                                      |
| ldapGroupFilter               | (&(|(objectclass=posixGroup)(objectclass=sambaGroupMapping)))           |
| ldapGroupFilterGroups         |                                                                         |
| ldapGroupFilterMode           | 1                                                                       |
| ldapGroupFilterObjectclass    | posixGroup;sambaGroupMapping                                            |
| ldapGroupMemberAssocAttr      | memberUid                                                               |
| ldapHost                      | ldaps://192.168.2.1                                                     |
| ldapIgnoreNamingRules         |                                                                         |
| ldapLoginFilter               | (&(|(objectclass=posixAccount)(objectclass=sambaSamAccount))(uid=%uid)) |
| ldapLoginFilterAttributes     |                                                                         |
| ldapLoginFilterEmail          | 0                                                                       |
| ldapLoginFilterMode           | 0                                                                       |
| ldapLoginFilterUsername       | 1                                                                       |
| ldapNestedGroups              | 0                                                                       |
| ldapOverrideMainServer        |                                                                         |
| ldapPagingSize                | 500                                                                     |
| ldapPort                      | 636                                                                     |
| ldapQuotaAttribute            |                                                                         |
| ldapQuotaDefault              |                                                                         |
| ldapTLS                       | 0                                                                       |
| ldapUserDisplayName           | displayName                                                             |
| ldapUserDisplayName2          |                                                                         |
| ldapUserFilter                | (|(objectclass=posixAccount)(objectclass=sambaSamAccount))              |
| ldapUserFilterGroups          |                                                                         |
| ldapUserFilterMode            | 1                                                                       |
| ldapUserFilterObjectclass     | posixAccount;sambaSamAccount                                            |
| ldapUuidGroupAttribute        | auto                                                                    |
| ldapUuidUserAttribute         | auto                                                                    |
| turnOffCertCheck              | 0                                                                       |
| turnOnPasswordChange          | 0                                                                       |
| useMemberOfToDetectMembership | 1                                                                       |
+-------------------------------+-------------------------------------------------------------------------+

Client configuration

Browser: Firefox 57.0

Operating system: Windows 10

Logs

Web server error log

Details See above

Nextcloud log (data/nextcloud.log)

Details see above

Activity

  1. MorrisJobke commented on Dec 14, 2017

    @MorrisJobke
    Member
  2. icewind1991 commented on Dec 18, 2017

    @icewind1991
    Member

    @segdy can you see if #7556 fixes the problem for you

  3. MorrisJobke commented on Dec 18, 2017

    @MorrisJobke
    Member

    Fixed with #7556

  4. eigenphase commented on Dec 24, 2017

    @eigenphase
    Author

    Great - seems to work!

  5. rik26 commented on Jun 4, 2019

    @rik26

    Hi,

    I still have the problem with Nextcloud 16 :
    My samba server is configured not to follow symbolic links.

    If create a symlink on a share, the share content listing fails through WEB UI (sorry for my english)
    With smbclient, cd to the symlink gives "NT_STATUS_ACCESS_DENIED".

    I reviewed the file apps/files_external/lib/Lib/Storage/SMB.php and it seems the patch is already in place.

    The try catch code shoud do the trick but it does not....

    Cheers.

    log 👍{"reqId":"h9bFanEGQj9WuklaRLsJ","level":1,"time":"2019-06-05T09:41:45+00:00","remoteAddr":"172.30.2.2","user":"laurentq","app":"no app in context","method":"GET","url":"/index.php/apps/files_external/userglobalstorages/6?testOnly=false","message":"External storage not available: Invalid request for /Public (ForbiddenException)","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0","version":"16.0.1.1"}
    {"reqId":"h9bFanEGQj9WuklaRLsJ","level":0,"time":"2019-06-05T09:41:45+00:00","remoteAddr":"172.30.2.2","user":"laurentq","app":"no app in context","method":"GET","url":"/index.php/apps/files_external/userglobalstorages/6?testOnly=false","message":{"Exception":"Icewind\SMB\Exception\ForbiddenException","Message":"Invalid request for /Public (ForbiddenException)","Code":13,"Trace":[{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":62,"function":"fromMap","class":"Icewind\SMB\Exception\Exception","type":"::","args":[{"1":"Icewind\SMB\Exception\ForbiddenException","2":"Icewind\SMB\Exception\NotFoundException","13":"Icewind\SMB\Exception\ForbiddenException","16":"Icewind\SMB\Exception\FileInUseException","17":"Icewind\SMB\Exception\AlreadyExistsException","20":"Icewind\SMB\Exception\InvalidTypeException","21":"Icewind\SMB\Exception\InvalidTypeException","22":"Icewind\SMB\Exception\InvalidArgumentException","28":"Icewind\SMB\Exception\OutOfSpaceException","39":"Icewind\SMB\Exception\NotEmptyException","110":"Icewind\SMB\Exception\TimedOutException","111":"Icewind\SMB\Exception\ConnectionRefusedException","112":"Icewind\SMB\Exception\HostDownException","113":"Icewind\SMB\Exception\NoRouteToHostException"},13,"/Public"]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":74,"function":"handleError","class":"Icewind\SMB\Native\NativeState","type":"->","args":["/Public"]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":184,"function":"testResult","class":"Icewind\SMB\Native\NativeState","type":"->","args":["*** sensitive parameter replaced ","smb://172.30.1.20/laurentq/Public"]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php","line":133,"function":"stat","class":"Icewind\SMB\Native\NativeState","type":"->","args":["smb://172.30.1.20/laurentq/Public"]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php","line":98,"function":"getStat","class":"Icewind\SMB\Native\NativeShare","type":"->","args":["//Public"]},{"function":"Icewind\SMB\Native\{closure}","class":"Icewind\SMB\Native\NativeShare","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php","line":82,"function":"call_user_func","args":[{"class":"Closure"}]},{"file":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php","line":99,"function":"stat","class":"Icewind\SMB\Native\NativeFileInfo","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":292,"function":"getMTime","class":"Icewind\SMB\Native\NativeFileInfo","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":277,"function":"shareMTime","class":"OCA\Files_External\Lib\Storage\SMB","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Common.php","line":452,"function":"stat","class":"OCA\Files_External\Lib\Storage\SMB","type":"->","args":[""]},{"file":"/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":578,"function":"test","class":"OC\Files\Storage\Common","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/files_external/lib/config.php","line":269,"function":"test","class":"OCA\Files_External\Lib\Storage\SMB","type":"->","args":[" sensitive parameter replaced "," sensitive parameter replaced "]},{"file":"/var/www/nextcloud/apps/files_external/lib/Controller/StoragesController.php","line":256,"function":"getBackendStatus","class":"OC_Mount_Config","type":"::","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/apps/files_external/lib/Controller/UserGlobalStoragesController.php","line":121,"function":"updateStorageStatus","class":"OCA\Files_External\Controller\StoragesController","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":166,"function":"show","class":"OCA\Files_External\Controller\UserGlobalStoragesController","type":"->","args":[6," sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Files_External\Controller\UserGlobalStoragesController"},"show"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":126,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Files_External\Controller\UserGlobalStoragesController"},"show"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OCA\Files_External\Controller\UserGlobalStoragesController","show",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"id":"6","_route":"files_external.user_global_storages.show"}]},{"function":"__invoke","class":"OC\AppFramework\Routing\RouteActionHandler","type":"->","args":[{"id":"6","_route":"files_external.user_global_storages.show"}]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"class":"OC\AppFramework\Routing\RouteActionHandler"},{"id":"6","_route":"files_external.user_global_storages.show"}]},{"file":"/var/www/nextcloud/lib/base.php","line":975,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/files_external/userglobalstorages/6"]},{"file":"/var/www/nextcloud/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/Exception.php","Line":30,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0","version":"16.0.1.1"}

  6. rik26 commented on Jun 5, 2019

    @rik26
    Ok solved it. I tried to understand how to make a pull request but i'm not a software engineer...
    
    Here is the code i modified :
    
    In 
    /apps/files_external/lib/Lib/Storage/SMB.php :
    
    /**
             * get the best guess for the modification time of the share
             *
             * @return int
             */
            private function shareMTime() {
                    $highestMTime = 0;
                    $files = $this->share->dir($this->root);
                    foreach ($files as $fileInfo) {
                            try {
                                    if ($fileInfo->getMTime() > $highestMTime) {
                                            $highestMTime = $fileInfo->getMTime();
                                    }
                            } catch (NotFoundException $e) {
                                    // Ignore this, can happen on unavailable DFS shares
     -                        }
     +                       } catch (ForbiddenException $e) {
     +                               // Ignore this too : symlink
     +                       }
                    }
                    return $highestMTime;
            }
    
    
    
  7. MorrisJobke commented on Jul 2, 2019

    @MorrisJobke
    Member

    The fix by @rik26 is in #16195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions