~ubuntu-branches/ubuntu/vivid/kvpnc/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/13_add_kuser_issuperuser.diff

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2009-04-23 09:18:50 UTC
  • mfrom: (1.1.10 upstream) (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090423091850-hweeg0jo64t0jx52
Tags: 0.9.1-1
* New upstream release (KDE4 is here)
* Add Build-Depends cmake and pkg-kde-tools
* Remove obsolete debian/patches
* Refresh debian/patches:
  - 10_su-to-root_usage.diff
  - 13_add_kuser_issuperuser.diff
* Cleanup debian/rules - simple under KDE4
* Update debian/watch for KDE4 version
* Update debian/copyright - use versionned licenses
* Update Section field - move to utils
* Remove obsolete dependencies: kdebase-bin, gksu, sux and modutils
* Update debian/kvpnc.{manpages,1}

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
@@ -24,6 +24,7 @@
4
4
 #include <kmessagebox.h>
5
5
 #include <kmainwindow.h>
6
 
 #include <kapp.h>
 
6
 #include <kapplication.h>
7
7
+#include <kuser.h>
8
 
 
9
8
 #include <klocale.h>
10
 
 #include <dcopclient.h>
11
 
@@ -129,7 +130,12 @@
12
 
 //                     KMessageBox::error( 0, I18N_NOOP( "Kvpnc must be started as root!" ) );
13
 
 //                     exit(0);
14
 
 //             }
15
 
-               
16
 
+        if (!KUser().isSuperUser())
17
 
+        {
18
 
+                       KMessageBox::error( 0L, i18n( "Kvpnc must be started as root!" ) );
19
 
+                       exit(0);
20
 
+        }
21
 
+       
 
9
 #include <QtCore/QString>
 
10
 #include <../config-kvpnc.h>
 
11
@@ -126,11 +127,11 @@ int main ( int argc, char *argv[] )
 
12
        }
 
13
        else
 
14
        {
 
15
-//             if (getenv("USER") != "root")
 
16
-//             {
 
17
-//                     KMessageBox::error( 0, I18N_NOOP( "Kvpnc must be started as root!" ) );
 
18
-//                     exit(0);
 
19
-//             }
 
20
+               if (!KUser().isSuperUser())
 
21
+               {
 
22
+                       KMessageBox::error( 0L, i18n( "Kvpnc must be started as root!" ) );
 
23
+                       exit(0);
 
24
+               }
 
25
 
22
26
                KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
23
 
                
24
 
                a.setMainWidget( kvpnc );
 
27