owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.34k stars 2.06k forks source link

files_external:create with --user switch not creating mounts #25345

Closed davidshutter closed 6 years ago

davidshutter commented 8 years ago

Steps to reproduce

  1. run command such as: sudo -u www-data php occ files_external:create --user FEDCBA09-9876-ABCD-4321-FF7312345678 -c datadir=/media/drives/username 'Network Drive' local null::null
    1. run files_external:list

      Expected behaviour

/media/drives/username folder to be mounted as an external storage location for the user with the above UUID shows in files_external:list accessible through webui

Actual behaviour

files_external:create command runs and returns Storage created with id 13 shows in files_external:list FEDCBA09-9876-ABCD-4321-FF7312345678, but not if run without the username no external source shows for user on client side

Server configuration

Operating system: ubuntu 14.04 Web server: apache2 Database: mysql PHP version: 5.5.9 ownCloud version: (see ownCloud admin page) 9.0.3 Updated from an older ownCloud or fresh install: updated from 8.2.6 Where did you install ownCloud from: apt-get from latest repo Signing status (ownCloud 9.0 and above):

No errors have been found.

List of activated apps:

Enabled:
  - activity: 2.2.1
  - comments: 0.2
  - dav: 0.1.6
  - external: 1.2
  - federatedfilesharing: 0.1.0
  - federation: 0.0.4
  - files: 1.4.4
  - files_antivirus: 0.8.0.2
  - files_external: 0.5.2
  - files_pdfviewer: 0.8.1
  - files_sharing: 0.9.1
  - files_texteditor: 2.1
  - files_trashbin: 0.8.0
  - files_versions: 1.2.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 14.5.0
  - notifications: 0.2.3
  - provisioning_api: 0.4.1
  - systemtags: 0.2
  - templateeditor: 0.1
  - updatenotification: 0.1.0
  - user_ldap: 0.8.0
Disabled:
  - encryption
  - user_external

The content of config/config.php:

{
    "system": {
        "instanceid": "oczqd2w1jd3d",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "9.0.3.2",
        "dbname": "ownclouddb",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "mail_from_address": "vle_admin",
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "smtp.office365.com",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "theme": "",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "loglevel": 0,
        "maintenance": false,
        "trashbin_retention_obligation": "auto",
        "updatechecker": false
    }
}

Are you using external storage, if yes which one: local

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)

+-------------------------------+-------------------------------------------------------------------------------+
| Configuration                 |                                                                               |
+-------------------------------+-------------------------------------------------------------------------------+
| hasMemberOfFilterSupport      | 1                                                                             |
| hasPagedResultSupport         |                                                                               |
| homeFolderNamingRule          | attr:sAMAccountName                                                           |
| lastJpegPhotoLookup           | 0                                                                             |
| ldapAgentName                 | CN=moodle admin,CN=Builtin,DC=nsnet,DC=net                                    |
| ldapAgentPassword             | ***                                                                           |
| ldapAttributesForGroupSearch  |                                                                               |
| ldapAttributesForUserSearch   |                                                                               |
| ldapBackupHost                |                                                                               |
| ldapBackupPort                |                                                                               |
| ldapBase                      | DC=nsnet,DC=net                                                               |
| ldapBaseGroups                | DC=nsnet,DC=net                                                               |
| ldapBaseUsers                 | DC=nsnet,DC=net                                                               |
| ldapCacheTTL                  | 600                                                                           |
| ldapConfigurationActive       | 1                                                                             |
| ldapDynamicGroupMemberURL     |                                                                               |
| ldapEmailAttribute            |                                                                               |
| ldapExperiencedAdmin          | 0                                                                             |
| ldapExpertUUIDGroupAttr       |                                                                               |
| ldapExpertUUIDUserAttr        |                                                                               |
| ldapExpertUsernameAttr        |                                                                               |
| ldapGroupDisplayName          | cn                                                                            |
| ldapGroupFilter               |                                                                               |
| ldapGroupFilterGroups         |                                                                               |
| ldapGroupFilterMode           | 0                                                                             |
| ldapGroupFilterObjectclass    |                                                                               |
| ldapGroupMemberAssocAttr      | uniqueMember                                                                  |
| ldapHost                      | 10.60.112.51                                                                  |
| ldapIgnoreNamingRules         |                                                                               |
| ldapLoginFilter               | (&(&(|(objectclass=person)))(|(sAMAccountName=%uid)))) |
| ldapLoginFilterAttributes     | sAMAccountName                                                                |
| ldapLoginFilterEmail          | 0                                                                             |
| ldapLoginFilterMode           | 1                                                                             |
| ldapLoginFilterUsername       | 1                                                                             |
| ldapNestedGroups              | 0                                                                             |
| ldapOverrideMainServer        |                                                                               |
| ldapPagingSize                | 500                                                                           |
| ldapPort                      | 389                                                                           |
| ldapQuotaAttribute            |                                                                               |
| ldapQuotaDefault              |                                                                               |
| ldapTLS                       | 0                                                                             |
| ldapUserDisplayName           | sAMAccountName                                                                |
| ldapUserDisplayName2          |                                                                               |
| ldapUserFilter                | (&(|(objectclass=person)))                                                    |
| ldapUserFilterGroups          |                                                                               |
| ldapUserFilterMode            | 0                                                                             |
| ldapUserFilterObjectclass     | person                                                                        |
| ldapUuidGroupAttribute        | auto                                                                          |
| ldapUuidUserAttribute         | auto                                                                          |
| turnOffCertCheck              | 0                                                                             |
| useMemberOfToDetectMembership | 1                                                                             |
+-------------------------------+-------------------------------------------------------------------------------+
PVince81 commented 8 years ago

Seems it's not only for "local" storages.

I tried the following locally:

% sudo -u wwwrun php occ files_external:create --user user1 /smb smb password::password
Storage created with id 1
% sudo -u wwwrun php occ files_external:list user1
+----------+-------------+------------+-----------------------+---------------+-----------------------+
| Mount ID | Mount Point | Storage    | Authentication Type   | Configuration | Options               |
+----------+-------------+------------+-----------------------+---------------+-----------------------+
| 1        | /smb        | SMB / CIFS | Username and password |               | enable_sharing: false |
+----------+-------------+------------+-----------------------+---------------+-----------------------+

Even if I allow users to mount "SMB", the mount doesn't appear. That must be a bug.

However in your case @davidshutter you are trying to mount a "local" storage as user. So the bug is that the command should not allow it at all instead of saying ok. Only admins are allowed to mount "local" storages. Please try mounting it without "--user" and then use the ":applicable" command to scope the mount only for that specific user.

Let's keep this ticket open to provide a better error output for the commands.

ownclouders commented 6 years ago

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

PVince81 commented 6 years ago

Low priority and rare case. If anyone is interested in contributing, feel free to reopen.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.