开发者

Strange file-permissions if apps run as administrator

My program must be run as administrator and creates some files. If I run it manually by right-click on the icon and selecting "run as administrator" -- everything okay -- all users have access to created files. But if program launched from the another program by ShellExecuteEx with "runas" verb -- created 开发者_开发问答files have no access entry for BUILTIN\Users group. Only administrator users can read those files.


Why not setup the linker flag (VC2008 and higher): Linker -> Manifest -> UAC Execution Level: requireAdministrator (/level='requireAdministrator')

EDIT: I re-read the question, and found that problem is probably with NTFS file-security. This is not your program's fault, but this is by design. Any user who creates files and folders is given permissions to that user only.

Login as administrator user, create a folder. Then re-login as another user (however you like), and try to access/read/write/delete that folder - you cannot. The permissions are granted to administrator user, and not to everyone/users-group.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