New command: account - for authentication.
[egate.git] / kernel / persist.c
index 219024f..34263b1 100644 (file)
@@ -2,7 +2,10 @@
  * 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
@@ -224,6 +227,11 @@ int load_p_state (int userid)
 
     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);
 
@@ -319,7 +327,8 @@ int save_p_state (int userid)
         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;