cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] Changes to ccvs/src/main.c


From: Derek Robert Price
Subject: [Cvs-cvs] Changes to ccvs/src/main.c
Date: Sun, 11 Sep 2005 22:43:12 -0400

Index: ccvs/src/main.c
diff -u ccvs/src/main.c:1.253 ccvs/src/main.c:1.254
--- ccvs/src/main.c:1.253       Tue Sep  6 04:35:22 2005
+++ ccvs/src/main.c     Mon Sep 12 02:43:10 2005
@@ -798,6 +798,23 @@
                       CVSUMASK_ENV, cp);
        }
 
+       /* HOSTNAME & SERVER_HOSTNAME need to be set before they are
+        * potentially used in gserver_authenticate_connection() (called from
+        * pserver_authenticate_connection, below).
+        */
+       hostname = xgethostname ();
+       if (!hostname)
+       {
+            error (0, errno,
+                   "xgethostname () returned NULL, using \"localhost\"");
+            hostname = xstrdup ("localhost");
+       }
+
+       /* Keep track of this separately since the client can change
+        * HOSTNAME on the server.
+        */
+       server_hostname = xstrdup (hostname);
+
 #ifdef SERVER_SUPPORT
 
 # ifdef HAVE_KERBEROS
@@ -814,7 +831,6 @@
        }
 # endif /* HAVE_KERBEROS */
 
-
 # if defined (AUTH_SERVER_SUPPORT) || defined (HAVE_GSSAPI)
        if (strcmp (cvs_cmd_name, "pserver") == 0)
        {
@@ -863,21 +879,6 @@
 
        /* make sure we clean up on error */
        signals_register (main_cleanup);
-
-       hostname = xgethostname ();
-       if (hostname == NULL)
-       {
-            error (0, errno,
-                   "xgethostname () returned NULL, using \"localhost\"");
-            hostname = xstrdup ("localhost");
-            
-       }
-
-       /* Keep track of this separately since the client can change
-        * HOSTNAME on the server.
-        */
-       server_hostname = xstrdup (hostname);
-
 
 #ifdef KLUDGE_FOR_WNT_TESTSUITE
        /* Probably the need for this will go away at some point once




reply via email to

[Prev in Thread] Current Thread [Next in Thread]