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
Sparkle requesting authentication when it doesn't need it #752
Comments
Hm. It was trying to change ownership on your old app (currently in a temporary directory) to match the user's trash's directory, before attempting to move it into the user's trash. Are permissions set up properly on the user's trash directory? Relevant code: https://github.com/sparkle-project/Sparkle/blob/master/Sparkle/SUFileManager.m#L885 |
I wonder if it's caring about the group being different? Looks like my Trash permissions are left over from OS X using per-user groups.
Maybe I'm missing something security-wise but I don't understand why this matters enough to request authentication. |
Yeah. It's trying to change owner and group of the app to match the trash directory. I am guessing you don't have an actual group name corresponding to gid 501. For me, the group assigned to ~/.Trash is staff. As I understand it, we prefer to mv files because of atomicity, but it has the behavior (unlike of cp) in that it doesn't change owner/group. On OS X, new files that are created use the parent directory's group ID. So if we cp'ed it, it'd use the trash's gid. But we use mv instead, and the question then becomes if we should want to change the group (which requires auth if not already requested). |
…ect#752). Group doesn’t need to match in order to successfully empty the trash.
OK, after some false starts on tackling this problem I think I have an idea how this could work. If the owner doesn't match, clearly we need to authenticate no matter what, and that's fine. If the owner matches and the group is different yet one of the owner's groups, then we can change its group without authenticating. If the owner matches and the group is not one of the owner's groups (as in this case where I'm stuck an old group 501 which no longer exists on the system), I think it makes sense not to change the group at all. Does this make sense? |
Just want to note changing the owner & group is also used when installing the new update (it uses the owner & group from the old app). In this particular case, I think it sounds reasonable to match the group. Is the owner more important? What about vise versa: if the owner doesn't match, but the group does and we don't really have to authenticate, but do anyway. Can that happen? Perhaps the safest assuming thing is not changing owner & group at all. This could be a little unfortunate though because I assume the user may have to enter a password to empty their trash. There's also the argument/perspective that user's trash directory needs to be repaired. |
Submitted a pull request in #790 that is intended to "fix" this. Though the app may not be successfully moved to the trash in this scenario, it won't request authorization during cleanup which I think is more important. |
I just updated an app to Sparkle 1.13.1. Now, when I try to update it, it prompts me for my password even though it's installed in a writable directory. This prompt seems to happen after the update is installed.
The corresponding log entries appear to be:
Is Sparkle trying to change ownership on a file in the Trash?
The text was updated successfully, but these errors were encountered: