UNIX_FD in practice?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ruby
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
Start at the DBus::Object NewConnection declaration and the RegisterProfile call shown in the issue, then reproduce the Bluetooth connection while watching the dbus monitor output. Trace why the method call containing a file descriptor is rejected before the callback runs; done means the callback receives the descriptor without the NotSupported error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Heya!
I'm using ruby-dbus to attempt a Bluetooth serial profile callback, and I'm
running into a "Tried to send message with Unix file descriptors to a client that
doesn't support that." error message from dbus.
It's entirely possible I'm defining the callback incorrectly, but I think that's
correct. Example profile definition and registration (as defined here)
class SerialConnection < DBus::Object
dbus_interface( 'org.bluez.Profile1' ) do
dbus_method( :Release ) do
puts "... release"
nil
end
dbus_method( :NewConnection, "in device:o, in fd:h, in fd_props:a{sv}" ) do |device, fd, fd_props|
puts "... incoming connection %p %p %p" % [ device, fd, fd_props ]
# sock = Socket.for_fd( fd )
# ...
nil
end
dbus_method( :RequestDisconnection, "in device:o" ) do |device|
puts "... disconnect"
nil
end
end
end
serial_conn = SerialConnection.new( '/serial/connection' )
bluez_service = DBus::SystemBus.instance.service( 'org.bluez' ).introspect
bluez_profile_manager = bluez_service[ '/org/bluez' ][ 'org.bluez.ProfileManager1' ]
bluez_profile_manager.RegisterProfile( serial_conn.path, '1101', {
'Name' => 'Serial Port',
'Role' => 'server',
'RequireAuthorization' => false,
'Channel' => DBus.variant( 'q', 22 )
});
# ... enter dbus main loop here
When an RFCOMM compatible client connects, the dbus monitor shows it disconnect
immediately (the callback doesn't fire at all).
signal time=1649451498.238931 sender=:1.2 -> destination=(null destination) serial=870 path=/org/bluez/hci0/dev_0C_8D_CA_99_D7_E7; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Device1"
array [
dict entry(
string "Connected"
variant boolean true
)
]
array [
]
method call time=1649451498.709483 sender=:1.2 -> destination=:1.73 serial=871 path=/serial/connection; interface=org.bluez.Profile1; member=NewConnection
object path "/org/bluez/hci0/dev_0C_8D_CA_99_D7_E7"
file descriptor
inode: 72836 type: socket
address family: bluetooth
array [
]
error time=1649451498.709751 sender=org.freedesktop.DBus -> destination=:1.2 error_name=org.freedesktop.DBus.Error.NotSupported reply_serial=871
string "Tried to send message with Unix file descriptorsto a client that doesn't support that."
signal time=1649451503.316416 sender=:1.2 -> destination=(null destination) serial=872 path=/org/bluez/hci0/dev_0C_8D_CA_99_D7_E7; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Device1"
array [
dict entry(
string "Connected"
variant boolean false
)
]
array [
]
It seems like it's complaining specifically about the second argument to the
NewConnection method.
file descriptor
inode: 72836 type: socket
address family: bluetooth
Is there a different path I should be taking to tackle this?
Thanks for any insight provided.
- Ngôn ngữ chính
- Ruby
- Star
- 174
- Fork
- 51
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mvidner/ruby-dbus
-
Specify rexml versioningĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Rexml or Nokogiri?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
NetworkManager.Settings.Connection cannot round-trip, calling Update with what GetSettings returnedĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của mvidner/ruby-dbus
Issue tương tự
-
kotlin-lsp is missingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
JetBrains/homebrew-utils#21 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ublue-os/homebrew-experimental-tap#774 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
slovensko-digital/ops-portal#212 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Don't expose useless actions....Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Local evaluation buckets percentage splits with the server key, so results differ from FlagsmithĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100