Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/net/sftp/protocol/04/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ def prepare_serialization!
# were given on instantiation
owner
group

# The subsecond flag applies to every timestamp present in the packet.
subseconds = self.class.elements.select { |_name, _type, flags| flags & F_SUBSECOND_TIMES != 0 }
if subseconds.any? { |name, _type, _flags| attributes[name] }
subseconds.each do |name, _type, _flags|
seconds = name.to_s.sub(/_nseconds\z/, "").to_sym
attributes[name] ||= 0 if attributes[seconds]
end
end
end

# Performs protocol-version-specific encoding of the access control
Expand Down