[Pkg-ossec-devel] [pkg-ossec] 04/18: Adapting patch #02 to 2.7.1-beta-1 upstream version.

Jose Antonio Quevedo Muñoz jaqm-guest at alioth.debian.org
Tue Aug 13 15:24:51 UTC 2013


This is an automated email from the git hooks/post-receive script.

jaqm-guest pushed a commit to branch debian
in repository pkg-ossec.

commit 3233fcf9bb10e727533d31e1bbd666fcb8d3603a
Author: Jose Antonio Quevedo <joseantonio.quevedo at gmail.com>
Date:   Tue Aug 13 09:59:46 2013 +0200

    Adapting patch #02 to 2.7.1-beta-1 upstream version.
---
 debian/patches/02-add-chroot-option.patch |  304 +++++++++++++----------------
 1 file changed, 132 insertions(+), 172 deletions(-)

diff --git a/debian/patches/02-add-chroot-option.patch b/debian/patches/02-add-chroot-option.patch
index 9d906a8..879144a 100644
--- a/debian/patches/02-add-chroot-option.patch
+++ b/debian/patches/02-add-chroot-option.patch
@@ -21,28 +21,26 @@ Reviewed-By:
 Last-Update: 2012-08-26
 
 
-Index: pkg-ossec/src/os_auth/main-server.c
-===================================================================
---- pkg-ossec.orig/src/os_auth/main-server.c	2012-08-30 01:39:37.000000000 +0200
-+++ pkg-ossec/src/os_auth/main-server.c	2012-08-30 01:55:42.000000000 +0200
-@@ -48,6 +48,7 @@
-     FILE *fp;
-     int c, test_config = 0;
+--- a/src/os_auth/main-server.c
++++ b/src/os_auth/main-server.c
+@@ -53,6 +53,7 @@
+     // Count of pids we are wait()ing on.
+     int c = 0, test_config = 0, use_ip_address = 0, pid = 0, status, i = 0, active_processes = 0;
      int gid = 0, client_sock = 0, sock = 0, port = 1515, ret = 0;
 +    int do_chroot = 1;
      char *dir  = DEFAULTDIR;
      char *user = USER;
      char *group = GROUPGLOBAL;
-@@ -67,7 +68,7 @@
-     /* Setting the name */
+@@ -76,7 +77,7 @@
      OS_SetName(ARGV0);
