File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,11 @@ impl OpenOptions {
191
191
pub fn access_mode ( & mut self , access_mode : u32 ) { self . access_mode = Some ( access_mode) ; }
192
192
pub fn share_mode ( & mut self , share_mode : u32 ) { self . share_mode = share_mode; }
193
193
pub fn attributes ( & mut self , attrs : u32 ) { self . attributes = attrs; }
194
- pub fn security_qos_flags ( & mut self , flags : u32 ) { self . security_qos_flags = flags; }
194
+ pub fn security_qos_flags ( & mut self , flags : u32 ) {
195
+ // We have to set `SECURITY_SQOS_PRESENT` here, because one of the valid flags we can
196
+ // receive is `SECURITY_ANONYMOUS = 0x0`, which we can't check for later on.
197
+ self . security_qos_flags = flags | c:: SECURITY_SQOS_PRESENT ;
198
+ }
195
199
pub fn security_attributes ( & mut self , attrs : c:: LPSECURITY_ATTRIBUTES ) {
196
200
self . security_attributes = attrs as usize ;
197
201
}
@@ -239,7 +243,6 @@ impl OpenOptions {
239
243
self . custom_flags |
240
244
self . attributes |
241
245
self . security_qos_flags |
242
- if self . security_qos_flags != 0 { c:: SECURITY_SQOS_PRESENT } else { 0 } |
243
246
if self . create_new { c:: FILE_FLAG_OPEN_REPARSE_POINT } else { 0 }
244
247
}
245
248
}
You can’t perform that action at this time.
0 commit comments