trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1147168 - /trafficserver/traffic/trunk/cop/TrafficCop.cc
Date Fri, 15 Jul 2011 14:45:53 GMT
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



Mime
View raw message