Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

occ audioplayer:scan unknown_user #93

Closed
eplusk opened this issue Nov 23, 2016 · 5 comments
Closed

occ audioplayer:scan unknown_user #93

eplusk opened this issue Nov 23, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@eplusk
Copy link

eplusk commented Nov 23, 2016

root@ncserver:~# sudo -u www-data php /var/www/nextcloud/occ audioplayer:scan klaus
Wrong user-name klaus --> Klaus

Expected behavior

telling: unknown user,

Actual behavior

audioplayer tries to find the music and installed in nextcloud/data the default directories and the default files for the wrong user klaus

Possible solution (optional)

first check if known user

Server configuration

Operating system:
Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-1029-raspi2 armv7l)

Web server:
nginx_1.11.5-1~xenial_armhf

Database:
mariadb

PHP version:
php7.0

ownCloud/Nextcloud version: (see /status.php)
nextcloud 10.0.1

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

Where did you install Audio Player from:
audioplayer-1.3.0.tar.gz with wget

Are you using external storage, if yes which one: local/smb/sftp/...
yes local , system mounted CIFS filesystem

Are you using encryption: yes/no
no

Client configuration

Operating system:
Kubuntu 16.4 LTS

Browser:
Firefox 50.0

@ghost ghost changed the title unknown/wrong user occ audioplayer:scan unknown_user Nov 23, 2016
Rello added a commit that referenced this issue Nov 24, 2016
@Rello Rello self-assigned this Nov 24, 2016
@Rello Rello added this to the 1.3.2 milestone Nov 24, 2016
@Rello Rello added the bug label Nov 24, 2016
@Rello
Copy link
Owner

Rello commented Nov 24, 2016

a check for an existing user is missing
$this->userManager->userExists($user)

@eplusk
Copy link
Author

eplusk commented Nov 25, 2016

Test after occ audioplayer:scan unknown_user and validate if user actually exists #93

I manually included the patch and tested the occ audioplayer:scan

root@ncserver:~# sudo -u www-data php /var/www/nextcloud/occ audioplayer:scan klaus --debug
Start scan for klaus
Scanned Folder: /klaus/files
Total audio files: 0
Checking all files whether they can be skipped
Final audio files to be processed: 0
Start processing of ID3s
Audios found: 0
Duplicates found: 0
Written to music library: 0
Albums found: 0
Errors: 0
root@ncserver:~# ll /var/nc_data/
total 700
drwxrwx--- 11 www-data www-data   4096 Nov 25 12:25 ./
drwxr-xr-x 15 root     root       4096 Oct 27 21:55 ../
drwxr-xr-x  2 www-data www-data   4096 Oct 28 17:10 files_external/
-rw-r--r--  1 root     www-data    284 Oct 28 14:24 .htaccess
-rw-r--r--  1 www-data www-data      0 Oct 28 14:24 index.html
drwxr-xr-x  3 www-data www-data   4096 Nov 25 12:25 klaus/
drwxr-xr-x  7 www-data www-data   4096 Nov 17 21:01 Klaus/
drwxr-xr-x  6 www-data www-data   4096 Nov 10 20:44 ncadmin/
-rw-r-----  1 www-data www-data 499139 Nov 24 21:23 nextcloud.log
-rw-r--r--  1 www-data www-data      0 Oct 28 14:24 .ocdata
-rw-r--r--  1 www-data www-data 162112 Nov  1 11:16 themedbackgroundlogo

It seemes the error has not disappeared.

Then I tried to delete the wrong user

root@ncserver:~# sudo -u www-data php /var/www/nextcloud/occ user:delete klaus
The specified user was deleted

root@ncserver:~# ll /var/nc_data/
total 696
drwxrwx--- 10 www-data www-data   4096 Nov 25 12:27 ./
drwxr-xr-x 15 root     root       4096 Oct 27 21:55 ../
drwxr-xr-x  2 www-data www-data   4096 Oct 28 17:10 files_external/
-rw-r--r--  1 root     www-data    284 Oct 28 14:24 .htaccess
-rw-r--r--  1 www-data www-data      0 Oct 28 14:24 index.html
drwxr-xr-x  3 www-data www-data   4096 Nov 25 12:25 klaus/
drwxr-xr-x  6 www-data www-data   4096 Nov 10 20:44 ncadmin/
-rw-r-----  1 www-data www-data 499139 Nov 24 21:23 nextcloud.log
-rw-r--r--  1 www-data www-data      0 Oct 28 14:24 .ocdata
-rw-r--r--  1 www-data www-data 162112 Nov  1 11:16 themedbackgroundlogo

Again I tried to delete the non-existent user

root@ncserver:~# sudo -u www-data php /var/www/nextcloud/occ user:delete klaus
User does not exist

The default directories and the default files for the non-existent user klaus are in Nextcloud Data-directory.
But the real user Klaus and his data vanished.!!

Second test: really unknown user

root@ncserver:~# sudo -u www-data php /var/www/nextcloud/occ audioplayer:scan blabla --debug
Unknown user blabla

Validation if user actually exists #93 was successful.

Conclusion: This new error looks like not distinguishing between Klaus and klaus and klauS.

I think its an server problem, not an audioplayer problem.

@eplusk eplusk closed this as completed Nov 25, 2016
@ghost
Copy link

ghost commented Nov 25, 2016

But the real user Klaus and his data vanished.!!

Because user klaus did not exist, Klaus was deleted. That's a bug in server, imo.

"Login names may contain letters (a-z, A-Z), numbers (0-9), dashes (-), underscores (), periods (.) and at signs (@)."_ (Source) – No info about case sensitivity.

@ghost ghost reopened this Nov 25, 2016
@ghost ghost added the in progress label Nov 25, 2016
@Rello
Copy link
Owner

Rello commented Nov 26, 2016

Issue for "userExists($user) not case sensitive"
owncloud/core#26727

Rello added a commit that referenced this issue Nov 26, 2016
Rello added a commit that referenced this issue Nov 28, 2016
Rello added a commit that referenced this issue Nov 28, 2016
@Rello
Copy link
Owner

Rello commented Dec 3, 2016

background:
the creation of a folder for a mistyped user was introduced here
nextcloud/server@fb88d66

@Rello Rello changed the title occ audioplayer:scan unknown_user fix: occ audioplayer:scan unknown_user Dec 3, 2016
@ghost ghost modified the milestones: 1.4.0, 1.3.2 Dec 3, 2016
Rello added a commit that referenced this issue Dec 5, 2016
fix: catch special characters in album #87
fix: occ catch unknown user #93
fix: correct album sort order to case-insensitive
fix: first search result row is partially hidden under the top menu #74
enhancement: Ukrainian translation #94
enhancement: folders as additional filter category #98
enhancement: search for cover in album folder #24
enhancement: Opus support #92
@ghost ghost removed the pending release label Dec 15, 2016
@ghost ghost closed this as completed Dec 15, 2016
@ghost ghost changed the title fix: occ audioplayer:scan unknown_user occ audioplayer:scan unknown_user Feb 12, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants