* Europagate, 1995
*
* $Log: kernel.h,v $
- * Revision 1.14 1995/04/19 10:46:18 adam
+ * Revision 1.15 1995/04/19 13:19:08 adam
+ * New command: account - for authentication.
+ *
+ * Revision 1.14 1995/04/19 10:46:18 adam
* Persistency works much better now. New command: status - history-like
*
* Revision 1.13 1995/04/19 07:31:04 adam
const char *override_res;
char target[128];
char hostname[128];
+ char account[128];
int port;
const char *lang;
const char *override_portno;
* Europagate, 1995
*
* $Log: main.c,v $
- * Revision 1.17 1995/04/19 10:46:18 adam
+ * Revision 1.18 1995/04/19 13:19:09 adam
+ * New command: account - for authentication.
+ *
+ * Revision 1.17 1995/04/19 10:46:18 adam
* Persistency works much better now. New command: status - history-like
*
* Revision 1.16 1995/04/19 07:31:07 adam
info.default_res = "default.res";
info.override_res = NULL;
*info.target = 0;
+ *info.account = 0;
info.lang = NULL;
info.bibset = NULL;
info.zass = NULL;
if (*info.target && ! gw_res_get (info.kernel_res, resource_name, NULL))
{
/* target is there, and there is no sub-resource for it... */
- char *split;
+ const char *split;
if ((split = strchr (info.target, ':')))
- *split++ = '\0';
- strncpy (info.hostname, info.target, sizeof(info.hostname)-1);
- if (split)
- info.port = atoi (split);
+ {
+ memcpy (info.hostname, info.target, split-info.target);
+ info.hostname[split-info.target] = '\0';
+ info.port = atoi (split+1);
+ }
else
+ {
+ strcpy (info.hostname, info.target);
info.port = atoi (gw_res_get
(info.kernel_res, "gw.portno", "210"));
+ }
}
else
{
* Europagate, 1995
*
* $Log: persist.c,v $
- * Revision 1.2 1995/04/19 10:46:19 adam
+ * Revision 1.3 1995/04/19 13:19:09 adam
+ * New command: account - for authentication.
+ *
+ * Revision 1.2 1995/04/19 10:46:19 adam
* Persistency works much better now. New command: status - history-like
*
* Revision 1.1 1995/04/19 07:31:10 adam
if (!fgetsx (fline, 1024, inf))
return -1;
+ if (sscanf (fline, "%s", info.account) != 1)
+ *info.account = '\0';
+
+ if (!fgetsx (fline, 1024, inf))
+ return -1;
free (info.database);
info.database = gw_strdup (fline);
return -1;
}
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Writing persistence file %s", fname);
- fprintf (of, "%s\n%s\n%d\n", info.target, info.database, info.setno);
+ fprintf (of, "%s\n%s\n%s\n%d\n", info.target, info.account,
+ info.database, info.setno);
save_sets (of, info.sets);
fclose (of);
return 0;
* Europagate, 1995
*
* $Log: urp.c,v $
- * Revision 1.27 1995/04/19 10:46:19 adam
+ * Revision 1.28 1995/04/19 13:19:09 adam
+ * New command: account - for authentication.
+ *
+ * Revision 1.27 1995/04/19 10:46:19 adam
* Persistency works much better now. New command: status - history-like
*
* Revision 1.26 1995/04/19 07:31:12 adam
if (info.zass)
gw_log (GW_LOG_WARN, KERNEL_LOG, "Zass free...");
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "reopen_target");
- info.zass = zass_open (info.hostname, info.port);
+ info.zass = zass_open (info.hostname, info.port, *info.account ?
+ info.account : NULL);
if (!info.zass)
{
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Cannot connect to target %s:%d",
{ "cancel", "cancel" },
{ "target", "target" },
{ "stop", "stop" },
+{ "account", "account" },
{ NULL, NULL }
};
return 0;
}
+static int exec_account (struct ccl_token *list)
+{
+ if (list->kind != CCL_TOK_EOL)
+ {
+ int len = list->len;
+ memcpy (info.account, list->name, len);
+ info.target[len] = '\0';
+ }
+ else
+ *info.account = '\0';
+ return 0;
+}
+
static int exec_target (struct ccl_token *list)
{
int len;
if (cmd->kind != CCL_TOK_EOL &&
(no = command_search (command_tab, cmd, "ccl.command.")))
{
- if (!info.zass && no != 9 && no != 4)
+ if (!info.zass && no != 9 && no != 4 && no != 11 && no != 7)
reopen_target ();
fprintf (reply_fd, "\n> %s\n", str);
if (!info.zass && (no == 1 || no == 2 || no == 3))
return exec_status (cmd->next);
case 9:
return exec_target (cmd->next);
+ case 11:
+ return exec_account (cmd->next);
default:
fprintf (reply_fd, "%s\n",
gw_res_get (info.kernel_res, "gw.err.unimplemented",