2004-08-23 20:38:10 +00:00
|
|
|
/*
|
2020-01-03 15:44:07 -05:00
|
|
|
* Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
|
2019-01-25 10:15:50 -05:00
|
|
|
* Copyright (C) 2007-2013 Sourcefire, Inc.
|
2009-02-13 10:55:45 +00:00
|
|
|
*
|
|
|
|
* Authors: Tomasz Kojm
|
2004-08-23 20:38:10 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2007-03-31 20:31:04 +00:00
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
2004-08-23 20:38:10 +00:00
|
|
|
*
|
|
|
|
* 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
|
2006-04-09 19:59:28 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
* MA 02110-1301, USA.
|
2004-08-23 20:38:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#if HAVE_CONFIG_H
|
|
|
|
#include "clamav-config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2004-11-28 23:26:29 +00:00
|
|
|
#include <stdlib.h>
|
2018-12-03 12:40:13 -05:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2004-11-28 23:26:29 +00:00
|
|
|
#include <unistd.h>
|
2006-09-27 10:49:26 +00:00
|
|
|
#endif
|
2004-08-23 20:38:10 +00:00
|
|
|
#include <string.h>
|
2004-09-04 15:48:30 +00:00
|
|
|
#include <time.h>
|
2004-11-28 23:26:29 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
2009-09-24 19:23:21 +02:00
|
|
|
#ifndef _WIN32
|
2009-02-17 17:35:31 +00:00
|
|
|
#include <sys/socket.h>
|
2009-09-24 19:23:21 +02:00
|
|
|
#endif
|
2006-06-08 20:00:50 +00:00
|
|
|
#include <dirent.h>
|
2004-11-28 23:26:29 +00:00
|
|
|
#include <fcntl.h>
|
2006-04-10 09:59:51 +00:00
|
|
|
#include <ctype.h>
|
2006-06-08 20:00:50 +00:00
|
|
|
#include <errno.h>
|
2004-08-23 20:38:10 +00:00
|
|
|
|
2009-01-02 21:45:46 +00:00
|
|
|
#include "shared/optparser.h"
|
2006-09-27 10:49:26 +00:00
|
|
|
#include "shared/output.h"
|
2004-09-07 21:19:02 +00:00
|
|
|
|
2006-09-27 10:49:26 +00:00
|
|
|
#include "libclamav/clamav.h"
|
|
|
|
#include "libclamav/cvd.h"
|
2007-03-05 21:05:22 +00:00
|
|
|
#include "libclamav/others.h" /* for cli_rmdirs() */
|
2008-07-18 16:31:02 +00:00
|
|
|
#include "libclamav/regex/regex.h"
|
2008-08-04 10:38:24 +00:00
|
|
|
#include "libclamav/version.h"
|
2007-02-11 00:41:13 +00:00
|
|
|
#include "shared/misc.h"
|
2006-09-27 10:49:26 +00:00
|
|
|
|
2020-07-24 10:47:20 -07:00
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
#ifndef WIN32
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#endif
|
|
|
|
|
2008-08-04 10:38:24 +00:00
|
|
|
#ifndef REPO_VERSION
|
|
|
|
#define REPO_VERSION "exported"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
const char *get_version(void)
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
if (!strncmp("devel-", VERSION, 6) && strcmp("exported", REPO_VERSION)) {
|
|
|
|
return REPO_VERSION "" VERSION_SUFFIX;
|
|
|
|
}
|
|
|
|
/* it is a release, or we have nothing better */
|
|
|
|
return VERSION "" VERSION_SUFFIX;
|
2008-08-04 10:38:24 +00:00
|
|
|
}
|
2011-04-16 17:41:57 +03:00
|
|
|
/* CL_NOLIBCLAMAV means to omit functions that depends on libclamav */
|
|
|
|
#ifndef CL_NOLIBCLAMAV
|
|
|
|
char *freshdbdir(void)
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
struct cl_cvd *d1, *d2;
|
|
|
|
struct optstruct *opts;
|
|
|
|
const struct optstruct *opt;
|
|
|
|
const char *dbdir;
|
|
|
|
char *retdir;
|
2011-04-16 17:41:57 +03:00
|
|
|
|
|
|
|
/* try to find the most up-to-date db directory */
|
|
|
|
dbdir = cl_retdbdir();
|
2018-12-03 12:40:13 -05:00
|
|
|
if ((opts = optparse(CONFDIR_FRESHCLAM, 0, NULL, 0, OPT_FRESHCLAM, 0, NULL))) {
|
|
|
|
if ((opt = optget(opts, "DatabaseDirectory"))->enabled) {
|
|
|
|
if (strcmp(dbdir, opt->strarg)) {
|
|
|
|
char *daily = (char *)malloc(strlen(opt->strarg) + strlen(dbdir) + 30);
|
|
|
|
if (daily == NULL) {
|
|
|
|
fprintf(stderr, "Unable to allocate memory for db directory...\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
sprintf(daily, "%s" PATHSEP "daily.cvd", opt->strarg);
|
|
|
|
if (access(daily, R_OK))
|
|
|
|
sprintf(daily, "%s" PATHSEP "daily.cld", opt->strarg);
|
|
|
|
|
|
|
|
if (!access(daily, R_OK) && (d1 = cl_cvdhead(daily))) {
|
|
|
|
sprintf(daily, "%s" PATHSEP "daily.cvd", dbdir);
|
|
|
|
if (access(daily, R_OK))
|
|
|
|
sprintf(daily, "%s" PATHSEP "daily.cld", dbdir);
|
|
|
|
|
|
|
|
if (!access(daily, R_OK) && (d2 = cl_cvdhead(daily))) {
|
|
|
|
free(daily);
|
|
|
|
if (d1->version > d2->version)
|
|
|
|
dbdir = opt->strarg;
|
|
|
|
cl_cvdfree(d2);
|
|
|
|
} else {
|
|
|
|
free(daily);
|
|
|
|
dbdir = opt->strarg;
|
|
|
|
}
|
|
|
|
cl_cvdfree(d1);
|
|
|
|
} else {
|
|
|
|
free(daily);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-04-16 17:41:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
retdir = strdup(dbdir);
|
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
if (opts)
|
|
|
|
optfree(opts);
|
2011-04-16 17:41:57 +03:00
|
|
|
|
|
|
|
return retdir;
|
|
|
|
}
|
|
|
|
|
|
|
|
void print_version(const char *dbdir)
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
char *fdbdir = NULL, *path;
|
|
|
|
const char *pt;
|
|
|
|
struct cl_cvd *daily;
|
|
|
|
time_t db_time;
|
|
|
|
unsigned int db_version = 0;
|
|
|
|
|
|
|
|
if (dbdir)
|
|
|
|
pt = dbdir;
|
2011-04-16 17:41:57 +03:00
|
|
|
else
|
2018-12-03 12:40:13 -05:00
|
|
|
pt = fdbdir = freshdbdir();
|
2011-04-16 17:41:57 +03:00
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
if (!pt) {
|
|
|
|
printf("ClamAV %s\n", get_version());
|
|
|
|
return;
|
2011-04-16 17:41:57 +03:00
|
|
|
}
|
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
if (!(path = malloc(strlen(pt) + 11))) {
|
|
|
|
if (!dbdir)
|
|
|
|
free(fdbdir);
|
|
|
|
return;
|
2011-04-16 17:41:57 +03:00
|
|
|
}
|
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
sprintf(path, "%s" PATHSEP "daily.cvd", pt);
|
|
|
|
if (!access(path, R_OK)) {
|
|
|
|
daily = cl_cvdhead(path);
|
|
|
|
if (daily) {
|
|
|
|
db_version = daily->version;
|
|
|
|
db_time = daily->stime;
|
|
|
|
cl_cvdfree(daily);
|
|
|
|
}
|
2011-04-16 17:41:57 +03:00
|
|
|
}
|
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
sprintf(path, "%s" PATHSEP "daily.cld", pt);
|
|
|
|
if (!access(path, R_OK)) {
|
|
|
|
daily = cl_cvdhead(path);
|
|
|
|
if (daily) {
|
|
|
|
if (daily->version > db_version) {
|
|
|
|
db_version = daily->version;
|
|
|
|
db_time = daily->stime;
|
|
|
|
}
|
|
|
|
cl_cvdfree(daily);
|
|
|
|
}
|
2011-04-16 17:41:57 +03:00
|
|
|
}
|
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
if (!dbdir)
|
|
|
|
free(fdbdir);
|
2011-04-16 17:41:57 +03:00
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
if (db_version) {
|
|
|
|
printf("ClamAV %s/%u/%s", get_version(), db_version, ctime(&db_time));
|
2011-04-16 17:41:57 +03:00
|
|
|
} else {
|
2018-12-03 12:40:13 -05:00
|
|
|
printf("ClamAV %s\n", get_version());
|
2011-04-16 17:41:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
free(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
int check_flevel(void)
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
if (cl_retflevel() < CL_FLEVEL) {
|
|
|
|
fprintf(stderr, "ERROR: This tool requires libclamav with functionality level %u or higher (current f-level: %u)\n", CL_FLEVEL, cl_retflevel());
|
|
|
|
return 1;
|
2011-04-16 17:41:57 +03:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-05-21 13:43:05 +00:00
|
|
|
const char *filelist(const struct optstruct *opts, int *err)
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
static char buff[1025];
|
|
|
|
static unsigned int cnt = 0;
|
|
|
|
const struct optstruct *opt;
|
|
|
|
static FILE *fs = NULL;
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
if (!cnt && (opt = optget(opts, "file-list"))->enabled) {
|
|
|
|
if (!fs) {
|
|
|
|
fs = fopen(opt->strarg, "r");
|
|
|
|
if (!fs) {
|
|
|
|
fprintf(stderr, "ERROR: --file-list: Can't open file %s\n", opt->strarg);
|
|
|
|
if (err)
|
|
|
|
*err = 54;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fgets(buff, 1024, fs)) {
|
|
|
|
buff[1024] = 0;
|
|
|
|
len = strlen(buff);
|
|
|
|
if (!len) {
|
|
|
|
fclose(fs);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
len--;
|
|
|
|
while (len && ((buff[len] == '\n') || (buff[len] == '\r')))
|
|
|
|
buff[len--] = '\0';
|
|
|
|
return buff;
|
|
|
|
} else {
|
|
|
|
fclose(fs);
|
|
|
|
return NULL;
|
|
|
|
}
|
2009-05-21 13:43:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return opts->filename ? opts->filename[cnt++] : NULL;
|
|
|
|
}
|
|
|
|
|
2004-11-28 23:26:29 +00:00
|
|
|
int filecopy(const char *src, const char *dest)
|
|
|
|
{
|
2009-09-24 16:21:51 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
return (!CopyFileA(src, dest, 0));
|
|
|
|
#elif defined(C_DARWIN)
|
2018-12-03 12:40:13 -05:00
|
|
|
pid_t pid;
|
2004-11-28 23:26:29 +00:00
|
|
|
|
2005-04-28 22:58:31 +00:00
|
|
|
/* On Mac OS X use ditto and copy resource fork, too. */
|
2018-12-03 12:40:13 -05:00
|
|
|
switch (pid = fork()) {
|
|
|
|
case -1:
|
|
|
|
return -1;
|
|
|
|
case 0:
|
|
|
|
execl("/usr/bin/ditto", "ditto", src, dest, NULL);
|
|
|
|
perror("execl(ditto)");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
wait(NULL);
|
|
|
|
return 0;
|
2004-11-28 23:26:29 +00:00
|
|
|
}
|
|
|
|
|
2005-04-28 22:58:31 +00:00
|
|
|
return -1;
|
2004-11-28 23:26:29 +00:00
|
|
|
|
2009-02-03 18:47:18 +00:00
|
|
|
#else /* C_DARWIN */
|
|
|
|
return cli_filecopy(src, dest);
|
2004-11-28 23:26:29 +00:00
|
|
|
#endif
|
|
|
|
}
|
2005-04-29 01:21:12 +00:00
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
#ifndef _WIN32
|
|
|
|
int close_std_descriptors()
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
int fds[3], i;
|
2006-08-30 22:41:21 +00:00
|
|
|
|
2008-01-22 17:47:15 +00:00
|
|
|
fds[0] = open("/dev/null", O_RDONLY);
|
|
|
|
fds[1] = open("/dev/null", O_WRONLY);
|
|
|
|
fds[2] = open("/dev/null", O_WRONLY);
|
2018-12-03 12:40:13 -05:00
|
|
|
if (fds[0] == -1 || fds[1] == -1 || fds[2] == -1) {
|
|
|
|
fputs("Can't open /dev/null\n", stderr);
|
|
|
|
for (i = 0; i <= 2; i++)
|
|
|
|
if (fds[i] != -1)
|
|
|
|
close(fds[i]);
|
|
|
|
return -1;
|
2008-01-22 17:47:15 +00:00
|
|
|
}
|
2006-08-30 22:41:21 +00:00
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
for (i = 0; i <= 2; i++) {
|
|
|
|
if (dup2(fds[i], i) == -1) {
|
|
|
|
fprintf(stderr, "dup2(%d, %d) failed\n", fds[i], i); /* may not be printed */
|
|
|
|
for (i = 0; i <= 2; i++)
|
|
|
|
if (fds[i] != -1)
|
|
|
|
close(fds[i]);
|
|
|
|
return -1;
|
|
|
|
}
|
2006-08-30 22:41:21 +00:00
|
|
|
}
|
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
for (i = 0; i <= 2; i++)
|
|
|
|
if (fds[i] > 2)
|
|
|
|
close(fds[i]);
|
2008-01-22 17:47:15 +00:00
|
|
|
|
2020-07-24 10:47:20 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
int daemonize_all_return(void)
|
|
|
|
{
|
2020-07-24 10:47:20 -07:00
|
|
|
pid_t pid;
|
|
|
|
|
2008-01-22 17:47:15 +00:00
|
|
|
pid = fork();
|
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
if (0 == pid) {
|
2020-07-24 10:47:20 -07:00
|
|
|
setsid();
|
|
|
|
}
|
|
|
|
return pid;
|
|
|
|
}
|
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
int daemonize(void)
|
|
|
|
{
|
2020-07-24 10:47:20 -07:00
|
|
|
int ret = 0;
|
2008-01-22 17:47:15 +00:00
|
|
|
|
2020-07-24 10:47:20 -07:00
|
|
|
ret = close_std_descriptors();
|
2020-08-05 22:33:44 -07:00
|
|
|
if (ret) {
|
2020-07-24 10:47:20 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
ret = daemonize_all_return();
|
|
|
|
pid_t pid = (pid_t)ret;
|
2020-07-24 10:47:20 -07:00
|
|
|
/*parent process.*/
|
2020-08-05 22:33:44 -07:00
|
|
|
if (pid > 0) {
|
2018-12-03 12:40:13 -05:00
|
|
|
exit(0);
|
2020-07-24 10:47:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return pid;
|
|
|
|
}
|
2006-08-30 22:41:21 +00:00
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
static void daemonize_child_initialized_handler(int sig)
|
|
|
|
{
|
2020-07-24 10:47:20 -07:00
|
|
|
(void)(sig);
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
int daemonize_parent_wait()
|
|
|
|
{
|
2020-07-24 10:47:20 -07:00
|
|
|
int daemonizePid = daemonize_all_return();
|
|
|
|
if (daemonizePid == -1) {
|
|
|
|
return -1;
|
2020-08-05 22:33:44 -07:00
|
|
|
} else if (daemonizePid) { //parent
|
2020-07-24 10:47:20 -07:00
|
|
|
/* The parent will wait until either the child process
|
|
|
|
* exits, or signals the parent that it's initialization is
|
|
|
|
* complete. If it exits, it is due to an error condition,
|
|
|
|
* so the parent should exit with the same error code as the child.
|
|
|
|
* If the child signals the parent that initialization is complete, it
|
|
|
|
* the parent will exit from the signal handler (initDoneSignalHandler)
|
|
|
|
* with exit code 0.
|
|
|
|
*/
|
|
|
|
struct sigaction sig;
|
|
|
|
memset(&sig, 0, sizeof(sig));
|
|
|
|
sigemptyset(&(sig.sa_mask));
|
|
|
|
sig.sa_handler = daemonize_child_initialized_handler;
|
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
if (0 != sigaction(SIGINT, &sig, NULL)) {
|
2020-07-24 10:47:20 -07:00
|
|
|
perror("sigaction");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int exitStatus;
|
|
|
|
wait(&exitStatus);
|
2020-08-05 22:33:44 -07:00
|
|
|
if (WIFEXITED(exitStatus)) { //error
|
2020-07-24 10:47:20 -07:00
|
|
|
exitStatus = WEXITSTATUS(exitStatus);
|
|
|
|
exit(exitStatus);
|
|
|
|
}
|
|
|
|
}
|
2008-01-22 17:47:15 +00:00
|
|
|
return 0;
|
2006-08-30 22:41:21 +00:00
|
|
|
}
|
2008-07-18 16:31:02 +00:00
|
|
|
|
2020-08-05 22:33:44 -07:00
|
|
|
void daemonize_signal_parent(pid_t parentPid)
|
|
|
|
{
|
2020-07-24 10:47:20 -07:00
|
|
|
close_std_descriptors();
|
2020-08-05 22:33:44 -07:00
|
|
|
kill(parentPid, SIGINT);
|
2020-07-24 10:47:20 -07:00
|
|
|
}
|
2020-08-05 22:33:44 -07:00
|
|
|
#endif
|
2020-07-24 10:47:20 -07:00
|
|
|
|
2008-07-18 16:31:02 +00:00
|
|
|
int match_regex(const char *filename, const char *pattern)
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
regex_t reg;
|
|
|
|
int match, flags = REG_EXTENDED | REG_NOSUB;
|
|
|
|
char fname[513];
|
2009-09-24 19:10:27 +02:00
|
|
|
#ifdef _WIN32
|
2018-12-03 12:40:13 -05:00
|
|
|
flags |= REG_ICASE; /* case insensitive on Windows */
|
2008-07-18 16:31:02 +00:00
|
|
|
#endif
|
2018-12-03 12:40:13 -05:00
|
|
|
if (cli_regcomp(®, pattern, flags) != 0)
|
|
|
|
return 2;
|
|
|
|
|
|
|
|
if (pattern[strlen(pattern) - 1] == *PATHSEP) {
|
|
|
|
snprintf(fname, 511, "%s" PATHSEP, filename);
|
|
|
|
fname[512] = 0;
|
|
|
|
} else {
|
|
|
|
strncpy(fname, filename, 513);
|
|
|
|
fname[512] = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
match = (cli_regexec(®, fname, 0, NULL, 0) == REG_NOMATCH) ? 0 : 1;
|
|
|
|
cli_regfree(®);
|
|
|
|
return match;
|
2008-07-18 16:31:02 +00:00
|
|
|
}
|
2009-02-12 21:14:51 +00:00
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
int cli_is_abspath(const char *path)
|
|
|
|
{
|
2009-09-25 00:09:13 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
int len = strlen(path);
|
2009-10-21 04:31:11 +02:00
|
|
|
return (len > 2 && path[0] == '\\' && path[1] == '\\') || (len >= 2 && ((*path >= 'a' && *path <= 'z') || (*path >= 'A' && *path <= 'Z')) && path[1] == ':');
|
2009-09-25 00:09:13 +02:00
|
|
|
#else
|
|
|
|
return *path == '/';
|
|
|
|
#endif
|
|
|
|
}
|
2010-09-16 14:37:43 +02:00
|
|
|
|
|
|
|
unsigned int countlines(const char *filename)
|
|
|
|
{
|
2018-12-03 12:40:13 -05:00
|
|
|
FILE *fh;
|
|
|
|
char buff[1024];
|
|
|
|
unsigned int lines = 0;
|
2010-09-16 14:37:43 +02:00
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
if ((fh = fopen(filename, "r")) == NULL)
|
|
|
|
return 0;
|
2010-09-16 14:37:43 +02:00
|
|
|
|
2018-12-03 12:40:13 -05:00
|
|
|
while (fgets(buff, sizeof(buff), fh)) {
|
|
|
|
if (buff[0] == '#') continue;
|
|
|
|
lines++;
|
2010-09-16 14:37:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fclose(fh);
|
|
|
|
return lines;
|
|
|
|
}
|