Update of /cvsroot/openantivirus/samba3-vscan/global
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8372/global
Modified Files:
.cvsignore vscan-fileaccesslog.c vscan-fileregexp.c
vscan-filetype.c vscan-functions.c vscan-message.c
vscan-parameter.c vscan-quarantine.c
Log Message:
remove Samba 2.2 support, Samba3 is from now on supported only
Index: vscan-message.c
===================================================================
RCS file: /cvsroot/openantivirus/samba3-vscan/global/vscan-message.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- vscan-message.c 23 Jul 2005 14:33:55 -0000 1.1.1.1
+++ vscan-message.c 23 Jul 2005 14:47:46 -0000 1.2
@@ -18,13 +18,8 @@
static pstring username;
static struct cli_state *cli;
static int name_type = 0x03; /* messages are sent to NetBIOS name type 0x3 */
-#if SAMBA_VERSION_MAJOR==2
-static int port = SMB_PORT;
-extern fstring remote_machine;
-#elif SAMBA_VERSION_MAJOR==3
static int port = SMB_PORT2;
fstring remote_machine;
-#endif
/****************************************************************************
Handle a message operation.
@@ -41,10 +36,8 @@
static pstring lastfile;
static pstring lastip;
- #if SAMBA_VERSION_MAJOR==3
fstrcpy(remote_machine, get_remote_machine_name());
DEBUG(5, ("remote machine is: %s\n", remote_machine));
- #endif
/* Only notify once for a given virus/ip combo - otherwise the
* scanner will go crazy reaccessing the file and sending
@@ -121,17 +114,7 @@
int len;
int grp_id;
- #if SAMBA_VERSION_MAJOR==2
- #if SAMBA_VERSION_RELEASE < 4
- /* Samba 2.2.0-2.2.3 */
- pstrcpy(msg_conv, unix_to_dos(msg, FALSE));
- #else
- /* Samba >= 2.2.4 */
- pstrcpy(msg_conv, unix_to_dos(msg));
- #endif
- #elif SAMBA_VERSION_MAJOR==3
push_ascii_pstring(msg_conv, msg);
- #endif
len = strlen(msg_conv);
Index: vscan-quarantine.c
===================================================================
RCS file: /cvsroot/openantivirus/samba3-vscan/global/vscan-quarantine.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- vscan-quarantine.c 23 Jul 2005 14:33:56 -0000 1.1.1.1
+++ vscan-quarantine.c 23 Jul 2005 14:47:46 -0000 1.2
@@ -25,13 +25,10 @@
* !=0 failure, file not deleted
*/
-#if (SMB_VFS_INTERFACE_VERSION >= 6)
-int vscan_delete_virus(vfs_handle_struct *handle, connection_struct *conn,
char *virus_file) {
+int vscan_delete_virus(vfs_handle_struct *handle, connection_struct *conn,
char *virus_file)
+{
+
int rc = SMB_VFS_NEXT_UNLINK(handle, conn, virus_file);
-#else
-int vscan_delete_virus(struct vfs_ops *ops, struct connection_struct *conn,
char *virus_file) {
- int rc = ops->unlink(conn, virus_file);
-#endif
if (rc) {
vscan_syslog_alert("ERROR: removing file '%s' failed, reason:
%s", virus_file, strerror(errno));
@@ -52,11 +49,8 @@
* 0 success, file quarantined
* !=0 failure, file not quarantined
*/
-#if (SMB_VFS_INTERFACE_VERSION >= 6)
-int vscan_quarantine_virus(vfs_handle_struct *handle, connection_struct *conn,
char *virus_file, char *q_dir, char *q_prefix) {
-#else
-int vscan_quarantine_virus(struct vfs_ops *ops, struct connection_struct
*conn, char *virus_file, char *q_dir, char *q_prefix) {
-#endif
+int vscan_quarantine_virus(vfs_handle_struct *handle, connection_struct *conn,
char *virus_file, char *q_dir, char *q_prefix)
+{
int rc, fd;
pstring q_file;
@@ -86,11 +80,7 @@
}
/* now do the actual quarantine, i.e. renaming */
-#if (SMB_VFS_INTERFACE_VERSION >= 6)
rc = SMB_VFS_NEXT_RENAME(handle, conn, virus_file, q_file);
-#else
- rc = ops->rename(conn, virus_file, q_file);
-#endif
if (rc) {
vscan_syslog_alert("ERROR: quarantining file '%s' to '%s'
failed, reason: %s", virus_file, q_file, strerror(errno));
@@ -108,11 +98,8 @@
/**
do action on infected file
*/
-#if (SMB_VFS_INTERFACE_VERSION >= 6)
-int vscan_do_infected_file_action(vfs_handle_struct *handle_ops,
connection_struct *conn, char *virus_file, char *q_dir, char *q_prefix, enum
infected_file_action_enum infected_file_action) {
-#else
-int vscan_do_infected_file_action(struct vfs_ops *handle_ops, struct
connection_struct *conn, char *virus_file, char *q_dir, char *q_prefix, enum
infected_file_action_enum infected_file_action) {
-#endif
+int vscan_do_infected_file_action(vfs_handle_struct *handle_ops,
connection_struct *conn, char *virus_file, char *q_dir, char *q_prefix, enum
infected_file_action_enum infected_file_action)
+{
int rc = -1;
switch (infected_file_action) {
Index: vscan-parameter.c
===================================================================
RCS file: /cvsroot/openantivirus/samba3-vscan/global/vscan-parameter.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- vscan-parameter.c 23 Jul 2005 14:33:55 -0000 1.1.1.1
+++ vscan-parameter.c 23 Jul 2005 14:47:46 -0000 1.2
@@ -98,49 +98,11 @@
*/
/* FIXME: should we use const here? Should we use **conn instead? */
-#if (SMB_VFS_INTERFACE_VERSION >= 6)
const char* get_configuration_file(const connection_struct *conn, fstring
module_name, fstring paramconf)
-#else
-const char* get_configuration_file(const struct connection_struct *conn,
fstring module_name, fstring paramconf)
-#endif
{
static fstring config_file;
- #if (SAMBA_VERSION_MAJOR==2 && SAMBA_VERSION_RELEASE>=4) ||
SAMBA_VERSION_MAJOR==3
- #if !(SMB_VFS_INTERFACE_VERSION >= 6)
- pstring opts_str;
- PROTOTYPE_CONST char *p;
- #endif
- #endif
-
- #if (SMB_VFS_INTERFACE_VERSION >= 6)
- fstrcpy(config_file,
lp_parm_const_string(SNUM(conn),module_name,"config-file",paramconf));
- #else
- pstrcpy(opts_str, (const char*) lp_vfs_options(SNUM(conn)));
- if( !*opts_str ) {
- DEBUG(3, ("samba-vscan: no configuration file set - using
default value (%s).\n", lp_vfs_options(SNUM(conn))));
- } else {
- p = opts_str;
- if ( next_token(&p, config_file, "=", sizeof(config_file)) ) {
- trim_string(config_file, " ", " ");
- if ( !strequal("config-file", config_file) ) {
- DEBUG(3, ("samba-vscan - connect: options %s
is not config-file\n", config_file));
- /* setting default value */
- fstrcpy(config_file, paramconf);
-
- } else {
- if ( !next_token(&p, config_file,"
\n",sizeof(config_file)) ) {
- DEBUG(3, ("samba-vscan - connect: no
option after config-file=\n"));
- /* setting default value */
- fstrcpy(config_file, paramconf);
- } else {
- trim_string(config_file, " ", " ");
- DEBUG(3, ("samba-vscan - connect:
config file name is %s\n", config_file));
- }
- }
- }
- }
- #endif /* #if (SMB_VFS_INTERFACE_VERSION >= 6)*/
+ fstrcpy(config_file,
lp_parm_const_string(SNUM(conn),module_name,"config-file",paramconf));
return config_file;
}
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
|