Blob Blame History Raw
diff -Naur aide-0.9-orig/ChangeLog aide-CVS-20030902/ChangeLog
--- aide-0.9-orig/ChangeLog	2002-06-04 09:34:42.000000000 +0200
+++ aide-CVS-20030902/ChangeLog	2003-01-16 11:37:34.000000000 +0100
@@ -1,3 +1,10 @@
+2002-07-22  Rami Lehti  <Rami.Lehti@Finland.Sun.COM>
+
+	* Fixed Unimplemented error message when conf md not compiled in
+	* Fixed error message about nonexistant files.
+	* Fixed --with-extra-includes --with-extra-libs handling (I hope)
+	* Fixed *stat handling
+
 2002-06-04  Rami Lehti  <Rami.Lehti@Finland.Sun.COM>
 
 	* Released 0.9
diff -Naur aide-0.9-orig/doc/aide.1.ru aide-CVS-20030902/doc/aide.1.ru
--- aide-0.9-orig/doc/aide.1.ru	1970-01-01 01:00:00.000000000 +0100
+++ aide-CVS-20030902/doc/aide.1.ru	2003-01-16 11:37:34.000000000 +0100
@@ -0,0 +1,65 @@
+.TH "aide" "1"
+.SH "НАЗВАНИЕ"
+\fBaide\fP \- Advanced Intrusion Detection Environment
+.SH "СИНТАКСИС"
+\fBaide\fP
+\%[\fBoptions\fP]
+\%\fBcommand\fP
+.SH "ОПИСАНИЕ"
+\fBaide\fP это система определения незаконных вторжений в систему, путем проверки целостности файловой системы
+
+.SH "КОМАНДЫ"
+.PP
+.IP --check, -C
+Проверяет базу на непоследовательноть данных. Вы должны предварительно
+создать базу перед данной процедурой. Это также действие по умолчанию.
+Запущенная безо всяких параметров программа \fBaide\fP будет выполнять проверку.
+.IP --init, -i
+Создает базу данных. Вы должны создать базу и скопировать ее в определенное
+место паред использованием параметра --check.
+.IP --update, -u
+Проверяет базу и вносит обновления, если это необходимо, автоматически.
+Входная и вызодная базы должны быть различны.
+.SH "ПАРАМЕТРЫ"
+.IP --config=\fBconfigfile\fR , -c \fBconfigfile\fR
+Конфигурационные данные будут прочитаны из файла\fBconfigfile\fR вместо "./aide.conf". Можно использовать '-' для обозначения стандартного входа
+.IP --before="\fBconfigparameters\fR" , -B "\fBconfigparameters\fR"
+Этот параметр означает что надо принять \fBconfigparameters\fR перед
+чтением конфигурационного файла. Смотрите aide.conf (5)
+для более подробной информации о том, что можно поместить здесь.
+.IP --after="configparameters" , -A "configparameters"
+Этот параметр означает что надо принять \fBconfigparameters\fR после
+чтения конфигурационного файла. Смотрите aide.conf (5)
+для более подробной информации о том, что можно поместить здесь.
+.IP --verbose=verbosity_level,-Vverbosity_level
+Контролирует уровень подробности сообщений \fBaide\fP. Значение должно быть между 0 и 255.
+По умолчанию оно принимается равным 5. Без параметра значение устанавливается в 20.
+Этот параметр изменяет значение заданное в конфигурационном файле.
+.IP --report=\fBreporter\fR,-r \fBreporter\fR
+\fBreporter\fR это URL который указывает \fBaide\fP куда ей отсылать весь вывод.
+Смотрите aide.conf (5), раздел URL  на предмет допустимых значений.
+.IP --version,-v
+\fBaide\fP выводит номер версии.
+.IP --help,-h
+Выводит стандартное мправочное сообщение.
+.PP
+.SH "ФАЙЛЫ"
+.B <prefix>/etc/aide.conf
+Стандартный конфигурационный файл aide.
+.B <prefix>/etc/aide.db
+Стандартная база данных aide.
+.B <prefix>/etc/aide.db.new
+Стандартная выходная (вновь создаваемая) база aide.
+.SH "СМ. ТАКЖЕ"
+.BR aide.conf (5)
+.BR http://www.cs.tut.fi/~rammer/aide/manual.html
+.SH "ОШИБКИ"
+В этой версии программы возможно наличие ошибок. Пожайлуста сообщите о них
+rammer@cs.tut.fi. Исправления приветствуются. Предпочитаются в виде стандартных патчей.
+.SH DISCLAIMER
+All trademarks are the property of their respective owners.
+No animals were harmed while making this webpage or this piece of
+software. Although some pizza delivery guy's feelings were hurt.
+.BR
+.SH "ПЕРЕВОД"
+Translation by Stanislav I. Ievlev <inger@linux.ru.net>
diff -Naur aide-0.9-orig/doc/aide.conf.5.ru aide-CVS-20030902/doc/aide.conf.5.ru
--- aide-0.9-orig/doc/aide.conf.5.ru	1970-01-01 01:00:00.000000000 +0100
+++ aide-CVS-20030902/doc/aide.conf.5.ru	2003-01-16 11:37:34.000000000 +0100
@@ -0,0 +1,200 @@
+.TH "aide.conf" "5"
+.SH "НАЗВАНИЕ"
+aide.conf - Конфигурационный файл для Advanced Intrusion Detection
+Environment 
+.PP
+.SH "СИНТАКСИС"
+\fBaide.conf\fP это конфигурационный файл для Advanced Intrusion
+Detection Environment. \fBaide.conf\fP содержит данные кофигурации
+используемые для создания или проверки базы данных aide.
+.PP
+.SH "ФОРМАТ ФАЙЛА"
+\fBaide.conf\fP подобен  конфигурационному файлу программы Tripwire (tm).
+C небольшими усилиями можно перевести tw.conf в aide.conf.
+.PP
+Записи в Aide.conf чувствительны к регистру. Первые и  последние пробелы 
+в строке игнорируются.
+.PP
+Существует три типа строк в \fBaide.conf\fP. Во-первых, это строки конфигурации
+которые используются для установки параметров и назначения/отмены переменных.
+Второй тип строк используется для выбора файлов добавляемых в базу. Третий-
+это макросы. Только второй тип строк необходим для работоспособности aide.
+Строки начинающиеся со знака # игнорируются как коментарии.
+.PP
+.SH "СТРОКИ КОНФИГУРАЦИИ"
+.PP
+Эти строки имеют формат "параметр=значение". Смотрите  URLS для ознакомления со
+списком возможных.
+.PP
+.IP database
+Это URL указывающий на метоположение базы для чтения. Может присутствовать только
+одна строка этого типа. Если указано несколько, то будет использоваться только первая.
+Значение по умолчанию "./aide.db".
+.IP database_out
+URL указывает местоположение для записи новой, только что созданной базы.
+Может присутствовать только
+одна строка этого типа. Если указано несколько, то будет использоваться только первая.
+Значение по умолчанию"./aide.db.new".
+.IP verbose
+Уровень подробности сообщений на выводе. Это значение может быть между 0 и 255
+включительно. Этот параметр задается только один раз. Используется значение указанное
+первый раз. Если используется --verbose или -V то значение переписывается новым,
+там указанным. Значение по умолчанию 5. Если подробность установлена в 20 то
+появляются дополнительные сообщения во время выполнения --check или --update.
+.IP report_url
+местоположение куда будет направлен вывод. Может присутствовать несколько строк
+данного типа. Вывод будет осуществляться во все указанные. По умолчанию это стандартный вывод.
+.IP gzip_dbout
+Осуществлять вывод в базу используя сжатие gzip или нет. Допустимые
+значения yes, true, no и false. По умолчанию сжатие не осуществляется.
+Этот параметр доступен только если программа собрана с поддержкой zlib.
+.IP "Определения групп"
+Если параметр не один из выше перечисленных, то он трактуется как определение групп.
+Значение представлено выражением. Выражение имеет следующий вид.
+.LP 
+<предопределенная группа>| <выражение> + <предопределенная группа>
+		  | <выражение> - <предопределенная группа>
+.IP
+Смотрите СТАНДАРТНЫЕ ГРУППЫ на предмет предопределенных групп.
+Этметим, что это несколько отлично от того как делается в Tripwire(tm)
+.IP
+Существует также специальная группа именуемая "ignore_list". Предопределенные 
+группы включенные в нее НЕ будут отражены в окончательном отчете.
+.PP
+.SH "СТРОКИ ВЫБОРА"
+.PP
+Существуют три типа строк выбора (обычные, отрицательные, равенства)
+Строки начинающиеся с "/" обычные строки выбора (/home/*). Строки
+начинающиеся с "!" это отрицательные строки. А строки начинающиеся со знака "="
+это строки-равенства. Строка следующая за первым символом трактуется как
+регулярное выражение соотвествующее полному имени файлы (с указанием полного пути)
+При обычном правиле выбора "/" включается в регулярное выражение.Возможны регулярные выражения в выражениях.
+Смотрите СТРОКИ КОНФИГУРАЦИИ на предмет возможных выражений. Смотрите ПРИМЕРЫ и 
+doc/aide.conf на предмет примеров.
+.PP
+.SH "СТРОКИ МАКРОСЫ"
+.PP
+.IP "@@define \fBVAR\fR \fBval\fR"
+Назначить переменной \fBVAR\fR значение \fBval\fR.
+.IP "@@undef \fBVAR\fR"
+Отменить значение переменной \fBVAR\fR.
+.IP "@@ifdef \fBVAR\fR, @@ifndef \fBVAR\fR"
+@@ifdef начало условного выражения if . Оно должно заверщиться с @@endif.
+Строки между @@ifdef и @@endif используются если переменная
+\fBVAR\fR определена. Если есть условие @@else то часть между
+@@ifdef и @@else используется если \fBVAR\fR определена, в противном случае
+используется часть между @@else и @@endif .Выражение @@ifndef имеет
+логику обратную к @@ifdef но в остальном работает также.
+.IP "@@ifhost \fBhostname\fR, @@ifnhost \fBhostname\fR"
+@@ifhost работает как @@ifdef только в отличие от него проверяет 
+равно ли \fBhostname\fR имени машины на которой запущен aide.
+\fBhostname\fR это имя машины без имени домена
+(hostname, но не hostname.aide.org).
+.IP "@{\fBVAR\fR}"
+Выражение @@{\fBVAR\fR} заменяется значением переменной \fBVAR\fR.
+Если переменная \fBVAR\fR не определена,то используется пустая строка. В
+Tripwire(tm) @@VAR НЕ поддерживаются.
+.IP "@@else"
+Начало альтернативной части выражения.
+.IP "@@endif"
+Окончание условного выражения if.
+.IP "@@include \fBVAR\fR"
+Включает файл \fBVAR\fR. Содержимое файла используется как если бы он был
+частью конфигурационного файла.
+.PP
+.SH URLS
+Местоположение может быть одним из следующий. Входящие URL не могут быть
+использованы как выходные и наоборот
+.IP stdout
+.IP stderr
+Выходные данные направытся в stdout и stderr соответственно.
+.IP stdin
+Входные данные берутся с stdin.
+.IP file://\fBfilename\fR
+Входные данные берутся из файла с именем \fBfilename\fR или туда записываются выходные.
+.IP fd:\fBnumber\fR
+Входные данные берутся из дескриптора с номером \fBnumber\fR или туда записываются выходные.
+.PP
+.SH "СТАНДАРТНЫЕ ГРУППЫ"
+.PP
+.IP "p:	права"
+.IP "i:	inode"
+.IP "n:	количество ссылок"
+.IP "u:	пользователь"
+.IP "g:	группа"
+.IP "s:	размер"
+.IP "m:	время модификации"
+.IP "a:	время доступа"
+.IP "c:	время создания"
+.IP "S:	проверка на увеличение/изменение размера"
+.IP "md5:	md5 checksum"
+.IP "sha1:	sha1 checksum"
+.IP "rmd160:     rmd160 checksum"
+.IP "tiger:     tiger checksum"
+.IP "R:	p+i+n+u+g+s+m+c+md5"
+.IP "L:	p+i+n+u+g"
+.IP "E:	Пустая группа"
+.IP ">:	Постоянно увеличивающийся лог-файл p+u+g+i+n+S"
+.IP "Возможны также, если при сборке выбранна поддержка mhash"
+.IP "crc32:	crc32 checksum"
+.IP "haval:	haval checksum"
+.IP "gost:	gost checksum"
+
+
+.PP
+.SH ПРИМЕРЫ
+.IP
+.B "/	R"
+.LP
+Это добавляет все файлы вашей машины. Эта одна строка вполне достаточна для конфигурационного файла.
+.IP
+.B "!/dev"
+.LP
+Игнорировать структуру каталога /dev.
+.IP
+.B "=/tmp"
+.LP
+Добавить только /tmp в базу, но не добавлять его подкаталоги.
+.IP 
+.B "\fBAll\fR=p+i+n+u+g+s+m+c+a+md5+sha1+tiger+rmd160"
+.LP 
+Эта строка назначает группу \fBAll\fR. Она включает в себя все аттрибуты и все
+возможные контрольные суммы. Если вы действительно желаете использовать все
+доступные контрольные суммы, то следует включить поддержку mhash при сборке и
+добавить +crc32+haval+gost в конец определения группы \fBAll\fR.Обращаем внимание,
+что поддержка Mhash может быть включена только во время сборки.
+.PP
+.SH СОВЕТЫ
+.IP
+.B "=/foo R"
+.IP
+.B "/foo/bar R"
+.LP
+Этот параметр добавит все файлы в /foo поскольку они соответствуют /foo,
+что эквивалентно /foo.* (напомним, что в строках выбора используются регулярные выражения). Возможно вы в действительности жалали написать следующее:
+
+.IP 
+.B "=/foo$ R"
+.IP
+.B "/foo/bar R"
+.LP 
+Отметим, что следующее выражение работает, поскольку /foo добавляется не
+рекурсивно.
+.IP
+.B "=/foo R"
+ А вот первое выражение не разрешено в AIDE. Вместо этого используйте
+.IP
+.B "/foo epug"
+.IP 
+.B "/foo e+p+u+g"
+.PP
+.SH "СМ. ТАКЖЕ"
+.BR aide (1)
+.BR http://www.cs.tut.fi/~rammer/aide/manual.html
+.SH DISCLAIMER
+All trademarks are the property of their respective owners.
+No animals were harmed while making this webpage or this piece of
+software.
+.SH "ПЕРЕВОД"
+Translation by Stanislav I. Ievlev <inger@linux.ru.net>
+
diff -Naur aide-0.9-orig/doc/release.HOWTO aide-CVS-20030902/doc/release.HOWTO
--- aide-0.9-orig/doc/release.HOWTO	1970-01-01 01:00:00.000000000 +0100
+++ aide-CVS-20030902/doc/release.HOWTO	2003-01-16 11:37:34.000000000 +0100
@@ -0,0 +1,48 @@
+This document is for the maintainer of AIDE.
+Currently that is Rami Lehti.
+
+HOWTO do a release of aide.
+
+From a clean CVS tree do 
+sh autogen.sh
+./configure;make
+to create all necessary files.
+make dist
+to create the distribution
+
+unpack it and see that it compiles without too many errors.
+
+Tag the CVS tree with 
+cvs tag RELEASE_<version number s/\./_/g>
+
+create PGP signature 
+gpg -a --detach-sign aide*tar.gz
+
+copy it to ~/public_html/
+and /share/ftpcs/pub/src/gnu
+chmod a+r ~/public_html/aide* /share/ftpcs/pub/src/gnu/aide*
+
+Post an announcement to the mailinglist.
+
+New version of AIDE released!
+***************************************
+
+The new version is <version number>
+
+You can download it from <direct URL>
+
+There are <many/a few/important/trivial> changes in this release, so
+it's <recommended/not necessary> to upgrade if you're using a version
+prior to <some other version number>
+
+All comments and feedback is welcome!
+
+Regards and best wishes,
+
+Rami
+
+The home URL of <package name> is http://<homepage URL>
+
+Post an announcement to freshmeat.net
+Post an announcement to www.linuxsecurity.com by
+news@linuxsecurity.com or contribute@linuxsecurity.com
\ No newline at end of file
diff -Naur aide-0.9-orig/include/commandconf.h aide-CVS-20030902/include/commandconf.h
--- aide-0.9-orig/include/commandconf.h	2002-05-29 10:04:26.000000000 +0200
+++ aide-CVS-20030902/include/commandconf.h	2003-01-16 11:37:34.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/include/commandconf.h,v 1.11 2002/05/29 08:04:26 rammer Exp $
+ * $Header: /aide/aide/include/commandconf.h,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -24,6 +24,7 @@
 #include "db_config.h"
 
 extern long conf_lineno;
+extern int newlinelastinconfig;
 
 int commandconf(const char mode,const char* line);
 
diff -Naur aide-0.9-orig/README aide-CVS-20030902/README
--- aide-0.9-orig/README	2002-05-29 10:04:26.000000000 +0200
+++ aide-CVS-20030902/README	2003-01-17 10:24:41.000000000 +0100
@@ -2,7 +2,7 @@
 
 		Advanced Intrusion Detection Environment
 
-		Version 0.9
+		Version 0.9.1
 
 *******************************************************************
 
@@ -34,6 +34,8 @@
 Checksum of the binary at the start of the report
 PGP support
 @@ifdef foo || ( bar && baz )
+Use newer autoconf
+Release more often
 
 
 Documentation 
diff -Naur aide-0.9-orig/src/aide.c aide-CVS-20030902/src/aide.c
--- aide-0.9-orig/src/aide.c	2002-05-31 14:47:07.000000000 +0200
+++ aide-CVS-20030902/src/aide.c	2003-01-16 11:37:34.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/aide.c,v 1.26 2002/05/31 12:47:07 rammer Exp $
+ * $Header: /aide/aide/src/aide.c,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -472,6 +472,10 @@
   }
   
   if((conf->do_configmd||conf->config_check)&& conf->confmd!=0){
+    /* The patch automatically adds a newline so will also have to add it. */
+    if(newlinelastinconfig==0){
+      mhash(conf->confmd,"\n",1);
+    };
     mhash(conf->confmd, NULL,0);
     dig=(byte*)malloc(sizeof(byte)*mhash_get_block_size(conf->confhmactype));
     mhash_deinit(conf->confmd,(void*)dig);
@@ -546,7 +550,11 @@
     if(conf->confmd){
       error(0,"Config checked. Use the following to patch your config file.\n");
       error(0,"0a1\n");
-      error(0,"> @@begin_config %s\n%ia%i\n> @@end_config\n",digstr,conf_lineno-2,conf_lineno);
+      if(newlinelastinconfig==1){
+	error(0,"> @@begin_config %s\n%ia%i\n> @@end_config\n",digstr,conf_lineno-1,conf_lineno+1);
+      }else {
+	error(0,"> @@begin_config %s\n%ia%i\n> @@end_config\n",digstr,conf_lineno,conf_lineno+2);
+      }
       free(dig);
       free(digstr);
     }
diff -Naur aide-0.9-orig/src/commandconf.c aide-CVS-20030902/src/commandconf.c
--- aide-0.9-orig/src/commandconf.c	2002-05-29 10:04:27.000000000 +0200
+++ aide-CVS-20030902/src/commandconf.c	2003-01-16 11:37:34.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/commandconf.c,v 1.30 2002/05/29 08:04:27 rammer Exp $
+ * $Header: /aide/aide/src/commandconf.c,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -241,7 +241,7 @@
   int err=0;
   int* domd=0;
 #ifdef WITH_MHASH
-  MHASH* md;
+  MHASH* md=NULL;
   void* key=NULL;
   int keylen;
 #endif
@@ -385,6 +385,10 @@
 
 void update_db_out_order(int attr)
 {
+  /* First we add those attributes that must be there */
+  if (check_dboo(db_linkname)==RETOK) {
+    conf->db_out_order[conf->db_out_size++]=db_linkname;
+  }
   if (check_dboo(db_attr)==RETOK) {
     conf->db_out_order[conf->db_out_size++]=db_attr;
   }
diff -Naur aide-0.9-orig/src/conf_lex.l aide-CVS-20030902/src/conf_lex.l
--- aide-0.9-orig/src/conf_lex.l	2002-05-29 10:04:27.000000000 +0200
+++ aide-CVS-20030902/src/conf_lex.l	2003-01-16 11:37:34.000000000 +0100
@@ -16,7 +16,7 @@
 
 /*
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/conf_lex.l,v 1.8 2002/05/29 08:04:27 rammer Exp $
+ * $Header: /aide/aide/src/conf_lex.l,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -56,6 +56,7 @@
 int varbol=0;
 
 long conf_lineno=1;
+int newlinelastinconfig=0;
 
 #define MAX_INCLUDE_DEPTH 10
 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
@@ -250,6 +251,11 @@
 }
 
 <<EOF>> {
+        if (yy_hold_char=='\n'){
+            newlinelastinconfig=1;
+        }else {
+            newlinelastinconfig=0;
+        }
         if ( --include_stack_ptr < 0 )
             {
             yyterminate();
@@ -266,6 +272,7 @@
             conf_switch_to_buffer(
                  include_stack[include_stack_ptr] );
             }
+         return TEOF;
 }
 
 
@@ -329,7 +336,7 @@
   error(230,"recstop =\n");
   BEGIN CONFVALHUNT;
   return (TRECSTOP);
-} 
+}
 
 ^[\ \t]*"config_version"{E} {
   error(230,"config_version =\n");
@@ -362,6 +369,7 @@
 
 [^\n] { return(conftext[0]); }
 
+
 %%
 
 int confwrap(){
diff -Naur aide-0.9-orig/src/conf_yacc.y aide-CVS-20030902/src/conf_yacc.y
--- aide-0.9-orig/src/conf_yacc.y	2002-05-29 10:04:27.000000000 +0200
+++ aide-CVS-20030902/src/conf_yacc.y	2003-01-16 11:37:34.000000000 +0100
@@ -2,7 +2,7 @@
 
 /*	
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/conf_yacc.y,v 1.9 2002/05/29 08:04:27 rammer Exp $
+ * $Header: /aide/aide/src/conf_yacc.y,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -62,6 +62,7 @@
 %token TEND_CONFIG
 %token TBEGIN_DB
 %token TEND_DB
+%token TEND_DBNOMD
 %token TID
 %token <s> TSTRING
 %token '='
@@ -136,37 +137,47 @@
 
 line : rule | equrule | negrule | definestmt | undefstmt
        | ifdefstmt | ifndefstmt | ifhoststmt | ifnhoststmt
-       | groupdef | TNEWLINE | db_in | db_out | db_new | verbose
+       | groupdef | db_in | db_out | db_new | verbose | config_version 
        | report | gzipdbout | recursion_stopper | warn_dead_symlinks
        | acl_no_symlink_follow | beginconfigstmt | endconfigstmt
-       | config_version
+       | TEOF {
+            newlinelastinconfig=1;
+	    YYACCEPT;
+          } ;
+       | TNEWLINE 
        | TDBSPEC {
           error(220,"Got @@dbspec.Stopping\n");
 	  YYACCEPT;
-          }
+          } ;
        | TBEGIN_DB {
 	  error(220,"Got @@begin_db. Stopping\n");
 	  YYACCEPT;
-	  }
+          } ;
        | TEND_DB {
 	  conferror("Error while reading configuration");
-          }
+          } ;
        | error {
 	  conferror("Error while reading configuration");
 	  YYABORT;
           } ;
 
-rule : TSELRXRULE expr TNEWLINE
+rule : TSELRXRULE expr newlineoreof
 { conf->selrxlst=append_rxlist($1,$2,conf->selrxlst); } ;
 
-equrule : TEQURXRULE expr TNEWLINE
+equrule : TEQURXRULE expr newlineoreof
 { conf->equrxlst=append_rxlist($1,$2,conf->equrxlst); } ;
 
-negrule : TNEGRXRULE TNEWLINE
+negrule : TNEGRXRULE newlineoreof
 { conf->negrxlst=append_rxlist($1,0,conf->negrxlst); } |
-          TNEGRXRULE expr TNEWLINE 
+          TNEGRXRULE expr newlineoreof 
 { conf->negrxlst=append_rxlist($1,0,conf->negrxlst); };
 
+newlineoreof : TNEWLINE |
+          TEOF {
+            newlinelastinconfig=0;
+	    YYACCEPT;
+          } ;
+
 expr :  expr '+' expr { $$ =$1  | $3 ; } |
         expr '-' expr { $$ =$1  & (~$3 ); } |
 	primary { $$ =$1 ;} ;
@@ -180,7 +191,7 @@
 	    conferror("Error in expression");
 	    YYABORT;
 	  }
-	  }
+	  } ;
 
 other : TRIGHTS { $$ =$1 ;} | TUSER {$$ =$1 ;} 
         | TGROUP {$$ =$1 ;} | TINODE {$$ =$1 ;}
@@ -242,11 +253,11 @@
 beginconfigstmt : TBEGIN_CONFIG TSTRING {
   conf->do_configmd=1;
   conf->old_confmdstr=strdup($2);
-}
+} ;
 
 endconfigstmt : TEND_CONFIG {
   YYACCEPT;
-}
+} ;
 
 acl_no_symlink_follow : TACLNOSYMLINKFOLLOW TTRUE { 
 #ifdef WITH_ACL
@@ -254,7 +265,7 @@
 #else
   error(0,"ACL-support not compiled in.\n");
 #endif
-}
+} ;
 
 acl_no_symlink_follow : TACLNOSYMLINKFOLLOW TFALSE { 
 #ifdef WITH_ACL
@@ -262,15 +273,15 @@
 #else
   error(0,"ACL-support not compiled in.\n");
 #endif
-}
+} ;
 
 warn_dead_symlinks : TWARNDEADSYMLINKS TTRUE {
   conf->warn_dead_symlinks=1;
-}
+} ;
 
 warn_dead_symlinks : TWARNDEADSYMLINKS TFALSE {
   conf->warn_dead_symlinks=0;
-}
+} ;
 
 gzipdbout : TGZIPDBOUT TTRUE { 
 #ifdef WITH_ZLIB
@@ -288,11 +299,11 @@
 recursion_stopper : TRECSTOP TSTRING {
   /* FIXME implement me */  
   
-}
+} ;
 
 config_version : TCONFIG_VERSION TSTRING {
   conf->config_version=strdup($2);
-}
+} ;
 
 %%
 
