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 260041 Details for
Bug 368481
Unable to change Admin Server log paths in Console
[?]
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 cgi part
cvsdiffs (text/plain), 6.71 KB, created by
Rich Megginson
on 2007-11-15 17:09:37 UTC
(
hide
)
Description:
diffs for cgi part
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-11-15 17:09:37 UTC
Size:
6.71 KB
patch
obsolete
>Index: adminserver/admserv/cgi-src40/config.c >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/config.c,v >retrieving revision 1.13 >diff -u -8 -r1.13 config.c >--- adminserver/admserv/cgi-src40/config.c 13 Jul 2007 19:47:15 -0000 1.13 >+++ adminserver/admserv/cgi-src40/config.c 14 Nov 2007 18:00:20 -0000 >@@ -79,23 +79,23 @@ > #define DBT_PSET_ADD_ERROR resource_key(RESOURCE_FILE, "15") > #define DBT_PSET_SET_NOT_EXIST resource_key(RESOURCE_FILE, "16") > #define DBT_SSL_INIT_ERROR resource_key(RESOURCE_FILE, "17") > #define DBT_ATTR_INVALID_VALUE resource_key(RESOURCE_FILE, "18") > #define DBT_PORT_INVALID resource_key(RESOURCE_FILE, "19") > #define DBT_PORT_INUSE resource_key(RESOURCE_FILE, "20") > #define DBT_PORT_EACCESS resource_key(RESOURCE_FILE, "21") > #define DBT_PORT_NOT_AVAIL resource_key(RESOURCE_FILE, "22") >-#define DBT_ACCESSLOG_INVALID resource_key(RESOURCE_FILE, "23") >-#define DBT_ERRORLOG_INVALID resource_key(RESOURCE_FILE, "24") >+#define DBT_ERROR_OPENING_LOG resource_key(RESOURCE_FILE, "23") >+#define DBT_LOG_INVALID resource_key(RESOURCE_FILE, "24") > > static char * read_conf(char *file, char *name); > static int update_conf(char *file, char *name, char *val); > static int validate_addr(char* ip); >-static int validate_logfile(char* name); >+static int validate_logfile(char *logdir, char* name); > #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 > >@@ -533,45 +533,71 @@ > } > else { > 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)) { >+ int rc = validate_logfile(logdir, valptr); >+ if (rc == 2) { > /* report error */ > psetDelete(pset); > if (i18nResource) > PR_snprintf(error_info, sizeof(error_info), >- res_getstring(i18nResource, DBT_ACCESSLOG_INVALID, >+ res_getstring(i18nResource, DBT_LOG_INVALID, > acceptLanguage, msgbuf, sizeof(msgbuf), NULL), >- nameptr); >- else PR_snprintf(error_info, sizeof(error_info), "Invalid access log file specified"); >+ "Access", nameptr); >+ else PR_snprintf(error_info, sizeof(error_info), "%s log file name must be a valid file name and must not include the path. [%s] is invalid.", >+ "Access", nameptr); >+ rpt_err(APP_ERROR, error_info, NULL, NULL); >+ } else if (rc == 0) { >+ /* report error */ >+ psetDelete(pset); >+ if (i18nResource) >+ PR_snprintf(error_info, sizeof(error_info), >+ res_getstring(i18nResource, DBT_ERROR_OPENING_LOG, >+ acceptLanguage, msgbuf, sizeof(msgbuf), NULL), >+ "access", nameptr, strerror(errno)); >+ else PR_snprintf(error_info, sizeof(error_info), "Could not open %s log file [%s]. Error: %s", >+ "access", nameptr, strerror(errno)); > rpt_err(APP_ERROR, error_info, NULL, NULL); > } > else { > char *pathline = PR_smprintf("%s/%s %s", logdir, valptr, "common"); > err = update_conf("console.conf", "CustomLog", pathline); > PR_smprintf_free(pathline); > } > } > > /* Check if error log file is being changed */ > if (strcasecmp(nameptr,"configuration.nserrorlog") == 0) { >- if (!validate_logfile(valptr)) { >+ int rc = validate_logfile(logdir, valptr); >+ if (rc == 2) { > /* report error */ > psetDelete(pset); > if (i18nResource) > PR_snprintf(error_info, sizeof(error_info), >- res_getstring(i18nResource, DBT_ERRORLOG_INVALID, >+ res_getstring(i18nResource, DBT_LOG_INVALID, > acceptLanguage, msgbuf, sizeof(msgbuf), NULL), >- nameptr); >- else PR_snprintf(error_info, sizeof(error_info), "Invalid error log file specified"); >+ "Error", nameptr); >+ else PR_snprintf(error_info, sizeof(error_info), "%s log file name must be a valid file name and must not include the path. [%s] is invalid.", >+ "Error", nameptr); >+ rpt_err(APP_ERROR, error_info, NULL, NULL); >+ } else if (rc == 0) { >+ /* report error */ >+ psetDelete(pset); >+ if (i18nResource) >+ PR_snprintf(error_info, sizeof(error_info), >+ res_getstring(i18nResource, DBT_ERROR_OPENING_LOG, >+ acceptLanguage, msgbuf, sizeof(msgbuf), NULL), >+ "error", nameptr, strerror(errno)); >+ else PR_snprintf(error_info, sizeof(error_info), "Could not open %s log file [%s]. Error: %s", >+ "error", nameptr, strerror(errno)); > rpt_err(APP_ERROR, error_info, NULL, NULL); > } > else { > char *newpath = PR_smprintf("%s/%s", logdir, valptr); > err = update_conf("console.conf", "ErrorLog", newpath); > } > } > >@@ -1037,26 +1063,26 @@ > } > > /* > * Try to open a log file in append mode. If the file is not present, it will be created > * Returns : 1 ok > * 0 error > * > */ >-static int validate_logfile(char *name) { >+static int validate_logfile(char *logdir, char *name) { > FILE *f; > char *fullname; > > if (!name || !*name || > !util_is_valid_path_string(name)) { >- return 0; /* error */ >+ return 2; /* error */ > } > >- fullname = PR_smprintf("%s/%s", LOGDIR, name); >+ fullname = PR_smprintf("%s/%s", logdir, name); > > f = fopen(fullname, "a+"); > PR_smprintf_free(fullname); > if (f != NULL) { > fclose(f); > return 1; /* ok*/ > } > >Index: adminserver/admserv/cgi-src40/config.properties >=================================================================== >RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/config.properties,v >retrieving revision 1.3 >diff -u -8 -r1.3 config.properties >--- adminserver/admserv/cgi-src40/config.properties 18 Aug 2005 18:59:03 -0000 1.3 >+++ adminserver/admserv/cgi-src40/config.properties 14 Nov 2007 18:00:20 -0000 >@@ -41,12 +41,12 @@ > config15 { "PSET add operation failed" } > config16 { "PSET set operation try to set non-exist attribute" } > config17 { "SSL related initialization failed" } > config18 { "Attribute[%s] has invalid value" } > config19 { "Invalid port number" } > config20 { "Port is already in use" } > config21 { "Inadequate permission. Port is protected." } > config22 { "Port is not available" } >-config23 { "Invalid access log file specified" } >-config24 { "Invalid error log file specified" } >+config23 { "Could not open %s log file [%s]. Error: %s" } >+config24 { "%s log file name must be a valid file name and must not include the path. [%s] is invalid." } > > }
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 368481
: 260041 |
260111
|
408766
|
408767