Extended auth command so that NULL User, pass may be set.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 29 Oct 2007 09:16:32 +0000 (09:16 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 29 Oct 2007 09:16:32 +0000 (09:16 +0000)
This is to solve bug #1820.

client/client.c

index 59c48a0..53c241b 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
  * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.351 2007-08-24 13:25:14 adam Exp $
+ * $Id: client.c,v 1.352 2007-10-29 09:16:32 adam Exp $
  */
 /** \file client.c
  *  \brief yaz-client program
  */
 /** \file client.c
  *  \brief yaz-client program
@@ -844,8 +844,8 @@ int cmd_authentication(const char *arg)
         au.which = Z_IdAuthentication_idPass;
         au.u.idPass = &idPass;
         idPass.groupId = NULL;
         au.which = Z_IdAuthentication_idPass;
         au.u.idPass = &idPass;
         idPass.groupId = NULL;
-        idPass.userId = user;
-        idPass.password = group;
+        idPass.userId = !strcmp(user, "-") ? 0 : user;
+        idPass.password = !strcmp(group, "-") ? 0 : group;
         printf("Authentication set to User (%s), Pass (%s)\n", user, group);
     }
     if (r == 3)
         printf("Authentication set to User (%s), Pass (%s)\n", user, group);
     }
     if (r == 3)