Taking Ownership Fails With UNC Path, Works Locally!?! Why?

  • Security
  • Published Jul 28, 2010 Updated Jul 14, 2019

Here is an interesting tidbit related to Windows security:

  1. Create a test file share, e.g. C:\temp\test, and share it with full permissions for everyone (share, not NTFS permissions) as “test”
  2. Create the following directory hierarchy below the share: C:\temp\test\1\2\3\4
  3. Assign ownership of the four folders 1, 2, 3 and 4 to any user (but do not use your own account, just anyone else’s)
  4. Set permissions on 1, 2, 3 and 4 that only the user from the previous step has full access, nobody else, not even the SYSTEM
  5. Now try to use SetACL to change the owner of directory “4” over the network (SetACL uses backup and restore privileges so this should be no problem) by issuing the following command locally:
    setacl -on \localhost\test\1\2\3\4 -ot file -actn setowner -ownr n:domain\administrator
  6. SetACL will fail with access denied (full message: “ERROR: Writing SD to <\?\UNC\localhost\test\1\2\3\4> failed with: Access is denied.”)
  7. Now issue the same command, but instead of using a UNC path use the local drive letter:
    setacl -on c:\temp\test\1\2\3\4 -ot file -actn setowner -ownr n:domain\administrator
  8. That works!

Why is this so? I have no clue.

This is also documented in the FAQ for SetACL.

Comments

Related Posts

How Forcing Password Changes Actually Weakens Security

How Forcing Password Changes Actually Weakens Security
When was the last time you got that not too friendly message stating that your password has expired and asking you to change it? Probably only a few weeks ago, and just as sure as day follows night, it is going to appear again only too soon. At least that is the typical user’s point of view. Security conscious administrators see this differently: they seem to think that passwords become weaker over time, like human beings growing old, and therefore force a rejuvenation process every couple of weeks. But is that really necessary? I do not think so.
Security

Latest Posts

Beautiful Slide Decks from Markdown: Presenting with Slidev

Beautiful Slide Decks from Markdown: Presenting with Slidev
Would you like to get away from PowerPoint and author slide decks in Markdown? Then Slidev may be just what you’re looking for. It’s a web app for presentations. The fact that it’s geared towards developers shouldn’t put you off. After all, who isn’t a developer these days, with AI? Slidev comes with the beautiful Tahta themes and supports features like syntax highlighting and animations. Export options to PDF and PPTX allow for easy sharing. This article shows how to get started.
Applications