]> andersk Git - moira.git/commitdiff
${CRYPT} in Imakefile
authordanw <danw>
Wed, 29 Jan 1997 23:06:09 +0000 (23:06 +0000)
committerdanw <danw>
Wed, 29 Jan 1997 23:06:09 +0000 (23:06 +0000)
same sanity fixes from the sipb-athena port.
several s/#endif lint/#endif/ to make irix cc happy
rename SignalHandler to Signal_Handler to avoid namespace collision in Linux
POSIX and other fixes in menu.c. Kludge for NetBSD since there's no
portable fix. Removed Password_input since it's not used and it was
hopelessly confused about POSIX vs SYSV

16 files changed:
clients/moira/Imakefile
clients/moira/cluster.c
clients/moira/delete.c
clients/moira/globals.c
clients/moira/lists.c
clients/moira/main.c
clients/moira/menu.c
clients/moira/menus.c
clients/moira/misc.c
clients/moira/namespace.c
clients/moira/nfs.c
clients/moira/pobox.c
clients/moira/printer.c
clients/moira/quota.c
clients/moira/user.c
clients/moira/utils.c

index f0a4a3c063d2ce189a25bd401522c531c53c4122..12b1d2ef94161004d0382d1bfa5e063dd7c877ea 100644 (file)
@@ -22,9 +22,8 @@ NOBJS=        namespace.o globals.o lists.o menu.o \
 OBJS=  ${MOBJS} ${NOBJS}
 INCLUDE= -I$(BUILDTOP)/include -I$(BUILDTOP)/lib ${GDSSINC} -I/usr/athena/include -I.
 
-
-program(moira, ${MOBJS},${MR_LIBDEP} ${GDB_LIBDEP}, ${LIBGDSS} ${CLIBS} ${CURSES},${PROGDIR})
-program(namespace, ${NOBJS},${MR_LIBDEP} ${GDB_LIBDEP}, ${LIBGDSS} ${CLIBS} ${CURSES},${PROGDIR})
+program(moira, ${MOBJS},${MR_LIBDEP} ${GDB_LIBDEP}, ${LIBGDSS} ${CLIBS} ${CRYPT} ${CURSES},${PROGDIR})
+program(namespace, ${NOBJS},${MR_LIBDEP} ${GDB_LIBDEP}, ${LIBGDSS} ${CLIBS} ${CRYPT} ${CURSES},${PROGDIR})
 
 install::
        $(RM) $(DESTDIR)$(PROGDIR)/listmaint
index bdc14a4966f0563ff1ee66c106a5d13f34ec83ef..328766f9eea466e22b1caa6f0129499886472823 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file cluster.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
@@ -68,7 +68,7 @@ static char *uses[]   = { "none (0)"};
 static char *MacState(state)
 int state;
 {
-    char buf[BUFSIZ];
+    static char buf[BUFSIZ];
 
     if (state < 0 || state > 3) {
        sprintf(buf, "Unknown (%d)", state);
@@ -790,7 +790,7 @@ char **argv;
 
     name = strsave(""); /* want to put prefix here */
     if (GetValueFromUser("Machine name", &name) == SUB_ERROR)
-          return(NULL);
+          return(0);
 
     name =  canonicalize_hostname(strsave(name));
 
index 1946eb275fad1cf463f81da6236020ca19ef43ad..b80859203292880bcd1d8e829a144a2fa3b83976 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file delete.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
index 25a0d1348ccb3f059e92ab85b63c2e1865a83d8a..e901156f31c9367055c5ba536c8595273bb18576 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file globals.c for the Moira Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the Moira database.
index 173c3909b1ca31416f35e4857fe716d7aa680177..448128eba43547e76b8586d39bb65c8727190f47 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file lists.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
index 00e99844512d898f2b9c10ce1b6e03909099142c..30e543328c2266a8ad9b921b17a458ab5bc8593f 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file main.c for the Moira Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the Moira database.
@@ -40,8 +40,8 @@ int interrupt = 0;
 extern Menu moira_top_menu, list_menu, user_menu, dcm_menu;
 
 #ifndef DEBUG
-static void SignalHandler(), CatchInterrupt();
-#endif DEBUG
+static void Signal_Handler(), CatchInterrupt();
+#endif
 
 static void ErrorExit(), Usage();
 char *getlogin();
@@ -138,7 +138,7 @@ main(argc, argv)
 #ifdef POSIX
     sigemptyset(&act.sa_mask);
     act.sa_flags = 0;
-    act.sa_handler= (void (*)()) SignalHandler;
+    act.sa_handler= (void (*)()) Signal_Handler;
     (void) sigaction(SIGHUP, &act, NULL);
     (void) sigaction(SIGQUIT, &act, NULL);
     if (use_menu)
@@ -148,10 +148,10 @@ main(argc, argv)
        (void) sigaction(SIGINT, &act, NULL); 
     }
 #else
-    (void) signal(SIGHUP, SignalHandler);
-    (void) signal(SIGQUIT, SignalHandler);
+    (void) signal(SIGHUP, Signal_Handler);
+    (void) signal(SIGQUIT, Signal_Handler);
     if (use_menu)
-      (void) signal(SIGINT, SignalHandler); 
+      (void) signal(SIGINT, Signal_Handler); 
     else
       (void) signal(SIGINT, CatchInterrupt); 
 #endif /* POSIX */
@@ -211,14 +211,14 @@ Usage()
 }
 
 #ifndef DEBUG