diff -Naur aide-0.9-orig/src/db_disk.c aide-CVS-20030902/src/db_disk.c
--- aide-0.9-orig/src/db_disk.c	2002-05-29 10:04:27.000000000 +0200
+++ aide-CVS-20030902/src/db_disk.c	2003-01-16 11:37:34.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/db_disk.c,v 1.13 2002/05/29 08:04:27 rammer Exp $
+ * $Header: /aide/aide/src/db_disk.c,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -350,6 +350,38 @@
 	error(255,"New start_path=%s\n",start_path);
       
 	if (open_dir()==RETFAIL) {
+	  /* open_dir failed so we need to know why and print 
+	     an errormessage if needed.
+	     errno should still be the one from opendir() since it's global
+	  */ 
+	  if(errno == ENOENT && r->old_data != NULL &&
+	     r->sel_rx_lst==NULL && r->neg_rx_lst==NULL && 
+	     r->equ_rx_lst==NULL) {
+	    /* The path did not exist and there is old data for this node
+	       and there are no regexps for this node
+	       There is no new data for this node otherwise it would not
+	       come to this part of the code.
+	       So we don't print any error message.
+	       */	    
+	  }else {
+	    /* In any other case we print the message. */
+	    char* er=strerror(errno);
+	    if (er!=NULL) {
+	      error(5,"open_dir():%s: %s\n",er , start_path);
+	    } else {
+	      error(5,"open_dir():%i: %s\n",errno ,start_path);      
+	    }
+	    if(errno == ENOENT &&
+	       ((r->sel_rx_lst!=NULL || r->neg_rx_lst!=NULL || 
+	       r->equ_rx_lst!=NULL)||r->childs!=NULL)) {
+	      /* The dir did not exist and there are regexps referring to
+		 this node or there are children to this node. 
+		 The only way a nonexistant dirnode can have children is by 
+		 having rules referring to them.
+	       */
+	      error(5,"There are rules referring to non-existant directories!\n");
+	    }
+	  }
 	  r->checked|=NODE_TRAVERSE|NODE_CHECKED;
 	  r=r->parent;
 	  error(255,"dropping back to parent\n");
@@ -399,12 +431,15 @@
   
   dirh=opendir(start_path);
   if (dirh==NULL) {
-    char* er=strerror(errno);
+    /* Errors should be printed here because then we get too many
+       errormessages. */
+    /*    char* er=strerror(errno);
     if (er!=NULL) {
       error(5,"open_dir():%s: %s\n",er , start_path);
     } else {
       error(5,"open_dir():%i: %s\n",errno ,start_path);      
     }
+    */
     return RETFAIL;
   }
   
diff -Naur aide-0.9-orig/src/db_file.c aide-CVS-20030902/src/db_file.c
--- aide-0.9-orig/src/db_file.c	2002-05-30 11:42:46.000000000 +0200
+++ aide-CVS-20030902/src/db_file.c	2003-01-16 11:37:34.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/db_file.c,v 1.18 2002/05/30 09:42:46 pablo Exp $
+ * $Header: /aide/aide/src/db_file.c,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -460,7 +460,9 @@
 	i--;
 	break;
       }
