Skip to content

Commit

Permalink
Treat an empty cookie (null string) as undefined
Browse files Browse the repository at this point in the history
This allows bootstrapping a cookie file. Initially do:
  echo '' > cookie-file

In the setup script, write the received cookie value to the
cookie file, so it will be used next time the VPN is started.

Signed-off-by: Nick Andrew <nick@nick-andrew.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
nickandrew authored and David Woodhouse committed Oct 26, 2008
1 parent ce35151 commit 3740ed3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.c
Expand Up @@ -179,6 +179,10 @@ int main(int argc, char **argv)
break;
case '4':
read_stdin(&vpninfo->cookie);
/* If the cookie is empty, ignore it */
if (! *vpninfo->cookie) {
vpninfo->cookie = NULL;
}
break;
case '5':
read_stdin(&vpninfo->password);
Expand Down

0 comments on commit 3740ed3

Please sign in to comment.