-/*     Function Name: SignalHandler
+/*     Function Name: Signal_Handler
  *     Description: This function cleans up from a signal interrupt.
  *     Arguments: none.
  *     Returns: doesn't
  */
 
 static void
-SignalHandler()
+Signal_Handler()
 {
     Put_message("Signal caught - exiting");
     if (use_menu)
@@ -234,4 +234,4 @@ CatchInterrupt()
     Put_message("Interrupt! Press RETURN to continue");
     interrupt = 1;
 }
-#endif DEBUG
+#endif
index d18884e3c749371dca82ba7a2ff18ec494d543e8..7df215b1769fef0eaa6ff3dd4975a1e0aea843ec 100644 (file)
 
 #ifndef lint
 static char rcsid_menu_c[] = "$Header$";
-
-#endif lint
+#endif
 
 #include <mit-copyright.h>
 #include <sys/types.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <signal.h>
 #include <curses.h>
 #ifdef POSIX
 #include <unistd.h>
 #include <termios.h>
+#include <stdarg.h>
+#else
+#include <sgtty.h>
+#include <varargs.h>
 #endif /* POSIX */
 #include <ctype.h>
-#ifndef sun
-#include <varargs.h>
-#endif
 #include <com_err.h>
 #include <moira.h>
 #include "menu.h"
@@ -51,20 +52,11 @@ static char rcsid_menu_c[] = "$Header$";
 #define MIN_INPUT 2            /* Minimum number of lines for input window */
 
 extern int interrupt;          /* will be set if ^C is received */
-extern FILE *fdopen();
-#ifndef sgi
-extern int getpid();
-#endif
-extern char *calloc();
 extern char *whoami;
 
 FILE *log_file = (FILE *) NULL;                /* file stream of log file */
 int more_flg = 1;
 
-#ifdef POSIX
-extern char *malloc();
-#endif
-
 /* Structure for holding current displayed menu */
 struct menu_screen {
     WINDOW *ms_screen;         /* Window for this menu */
@@ -119,7 +111,7 @@ Start_menu(m)
 {
     struct menu_screen *make_ms();
 #ifdef __STDC__
-    register void (*old_hook)(const char *, long, const char *, va_list) = set_com_err_hook(menu_com_err_hook);
+    register void (*old_hook)(const char *, long, const char *, va_list) = set_com_err_hook((void (*) (const char *, long, const char *, va_list))menu_com_err_hook);
 #else
     register void (*old_hook)() = set_com_err_hook(menu_com_err_hook);
 #endif
@@ -484,7 +476,11 @@ int Prompt_input(prompt, buf, buflen)
                        (void) wmove(cur_ms->ms_input, y, 0);
                        (void) wclrtoeol(cur_ms->ms_input);
                        y--;
-                       x = cur_ms->ms_input->_maxx-1;
+#ifdef __NetBSD__
+                       x = cur_ms->ms_input->maxx - 1;
+#else
+                       x = cur_ms->ms_input->_maxx - 1;
+#endif
                    }
                }
                break;
@@ -501,7 +497,11 @@ int Prompt_input(prompt, buf, buflen)
                    (void) waddch(cur_ms->ms_input, c);
                    *p++ = c;
                    x++;
+#ifdef __NetBSD__
+                   if (x >= cur_ms->ms_input->maxx) {
+#else
                    if (x >= cur_ms->ms_input->_maxx) {
+#endif
                        x = 0;
                        y++;
                    }
@@ -534,113 +534,6 @@ gotit:
     return 1;
 }
 
