You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2011/07/15 16:45:53 UTC

svn commit: r1147168 - /trafficserver/traffic/trunk/cop/TrafficCop.cc

Author: amc
Date: Fri Jul 15 14:45:52 2011
New Revision: 1147168

URL: http://svn.apache.org/viewvc?rev=1147168&view=rev
Log:
Fix for TS-881 - better error message from TrafficCop when admin user lookup fails.

Modified:
    trafficserver/traffic/trunk/cop/TrafficCop.cc

Modified: trafficserver/traffic/trunk/cop/TrafficCop.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/cop/TrafficCop.cc?rev=1147168&r1=1147167&r2=1147168&view=diff
==============================================================================
--- trafficserver/traffic/trunk/cop/TrafficCop.cc (original)
+++ trafficserver/traffic/trunk/cop/TrafficCop.cc Fri Jul 15 14:45:52 2011
@@ -185,17 +185,19 @@ chown_file_to_user(const char *file, con
         uid = (int)geteuid();
       }
       pwd = getpwuid((uid_t)uid);
-    }
-    else {
+    } else {
       pwd = getpwnam(user);
     }
-  }
-  if (pwd) {
-    if (chown(file, pwd->pw_uid, pwd->pw_gid) < 0) {
-      //cop_log(COP_FATAL, "cop couldn't chown the  file: %s\n", file);
+
+    if (pwd) {
+      if (chown(file, pwd->pw_uid, pwd->pw_gid) < 0) {
+        //cop_log(COP_FATAL, "cop couldn't chown the  file: %s\n", file);
+      }
+    } else {
+      cop_log(COP_FATAL, "can't get passwd entry for the admin user '%s' - [%d] %s\n", user, errno, strerror(errno));
     }
   } else {
-    cop_log(COP_FATAL, "can't get passwd entry for the admin user\n");
+    cop_log(COP_FATAL, "Admin user was the empty string.\n");
   }
 }
 static void