Merge lp:~zeller-benjamin/ubuntu-sdk-ide/no-superuser into lp:ubuntu-sdk-ide

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 169
Merged at revision: 167
Proposed branch: lp:~zeller-benjamin/ubuntu-sdk-ide/no-superuser
Merge into: lp:ubuntu-sdk-ide
Diff against target: 48 lines (+11/-2)
2 files modified
dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp (+3/-1)
dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp (+8/-1)
To merge this branch: bzr merge lp:~zeller-benjamin/ubuntu-sdk-ide/no-superuser
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
ubuntu-sdk-build-bot continuous-integration Approve
Review via email: mp+310789@code.launchpad.net

Commit message

- Less warnings when opening a snapcraft project
- Do not allow superuser to open the IDE

Description of the change

- Less warnings when opening a snapcraft project
- Do not allow superuser to open the IDE

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp'
2--- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp 2016-11-07 11:19:36 +0000
3+++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snapcraftprojectnode.cpp 2016-11-14 16:00:48 +0000
4@@ -420,7 +420,9 @@
5 watches << currentPath.toFileInfo().absoluteFilePath();
6 }
7
8- m_watcher->addPaths(watches);
9+ if (!watches.isEmpty())
10+ m_watcher->addPaths(watches);
11+
12 return currFolder;
13 }
14
15
16=== modified file 'dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp'
17--- dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-11-07 10:48:52 +0000
18+++ dist/qtcreator/src/plugins/ubuntu/src/ubuntu/ubuntuplugin.cpp 2016-11-14 16:00:48 +0000
19@@ -91,6 +91,8 @@
20
21 #include <coreplugin/icore.h>
22 #include <stdint.h>
23+#include <unistd.h>
24+#include <sys/types.h>
25
26
27 using namespace Ubuntu;
28@@ -123,6 +125,11 @@
29 defaultFont.setFamily(QStringLiteral("Ubuntu"));
30 defaultFont.setWeight(QFont::Light);
31
32+
33+ if (::getuid() == 0) {
34+ criticalError(tr("\nThe Ubuntu SDK can not be used as superuser."));
35+ return false;
36+ }
37 if (QStandardPaths::findExecutable(QStringLiteral("lxc")).isEmpty()) {
38 criticalError(tr("\nLxd is not installed properly.\nIt is required for the Ubuntu-SDK-IDE to work."));
39 return false;
40@@ -419,7 +426,7 @@
41 case ERR_NO_ACCESS:
42 //the tool tells us that we have no access to the LXD server
43 criticalError(tr("The current user can not access the LXD server which is required for the Ubuntu SDK.\n"
44- "Make sure the user is part of the lxd group and restart the IDE."));
45+ "Make sure the user is part of the lxd group, relogin and restart the IDE."));
46 break;
47 case ERR_NO_BRIDGE:
48 if (Settings::askForContainerSetup()) {

Subscribers

People subscribed via source and target branches