projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f347eed
)
IdPass authentication.
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 28 Jan 2002 09:25:38 +0000
(09:25 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 28 Jan 2002 09:25:38 +0000
(09:25 +0000)
client/client.c
patch
|
blob
|
history
diff --git
a/client/client.c
b/client/client.c
index
e27a246
..
9980c11
100644
(file)
--- a/
client/client.c
+++ b/
client/client.c
@@
-2,7
+2,7
@@
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.136 2002-01-23 22:40:36 adam Exp $
+ * $Id: client.c,v 1.137 2002-01-28 09:25:38 adam Exp $
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-340,7
+340,9
@@
int cmd_open(char *arg)
int cmd_authentication(char *arg)
{
static Z_IdAuthentication au;
int cmd_authentication(char *arg)
{
static Z_IdAuthentication au;
- static char open[256];
+ static char user[40], group[40], pass[40];
+ static Z_IdPass idPass;
+ int r;
if (!*arg)
{
if (!*arg)
{
@@
-348,10
+350,27
@@
int cmd_authentication(char *arg)
auth = 0;
return 1;
}
auth = 0;
return 1;
}
- auth = &au;
- au.which = Z_IdAuthentication_open;
- au.u.open = open;
- strcpy(open, arg);
+ r = sscanf (arg, "%39s %39s %39s", user, group, pass);
+ if (r == 0)
+ {
+ printf("Auth field set to null\n");
+ auth = 0;
+ }
+ if (r == 1)
+ {
+ auth = &au;
+ au.which = Z_IdAuthentication_open;
+ au.u.open = user;
+ }
+ if (r == 3)
+ {
+ auth = &au;
+ au.which = Z_IdAuthentication_idPass;
+ au.u.idPass = &idPass;
+ idPass.groupId = group;
+ idPass.userId = user;
+ idPass.password = pass;
+ }
return 1;
}
return 1;
}
@@
-2290,7
+2309,7
@@
int main(int argc, char **argv)
case 0:
if (!open_command)
{
case 0:
if (!open_command)
{
- open_command = xmalloc (strlen(arg)+6);
+ open_command = (char *) xmalloc (strlen(arg)+6);
strcpy (open_command, "open ");
strcat (open_command, arg);
}
strcpy (open_command, "open ");
strcat (open_command, arg);
}
@@
-2321,7
+2340,7
@@
int main(int argc, char **argv)
case 'u':
if (!auth_command)
{
case 'u':
if (!auth_command)
{
- auth_command = xmalloc (strlen(arg)+6);
+ auth_command = (char *) xmalloc (strlen(arg)+6);
strcpy (auth_command, "auth ");
strcat (auth_command, arg);
}
strcpy (auth_command, "auth ");
strcat (auth_command, arg);
}
@@
-2332,7
+2351,7
@@
int main(int argc, char **argv)
default:
fprintf (stderr, "Usage: %s [-m <marclog>] [ -a <apdulog>] "
"[-c cclfields]\n [-p <proxy-addr>] [-u <auth>] "
default:
fprintf (stderr, "Usage: %s [-m <marclog>] [ -a <apdulog>] "
"[-c cclfields]\n [-p <proxy-addr>] [-u <auth>] "
- "[<server-addr>]\n",
+ "[-k size] [<server-addr>]\n",
prog);
exit (1);
}
prog);
exit (1);
}