blob: 2ca626a64b94bb2f4db34d36adec8b792b8d8f9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
// **********************************************************************
//
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
#ifndef ICE_SERVICE_INSTALLER_H
#define ICE_SERVICE_INSTALLER_H
#include <Ice/Ice.h>
#include <AccCtrl.h>
class IceServiceInstaller
{
public:
#if defined(_MSC_VER) && _MSC_VER < 1300
enum {
icegridregistry = 0,
icegridnode = 1,
glacier2router = 2,
serviceCount = 3
};
#else
static const int icegridregistry = 0;
static const int icegridnode = 1;
static const int glacier2router = 2;
static const int serviceCount = 3;
#endif
IceServiceInstaller(int, const std::string&, const Ice::CommunicatorPtr&);
~IceServiceInstaller();
void install(const Ice::PropertiesPtr&);
void uninstall();
static std::vector<std::string> getPropertyNames();
static std::string serviceTypeToString(int);
static std::string serviceTypeToLowerString(int);
private:
void initializeSid(const std::string&);
bool fileExists(const std::string&) const;
void grantPermissions(const std::string& path, SE_OBJECT_TYPE type = SE_FILE_OBJECT,
bool inherit = false, bool fullControl = false) const;
bool mkdir(const std::string&) const;
void addLog(const std::string&) const;
void removeLog(const std::string&) const;
std::string createLog(const std::string&) const;
void addSource(const std::string&, const std::string&, const std::string&) const;
std::string removeSource(const std::string&) const;
std::string mangleSource(const std::string&) const;
std::string createSource(const std::string&, const std::string&) const;
std::string getIceDLLPath(const std::string&) const;
int _serviceType;
std::string _configFile;
Ice::CommunicatorPtr _communicator;
Ice::PropertiesPtr _serviceProperties;
std::string _serviceName;
Ice::LocatorPrx _defaultLocator;
std::string _icegridInstanceName;
std::string _nodeName;
std::string _glacier2InstanceName;
SID* _sid;
std::string _sidName;
bool _debug;
};
#endif
|