- Timestamp:
- Nov 2, 2023, 8:57:17 AM (13 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r579 r580 12 12 dnl start 13 13 dnl 14 AM_INIT_AUTOMAKE(samhain, 4. 4.10)14 AM_INIT_AUTOMAKE(samhain, 4.5.0) 15 15 AC_DEFINE([SAMHAIN], 1, [Application is samhain]) 16 16 AC_CANONICAL_HOST -
trunk/docs/Changelog
r579 r580 1 4.4.10: 1 4.5.0 (31-10-2023): 2 * fix for reading file attributes on Linux file systems 3 * new option UseAttributesCheck (boolean, default=yes) 4 5 4.4.10 (14-05-2023): 2 6 * fix for (very minor) memleak in sh_unix.c: sh_check_rotated_log() 3 7 * fix for memleak in sh_files.c: sh_files_checkdir(), not all cases for 4 8 scandir() covered (issue reported by T. Greulich) 5 9 6 4.4.9 :10 4.4.9 (10-05-2022): 7 11 * fix for double newline stripping when reading from database 8 12 -
trunk/include/sh_unix.h
r481 r580 217 217 int sh_unix_setcheckacl (const char * c); 218 218 #endif 219 #if defined(__linux__) || defined(HAVE_STAT_FLAGS) 220 int sh_unix_setcheckattributes (const char * c); 221 #endif 219 222 220 223 /* set I/O limit -
trunk/src/sh_hash.c
r570 r580 2257 2257 _("mode_old=\"%s\" mode_new=\"%s\" attr_old=\"%s\" attr_new=\"%s\" imode_old=\"%ld\" imode_new=\"%ld\" iattr_old=\"%ld\" iattr_new=\"%ld\" "), 2258 2258 #else 2259 _("mode_old=<%s>, mode_new=<%s>, attr_old=<%s>, attr_new=<%s>, "),2259 _("mode_old=<%s>, mode_new=<%s>, attr_old=<%s>, attr_new=<%s>, imode_old=<%ld>, imode_new=<%ld>, iattr_old=<%ld>, iattr_new=<%ld>, "), 2260 2260 #endif 2261 2261 p->theFile.c_mode, theFile->c_mode, 2262 p->theFile.c_attributes, theFile->c_attributes 2263 #ifdef SH_USE_XML 2264 ,(long) p->theFile.mode, (long) theFile->mode,2262 p->theFile.c_attributes, theFile->c_attributes, 2263 2264 (long) p->theFile.mode, (long) theFile->mode, 2265 2265 (long) p->theFile.attributes, 2266 2266 (long) theFile->attributes 2267 #endif2268 2267 ); 2269 2268 #else -
trunk/src/sh_readconf.c
r577 r580 1011 1011 { N_("hardlinkoffset"), SH_SECTION_MISC, SH_SECTION_NONE, 1012 1012 sh_files_hle_reg }, 1013 #if defined(__linux__) || defined(HAVE_STAT_FLAGS) 1014 { N_("useattributescheck"), SH_SECTION_MISC, SH_SECTION_NONE, 1015 sh_unix_setcheckattributes }, 1016 #endif 1013 1017 #if defined(USE_XATTR) 1014 1018 { N_("useselinuxcheck"), SH_SECTION_MISC, SH_SECTION_NONE, -
trunk/src/sh_unix.c
r579 r580 3139 3139 **************************************************************/ 3140 3140 3141 #if (defined(__linux__) && (defined(HAVE_LINUX_EXT2_FS_H) || defined(HAVE_EXT2FS_EXT2_FS_H))) || defined(HAVE_STAT_FLAGS)3141 #if defined(__linux__) || defined(HAVE_STAT_FLAGS) 3142 3142 3143 3143 #if defined(__linux__) … … 3148 3148 #if defined(HAVE_EXT2FS_EXT2_FS_H) 3149 3149 #include <ext2fs/ext2_fs.h> 3150 #el se3150 #elif defined(HAVE_LINUX_EXT2_FS_H) 3151 3151 #include <linux/ext2_fs.h> 3152 3152 #endif … … 3245 3245 #ifdef HAVE_EXT2_IOCTLS 3246 3246 int /* fd, */ r, f; 3247 unsigned long keep_flags = 0; 3247 3248 3248 3249 SL_ENTER(_("sh_unix_getinfo_attr")); 3249 3250 3250 3251 *flags = 0; 3252 3251 3253 (void) buf; 3252 3254 … … 3259 3261 3260 3262 3261 r = ioctl (fd, EXT2_IOC_GETFLAGS, &f);3263 r = ioctl (fd, FS_IOC_GETFLAGS, &f); 3262 3264 /* sl_close_fd (FIL__, __LINE__, fd); */ 3263 3265 … … 3270 3272 *flags = f; 3271 3273 3272 /* ! HAVE_ EXT2_IOCTLS */3274 /* ! HAVE_FS_IOCTLS */ 3273 3275 #else 3274 3276 … … 3277 3279 *flags = 0; /* modified by R.Wichmann */ 3278 3280 3279 /* ! HAVE_ EXT2_IOCTLS */3281 /* ! HAVE_FS_IOCTLS */ 3280 3282 #endif 3281 3283 /* … … 3288 3290 goto theend; 3289 3291 3290 #ifdef EXT2_SECRM_FL 3291 if ( (*flags & EXT2_SECRM_FL) != 0 ) c_attr[0] = 's'; 3292 #endif 3293 #ifdef EXT2_UNRM_FL 3294 if ( (*flags & EXT2_UNRM_FL) != 0 ) c_attr[1] = 'u'; 3295 #endif 3296 #ifdef EXT2_SYNC_FL 3297 if ( (*flags & EXT2_SYNC_FL) != 0 ) c_attr[2] = 'S'; 3298 #endif 3299 #ifdef EXT2_IMMUTABLE_FL 3300 if ( (*flags & EXT2_IMMUTABLE_FL) != 0) c_attr[3] = 'i'; 3301 #endif 3302 #ifdef EXT2_APPEND_FL 3303 if ( (*flags & EXT2_APPEND_FL) != 0 ) c_attr[4] = 'a'; 3304 #endif 3305 #ifdef EXT2_NODUMP_FL 3306 if ( (*flags & EXT2_NODUMP_FL) != 0 ) c_attr[5] = 'd'; 3307 #endif 3308 #ifdef EXT2_NOATIME_FL 3309 if ( (*flags & EXT2_NOATIME_FL) != 0) c_attr[6] = 'A'; 3310 #endif 3311 #ifdef EXT2_COMPR_FL 3312 if ( (*flags & EXT2_COMPR_FL) != 0 ) c_attr[7] = 'c'; 3313 #endif 3314 3315 #ifdef EXT2_TOPDIR_FL 3316 if ( (*flags & EXT2_TOPDIR_FL) != 0 ) c_attr[8] = 'T'; 3317 #endif 3318 #ifdef EXT2_DIRSYNC_FL 3319 if ( (*flags & EXT2_DIRSYNC_FL) != 0 ) c_attr[9] = 'D'; 3320 #endif 3321 #ifdef EXT2_NOTAIL_FL 3322 if ( (*flags & EXT2_NOTAIL_FL) != 0 ) c_attr[10] = 't'; 3323 #endif 3324 #ifdef EXT2_JOURNAL_DATA_FL 3325 if ( (*flags & EXT2_JOURNAL_DATA_FL) != 0) c_attr[11] = 'j'; 3326 #endif 3327 3292 #ifdef FS_SECRM_FL 3293 if ( (*flags & FS_SECRM_FL) != 0 ) { c_attr[0] = 's'; keep_flags |= FS_SECRM_FL; } 3294 #endif 3295 #ifdef FS_UNRM_FL 3296 if ( (*flags & FS_UNRM_FL) != 0 ) { c_attr[1] = 'u'; keep_flags |= FS_UNRM_FL; } 3297 #endif 3298 #ifdef FS_SYNC_FL 3299 if ( (*flags & FS_SYNC_FL) != 0 ) { c_attr[2] = 'S'; keep_flags |= FS_SYNC_FL; } 3300 #endif 3301 #ifdef FS_IMMUTABLE_FL 3302 if ( (*flags & FS_IMMUTABLE_FL) != 0) { c_attr[3] = 'i'; keep_flags |= FS_IMMUTABLE_FL; } 3303 #endif 3304 #ifdef FS_APPEND_FL 3305 if ( (*flags & FS_APPEND_FL) != 0 ) { c_attr[4] = 'a'; keep_flags |= FS_APPEND_FL; } 3306 #endif 3307 #ifdef FS_NODUMP_FL 3308 if ( (*flags & FS_NODUMP_FL) != 0 ) { c_attr[5] = 'd'; keep_flags |= FS_NODUMP_FL; } 3309 #endif 3310 #ifdef FS_NOATIME_FL 3311 if ( (*flags & FS_NOATIME_FL) != 0) { c_attr[6] = 'A'; keep_flags |= FS_NOATIME_FL; } 3312 #endif 3313 #ifdef FS_COMPR_FL 3314 if ( (*flags & FS_COMPR_FL) != 0 ) { c_attr[7] = 'c'; keep_flags |= FS_COMPR_FL; } 3315 #endif 3316 3317 #ifdef FS_TOPDIR_FL 3318 if ( (*flags & FS_TOPDIR_FL) != 0 ) { c_attr[8] = 'T'; keep_flags |= FS_TOPDIR_FL; } 3319 #endif 3320 #ifdef FS_DIRSYNC_FL 3321 if ( (*flags & FS_DIRSYNC_FL) != 0 ) { c_attr[9] = 'D'; keep_flags |= FS_DIRSYNC_FL; } 3322 #endif 3323 #ifdef FS_NOTAIL_FL 3324 if ( (*flags & FS_NOTAIL_FL) != 0 ) { c_attr[10] = 't'; keep_flags |= FS_NOTAIL_FL; } 3325 #endif 3326 #ifdef FS_JOURNAL_DATA_FL 3327 if ( (*flags & FS_JOURNAL_DATA_FL) != 0) { c_attr[11] = 'j'; keep_flags |= FS_JOURNAL_DATA_FL; } 3328 #endif 3329 3330 *flags = keep_flags; 3331 3328 3332 theend: 3329 /* ext2*/3330 #endif 3331 3332 c_attr[ 12] = '\0';3333 /* !HAVE_STAT_FLAGS */ 3334 #endif 3335 3336 c_attr[ATTRBUF_USED] = '\0'; 3333 3337 3334 3338 SL_RETURN(0, _("sh_unix_getinfo_attr")); … … 3614 3618 int sh_unix_check_selinux = S_FALSE; 3615 3619 int sh_unix_check_acl = S_FALSE; 3620 int sh_unix_check_attributes = S_TRUE; 3616 3621 3617 3622 #ifdef USE_ACL … … 3774 3779 3775 3780 SL_RETURN((collect),_("sh_unix_getinfo_xattr")); 3781 } 3782 #endif 3783 3784 #if defined(__linux__) || defined(HAVE_STAT_FLAGS) 3785 int sh_unix_setcheckattributes (const char * c) 3786 { 3787 int i; 3788 SL_ENTER(_("sh_unix_setcheckattributes")); 3789 i = sh_util_flagval(c, &(sh_unix_check_attributes)); 3790 3791 SL_RETURN(i, _("sh_unix_setcheckattributes")); 3776 3792 } 3777 3793 #endif … … 4206 4222 theFile->attributes = 0; 4207 4223 4208 #if (defined(__linux__) && (defined(HAVE_LINUX_EXT2_FS_H) || defined(HAVE_EXT2FS_EXT2_FS_H))) || defined(HAVE_STAT_FLAGS)4224 #if defined(__linux__) || defined(HAVE_STAT_FLAGS) 4209 4225 if (theFile->c_mode[0] != 'c' && theFile->c_mode[0] != 'b' && 4210 theFile->c_mode[0] != 'l' ) 4211 sh_unix_getinfo_attr(theFile->fullpath, 4212 &theFile->attributes, theFile->c_attributes, 4213 fd, &buf); 4226 theFile->c_mode[0] != 'l' ) { 4227 if (sh_unix_check_attributes == S_TRUE) 4228 sh_unix_getinfo_attr(theFile->fullpath, 4229 &theFile->attributes, theFile->c_attributes, 4230 fd, &buf); 4231 } 4214 4232 #endif 4215 4233 #endif
Note:
See TracChangeset
for help on using the changeset viewer.