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 148983 Details for
Bug 230498
allow ds_newinst with ldapi and no serverport
[?]
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
cvsdiffs (text/plain), 11.55 KB, created by
Rich Megginson
on 2007-03-01 02:15:26 UTC
(
hide
)
Description:
diffs
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-03-01 02:15:26 UTC
Size:
11.55 KB
patch
obsolete
>Index: ldapserver/ldap/admin/src/create_instance.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.c,v >retrieving revision 1.48 >diff -u -8 -r1.48 create_instance.c >--- ldapserver/ldap/admin/src/create_instance.c 27 Feb 2007 02:57:24 -0000 1.48 >+++ ldapserver/ldap/admin/src/create_instance.c 1 Mar 2007 02:14:29 -0000 >@@ -248,17 +248,16 @@ > *t = '\0'; > id = PR_smprintf("%s", hn); > if(t) > *t = '.'; > } > > conf->servname = hn; > conf->bindaddr = ""; >- conf->servport = "80"; > conf->cfg_sspt = NULL; > conf->suitespot3x_uid = NULL; > conf->cfg_sspt_uid = NULL; > conf->cfg_sspt_uidpw = NULL; > conf->servport = "389"; > conf->secserv = "off"; > conf->secservport = "636"; > conf->rootpw = ""; >@@ -326,16 +325,17 @@ > conf->schema_dir = NULL; > conf->sysconfdir = NULL; > conf->tmp_dir = NULL; > } > > /* ----------------- Sanity check a server configuration ------------------ */ > > char *create_instance_checkport(char *, char *); >+char *create_instance_checkports(server_config_s *cf); > char *create_instance_checkuser(char *); > int create_instance_numbers(char *); > int create_instance_exists(char *fn, int type); > char *create_instance_copy(char *, char *, int, int); > char *create_instance_concatenate(char *, char *, int); > int create_instance_mkdir(char *, int); > char *create_instance_mkdir_p(char *, char *, int, struct passwd *); > static char *create_instance_strdup(const char *); >@@ -436,17 +436,17 @@ > if (!param_name) > return "Parameter param_name is null"; > > /* if we don't need to start the server right away, we can skip the > port number checks > */ > if (!needToStartServer(cf)) > { >- if( (t = create_instance_checkport(cf->bindaddr, cf->servport)) ) >+ if( (t = create_instance_checkports(cf))) > { > PL_strncpyz(param_name, "servport", BIG_LINE); > return t; > } > > if ( cf->secserv && (strcmp(cf->secserv, "on") == 0) && (cf->secservport != NULL) && > (*(cf->secservport) != '\0') ) { > if ( (t = create_instance_checkport(cf->bindaddr, cf->secservport)) ) { >@@ -1413,16 +1413,30 @@ > unlink(fn); > return (ret == -1 ? -2 : 0); > } > #endif /* XP_UNIX */ > > > /* --------------------------- create_instance_check* ---------------------------- */ > >+char *create_instance_checkports(server_config_s *cf) >+{ >+ /* allow port 0 if ldapifilepath is specified */ >+#if defined(ENABLE_LDAPI) >+ if (!cf->ldapifilepath || strcmp(cf->servport, "0")) { >+#endif >+ return create_instance_checkport(cf->bindaddr, cf->servport); >+#if defined(ENABLE_LDAPI) >+ } >+#endif >+ >+ return NULL; >+} >+ > > char *create_instance_checkport(char *addr, char *sport) > { > int port; > > port = atoi(sport); > if((port < 1) || (port > 65535)) { > return ("Valid port numbers are between 1 and 65535"); >@@ -2682,17 +2696,21 @@ > fprintf(f, "nsslapd-localhost: %s\n", cf->servname); > fprintf(f, "nsslapd-schemacheck: %s\n", > (cf->disable_schema_checking && !strcmp(cf->disable_schema_checking, "1")) ? "off" : "on"); > fprintf(f, "nsslapd-rewrite-rfc1274: off\n"); > fprintf(f, "nsslapd-return-exact-case: on\n"); > fprintf(f, "nsslapd-ssl-check-hostname: on\n"); > fprintf(f, "nsslapd-port: %s\n", cf->servport); > #if defined(ENABLE_LDAPI) >- fprintf(f, "nsslapd-ldapifilepath: %s/%s-%s.socket\n", cf->run_dir, PRODUCT_NAME, cf->servid); >+ if (cf->ldapifilepath) { >+ fprintf(f, "nsslapd-ldapifilepath: %s\n", cf->ldapifilepath); >+ } else { >+ fprintf(f, "nsslapd-ldapifilepath: %s/%s-%s.socket\n", cf->run_dir, PRODUCT_NAME, cf->servid); >+ } > fprintf(f, "nsslapd-ldapilisten: on\n"); > #if defined(ENABLE_AUTOBIND) > fprintf(f, "nsslapd-ldapiautobind: on\n"); > #endif /* ENABLE_AUTOBIND */ > fprintf(f, "nsslapd-ldapimaprootdn: cn=Directory Manager\n"); > fprintf(f, "nsslapd-ldapimaptoentries: off\n"); > fprintf(f, "nsslapd-ldapiuidnumbertype: uidNumber\n"); > fprintf(f, "nsslapd-ldapigidnumbertype: gidNumber\n"); >@@ -3998,19 +4016,20 @@ > } > > /* > All of the config files have been written, and the server should > be ready to go. Start the server if the user specified to start > it or if we are configuring the server to serve as the repository > for SuiteSpot (Mission Control) information > Only attempt to start the server if the port is not in use >+ In order to start the server, there must either be an ldapifilepath >+ specified or a valid port. If the port is not "0" it must be valid. > */ >- if(needToStartServer(cf) && >- !(t = create_instance_checkport(cf->bindaddr, cf->servport))) >+ if(needToStartServer(cf) && !(t = create_instance_checkports(cf))) > { > PR_snprintf(big_line, sizeof(big_line),"SERVER_NAMES=slapd-%s",cf->servid); > putenv(big_line); > > isrunning = ds_get_updown_status(); > > if (isrunning != DS_SERVER_UP) > { >@@ -4361,22 +4380,43 @@ > > if (!(cf->servname = ds_a_get_cgi_var("servname", "Server Name", > "Please give a hostname for your server."))) > { > return 1; > } > > cf->bindaddr = ds_a_get_cgi_var("bindaddr", NULL, NULL); >- if (!(cf->servport = ds_a_get_cgi_var("servport", "Server Port", >- "Please specify the TCP port number for this server."))) >- { >+#if defined(ENABLE_LDAPI) >+ temp = ds_a_get_cgi_var("ldapifilepath", NULL, NULL); >+ if (NULL != temp) { >+ cf->ldapifilepath = PL_strdup(temp); >+ } >+#endif >+ >+ temp = ds_a_get_cgi_var("servport", NULL, NULL); >+ if (!temp >+#if defined(ENABLE_LDAPI) >+ && !cf->ldapifilepath >+#endif >+ ) { >+#if defined(ENABLE_LDAPI) >+ ds_show_message("error: either servport or ldapifilepath must be specified."); >+#else >+ ds_show_message("error: servport must be specified."); >+#endif > return 1; > } > >+ if (NULL != temp) { >+ cf->servport = PL_strdup(temp); >+ } else { >+ cf->servport = PL_strdup("0"); >+ } >+ > cf->cfg_sspt = ds_a_get_cgi_var("cfg_sspt", NULL, NULL); > cf->cfg_sspt_uid = ds_a_get_cgi_var("cfg_sspt_uid", NULL, NULL); > if (cf->cfg_sspt_uid && *(cf->cfg_sspt_uid) && > !(cf->cfg_sspt_uidpw = ds_a_get_cgi_var("cfg_sspt_uid_pw", NULL, NULL))) > { > > if (!(cfg_sspt_uid_pw1 = ds_a_get_cgi_var("cfg_sspt_uid_pw1", "Password", > "Enter the password for the Mission Control Administrator's account."))) >Index: ldapserver/ldap/admin/src/create_instance.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/create_instance.h,v >retrieving revision 1.15 >diff -u -8 -r1.15 create_instance.h >--- ldapserver/ldap/admin/src/create_instance.h 9 Feb 2007 22:33:59 -0000 1.15 >+++ ldapserver/ldap/admin/src/create_instance.h 1 Mar 2007 02:14:29 -0000 >@@ -177,16 +177,19 @@ > char *db_dir; > char *bak_dir; > char *ldif_dir; > char *plugin_dir; > char *tmp_dir; > char *cert_dir; > char *sasl_path; > char *prefix; >+#if defined(ENABLE_LDAPI) >+ char *ldapifilepath; >+#endif > } server_config_s; > > > #ifdef NS_UNSECURE > #define DEFAULT_ID "unsecure" > #else > #define DEFAULT_ID "secure" > #endif >Index: ldapserver/ldap/admin/src/ds_newinst.pl.in >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/ds_newinst.pl.in,v >retrieving revision 1.4 >diff -u -8 -r1.4 ds_newinst.pl.in >--- ldapserver/ldap/admin/src/ds_newinst.pl.in 12 Feb 2007 19:39:04 -0000 1.4 >+++ ldapserver/ldap/admin/src/ds_newinst.pl.in 1 Mar 2007 02:14:29 -0000 >@@ -39,17 +39,18 @@ > use Symbol; > use CGI::Util qw(escape); > use Cwd; > use File::Basename; > > sub usage { > my $msg = shift; > print "Error: $msg\n"; >- print "Usage: $0 filename.inf\n"; >+ print "Usage: $0 [-|filename.inf]\n"; >+ print "Use - to read from stdin\n"; > exit 1 > } > > sub getCgiContentAndLength { > my $args = shift; > my $content = ""; > my $firsttime = 1; > while (my ($kk, $vv) = each %{$args}) { >@@ -131,57 +132,81 @@ > if (! $source->{$ssec}->{$skey}) { > usage("Missing required parameter $ssec - $skey\n"); > } > > $dest->{$dkey} = $source->{$ssec}->{$skey}; > } > > my $filename = $ARGV[0]; >-usage("$filename not found") if (! -f $filename); >+usage("$filename not found") if ($filename ne "-" && ! -f $filename); > > my $curSection; > # each key in the table is a section name > # the value is a hash ref of the items in that section > # in that hash ref, each key is the config param name, > # and the value is the config param value > my %table = (); > >-open(IN, $filename); >-while (<IN>) { >+my $fh; >+if ($filename eq "-") { >+ $fh = \*STDIN; >+} else { >+ open(IN, $filename); >+ $fh = \*IN; >+} >+while (<$fh>) { > # e.g. [General] > if (/^\[(.*?)\]/) { > $curSection = $1; > } elsif (/^\s*$/) { > next; # skip blank lines > } elsif (/^\s*\#/) { > next; # skip comment lines > } elsif (/^\s*(.*?)\s*=\s*(.*?)\s*$/) { > $table{$curSection}->{$1} = $2; > } > } >-close IN; >+if ($filename ne "-") { >+ close IN; >+} > > #printhash (\%table); > > # next, construct a hash table with our arguments > > my %cgiargs = (); > my $package_name = "@package_name@"; > > # the following items are always required > addAndCheck(\%cgiargs, "sroot", \%table, "General", "ServerRoot"); > addAndCheck(\%cgiargs, "servname", \%table, "General", "FullMachineName"); > addAndCheck(\%cgiargs, "servuser", \%table, "General", "SuiteSpotUserID"); >-addAndCheck(\%cgiargs, "servport", \%table, "slapd", "ServerPort"); > addAndCheck(\%cgiargs, "rootdn", \%table, "slapd", "RootDN"); > addAndCheck(\%cgiargs, "rootpw", \%table, "slapd", "RootDNPwd"); > addAndCheck(\%cgiargs, "servid", \%table, "slapd", "ServerIdentifier"); > addAndCheck(\%cgiargs, "suffix", \%table, "slapd", "Suffix"); > >+# either servport or ldapifilepath must be specified - the server must >+# listen to something . . . >+my $canlisten = 0; >+if (defined($table{"slapd"}->{"ServerPort"})) { >+ $canlisten = 1; >+ $cgiargs{"servport"} = $table{"slapd"}->{"ServerPort"}; >+} else { >+ $cgiargs{"servport"} = "0"; # 0 means do not listen >+} >+if (defined($table{"slapd"}->{"ldapifilepath"})) { >+ $canlisten = 1; >+ $cgiargs{"ldapifilepath"} = $table{"slapd"}->{"ldapifilepath"}; >+} >+if (! $canlisten) { >+ usage("Either ServerPort or ldapifilepath must be specified in the slapd section of $filename"); >+} >+ > # the following items are optional > > $cgiargs{"lock_dir"} = $table{"slapd"}->{"lock_dir"}; > $cgiargs{"log_dir"} = $table{"slapd"}->{"log_dir"}; > $cgiargs{"run_dir"} = $table{"slapd"}->{"run_dir"}; > $cgiargs{"db_dir"} = $table{"slapd"}->{"db_dir"}; > $cgiargs{"bak_dir"} = $table{"slapd"}->{"bak_dir"}; > $cgiargs{"ldif_dir"} = $table{"slapd"}->{"ldif_dir"}; >@@ -248,17 +273,21 @@ > # populate the DS with this file - the suffix in this file must > # be the suffix specified in the suffix argument above > # the filename should use the full absolute path > $cgiargs{install_ldif_file} = $table{slapd}->{InstallLdifFile}; > > # if for some reason you do not want the server started after instance creation > # the following line can be commented out - NOTE that if you are creating the > # Configuration DS, it will be started anyway >-$cgiargs{start_server} = 1; >+if (defined($table{"slapd"}->{"start_server"})) { >+ $cgiargs{start_server} = $table{"slapd"}->{"start_server"}; >+} else { # default is on >+ $cgiargs{start_server} = 1; >+} > > my $sroot = $cgiargs{sroot}; > > my $prog = "@bindir@/ds_newinst"; > if (! -x $prog) { > $prog = "@libdir@/$package_name/ds_newinst"; > } >
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 230498
:
148982
|
148983
|
148985
|
148986
|
148987
|
149056
|
149057