]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Backed out AUTO_USERID feature introduced in r1436.
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Fri, 10 Nov 2006 10:22:48 +0000 (10:22 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Fri, 10 Nov 2006 10:22:48 +0000 (10:22 +0000)
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1449 e7ae566f-a301-0410-adde-c780ea21d3b5

config-win32.h.in
misc.c
tun.c
tun.h

index fcf4b69fc7200841418fcdefe0618945ba1d6093..502c6aebc05b76298a518831907a534fe76ad393 100644 (file)
@@ -65,9 +65,6 @@ typedef unsigned long in_addr_t;
 /* Allow --askpass and --auth-user-pass passwords to be read from a file */
 /* #undef ENABLE_PASSWORD_SAVE */
 
-/* Enable AUTO_USERID feature */
-/* #define AUTO_USERID */
-
 /* Enable client/server capability */
 #define ENABLE_CLIENT_SERVER 1
 
diff --git a/misc.c b/misc.c
index 161b9e40ad34471d8d9172af317de36b3d3a3453..f02385ae2fa6baf7f21155cadb67d4fe67bbc3ad 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1285,11 +1285,6 @@ get_user_pass (struct user_pass *up,
                msg (M_FATAL, "Error reading username and password (must be on two consecutive lines) from %s authfile: %s",
                     prefix,
                     auth_file);
-
-#if defined(AUTO_USERID) && defined(WIN32)
-             if (!strncmp (up->username, "AUTO_USERID", 11))
-               get_auto_userid (up->username, USER_PASS_LEN);
-#endif
            }
       
          fclose (fp);
diff --git a/tun.c b/tun.c
index abfd760ed5c7f5b07d033a42f1a613b19f5020c0..f0c2d49440de4413e8dcdb616750de5ebdc3684d 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -62,7 +62,7 @@ static void netsh_ifconfig (const struct tuntap_options *to,
                            const in_addr_t netmask,
                            unsigned int flags);
 
-static const char *netsh_get_id (const char *dev_node, const bool force_guid, struct gc_arena *gc);
+static const char *netsh_get_id (const char *dev_node, struct gc_arena *gc);
 
 #endif
 
@@ -144,7 +144,7 @@ guess_tuntap_dev (const char *dev,
   const int dt = dev_type_enum (dev, dev_type);
   if (dt == DEV_TYPE_TUN || dt == DEV_TYPE_TAP)
     {
-      return netsh_get_id (dev_node, false, gc);
+      return netsh_get_id (dev_node, gc);
     }
 #endif
 
@@ -3391,7 +3391,7 @@ netsh_enable_dhcp (const struct tuntap_options *to,
  * Return a TAP name for netsh commands.
  */
 static const char *
-netsh_get_id (const char *dev_node, const bool force_guid, struct gc_arena *gc)
+netsh_get_id (const char *dev_node, struct gc_arena *gc)
 {
   const struct tap_reg *tap_reg = get_tap_reg (gc);
   const struct panel_reg *panel_reg = get_panel_reg (gc);
@@ -3414,46 +3414,12 @@ netsh_get_id (const char *dev_node, const bool force_guid, struct gc_arena *gc)
 
   if (!guid)
     return "NULL";         /* not found */
-  else if (!force_guid && strcmp (BPTR (&actual), "NULL"))
+  else if (strcmp (BPTR (&actual), "NULL"))
     return BPTR (&actual); /* control panel name */
   else
     return guid;           /* no control panel name, return GUID instead */
 }
 
-#ifdef AUTO_USERID
-
-static const char *
-debrace (const char *str, struct gc_arena *gc)
-{
-  char *s = string_alloc (str, gc);
-  int l;
-  if (*s == '{')
-    ++s;
-  l = strlen (s);
-  if (l > 0)
-    {
-      char *e = s + (l - 1);
-      if (*e == '}')
-       *e = '\0';
-    }
-  return s;
-}
-
-void
-get_auto_userid (char *username, const int capacity)
-{
-  struct gc_arena gc = gc_new ();
-  const char *nid = netsh_get_id (NULL, true, &gc);
-  if (nid && strcmp (nid, "NULL") && strlen (nid) > 3)
-    {
-      const char *nid1 = debrace (nid, &gc);
-      openvpn_snprintf (username, capacity, "W%s", nid1);
-    }
-  gc_free (&gc);
-}
-
-#endif
-
 /*
  * Called iteratively on TAP-Win32 wait-for-initialization polling loop
  */
diff --git a/tun.h b/tun.h
index 4d66533459326bf8df9349fc79de091c332aa0a8..1bf17fa3f3dd70a59a4bf65763db594409299241 100644 (file)
--- a/tun.h
+++ b/tun.h
@@ -332,8 +332,6 @@ int tun_read_queue (struct tuntap *tt, int maxsize);
 int tun_write_queue (struct tuntap *tt, struct buffer *buf);
 int tun_finalize (HANDLE h, struct overlapped_io *io, struct buffer *buf);
 
-void get_auto_userid (char *username, const int capacity);
-
 static inline bool
 tuntap_stop (int status)
 {