File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -831,12 +831,14 @@ def group_sid=(sid)
831
831
832
832
private
833
833
834
+ BUFFER_FIELD_ORDER = %i[ sacl dacl owner_sid group_sid ]
835
+
834
836
def build_buffer
835
837
buf = ''
836
- buf << owner_sid . to_binary_s if owner_sid
837
- buf << group_sid . to_binary_s if group_sid
838
- buf << sacl . to_binary_s if sacl
839
- buf << dacl . to_binary_s if dacl
838
+ BUFFER_FIELD_ORDER . each do | field_name |
839
+ field_value = send ( field_name )
840
+ buf << field_value . to_binary_s if field_value
841
+ end
840
842
buf
841
843
end
842
844
@@ -850,7 +852,7 @@ def offset_for(field)
850
852
return 0 unless instance_variable_get ( "@#{ field } " )
851
853
852
854
offset = buffer . rel_offset
853
- %i[ owner_sid group_sid sacl dacl ] . each do |cursor |
855
+ BUFFER_FIELD_ORDER . each do |cursor |
854
856
break if cursor == field
855
857
856
858
cursor = instance_variable_get ( "@#{ cursor } " )
You can’t perform that action at this time.
0 commit comments