this post was submitted on 08 Jul 2024
500 points (97.0% liked)

Programmer Humor

32559 readers
573 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 25 points 4 months ago (3 children)

chown won't alter the ACLs set by setfacl (which is much closer to the permission model Windows follows).

On Windows, you can use takeown /f "path" /r to recursively set the owner on a directory. Powershell can do more fine-grained control if necessary.

The problem with this and your proposed Linux solution is that most normal users don't know any command line tools and just want a button to access their files. Windows does have this, but it doesn't always work reliably. On Linux it depends on the file manager, but I don't think any of them support setfacl-style permissions.

[–] [email protected] 11 points 4 months ago (2 children)

In which case you could also go right-click -> properties -> security -> advanced -> click change where it lists the owner.

It's not as quick but hey, mouse-driven UI exists.

[–] [email protected] 5 points 4 months ago

I think I had this guy's exact issue and maybe even stumbled upon his comment in that Microsoft support forum thread. It looks very familiar, but I could have just seen the meme before.

My problem was that I needed to do this for 100+ files, so using the UI individually for each file was out of the question. The eventual solution I found was in this tutorial for adding a context menu entry that changes folder/file ownership recursively. It's been very useful!

[–] [email protected] 1 points 4 months ago

That's exactly what the guy in the opening post was told to do, and at least to him that's a big problem.

[–] [email protected] 3 points 4 months ago (1 children)

The fact that Andrew might have to run this at all means Windows has fucked up. He should not need to learn about this to use his files. Obviously he shouldn't have permissions to system files but that's clearly not what he actually wants.

[–] [email protected] 1 points 4 months ago* (last edited 4 months ago) (1 children)

Windows defaults to giving a user access to common folders like a desktop, pictures, etc. Most never need anymore access to internal folders.

The fact that Andrew has the permissions settings open enough to discover "owner" but doesnt understand what any of it is means and instead launched a "don't tread on me" screed about his "dominion of all things mine" implies that he fucked up, not Microsoft.

[–] [email protected] 1 points 4 months ago* (last edited 4 months ago) (1 children)

How did his user account lose permissions to a folder of pictures?

He didn't "discover owner" by opening any permission settings. He is simply asserting that he is the owner of the pictures he took, in a non-technical sense.

[–] [email protected] 1 points 4 months ago* (last edited 4 months ago)

He doesnt talk about pictures at all. That was someone elses supposition.

It's not clear from the snippet of text what the issue is, but it sure looks like he opened up the folder ACLs and found that his account wasn't "Owner" for some folder/files, and now hes mad that he is being made to elevate his own account for that folder, because "He is the OWNER!" of the files in a property rights context.

[–] [email protected] 2 points 4 months ago

Ah, ACLs, had the pleasure of working with these again last weeks.

It gets really curious when even the Arch wiki doesn't really know what's going on (talking about mask and effective permissions):

The factual accuracy of this article or section is disputed.

Reason: The original note about the --mask option (which was taken from setfacl(1)) was determined as inaccurate, but the new note does not seem correct either. See the talk page for details.

From trying, I can confirm that the info presented further down is wrong.

Once you read what it actually does and why it's the way it is, it makes more sense - not that I remember it now - but at least there was a coherent design decision behind it