diff --git a/Makefile.am b/Makefile.am index ea9b1eb..84c9712 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,15 +31,14 @@ pkginclude_HEADERS = AM_CFLAGS = $(WARNING_CFLAGS) $(MISC_CFLAGS) $(UDEV_CFLAGS) $(ell_cflags) AM_LDFLAGS = $(MISC_LDFLAGS) -confdir = $(sysconfdir)/bluetooth -statedir = $(localstatedir)/lib/bluetooth - if DATAFILES dbusdir = $(DBUS_CONFDIR)/dbus-1/system.d dbus_DATA = src/bluetooth.conf +confdir = $(sysconfdir)/bluetooth conf_DATA = +statedir = $(localstatedir)/lib/bluetooth state_DATA = endif @@ -580,8 +579,6 @@ MAINTAINERCLEANFILES = Makefile.in \ SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ $(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \ - -e 's,@statedir\@,$(statedir),g' \ - -e 's,@confdir\@,$(confdir),g' \ < $< > $@ %.service: %.service.in Makefile diff --git a/obexd/src/manager.c b/obexd/src/manager.c index c172c59..a4af627 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -653,14 +653,14 @@ static void agent_reply(DBusPendingCall *call, void *user_data) DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID)) { /* Splits folder and name */ - gboolean is_relative = !g_path_is_absolute(name); + const char *slash = strrchr(name, '/'); DBG("Agent replied with %s", name); - if (is_relative) { - agent->new_name = g_path_get_basename(name); + if (!slash) { + agent->new_name = g_strdup(name); agent->new_folder = NULL; } else { - agent->new_name = g_path_get_basename(name); - agent->new_folder = g_path_get_dirname(name); + agent->new_name = g_strdup(slash + 1); + agent->new_folder = g_strndup(name, slash - name); } } diff --git a/plugins/hostname.c b/plugins/hostname.c index 1df1b4b..4f9dfe6 100644 --- a/plugins/hostname.c +++ b/plugins/hostname.c @@ -301,10 +301,6 @@ static int hostname_init(void) hostname_proxy = NULL; g_dbus_client_unref(hostname_client); hostname_client = NULL; - } else { - g_dbus_proxy_refresh_property(hostname_proxy, "PrettyHostname"); - g_dbus_proxy_refresh_property(hostname_proxy, "StaticHostname"); - g_dbus_proxy_refresh_property(hostname_proxy, "Chassis"); } return err; diff --git a/profiles/input/device.c b/profiles/input/device.c index 075b139..a711ef5 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -92,7 +92,6 @@ struct input_device { static int idle_timeout = 0; static bool uhid_enabled = false; -static bool classic_bonded_only = false; void input_set_idle_timeout(int timeout) { @@ -104,11 +103,6 @@ void input_enable_userspace_hid(bool state) uhid_enabled = state; } -void input_set_classic_bonded_only(bool state) -{ - classic_bonded_only = state; -} - static void input_device_enter_reconnect_mode(struct input_device *idev); static int connection_disconnect(struct input_device *idev, uint32_t flags); @@ -976,18 +970,8 @@ static int hidp_add_connection(struct input_device *idev) if (device_name_known(idev->device)) device_get_name(idev->device, req->name, sizeof(req->name)); - /* Make sure the device is bonded if required */ - if (classic_bonded_only && !device_is_bonded(idev->device, - btd_device_get_bdaddr_type(idev->device))) { - error("Rejected connection from !bonded device %s", dst_addr); - goto cleanup; - } - /* Encryption is mandatory for keyboards */ - /* Some platforms may choose to require encryption for all devices */ - /* Note that this only matters for pre 2.1 devices as otherwise the */ - /* device is encrypted by default by the lower layers */ - if (classic_bonded_only || req->subclass & 0x40) { + if (req->subclass & 0x40) { if (!bt_io_set(idev->intr_io, &gerr, BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, BT_IO_OPT_INVALID)) { @@ -1219,11 +1203,6 @@ static void input_device_enter_reconnect_mode(struct input_device *idev) DBG("path=%s reconnect_mode=%s", idev->path, reconnect_mode_to_string(idev->reconnect_mode)); - /* Make sure the device is bonded if required */ - if (classic_bonded_only && !device_is_bonded(idev->device, - btd_device_get_bdaddr_type(idev->device))) - return; - /* Only attempt an auto-reconnect when the device is required to * accept reconnections from the host. */ diff --git a/profiles/input/device.h b/profiles/input/device.h index 3044db6..51a9aee 100644 --- a/profiles/input/device.h +++ b/profiles/input/device.h @@ -29,7 +29,6 @@ struct input_conn; void input_set_idle_timeout(int timeout); void input_enable_userspace_hid(bool state); -void input_set_classic_bonded_only(bool state); int input_device_register(struct btd_service *service); void input_device_unregister(struct btd_service *service); diff --git a/profiles/input/hog.c b/profiles/input/hog.c index dfac689..83c017d 100644 --- a/profiles/input/hog.c +++ b/profiles/input/hog.c @@ -186,10 +186,6 @@ static int hog_accept(struct btd_service *service) return -EINVAL; } - /* HOGP 1.0 Section 6.1 requires bonding */ - if (!device_is_bonded(device, btd_device_get_bdaddr_type(device))) - return -ECONNREFUSED; - /* TODO: Replace GAttrib with bt_gatt_client */ bt_hog_attach(dev->hog, attrib); diff --git a/profiles/input/input.conf b/profiles/input/input.conf index 166aff4..3e1d65a 100644 --- a/profiles/input/input.conf +++ b/profiles/input/input.conf @@ -11,11 +11,3 @@ # Enable HID protocol handling in userspace input profile # Defaults to false (HIDP handled in HIDP kernel module) #UserspaceHID=true - -# Limit HID connections to bonded devices -# The HID Profile does not specify that devices must be bonded, however some -# platforms may want to make sure that input connections only come from bonded -# device connections. Several older mice have been known for not supporting -# pairing/encryption. -# Defaults to false to maximize device compatibility. -#ClassicBondedOnly=true diff --git a/profiles/input/manager.c b/profiles/input/manager.c index 5cd27b8..1d31b06 100644 --- a/profiles/input/manager.c +++ b/profiles/input/manager.c @@ -96,7 +96,7 @@ static int input_init(void) config = load_config_file(CONFIGDIR "/input.conf"); if (config) { int idle_timeout; - gboolean uhid_enabled, classic_bonded_only; + gboolean uhid_enabled; idle_timeout = g_key_file_get_integer(config, "General", "IdleTimeout", &err); @@ -114,17 +114,6 @@ static int input_init(void) input_enable_userspace_hid(uhid_enabled); } else g_clear_error(&err); - - classic_bonded_only = g_key_file_get_boolean(config, "General", - "ClassicBondedOnly", &err); - - if (!err) { - DBG("input.conf: ClassicBondedOnly=%s", - classic_bonded_only ? "true" : "false"); - input_set_classic_bonded_only(classic_bonded_only); - } else - g_clear_error(&err); - } btd_profile_register(&input_profile); diff --git a/src/adapter.c b/src/adapter.c index 17018ec..cef2561 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -546,8 +546,7 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings) g_dbus_emit_property_changed(dbus_conn, adapter->path, ADAPTER_INTERFACE, "Discoverable"); store_adapter_info(adapter); - if (adapter->supported_settings & MGMT_SETTING_LE) - btd_adv_manager_refresh(adapter->adv_manager); + btd_adv_manager_refresh(adapter->adv_manager); } if (changed_mask & MGMT_SETTING_BONDABLE) { diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in index f188018..f9faaa4 100644 --- a/src/bluetooth.service.in +++ b/src/bluetooth.service.in @@ -12,24 +12,8 @@ NotifyAccess=main #Restart=on-failure CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE LimitNPROC=1 - -# Filesystem lockdown ProtectHome=true ProtectSystem=full -PrivateTmp=true -ProtectKernelTunables=true -ProtectControlGroups=true -ReadWritePaths=@statedir@ -ReadOnlyPaths=@confdir@ - -# Execute Mappings -MemoryDenyWriteExecute=true - -# Privilege escalation -NoNewPrivileges=true - -# Real-time -RestrictRealtime=true [Install] WantedBy=bluetooth.target