#204 Fix error handling in gp_config_from_dir
Merged by cipherboy. Opened by cipherboy.
cipherboy/gssproxy error_handling  into  master

Download 204.patch

This is a bugfix when handling errors in gp_config_from_dir. Per docs, ref_array_getlen returns a status code (0/EINVAL) and not the length of the array; the second parameter, i, is assigned the length of the array. Thus i >= 0 and len == 0, so i >= len and the for loop is never triggered.

Second, due to the implementation, error_list is a list of pointers to error message strings. This does not need to be freed as ini_config_augment handles this for us.

Would you accept GPDEBUG() changed to GPERROR() or fprintf(stderr, ...) as well? I feel that GPERROR() is more fitting in this case, as GPDEBUG() will not work when run as a daemon due to gp_debug not being set. If an error happens while loading the config file, gp_debug_toggle() will not have been called and with the current implementation of gp_debug_args(), gp_debug will be at its default value of zero.

The problem is that this is not an error case, so GPERROR isn't appropriate. GPAUDIT might be more appropriate.

Good point -- and GPAUDIT() doesn't have the same problems GPDEBUG() has.

rebased

Commit eb880e93 fixes this pull-request

Pull-Request has been merged by ascheel@redhat.com

Commit 69c7dd11 fixes this pull-request

Pull-Request has been merged by ascheel@redhat.com

Commit eb880e93 fixes this pull-request

Pull-Request has been merged by ascheel@redhat.com

Metadata