开发者

clarity on permissions in windows

开发者 https://www.devze.com 2022-12-21 21:00 出处:网络
I开发者_如何转开发 work on linux. I donot have much idea in windows. How the permissions of files are organized in windows? Do we have any api like chmod in unix to change the permissions?for windows

I开发者_如何转开发 work on linux. I donot have much idea in windows. How the permissions of files are organized in windows? Do we have any api like chmod in unix to change the permissions?


for windows there is a tool called cacls, but it behaves differently than chmod, so you would better to read docs: http://technet.microsoft.com/en-us/library/bb490872.aspx


The Win32 API has a function named SetFileAttributes for managing file attributes, among them permissions.

Here's an example from MSDN.


The security model in Windows NT-based systems is very different from the Unix one that the overwhelming majority of Linux systems use. They work from ACLs (Access Control Lists) and can get very ornate in terms of who gets what permission where. Further they apply to almost every (perhaps even every?) object in the Win32 API, not just files. (This doesn't apply to the pathological FAT file systems if memory serves.)

I would recommend looking closely at how the Win32 security model works before you start messing with tools like cacls (the closest to chmod you're going to find) because you can hurt your system pretty badly if you mess with permissions without understanding them. It's a whole lot more complex than vanilla Linux.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号