-/* Prompt the user for input in the input window of cur_ms, but don't echo
-   and allow some control characters */
-int Password_input(prompt, buf, buflen)
-    char *prompt;
-    char *buf;
-    int buflen;
-{
-    int c;
-    char *p;
-    int y, x, oldx;
-
-    if (cur_ms != NULLMS) {
-       more_flg = 1;
-       getyx(cur_ms->ms_input, y, x);
-       (void) wmove(cur_ms->ms_input, y, 0);
-
-       touchwin(cur_ms->ms_screen);
-       refresh_ms(cur_ms);
-       (void) waddstr(cur_ms->ms_input, prompt);
-       getyx(cur_ms->ms_input, y, x);
-
-       oldx = x;
-       for (p = buf; p - buf < buflen;) {
-           (void) wmove(cur_ms->ms_input, y, x);
-           (void) wclrtoeol(cur_ms->ms_input);
-           refresh_ms(cur_ms);
-           c = getchar() & 0x7f;
-           switch (c) {
-           case CTL('C'):
-               return 0;
-           case CTL('Z'):
-               (void) kill(getpid(), SIGTSTP);
-               touchwin(curscr);
-               break;
-           case CTL('L'):
-               (void) wclear(cur_ms->ms_input);
-               (void) waddstr(cur_ms->ms_input, prompt);
-               refresh_ms(cur_ms);
-               (void) move(LINES - 1, 0);
-               (void) wrefresh(curscr);
-               getyx(cur_ms->ms_input, y, x);
-               break;
-           case '\n':
-           case '\r':
-               (void) waddch(cur_ms->ms_input, '\n');
-
-               (void) wclrtoeol(cur_ms->ms_input);
-               refresh_ms(cur_ms);
-               *p = '\0';
-               Start_paging();
-               return 1;
-           case '\b':
-           case '\177':
-               if (p > buf) {
-                   p--;
-                   x--;
-               }
-               break;
-           case CTL('U'):
-               x = oldx;
-               p = buf;
-               break;
-           default:
-               *p++ = c;
-               break;
-           }
-       }
-    }
-    else {
-#ifdef POSIX
-       struct termios ttybuf, nttybuf;
-#else
-       struct sgttyb ttybuf, nttybuf;
-#endif /* POSIX */
-       printf("%s", prompt);
-       /* turn off echoing */
-#ifdef POSIX
-       tcgetattr(0, &ttybuf);
-       nttybuf = ttybuf;
-       nttybuf.c_lflag &= ~ECHO;
-       tcsetattr(0, TCSANOW, &nttybuf);
-       if (gets(buf) == NULL) {
-           tcsetattr(0, TCSANOW, &ttybuf);
-           putchar('\n');
-           return 0;
-       }
-       putchar('\n');
-       (void) ioctl(0, TCSETA, (char *)&ttybuf);
-#else
-       (void) ioctl(0, TIOCGETP, (char *)&ttybuf);
-       nttybuf = ttybuf;
-       nttybuf.sg_flags &= ~ECHO;
-       (void)ioctl(0, TIOCSETP, (char *)&nttybuf);
-       if (gets(buf) == NULL) {
-           (void) ioctl(0, TIOCSETP, (char *)&ttybuf);
-           putchar('\n');
-           return 0;
-       }
-       putchar('\n');
-       (void) ioctl(0, TIOCSETP, (char *)&ttybuf);
-#endif /* POSIX */
-       Start_paging();
-       return 1;
-    }
-    return 0;
-}
-
 int lines_left;
 
 /* Start paging */
index d20698c7f462d8cb27836f314ace3704380402fe..211e71368f323dca54a4ba97dcbda71f65cb4ec6 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file menus.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
index c8e192920dbc72ebd74ca62634ebef8c21230a59..538c4e6c90ac9bdc81bab2b527fb5b8dc0d86c81 100644 (file)
@@ -88,7 +88,7 @@ char **info;
     struct hostent *host_entry;
 
     host_address = inet_addr(info[1]);
