aide/aide-0.13.1-contextsize.patch

50 lines
1.8 KiB
Diff
Raw Normal View History

From: Steve Conklin <sconklin@redhat.com>
To: aide-devel@lists.sourceforge.net
2008-09-26 17:29:01 +00:00
Only the first 32 characters of the selinux context was displayed, which
often isn't enough to see what changed.
2008-09-26 17:29:01 +00:00
This patch increases the displayed length to 128 characters for selinux
contexts and also for link names.
2008-09-26 17:29:01 +00:00
diff -up aide-0.13.1/src/compare_db.c.selcon aide-0.13.1/src/compare_db.c
--- aide-0.13.1/src/compare_db.c.selcon 2006-11-30 14:06:56.000000000 -0500
+++ aide-0.13.1/src/compare_db.c 2008-09-26 13:23:25.000000000 -0400
@@ -53,9 +53,10 @@
const int old_col = 12;
const int new_col = 40;
-const int part_len = 33; /* usable length of line[] */
-char oline[33];
-char nline[33];
+const int part_len = 33; /* usable length of line[] for most purposes */
+const int long_part_len = 129; /* length of line[] for link names and selinux contexts */
+char oline[129];
+char nline[129];
const char* entry_format= " %-9s: %-33s, %s\n";
const char* entry_format_justnew=" %-9s: %-33c %s\n";
/*************/
2008-09-26 17:29:01 +00:00
@@ -379,17 +380,17 @@ void print_str_changes(char*old,char*new
if(old==NULL){
if(new!=NULL){
- snprintf(oline,part_len,"<NULL>");
- snprintf(nline,part_len,"%s",new);
+ snprintf(oline,long_part_len,"<NULL>");
+ snprintf(nline,long_part_len,"%s",new);
ok = 1;
}
} else if(new==NULL){
- snprintf(oline,part_len,"%s",old);
- snprintf(nline,part_len,"<NULL>");
+ snprintf(oline,long_part_len,"%s",old);
+ snprintf(nline,long_part_len,"<NULL>");
ok = 1;
} else if(strcmp(old,new)!=0){
- snprintf(oline,part_len,"%s",old);
- snprintf(nline,part_len,"%s",new);
+ snprintf(oline,long_part_len,"%s",old);
+ snprintf(nline,long_part_len,"%s",new);
ok = 1;
}
if(ok)