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

.DirIcon not shown if not owned #191

Open
step- opened this issue Jan 22, 2019 · 2 comments
Open

.DirIcon not shown if not owned #191

step- opened this issue Jan 22, 2019 · 2 comments

Comments

@step-
Copy link

step- commented Jan 22, 2019

I customize the folder icon by adding a png icon as file .DirIcon. Normally it works, but sometimes it doesn't and rox continues to display the default icon for the folder. To fix this I change user and group of file .DirIcon to the current user's. Immediately after this change rox displays the new icon as the folder icon.

Do you think you can fix this, please?


running as user root
roxfiler-20190122-001


add icon (owner's user id 510)
roxfiler-20190122-002


you see that the window icon is unchanged
now change the owner and group to root's
roxfiler-20190122-004


you see that now the window icon is changed as it should be
roxfiler-20190122-005


@jun7
Copy link
Owner

jun7 commented Jan 22, 2019

It is caused by following line

if (mc_lstat(pathbuf, &info) != 0 || info.st_uid != uid)

So removing info.st_uid != uid solves it but the comment on the src says

         * .DirIcon and AppRun must have the same owner as the
	 * directory itself, to prevent abuse of /tmp, etc.
	 * For symlinks, we want the symlink's owner.

I don't know how abuse it though.

@step-
Copy link
Author

step- commented Jan 22, 2019

Me neither, I don't know how a ROXapp could abuse /tmp or viceversa. Perhaps he's pointing out /tmp because everyone can write files and folders in /tmp but I still don't understand how that could lead to abuse.
Anyway, if security is a concern, even if we don't understand the details, it's reasonable to enforce same user's ownership. Then you can close this issue with no changes. Thanks for looking at this.

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

No branches or pull requests

2 participants