Skip to content

Commit 31b8fad

Browse files
committed
Allow SIDs to be set by strings
1 parent d96d980 commit 31b8fad

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

lib/rex/proto/ms_dtyp.rb

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,10 @@ def initialize_shared_instance
683683

684684
def initialize_instance
685685
value = super
686-
@owner_sid = get_parameter(:owner_sid)
687-
@group_sid = get_parameter(:group_sid)
688-
@sacl = get_parameter(:sacl)
689-
@dacl = get_parameter(:dacl)
686+
self.owner_sid = get_parameter(:owner_sid)
687+
self.group_sid = get_parameter(:group_sid)
688+
self.sacl = get_parameter(:sacl)
689+
self.dacl = get_parameter(:dacl)
690690
value
691691
end
692692

@@ -716,7 +716,18 @@ def snapshot
716716
snap
717717
end
718718

719-
attr_accessor :owner_sid, :group_sid, :sacl, :dacl
719+
def owner_sid=(sid)
720+
sid = MsDtypSid.new(sid) unless sid.nil? || sid.is_a?(MsDtypSid)
721+
@owner_sid = sid
722+
end
723+
724+
def group_sid=(sid)
725+
sid = MsDtypSid.new(sid) unless sid.nil? || sid.is_a?(MsDtypSid)
726+
@group_sid = sid
727+
end
728+
729+
attr_accessor :sacl, :dacl
730+
attr_reader :owner_sid, :group_sid
720731

721732
private
722733

0 commit comments

Comments
 (0)