More help information and better diagnostics.
[egate.git] / kernel / urp.c
index 3ca6e5f..92a4b36 100644 (file)
  * Europagate, 1995
  *
  * $Log: urp.c,v $
- * Revision 1.40  1995/05/23 08:13:00  adam
+ * Revision 1.41  1995/07/03 08:20:18  adam
+ * More help information and better diagnostics.
+ *
+ * Revision 1.40  1995/05/23  08:13:00  adam
  * Minor changes.
  *
  * Revision 1.39  1995/05/22  14:57:30  adam
    Todo:
      info/status (other name?)
      better persistence diagnostics
-     resource gw.path - use chdir call instead
 
    Optional:
      automatic information about target-aliases: name, query-support, etc.
@@ -377,6 +379,12 @@ static int exec_help (struct ccl_token *list)
     put_esc_str (gw_res_get (info.kernel_res, "gw.help.show",
                              "show <spec>    - retrieves and displays "
                              "records\n"));
+    put_esc_str (sep);
+    put_esc_str (gw_res_get (info.kernel_res, "gw.help.def",
+                             "def <setting> <value> sets/gets definitons\n"));
+    put_esc_str (sep);
+    put_esc_str (gw_res_get (info.kernel_res, "gw.help.account",
+                             "account <str>    sets authentication string\n"));
     return 0;
 }
 
@@ -447,7 +455,7 @@ static int exec_find (struct ccl_token *list, const char *search_str)
     {
         fprintf (reply_fd, "%s\n",
                  gw_res_get (info.kernel_res, "gw.err.search.fail",
-                             "Search fail. Connection closed"));
+                             "Search fail."));
         return -1;
     }
     if (p->errcode != -1)
@@ -573,7 +581,6 @@ static void present (const char *set, int offset, int number,
     {
         int i;
         zass_record *pp;
-        char path[128];
         int  record_log_fd = -1;
         const char *record_log_name;
 
@@ -581,12 +588,11 @@ static void present (const char *set, int offset, int number,
                                       NULL);
         if (record_log_name)
         {
-            sprintf (path, "%s/%s", gw_res_get (info.kernel_res,
-                                                "gw.path", "."),
-                     record_log_name );
-            record_log_fd = open (path, O_WRONLY|O_CREAT|O_APPEND, 0666);
+            record_log_fd = open (record_log_name, 
+                                  O_WRONLY|O_CREAT|O_APPEND, 0666);
             if (record_log_fd == -1)
-                gw_log (GW_LOG_WARN|GW_LOG_ERRNO, "Cannot open %s", path);
+                gw_log (GW_LOG_WARN|GW_LOG_ERRNO, "Cannot open %s", 
+                        record_log_name);
         }
         fprintf (reply_fd, gw_res_get (info.kernel_res,
                                        "gw.msg.records",
@@ -884,9 +890,7 @@ static int exec_def (struct ccl_token *list)
 
     if (info.userid < 0)
         return -1;
-    sprintf (fname, "%s/user.%d.r", gw_res_get (info.kernel_res,
-                                                "gw.path", "."),
-             info.userid);
+    sprintf (fname, "user.%d.r", info.userid);
 
     if (list->kind == CCL_TOK_EOL) 
         show_def ();