Merge branch 'master' of ssh://git.clam.sourcefire.com/var/lib/git/clamav-devel

0.96
Tomasz Kojm 15 years ago
commit 5e61351408
  1. 3
      libclamav/pdf.c
  2. 6
      win32/clamav-for-windows/clamav-for-windows/main.c
  3. 85
      win32/clamav-for-windows/freshclamwrap/flog.c
  4. 1
      win32/clamav-for-windows/sigui/SigUI/GUIFrame.cpp
  5. 5
      win32/clamav-for-windows/sigui/SigUI/SigUIMain.cpp
  6. 2
      win32/clamav-for-windows/sigui/SigUI/WxWizFrame.fbp
  7. 2
      win32/clamav-for-windows/sigui/SigUI/doc/overview.tex
  8. 2
      win32/clamav-for-windows/sigui/SigUI/doc/scenarios.tex
  9. BIN
      win32/clamav-for-windows/sigui/SigUI/doc/sigui-manual.pdf
  10. 17
      win32/clamav-for-windows/sigui/SigUI/doc/ui.tex

@ -1145,7 +1145,8 @@ int cli_pdf(const char *dir, cli_ctx *ctx, off_t offset)
}
cli_dbgmsg("cli_pdf: returning %d\n", rc);
free(pdf.objs);
return rc;
/* PDF hooks may abort, don't return CL_BREAK to caller! */
return rc == CL_BREAK ? CL_CLEAN : rc;
}
#else

@ -62,9 +62,13 @@ BOOL init() {
logg_time = 1;
logg_size = -1;
logg_file = strdup(whereami);
logg_noflush = 1;/* only flush on errors and warnings */
if(!logg_file)
return FALSE;
strncpy(slash, "clamav.old.log", sizeof(whereami) - (slash - whereami));
whereami[sizeof(whereami)-1] = '\0';
if(!MoveFileEx(logg_file, whereami, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH))
DeleteFile(logg_file);
logg_noflush = 1;/* only flush on errors and warnings */
if(logg("ClamAV core initialized\n"))
return FALSE;

@ -17,36 +17,55 @@
* USA
*/
#include <windows.h>
#include <stdio.h>
#include "flog.h"
static HANDLE logh;
void flog_open(const char *path) {
logh = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
SetFilePointer(logh, 0, NULL, FILE_END);
flog("Log file initialized");
}
void flog(const char *fmt, ...) {
char buf[4096];
SYSTEMTIME t;
DWORD x;
va_list ap;
GetLocalTime(&t);
_snprintf(buf, sizeof(buf), "%04u-%02u-%02u %02u:%02u:%02u - ", t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond);
WriteFile(logh, buf, strlen(buf), &x, NULL);
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
WriteFile(logh, buf, strlen(buf), &x, NULL);
WriteFile(logh, "\r\n", 2, &x, NULL);
}
void flog_close(void) {
flog("Log file closed");
CloseHandle(logh);
}
#include <windows.h>
#include <stdio.h>
#include "flog.h"
static HANDLE logh = INVALID_HANDLE_VALUE;
void flog_open(const char *path) {
DWORD sz;
logh = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if(logh == INVALID_HANDLE_VALUE)
return;
sz = GetFileSize(logh, NULL);
if(sz >= 10*1024*1024)
SetEndOfFile(logh);
else
SetFilePointer(logh, 0, NULL, FILE_END);
flog("Log file initialized");
}
void flog(const char *fmt, ...) {
char buf[4096];
SYSTEMTIME t;
DWORD x;
va_list ap;
int len;
if(logh == INVALID_HANDLE_VALUE)
return;
GetLocalTime(&t);
_snprintf(buf, sizeof(buf), "%04u-%02u-%02u %02u:%02u:%02u - ", t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond);
buf[sizeof(buf)-1] = '\0';
len = strlen(buf);
va_start(ap, fmt);
vsnprintf(buf + len, sizeof(buf) - len, fmt, ap);
va_end(ap);
buf[sizeof(buf)-1] = '\0';
len = strlen(buf);
len = len < sizeof(buf) - 2 ? len : sizeof(buf) - 2;
memcpy(buf + len, "\r\n", 2);
len += 2;
WriteFile(logh, buf, len, &x, NULL);
}
void flog_close(void) {
if(logh == INVALID_HANDLE_VALUE)
return;
flog("Log file closed");
CloseHandle(logh);
}

@ -264,6 +264,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
bSizer7->Add( sbSizer4, 1, wxALL|wxEXPAND, 5 );
m_install = new wxButton( m_panel_sigman, wxID_ANY, _("Verify and &Install signatures"), wxDefaultPosition, wxDefaultSize, 0 );
m_install->Enable( false );
m_install->SetToolTip( _("Check that the signature files are well formed and install them in ClamAV's database directory") );
bSizer7->Add( m_install, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );

@ -754,6 +754,7 @@ void SigUIFrame::m_local_addOnButtonClick( wxCommandEvent& WXUNUSED(event) )
m_sig_candidates->Append(path);
}
m_local_remove->Enable(!m_sig_candidates->IsEmpty());
m_install->Enable(!m_sig_candidates->IsEmpty());
}
}
@ -766,6 +767,7 @@ void SigUIFrame::m_local_removeOnButtonClick( wxCommandEvent& WXUNUSED(event) )
m_sig_candidates->Delete(selections[--n]);
}
m_local_remove->Enable(!m_sig_candidates->IsEmpty());
m_install->Enable(!m_sig_candidates->IsEmpty());
}
void SigUIFrame::OnTerminateInstall(wxProcessEvent &event)
@ -868,7 +870,8 @@ void SigUIFrame::m_deleteOnButtonClick( wxCommandEvent& WXUNUSED(event) )
wxFileName filepath(GetExecPath(), file);
if (!wxRemoveFile(filepath.GetFullPath())) {
wxLogError(_("Can't remove file %s"), filepath.GetFullPath());
}
} else
reload();
}
wxWakeUpIdle();

