Bug 368481 - Unable to change Admin Server log paths in Console
Unable to change Admin Server log paths in Console
Product: 389
Classification: Community
Component: UI - Configuration (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
Depends On:
Blocks: 434914 434915
  Show dependency treegraph
Reported: 2007-11-06 11:42 EST by Nathan Kinder
Modified: 2015-12-07 11:49 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-07 11:49:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
diffs for cgi part (6.71 KB, patch)
2007-11-15 12:09 EST, Rich Megginson
no flags Details | Diff
cvs commit log (363 bytes, text/plain)
2007-11-15 12:33 EST, Rich Megginson
no flags Details
368481-admin.patch (4.13 KB, patch)
2010-04-23 20:07 EDT, Endi Sukma Dewata
rmeggins: review+
Details | Diff
368481-admin-console.patch (7.50 KB, patch)
2010-04-23 20:08 EDT, Endi Sukma Dewata
rmeggins: review+
Details | Diff

  None (edit)
Description Nathan Kinder 2007-11-06 11:42:28 EST
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.

    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."
Comment 1 Rich Megginson 2007-11-06 12:52:29 EST
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.
Comment 2 Nathan Kinder 2007-11-06 13:29:11 EST
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.
Comment 3 Rich Megginson 2007-11-06 14:33:49 EST
Do we want the config CGI to automatically strip off paths and just use the
Comment 4 Nathan Kinder 2007-11-06 14:39:05 EST
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.
Comment 5 Rich Megginson 2007-11-15 12:09:37 EST
Created attachment 260041 [details]
diffs for cgi part
Comment 6 Rich Megginson 2007-11-15 12:33:22 EST
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
Comment 8 Jenny Galipeau 2009-03-11 16:34:35 EDT
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
   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.
Comment 10 Endi Sukma Dewata 2010-04-23 20:07:14 EDT
Created attachment 408766 [details]

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.
Comment 11 Endi Sukma Dewata 2010-04-23 20:08:14 EDT
Created attachment 408767 [details]

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.
Comment 12 Rich Megginson 2010-04-26 19:51:17 EDT
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@redhat.com>
Date:   Fri Apr 23 18:59:56 2010 -0500
   ffef30b..2d2a225  master -> master
commit 2d2a225b0a435e7f3199c4656ea2078b02cc6573
Author: Endi S. Dewata <edewata@redhat.com>
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@redhat.com>
Date:   Fri Apr 23 19:13:04 2010 -0500
Comment 13 Jenny Galipeau 2010-05-27 15:27:09 EDT
I am not seeing the separate text fields with only the file name editable.  Behavior is still the same.


Comment 14 Rich Megginson 2010-06-02 11:23:30 EDT
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
Comment 15 Fedora Update System 2010-06-02 11:27:51 EDT
389-admin-console-1.1.5-1.fc12 has been submitted as an update for Fedora 12.
Comment 16 Fedora Update System 2010-06-02 11:27:57 EDT
389-admin-console-1.1.5-1.fc11 has been submitted as an update for Fedora 11.
Comment 17 Fedora Update System 2010-06-02 11:28:02 EDT
389-admin-console-1.1.5-1.fc13 has been submitted as an update for Fedora 13.

Note You need to log in before you can comment on or make changes to this bug.