Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[connectionagent] Make connectionagent privileged. Fixes JB#38236
Now that connman applies access control rules to most of its
service methods, connectionagent needs to have its effected
group id to be privileged. Otherwise it won't be able to
connect or disconnect connman services
  • Loading branch information
monich committed Apr 1, 2017
1 parent 33d9a34 commit 6f962a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
9 changes: 1 addition & 8 deletions connd/connd.pro
@@ -1,4 +1,3 @@

QT = core network dbus

TARGET = connectionagent
Expand All @@ -16,16 +15,13 @@ CONFIG -= app_bundle

TEMPLATE = app

OTHER_FILES += com.jolla.Connectiond.xml
OTHER_FILES += com.jolla.Connectiond.xml privileges

DBUS_ADAPTORS = connadaptor
connadaptor.files = com.jollamobile.Connectiond.xml
connadaptor.header_flags = -c ConnAdaptor
connadaptor.source_flags = -c ConnAdaptor

# create adaptor
#system(qdbusxml2cpp -c ConnAdaptor -a connadaptor.h:connadaptor.cpp com.jollamobile.Connectiond.xml)

SOURCES += main.cpp \
qconnectionagent.cpp \
wakeupwatcher.cpp
Expand All @@ -39,6 +35,3 @@ INSTALLS += target

MOC_DIR = .moc
OBJECTS_DIR = .obj



2 changes: 2 additions & 0 deletions connd/privileges
@@ -0,0 +1,2 @@
# Tells invoker to run connectionagent as nemo:privileged
/usr/bin/connectionagent,
8 changes: 7 additions & 1 deletion rpm/connectionagent-qt5.spec
@@ -1,7 +1,7 @@
Name: connectionagent-qt5

Summary: User Agent daemon
Version: 0.11.25
Version: 0.11
Release: 0
Group: Communications/Connectivity Adaptation
License: LGPLv2.1
Expand Down Expand Up @@ -75,6 +75,9 @@ rm -rf %{buildroot}
mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants
ln -s ../connectionagent.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/

mkdir -p %{buildroot}%{_datadir}/mapplauncherd/privileges.d
install -m 644 -p connd/privileges %{buildroot}%{_datadir}/mapplauncherd/privileges.d/connectionagent

%post
if [ "$1" -ge 1 ]; then
systemctl-user daemon-reload || :
Expand All @@ -91,6 +94,9 @@ fi
%defattr(-,root,root,-)
%{_bindir}/connectionagent
%{_datadir}/dbus-1/services/com.jolla.Connectiond.service
%dir %{_datadir}/mapplauncherd
%dir %{_datadir}/mapplauncherd/privileges.d
%{_datadir}/mapplauncherd/privileges.d/connectionagent
%{_libdir}/systemd/user/connectionagent.service
%{_sysconfdir}/dbus-1/session.d/connectionagent.conf
%{_libdir}/systemd/user/user-session.target.wants/connectionagent.service
Expand Down

0 comments on commit 6f962a8

Please sign in to comment.