Pseudo-code for a path-restricted chown script:



* Check User/Path Mapping (user perm)

* Get/Clean Input

* Get real path (follow symlinks)

? If User && Path OK

  * Make chown system call