是否可以将永久性小组设置为文件?
我有一个文件,我试图将其主要组更改为 localsystemsid
( s-1-5-32-544
), a>函数。
只要程序正在运行,它都可以正常工作。
当我再次启动程序时,主组返回为 s-1-5-21-<域> -513
(使用 getgroup
getGroup ):
string path = @"c:\tmp\myfile.txt";
FileSecurity accessControl = new FileInfo(path).GetAccessControl();
// S-1-5-32-544
IdentityReference localSystemGroup = new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null);
// S-1-5-21-<domain>-513
IdentityReference group = accessControl.GetGroup(typeof(SecurityIdentifier));
// Primary group changed to S-1-5-32-544
accessControl.SetGroup(localSystemGroup);
// Next run it will become S-1-5-21-<domain>-513 again
IS是否可以将主要群体变为永久?因此,下次我将调用 getGroup
它将返回 localsystemsid
( S-1-1-5-32-544
)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论