The CGI responsible for setting the Admin Server logfile names only accepts a filename (no path). In addition, the filename can not already exist. The problem is that the default values displayed in the Console are absolute paths. If you modify the name of only one log file (for example, change the error log filename to errors2), then click on "Save", you will get an error from the ServerSetup task stating that the access log setting is invalid. Status:Failure Invalid access log file specified Application error In addition, the behavior seems a little odd in that you can't set the filename back to the original filename because that file exists. You would first need to go delete the log manually to be able to go back to a previous log filename. I think that this is acceptable, but the error message is the same as above, so it doesn't tell you what the problem is. I think the proper way to fix this is to have the default setting not be an absolute path in the Console. In addition, the error messages returned by the ServerSetup CGI should say what the problem is, such as "Access log file can not include a path." and "File already exists."
I don't see that in the CGI code. The CGI program is config for the ServerSetup task. The input parameters are configuration.nserrorlog and configuration.nsaccesslog. The code first attempts to validate the given strings, which will fail if they include paths. Then the code opens the given filename in the log file directory with "a+" - write/append - which should succeed whether the file exists or not. So I'm not sure why it would fail if the file already exists.
Hmm... you're right. I'm not sure of the exact input I had before, but I must have had a path in one of the fields. I am able to use an existing filename with no problems.
Do we want the config CGI to automatically strip off paths and just use the filename?
I don't think we need to do that. I'd like the default values displayed in Console to only be the filenames. I'd like the CGI to return an error stating that only a filename is accepted. I've changed the wording in the online help for that panel to state that no path will be accepted, only a filename.
Created attachment 260041 [details] diffs for cgi part
Created attachment 260111 [details] cvs commit log Reviewed by: nkinder (Thanks!) Fix Description: This is for the CGI part. The CGI will now return one error if the input is not a valid filename (i.e. it is a path), and return a different error if the filename could not be opened. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
1. The default names displayed in the console are still absolute paths and not just file name. 2. The error returned for absolute paths looks good, but is confusing because the default value is an absolute path: Status: Failure Error log file name must ba a valid file name and must not include the path. [configuration.nserror.log] is invalid. Application Error 3. If you change both to just file names, if either of the file names are unchanged or exist it will error and the error message is not understandable Status:Failure Could not open error log file [configuration.nserrorlog]. Error: Success Application Error I think some GUI work is needed here. Since you want the administrator to know the path to the log file, but you aren't going to allow a change to that path. The path should be displayed and just a field displaying "Log File Name:" as it's display name. This would clear up a lot of confusion and avoid some of the odd errors.
Created attachment 408766 [details] 368481-admin.patch The console assumes that the attribute values read from and written to the server will follow the same format, so the config.c has been modified to accept the full path instead of just the file name. The path will be validated to ensure that it is inside the server log dir (ADMSERV_LOG_DIR). The return code of validate_logfile() has been changed such that 0 indicates no error has occured.
Created attachment 408767 [details] 368481-admin-console.patch The console has been modified to split the log full path into the path of the log directory and the file name. They will be shown in separate text fields. Only the file name will be editable. When the user saves the changes, the directory path will be combined with the file name, then submitted to the server as a full path.
To ssh://git.fedorahosted.org/git/389/admin.git 3e2913b..05d5cf2 Directory_Server_8_2_Branch -> Directory_Server_8_2_Branch commit 05d5cf22730ba621fbc2b91f402787bb0f90a4c2 Author: Endi S. Dewata <edewata> Date: Fri Apr 23 18:59:56 2010 -0500 ffef30b..2d2a225 master -> master commit 2d2a225b0a435e7f3199c4656ea2078b02cc6573 Author: Endi S. Dewata <edewata> Date: Fri Apr 23 18:59:56 2010 -0500 To ssh://git.fedorahosted.org/git/389/admin-console.git a6c7399..8a5bb4c master -> master commit 8a5bb4c58ab983c52d471de232053608d8e174bb Author: Endi S. Dewata <edewata> Date: Fri Apr 23 19:13:04 2010 -0500
I am not seeing the separate text fields with only the file name editable. Behavior is still the same. versions: redhat-ds-admin-8.2.0-3.el4dsrv redhat-idm-console-1.0.0-26.el4idm redhat-ds-console-8.2.0-3.el4dsrv redhat-ds-8.2.0-1.el4dsrv redhat-ds-base-8.2.0-2010052704.el4dsrv redhat-admin-console-8.2.0-1.el4dsrv
Might help if I actually built it :P Done - built in Brew - 8.2.0-2 branched for Solaris 8.2.0 - https://svn.devel.redhat.com/repos/dirsec/branches/Directory_Server_8_2_Branch/pkgs/redhat-admin-console Need kwright to rebuild for Solaris
389-admin-console-1.1.5-1.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/389-admin-console-1.1.5-1.fc12
389-admin-console-1.1.5-1.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/389-admin-console-1.1.5-1.fc11
389-admin-console-1.1.5-1.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/389-admin-console-1.1.5-1.fc13