git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1031 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/10/21 06:54:08... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Wed Oct 20 23:51:46 CEST 2004 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * clamd, clamscan: do not initialise procdev when /proc is not mounted |
|
4 |
+ (thanks to Andrey J. Melnikoff (TEMHOTA) <temnota*kmv.ru>) |
|
5 |
+ |
|
1 | 6 |
Wed Oct 20 22:37:24 CEST 2004 (tk) |
2 | 7 |
---------------------------------- |
3 | 8 |
* shared/misc.c: print version information to stdin instead of stderr |
... | ... |
@@ -176,9 +176,8 @@ void clamd(struct optstruct *opt) |
176 | 176 |
logg("*Verbose logging activated.\n"); |
177 | 177 |
|
178 | 178 |
#ifdef C_LINUX |
179 |
- if(stat("/proc", &sb) == -1) |
|
180 |
- procdev = 0; |
|
181 |
- else |
|
179 |
+ procdev = 0; |
|
180 |
+ if(stat("/proc", &sb) != -1 && !sb.st_size) |
|
182 | 181 |
procdev = sb.st_dev; |
183 | 182 |
#endif |
184 | 183 |
|
... | ... |
@@ -81,7 +81,7 @@ int dirscan(const char *dirname, const char **virname, unsigned long int *scanne |
81 | 81 |
struct dirent *dent; |
82 | 82 |
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) |
83 | 83 |
#ifdef C_SOLARIS |
84 |
- char result[sizeof(struct dirent) + MAX_PATH + 1]; |
|
84 |
+ char result[sizeof(struct dirent) + PATH_MAX + 1]; |
|
85 | 85 |
#else |
86 | 86 |
struct dirent result; |
87 | 87 |
#endif |
... | ... |
@@ -381,7 +381,7 @@ int cli_rmdirs(const char *dirname) |
381 | 381 |
struct dirent *dent; |
382 | 382 |
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) |
383 | 383 |
#ifdef C_SOLARIS |
384 |
- char result[sizeof(struct dirent) + MAX_PATH + 1]; |
|
384 |
+ char result[sizeof(struct dirent) + PATH_MAX + 1]; |
|
385 | 385 |
#else |
386 | 386 |
struct dirent result; |
387 | 387 |
#endif |
... | ... |
@@ -737,7 +737,7 @@ int cl_loaddbdir(const char *dirname, struct cl_node **root, unsigned int *signo |
737 | 737 |
struct dirent *dent; |
738 | 738 |
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) |
739 | 739 |
#ifdef C_SOLARIS |
740 |
- char result[sizeof(struct dirent) + MAX_PATH + 1]; |
|
740 |
+ char result[sizeof(struct dirent) + PATH_MAX + 1]; |
|
741 | 741 |
#else |
742 | 742 |
struct dirent result; |
743 | 743 |
#endif |
... | ... |
@@ -806,7 +806,7 @@ int cl_statinidir(const char *dirname, struct cl_stat *dbstat) |
806 | 806 |
const struct dirent *dent; |
807 | 807 |
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) |
808 | 808 |
#ifdef C_SOLARIS |
809 |
- char result[sizeof(struct dirent) + MAX_PATH + 1]; |
|
809 |
+ char result[sizeof(struct dirent) + PATH_MAX + 1]; |
|
810 | 810 |
#else |
811 | 811 |
struct dirent result; |
812 | 812 |
#endif |
... | ... |
@@ -869,7 +869,7 @@ int cl_statchkdir(const struct cl_stat *dbstat) |
869 | 869 |
struct dirent *dent; |
870 | 870 |
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) |
871 | 871 |
#ifdef C_SOLARIS |
872 |
- char result[sizeof(struct dirent) + MAX_PATH + 1]; |
|
872 |
+ char result[sizeof(struct dirent) + PATH_MAX + 1]; |
|
873 | 873 |
#else |
874 | 874 |
struct dirent result; |
875 | 875 |
#endif |
... | ... |
@@ -760,7 +760,7 @@ static int cli_scandir(const char *dirname, const char **virname, long int *scan |
760 | 760 |
struct dirent *dent; |
761 | 761 |
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) |
762 | 762 |
#ifdef C_SOLARIS |
763 |
- char result[sizeof(struct dirent) + MAX_PATH + 1]; |
|
763 |
+ char result[sizeof(struct dirent) + PATH_MAX + 1]; |
|
764 | 764 |
#else |
765 | 765 |
struct dirent result; |
766 | 766 |
#endif |
... | ... |
@@ -824,7 +824,7 @@ static int cli_vba_scandir(const char *dirname, const char **virname, long int * |
824 | 824 |
struct dirent *dent; |
825 | 825 |
#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) |
826 | 826 |
#ifdef C_SOLARIS |
827 |
- char result[sizeof(struct dirent) + MAX_PATH + 1]; |
|
827 |
+ char result[sizeof(struct dirent) + PATH_MAX + 1]; |
|
828 | 828 |
#else |
829 | 829 |
struct dirent result; |
830 | 830 |
#endif |