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 157833 Details for
Bug 245665
dsalib still relies on server root
[?]
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]
CVS Diffs - First Pass
diffs.txt (text/plain), 11.48 KB, created by
Nathan Kinder
on 2007-06-25 23:07:25 UTC
(
hide
)
Description:
CVS Diffs - First Pass
Filename:
MIME Type:
Creator:
Nathan Kinder
Created:
2007-06-25 23:07:25 UTC
Size:
11.48 KB
patch
obsolete
>Index: Makefile.am >=================================================================== >RCS file: /cvs/dirsec/adminserver/Makefile.am,v >retrieving revision 1.16 >diff -u -5 -t -r1.16 Makefile.am >--- Makefile.am 22 Jun 2007 02:31:59 -0000 1.16 >+++ Makefile.am 25 Jun 2007 22:58:29 -0000 >@@ -105,11 +105,12 @@ > -DPIDDIR=\"$(piddir)\" -DHTMLDIR=\"$(htmldir)\" -DICONDIR=\"$(icondir)\" \ > -DCMDBINDIR=\"$(cmdbindir)\" -DMANUALDIR=\"$(manualdir)\" \ > -DCONFIGDIR=\"$(configdir)\" -DSECURITYDIR=\"$(securitydir)\" \ > -DLOGDIR=\"$(logdir)\" -DHTTPD=\"$(HTTPD)\" -DDEFAULT_HTTPDUSER=\"$(httpduser)\" \ > -DPIDFILE=\"$(pidfile)\" -DDATADIR=\"$(datadir)\" -DLDIFDIR=\"$(ldifdir)\" \ >- -DBUILD_NUM=$(BUILDNUM) -DINFDIR=\"$(infdir)\" -DCGIBINDIR=\"$(cgibindir)\" >+ -DBUILD_NUM=$(BUILDNUM) -DINFDIR=\"$(infdir)\" -DCGIBINDIR=\"$(cgibindir)\" \ >+ -DINSTCONFIGDIR=\"$(instconfigdir)\" > > lib_LTLIBRARIES = libds-admin-serv.la > > noinst_LIBRARIES = libdsa.a > >Index: config.h.in >=================================================================== >RCS file: /cvs/dirsec/adminserver/config.h.in,v >retrieving revision 1.4 >diff -u -5 -t -r1.4 config.h.in >--- config.h.in 22 Jun 2007 02:32:00 -0000 1.4 >+++ config.h.in 25 Jun 2007 22:58:33 -0000 >@@ -340,11 +340,11 @@ > #undef pid_t > > /* Define to rpl_realloc if the replacement function should be used. */ > #undef realloc > >-/* Define to `unsigned int' if <sys/types.h> does not define. */ >+/* Define to `unsigned' if <sys/types.h> does not define. */ > #undef size_t > > /* SunOS5 */ > #undef sunos5 > >Index: include/libdsa/dsalib.h >=================================================================== >RCS file: /cvs/dirsec/adminserver/include/libdsa/dsalib.h,v >retrieving revision 1.1 >diff -u -5 -t -r1.1 dsalib.h >--- include/libdsa/dsalib.h 13 Jun 2007 01:37:17 -0000 1.1 >+++ include/libdsa/dsalib.h 25 Jun 2007 22:58:40 -0000 >@@ -275,12 +275,15 @@ > #define DS_ACCESSLOG 9 > #define DS_ERRORLOG 10 > #define DS_ROOTDN 11 > #define DS_ROOTPW 12 > #define DS_SUFFIX 13 >-#define DS_LOCALUSER 14 >-#define DS_CFG_MAX 15 /* MUST be one greater than the last option */ >+#define DS_LOCALUSER 14 >+#define DS_BAKDIR 15 >+#define DS_RUNDIR 16 >+#define DS_TMPDIR 17 >+#define DS_CFG_MAX 18 /* MUST be one greater than the last option */ > > /* These control how long we wait for the server to start up or shutdown */ > #define SERVER_START_TIMEOUT 600 /* seconds */ > #define SERVER_STOP_TIMEOUT SERVER_START_TIMEOUT /* same as start timeout */ > >Index: lib/libdsa/dsalib_conf.c >=================================================================== >RCS file: /cvs/dirsec/adminserver/lib/libdsa/dsalib_conf.c,v >retrieving revision 1.1 >diff -u -5 -t -r1.1 dsalib_conf.c >--- lib/libdsa/dsalib_conf.c 13 Jun 2007 01:37:17 -0000 1.1 >+++ lib/libdsa/dsalib_conf.c 25 Jun 2007 22:58:40 -0000 >@@ -120,10 +120,13 @@ > {"nsslapd-errorlog"}, > {"nsslapd-rootdn"}, > {"nsslapd-rootpwstoragescheme"}, > {"nsslapd-suffix"}, > {"nsslapd-localuser"}, >+{"nsslapd-bakdir"}, >+{"nsslapd-lockdir"}, >+{"nsslapd-tmpdir"}, > {0} > }; > > /* > * Open the config file and look for option "option". Return its >Index: lib/libdsa/dsalib_db.c >=================================================================== >RCS file: /cvs/dirsec/adminserver/lib/libdsa/dsalib_db.c,v >retrieving revision 1.1 >diff -u -5 -t -r1.1 dsalib_db.c >--- lib/libdsa/dsalib_db.c 13 Jun 2007 01:37:17 -0000 1.1 >+++ lib/libdsa/dsalib_db.c 25 Jun 2007 22:58:41 -0000 >@@ -67,21 +67,14 @@ > > DS_EXPORT_SYMBOL char ** > ds_get_bak_dirs() > { > char format_str[PATH_MAX]; >- char *root; > int i = 0; > char **bak_dirs = NULL; > char *bakdir = NULL; > >- if ( (root = ds_get_install_root()) == NULL ) >- { >- ds_send_error("Cannot find server root directory.", 0); >- return(bak_dirs); >- } >- > if ( (bakdir = ds_get_bak_dir()) == NULL ) > { > ds_send_error("Cannot find backup directory.", 0); > return(bak_dirs); > } >@@ -90,11 +83,11 @@ > bak_dirs = ds_get_file_list( format_str ); > if( bak_dirs ) > { > while( bak_dirs[i] != NULL ) > { >- /* Prepend the filename with the install root */ >+ /* Prepend the filename with the backup directory */ > char filename[PATH_MAX]; > PR_snprintf( filename, PATH_MAX, "%s%c%s", > bakdir, FILE_SEP, bak_dirs[i] ); > free( bak_dirs[i] ); > bak_dirs[i] = strdup( filename ); >Index: lib/libdsa/dsalib_location.c >=================================================================== >RCS file: /cvs/dirsec/adminserver/lib/libdsa/dsalib_location.c,v >retrieving revision 1.1 >diff -u -5 -t -r1.1 dsalib_location.c >--- lib/libdsa/dsalib_location.c 13 Jun 2007 01:37:17 -0000 1.1 >+++ lib/libdsa/dsalib_location.c 25 Jun 2007 22:58:41 -0000 >@@ -97,11 +97,22 @@ > * for reuse if needed. > */ > DS_EXPORT_SYMBOL char * > ds_get_config_dir() > { >- return getenv("DS_CONFIG_DIR"); >+ char *ds_name; >+ char *configdir_env; >+ static char configdir[PATH_MAX]; >+ >+ if (configdir_env = getenv("DS_CONFIG_DIR")) { >+ return configdir_env; >+ } else { >+ if ( (ds_name = ds_get_server_name()) == NULL ) >+ return(NULL); >+ PR_snprintf(configdir, sizeof(configdir), "%s/%s", INSTCONFIGDIR, ds_name); >+ return (configdir); >+ } > } > > /* > * set config_dir to environment variable DS_CONFIG_DIR > * to retrieve the value using ds_get_config_dir later. >@@ -120,11 +131,17 @@ > * for reuse if needed. > */ > DS_EXPORT_SYMBOL char * > ds_get_run_dir() > { >- return getenv("DS_RUN_DIR"); >+ char *rundir; >+ >+ if (rundir = getenv("DS_RUN_DIR")) { >+ return rundir; >+ } else { >+ return ds_get_config_value(DS_RUNDIR); >+ } > } > > /* > * set run_dir to environment variable DS_RUN_DIR > * to retrieve the value using ds_get_run_dir later. >@@ -143,11 +160,17 @@ > * for reuse if needed. > */ > DS_EXPORT_SYMBOL char * > ds_get_bak_dir() > { >- return getenv("DS_BAK_DIR"); >+ char *bakdir; >+ >+ if (bakdir = getenv("DS_BAK_DIR")) { >+ return bakdir; >+ } else { >+ return ds_get_config_value(DS_BAKDIR); >+ } > } > > /* > * set bak_dir to environment variable DS_BAK_DIR > * to retrieve the value using ds_get_bak_dir later. >@@ -166,11 +189,17 @@ > * for reuse if needed. > */ > DS_EXPORT_SYMBOL char * > ds_get_tmp_dir() > { >- return getenv("DS_TMP_DIR"); >+ char *tmpdir; >+ >+ if (tmpdir = getenv("DS_TMP_DIR")) { >+ return tmpdir; >+ } else { >+ return ds_get_config_value(DS_TMPDIR); >+ } > } > > /* > * set bak_dir to environment variable DS_TMP_DIR > * to retrieve the value using ds_get_tmp_dir later. >Index: lib/libdsa/dsalib_updown.c >=================================================================== >RCS file: /cvs/dirsec/adminserver/lib/libdsa/dsalib_updown.c,v >retrieving revision 1.1 >diff -u -5 -t -r1.1 dsalib_updown.c >--- lib/libdsa/dsalib_updown.c 13 Jun 2007 01:37:17 -0000 1.1 >+++ lib/libdsa/dsalib_updown.c 25 Jun 2007 22:58:41 -0000 >@@ -90,11 +90,11 @@ > FILE *pidfile; > int ipid = -1; > int status = 0; > > if ( (rundir = ds_get_run_dir()) == NULL ) { >- fprintf(stderr, "ds_get_updown_status: could not get install root\n"); >+ fprintf(stderr, "ds_get_updown_status: could not get run directory\n"); > return(DS_SERVER_UNKNOWN); > } > PR_snprintf(pid_file_name, BIG_LINE, "%s/%s.pid", rundir, ds_get_server_name()); > pidfile = fopen(pid_file_name, "r"); > if ( pidfile == NULL ) { >@@ -106,25 +106,25 @@ > return(DS_SERVER_DOWN); > } > status = fscanf(pidfile, "%d\n", &ipid); > fclose(pidfile); > if ( status == -1 ) { >- fprintf(stderr, >+ fprintf(stderr, > "ds_get_updown_status: pidfile=%s server_pid=%d errno=%d\n", > pid_file_name, ipid, errno); > unlink(pid_file_name); /* junk in file? */ > return(DS_SERVER_DOWN); > } > server_pid = (pid_t) ipid; > if ( (status = kill(server_pid, 0)) != 0 && errno != EPERM ) { >- /* we should get ESRCH if the server is down, anything else may be >+ /* we should get ESRCH if the server is down, anything else may be > a real problem */ >- if (errno != ESRCH) { >- fprintf(stderr, >+ if (errno != ESRCH) { >+ fprintf(stderr, > "ds_get_updown_status: pidfile=%s server_pid=%d status=%d errno=%d\n", > pid_file_name, server_pid, status, errno); >- } >+ } > unlink(pid_file_name); /* pid does not exist! */ > return(DS_SERVER_DOWN); > } > return(DS_SERVER_UP); > } >@@ -308,10 +308,11 @@ > int status; > char *errorlog; > status = ds_get_updown_status(); > if ( status == DS_SERVER_UP ) > return(DS_SERVER_ALREADY_UP); >+ /* NGK - Need to eliminate root */ > if ( (root = ds_get_install_root()) == NULL ) > return(DS_SERVER_UNKNOWN); > > errorlog = ds_get_config_value(DS_ERRORLOG); > if ( errorlog == NULL ) { >@@ -321,62 +322,54 @@ > } > > DS_EXPORT_SYMBOL int > ds_bring_down_server() > { >- char *root; > int status; > int cur_size; > char *errorlog; > > status = ds_get_updown_status(); /* set server_pid too! */ > if ( status != DS_SERVER_UP ) { >- ds_send_error("The server is not up.", 0); >+ ds_send_error("The server is not up.", 0); > return(DS_SERVER_ALREADY_DOWN); > } >- if ( (root = ds_get_install_root()) == NULL ) { >- ds_send_error("Could not get the server root directory.", 0); >- return(DS_SERVER_UNKNOWN); >- } > > ds_send_status("shutting down server ..."); > if (!(errorlog = ds_get_errors_name())) { >- ds_send_error("Could not get the error log filename.", 0); >- return DS_SERVER_UNKNOWN; >+ ds_send_error("Could not get the error log filename.", 0); >+ return DS_SERVER_UNKNOWN; > } > > cur_size = ds_get_file_size(errorlog); > #if !defined( XP_WIN32 ) > if ( (kill(server_pid, SIGTERM)) != 0) { >- if (errno == EPERM) { >- ds_send_error("Not permitted to kill server.", 0); >- fprintf (stdout, "[%s]: kill (%li, SIGTERM) failed with errno = EPERM.<br>\n", >- ds_get_server_name(), (long)server_pid); >- } else { >- ds_send_error("error in killing server.", 1); >- } >+ if (errno == EPERM) { >+ ds_send_error("Not permitted to kill server.", 0); >+ fprintf (stdout, "[%s]: kill (%li, SIGTERM) failed with errno = EPERM.<br>\n", >+ ds_get_server_name(), (long)server_pid); >+ } else { >+ ds_send_error("error in killing server.", 1); >+ } > return(DS_SERVER_UNKNOWN); > } > #else >- if( StopServer() == DS_SERVER_DOWN ) >- { >- ds_send_status("shutdown: server shut down"); >- } >- else >- { >+ if ( StopServer() == DS_SERVER_DOWN ) { >+ ds_send_status("shutdown: server shut down"); >+ } else { > ds_send_error("error in killing server.", 1); > return(DS_SERVER_UNKNOWN); >- } >+ } > #endif > /* > * Wait up to SERVER_STOP_TIMEOUT seconds for the stopped message to >- * appear in the error log. >+ * appear in the error log. > */ > ds_display_tail(errorlog, SERVER_STOP_TIMEOUT, cur_size, "slapd stopped.", NULL); > /* in some cases, the server will tell us it's down when it's really not, > so give the OS a chance to remove it from the process table */ >- PR_Sleep(PR_SecondsToInterval(1)); >+ PR_Sleep(PR_SecondsToInterval(1)); > return(ds_get_updown_status()); > } > > #if defined( XP_WIN32 ) >
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 245665
: 157833 |
157834
|
157923
|
157931