Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 103164 | Differences between
and this patch

Collapse All | Expand All

(-)samba-vscan-0.3.6/global/vscan-fileaccesslog.c (-12 / +12 lines)
Lines 1-4 Link Here
1
/* $Id: vscan-fileaccesslog.c,v 1.8.2.3 2004/09/24 21:42:20 reniar Exp $
1
/* $Id: vscan-fileaccesslog.c,v 1.8.2.4 2005/07/13 14:58:43 reniar Exp $
2
 * 
2
 * 
3
 * File Access Log - stores information about LRU files
3
 * File Access Log - stores information about LRU files
4
 *
4
 *
Lines 128-134 Link Here
128
 *
128
 *
129
*/
129
*/
130
struct lrufiles_struct *lrufiles_add(pstring fname, time_t mtime, BOOL infected) {
130
struct lrufiles_struct *lrufiles_add(pstring fname, time_t mtime, BOOL infected) {
131
	struct lrufiles_struct *new, *tmp, *found = NULL;
131
	struct lrufiles_struct *new_entry, *tmp, *found = NULL;
132
132
133
	/* check if lru file access was disabled by setting the corresponding
133
	/* check if lru file access was disabled by setting the corresponding
134
	   value in the configuration file to zero (or below zero) */
134
	   value in the configuration file to zero (or below zero) */
Lines 150-164 Link Here
150
		return found;
150
		return found;
151
	} else {
151
	} else {
152
		DEBUG(10, ("alloc space for file entry '%s'\n", fname));
152
		DEBUG(10, ("alloc space for file entry '%s'\n", fname));
153
		new = (struct lrufiles_struct *)malloc(sizeof(*new));
153
		new_entry = (struct lrufiles_struct *)malloc(sizeof(*new_entry));
154
		if (!new) return NULL;
154
		if (!new_entry) return NULL;
155
155
156
		ZERO_STRUCTP(new);
156
		ZERO_STRUCTP(new_entry);
157
157
158
		pstrcpy(new->fname, fname);
158
		pstrcpy(new_entry->fname, fname);
159
		new->mtime = mtime;
159
		new_entry->mtime = mtime;
160
		new->infected = infected;
160
		new_entry->infected = infected;
161
		new->time_added = time(NULL);
161
		new_entry->time_added = time(NULL);
162
162
163
		/* reached maximum? */
163
		/* reached maximum? */
164
		if ( lrufiles_count == lrufiles_max_entries ) {
164
		if ( lrufiles_count == lrufiles_max_entries ) {
Lines 170-181 Link Here
170
		}
170
		}
171
		
171
		
172
		DEBUG(10, ("adding new entry to list...\n"));
172
		DEBUG(10, ("adding new entry to list...\n"));
173
		DLIST_ADD_END(Lrufiles, new, tmp);
173
		DLIST_ADD_END(Lrufiles, new_entry, tmp);
174
		LrufilesEnd = new;
174
		LrufilesEnd = new_entry;
175
		lrufiles_count++;
175
		lrufiles_count++;
176
		DEBUG(10, ("entry '%s' added, count '%d'\n", fname, lrufiles_count));
176
		DEBUG(10, ("entry '%s' added, count '%d'\n", fname, lrufiles_count));
177
177
178
		return new;
178
		return new_entry;
179
	}
179
	}
180
}
180
}
181
181

Return to bug 103164