kgiusti commented on a change in pull request #582: DISPATCH-1440 - Deprecated 
passwordFile attribute in sslProfile and m…
URL: https://github.com/apache/qpid-dispatch/pull/582#discussion_r332507603
 
 

 ##########
 File path: src/connection_manager.c
 ##########
 @@ -107,31 +107,39 @@ static qd_config_ssl_profile_t 
*qd_find_ssl_profile(qd_connection_manager_t *cm,
  * Read the file from the password_file location on the file system and 
populate password_field with the
  * contents of the file.
  */
-static void qd_set_password_from_file(char *password_file, char 
**password_field)
+static void qd_set_password_from_file(char *password_file, char 
**password_field, qd_log_source_t *log_source)
 {
     if (password_file) {
         FILE *file = fopen(password_file, "r");
 
-        if (file) {
-            char buffer[200];
+        if (file == NULL) {
+            //
+            // The global variable errno (found in <errno.h>) contains 
information about what went wrong; you can use perror() to print that 
information as a readable string
+            //
+            qd_log(log_source, QD_LOG_WARNING, "Unable to open password file  
%s", password_file);
 
 Review comment:
   I'd recommend including the output of "strerror(errno)" in the log file and 
remove the perror stuff (no stderr if in daemon mode):
   
   qd_log(log_source, QD_LOG_WARNING, "Unable to open password file  %s, error: 
%s", password_file, strerror(errno));
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to