Hi there.

Has anyone got experience with accessing file permission rights on windows machines (NTFS file permissions that is)?
more precise: I am wondering if there is a way of reading DACLs (thats Discretionary Access Control List - windows uses those things to save file rights) on the machine my webserver is running on.

I have tried the usual php file functions, but they're *nix tools and can't read DACLs or so it seems... which is ok.

Well.
The machine I have to use (external reasons) is a win2k/sp4 server, apache 2.0.55 and php 5.1.2, the whole thing exists in a windows environment with various win domains and so on.

The reason for asking this mad question at all is that I can get all the LDAP information on my users from the domain easily but unless I can read the file rights on the shares to be accessed I will have to create a php readable file right management parallel to the existing one in windows - for some 30 or 40 thousand files.

Which I dont want to do unless I can avoid it 🙂

neither googling nor digging in to manuals so far has brought more than a shrug and "why would you do that anyway", so I'm asking here.

Obviously I would be grateful even for a shove in the right direction.

Thanks in advance,
jakob

    Probably the long way around, but there is a command-line tool cacls that's in many versions of windows. You could call that program from your code redirecting the output to a text file, then parse the text file to figure out the permission info.

    Probably you need to be an administrator user to run that program though, so a normal web page might not have permissions to view the permissions.

      Hi.

      Thanks for the hint.
      Thats a starting point at least.

      jakob

        Write a Reply...