-      
+      if(gotend_db){
+	return NULL;
+      }
       /*  */
 
       error(0,"Not enough parameters in db:%i. Trying to continue.\n",
@@ -515,6 +517,11 @@
       break;
     }
 
+    case TEND_DBNOMD : {
+      gotend_db=1;
+      break;
+    }
+
     case TEOF : {
       if(gotend_db){
 	return NULL;
diff -Naur aide-0.9-orig/src/db_lex.l aide-CVS-20030902/src/db_lex.l
--- aide-0.9-orig/src/db_lex.l	2002-05-29 10:04:27.000000000 +0200
+++ aide-CVS-20030902/src/db_lex.l	2003-01-16 11:37:34.000000000 +0100
@@ -23,7 +23,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti,Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/db_lex.l,v 1.4 2002/05/29 08:04:27 rammer Exp $
+ * $Header: /aide/aide/src/db_lex.l,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -104,6 +104,10 @@
   return (TSTRING);
 }
 
+^"@@end_db" {
+  return (TEND_DBNOMD);
+}
+
 "@@"({L}+) {
   return (TUNKNOWN);
 }
diff -Naur aide-0.9-orig/src/db_list.c aide-CVS-20030902/src/db_list.c
--- aide-0.9-orig/src/db_list.c	1970-01-01 01:00:00.000000000 +0100
+++ aide-CVS-20030902/src/db_list.c	2003-01-16 11:37:34.000000000 +0100
@@ -0,0 +1,51 @@
+/* aide, Advanced Intrusion Detection Environment
+ *
+ * Copyright (C) 1999,2000,2001,2002 Rami Lehti,Pablo Virolainen
+ * $Header: /aide/aide/src/db_list.c,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "db_list.h"
+/*for locale support*/
+#include "locale-aide.h"
+/*for locale support*/
+
+void db_list_append(db_list*item)
+{
+  db_list* tmp_listp=NULL;
+  item->next=NULL;
+  item->prev=NULL;
+  item->head=NULL;
+  
+  if(db_list_head==NULL){
+    db_list_head=item;
+    db_list_head->next=NULL;
+    db_list_head->prev=NULL;
+    db_list_head->head=db_list_head;
+    db_list_head->tail=db_list_head;
+    return;
+  }
+  else {
+    tmp_listp=db_list_head->tail;
+    tmp_listp->next=item;
+    tmp_listp->tail=item;
+    item->head=db_list_head;
+    item->tail=db_list_head;
+    db_list_head->tail=item;
+    return;
+  }
+}
+
diff -Naur aide-0.9-orig/src/do_md.c aide-CVS-20030902/src/do_md.c
--- aide-0.9-orig/src/do_md.c	2002-05-31 14:47:07.000000000 +0200
+++ aide-CVS-20030902/src/do_md.c	2003-01-16 11:37:34.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti, Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/do_md.c,v 1.11 2002/05/31 12:47:07 rammer Exp $
+ * $Header: /aide/aide/src/do_md.c,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -149,7 +149,7 @@
     return;
   }
   
