summaryrefslogtreecommitdiffstats
path: root/recipes-security/buck-security/files/pseudo.patch
blob: 906c1e25514813091e32fb42f9edbf589ae2148a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Index: buck-security_0.6/buck-security
===================================================================
--- buck-security_0.6.orig/buck-security	2013-09-10 20:58:49.564292001 -0400
+++ buck-security_0.6/buck-security	2013-09-11 10:07:40.440543001 -0400
@@ -28,11 +28,6 @@
 # start time
 my $start_time = time();
 
-# Runned by root?
-if ( $> != 0 ) {
-    print STDERR "Only root can run this program\n";
-    exit 1;
-}
 
 # Read Options from command line (--help, --log and --output), run buck --help for more information
 my $man        = 0;
@@ -41,13 +36,15 @@
 my $opt_log    = '';     # Log? via --log
 my $opt_checksum = 0;
 my $opt_sysroot = '';
+my $opt_pseudo = 0;
 GetOptions(
     'output=i'         => \$opt_output,
     'log=s'            => \$opt_log,
     'help|?'           => \$help,
      man               => \$man,
     'make-checksums'   => \$opt_checksum,
-    'sysroot=s'        => \$opt_sysroot
+    'sysroot=s'        => \$opt_sysroot,
+    'pseudo'           => \$opt_pseudo
 ) ||
 pod2usage(
     -message => "\n",
@@ -73,6 +70,12 @@
 
 { package Config; do $config_file }
 
+if ( $> != 0 && ! $opt_pseudo) {
+    print STDERR "If you are not using pseudo you must run this script as root.\n";
+    exit 1;
+}
+
+
 if ($opt_sysroot) {
     $Config::sysroot = $opt_sysroot;
 }
@@ -98,6 +101,17 @@
 
 
 
+if ($opt_pseudo) {
+    @Config::checks = grep
+      { $_ ne 'checksum' &&
+        $_ ne 'firewall' &&
+        $_ ne 'services' &&
+        $_ ne 'usermask' }
+      @Config::checks;
+}
+
+
+
 if ($opt_checksum != 0) {
     use mkchecksum;
     mkchecksum->MkChecksum();
@@ -219,6 +233,9 @@
  --sysroot=<root>
  specify the root directory of the filesystem to be analyzed
 
+ --pseudo
+ if set, run with pseudo
+
 
 
 =head1 FURTHER INFORMATION