windows - Copying file security permissions -


i'm copying file folder folder b , trying copy file permissions. here basic steps i'm using:

  1. copyfile(source, target)
  2. getnamedsecurityinfo(source, group_security_information | dacl_security_information)
  3. print source sd using convertsecuritydescriptortostringsecuritydescriptor
  4. setnamedsecurityinfo(target, group_security_information | dacl_security_information)
  5. getnamedsecurityinfo(target, group_security_information | dacl_security_information)
  6. print target sd using convertsecuritydescriptortostringsecuritydescriptor

at #3 sd:

g:s-1-5-21-1454471165-1482476501-839522115-513d:ai(a;id;0x1200a9;;;bu)(a;id;0x1301bf;;;pu)(a;id;fa;;;ba)(a;id;fa;;;sy)(a;id;fa;;;s-1-5-21-1454471165-1482476501-839522115-1004) 

at #6 get

g:s-1-5-21-1454471165-1482476501-839522115-513d:ai(a;id;0x1301bf;;;pu)(a;id;fa;;;ba)(a;id;fa;;;sy) 

the call setnamedsecurityinfo returns error_success, yet results source , target file not have same sds. why that? doing wrong here?

shfileoperation can copy files security attributes, your other question see you're concerned won't work within service. maybe following newsgroup discussions provide useful information you:


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -