Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 158486 Details for
Bug 246683
Reimplement ds_create without setuputil code
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
new ds_create.in
ds_create.in (text/plain), 5.68 KB, created by
Rich Megginson
on 2007-07-03 22:47:31 UTC
(
hide
)
Description:
new ds_create.in
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-07-03 22:47:31 UTC
Size:
5.68 KB
patch
obsolete
>#!/usr/bin/env perl ># 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) 2007 Red Hat, Inc. ># All rights reserved. ># END COPYRIGHT BLOCK ># > >use lib '@perldir@'; > >use strict; > >use CGI qw(:cgi :oldstyle_urls); >use Inf; >use AdminUtil; >use Util; >use Resource; > >my $res = new Resource("@propertydir@/ds_create.res", > "@propertydir@/setup-ds-admin.res", > "@propertydir@/setup-ds.res"); > ># parse the input parameters >my $query = new CGI; ># look at arguments ># save old start_server param ># set start_server=0 >my $start_server = $query->param('start_server'); >$query->param('start_server', '0'); # create server but do not start > ># call ds_newinst as a GET (GET or POST works, GET is simpler) >$ENV{REQUEST_METHOD} = "GET"; >$ENV{QUERY_STRING} = $query->query_string(); > ># make sure the child exit code is reset before starting the fake ># cgi program >my $prog = "@bindir@/ds_newinst"; >if (! -x $prog) { > $prog = "@dslibdir@/ds_newinst"; >} >$? = 0; ># run the CGI >my $output = `$prog 2>&1`; >my $status = $?; ># check for and report errors >if ($status) { > print $output; > exit $status; >} > ># set up new DS to be managed by config DS - acis, pta config > ># new ds info, needed for registration (or get from new dse.ldif) ># temp = ds_a_get_cgi_var("servport", NULL, NULL); ># if (!(cf->servid = ds_a_get_cgi_var("servid", "Server Identifier", ># "Please give your server a short identifier."))) ># cf->rootdn = dn_normalize_convert(ds_a_get_cgi_var("rootdn", NULL, NULL)); ># if (!(cf->rootpw = ds_a_get_cgi_var("rootpw", NULL, NULL))) ># cf->start_server = ds_a_get_cgi_var("start_server", NULL, NULL); >my $inst = $query->param('servid'); >my @errs; >my $inf = createInfFromConfig("@instconfigdir@/slapd-$inst", $inst, \@errs); >if (@errs) { > print "NMC_ErrInfo: ", $res->getText(@errs), "\n"; > print "NMC_Status: 1\n"; > exit 1; >} > ># add the parmeters necessary to configure this DS to be managed ># by the console and to be registered with the config DS - these ># are usually passed in via the CGI params, or use reasonable ># default values >my $admConf = getAdmConf("@instconfigdir@/admin-serv"); >$inf->{General}->{ConfigDirectoryLdapURL} = $query->param('ldap_url') || > $admConf->{ldapurl}; >$inf->{General}->{ConfigDirectoryAdminID} = $query->param('cfg_sspt_uid'); >$inf->{General}->{ConfigDirectoryAdminPwd} = $query->param('cfg_sspt_uid_pw'); >$inf->{General}->{AdminDomain} = $query->param('admin_domain') || > $admConf->{AdminDomain}; > >if (!createSubDSNoConn($inf, \@errs)) { > print "NMC_ErrInfo: ", $res->getText(@errs), "\n"; > print "NMC_Status: 1\n"; > exit 1; >} > >my $servid = $query->param('servid'); >if ($start_server) { > # ok to use here because not only will ds_newinst have validated that > # servid contains only good characters, but we test for the existence > # of this file first > $prog = "@dslibdir@/slapd-$servid/start-slapd"; > if (-x $prog) { > $? = 0; > # run the CGI > my $output = `$prog 2>&1`; > my $status = $?; > if ($status) { > print "NMC_ErrInfo: Could not start directory server: $output\n"; > print "NMC_Status: $status\n"; > exit $status; > } > } else { > print "NMC_ErrInfo: The program $prog does not exist\n"; > print "NMC_Status: 1\n"; > exit 1; > } >} > ># register the new server with the configuration ds ># get config ds url from input or admconf ># get admin id from input or admconf ># must get admin password from input (PASSWORD_PIPE?) ># get admin domain ># config ds info > >if (!registerDSWithConfigDS($servid, \@errs, $inf)) { > print "NMC_ErrInfo: ", $res->getText(@errs), "\n"; > print "NMC_Status: 1\n"; > exit 1; >} > ># if we got here, report success >print "NMC_Status: 0\n"; >exit 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 246683
:
158484
|
158485
| 158486 |
158487
|
158491
|
158494
|
158914
|
158989
|
159007