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 159232 Details for
Bug 248184
adminserver: The config CGI program does not preserve Listen IP addr
[?]
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), 3.87 KB, created by
Rich Megginson
on 2007-07-13 19:14:32 UTC
(
hide
)
Description:
diffs
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-07-13 19:14:32 UTC
Size:
3.87 KB
patch
obsolete
>Index: adminserver/admserv/cgi-src40/config.c >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/config.c,v >retrieving revision 1.12 >diff -u -8 -r1.12 config.c >--- adminserver/admserv/cgi-src40/config.c 6 Jul 2007 18:06:19 -0000 1.12 >+++ adminserver/admserv/cgi-src40/config.c 13 Jul 2007 19:13:13 -0000 >@@ -94,16 +94,53 @@ > #ifdef XP_UNIX > static int rename_pidlog_file(PsetHndl pset, char* newname); > static int change_uid_all(char *dir, int curuid, int newuid); > static int change_uid(char *fpath, int curuid, int newuid); > static int verify_server_uname(char *newuname); > static int change_server_uid(PsetHndl pset, char* newuname); > #endif > >+static int >+update_port_addr(char *port, char *addr) >+{ >+ char line[BIG_LINE]; >+ char *val = read_conf("console.conf", "Listen"); >+ char *ptr = NULL; >+ int err; >+ >+ if (val) { >+ ptr = strchr(val, ':'); >+ } >+ >+ if (ptr) { >+ *ptr = '\0'; >+ ++ptr; /* ptr points to the start of the port number in host:port */ >+ } else if (val) { >+ ptr = val; /* Listen only specifies the port number */ >+ val = "0.0.0.0"; /* default listen on all interfaces */ >+ } else { >+ /* console.conf should always have Listen with the server port */ >+ ptr = "80"; /* default httpd port? */ >+ val = "0.0.0.0"; >+ } >+ /* >+ If ip address is not defined, it means that server should >+ listen on all interfaces. This is dependant upon console >+ to always include the port string first. >+ */ >+ PR_snprintf(line, sizeof(line), "%s:%s", >+ (addr && *addr) ? addr : val, >+ (port && *port) ? port : ptr); >+ err = update_conf("console.conf", "Listen", line); >+ PL_strfree(val); >+ >+ return err; >+} >+ > int main(int argc, char *argv[]) > { > int _ai = ADMUTIL_Init(); > PsetHndl pset; > char *method; > int rv, cnt, i, j, x, errorCode; > int err; > int *errp = &err; >@@ -446,17 +483,17 @@ > err = -2; > else if(errno == EACCES) > err = -3; > else > err = -4; > } > > if(err == 0) { >- err = update_conf("console.conf", "Listen", valptr); >+ err = update_port_addr(valptr, NULL); /* update port only */ > } > > if (err < 0) > { > psetDelete(pset); > if (i18nResource) > { > if (err == -1) >@@ -490,44 +527,17 @@ > res_getstring(i18nResource, DBT_ATTR_INVALID_VALUE, > acceptLanguage, msgbuf, sizeof(msgbuf), NULL), > nameptr); > else PR_snprintf(error_info, sizeof(error_info), "Attribute[%s] has invalid value", > nameptr); > rpt_err(APP_ERROR, error_info, NULL, NULL); > } > else { >- char line[BIG_LINE]; >- char *val = read_conf("console.conf", "Listen"); >- char *ptr = NULL; >- >- if (val) { >- ptr = strchr(val, ':'); >- } >- >- if (ptr) { >- ++ptr; /* ptr points to the start of the port number in host:port */ >- } else if (val) { >- ptr = val; /* Listen only specifies the port number */ >- } else { >- /* console.conf should always have Listen with the server port */ >- ptr = "80"; /* default httpd port? */ >- } >- /* >- If ip address is not defined, it means that server should >- listen on all interfaces. This is dependant upon console >- to always include the port string first. >- */ >- if (valptr && valptr[0] ) { >- PR_snprintf(line, sizeof(line), "%s:%s", valptr, ptr); >- } else { >- PR_snprintf(line, sizeof(line), "0.0.0.0:%s", ptr); >- } >- err = update_conf("console.conf", "Listen", line); >- PL_strfree(val); >+ err = update_port_addr(NULL, valptr); /* update address only */ > } > } > > /* Check if access log file is being changed */ > if (strcasecmp(nameptr,"configuration.nsaccesslog") == 0) { > if (!validate_logfile(valptr)) { > /* report error */ > psetDelete(pset);
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 248184
: 159232