trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r990206 - /trafficserver/traffic/trunk/proxy/Main.cc
Date Fri, 27 Aug 2010 16:56:50 GMT
Author: zwoop
Date: Fri Aug 27 16:56:50 2010
New Revision: 990206

URL: http://svn.apache.org/viewvc?rev=990206&view=rev
Log:
TS-410 TS fails to use user ID with user name longer than 8 characters

Author: Yakov Markovitch
Review: Leif
Tested: Fedora Core 13 / 64-bit

Modified:
    trafficserver/traffic/trunk/proxy/Main.cc

Modified: trafficserver/traffic/trunk/proxy/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Main.cc?rev=990206&r1=990205&r2=990206&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Main.cc (original)
+++ trafficserver/traffic/trunk/proxy/Main.cc Fri Aug 27 16:56:50 2010
@@ -2188,7 +2188,9 @@ main(int argc, char **argv)
   }
 
   // change the user of the process
-  char user[_POSIX_LOGIN_NAME_MAX] = "\0";
+  const long MAX_LOGIN = sysconf(_SC_LOGIN_NAME_MAX);
+  char user[MAX_LOGIN <= 0 ? _POSIX_LOGIN_NAME_MAX : MAX_LOGIN];
+  *user = '\0';
   if ((TS_ReadConfigString(user, "proxy.config.admin.user_id",
                            sizeof(user)) == REC_ERR_OKAY) &&
                            user[0] != '\0' &&



Mime
View raw message