-  sres=fstat(filedes,&fs);
+  sres=AIDE_FSTAT_FUNC(filedes,&fs);
   
   if (stat_cmp(&fs,old_fs)==RETOK) {
     /*
diff -Naur aide-0.9-orig/src/gen_list.c aide-CVS-20030902/src/gen_list.c
--- aide-0.9-orig/src/gen_list.c	2002-05-30 11:53:52.000000000 +0200
+++ aide-CVS-20030902/src/gen_list.c	2003-01-17 09:58:38.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti,Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/gen_list.c,v 1.17 2002/05/30 09:53:52 pablo Exp $
+ * $Header: /aide/aide/src/gen_list.c,v 1.2 2003/01/17 08:58:38 cvsd Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -369,6 +369,11 @@
   }
   
 #ifdef HAVE_USTAT
+  /* 
+   * This should not use ustat and should be implemented otherwise
+   * since ustat is not universally known function
+   * check find(1) for clues
+   */
   /*
     Here we should check if we need to add it..
    */  
@@ -1322,24 +1327,24 @@
       }
     }
     /*
-      Is this valid??
-      I think not.
+      Is this valid?? 
+      No, We should do this elsewhere.
+    */
+    /*    if(conf->symlinks_found==0){ 
+      int it=0; 
+      DB_FIELD dbtmp; 
+      DB_FIELD dbtmp2; 
+      dbtmp=conf->db_out_order[1]; 
+      conf->db_out_order[1]=db_linkname; 
+      for(it=2;it<conf->db_out_size;it++){ 
+      	dbtmp2=conf->db_out_order[it]; 
+      	conf->db_out_order[it]=dbtmp;
+      	dbtmp=dbtmp2;
+      } 
+      conf->db_out_order[conf->db_out_size++]=dbtmp; 
+      conf->symlinks_found=1; 
+    } 
     */