-         
--    while((c = getopt(argc, argv, "Vdhu:g:D:c:m:p:")) != -1)
-+    while((c = getopt(argc, argv, "Vdhu:g:D:c:m:p:NC")) != -1)
+     /* add an option to use the ip on the socket to tie the name to a
+        specific address */
+-    while((c = getopt(argc, argv, "Vdhiu:g:D:c:m:p:")) != -1)
++    while((c = getopt(argc, argv, "Vdhiu:g:D:c:m:p:NC:")) != -1)
      {
          switch(c){
              case 'V':
-@@ -110,6 +111,12 @@
+@@ -122,6 +123,12 @@
                      ErrorExit("%s: Invalid port: %s", ARGV0, optarg);
                  }
                  break;
@@ -55,27 +53,25 @@ Index: pkg-ossec/src/os_auth/main-server.c
              default:
                  report_help();
                  break;
-@@ -138,8 +145,13 @@
+@@ -151,8 +158,13 @@
  
-     
-     /* chrooting */
+     /* chrooting -- TODO: this isn't a chroot. Should also close
+        unneeded open file descriptors (like stdin/stdout)*/
 -    chdir(dir);
 -
-+    if (do_chroot) 
-+	    chdir(dir);
++    if (do_chroot)
++      chdir(dir);
 +    else
-+	    chdir(dir);
++      chdir(dir);
 +    /* Note: there is no difference with chrooting or not in the main-server as
 +     * upstream does not yet make one, the code is there to make it possible if
 +     * upstream changes the behaviour */
  
  
      /* Signal manipulation */
-Index: pkg-ossec/src/os_csyslogd/main.c
-===================================================================
---- pkg-ossec.orig/src/os_csyslogd/main.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/os_csyslogd/main.c	2012-08-30 01:55:41.000000000 +0200
-@@ -20,6 +20,7 @@
+--- a/src/os_csyslogd/main.c
++++ b/src/os_csyslogd/main.c
+@@ -21,6 +21,7 @@
  int main(int argc, char **argv)
  {
      int c, test_config = 0,run_foreground = 0;
@@ -83,7 +79,7 @@ Index: pkg-ossec/src/os_csyslogd/main.c
      int uid = 0,gid = 0;
  
      /* Using MAILUSER (read only) */
-@@ -37,7 +38,7 @@
+@@ -38,7 +39,7 @@
      OS_SetName(ARGV0);
          
  
@@ -92,7 +88,7 @@ Index: pkg-ossec/src/os_csyslogd/main.c
          switch(c){
              case 'V':
                  print_version();
-@@ -76,6 +77,12 @@
+@@ -77,6 +78,12 @@
              case 't':
                  test_config = 1;    
                  break;
@@ -105,7 +101,7 @@ Index: pkg-ossec/src/os_csyslogd/main.c
              default:
                  help(ARGV0);
                  break;
-@@ -146,14 +153,15 @@
+@@ -147,14 +154,15 @@
      if(Privsep_SetGroup(gid) < 0)
          ErrorExit(SETGID_ERROR,ARGV0,group);
  
@@ -128,11 +124,9 @@ Index: pkg-ossec/src/os_csyslogd/main.c
  
  
      
-Index: pkg-ossec/src/shared/help.c
-===================================================================
---- pkg-ossec.orig/src/shared/help.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/shared/help.c	2012-08-30 01:55:41.000000000 +0200
-@@ -34,7 +34,9 @@
+--- a/src/shared/help.c
++++ b/src/shared/help.c
+@@ -35,7 +35,9 @@
      print_out("    -u <user>   Run as 'user'");
      print_out("    -g <group>  Run as 'group'");
      print_out("    -c <config> Read the 'config' file");
@@ -143,11 +137,9 @@ Index: pkg-ossec/src/shared/help.c
      print_out(" ");
      exit(1);
  }
-Index: pkg-ossec/src/analysisd/analysisd.c
-===================================================================
---- pkg-ossec.orig/src/analysisd/analysisd.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/analysisd/analysisd.c	2012-08-30 01:55:41.000000000 +0200
-@@ -132,6 +132,7 @@
+--- a/src/analysisd/analysisd.c
++++ b/src/analysisd/analysisd.c
+@@ -133,6 +133,7 @@
  #endif
  {
      int c = 0, m_queue = 0, test_config = 0,run_foreground = 0;
@@ -155,7 +147,7 @@ Index: pkg-ossec/src/analysisd/analysisd.c
      char *dir = DEFAULTDIR;
      char *user = USER;
      char *group = GROUPGLOBAL;
-@@ -151,7 +152,7 @@
+@@ -152,7 +153,7 @@
      hourly_syscheck = 0;
      hourly_firewall = 0;
  
@@ -164,7 +156,7 @@ Index: pkg-ossec/src/analysisd/analysisd.c
          switch(c){
  	    case 'V':
  		print_version();
-@@ -187,6 +188,12 @@
+@@ -188,6 +189,12 @@
              case 't':
                  test_config = 1;    
                  break;
@@ -177,7 +169,7 @@ Index: pkg-ossec/src/analysisd/analysisd.c
              default:
                  help(ARGV0);
                  break;
-@@ -280,11 +287,13 @@
+@@ -281,11 +288,13 @@
          ErrorExit(SETGID_ERROR,ARGV0,group);
  
      /* Chrooting */
@@ -196,11 +188,9 @@ Index: pkg-ossec/src/analysisd/analysisd.c
      
      
  
-Index: pkg-ossec/src/analysisd/makelists.c
-===================================================================
---- pkg-ossec.orig/src/analysisd/makelists.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/analysisd/makelists.c	2012-08-30 01:55:41.000000000 +0200
-@@ -66,7 +66,9 @@
+--- a/src/analysisd/makelists.c
++++ b/src/analysisd/makelists.c
+@@ -67,7 +67,9 @@
      print_out("    -u <user>   Run as 'user'");
      print_out("    -g <group>  Run as 'group'");
      print_out("    -c <config> Read the 'config' file");
@@ -211,7 +201,7 @@ Index: pkg-ossec/src/analysisd/makelists.c
      print_out(" ");
      exit(1);
  }
-@@ -76,6 +78,7 @@
+@@ -77,6 +79,7 @@
  int main(int argc, char **argv)
  {
      int c = 0;
@@ -219,7 +209,7 @@ Index: pkg-ossec/src/analysisd/makelists.c
      char *dir = DEFAULTDIR;
      char *user = USER;
      char *group = GROUPGLOBAL;
-@@ -92,7 +95,7 @@
+@@ -93,7 +96,7 @@
      prev_year = 0;
      memset(prev_month, '\0', 4);
  
@@ -228,7 +218,7 @@ Index: pkg-ossec/src/analysisd/makelists.c
          switch(c){
  	    case 'V':
  		print_version();
-@@ -125,6 +128,12 @@
+@@ -126,6 +129,12 @@
              case 'f':
                  force = 1;
                  break;
@@ -241,7 +231,7 @@ Index: pkg-ossec/src/analysisd/makelists.c
              default:
                  help(ARGV0);
                  break;
-@@ -157,11 +166,13 @@
+@@ -158,11 +167,13 @@
          ErrorExit(SETGID_ERROR,ARGV0,group);
  
      /* Chrooting */
@@ -260,10 +250,8 @@ Index: pkg-ossec/src/analysisd/makelists.c
      
  
      /* Createing the lists for use in rules */
-Index: pkg-ossec/src/os_maild/maild.c
-===================================================================
---- pkg-ossec.orig/src/os_maild/maild.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/os_maild/maild.c	2012-08-30 01:55:41.000000000 +0200
+--- a/src/os_maild/maild.c
++++ b/src/os_maild/maild.c
 @@ -31,6 +31,7 @@
  int main(int argc, char **argv)
  {
@@ -294,7 +282,7 @@ Index: pkg-ossec/src/os_maild/maild.c
              default:
                  help(ARGV0);
                  break;
-@@ -137,11 +144,13 @@
+@@ -143,11 +150,13 @@
  
      
      /* chrooting */
@@ -313,37 +301,35 @@ Index: pkg-ossec/src/os_maild/maild.c
  
      
      /* Changing user */        
-Index: pkg-ossec/src/addagent/main.c
-===================================================================
---- pkg-ossec.orig/src/addagent/main.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/addagent/main.c	2012-08-30 01:55:41.000000000 +0200
-@@ -24,6 +24,8 @@
+--- a/src/addagent/main.c
++++ b/src/addagent/main.c
+@@ -25,6 +25,8 @@
      printf("\t-l          List available agents.\n");
      printf("\t-e <id>     Extracts key for an agent (Manager only).\n");
-     printf("\t-i <id>     Import authentication key (Agent only).\n\n");
+     printf("\t-i <id>     Import authentication key (Agent only).\n");
 +    printf("\t-N          Do not chroot.\n");
 +    printf("\t-C          Chroot the program (default behaviour).\n");
+     printf("\t-f <file>   Bulk generate client keys from file. (Manager only).\n\n");
      exit(1);
  }
- 
-@@ -68,6 +70,7 @@
+@@ -70,6 +72,7 @@
      char *user_msg;
  
      int c = 0, cmdlist = 0;
 +    int do_chroot = 1;
      char *cmdexport = NULL;
      char *cmdimport = NULL;
- 
-@@ -82,7 +85,7 @@
+     char *cmdbulk = NULL;
+@@ -85,7 +88,7 @@
      OS_SetName(ARGV0);
  
  
--    while((c = getopt(argc, argv, "Vhle:i:")) != -1){
-+    while((c = getopt(argc, argv, "Vhle:i:NC")) != -1){
+-    while((c = getopt(argc, argv, "Vhle:i:f:")) != -1){
++    while((c = getopt(argc, argv, "Vhle:i:f:NC:")) != -1){
          switch(c){
  	        case 'V':
  		        print_version();
-@@ -112,6 +115,12 @@
+@@ -124,6 +127,12 @@
              case 'l':
                  cmdlist = 1;
                  break;
@@ -356,7 +342,7 @@ Index: pkg-ossec/src/addagent/main.c
              default:
                  helpmsg();
                  break;
-@@ -143,16 +152,18 @@
+@@ -155,16 +164,18 @@
  
  
      /* Chrooting to the default directory */
@@ -382,11 +368,9 @@ Index: pkg-ossec/src/addagent/main.c
      /* Starting signal handler */
      StartSIG2(ARGV0, manage_shutdown);
      #endif
-Index: pkg-ossec/src/monitord/main.c
-===================================================================
---- pkg-ossec.orig/src/monitord/main.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/monitord/main.c	2012-08-30 01:55:41.000000000 +0200
-@@ -19,6 +19,7 @@
+--- a/src/monitord/main.c
++++ b/src/monitord/main.c
+@@ -20,6 +20,7 @@
  int main(int argc, char **argv)
  {
      int c, test_config = 0, run_foreground = 0;
@@ -394,7 +378,7 @@ Index: pkg-ossec/src/monitord/main.c
      int uid=0,gid=0;
      char *dir  = DEFAULTDIR;
      char *user = USER;
-@@ -32,7 +33,7 @@
+@@ -33,7 +34,7 @@
      OS_SetName(ARGV0);
          
  
@@ -403,7 +387,7 @@ Index: pkg-ossec/src/monitord/main.c
          switch(c){
              case 'V':
                  print_version();
-@@ -68,6 +69,12 @@
+@@ -69,6 +70,12 @@
              case 't':
                  test_config = 1;    
                  break;
@@ -416,7 +400,7 @@ Index: pkg-ossec/src/monitord/main.c
              default:
                  help(ARGV0);
                  break;
-@@ -169,11 +176,13 @@
+@@ -170,11 +177,13 @@
  
      
      /* chrooting */
@@ -435,11 +419,9 @@ Index: pkg-ossec/src/monitord/main.c
  
      
      /* Changing user */        
-Index: pkg-ossec/src/monitord/report.c
-===================================================================
---- pkg-ossec.orig/src/monitord/report.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/monitord/report.c	2012-08-30 01:55:41.000000000 +0200
-@@ -24,6 +24,8 @@
+--- a/src/monitord/report.c
++++ b/src/monitord/report.c
+@@ -25,6 +25,8 @@
      printf("\t-r <filter> <value> Show related entries.\n");
      printf("\t-n                  Creates a description for the report.\n");
      printf("\t-s                  Show the alert dump.\n");
@@ -448,7 +430,7 @@ Index: pkg-ossec/src/monitord/report.c
      printf("\n");
      printf("\tFilters allowed: group, rule, level, location,\n");
      printf("\t                 user, srcip, filename\n");
-@@ -41,6 +43,7 @@
+@@ -42,6 +44,7 @@
  {
      int c, test_config = 0;
      int uid=0,gid=0;
@@ -456,7 +438,7 @@ Index: pkg-ossec/src/monitord/report.c
      char *dir  = DEFAULTDIR;
      char *user = USER;
      char *group = GROUPGLOBAL;
-@@ -76,7 +79,7 @@
+@@ -77,7 +80,7 @@
      
      r_filter.report_name = NULL;
  
@@ -465,7 +447,7 @@ Index: pkg-ossec/src/monitord/report.c
      {
          switch(c){
              case 'V':
-@@ -144,6 +147,12 @@
+@@ -145,6 +148,12 @@
              case 's':
                  r_filter.show_alerts = 1;
                  break;
@@ -478,7 +460,7 @@ Index: pkg-ossec/src/monitord/report.c
              default:
                  report_help();
                  break;
-@@ -173,11 +182,13 @@
+@@ -174,11 +183,13 @@
  
      
      /* chrooting */
@@ -497,11 +479,9 @@ Index: pkg-ossec/src/monitord/report.c
  
      
      /* Changing user */        
-Index: pkg-ossec/src/os_dbd/main.c
-===================================================================
---- pkg-ossec.orig/src/os_dbd/main.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/os_dbd/main.c	2012-08-30 01:55:41.000000000 +0200
-@@ -55,6 +55,7 @@
+--- a/src/os_dbd/main.c
++++ b/src/os_dbd/main.c
+@@ -56,6 +56,7 @@
  {
      int c, test_config = 0, run_foreground = 0;
      int uid = 0,gid = 0;
@@ -509,7 +489,7 @@ Index: pkg-ossec/src/os_dbd/main.c
  
      /* Using MAILUSER (read only) */
      char *dir  = DEFAULTDIR;
-@@ -72,7 +73,7 @@
+@@ -73,7 +74,7 @@
      OS_SetName(ARGV0);
          
  
@@ -518,7 +498,7 @@ Index: pkg-ossec/src/os_dbd/main.c
          switch(c){
              case 'V':
                  db_info();
-@@ -111,6 +112,12 @@
+@@ -112,6 +113,12 @@
              case 't':
                  test_config = 1;    
                  break;
@@ -531,7 +511,7 @@ Index: pkg-ossec/src/os_dbd/main.c
              default:
                  help(ARGV0);
                  break;
-@@ -215,12 +222,14 @@
+@@ -216,12 +223,14 @@
  
      
      /* chrooting */
@@ -552,11 +532,9 @@ Index: pkg-ossec/src/os_dbd/main.c
  
  
      /* Inserting server info into the db */
-Index: pkg-ossec/src/remoted/main.c
-===================================================================
---- pkg-ossec.orig/src/remoted/main.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/remoted/main.c	2012-08-30 01:55:41.000000000 +0200
-@@ -20,6 +20,7 @@
+--- a/src/remoted/main.c
++++ b/src/remoted/main.c
+@@ -21,6 +21,7 @@
      int i = 0,c = 0;
      int uid = 0, gid = 0;
      int test_config = 0,run_foreground = 0;
@@ -564,7 +542,7 @@ Index: pkg-ossec/src/remoted/main.c
      
      char *cfg = DEFAULTCPATH;
      char *dir = DEFAULTDIR;
-@@ -31,7 +32,7 @@
+@@ -32,7 +33,7 @@
      OS_SetName(ARGV0);
  
      
@@ -573,7 +551,7 @@ Index: pkg-ossec/src/remoted/main.c
          switch(c){
              case 'V':
                  print_version();
-@@ -67,6 +68,17 @@
+@@ -68,6 +69,17 @@
                  if(!optarg)
                      ErrorExit("%s: -D needs an argument",ARGV0);
                  dir = optarg;
@@ -591,7 +569,7 @@ Index: pkg-ossec/src/remoted/main.c
          }
      }
  
-@@ -113,11 +125,13 @@
+@@ -114,11 +126,13 @@
              ErrorExit(SETGID_ERROR, ARGV0, group);
  
      /* Going on chroot */
@@ -610,11 +588,9 @@ Index: pkg-ossec/src/remoted/main.c
  
  
      /* Starting the signal manipulation */
-Index: pkg-ossec/src/util/agent_control.c
-===================================================================
---- pkg-ossec.orig/src/util/agent_control.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/util/agent_control.c	2012-08-30 01:55:41.000000000 +0200
-@@ -34,6 +34,8 @@
+--- a/src/util/agent_control.c
++++ b/src/util/agent_control.c
+@@ -35,6 +35,8 @@
      printf("\t-f <ar>     Used with -b, specifies which response to run.\n");
      printf("\t-L          List available active responses.\n");
      printf("\t-s          Changes the output to CSV (comma delimited).\n");
@@ -623,7 +599,7 @@ Index: pkg-ossec/src/util/agent_control.c
      exit(1);
  }
  
-@@ -54,6 +56,7 @@
+@@ -55,6 +57,7 @@
      int c = 0, restart_syscheck = 0, restart_all_agents = 0, list_agents = 0;
      int info_agent = 0, agt_id = 0, active_only = 0, csv_output = 0; 
      int list_responses = 0, end_time = 0, restart_agent = 0;
@@ -631,7 +607,7 @@ Index: pkg-ossec/src/util/agent_control.c
  
      char shost[512];
      
-@@ -72,7 +75,7 @@
+@@ -73,7 +76,7 @@
      }
  
  
@@ -640,7 +616,7 @@ Index: pkg-ossec/src/util/agent_control.c
      {
          switch(c){
              case 'V':
-@@ -139,6 +142,12 @@
+@@ -140,6 +143,12 @@
              case 'a':
                  restart_all_agents = 1;
                  break;
@@ -653,7 +629,7 @@ Index: pkg-ossec/src/util/agent_control.c
              default:
                  helpmsg();
                  break;
-@@ -164,14 +173,16 @@
+@@ -165,14 +174,16 @@
      
      
      /* Chrooting to the default directory */
@@ -677,11 +653,9 @@ Index: pkg-ossec/src/util/agent_control.c
   
  
      /* Setting the user */
-Index: pkg-ossec/src/util/rootcheck_control.c
-===================================================================
---- pkg-ossec.orig/src/util/rootcheck_control.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/util/rootcheck_control.c	2012-08-30 01:55:57.000000000 +0200
-@@ -34,6 +34,8 @@
+--- a/src/util/rootcheck_control.c
++++ b/src/util/rootcheck_control.c
+@@ -35,6 +35,8 @@
      printf("\t-q          Used with -i, prints all the outstanding issues.\n");
      printf("\t-L          Used with -i, prints the last scan.\n");
      printf("\t-s          Changes the output to CSV (comma delimited).\n");
@@ -690,7 +664,7 @@ Index: pkg-ossec/src/util/rootcheck_control.c
      exit(1);
  }
  
-@@ -48,6 +50,7 @@
+@@ -49,6 +51,7 @@
  
      int gid = 0;
      int uid = 0;
@@ -698,7 +672,7 @@ Index: pkg-ossec/src/util/rootcheck_control.c
      int c = 0, info_agent = 0, update_rootcheck = 0,
                 list_agents = 0, show_last = 0,
                 resolved_only = 0;
-@@ -68,7 +71,7 @@
+@@ -69,7 +72,7 @@
      }
  
  
@@ -707,7 +681,7 @@ Index: pkg-ossec/src/util/rootcheck_control.c
      {
          switch(c){
              case 'V':
-@@ -116,6 +119,12 @@
+@@ -117,6 +120,12 @@
                  agent_id = optarg;
                  update_rootcheck = 1;
                  break;
@@ -720,7 +694,7 @@ Index: pkg-ossec/src/util/rootcheck_control.c
              default:
                  helpmsg();
                  break;
-@@ -141,14 +150,16 @@
+@@ -142,14 +151,16 @@
      
      
      /* Chrooting to the default directory */
@@ -744,11 +718,9 @@ Index: pkg-ossec/src/util/rootcheck_control.c
   
  
      /* Setting the user */
-Index: pkg-ossec/src/util/clear_stats.c
-===================================================================
---- pkg-ossec.orig/src/util/clear_stats.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/util/clear_stats.c	2012-08-30 01:55:42.000000000 +0200
-@@ -27,6 +27,8 @@
+--- a/src/util/clear_stats.c
++++ b/src/util/clear_stats.c
+@@ -28,6 +28,8 @@
      printf("\t-a       Clear all the stats (averages).\n");
      printf("\t-d       Clear the daily averages.\n");
      printf("\t-w       Clear the weekly averages.\n\n");
@@ -757,7 +729,7 @@ Index: pkg-ossec/src/util/clear_stats.c
      exit(1);
  }
  
-@@ -42,6 +44,8 @@
+@@ -43,6 +45,8 @@
      char *user = USER;
      int gid;
      int uid;
@@ -766,7 +738,7 @@ Index: pkg-ossec/src/util/clear_stats.c
      
  
      /* Setting the name */
-@@ -49,11 +53,42 @@
+@@ -50,11 +54,42 @@
          
      
      /* user arguments */
@@ -812,7 +784,7 @@ Index: pkg-ossec/src/util/clear_stats.c
      /* Getting the group name */
      gid = Privsep_GetGroup(group);
      uid = Privsep_GetUser(user);
-@@ -71,14 +106,16 @@
+@@ -72,14 +107,16 @@
      
      
      /* Chrooting to the default directory */
@@ -836,7 +808,7 @@ Index: pkg-ossec/src/util/clear_stats.c
   
  
      /* Setting the user */
-@@ -87,30 +124,6 @@
+@@ -88,30 +125,6 @@
          ErrorExit(SETUID_ERROR, ARGV0, user);
      }
    
@@ -867,19 +839,17 @@ Index: pkg-ossec/src/util/clear_stats.c
  
      /* Clear daily files */
      if(clear_daily)
-Index: pkg-ossec/src/util/syscheck_update.c
-===================================================================
---- pkg-ossec.orig/src/util/syscheck_update.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/util/syscheck_update.c	2012-08-30 01:55:41.000000000 +0200
+--- a/src/util/syscheck_update.c
++++ b/src/util/syscheck_update.c
 @@ -27,6 +27,8 @@
-     printf("\t-a       Update syscheck database for all agents.\n");
-     printf("\t-u <id>  Update syscheck database for a specific agent.\n");
-     printf("\t-u local Update syscheck database locally.\n\n");
+     printf("\t-l       List available agents.\n");
+     printf("\t-a       Update (clear) syscheck database for all agents.\n");
+     printf("\t-u <id>  Update (clear) syscheck database for a specific agent.\n");
 +    printf("\t-N       Do not chroot.\n");
 +    printf("\t-C       Chroot the program (default behaviour).\n");
+     printf("\t-u local Update (clear) syscheck database locally.\n\n");
      exit(1);
  }
- 
 @@ -39,6 +41,10 @@
      char *user = USER;
      int gid;
@@ -1159,11 +1129,9 @@ Index: pkg-ossec/src/util/syscheck_update.c
  }
  
  
-Index: pkg-ossec/src/util/syscheck_control.c
-===================================================================
---- pkg-ossec.orig/src/util/syscheck_control.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/util/syscheck_control.c	2012-08-30 01:55:42.000000000 +0200
-@@ -36,6 +36,8 @@
+--- a/src/util/syscheck_control.c
++++ b/src/util/syscheck_control.c
+@@ -37,6 +37,8 @@
      printf("\t-z          Used with the -f, zeroes the auto-ignore counter.\n");
      printf("\t-d          Used with the -f, ignores that file.\n");
      printf("\t-s          Changes the output to CSV (comma delimited).\n");
@@ -1172,7 +1140,7 @@ Index: pkg-ossec/src/util/syscheck_control.c
      exit(1);
  }
  
-@@ -51,6 +53,7 @@
+@@ -52,6 +54,7 @@
  
      int gid = 0;
      int uid = 0;
@@ -1180,7 +1148,7 @@ Index: pkg-ossec/src/util/syscheck_control.c
      int c = 0, info_agent = 0, update_syscheck = 0,
                 list_agents = 0, zero_counter = 0,
                 registry_only = 0;
-@@ -71,7 +74,7 @@
+@@ -72,7 +75,7 @@
      }
  
  
@@ -1189,7 +1157,7 @@ Index: pkg-ossec/src/util/syscheck_control.c
      {
          switch(c){
              case 'V':
-@@ -126,6 +129,12 @@
+@@ -127,6 +130,12 @@
                  agent_id = optarg;
                  update_syscheck = 1;
                  break;
@@ -1202,7 +1170,7 @@ Index: pkg-ossec/src/util/syscheck_control.c
              default:
                  helpmsg();
                  break;
-@@ -151,14 +160,16 @@
+@@ -152,14 +161,16 @@
      
      
      /* Chrooting to the default directory */
@@ -1226,11 +1194,9 @@ Index: pkg-ossec/src/util/syscheck_control.c
   
  
      /* Setting the user */
-Index: pkg-ossec/src/client-agent/agentd.c
-===================================================================
---- pkg-ossec.orig/src/client-agent/agentd.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/client-agent/agentd.c	2012-08-30 01:39:39.000000000 +0200
-@@ -24,7 +24,7 @@
+--- a/src/client-agent/agentd.c
++++ b/src/client-agent/agentd.c
+@@ -25,7 +25,7 @@
  /* AgentdStart v0.2, 2005/11/09
   * Starts the agent daemon.
   */
@@ -1239,7 +1205,7 @@ Index: pkg-ossec/src/client-agent/agentd.c
  {
      int rc = 0;
      int pid = 0;
-@@ -48,11 +48,13 @@
+@@ -49,11 +49,13 @@
  
      
      /* chrooting */
@@ -1258,11 +1224,9 @@ Index: pkg-ossec/src/client-agent/agentd.c
  
  
      if(Privsep_SetUser(uid) < 0)
-Index: pkg-ossec/src/client-agent/agentd.h
-===================================================================
---- pkg-ossec.orig/src/client-agent/agentd.h	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/client-agent/agentd.h	2012-08-30 01:39:39.000000000 +0200
-@@ -28,7 +28,7 @@
+--- a/src/client-agent/agentd.h
++++ b/src/client-agent/agentd.h
+@@ -29,7 +29,7 @@
  int ClientConf(char *cfgfile);
  
  /* Agentd init function */
@@ -1271,11 +1235,9 @@ Index: pkg-ossec/src/client-agent/agentd.h
  
  /* Event Forwarder */
  void *EventForward();
-Index: pkg-ossec/src/client-agent/main.c
-===================================================================
---- pkg-ossec.orig/src/client-agent/main.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/client-agent/main.c	2012-08-30 01:55:42.000000000 +0200
-@@ -42,13 +42,14 @@
+--- a/src/client-agent/main.c
++++ b/src/client-agent/main.c
+@@ -43,13 +43,14 @@
      
      int uid = 0;
      int gid = 0;
@@ -1291,7 +1253,7 @@ Index: pkg-ossec/src/client-agent/main.c
          switch(c){
              case 'V':
                  print_version();
-@@ -77,6 +78,12 @@
+@@ -78,6 +79,12 @@
                      ErrorExit("%s: -D needs an argument",ARGV0);
                  dir = optarg;
                  break;
@@ -1304,7 +1266,7 @@ Index: pkg-ossec/src/client-agent/main.c
          }
      }
  
-@@ -129,7 +136,7 @@
+@@ -130,7 +137,7 @@
  
  
      /* Agentd Start */
@@ -1313,11 +1275,9 @@ Index: pkg-ossec/src/client-agent/main.c
  
      
      return(0);
-Index: pkg-ossec/src/util/list_agents.c
-===================================================================
---- pkg-ossec.orig/src/util/list_agents.c	2012-08-29 13:44:53.000000000 +0200
-+++ pkg-ossec/src/util/list_agents.c	2012-08-30 01:55:42.000000000 +0200
-@@ -25,6 +25,8 @@
+--- a/src/util/list_agents.c
++++ b/src/util/list_agents.c
+@@ -26,6 +26,8 @@
      printf("\t-a    List all agents.\n");
      printf("\t-c    List the connected (active) agents.\n");
      printf("\t-n    List the not connected (active) agents.\n");
@@ -1326,7 +1286,7 @@ Index: pkg-ossec/src/util/list_agents.c
      exit(1);
  }
  
-@@ -41,6 +43,8 @@
+@@ -42,6 +44,8 @@
      int gid;
      int uid;
      int flag;
@@ -1335,7 +1295,7 @@ Index: pkg-ossec/src/util/list_agents.c
      
  
      /* Setting the name */
-@@ -52,6 +56,36 @@
+@@ -53,6 +57,36 @@
      {
          helpmsg();
      }
@@ -1372,7 +1332,7 @@ Index: pkg-ossec/src/util/list_agents.c
      
      /* Getting the group name */
      gid = Privsep_GetGroup(group);
-@@ -70,14 +104,16 @@
+@@ -71,14 +105,16 @@
      
      
      /* Chrooting to the default directory */
@@ -1396,7 +1356,7 @@ Index: pkg-ossec/src/util/list_agents.c
   
  
      /* Setting the user */
-@@ -86,32 +122,6 @@
+@@ -87,32 +123,6 @@
          ErrorExit(SETUID_ERROR, ARGV0, user);
      }
    

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ossec/pkg-ossec.git



More information about the Pkg-ossec-devel mailing list