summaryrefslogtreecommitdiffstats
path: root/ldap/cm/newinst/ux-config.h
blob: 5fb55c281eca4efd8b978c7ad18977f3807f660a (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
/** BEGIN COPYRIGHT BLOCK
 * This Program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; version 2 of the License.
 * 
 * This Program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA.
 * 
 * In addition, as a special exception, Red Hat, Inc. gives You the additional
 * right to link the code of this Program with code not covered under the GNU
 * General Public License ("Non-GPL Code") and to distribute linked combinations
 * including the two, subject to the limitations in this paragraph. Non-GPL Code
 * permitted under this exception must only link to the code of this Program
 * through those well defined interfaces identified in the file named EXCEPTION
 * found in the source code files (the "Approved Interfaces"). The files of
 * Non-GPL Code may instantiate templates or use macros or inline functions from
 * the Approved Interfaces without causing the resulting work to be covered by
 * the GNU General Public License. Only Red Hat, Inc. may make changes or
 * additions to the list of Approved Interfaces. You must obey the GNU General
 * Public License in all respects for all of the Program code and other code used
 * in conjunction with the Program except the Non-GPL Code covered by this
 * exception. If you modify this file, you may extend this exception to your
 * version of the file, but you are not obligated to do so. If you do not wish to
 * provide this exception without modification, you must delete this exception
 * statement from your version and license this file solely under the GPL without
 * exception. 
 * 
 * 
 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
 * Copyright (C) 2005 Red Hat, Inc.
 * All rights reserved.
 * END COPYRIGHT BLOCK **/

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

/*********************************************************************
**
**
** NAME:
**   ux-config.h
**
** DESCRIPTION:
**   Fedora Directory Server Pre-installation Program
**
** NOTES:
**
** HISTORY:
** $Log: ux-config.h,v $
** Revision 1.7  2006/11/10 23:44:40  nhosoi
** Resolves: #214533
** Summary: configure needs to support --with-fhs (Comment #6)
** Changes: Added the following include next to the end of the copyright block.
** +
** +#ifdef HAVE_CONFIG_H
** +#  include <config.h>
** +#endif
** +
**
** Revision 1.6  2005/04/19 22:07:21  nkinder
** Fixed licensing typo
**
** Revision 1.5  2005/04/15 22:40:11  nkinder
** 155068 - Added license to source files
**
** Revision 1.4  2005/03/25 02:09:16  nhosoi
** [Bug 146919] Directory Server rebranding
** 1) Brandx -> Fedora
** 2) Pick up new internal component set (Admin SDK, Setup SDK, Admin Server)
** 3) Use JRE from the Admin Server package
** 4) Docs
**   a) Componentize Docs
**   b) Rebrand Docs
**   c) Drop packaging Administration Guide in the external version
**
** Revision 1.3  2005/02/28 23:37:49  nkinder
** 149951 - Updated source code copyrights
**
** Revision 1.2  2005/02/02 19:35:43  nhosoi
** [146919] De-brand the Directory Server as "brandx"
**
** Revision 1.1.1.1  2005/01/21 00:40:49  cvsadm
** Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth)
**
** Revision 1.1.2.6.8.9  2005/01/14 01:22:10  nhosoi
** For the open-source project.
** 1) eliminated 'netsite' level
** 2) moved ns/config one level lower
** 3) moved fasttime to lib/base
**
** Revision 1.1.2.6.8.8  2003/09/22 19:38:51  ulfw
** Update copyright years from 2001 to 2001-2003
**
** Revision 1.1.2.6.8.7  2001/11/02 23:32:56  richm
** XXX use new copyright XXX
**
** Revision 1.1.2.6.8.6  2001/10/06 20:01:04  richm
** ldapserver/ldap/cm/newinst/ux-config.h
** 1.1.2.6.8.5
** 20010918
**
** Remove copyright caracter form copyright
**
**
** ====================================================
**
** Revision 1.1.2.6.8.5  2001/09/21 15:25:29  richm
** rebrand to Netscape and change version to 6.0
**
** Revision 1.1.2.6.8.4  2001/02/13 09:40:08  rmarco
** copyrights
**
** Revision 1.1.2.6.8.3  2000/08/22 10:07:32  elp
** First bunch of branding fixes.
** Replaced 'Netscape Directory Server' by 'iPlanet Directory Server'.
**
** Revision 1.1.2.6.8.2  2000/08/08 19:34:10  mwahl
** ensure domainname is valid before beginning install
**
** Revision 1.1.2.6.8.1  1999/02/23 02:14:08  ggood
** Merge changes made on server4_directory_branch after 4.0 RTM to DirectoryBranch
**
** Revision 1.1.2.7  1998/11/25 02:07:59  rweltman
** Merging from DS 4.0 RTM into server4_directory_branch
**
** Revision 1.1.2.6.4.2  1998/11/06 21:33:15  richm
** added normalizeDNs
**
** Revision 1.1.2.6.4.1  1998/10/15 18:23:05  richm
** check for bogus admin domain
**
** Revision 1.1.2.6  1998/07/23 21:32:39  richm
** allow re-installation into existing server root
**
** Revision 1.1.2.5  1998/06/15 23:52:08  richm
** added support for user/group separation, better flow control, and support for AS 0611
**
** Revision 1.1.2.4  1997/12/17 21:10:19  richm
** updated for minor 19971216 changes to admin setup sdk
**
** Revision 1.1.2.3  1997/12/06 01:43:18  richm
** upgraded to latest changes from 12.03 admin
**
** Revision 1.1.2.2  1997/11/12 23:42:57  richm
** updates for unix installer
**
** Revision 1.1.2.1  1997/11/04 01:57:53  richm
** Kingpin UNIX installation modules
**
** Revision 1.1.2.4  1997/10/22 02:46:08  pvo
** Removed restore().
**
** Revision 1.1.2.3  1997/10/01 17:24:11  pvo
** Changed include path.
**
** Revision 1.1.2.2  1997/09/27 02:43:39  pvo
** Check in.
**
**
*********************************************************************/
#include "dialog.h"
#include "ux-util.h"
extern const char *DEFAULT_SYSUSER;
extern const char *DEFAULT_OLDROOT;


class SlapdPreInstall:public DialogManager
{
public:

	SlapdPreInstall(int, char **);
	~SlapdPreInstall();

    int init();

    int  start();
    void add (Dialog *);
    void addLast(Dialog *);
	void resetLast();
    void clear();
    int  cont();
    void setParent(void *);
    void *parent() const;

	void setAdminScript(InstallInfo *script);
	InstallInfo *getAdminScript() const;

	InstallInfo *getBaseScript() const;

	int verifyRemoteLdap(const char *host, const char *port, const char *suffix,
						 const char *binddn, const char *binddnpwd) const;

	int verifyAdminDomain(const char *host, const char *port, const char *suffix,
						  const char *admin_domain,
						  const char *binddn, const char *binddnpwd) const;

	const char *getDNSDomain() const;
	const char *getDefaultSuffix() const;
	const char *getConsumerDN() const;
	int featureIsEnabled(const char *which) const;

	static void showAlert(const char *msg);

private:

   NSString        _serverRoot;

   NSString        _infoFile;
   InstallInfo     *_installInfo;
   InstallInfo     *_slapdInfo;
   InstallInfo     *_adminInfo;

   NSString        _logFile;
   InstallLog      *_installLog;

   Bool _configured;
   Bool _reconfig;


   void getOptions(int argc, char **argv);
   int initDefaultConfig();

   void shutdownServers();

   void normalizeDNs();
};

typedef SlapdPreInstall DialogManagerType;

inline DialogManagerType*
getManager(Dialog *me)
{
	return (DialogManagerType*)me->manager();
}