-    /*      if(conf->symlinks_found==0){ */
-    /*        int it=0; */
-    /*        DB_FIELD dbtmp; */
-    /*        DB_FIELD dbtmp2; */
-    /*        dbtmp=conf->db_out_order[1]; */
-    /*        conf->db_out_order[1]=db_linkname; */
-    /*        for(it=2;it<conf->db_out_size;it++){ */
-    /*  	dbtmp2=conf->db_out_order[it]; */
-    /*  	conf->db_out_order[it]=dbtmp; */
-    /*  	dbtmp=dbtmp2; */
-    /*        } */
-    /*        conf->db_out_order[conf->db_out_size++]=dbtmp; */
-    /*        conf->symlinks_found=1; */
-    /*      } */
-    
     line->linkname=(char*)malloc(_POSIX_PATH_MAX+1);
     if(line->linkname==NULL){
       error(0,_("malloc failed in add_file_to_list()\n"));
diff -Naur aide-0.9-orig/src/list.c aide-CVS-20030902/src/list.c
--- aide-0.9-orig/src/list.c	2002-05-29 10:04:27.000000000 +0200
+++ aide-CVS-20030902/src/list.c	2003-01-16 11:37:34.000000000 +0100
@@ -1,7 +1,7 @@
 /* aide, Advanced Intrusion Detection Environment
  *
  * Copyright (C) 1999,2000,2001,2002 Rami Lehti,Pablo Virolainen
- * $Header: /cvs-root-aide/aide2/src/list.c,v 1.5 2002/05/29 08:04:27 rammer Exp $
+ * $Header: /aide/aide/src/list.c,v 1.1.1.1 2003/01/16 10:37:34 rammer Exp $
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -32,7 +32,7 @@
  
  * And that is not true anymore. 
  * Now list has header which knows head and tail.
- * Every irem knows header.
+ * Every item knows header.
  
  */