]> andersk Git - moira.git/blobdiff - clients/moira/attach.c
Added some casts for ANSI standard.
[moira.git] / clients / moira / attach.c
index 58522cd18b6d383c4961d42db5b680700f3ce9e8..569362065878ccc121aeef90ab85bb725c5308b1 100644 (file)
@@ -1,22 +1,21 @@
-#ifndef lint
+#if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
-/*     This is the file attach.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
+/*     This is the file attach.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
  *     It Contains: Functions for maintaining data used by Hesiod 
  *                   to map courses/projects/users to their file systems, 
  *                   and maintain filesys info. 
  *     
  *     Created:        5/4/88
  *     By:             Chris D. Peterson
- *      Based Upon:     attach.c 87/07/24 marcus
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -28,8 +27,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
 #define GROUP        2
 #define ALIAS        3
 
+#define DEFAULT_TYPE     ("NFS")
+#define DEFAULT_MACHINE  DEFAULT_NONE
+#define DEFAULT_PACK     DEFAULT_NONE
+#define DEFAULT_M_POINT  DEFAULT_NONE
+#define DEFAULT_ACCESS   ("r")
+#define DEFAULT_COMMENTS DEFAULT_COMMENT
+#define DEFAULT_OWNER    (user)
+#define DEFAULT_OWNERS   (user)
+#define DEFAULT_CREATE   DEFAULT_YES
+#define DEFAULT_L_TYPE   ("HOMEDIR")
+
+/*     Function Name: SetDefaults
+ *     Description: sets the default values for filesystem additions.
+ *     Arguments: info - an array of char pointers to recieve defaults. 
+ *     Returns: char ** (this array, now filled).
+ */
+
+static char ** 
+SetDefaults(info, name)
+char ** info;
+char * name;
+{
+    info[FS_NAME] =     Strsave(name);
+    info[FS_TYPE] =     Strsave(DEFAULT_TYPE);
+    info[FS_MACHINE] =  Strsave(DEFAULT_MACHINE);
+    info[FS_PACK] =     Strsave(DEFAULT_PACK);
+    info[FS_M_POINT] =  Strsave(DEFAULT_M_POINT);
+    info[FS_ACCESS] =   Strsave(DEFAULT_ACCESS);
+    info[FS_COMMENTS] = Strsave(DEFAULT_COMMENTS);
+    info[FS_OWNER] =    Strsave(DEFAULT_OWNER);
+    info[FS_OWNERS] =   Strsave(DEFAULT_OWNERS);
+    info[FS_CREATE] =   Strsave(DEFAULT_CREATE);
+    info[FS_L_TYPE] =   Strsave(DEFAULT_L_TYPE);
+    info[FS_MODTIME] = info[FS_MODBY] = info[FS_MODWITH] = info[FS_END] = NULL;
+    return(info);
+}
+
 /*     Function Name: GetFSInfo
  *     Description: Stores the info in a queue.
  *     Arguments: type - type of information to get.
  *     Returns: a pointer to the first element in the queue.
  */
 
