owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.36k stars 179 forks source link

share created with wrong file_path for sub folder resource #2201

Closed kiranparajuli589 closed 2 months ago

kiranparajuli589 commented 3 years ago

Describe the bug

A clear and concise description of what the bug is.

Steps to reproduce

Steps to reproduce the behavior:

  1. create two users uu1 and uu2
  2. create folders test and test/sub using user uu1
  3. share test/sub with user uu2 using user uu1

Expected behavior

Response on oc10 backend:

<?xml version="1.0"?>
<ocs>
    <meta>
        <status>ok</status>
        <statuscode>100</statuscode>
        <message/>
        <totalitems></totalitems>
        <itemsperpage></itemsperpage>
    </meta>
    <data>
        <id>1813</id>
        <share_type>0</share_type>
        <uid_owner>uu1</uid_owner>
        <displayname_owner>uu1</displayname_owner>
        <permissions>1</permissions>
        <stime>1624356401</stime>
        <parent/>
        <expiration/>
        <token/>
        <uid_file_owner>uu1</uid_file_owner>
        <displayname_file_owner>uu1</displayname_file_owner>
        <additional_info_owner/>
        <additional_info_file_owner/>
        <path>/test/sub</path>
        <mimetype>httpd/unix-directory</mimetype>
        <storage_id>home::uu1</storage_id>
        <storage>4592</storage>
        <item_type>folder</item_type>
        <item_source>2147523745</item_source>
        <file_source>2147523745</file_source>
        <file_parent>2147523744</file_parent>
        <file_target>/sub</file_target>
        <share_with>uu2</share_with>
        <share_with_displayname>uu2</share_with_displayname>
        <share_with_additional_info/>
        <mail_send>0</mail_send>
        <attributes/>
    </data>
</ocs>

Actual behavior

Response on oCIS backend:

<?xml version="1.0" encoding="UTF-8"?>
<ocs>
    <meta>
        <status>ok</status>
        <statuscode>100</statuscode>
        <message>OK</message>
    </meta>
    <data>
        <id>da3bb876-928c-4e87-baa2-4332759d9e4f</id>
        <share_type>0</share_type>
        <uid_owner>uu1</uid_owner>
        <displayname_owner>uu1</displayname_owner>
        <additional_info_owner>uu1@test.oc</additional_info_owner>
        <permissions>1</permissions>
        <stime>1624356083</stime>
        <parent></parent>
        <expiration></expiration>
        <token></token>
        <uid_file_owner>uu1</uid_file_owner>
        <displayname_file_owner>uu1</displayname_file_owner>
        <additional_info_file_owner>uu1@test.oc</additional_info_file_owner>
        <state>0</state>
        <path>/sub</path>
        <item_type>folder</item_type>
        <mimetype>httpd/unix-directory</mimetype>
        <storage_id>1284d238-aa92-42ce-bdc4-0b0000009157</storage_id>
        <storage>0</storage>
        <item_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OmEyYzBmZDJiLTc0Y2UtNDc2Ny1hYTA1LWQ3NjAyOWE5MmFmZg==</item_source>
        <file_source>MTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3OmEyYzBmZDJiLTc0Y2UtNDc2Ny1hYTA1LWQ3NjAyOWE5MmFmZg==</file_source>
        <file_parent></file_parent>
        <file_target>/sub</file_target>
        <share_with>uu2</share_with>
        <share_with_displayname>uu2</share_with_displayname>
        <share_with_additional_info>uu2@test.oc</share_with_additional_info>
        <mail_send>0</mail_send>
        <name></name>
    </data>
</ocs>

Setup

Please describe how you started the server and provide a list of relevant environment variables.

#!/bin/bash
rm -rf /tmp/ocis/

mkdir /tmp/ocis/storage/users -p
mkdir /tmp/ocis/owncloud/data -p

export OCIS_URL=https://localhost:9200
export STORAGE_HOME_DRIVER=$DRIVER
export STORAGE_USERS_DRIVER=$DRIVER
export STORAGE_DRIVER_OCIS_ROOT=/tmp/ocis/storage/users
export STORAGE_DRIVER_LOCAL_ROOT=/tmp/ocis/local/root
export STORAGE_METADATA_ROOT=/tmp/ocis/metadata
export STORAGE_DRIVER_OWNCLOUD_DATADIR=/tmp/ocis/owncloud/data
export STORAGE_HOME_DATA_SERVER_URL=http://localhost:9155/data
export STORAGE_USERS_DATA_SERVER_URL=http://localhost:9158/data
export STORAGE_SHARING_USER_JSON_FILE=/tmp/ocis/shares.json
export PROXY_ENABLE_BASIC_AUTH=True
export WEB_UI_CONFIG=$HOME/www/ocConfigs/ocis-config/ocis-config.json
export IDP_IDENTIFIER_REGISTRATION_CONF=$HOME/www/ocConfigs/ocis-config/idp.yml
export OCIS_LOG_LEVEL="error"
export SETTINGS_DATA_PATH=/tmp/ocis/settings

if [ $DRIVER == "owncloud" ]
then
    export STORAGE_DRIVER_OWNCLOUD_REDIS_ADDR=localhost:6379
else
    export STORAGE_DRIVER_OWNCLOUD_REDIS_ADDR=
fi

$HOME/go/src/github.com/owncloud/ocis/ocis/bin/ocis server

```console ❯ curl -k -u admin:admin https://localhost:9200/status.php | jq ✘ INT  15:52:26 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 197 100 197 0 0 1470 0 --:--:-- --:--:-- --:--:-- 1470 { "installed": true, "maintenance": false, "needsDbUpgrade": false, "version": "10.0.9.5", "versionstring": "10.0.9", "edition": "community", "productname": "ownCloud" } ```

Additional context

Add any other context about the problem here.

ScharfViktor commented 3 years ago

re-tested with local server oCIS version 1.11.0 I can confirm that it is happening

ScharfViktor commented 2 months ago

now we use SharingNG and test is green OCS is deprecated and won't fix