[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-providers-hybris.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/geoclue-providers-hybris.git</param>
<param name="branch">master</param>
- <param name="revision">c9996f0b96718c7f1f30405de9c2e52ec9efeaac</param>
+ <param name="revision">93e83f42a9a7ab8522cbf70593468c92de88807d</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.32.tar.gz/binder/binderlocationbackend.cpp
^
|
@@ -364,13 +364,13 @@
qCDebug(lcGeoclueHybris) << "GNSS set system info";
break;
default:
- qWarning("Failed to decode callback %u\n", code);
+ qWarning("Failed to decode callback %u", code);
break;
}
*status = GBINDER_STATUS_OK;
return gbinder_local_reply_append_int32(gbinder_local_object_new_reply(obj), 0);
} else {
- qWarning("Unknown interface %s and code %u\n", iface, code);
+ qWarning("Unknown interface %s and code %u", iface, code);
*status = GBINDER_STATUS_FAILED;
}
return Q_NULLPTR;
@@ -397,13 +397,13 @@
QMetaObject::invokeMethod(staticProvider, "xtraDownloadRequest", Qt::QueuedConnection);
break;
default:
- qWarning("Failed to decode callback %u\n", code);
+ qWarning("Failed to decode callback %u", code);
break;
}
*status = GBINDER_STATUS_OK;
return gbinder_local_reply_append_int32(gbinder_local_object_new_reply(obj), 0);
} else {
- qWarning("Unknown interface %s and code %u\n", iface, code);
+ qWarning("Unknown interface %s and code %u", iface, code);
*status = GBINDER_STATUS_FAILED;
}
return Q_NULLPTR;
@@ -463,13 +463,13 @@
}
break;
default:
- qWarning("Failed to decode callback %u\n", code);
+ qWarning("Failed to decode callback %u", code);
break;
}
*status = GBINDER_STATUS_OK;
return gbinder_local_reply_append_int32(gbinder_local_object_new_reply(obj), 0);
} else {
- qWarning("Unknown interface %s and code %u\n", iface, code);
+ qWarning("Unknown interface %s and code %u", iface, code);
*status = GBINDER_STATUS_FAILED;
}
return Q_NULLPTR;
@@ -500,13 +500,13 @@
qCDebug(lcGeoclueHybris) << "AGNSS RIL request ref location";
break;
default:
- qWarning("Failed to decode callback %u\n", code);
+ qWarning("Failed to decode callback %u", code);
break;
}
*status = GBINDER_STATUS_OK;
return gbinder_local_reply_append_int32(gbinder_local_object_new_reply(obj), 0);
} else {
- qWarning("Unknown interface %s and code %u\n", iface, code);
+ qWarning("Unknown interface %s and code %u", iface, code);
*status = GBINDER_STATUS_FAILED;
}
return Q_NULLPTR;
@@ -534,13 +534,13 @@
qCDebug(lcGeoclueHybris) << "GNSS NI notify";
break;
default:
- qWarning("Failed to decode callback %u\n", code);
+ qWarning("Failed to decode callback %u", code);
break;
}
*status = GBINDER_STATUS_OK;
return gbinder_local_reply_append_int32(gbinder_local_object_new_reply(obj), 0);
} else {
- qWarning("Unknown interface %s and code %u\n", iface, code);
+ qWarning("Unknown interface %s and code %u", iface, code);
*status = GBINDER_STATUS_FAILED;
}
return Q_NULLPTR;
@@ -681,7 +681,7 @@
gbinder_remote_reply_init_reader(reply, &reader);
if (!gbinder_reader_read_int32(&reader, &status) || status != 0) {
- qWarning("Failed to get extension object %d\n", status);
+ qWarning("Failed to get extension object %d", status);
return Q_NULLPTR;
}
@@ -693,7 +693,7 @@
{
bool ret = false;
- qWarning("Initialising GNSS interface\n");
+ qWarning("Initialising GNSS interface");
m_sm = gbinder_servicemanager_new(GNSS_BINDER_DEFAULT_DEV);
if (m_sm) {
@@ -733,7 +733,7 @@
}
if (!ret) {
- qWarning("Failed to initialise GNSS interface\n");
+ qWarning("Failed to initialise GNSS interface");
}
return ret;
}
@@ -757,7 +757,7 @@
}
if (!ret) {
- qWarning("Failed to start positioning\n");
+ qWarning("Failed to start positioning");
}
return ret;
}
@@ -781,7 +781,7 @@
}
if (!ret) {
- qWarning("Failed to stop positioning\n");
+ qWarning("Failed to stop positioning");
}
return ret;
}
@@ -789,12 +789,7 @@
void BinderLocationBackend::gnssCleanup()
{
if (m_clientGnss) {
- const int status = gbinder_client_transact_sync_oneway(m_clientGnss,
- GNSS_CLEANUP, Q_NULLPTR);
-
- if (status) {
- qWarning("Failed to cleanup\n");
- }
+ gbinder_client_transact(m_clientGnss, GNSS_CLEANUP, 0, NULL, NULL, NULL, NULL);
}
}
@@ -821,7 +816,7 @@
ret = isReplySuccess(reply);
}
if (!ret) {
- qWarning("Failed to inject location\n");
+ qWarning("Failed to inject location");
}
gbinder_local_request_unref(req);
@@ -854,7 +849,7 @@
}
if (!ret) {
- qWarning("Failed to inject time\n");
+ qWarning("Failed to inject time");
}
gbinder_local_request_unref(req);
gbinder_remote_reply_unref(reply);
@@ -869,8 +864,8 @@
req = gbinder_client_new_request(m_clientGnss);
gbinder_local_request_append_int32(req, aidingDataFlags);
- gbinder_client_transact_sync_oneway(m_clientGnss,
- GNSS_DELETE_AIDING_DATA, req);
+ gbinder_client_transact(m_clientGnss, GNSS_DELETE_AIDING_DATA,
+ 0, req, NULL, NULL, NULL);
gbinder_local_request_unref(req);
}
@@ -903,7 +898,7 @@
}
if (!ret) {
- qWarning("GNSS set position mode failed\n");
+ qWarning("GNSS set position mode failed");
}
gbinder_local_request_unref(req);
gbinder_remote_reply_unref(reply);
@@ -923,7 +918,7 @@
if (!status) {
m_remoteGnssDebug = getExtensionObject(reply);
if (m_remoteGnssDebug) {
- qWarning("Initialising GNSS Debug interface\n");
+ qWarning("Initialising GNSS Debug interface");
m_clientGnssDebug = gbinder_client_new(m_remoteGnssDebug, GNSS_DEBUG_REMOTE);
}
}
@@ -943,7 +938,7 @@
m_remoteGnssNi = getExtensionObject(reply);
if (m_remoteGnssNi) {
- qWarning("Initialising GNSS NI interface\n");
+ qWarning("Initialising GNSS NI interface");
GBinderLocalRequest *req;
m_clientGnssNi = gbinder_client_new(m_remoteGnssNi, GNSS_NI_REMOTE);
m_callbackGnssNi = gbinder_servicemanager_new_local_object
@@ -959,7 +954,7 @@
if (!status) {
if (!gbinder_remote_reply_read_int32(reply, &status) || status != 0) {
- qWarning("Initialising GNSS NI interface failed %d\n", status);
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.32.tar.gz/hal/hallocationbackend.cpp
^
|
@@ -18,8 +18,12 @@
#include <android-config.h>
+#include <errno.h>
+#include <grp.h>
#include <strings.h>
#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
// Define versions of the Android GPS interface supported.
#if ANDROID_VERSION_MAJOR >= 7
@@ -254,7 +258,7 @@
void requestUtcTimeCallback()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "GNSS request UTC time";
QMetaObject::invokeMethod(staticProvider, "injectUtcTime", Qt::QueuedConnection);
}
@@ -263,7 +267,7 @@
void gnssSetSystemInfoCallback(const GnssSystemInfo *info)
{
Q_UNUSED(info)
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "GNSS set system info";
}
#endif
@@ -299,19 +303,19 @@
void gpsNiNotifyCallback(GpsNiNotification *notification)
{
Q_UNUSED(notification)
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "GNSS NI notify";
}
void agpsRilRequestSetId(uint32_t flags)
{
Q_UNUSED(flags)
- qCDebug(lcGeoclueHybris) << "flags" << showbase << hex << flags;
+ qCDebug(lcGeoclueHybris) << "AGNSS RIL request set ID flags" << showbase << hex << flags;
}
void agpsRilRequestRefLoc(uint32_t flags)
{
Q_UNUSED(flags)
- qCDebug(lcGeoclueHybris) << "flags" << showbase << hex << flags;
+ qCDebug(lcGeoclueHybris) << "AGNSS RIL request ref location flags" << showbase << hex << flags;
}
void gnssXtraDownloadRequest()
@@ -398,6 +402,65 @@
HalLocationBackend::HalLocationBackend(QObject *parent)
: HybrisLocationBackend(parent), m_gps(Q_NULLPTR), m_agps(Q_NULLPTR), m_agpsril(Q_NULLPTR), m_gpsni(Q_NULLPTR), m_xtra(Q_NULLPTR), m_debug(Q_NULLPTR)
{
+ uid_t realUid;
+ uid_t effectiveUid;
+ uid_t savedUid;
+
+ int result = getresuid(&realUid, &effectiveUid, &savedUid);
+ if (result == -1)
+ qFatal("Failed to get process uids, %s", strerror(errno));
+
+ gid_t supplementaryGroups[NGROUPS_MAX];
+ int numberGroups = getgroups(NGROUPS_MAX, supplementaryGroups);
+ if (numberGroups == -1)
+ qFatal("Failed to get supplementary groups, %s", strerror(errno));
+
+ if (numberGroups + 1 > NGROUPS_MAX)
+ qFatal("Too many supplementary groups");
+
+ group *group = getgrnam("gps");
+ if (!group)
+ qFatal("Failed to get id of gps group, %s", strerror(errno));
+
+ supplementaryGroups[numberGroups++] = group->gr_gid;
+
+ // remove nfc, audio, radio and bluetooth groups to avoid confusion in BSP
+ const char *groups_to_remove[] = {"bluetooth", "radio", "audio", "nfc", NULL};
+
+ for (int idx = 0; idx < numberGroups; idx++) {
+ for (int j = 0; groups_to_remove[j]; j++) {
+ group = getgrnam(groups_to_remove[j]);
+ if (group) {
+ if (supplementaryGroups[idx] == group->gr_gid) {
+ // remove it
+ qCDebug(lcGeoclueHybris, "Removing supplementary group %s (%i)", groups_to_remove[j], supplementaryGroups[idx]);
+ memmove((void*)&supplementaryGroups[idx], (void*)&supplementaryGroups[idx + 1], (numberGroups - idx) * sizeof(gid_t));
+ numberGroups--;
+ }
+ }
+ }
+ }
+
+#if GEOCLUE_ANDROID_GPS_INTERFACE >= 2
+ group = getgrnam("net_raw");
+ if (group) {
+ if (numberGroups + 1 > NGROUPS_MAX)
+ qWarning("Too many supplementary groups, can't add net_raw");
+ else
+ supplementaryGroups[numberGroups++] = group->gr_gid;
+ }
+#endif
+
+ numberGroups = setgroups(numberGroups, supplementaryGroups);
+ if (numberGroups == -1)
+ qFatal("Failed to set supplementary groups, %s", strerror(errno));
+
+#if GEOCLUE_ANDROID_GPS_INTERFACE == 1
+ // Drop privileges.
+ result = setuid(realUid);
+ if (result == -1)
+ qFatal("Failed to set process uid to %d, %s", realUid, strerror(errno));
+#endif
}
HalLocationBackend::~HalLocationBackend()
@@ -411,17 +474,17 @@
int error = hw_get_module(GPS_HARDWARE_MODULE_ID, &hwModule);
if (error) {
- qWarning("Android GPS interface not found, error %d\n", error);
+ qWarning("Android GPS interface not found, error %d", error);
return false;
}
- qWarning("Android GPS hardware module \"%s\" \"%s\" %u.%u\n", hwModule->id, hwModule->name,
+ qWarning("Android GPS hardware module \"%s\" \"%s\" %u.%u", hwModule->id, hwModule->name,
hwModule->module_api_version, hwModule->hal_api_version);
error = hwModule->methods->open(hwModule, GPS_HARDWARE_MODULE_ID,
reinterpret_cast<hw_device_t **>(&m_gpsDevice));
if (error) {
- qWarning("Failed to open GPS device, error %d\n", error);
+ qWarning("Failed to open GPS device, error %d", error);
return false;
}
@@ -429,11 +492,11 @@
if (!m_gps)
return false;
- qWarning("Initialising GPS interface\n");
+ qWarning("Initialising GPS interface");
error = m_gps->init(&gpsCallbacks);
if (error) {
- qWarning("Failed to initialise GPS interface, error %d\n", error);
+ qWarning("Failed to initialise GPS interface, error %d", error);
return false;
}
@@ -445,7 +508,7 @@
if (m_gps) {
int error = m_gps->start();
if (error) {
- qWarning("Failed to start positioning, error %d\n", error);
+ qWarning("Failed to start positioning, error %d", error);
return false;
}
return true;
@@ -458,7 +521,7 @@
if (m_gps) {
int error = m_gps->stop();
if (error) {
- qWarning("Failed to stop positioning, error %d\n", error);
+ qWarning("Failed to stop positioning, error %d", error);
return false;
}
return true;
@@ -480,7 +543,7 @@
if (m_gps) {
int error = m_gps->inject_location(latitudeDegrees, longitudeDegrees, accuracyMeters);
if (error) {
- qWarning("Failed to inject location, error %d\n", error);
+ qWarning("Failed to inject location, error %d", error);
return false;
}
return true;
@@ -493,7 +556,7 @@
if (m_gps) {
int error = m_gps->inject_time(timeMs, timeReferenceMs, uncertaintyMs);
if (error) {
- qWarning("Failed to inject time, error %d\n", error);
+ qWarning("Failed to inject time, error %d", error);
return false;
}
return true;
@@ -515,7 +578,7 @@
int error = m_gps->set_position_mode(mode, recurrence, minIntervalMs,
preferredAccuracyMeters, preferredTimeMs);
if (error) {
- qWarning("While updating the updateInterval, failed to set position mode, error %d\n", error);
+ qWarning("While updating the updateInterval, failed to set position mode, error %d", error);
return false;
}
return true;
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.32.tar.gz/hybrisprovider.cpp
^
|
@@ -215,21 +215,30 @@
m_xtraServers.enqueue(xtraServer);
}
}
+ if (!m_xtraServers.isEmpty())
+ qCDebug(lcGeoclueHybris) << "Overriding XTRA servers with" << m_xtraServers;
m_useForcedXtraInject = settings.value("xtra/XTRA_FORCE_INJECT", "").toBool();
+ if (m_useForcedXtraInject)
+ qCDebug(lcGeoclueHybris) << "Forcing XTRA data injection";
QString xtraUserAgentFileName = settings.value("xtra/XTRA_USERAGENT_FILE", QString()).toString();
if (!xtraUserAgentFileName.isEmpty()) {
QFile xtraUserAgentFile(xtraUserAgentFileName);
if (xtraUserAgentFile.open(QIODevice::ReadOnly)) {
m_xtraUserAgent = xtraUserAgentFile.readLine();
+ qCDebug(lcGeoclueHybris) << "Overriding XTRA user agent with" << m_xtraUserAgent;
}
}
m_useForcedNtpInject = settings.value("ntp/NTP_FORCE_INJECT", "").toBool();
+ if (m_useForcedNtpInject)
+ qCDebug(lcGeoclueHybris) << "Forcing NTP injection";
- m_suplHost = settings.value("supl/SUPL_HOST", QString()).toString();
- m_suplPort = settings.value("supl/SUPL_PORT", "").toInt();
+ m_suplHost = settings.value("supl/SUPL_HOST").toString();
+ m_suplPort = settings.value("supl/SUPL_PORT").toInt();
+ if (!m_suplHost.isEmpty() && m_suplPort > 0)
+ qCDebug(lcGeoclueHybris) << "Overriding SUPL server with" << m_suplHost << "port" << m_suplPort;
if (m_xtraServers.isEmpty() || m_suplHost.isEmpty() || m_suplPort == 0) {
loadDefaultsFromConfigurationFile();
@@ -249,8 +258,10 @@
m_backend->gnssDebugInit();
// Set SUPL server if provided
- if (!m_suplHost.isEmpty() && m_suplPort != 0)
- m_backend->aGnssSetServer(HYBRIS_AGNSS_TYPE_SUPL, m_suplHost.toLatin1().constData(), m_suplPort);
+ if (!m_suplHost.isEmpty() && m_suplPort > 0) {
+ if (!m_backend->aGnssSetServer(HYBRIS_AGNSS_TYPE_SUPL, m_suplHost.toLatin1().constData(), m_suplPort))
+ qWarning("Setting SUPL server to %s (%i) failed", m_suplHost.toLatin1().constData(), m_suplPort);
+ }
}
HybrisProvider::~HybrisProvider()
@@ -488,12 +499,14 @@
void HybrisProvider::setLocation(const Location &location)
{
- qCDebug(lcGeoclueHybrisPosition) << location.timestamp() << location.latitude()
+ qCDebug(lcGeoclueHybrisPosition) << "Set location"
+ << location.timestamp() << location.latitude()
<< location.longitude() << location.altitude();
// Stop listening to all PositionChanged signals from org.freedesktop.Geoclue.Position
// interfaces.
if (m_positionInjectionConnected) {
+ qCDebug(lcGeoclueHybrisPosition) << "Stop listening to all PositionChanged signals";
QDBusConnection conn = QDBusConnection::sessionBus();
conn.disconnect(QString(), QString(), QStringLiteral("org.freedesktop.Geoclue.Position"),
QStringLiteral("PositionChanged"),
@@ -509,6 +522,7 @@
m_currentLocation = location;
if (m_currentLocation.timestamp() != 0 && m_currentLocation.timestamp() < GnssWeekRolloverTimestamp) {
+ qCDebug(lcGeoclueHybris) << "Fixing timestamp offset";
m_currentLocation.setTimestamp(m_currentLocation.timestamp() + GnssWeekRolloverTimestampOffset);
}
@@ -560,7 +574,7 @@
if (!(positionFields & LatitudePresent && positionFields & LongitudePresent))
return;
- qCDebug(lcGeoclueHybris) << fields << timestamp << latitude << longitude << altitude
+ qCDebug(lcGeoclueHybris) << "Injecting position" << fields << timestamp << latitude << longitude << altitude
<< accuracy.horizontal() << accuracy.vertical();
m_backend->gnssInjectLocation(latitude, longitude, accuracy.horizontal());
@@ -721,7 +735,7 @@
if (m_xtraServerIndex >= m_xtraServers.count())
return;
- qCDebug(lcGeoclueHybris) << m_xtraServers;
+ qCDebug(lcGeoclueHybris) << "XTRA servers" << m_xtraServers;
QNetworkRequest network_request(m_xtraServers[m_xtraServerIndex]);
if (!m_xtraUserAgent.isEmpty()) {
@@ -738,7 +752,7 @@
if (!m_xtraDownloadReply)
return;
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "XTRA download finished";
m_xtraDownloadReply->deleteLater();
@@ -771,7 +785,7 @@
Q_UNUSED(ssid)
Q_UNUSED(password)
- qCDebug(lcGeoclueHybris) << "type:" << type << "status:" << status;
+ qCDebug(lcGeoclueHybris) << "AGNSS type:" << type << "status:" << status;
if (!m_agpsEnabled) {
m_backend->aGnssDataConnFailed();
@@ -805,7 +819,7 @@
void HybrisProvider::dataServiceConnected()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "Data service connected";
if (!m_agpsOnlineEnabled)
return;
@@ -831,7 +845,7 @@
void HybrisProvider::connectionErrorReported(const QString &path, const QString &error)
{
- qCDebug(lcGeoclueHybris) << path << error;
+ qCDebug(lcGeoclueHybris) << "Connection error" << path << error;
if (path.contains(QStringLiteral("cellular")))
m_backend->aGnssDataConnFailed();
@@ -862,7 +876,7 @@
void HybrisProvider::engineOn()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "Engine on";
// The GPS is being turned back on because a position update is required soon.
@@ -876,7 +890,7 @@
void HybrisProvider::engineOff()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "Engine off";
// The GPS is being turned off because a position update is not required for a while.
@@ -926,7 +940,7 @@
void HybrisProvider::connectionManagerValidChanged()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "Connection manager valid changed";
if (m_agpsOnlineEnabled && !m_agpsInterface.isEmpty())
processConnectionContexts();
@@ -934,7 +948,7 @@
void HybrisProvider::connectionContextValidChanged()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "Connection context valid changed";
if (!m_agpsOnlineEnabled)
return;
@@ -958,7 +972,7 @@
void HybrisProvider::cellularConnected(bool connected)
{
- qCDebug(lcGeoclueHybris) << connected;
+ qCDebug(lcGeoclueHybris) << "Cellular connected" << connected;
if (connected)
dataServiceConnected();
}
@@ -1139,7 +1153,7 @@
void HybrisProvider::startDataConnection()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "Start data connection";
if (!m_agpsOnlineEnabled) {
qCDebug(lcGeoclueHybris) << "Online aGPS not enabled, not starting data connection.";
@@ -1169,7 +1183,7 @@
void HybrisProvider::stopDataConnection()
{
- qCDebug(lcGeoclueHybris);
+ qCDebug(lcGeoclueHybris) << "Stop data connection";
if (!m_requestedConnect)
return;
@@ -1190,7 +1204,7 @@
void HybrisProvider::sendNtpRequest()
{
- qCDebug(lcGeoclueHybris) << m_ntpServers;
+ qCDebug(lcGeoclueHybris) << "Send NTP request. Servers:" << m_ntpServers;
if (!m_agpsOnlineEnabled) {
qCDebug(lcGeoclueHybris) << "Online aGPS not enabled, not sending NTP request.";
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.32.tar.gz/main.cpp
^
|
@@ -18,17 +18,8 @@
#include <locationsettings.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <grp.h>
-#include <errno.h>
-
int main(int argc, char *argv[])
{
- uid_t realUid;
- uid_t effectiveUid;
- uid_t savedUid;
-
#if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
QCoreApplication::setSetuidAllowed(true);
#endif
@@ -37,60 +28,6 @@
"geoclue.provider.hybris.position.debug=false"));
QCoreApplication a(argc, argv);
- int result = getresuid(&realUid, &effectiveUid, &savedUid);
- if (result == -1)
- qFatal("Failed to get process uids, %s", strerror(errno));
-
- gid_t supplementaryGroups[NGROUPS_MAX];
- int numberGroups = getgroups(NGROUPS_MAX, supplementaryGroups);
- if (numberGroups == -1)
- qFatal("Failed to get supplementary groups, %s", strerror(errno));
-
- if (numberGroups + 1 > NGROUPS_MAX)
- qFatal("Too many supplementary groups");
-
- group *group = getgrnam("gps");
- if (!group)
- qFatal("Failed to get id of gps group, %s", strerror(errno));
-
- supplementaryGroups[numberGroups++] = group->gr_gid;
-
- // remove nfc, audio, radio and bluetooth groups to avoid confusion in BSP
- char *groups_to_remove[] = {"bluetooth", "radio", "audio", "nfc", NULL};
-
- int idx = 0;
- while (groups_to_remove[idx]) {
- group = getgrnam(groups_to_remove[idx]);
- idx++;
-
- if (idx + 1 < numberGroups) {
- memmove((void*)&supplementaryGroups[idx], (void*)&supplementaryGroups[idx + 1], (numberGroups - idx - 1) * sizeof(gid_t));
- }
-
- numberGroups--;
- }
-
-#if GEOCLUE_ANDROID_GPS_INTERFACE >= 2
- group = getgrnam("net_raw");
- if (group) {
- if (numberGroups + 1 > NGROUPS_MAX)
- qWarning("Too many supplementary groups, can't add net_raw");
- else
- supplementaryGroups[numberGroups++] = group->gr_gid;
- }
-#endif
-
- numberGroups = setgroups(numberGroups, supplementaryGroups);
- if (numberGroups == -1)
- qFatal("Failed to set supplementary groups, %s", strerror(errno));
-
-#if GEOCLUE_ANDROID_GPS_INTERFACE == 1
- // Drop privileges.
- result = setuid(realUid);
- if (result == -1)
- qFatal("Failed to set process uid to %d, %s", realUid, strerror(errno));
-#endif
-
QDBusConnection session = QDBusConnection::sessionBus();
LocationSettings settings;
HybrisProvider provider;
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-providers-hybris.inc
^
|
@@ -17,21 +17,22 @@
%description
%{summary}.
-
%prep
-%setup -q -n %{name}-%{version}
-
+%autosetup -n %{name}-%{version}
%build
%{qmake_command}
-make %{?_smp_mflags}
-
+%make_build
%install
-make INSTALL_ROOT=%{buildroot} install
+%make_install
%files
+%if 0%{?with_suid}
%defattr(04755,root,root,-)
+%else
+%defattr(-,root,root,-)
+%endif
%{_libexecdir}/geoclue-hybris
%defattr(-,root,root,-)
%{_sysconfdir}/dbus-1
|