-struct qelem *
+static struct qelem *
 GetFSInfo(type, name)
 int type;
 char *name;
 {
     int stat;
     struct qelem * elem = NULL;
-    char * args[2];
+    char * args[5];
 
     switch (type) {
     case LABEL:
        if ( (stat = sms_query("get_filesys_by_label", 1, &name,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
        break;
     case MACHINE:
        if ( (stat = sms_query("get_filesys_by_machine", 1, &name,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
        break;
     case GROUP:
        if ( (stat = sms_query("get_filesys_by_group", 1, &name,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
        break;
     case ALIAS:
-       args[0] = name;
-       args[1] = FS_ALIAS_TYPE;
-       if ( (stat = sms_query("get_alias", 2, args, StoreInfo, &elem)) != 0) {
+       args[ALIAS_NAME] = name;
+       args[ALIAS_TYPE] = FS_ALIAS_TYPE;
+       args[ALIAS_TRANS] = "*";
+       if ( (stat = sms_query("get_alias", 3, args, StoreInfo, 
+                              (char *) &elem)) != 0) {
            com_err(program_name, stat, " in get_alias.");
            return(NULL);
        }
@@ -90,59 +128,58 @@ char *name;
     return(QueueTop(elem));
 }
 
+/*     Function Name: PrintFSAlias
+ *     Description: Prints a filesystem alias
+ *     Arguments: info - an array contains the strings of info.
+ *     Returns: the name of the filesys - used be QueryLoop().
+ */
+
+static char *
+PrintFSAlias(info)
+char ** info;
+{
+    char buf[BUFSIZ];
+
+    sprintf(buf,"Alias: %-25s Filesystem: %s",info[ALIAS_NAME], 
+           info[ALIAS_TRANS]);
+    Put_message(buf);
+    return(info[ALIAS_NAME]);
+}
+
 /*     Function Name: PrintFSInfo
  *     Description: Prints the filesystem information.
  *     Arguments: info - a pointer to the filesystem information.
  *     Returns: none.
  */
 
-void
+static char *
 PrintFSInfo(info)
 char ** info;
 {
     char print_buf[BUFSIZ];
-    sprintf(print_buf,"Information about filesystem: %s", info[FS_NAME]);
+    FORMFEED;
+    sprintf(print_buf,"%20s Filesystem: %s", 
+           " ",info[FS_NAME]);
     Put_message(print_buf);
-    sprintf(print_buf,"Type: %s\t\tMachine: %s\t\tPackname: %s",info[FS_TYPE],
-           info[FS_MACHINE], info[FS_PACK]);
+    sprintf(print_buf,"Type: %-40s Machine: %-15s",
+           info[FS_TYPE], info[FS_MACHINE]);
     Put_message(print_buf);
-    sprintf(print_buf,"Mountpoint %s\t\t Default Access: %s",info[FS_M_POINT],
-           info[FS_ACCESS]);
+    sprintf(print_buf,"Default Access: %-2s Packname: %-17s Mountpoint %s ",
+           info[FS_ACCESS], info[FS_PACK], info[FS_M_POINT]);
     Put_message(print_buf);
     sprintf(print_buf,"Comments; %s",info[FS_COMMENTS]);
     Put_message(print_buf);
-    sprintf(print_buf, "User Ownership: %s,\t\tGroup Ownership:\t\t%s",
+    sprintf(print_buf, "User Ownership: %-30s Group Ownership: %s",
            info[FS_OWNER], info[FS_OWNERS]);
     Put_message(print_buf);
-    sprintf(print_buf, "Auto Create %s\t\tLocker Type: %s",info[FS_CREATE], 
+    sprintf(print_buf, "Auto Create: %-34s Locker Type: %s",
+           atoi(info[FS_CREATE]) ? "ON" : "OFF", 
            info[FS_L_TYPE]);
     Put_message(print_buf);
-    sprintf(print_buf, "Last Modified at %s, by %s with %s",info[FS_MODTIME],
-           info[FS_MODBY], info[FS_MODWITH]);
+    sprintf(print_buf, MOD_FORMAT, info[FS_MODBY], info[FS_MODTIME], 
+           info[FS_MODWITH]);
     Put_message(print_buf);
-}
-
-/*     Function Name: PrintAllFSInfo
- *     Description: Prints all infomation about a filesystem, stored in
- *                   a queue.
- *     Arguments: elem - a pointer to the first elem in the queue.
- *     Returns: none.
- */
-
-void
-PrintAllFSInfo(elem)
-struct qelem * elem;
-{
-/* 
- * Not nescessary, but makes it clear that we are not changing this value.
- */
-    struct qelem * local = elem;       
-                               
-    while(local != NULL) {
-       char ** info = (char **) local->q_data;
-       PrintFSInfo(info);
-       local = local->q_forw;
-    }
+    return(info[FS_NAME]);
 }
 
 /*     Function Name: AskFSInfo.
@@ -154,33 +191,39 @@ struct qelem * elem;
  *     Returns: none.
  */
 
-char **
+static char **
 AskFSInfo(info, name)
 char ** info;
 Bool name;
 {
     char temp_buf[BUFSIZ], *newname;
 
-    sprintf(temp_buf, "\nChanging Attributes of user %s.\n", info[FS_NAME]);
+    Put_message("");
+    sprintf(temp_buf, "Changing Attributes of filesystem %s.", 
+           info[FS_NAME]);
     Put_message(temp_buf);
+    Put_message("");
 
     if (name) {
        newname = Strsave(info[FS_NAME]);
-       GetValueFromUser("The new login name for this filesystem.",
+       GetValueFromUser("The new name for this filesystem",
                         &newname);
     }
 
-    GetValueFromUser("Filesystem's Type:", &info[FS_TYPE]);
-    GetValueFromUser("Filesystem's Machine:", &info[FS_MACHINE]);
-    GetValueFromUser("Filesystem's Pack Name:", &info[FS_PACK]);
-    GetValueFromUser("Filesystem's Mount Point:", &info[FS_M_POINT]);
-    GetValueFromUser("Filesystem's Default Access:", &info[FS_ACCESS]);
-    GetValueFromUser("Commants about this Filesystem:", &info[FS_COMMENTS]);
-    GetValueFromUser("Filesystem's owner (user):", &info[FS_OWNER]);
-    GetValueFromUser("Filesystem's owners (group):", &info[FS_OWNERS]);
-    GetValueFromUser("Automatically create this filsystem (0/1):",
-                    &info[FS_COMMENTS]);
-    GetValueFromUser("Filesystem's lockertype:", &info[FS_L_TYPE]);
+    GetValueFromUser("Filesystem's Type", &info[FS_TYPE]);
+    GetValueFromUser("Filesystem's Machine", &info[FS_MACHINE]);
+    strcpy(temp_buf, CanonicalizeHostname(info[FS_MACHINE]));
+    free(info[FS_MACHINE]);
+    info[FS_MACHINE] = Strsave(temp_buf);
+    GetValueFromUser("Filesystem's Pack Name", &info[FS_PACK]);
+    GetValueFromUser("Filesystem's Mount Point", &info[FS_M_POINT]);
+    GetValueFromUser("Filesystem's Default Access", &info[FS_ACCESS]);
+    GetValueFromUser("Comments about this Filesystem", &info[FS_COMMENTS]);
+    GetValueFromUser("Filesystem's owner (user)", &info[FS_OWNER]);
+    GetValueFromUser("Filesystem's owners (group)", &info[FS_OWNERS]);
+    GetYesNoValueFromUser("Automatically create this filsystem",
+                    &info[FS_CREATE]);
+    GetValueFromUser("Filesystem's lockertype", &info[FS_L_TYPE]);
 
     FreeAndClear(&info[FS_MODTIME], TRUE);
     FreeAndClear(&info[FS_MODBY], TRUE);
@@ -206,14 +249,47 @@ GetFS(argc, argv)
 int argc;
 char **argv;
 {
-    struct qelem *elem;
+    struct qelem *top;
 
-    elem = GetFSInfo(LABEL, argv[1]); /* get info. */
-    PrintAllFSInfo(elem);      /* print it all. */
-    FreeQueue(elem);           /* clean the queue. */
+    top = GetFSInfo(LABEL, argv[1]); /* get info. */
+    Loop(top, (void *) PrintFSInfo);
+    FreeQueue(top);            /* clean the queue. */
     return (DM_NORMAL);
 }
 
+/*     Function Name: RealDeleteFS
+ *     Description: Does the real deletion work.
+ *     Arguments: info - array of char *'s containing all useful info.
+ *                 one_item - a Boolean that is true if only one item 
+ *                              in queue that dumped us here.
+ *     Returns: none.
+ */
+
+void
+RealDeleteFS(info, one_item)
+char ** info;
+Bool one_item;
+{
+    int stat;
+    char temp_buf[BUFSIZ];
+
+/* 
+ * Deletetions are  performed if the user hits 'y' on a list of multiple 
+ * filesystem, or if the user confirms on a unique alias.
+ */
+    sprintf(temp_buf, "Are you sure that you want to delete filesystem %s",
+           info[FS_NAME]);
+    if(!one_item || Confirm(temp_buf)) {
+       if ( (stat = sms_query("delete_filesys", 1,
+                              &info[FS_NAME], Scream, NULL)) != 0)
+           com_err(program_name, stat, " filesystem not deleted.");
+       else
+           Put_message("Filesystem deleted.");
+    }
+    else 
+       Put_message("Filesystem not deleted.");
+}
+
 /*     Function Name: DeleteFS
  *     Description: Delete a filesystem give its name.
  *     Arguments: argc, argv - argv[1] is the name of the filesystem.
@@ -227,65 +303,36 @@ DeleteFS(argc, argv)
 int argc;
 char **argv;
 {
-    int stat, answer, delete;
-    Bool one_filsys;
-    struct qelem *elem, *temp_elem;
-    
-    if ( (temp_elem = elem = GetFSInfo(LABEL, argv[1])) == 
-                                         (struct qelem *) NULL )
-       return(DM_NORMAL);
-/* 
- * 1) If there is no (zero) match then we exit immediately.
- * 2) If there is exactly 1 element then we ask for confirmation only if in
- *    verbose mode, via the Confirm function.  
- * 3) If there is more than 1 filesystem to be deleted then we ask
- *    about each one, and delete on yes only, and about if the user hits
- *    quit.
- */
-    one_filsys = (QueueCount(elem) == 1);
-    while (temp_elem != NULL) {
-       char **info = (char **) temp_elem->q_data;
-       
-       if (one_filsys) {
-           PrintFSInfo(info);
-       
-           answer = YesNoQuitQuestion("\nDelete this filesys?", FALSE); 
-           switch(answer) {
-           case TRUE:
-               delete = TRUE;
-               break;
-           case FALSE:
-               delete = FALSE;
-               break;
-           default:            /* Quit. */
-               Put_message("Aborting Delete Operation.");
-               FreeQueue(elem);
-               return(DM_NORMAL);
-           }
-       }
-       else
-           delete = 
-            Confirm("Are you sure that you want to delete this filsystem."); 
-/* 
- * Deletetions are  performed if the user hits 'y' on a list of multiple 
- * filesystem, or if the user confirms on a unique alias.
- */
-       if (delete) {
-           if ( (stat = sms_query("delete_filesys", 1,
-                                    &info[FS_NAME], Scream, NULL)) != 0)
-               com_err(program_name, stat, " filesystem not deleted.");
-           else
-               Put_message("Filesystem deleted.");
-       }
-       else 
-           Put_message("Filesystem not deleted.");
-       temp_elem = temp_elem->q_forw;
-    }
+    struct qelem *elem = GetFSInfo(LABEL, argv[1]);
+    QueryLoop(elem, PrintFSInfo, RealDeleteFS, "Delete the Filesystem");
 
-    FreeQueue(elem);           /* free all members of the queue. */
+    FreeQueue(elem);
     return (DM_NORMAL);
 }
 
+/*     Function Name: RealChangeFS
+ *     Description: performs the actual change to the filesys.
+ *     Arguments: info - the information 
+ *                 junk - an unused boolean.
+ *     Returns: none.
+ */
+
+/* ARGSUSED. */
+static void
+RealChangeFS(info, junk)
+char ** info;
+Bool junk;
+{
+    int stat;
+    char ** args = AskFSInfo(info, TRUE);
+
+    if ( (stat = sms_query("update_filesys", CountArgs(args), 
+                          args, NullFunc, NULL)) != 0)
+       com_err(program_name, stat, ", filesystem not updated");
+    else
+       Put_message("filesystem sucessfully updated.");
+}
+
 /*     Function Name: ChangeFS
  *     Description: change the information in a filesys record.
  *     Arguments: arc, argv - value of filsys in argv[1].
@@ -298,52 +345,9 @@ ChangeFS(argc, argv)
 char **argv;
 int argc;
 {
-    struct qelem *elem, *temp_elem;
-    int update, stat, answer;
-    Bool one_filsys;
-    char buf[BUFSIZ];
-    
-    elem = temp_elem = GetFSInfo(LABEL, argv[1]);
+    struct qelem *elem = GetFSInfo(LABEL, argv[1]);
+    QueryLoop(elem, NullPrint, RealChangeFS, "Update the Filesystem");
 
-/* 
- * This uses the same basic method as the deletion routine above.
- */
-
-    one_filsys = (QueueCount(elem) == 1);
-    while (temp_elem != NULL) {
-       char ** info = (char **) temp_elem->q_data;
-       if (one_filsys) {
-           sprintf(buf, "%s %s %s (y/n/q)? ", "Would you like to change the",
-                   "information about the filesystem:", 
-                   info[FS_NAME]);
-           info = (char **) temp_elem->q_data;
-           answer = YesNoQuitQuestion(buf, FALSE);
-           switch(answer) {
-           case TRUE:
-               update = TRUE;
-               break;
-           case FALSE:
-               update = FALSE;
-               break;
-           default:
-               Put_message("Aborting Operation.");
-               FreeQueue(elem);
-               return(DM_NORMAL);
-           }
-       }
-       else
-           update = TRUE;
-
-       if (update) {
-           char ** args = AskFSInfo(info, TRUE);
-           if ( (stat = sms_query("update_filesys", CountArgs(args), 
-                                  args, NullFunc, NULL)) != 0)
-               com_err(program_name, stat, " in filesystem not updated");
-           else
-               Put_message("filesystem sucessfully updated.");
-       }
-       temp_elem = temp_elem->q_forw;
-    }
     FreeQueue(elem);
     return (DM_NORMAL);
 }
@@ -361,7 +365,7 @@ char **argv;
 int argc;
 {
     char *info[MAX_ARGS_SIZE], **args;
-    int stat, count;
+    int stat;
 
     if ( !ValidName(argv[1]) )
        return(DM_NORMAL);
@@ -375,12 +379,10 @@ int argc;
        return(DM_NORMAL);
     } 
 
-    for (count = 0; count < 100; count++)
-       info[count] = NULL;
-    args = AskFSInfo(info, FALSE );
+    args = AskFSInfo(SetDefaults(info, argv[1]), FALSE );
 
-    if (stat = sms_query("add_filesys", CountArgs(args), args, 
-                        NullFunc, NULL) != 0)
+    if ( (stat = sms_query("add_filesys", CountArgs(args), args, 
+                        NullFunc, NULL)) != 0)
        com_err(program_name, stat, " in AddFS");
 
     FreeInfo(info);
@@ -403,19 +405,11 @@ GetFSAlias(argc, argv)
 int argc;
 char **argv;
 {
-    char **info, buf[BUFSIZ];
-    struct qelem *top, *elem;
-
-    top = elem = GetFSInfo(ALIAS, argv[1]);
-
-    while (elem != NULL) {
-       info = (char **) elem->q_data;
-       sprintf(buf,"Alias: %s\tFilesystem: %s",info[ALIAS_NAME], 
-               info[ALIAS_TRANS]);
-       Put_message(buf);
-       elem = elem->q_forw;
-    }
+    struct qelem *top;
 
+    top = GetFSInfo(ALIAS, argv[1]);
+    Put_message(" ");          /* blank line. */
+    Loop(top, (void *) PrintFSAlias);
     FreeQueue(top);
     return(DM_NORMAL);
 }
@@ -445,17 +439,19 @@ char **argv;
 
     args[ALIAS_NAME] = Strsave(argv[1]);
     args[ALIAS_TYPE] = Strsave(FS_ALIAS_TYPE);
+    args[ALIAS_TRANS] = Strsave("*");
 
 /*
  * Check to see if this alias already exists in the database, if so then
  * print out values, free memory used and then exit.
  */
 
-    if ( (stat = sms_query("get_alias", 2, args, StoreInfo, &elem)) == 0) {
-       top = elem;
+    if ( (stat = sms_query("get_alias", 3, args, StoreInfo, 
+                          (char *)&elem)) == 0) {
+       top = elem = QueueTop(elem);
        while (elem != NULL) {
            info = (char **) elem->q_data;          
-           sprintf(buf,"The alias: %s\tcurrently describes the filesystem %s",
+           sprintf(buf,"The alias: %s currently describes the filesystem %s",
                    info[ALIAS_NAME], info[ALIAS_TRANS]);
            Put_message(buf);
            elem = elem->q_forw;
@@ -478,6 +474,40 @@ char **argv;
     FreeInfo(args);
     return (DM_NORMAL);
 }
+    
+/*     Function Name: RealDeleteFSAlias
+ *     Description: Does the real deletion work.
+ *     Arguments: info - array of char *'s containing all useful info.
+ *                 one_item - a Boolean that is true if only one item 
+ *                              in queue that dumped us here.
+ *     Returns: none.
+ */
+
+void
+RealDeleteFSAlias(info, one_item)
+char ** info;
+Bool one_item;
+{
+    int stat;
+    char temp_buf[BUFSIZ];
+
+/* 
+ * Deletetions are  performed if the user hits 'y' on a list of multiple 
+ * filesystem, or if the user confirms on a unique alias.
+ */
+    sprintf(temp_buf, 
+           "Are you sure that you want to delete the filesystem alias %s",
+           info[ALIAS_NAME]);
+    if(!one_item || Confirm(temp_buf)) {
+       if ( (stat = sms_query("delete_alias", CountArgs(info),
+                              info, Scream, NULL)) != 0 )
+           com_err(program_name, stat, " filesystem alias not deleted.");
+       else
+           Put_message("Filesystem alias deleted.");
+    }
+    else 
+       Put_message("Filesystem alias not deleted.");
+}
 
 /*     Function Name: DeleteFSAlias
  *     Description: Delete an alias name for a filsystem
@@ -493,72 +523,10 @@ DeleteFSAlias(argc, argv)
 int argc;
 char **argv;
 {
-    register int stat;
-    char buf[BUFSIZ];
-    struct qelem *elem, *top;
-    Bool one_alias, delete;
-
-    if (!ValidName(argv[1]))
-       return(DM_NORMAL);
-
-    top = elem = GetFSInfo(ALIAS, argv[1]);
-
-/* 
- * 1) If there are no (zero) match in elements then we exit immediately.
- * 2) If there is exactly 1 element then we ask for confirmation only if in
- *    verbose mode, via the Confirm function.  
- * 3) If there is more than 1 filesystem alias to be deleted then we ask
- *    about each one, and delete on yes only, and about if the user hits
- *    quit.
- */
-    one_alias = ( QueueCount(top) == 1 );
-    while (elem != NULL) {
-       char **info = (char **) elem->q_data;
-
-       if (one_alias) {
-           int answer;
-
-           sprintf(buf, "%s %s for the filesystem %s? (y/n)",
-                   "Confirm that you want to delete\n the alias",
-                   info[ALIAS_NAME], info[ALIAS_TRANS]);
-           Put_message(buf);
-           
-           answer = YesNoQuitQuestion(buf, FALSE); 
-           switch(answer) {
-           case TRUE:
-               delete = TRUE;
-               break;
-           case FALSE:
-               delete = FALSE;
-               break;
-           default:            /* Quit. */
-               Put_message("Aborting Delete Operation.");
-               FreeQueue(top);
-               return(DM_NORMAL);
-           }
-       }
-       else {
-           sprintf(buf, "Are you sure that you want to delete %s",
-                   "this filesystem alias?");
-           delete = Confirm(buf);
-       }
-/* 
- * Deletetions are  performed if the user hits 'y' on a list of multiple 
- * filesystem aliases, or if the user confirms on a unique alias.
- */
-       if (delete) {
-           if ( (stat = sms_query("delete_filesys", 1,
-                                    &info[ALIAS_NAME], Scream, NULL)) != 0)
-               com_err(program_name, stat, " filesystem alias not deleted.");
-           else
-               Put_message("Filesystem alias deleted.");
-       }
-       else 
-           Put_message("Filesystem alias not deleted.");
-       elem = elem->q_forw;
-    }
-
-    FreeQueue(top);
+    struct qelem *elem = GetFSInfo(ALIAS, argv[1]);
+    QueryLoop(elem, PrintFSAlias, RealDeleteFSAlias,
+             "Delete the Filesystem Alias");
+    FreeQueue(elem);
     return (DM_NORMAL);
 }
 
@@ -572,16 +540,15 @@ int
 AttachHelp()
 {
     static char *message[] = {
-       "These are the options:\n",
-       "get - get information about a filesystem.",
-       "add - add a new filesystem to the data base.",
-       "update - update the information in the database on a filesystem.",
-       "delete - delete a filesystem from the database.\n",
-       "check - check information about association of a name and a filesys.",
-       "alias - associate a name with a filsystem.",
-       "unalias - disassociate a name with a filesystem.",
-       "\twhere a name is: user, group, or project\n",
-       "verbose - toggle the request for delete confirmation\n",
+      "These are the options:\n\n",
+      "get - get information about a filesystem.\n",
+      "add - add a new filesystem to the data base.\n",
+      "update - update the information in the database on a filesystem.\n",
+      "delete - delete a filesystem from the database.\n",
+      "check - check information about association of a name and a filesys.\n",
+      "alias - associate a name with a filsystem.\n",
+      "unalias - disassociate a name with a filesystem.\n",
+      "verbose - toggle the request for delete confirmation.\n",
        NULL,
     };
 
This page took 0.060756 seconds and 4 git commands to generate.