-    if (host_address != NULL) {
+    if (host_address != 0) {
        host_entry = gethostbyaddr((char *) &host_address, 4, AF_INET);
        if (host_entry != NULL) {
            free(info[1]);
index fa6c00f9e555e2e971e637daf88aaa16a7234376..415a85432763e97130bcedd3b085fb929b33d980 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file main.c for the Moira Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the Moira database.
@@ -166,8 +166,8 @@ Menu namespace_menu = {
 
 
 #ifndef DEBUG
-static void SignalHandler(), CatchInterrupt();
-#endif DEBUG
+static void Signal_Handler(), CatchInterrupt();
+#endif
 
 static void ErrorExit(), Usage();
 char *getlogin();
@@ -261,7 +261,7 @@ main(argc, argv)
 #ifdef POSIX
     sigemptyset(&act.sa_mask);
     act.sa_flags = 0;
-    act.sa_handler= (void (*)()) SignalHandler;
+    act.sa_handler= (void (*)()) Signal_Handler;
     (void) sigaction(SIGHUP, &act, NULL);
     (void) sigaction(SIGQUIT, &act, NULL);
     if (use_menu)
@@ -271,10 +271,10 @@ main(argc, argv)
        (void) sigaction(SIGINT, &act, NULL); 
     }
 #else
-    (void) signal(SIGHUP, SignalHandler);
-    (void) signal(SIGQUIT, SignalHandler);
+    (void) signal(SIGHUP, Signal_Handler);
+    (void) signal(SIGQUIT, Signal_Handler);
     if (use_menu)
-      (void) signal(SIGINT, SignalHandler); 
+      (void) signal(SIGINT, Signal_Handler); 
     else
       (void) signal(SIGINT, CatchInterrupt); 
 #endif /* POSIX */
@@ -325,14 +325,14 @@ Usage()
 }
 
 #ifndef DEBUG
-/*     Function Name: SignalHandler
+/*     Function Name: Signal_Handler
  *     Description: This function cleans up from a signal interrupt.
  *     Arguments: none.
  *     Returns: doesn't
  */
 
 static void
-SignalHandler()
+Signal_Handler()
 {
     Put_message("Signal caught - exiting");
     if (use_menu)
@@ -348,7 +348,7 @@ CatchInterrupt()
     Put_message("Interrupt! Press RETURN to continue");
     interrupt = 1;
 }
-#endif DEBUG
+#endif
 
 
 /* Dummy routine to be able to link against the rest of the moira client */
@@ -356,7 +356,7 @@ CatchInterrupt()
 DeleteUser()
 {
     return(DM_QUIT);
-};
+}
 
 
 int
index 536c75ddb8f0e9177cec681b7ee4ab7c952393ff..e053011e38696279d71a7c55bdefd93ad68dbad2 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file nfs.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
index 88d79601a4f41151918c053d922dbd4a417faad3..d723de8632887f2ff593b528fec231e9742d7064 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file pobox.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
index d08b396e99d62351156361d22468c2ff5f763c0e..943389528cc5a83ee437032d625ba73ef177c5c0 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file printer.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
index 9a5ce0bc900dbc34208371baf72592e4cebeefbd..0ac23b7e0e010d39f65ec0149ceb60ab1ef17438 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file quota.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
index e116804a2e1c43a58f1b26dc03337c391baf9a33..41059cb32b66e87666434f1622c05dc93b021eba 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file user.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
@@ -68,7 +68,7 @@ static char *states[] = { "Registerable (0)",
 static char *UserState(state)
 int state;
 {
-    char buf[BUFSIZ];
+    static char buf[BUFSIZ];
 
     if (state < 0 || state >= US_END) {
        sprintf(buf, "Unknown (%d)", state);
@@ -373,13 +373,6 @@ Bool name;
  *                         (wildcards okay).
  *     Returns: the first element of the queue containing the user info.
  *
- * Note: if we are checking a login name, if the length is greater
- * than 8 characters, we immediately print a "no such user" error.
- * This gets around a bug in Ingres, where a non-existent 8 character
- * username returns a "no such user" error instantaneously, but a 9
- * character username takes 5-6 minutes.  :-(  We will need to change
- * this if we ever make a username longer than 8 characters.
- * Unlikely, but....
  */
 
 struct qelem *
@@ -393,11 +386,6 @@ char *name1, *name2;
 
     switch(type) {
     case LOGIN:
-       if (strlen(name1) > 8) {
-           com_err(program_name, MR_USER,
-                   " when attempting to get_user_acount_by_login.");
-           return (NULL);
-        }
        args[0] = name1;
        if ( (status = do_mr_query("get_user_account_by_login", 1, args,
                                    StoreInfo, (char *) &elem)) != 0) {
index 570a30dabab78075682ce69e60530a58bee90dea..f3a9c6f0ce68a32ba1e0c546d45831c6ac1c98e8 100644 (file)
@@ -1,6 +1,6 @@
 #if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
-#endif lint
+#endif
 
 /*     This is the file utils.c for the MOIRA Client, which allows a nieve
  *      user to quickly and easily maintain most parts of the MOIRA database.
@@ -33,6 +33,7 @@
 #include <netdb.h>             /* for gethostbyname. */
 #include <sys/types.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 
 
 /*     Function Name: AddQueue
This page took 0.075656 seconds and 5 git commands to generate.