Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

access.ftp fails to check if files are writable #634

Closed
wants to merge 1 commit into from

Conversation

chusopr
Copy link
Contributor

@chusopr chusopr commented Sep 2, 2014

I've found that, to check if a repository file is writable, access.ftp seems to check if web server user can write to that file. But this check is wrong for FTP repositories, it should check if FTP user can write to that file, not web server user.
Thus, delete/rename/etc. buttons are only enabled when files are owned by web server user (www-data or whatever) and not when they belong to FTP user currently logged in.
May it be related to issue #429? I already tried the patch there with no success.

@chusopr
Copy link
Contributor Author

chusopr commented Sep 2, 2014

I just attached a patch to this issue, but for sure it will need to be improved. Is more a quick hack than an actual fix.

chusopr added a commit to ultreia-es/pydio-core that referenced this pull request Sep 2, 2014
@cdujeu
Copy link
Member

cdujeu commented Sep 2, 2014

normally, all that is taken care of with the "User ID" parameter of the FTP workspace parameters, plus the "Fix Permissions" parameter that can be set to "copy users permissions"... Did you try to tweak those ones before hacking?

@chusopr
Copy link
Contributor Author

chusopr commented Sep 3, 2014

Ah, I forgot to mention that I'm using session credentials as FTP login.
And using "copy user permissions" causes all files writable by its owner to appear as writable by Pydio, even if logged FTP user does not own the file.

chusopr added a commit to ultreia-es/pydio-core that referenced this pull request Nov 25, 2014
$credentials = AJXP_Safe::tryLoadingCredentialsFromSources($urlParts, $repository);
if (empty($credentials["user"]))
return is_writable($path);
if ((string)$stat["uid"] == $credentials["user"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding your comments, this $stat["uid"] is in fact returning a numerical value or here it's can really be the user name?

@cdujeu
Copy link
Member

cdujeu commented Sep 21, 2016

closing, too old, reopen if needed.

@cdujeu cdujeu closed this Sep 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants