diff options
Diffstat (limited to 'src/sh_suidchk.c')
-rw-r--r-- | src/sh_suidchk.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/sh_suidchk.c b/src/sh_suidchk.c index d9cc1f9..30c397c 100644 --- a/src/sh_suidchk.c +++ b/src/sh_suidchk.c @@ -996,8 +996,8 @@ static void report_file (const char * tmpcat, file_type * theFile, * putting it into a register, and avoids the 'clobbered * by longjmp' warning. And no, 'volatile' proved insufficient. */ -static void * sh_dummy_dirlist = NULL; -static void * sh_dummy_itmp = NULL; +void * sh_dummy_idirlist = NULL; +void * sh_dummy_itmp = NULL; static @@ -1027,8 +1027,8 @@ int sh_suidchk_check_internal (char * iname) /* Take the address to keep gcc from putting it into a register. * Avoids the 'clobbered by longjmp' warning. */ - sh_dummy_dirlist = (void*) &dirlist; - sh_dummy_itmp = (void*) &tmp; + sh_dummy_idirlist = (void*) &dirlist; + sh_dummy_itmp = (void*) &tmp; if (iname == NULL) { @@ -1145,7 +1145,7 @@ int sh_suidchk_check_internal (char * iname) (void) retry_msleep((int)((FileLimTotal/(FileLimNow-FileLimStart))/ ShSuidchkFps) , 0); } - + status = (int) retry_lstat(FIL__, __LINE__, tmpcat, &buf); if (status != 0) @@ -1185,6 +1185,7 @@ int sh_suidchk_check_internal (char * iname) /* fs is a STATIC string or NULL */ fs = filesystem_type (tmpcat, tmpcat, &buf); + if (fs != NULL #ifndef SH_SUIDTESTDIR && @@ -1301,6 +1302,7 @@ int sh_suidchk_check_internal (char * iname) { /* Running init. Report on files detected. */ + sh_dbIO_rootfs_strip(theFile->fullpath); sh_dbIO_data_write (theFile, fileHash); /* no call to sh_error_handle */ SH_MUTEX_LOCK(mutex_thread_nolog); sh_error_handle ((-1), FIL__, __LINE__, @@ -2210,6 +2212,7 @@ filesystem_type (char * path, char * relpath, struct stat * statp) } current_dev = statp->st_dev; current_fstype = filesystem_type_uncached (path, relpath, statp); + return current_fstype; } @@ -2231,7 +2234,7 @@ filesystem_type_uncached (path, relpath, statp) static char my_tmp_type[64]; #endif -#ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ +#ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix,Linux */ char *table = MOUNTED; FILE *mfp; struct mntent *mnt; @@ -2293,12 +2296,14 @@ filesystem_type_uncached (path, relpath, statp) char errmsg[256]; volatile int elevel = SH_ERR_ERR; size_t tlen = strlen(mnt->mnt_dir); - + if (tlen >= 6 && 0 == strcmp(&((mnt->mnt_dir)[tlen-6]), _("/.gvfs"))) elevel = SH_ERR_NOTICE; else if (tlen >= 5 && 0 == strcmp(&((mnt->mnt_dir)[tlen-5]), _("/gvfs"))) elevel = SH_ERR_NOTICE; - + else if (0 == strcmp (mnt->mnt_type, _("tracefs"))) + elevel = SH_ERR_NOTICE; + sl_snprintf(errmsg, sizeof(errmsg), _("stat(%s) failed"), mnt->mnt_dir); SH_MUTEX_LOCK(mutex_thread_nolog); @@ -2306,7 +2311,7 @@ filesystem_type_uncached (path, relpath, statp) errmsg, _("filesystem_type_uncached") ); SH_MUTEX_UNLOCK(mutex_thread_nolog); - return NULL; + continue; } dev = disk_stats.st_dev; } |