@ -1834,7 +1834,7 @@
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="enabled">0</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>

@ -43,4 +43,4 @@ settings are syntactically correct, and saves them in \gls{freshclam.conf}.
When installing custom signatures, \verb+SigUI+ verifies that \ClamAV can successfully load the databases, and install only those that are successfully loaded.
Any changes you make will not take effect immediately, but only the next time the databases are reloaded. This usually happens each hour. You can reload the databases immediately by opening the \CW user interface \footnote{from the tray, or the desktop}, and clicking on \textbf{Update Now}.
Once the databases are successfully installed, a reload is queued. ClamAV for Windows will reload the databases the next time the system is idle. SigUI will show a notification when the reload happens.

@ -52,7 +52,7 @@ To deploy them you have these choices:
\item Write and deploy a script that copies the signatures to a local drive, and runs SigUI in command-line mode. See \prettyref{sec:customautomatedcopy}
\end{itemize}
The signatures are not loaded in the running ClamAV immediately. See \prettyref{sec:updatenow}.
A reload of the signatures is queued once the signatures are installed. See \prettyref{sec:updatenow}.
\subsection{Deploying your own signatures from a webserver}
\label{sec:customweb}

@ -113,9 +113,16 @@ See \prettyref{sec:runfreshclam}
Note that the downloaded signature files will all be placed in the same directory. Hence you must make sure you don't have two URLs that, when downloaded, have the same filename.
The UI will warn you if you try to do that. \footnote{the two URLs with same filenames will just keep overwriting the same file}.
\section{Update now}
\section{Reloading the databases}
\label{sec:updatenow}
Any changes you make to \gls{freshclam.conf} and the databases won't take effect immediately.
They will take effect the next time the signatures are updated (usually once an hour).
To reload the signatures immediately open the \CW user interface from the tray (or desktop icon), and click on \emph{Update Now}.
Once the database is updated, it will be reloaded as soon as the system is idle.
A database reload is automatically queued in the following situations:
\begin{itemize}
\item You click \emph{Run freshclam to test configuration}, after freshclam
finishes and you close the window
\item You install new databases by clicking on \emph{Verify and Install
signatures}
\item You remove a database by using the \emph{Delete} button
\end{itemize}
The reload will happen the next time the system is idle (or immediately if
already idle).

Loading…
Cancel
Save