0

The company I am working at has an intranet based on asp.net which uses the windows domain users (active directory) to authenticate users and handle permissions. One feature of the app is that a user can see a directory structure, but only the entries where he has permissions for. The permissions are stored in the filesystem and then compared to the users permissions from LDAP.

The company wants to move the backend away from .net to php. Now I am looking for a way to replicate that feature.

Is there a way to read the ntfs permissions in PHP when the webserver is running on a linux host and the ntfs filesystem is a network share? Creating an LDAP bind is no problem and I guess so is getting the users permissions. Now I would need the files/folders permission to compare.

Or is there maybe another way I am not considering right now, like impersonating a user?

rootman
  • 660
  • 1
  • 8
  • 18

1 Answers1

0

You can use built-in utility cacls or newer icacls. https://technet.microsoft.com/en-us/library/cc753525%28v=ws.10%29.aspx

Run it and parse its output.

P.S. Useful function to run program with timeout: shell_exec() timeout management & exec()

Community
  • 1
  • 1
Vladislav Ross
  • 541
  • 5
  • 6