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 159188 Details for
Bug 248145
Replace ds_newinst binary with perl script
[?]
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.
[patch]
diffs for adminserver
cvsdiffs (text/plain), 14.44 KB, created by
Rich Megginson
on 2007-07-13 14:06:51 UTC
(
hide
)
Description:
diffs for adminserver
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-07-13 14:06:51 UTC
Size:
14.44 KB
patch
obsolete
>Index: adminserver/admserv/cgi-src40/ds_create.in >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/ds_create.in,v >retrieving revision 1.2 >diff -u -8 -r1.2 ds_create.in >--- adminserver/admserv/cgi-src40/ds_create.in 11 Jul 2007 21:36:47 -0000 1.2 >+++ adminserver/admserv/cgi-src40/ds_create.in 13 Jul 2007 14:05:20 -0000 >@@ -41,69 +41,41 @@ > > use strict; > > use CGI qw(:cgi :oldstyle_urls); > use Inf; > use AdminUtil; > use Util; > use Resource; >+use DSCreate; > > 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 "Content-type: text/plain\n\n"; >- 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); >+# create inf from CGI parameters >+my $inf = createInfFromCGIParams($query); >+# create the instance >+my @errs = createDSInstance($inf); > if (@errs) { > print "Content-type: text/plain\n\n"; > print "NMC_ErrInfo: ", $res->getText(@errs), "\n"; > print "NMC_Status: 1\n"; > exit 1; > } > >+# set up new DS to be managed by config DS - acis, pta config > # 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'); >@@ -114,21 +86,21 @@ > if (!createSubDSNoConn($inf, \@errs)) { > print "Content-type: text/plain\n\n"; > 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 >+if (!defined($start_server) or $start_server) { >+ # ok to use here because not only will createDSInstance have validated that > # servid contains only good characters, but we test for the existence > # of this file first >- $prog = "@dslibdir@/slapd-$servid/start-slapd"; >+ my $prog = "@dslibdir@/slapd-$servid/start-slapd"; > if (-x $prog) { > $? = 0; > # run the CGI > my $output = `$prog 2>&1`; > my $status = $?; > if ($status) { > print "Content-type: text/plain\n\n"; > print "NMC_ErrInfo: Could not start directory server: $output\n"; >@@ -139,25 +111,36 @@ > print "Content-type: text/plain\n\n"; > 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 "Content-type: text/plain\n\n"; > print "NMC_ErrInfo: ", $res->getText(@errs), "\n"; > print "NMC_Status: 1\n"; > exit 1; > } > > # if we got here, report success > print "Content-type: text/plain\n\n"; > print "NMC_Status: 0\n"; > exit 0; >+ >+ >+sub createInfFromCGIParams { >+ my $query = shift; >+ my $inf = new Inf; >+ $inf->{General}->{FullMachineName} = $query->param('servname'); >+ $inf->{General}->{SuiteSpotUserID} = $query->param('servuser'); >+ >+ $inf->{slapd}->{ServerPort} = $query->param('servport'); >+ $inf->{slapd}->{RootDN} = $query->param('rootdn'); >+ $inf->{slapd}->{RootDNPwd} = $query->param('rootpw'); >+ $inf->{slapd}->{ServerIdentifier} = $query->param('servid'); >+ $inf->{slapd}->{Suffix} = $query->param('suffix'); >+ $inf->{slapd}->{start_server} = 0; # we will start it explicitly later >+ >+ return $inf; >+} >Index: adminserver/admserv/newinst/src/AdminServer.pm.in >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/AdminServer.pm.in,v >retrieving revision 1.5 >diff -u -8 -r1.5 AdminServer.pm.in >--- adminserver/admserv/newinst/src/AdminServer.pm.in 4 Jul 2007 01:31:33 -0000 1.5 >+++ adminserver/admserv/newinst/src/AdminServer.pm.in 13 Jul 2007 14:05:20 -0000 >@@ -121,48 +121,51 @@ > my $rundir = shift; > > my $uid = getpwnam $setup->{inf}->{admin}->{SysUser}; > my $gid = getgrnam $setup->{inf}->{General}->{SuiteSpotGroup}; > > $setup->msg('create_adminserver_filesdirs'); > > # these paths are owned exclusively by admin sever >+ my @errs; > for ($configdir, $securitydir, $logdir) { >- $! = 0; # clear errno >- if (! -d $_) { >- mkpath($_, 1, 0700); >- } else { >- chmod 0700, $_; >- } >- if (! -d $_) { >- $setup->msg($FATAL, 'error_creating_directory', $_, $!); >+ @errs = makePaths($_, 0700, $setup->{inf}->{admin}->{SysUser}, >+ $setup->{inf}->{General}->{SuiteSpotGroup}); >+ if (@errs) { >+ $setup->msg($FATAL, @errs); > return 0; > } > $! = 0; # clear errno >+ chmod 0700, $_; >+ if ($!) { >+ $setup->msg($FATAL, 'error_chmoding_directory', $_, $!); >+ return 0; >+ } > chown $uid, -1, $_; > if ($!) { > $setup->msg($FATAL, 'error_chowning_directory', $_, > $setup->{inf}->{admin}->{SysUser}, $!); > return 0; > } > } > > # these paths are shared by SuiteSpotGroup members >- $! = 0; # clear errno >- if (! -d $rundir) { >- mkpath($rundir, 0, 0770); >- } else { >- chmod 0770, $rundir; >- } >- if (! -d $rundir) { >- $setup->msg($FATAL, 'error_creating_directory', $rundir, $!); >+ @errs = makePaths($rundir, 0770, $setup->{inf}->{admin}->{SysUser}, >+ $setup->{inf}->{General}->{SuiteSpotGroup}); >+ if (@errs) { >+ $setup->msg($FATAL, @errs); > return 0; > } > $! = 0; # clear errno >+ chmod 0770, $rundir; >+ if ($!) { >+ $setup->msg($FATAL, 'error_chmoding_directory', $rundir, $!); >+ return 0; >+ } > chown -1, $gid, $rundir; > if ($!) { > $setup->msg($FATAL, 'error_chgrping_directory', $rundir, > $setup->{inf}->{General}->{SuiteSpotGroup}, $!); > return 0; > } > > return 1; >@@ -322,22 +325,26 @@ > my $cmd = "@cgibindir@/config op=set configuration.nsSuiteSpotUser=\"$user\""; > if (!defined($origport) or ($port != $origport)) { # need to change the port number > $cmd .= " configuration.nsServerPort=\"$port\""; > } > if ($serverAddress) { > $cmd .= " configuration.nsServerAddress=\"$serverAddress\""; > } > >- if (system($cmd)) { >+ $? = 0; # clear error >+ my $output = `$cmd 2>&1`; >+ if ($?) { >+ debug(0, $output); > $ENV{LD_LIBRARY_PATH} = $savepath; > $ENV{SHLIB_PATH} = $savepath; > return 0; > } > >+ debug(1, $output); > $ENV{LD_LIBRARY_PATH} = $savepath; > $ENV{SHLIB_PATH} = $savepath; > return 1; > } > > sub startAdminServer { > my $setup = shift; > my $configdir = shift; >@@ -448,8 +455,17 @@ > } > return 1; > } > > sub reconfigAdminServer { > my $setup = shift; > return createAdminServer($setup, 1); > } >+ >+1; >+ >+# emacs settings >+# Local Variables: >+# mode:perl >+# indent-tabs-mode: nil >+# tab-width: 4 >+# End: >Index: adminserver/admserv/newinst/src/AdminUtil.pm.in >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/AdminUtil.pm.in,v >retrieving revision 1.9 >diff -u -8 -r1.9 AdminUtil.pm.in >--- adminserver/admserv/newinst/src/AdminUtil.pm.in 11 Jul 2007 01:20:21 -0000 1.9 >+++ adminserver/admserv/newinst/src/AdminUtil.pm.in 13 Jul 2007 14:05:20 -0000 >@@ -740,8 +740,17 @@ > getMappedEntries($mapper, \@ldiffiles, $errs, \&check_and_add_entry, $context); > > if ($needclose) { > $conn->close(); > } > > return @{$errs} ? 0 : 1; > } >+ >+1; >+ >+# emacs settings >+# Local Variables: >+# mode:perl >+# indent-tabs-mode: nil >+# tab-width: 4 >+# End: >Index: adminserver/admserv/newinst/src/migrate-ds-admin.pl.in >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/migrate-ds-admin.pl.in,v >retrieving revision 1.3 >diff -u -8 -r1.3 migrate-ds-admin.pl.in >--- adminserver/admserv/newinst/src/migrate-ds-admin.pl.in 12 Jul 2007 14:00:10 -0000 1.3 >+++ adminserver/admserv/newinst/src/migrate-ds-admin.pl.in 13 Jul 2007 14:05:20 -0000 >@@ -77,17 +77,19 @@ > my $configdsinst = getLocalConfigDS("$mig->{oldsroot}/admin-serv/config"); > if ($configdsinst) { > system("$mig->{oldsroot}/slapd-$configdsinst/stop-slapd"); > system("@dslibdir@/slapd-$configdsinst/start-slapd"); > } > > # next, migrate the admin server - this also registers the directory servers > $mig->msg('begin_as_migration', $mig->{oldsroot}); >-migrateAdminServer($mig); >+if (!migrateAdminServer($mig)) { >+ exit 1; >+} > > # next, register/update the new directory servers > # in the config ds > $mig->msg('registering_dirserver_instances'); > my @errs; > if (!registerManyDSWithConfigDS($mig->{inf}, \@errs, > $mig->{configdir}, > @{$mig->{instances}})) { >Index: adminserver/admserv/newinst/src/setup-ds-admin.pl.in >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/setup-ds-admin.pl.in,v >retrieving revision 1.7 >diff -u -8 -r1.7 setup-ds-admin.pl.in >--- adminserver/admserv/newinst/src/setup-ds-admin.pl.in 4 Jul 2007 01:31:33 -0000 1.7 >+++ adminserver/admserv/newinst/src/setup-ds-admin.pl.in 13 Jul 2007 14:05:20 -0000 >@@ -41,16 +41,17 @@ > > use strict; > > use Setup; > use SetupLog; > use Inf; > use Resource; > use DialogManager; >+use DSCreate; > use AdminUtil; > use AdminServer; > use Util; > > my $res = new Resource("@propertydir@/setup-ds.res", > "@propertydir@/setup-ds-admin.res"); > > my $setup = new Setup($res); >@@ -140,26 +141,23 @@ > $createconfigds = 1; > } > > $setup->{inf}->write(); > > $setup->msg('create_dirserver'); > > # create a directory server instance >-my @errs = (); >-my ($rc, $output) = createDSInstance($setup->{inf}, \@errs); >-if ($rc) { >- if (@errs) { >- $setup->msg(@errs); >- } >- $setup->msg($FATAL, 'error_creating_dsinstance', $rc, $output); >+my @errs = createDSInstance($setup->{inf}); >+if (@errs) { >+ $setup->msg(@errs); >+ $setup->msg($FATAL, 'error_creating_dsinstance', $setup->{inf}->{slapd}->{ServerIdentifier}); > exit 1; > } else { >- $setup->msg('created_dsinstance', $output); >+ $setup->msg('created_dsinstance', $setup->{inf}->{slapd}->{ServerIdentifier}); > } > > # setup directory server instance to be the configuration DS > if ($createconfigds) { > $setup->msg('create_configds'); > if (!createConfigDS($setup->{inf}, \@errs)) { > $setup->msg($FATAL, @errs); > $setup->msg($FATAL, 'error_create_configds'); >Index: adminserver/admserv/newinst/src/setup-ds-admin.res.in >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/newinst/src/setup-ds-admin.res.in,v >retrieving revision 1.4 >diff -u -8 -r1.4 setup-ds-admin.res.in >--- adminserver/admserv/newinst/src/setup-ds-admin.res.in 20 Jun 2007 16:35:02 -0000 1.4 >+++ adminserver/admserv/newinst/src/setup-ds-admin.res.in 13 Jul 2007 14:05:20 -0000 >@@ -87,21 +87,16 @@ > create_adminserver_filesdirs = Creating Admin Server files and directories . . .\n > creating_admpw = Could not create the admin server password file '%s': Error %s\n > missing_adminserver_param = Missing required Admin Server setup parameter '%s'. Cannot continue.\n > missing_general_param = Missing required General setup parameter '%s'. Cannot continue.\n > creating_admpw = Could not create the Admin Server password file '%s'. Error %s\n > error_create_dirserver = Failed to create directory server instance\n > error_create_configds = Failed to create the configuration directory server\n > error_create_adminserver = Failed to create and configure the admin server\n >-error_creating_directory = Could not create admin server directory '%s'. Error: %s\n >-error_chowning_directory = Could not change ownership of directory '%s' to userid '%s': Error: %s\n >-error_chowning_file = Could not change ownership of file '%s' to userid '%s': Error: %s\n >-error_chmoding_file = Could not change permissions of file '%s': Error: %s\n >-error_chgrping_directory = Could not change group of directory '%s' to group '%s': Error: %s\n > updating_admconf = Updating adm.conf . . .\n > error_updating_admconf = Could not update adm.conf. Error: %s\n > updating_admpw = Updating admpw . . .\n > error_updating_admpw = Could not update admpw. Error: %s\n > error_creating_adminserver_maptbl = Could not create the map table for registering the Admin Server with the configuration directory server.\n > error_updating_localconf = Could not update the local admin server configuration file '%s'. Error: %s\n > error_starting_adminserver = Could not start the admin server. Error: %s\n > registering_adminserver = Registering admin server with the configuration directory server . . .\n
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248145
:
159175
|
159176
|
159177
|
159178
|
159179
|
159181
|
159182
|
159183
|
159184
|
159185
|
159186
|
159187
| 159188 |
159227
|
159228
|
159230
|
159234
|
159235
|
159550
|
159551
|
159552
|
159558