install_pl.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. diff -u fwsnort-1.6.3-2/install.pl fwsnort-1.6.3/install.pl
  2. --- fwsnort-1.6.3-2/install.pl 2012-12-24 21:31:28.597018440 -0700
  3. +++ fwsnort-1.6.3/install.pl 2012-12-24 21:40:38.564569377 -0700
  4. @@ -45,7 +45,7 @@
  5. my $perlCmd = '/usr/bin/perl';
  6. my $makeCmd = '/usr/bin/make';
  7. my $wgetCmd = '/usr/bin/wget';
  8. -my $gzipCmd = '/bin/gzip';
  9. +my $gzipCmd = '/usr/bin/gzip';
  10. my $tarCmd = '/bin/tar';
  11. #======================= end config ======================
  12. @@ -129,10 +129,6 @@
  13. ### make sure the system binaries are where we think they are.
  14. &check_commands();
  15. -### check to make sure we are running as root
  16. -$< == 0 && $> == 0 or die "You need to be root (or equivalent UID 0",
  17. - " account) to install/uninstall fwsnort!\n";
  18. -
  19. if ($uninstall) {
  20. &uninstall();
  21. } else {
  22. @@ -154,10 +150,10 @@
  23. "sources directory." unless -e 'fwsnort' and -e 'fwsnort.conf';
  24. unless (-d $config{'CONF_DIR'}) {
  25. - &full_mkdir($config{'CONF_DIR'}, 0500);
  26. + &full_mkdir($config{'CONF_DIR'}, 0700);
  27. }
  28. unless (-d $config{'RULES_DIR'}) {
  29. - &full_mkdir($config{'RULES_DIR'}, 0500);
  30. + &full_mkdir($config{'RULES_DIR'}, 0700);
  31. }
  32. ### install perl modules
  33. @@ -336,52 +332,11 @@
  34. sub install_manpage() {
  35. my $manpage = 'fwsnort.8';
  36. - ### remove old man page
  37. - unlink "/usr/local/man/man8/${manpage}" if
  38. - (-e "/usr/local/man/man8/${manpage}");
  39. ### default location to put the fwsnort man page, but check with
  40. ### /etc/man.config
  41. - my $mpath = '/usr/share/man/man8';
  42. - if (-e '/etc/man.config') {
  43. - ### prefer to install $manpage in /usr/local/man/man8 if
  44. - ### this directory is configured in /etc/man.config
  45. - open M, '< /etc/man.config' or
  46. - die "[*] Could not open /etc/man.config: $!";
  47. - my @lines = <M>;
  48. - close M;
  49. - ### prefer the path "/usr/share/man"
  50. - my $found = 0;
  51. - for my $line (@lines) {
  52. - chomp $line;
  53. - if ($line =~ m|^MANPATH\s+/usr/share/man|) {
  54. - $found = 1;
  55. - last;
  56. - }
  57. - }
  58. - ### try to find "/usr/local/man" if we didn't find /usr/share/man
  59. - unless ($found) {
  60. - for my $line (@lines) {
  61. - chomp $line;
  62. - if ($line =~ m|^MANPATH\s+/usr/local/man|) {
  63. - $mpath = '/usr/local/man/man8';
  64. - $found = 1;
  65. - last;
  66. - }
  67. - }
  68. - }
  69. - ### if we still have not found one of the above man paths,
  70. - ### just select the first one out of /etc/man.config
  71. - unless ($found) {
  72. - for my $line (@lines) {
  73. - chomp $line;
  74. - if ($line =~ m|^MANPATH\s+(\S+)|) {
  75. - $mpath = $1;
  76. - last;
  77. - }
  78. - }
  79. - }
  80. - }
  81. + my $mpath = $config{'INSTALL_ROOT'}.'/usr/share/man/man8';
  82. +
  83. &full_mkdir($mpath, 0755);
  84. my $mfile = "${mpath}/${manpage}";
  85. print "[+] Installing $manpage man page as $mfile\n";
  86. @@ -532,6 +487,9 @@
  87. /bin
  88. /usr/bin
  89. /usr/local/bin
  90. + /sbin
  91. + /usr/sbin
  92. + /usr/local/sbin
  93. );
  94. CMD: for my $cmd (keys %cmds) {
  95. unless (-x $cmds{$cmd}) {
  96. diff -u fwsnort-1.6.3-2/fwsnort.conf fwsnort-1.6.3/fwsnort.conf
  97. --- fwsnort-1.6.3-2/fwsnort.conf 2012-12-24 22:39:21.323178467 -0700
  98. +++ fwsnort-1.6.3/fwsnort.conf 2012-12-24 22:41:52.172194457 -0700
  99. @@ -103,14 +103,14 @@
  100. ### system binaries
  101. shCmd /bin/sh;
  102. -echoCmd /bin/echo;
  103. +echoCmd /usr/bin/echo;
  104. tarCmd /bin/tar;
  105. wgetCmd /usr/bin/wget;
  106. unameCmd /usr/bin/uname;
  107. ifconfigCmd /sbin/ifconfig;
  108. -iptablesCmd /sbin/iptables;
  109. -iptables-saveCmd /sbin/iptables-save;
  110. -iptables-restoreCmd /sbin/iptables-restore;
  111. -ip6tablesCmd /sbin/ip6tables;
  112. -ip6tables-saveCmd /sbin/ip6tables-save;
  113. -ip6tables-restoreCmd /sbin/ip6tables-restore;
  114. +iptablesCmd /usr/sbin/iptables;
  115. +iptables-saveCmd /usr/sbin/iptables-save;
  116. +iptables-restoreCmd /usr/sbin/iptables-restore;
  117. +ip6tablesCmd /usr/sbin/ip6tables;
  118. +ip6tables-saveCmd /usr/sbin/ip6tables-save;
  119. +ip6tables-restoreCmd /usr/sbin/ip6tables-restore;