signon-apparmor-extension-0.1+15.04.20150203/0000755000015300001610000000000012464144344021033 5ustar pbuserpbgroup00000000000000signon-apparmor-extension-0.1+15.04.20150203/tests/0000755000015300001610000000000012464144344022175 5ustar pbuserpbgroup00000000000000signon-apparmor-extension-0.1+15.04.20150203/tests/mock/0000755000015300001610000000000012464144344023126 5ustar pbuserpbgroup00000000000000signon-apparmor-extension-0.1+15.04.20150203/tests/mock/mock.pro0000644000015300001610000000044112464144226024577 0ustar pbuserpbgroup00000000000000include(../../common-project-config.pri) TARGET = apparmor TEMPLATE = lib CONFIG += \ debug \ link_pkgconfig \ qt QT += \ core \ dbus PKGCONFIG += \ libapparmor # Error on undefined symbols QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF SOURCES += \ apparmor.cpp signon-apparmor-extension-0.1+15.04.20150203/tests/mock/apparmor.cpp0000644000015300001610000000312112464144226025447 0ustar pbuserpbgroup00000000000000/* * Copyright (C) 2013 Canonical Ltd. * * Contact: Alberto Mardegan * * This file is part of the signon-apparmor-extension * * This library is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see . */ #include #include #include #include #include #define UNCONFINED_PROFILE "unconfined" QByteArray mockedProfile() { QByteArray envVariable = qgetenv("APPARMOR_MOCK_PROFILE"); return envVariable.isEmpty() ? UNCONFINED_PROFILE : envVariable; } int aa_getpeercon(int fd, char **con, char **mode) { Q_UNUSED(fd); Q_UNUSED(mode); *con = strdup(mockedProfile().constData()); return 0; } QDBusMessage QDBusConnection::call(const QDBusMessage &message, QDBus::CallMode mode, int timeout) const { Q_UNUSED(mode); Q_UNUSED(timeout); return message.createReply(QVariantList() << mockedProfile().constData()); } signon-apparmor-extension-0.1+15.04.20150203/tests/tst_extension.pro0000644000015300001610000000076712464144226025636 0ustar pbuserpbgroup00000000000000include(../common-project-config.pri) include($${TOP_SRC_DIR}/common-vars.pri) TARGET = tst_extension CONFIG += \ link_pkgconfig \ qt QT += \ core \ dbus \ testlib QT -= gui PKGCONFIG += \ SignOnExtension DEFINES += \ PLUGIN_PATH=\\\"../src/libsignon-apparmor-ac.so\\\" SOURCES = \ tst_extension.cpp check.commands = "LD_PRELOAD=mock/libapparmor.so dbus-test-runner -t ./$${TARGET}" check.depends = $${TARGET} QMAKE_EXTRA_TARGETS += check QMAKE_CLEAN += $$TARGET signon-apparmor-extension-0.1+15.04.20150203/tests/tests.pro0000644000015300001610000000012212464144226024053 0ustar pbuserpbgroup00000000000000TEMPLATE = subdirs CONFIG += ordered SUBDIRS = \ mock \ tst_extension.pro signon-apparmor-extension-0.1+15.04.20150203/tests/tst_extension.cpp0000644000015300001610000001364212464144235025614 0ustar pbuserpbgroup00000000000000/* * Copyright (C) 2013 Canonical Ltd. * * Contact: Alberto Mardegan * * This file is part of the signon-apparmor-extension * * This library is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see . */ #include #include #include #include #include #include #include #define P2P_SOCKET "unix:path=/tmp/tst_extension_%1" static void setMockedProfile(const char *profile) { if (profile) { qputenv("APPARMOR_MOCK_PROFILE", profile); } else { #if QT_VERSION >= 0x050100 qunsetenv("APPARMOR_MOCK_PROFILE"); #else qputenv("APPARMOR_MOCK_PROFILE", ""); #endif } } class ExtensionTest: public QObject { Q_OBJECT public: ExtensionTest(); private Q_SLOTS: void initTestCase(); void test_appId(); void test_appId_p2p(); void test_click_version(); void test_access(); void test_accessWildcard(); void test_unconfined(); void cleanupTestCase(); private: SignOn::AbstractAccessControlManager *m_acm; QDBusConnection m_busConnection; QDBusConnection m_p2pConnection; }; ExtensionTest::ExtensionTest(): m_busConnection(QDBusConnection::sessionBus()), m_p2pConnection(QStringLiteral("uninitialized")) { } void ExtensionTest::initTestCase() { QPluginLoader pluginLoader(PLUGIN_PATH); QObject *plugin = pluginLoader.instance(); QVERIFY(plugin != 0); SignOn::ExtensionInterface3 *interface = qobject_cast(plugin); QVERIFY(interface != 0); m_acm = interface->accessControlManager(this); QVERIFY(m_acm != 0); QDBusServer *server; for (int i = 0; i < 10; i++) { server = new QDBusServer(QString::fromLatin1(P2P_SOCKET).arg(i), this); if (!server->isConnected()) { delete server; } else { break; } } QVERIFY(server->isConnected()); m_p2pConnection = QDBusConnection::connectToPeer(server->address(), QStringLiteral("tst")); QVERIFY(m_p2pConnection.isConnected()); } void ExtensionTest::test_appId() { QSKIP("Disable because of QTBUG-36475"); /* forge a QDBusMessage */ QDBusMessage msg = QDBusMessage::createMethodCall(m_busConnection.baseService(), "/", "my.interface", "hi"); QString appId = m_acm->appIdOfPeer(m_busConnection, msg); /* At the moment, AppArmor doesn't implement the * GetConnectionAppArmorSecurityContext method, so expect an error. */ QCOMPARE(appId, QStringLiteral("unconfined")); } void ExtensionTest::test_appId_p2p() { /* forge a QDBusMessage */ QDBusMessage msg = QDBusMessage::createMethodCall("", "/", "my.interface", "hi"); QString appId = m_acm->appIdOfPeer(m_p2pConnection, msg); QCOMPARE(appId, QStringLiteral("unconfined")); } void ExtensionTest::test_click_version() { /* forge a QDBusMessage */ setMockedProfile("com.ubuntu.myapp_myapp_0.2"); QDBusMessage msg = QDBusMessage::createMethodCall(":0.1", "/", "my.interface", "hi"); bool allowed = m_acm->isPeerAllowedToAccess(m_busConnection, msg, "anyContext"); QVERIFY(!allowed); allowed = m_acm->isPeerAllowedToAccess(m_busConnection, msg, "com.ubuntu.myapp_myapp_0.2"); QVERIFY(allowed); /* A different version of the package should also work */ allowed = m_acm->isPeerAllowedToAccess(m_busConnection, msg, "com.ubuntu.myapp_myapp_0.1"); QVERIFY(allowed); setMockedProfile(NULL); } void ExtensionTest::test_access() { QSKIP("Disable because of QTBUG-36475"); /* forge a QDBusMessage */ QDBusMessage msg = QDBusMessage::createMethodCall(m_busConnection.baseService(), "/", "my.interface", "hi"); bool allowed = m_acm->isPeerAllowedToAccess(m_busConnection, msg, "anyContext"); /* At the moment, AppArmor doesn't implement the * GetConnectionAppArmorSecurityContext method, so expect an error. */ QVERIFY(!allowed); } void ExtensionTest::test_accessWildcard() { QSKIP("Disable because of QTBUG-36475"); /* forge a QDBusMessage */ QDBusMessage msg = QDBusMessage::createMethodCall(m_busConnection.baseService(), "/", "my.interface", "hi"); bool allowed = m_acm->isPeerAllowedToAccess(m_busConnection, msg, "*"); /* Everything is allowed to access "*" */ QVERIFY(allowed); } void ExtensionTest::test_unconfined() { /* forge a QDBusMessage */ setMockedProfile("unconfined"); QDBusMessage msg = QDBusMessage::createMethodCall("", "/", "my.interface", "hi"); bool allowed = m_acm->isPeerAllowedToAccess(m_busConnection, msg, "anyContext"); QVERIFY(allowed); allowed = m_acm->isPeerAllowedToAccess(m_busConnection, msg, "com.ubuntu.myapp_myapp_0.2"); QVERIFY(allowed); setMockedProfile(NULL); } void ExtensionTest::cleanupTestCase() { delete m_acm; } QTEST_MAIN(ExtensionTest) #include "tst_extension.moc" signon-apparmor-extension-0.1+15.04.20150203/README0000644000015300001610000000000112464144226021701 0ustar pbuserpbgroup00000000000000 signon-apparmor-extension-0.1+15.04.20150203/src/0000755000015300001610000000000012464144344021622 5ustar pbuserpbgroup00000000000000signon-apparmor-extension-0.1+15.04.20150203/src/src.pro0000644000015300001610000000161212464144226023132 0ustar pbuserpbgroup00000000000000include(../common-project-config.pri) include($${TOP_SRC_DIR}/common-vars.pri) include($${TOP_SRC_DIR}/common-installs-config.pri) TEMPLATE = lib TARGET = signon-apparmor-ac CONFIG += \ link_pkgconfig \ plugin \ qt QT += \ core \ dbus QT -= gui QMAKE_CXXFLAGS += \ -fvisibility=hidden PKGCONFIG += \ SignOnExtension \ dbus-1 \ libapparmor # The following use of pkg-config + sed is a hack to workaround a qmake # limitation: the CFLAGS variable is not used with the moc compiler, so the # include rules given out by pkg-config wouldn't be applied when running the # moc. INCLUDEPATH += . \ $$system(pkg-config --cflags SignOnExtension | sed s/-I//g) HEADERS = \ access-control-manager.h \ plugin.h SOURCES = \ access-control-manager.cpp \ plugin.cpp target.path = $$system(pkg-config --variable=plugindir SignOnExtension) INSTALLS = target signon-apparmor-extension-0.1+15.04.20150203/src/access-control-manager.cpp0000644000015300001610000001035612464144235026661 0ustar pbuserpbgroup00000000000000/* * Copyright (C) 2013 Canonical Ltd. * * Contact: Alberto Mardegan * * This file is part of the signon-apparmor-extension * * This library is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see . */ #include "access-control-manager.h" #include #include #include #include #include static const char keychainAppId[] = "unconfined"; AccessReply::AccessReply(const SignOn::AccessRequest &request, QObject *parent): SignOn::AccessReply(request, parent) { /* Always decline */ QMetaObject::invokeMethod(this, "decline", Qt::QueuedConnection); } AccessControlManager::AccessControlManager(QObject *parent): SignOn::AbstractAccessControlManager(parent) { } AccessControlManager::~AccessControlManager() { } QString AccessControlManager::keychainWidgetAppId() { return QLatin1String(keychainAppId); } bool AccessControlManager::isPeerAllowedToAccess( const QDBusConnection &peerConnection, const QDBusMessage &peerMessage, const QString &securityContext) { QString appId = appIdOfPeer(peerConnection, peerMessage); bool allowed = (stripVersion(appId) == stripVersion(securityContext) || securityContext == QLatin1String("*") || /* Temporary workaround for * https://bugs.launchpad.net/bugs/1376445 */ appId == QStringLiteral("unconfined")); qDebug() << "Process" << appId << "access to" << securityContext << (allowed ? "ALLOWED" : "DENIED"); return allowed; } QString AccessControlManager::appIdOfPeer(const QDBusConnection &peerConnection, const QDBusMessage &peerMessage) { Q_UNUSED(peerConnection); QString uniqueConnectionId = peerMessage.service(); QString appId; if (uniqueConnectionId.isEmpty()) { /* it's a p2p connection; we treat the peer as "unconfined" */ qDebug() << "Client connected via P2P socket; treating as unconfined"; appId = "unconfined"; } else { QDBusMessage msg = QDBusMessage::createMethodCall("org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "GetConnectionAppArmorSecurityContext"); QVariantList args; args << uniqueConnectionId; msg.setArguments(args); QDBusMessage reply = QDBusConnection::sessionBus().call(msg, QDBus::Block); if (reply.type() == QDBusMessage::ReplyMessage) { appId = reply.arguments().value(0, QString()).toString(); qDebug() << "App ID:" << appId; } else { qWarning() << "Error getting app ID:" << reply.errorName() << reply.errorMessage(); } } return appId; } SignOn::AccessReply * AccessControlManager::handleRequest(const SignOn::AccessRequest &request) { return new AccessReply(request, this); } QString AccessControlManager::stripVersion(const QString &appId) const { QStringList components = appId.split('_'); if (components.count() != 3) return appId; /* Click packages have a profile of the form * $name_$application_$version * (see https://wiki.ubuntu.com/SecurityTeam/Specifications/ApplicationConfinement/Manifest#Click) * * We assume that this is a click package, and strip out the last part. */ components.removeLast(); return components.join('_'); } signon-apparmor-extension-0.1+15.04.20150203/src/access-control-manager.h0000644000015300001610000000361512464144226026326 0ustar pbuserpbgroup00000000000000/* * Copyright (C) 2013 Canonical Ltd. * * Contact: Alberto Mardegan * * This file is part of the signon-apparmor-extension * * This library is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see . */ #ifndef SIGNON_APPARMOR_ACCESS_CONTROL_MANAGER_H #define SIGNON_APPARMOR_ACCESS_CONTROL_MANAGER_H #include class AccessReply: public SignOn::AccessReply { Q_OBJECT public: AccessReply(const SignOn::AccessRequest &request, QObject *parent = 0); }; class AccessControlManager: public SignOn::AbstractAccessControlManager { Q_OBJECT public: AccessControlManager(QObject *parent = 0); ~AccessControlManager(); bool isPeerAllowedToAccess(const QDBusConnection &peerConnection, const QDBusMessage &peerMessage, const QString &securityContext) Q_DECL_OVERRIDE; QString appIdOfPeer(const QDBusConnection &peerConnection, const QDBusMessage &peerMessage) Q_DECL_OVERRIDE; QString keychainWidgetAppId() Q_DECL_OVERRIDE; SignOn::AccessReply *handleRequest(const SignOn::AccessRequest &request) Q_DECL_OVERRIDE; private: QString stripVersion(const QString &appId) const; }; #endif // SIGNON_APPARMOR_ACCESS_CONTROL_MANAGER_H signon-apparmor-extension-0.1+15.04.20150203/src/plugin.h0000644000015300001610000000252012464144226023267 0ustar pbuserpbgroup00000000000000/* * Copyright (C) 2013 Canonical Ltd. * * Contact: Alberto Mardegan * * This file is part of the signon-apparmor-extension * * This library is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see . */ #ifndef SIGNON_APPARMOR_PLUGIN_H #define SIGNON_APPARMOR_PLUGIN_H #include #include class Plugin: public QObject, public SignOn::ExtensionInterface3 { Q_OBJECT Q_INTERFACES(SignOn::ExtensionInterface3) Q_PLUGIN_METADATA(IID "com.nokia.SingleSignOn.ExtensionInterface/3.0") public: Plugin(QObject *parent = 0); SignOn::AbstractAccessControlManager * accessControlManager(QObject *parent = 0) const Q_DECL_OVERRIDE; }; #endif // SIGNON_APPARMOR_PLUGIN_H signon-apparmor-extension-0.1+15.04.20150203/src/plugin.cpp0000644000015300001610000000226612464144226023631 0ustar pbuserpbgroup00000000000000/* * Copyright (C) 2013 Canonical Ltd. * * Contact: Alberto Mardegan * * This file is part of the signon-apparmor-extension * * This library is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or (at * your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library. If not, see . */ #include "plugin.h" #include "access-control-manager.h" #include using namespace SignOn; Plugin::Plugin(QObject *parent): QObject(parent) { setObjectName(QLatin1String("apparmor-ac")); } AbstractAccessControlManager * Plugin::accessControlManager(QObject *parent) const { qDebug() << Q_FUNC_INFO; return new AccessControlManager(parent); } signon-apparmor-extension-0.1+15.04.20150203/COPYING0000644000015300001610000001674312464144226022100 0ustar pbuserpbgroup00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. signon-apparmor-extension-0.1+15.04.20150203/INSTALL0000644000015300001610000000003512464144226022061 0ustar pbuserpbgroup00000000000000qmake make sudo make install signon-apparmor-extension-0.1+15.04.20150203/common-project-config.pri0000644000015300001610000000062212464144226025745 0ustar pbuserpbgroup00000000000000#----------------------------------------------------------------------------- # Common configuration for all projects. #----------------------------------------------------------------------------- # we don't like warnings... QMAKE_CXXFLAGS += -Werror # Disable RTTI QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti TOP_SRC_DIR = $$PWD TOP_BUILD_DIR = $${TOP_SRC_DIR}/$(BUILD_DIR) include(coverage.pri) signon-apparmor-extension-0.1+15.04.20150203/common-vars.pri0000644000015300001610000000142512464144226024011 0ustar pbuserpbgroup00000000000000#----------------------------------------------------------------------------- # Common variables for all projects. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Project name (used e.g. in include file and doc install path). # remember to update debian/* files if you changes this #----------------------------------------------------------------------------- PROJECT_NAME = signon-apparmor-extension #----------------------------------------------------------------------------- # Project version # remember to update debian/* files if you changes this #----------------------------------------------------------------------------- PROJECT_VERSION = 0.1 # End of File signon-apparmor-extension-0.1+15.04.20150203/coverage.pri0000644000015300001610000000346412464144226023350 0ustar pbuserpbgroup00000000000000# Coverage CONFIG(coverage) { LIBS += -lgcov QMAKE_CXXFLAGS += --coverage QMAKE_LDFLAGS += --coverage QMAKE_EXTRA_TARGETS += coverage cov QMAKE_EXTRA_TARGETS += clean-gcno clean-gcda coverage-html \ generate-coverage-html clean-coverage-html coverage-gcovr \ generate-gcovr generate-coverage-gcovr clean-coverage-gcovr clean-gcno.commands = \ "@echo Removing old coverage instrumentation"; \ "find -name '*.gcno' -print | xargs -r rm" clean-gcda.commands = \ "@echo Removing old coverage results"; \ "find -name '*.gcda' -print | xargs -r rm" coverage-html.depends = clean-gcda check generate-coverage-html generate-coverage-html.commands = \ "@echo Collecting coverage data"; \ "lcov --directory $${TOP_SRC_DIR} --capture --output-file coverage.info --no-checksum --compat-libtool"; \ "lcov --extract coverage.info \"*/src/*.cpp\" -o coverage.info"; \ "lcov --remove coverage.info \"moc_*.cpp\" -o coverage.info"; \ "LANG=C genhtml --prefix $${TOP_SRC_DIR} --output-directory coverage-html --title \"Code Coverage\" --legend --show-details coverage.info" clean-coverage-html.depends = clean-gcda clean-coverage-html.commands = \ "lcov --directory $${TOP_SRC_DIR} -z"; \ "rm -rf coverage.info coverage-html" coverage-gcovr.depends = clean-gcda check generate-coverage-gcovr generate-coverage-gcovr.commands = \ "@echo Generating coverage GCOVR report"; \ "gcovr -x -r $${TOP_SRC_DIR} -o $${TOP_SRC_DIR}/coverage.xml -e \".*/moc_.*\" -e \"tests/.*\" -e \".*\\.h\"" clean-coverage-gcovr.depends = clean-gcda clean-coverage-gcovr.commands = \ "rm -rf $${TOP_SRC_DIR}/coverage.xml" QMAKE_CLEAN += *.gcda *.gcno coverage.info coverage.xml } signon-apparmor-extension-0.1+15.04.20150203/common-installs-config.pri0000644000015300001610000000420212464144226026126 0ustar pbuserpbgroup00000000000000#----------------------------------------------------------------------------- # Common installation configuration for all projects. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # setup the installation prefix #----------------------------------------------------------------------------- INSTALL_PREFIX = /usr # default installation prefix # default prefix can be overriden by defining PREFIX when running qmake isEmpty( PREFIX ) { message("====") message("==== NOTE: To override the installation path run: `qmake PREFIX=/custom/path'") message("==== (current installation path is `$${INSTALL_PREFIX}')") } else { INSTALL_PREFIX = $${PREFIX} message("====") message("==== install prefix set to `$${INSTALL_PREFIX}'") } #----------------------------------------------------------------------------- # default installation target for applications #----------------------------------------------------------------------------- contains( TEMPLATE, app ) { target.path = $${INSTALL_PREFIX}/bin INSTALLS += target message("====") message("==== INSTALLS += target") } #----------------------------------------------------------------------------- # default installation target for libraries #----------------------------------------------------------------------------- contains( TEMPLATE, lib ) { target.path = $${INSTALL_PREFIX}/lib INSTALLS += target message("====") message("==== INSTALLS += target") # reset the .pc file's `prefix' variable #include( tools/fix-pc-prefix.pri ) } #----------------------------------------------------------------------------- # target for header files #----------------------------------------------------------------------------- !isEmpty( headers.files ) { headers.path = $${INSTALL_PREFIX}/include/$${TARGET} INSTALLS += headers message("====") message("==== INSTALLS += headers") } else { message("====") message("==== NOTE: Remember to add your API headers into `headers.files' for installation!") } # End of File signon-apparmor-extension-0.1+15.04.20150203/apparmor-extension.pro0000644000015300001610000000057112464144226025412 0ustar pbuserpbgroup00000000000000include(common-vars.pri) TEMPLATE = subdirs CONFIG += ordered SUBDIRS = \ src \ tests DISTNAME = $${PROJECT_NAME}-$${PROJECT_VERSION} EXCLUDES = \ --exclude-vcs \ --exclude=.* \ --exclude=$${DISTNAME}.tar.bz2 dist.commands = "tar -cvjf $${DISTNAME}.tar.bz2 $$EXCLUDES --transform='s,^,$$DISTNAME/,' *" dist.depends = distclean QMAKE_EXTRA_TARGETS += dist