projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
novi upstream verzije 2.8.3
[ossec-hids.git]
/
src
/
win32
/
setup-win.c
diff --git
a/src/win32/setup-win.c
b/src/win32/setup-win.c
index
cee17ab
..
af04e8e
100755
(executable)
--- a/
src/win32/setup-win.c
+++ b/
src/win32/setup-win.c
@@
-1,4
+1,5
@@
-/* @(#) $Id$ */
+/* @(#) $Id: ./src/win32/setup-win.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
@@
-8,7
+9,7
@@
* License (version 2) as published by the FSF - Free Software
* Foundation
*/
* License (version 2) as published by the FSF - Free Software
* Foundation
*/
-
+
#include "setup-shared.h"
#include "setup-shared.h"
@@
-16,35
+17,23
@@
/* Setup windows after install */
int main(int argc, char **argv)
{
/* Setup windows after install */
int main(int argc, char **argv)
{
+ /* Setting the name */
+ OS_SetName(ARGV0);
+
if(argc < 2)
{
printf("%s: Invalid syntax.\n", argv[0]);
printf("Try: '%s directory'\n\n", argv[0]);
return(0);
}
if(argc < 2)
{
printf("%s: Invalid syntax.\n", argv[0]);
printf("Try: '%s directory'\n\n", argv[0]);
return(0);
}
-
+
/* Trying to chdir to ossec directory. */
if(chdir(argv[1]) != 0)
{
printf("%s: Invalid directory: '%s'.\n", argv[0], argv[1]);
return(0);
}
/* Trying to chdir to ossec directory. */
if(chdir(argv[1]) != 0)
{
printf("%s: Invalid directory: '%s'.\n", argv[0], argv[1]);
return(0);
}
-
- /* Checking if ossec was installed already (upgrade) */
- if(!fileexist(OSSECCONF))
- {
- char cmd[OS_MAXSTR +1];
-
- /* Copy default config to ossec.conf */
- snprintf(cmd, OS_MAXSTR, "copy %s %s", OSSECDEF, OSSECCONF);
- system(cmd);
- }
-
- /* Setting up local files */
- system("add-localfile.exe \"C:\\Windows\\pfirewall.log\" --quiet");
- system("add-localfile.exe \"C:\\Documents and Settings\\All Users\\Application Data\\Symantec\\Symantec AntiVirus Corporate Edition\\7.5\\Logs\\\%m\%d20\%y.log\" --quiet");
-
/* Configure ossec for automatic startup */
system("sc config OssecSvc start= auto");
/* Configure ossec for automatic startup */
system("sc config OssecSvc start= auto");
@@
-53,7
+42,7
@@
int main(int argc, char **argv)
/* Changing permissions. */
checkVista();
/* Changing permissions. */
checkVista();
-
+
if(isVista)
{
char cmd[OS_MAXSTR +1];
if(isVista)
{
char cmd[OS_MAXSTR +1];
@@
-78,7
+67,7
@@
int main(int argc, char **argv)
/* Changing permissions. */
system("echo y|cacls * /T /G Administrators:f ");
/* Changing permissions. */
system("echo y|cacls * /T /G Administrators:f ");
-
+
/* Copying them back. */
snprintf(cmd, OS_MAXSTR, "move ..\\os_win32ui.exe .");
system(cmd);
/* Copying them back. */
snprintf(cmd, OS_MAXSTR, "move ..\\os_win32ui.exe .");
system(cmd);
@@
-100,5
+89,5
@@
int main(int argc, char **argv)
system("echo y|cacls . /T /G Administrators:f ");
}
system("echo y|cacls . /T /G Administrators:f ");
}
- return(0);
+ return(1);
}
}