| |
@@ -387,8 +387,13 @@
|
| |
configs = koji.config_directory_contents(cfdir)
|
| |
else:
|
| |
configs = []
|
| |
- if cf and os.path.isfile(cf):
|
| |
- configs.append(cf)
|
| |
+ if cf:
|
| |
+ # Only consider the config file only if it is a readable file
|
| |
+ if os.path.isfile(cf) and os.access(cf, os.R_OK):
|
| |
+ configs.append(cf)
|
| |
+ else:
|
| |
+ # Log the permissions error if the config file is not readable
|
| |
+ logger.error('Unable to read configuration file (%s)', cf)
|
| |
if configs:
|
| |
config = RawConfigParser()
|
| |
config.read(configs)
|
| |
Hi Team,
During a recent test deploy of a new koji-hub host, I discovered that no logging is produced if the main configuration file (/etc/koji-hub/hub.conf) is unreadable.
In my case, an overly restrictive user/group/mode combination rendered the file unreadable by the apache user:
Attempting to connect to this koji-hub instance via koji-client yielded the following error:
Due to a lack of logging (and perhaps caffeine), I didn't initially spot the user/group/mode blunder.
This pull request seeks to ensure that suitable logging is produced in the event that the configuration file is not readable. This is particularly important, as koji-hub's default behaviour upon being unable to read the configuration file is to coalesce a number of configuration file parameters, with values that will result in koji-hub failing to operate.
Thanks! :)