* sendcommand.c: added (also updated utils.txt, weekly, Makefile.in)
authorArt Cancro <ajc@citadel.org>
Tue, 1 Dec 1998 01:13:59 +0000 (01:13 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 1 Dec 1998 01:13:59 +0000 (01:13 +0000)
citadel/ChangeLog
citadel/Makefile.in
citadel/TODO
citadel/sendcommand.c
citadel/utils.txt

index 725d6b6ae4c1c1c6c8b87b179cee04c737103e56..af6cfb1537d219a1b285752480bfccdb0e23bb23 100644 (file)
@@ -1,6 +1,6 @@
 Mon Nov 30 19:48:52 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * room_ops.c: added sort_msglist() to move and save operations
-       * sendcommand.c: added
+       * sendcommand.c: added (also updated utils.txt, weekly, Makefile.in)
 
 Sun Nov 29 23:57:39 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Fixed cmd_regi() to not display a second result code after xfer
index de0d3236ece09eba310b03c0ec277d52f2fa4b8f..94e66b5a2945b13b848dc50a3d71ae07f87309b7 100644 (file)
@@ -153,10 +153,9 @@ proxy: proxy.o ipc_c_tcp.o
 whobbs: whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF)
        $(CC) whobbs.o ipc_c_tcp.o tools.o $(SNPRINTF) $(LDFLAGS) -o whobbs
 
-sendcommand: sendcommand.o ipc_c_tcp.o tools.o $(SNPRINTF)
-       $(CC) sendcommand.o ipc_c_tcp.o tools.o $(SNPRINTF) $(LDFLAGS) \
-       -o sendcommand
-       chmod 700 sendcommand
+sendcommand: sendcommand.o ipc_c_tcp.o tools.o config.o $(SNPRINTF)
+       $(CC) sendcommand.o ipc_c_tcp.o tools.o config.o \
+        $(SNPRINTF) $(LDFLAGS) -o sendcommand
 
 userlist: userlist.o ipc_c_tcp.o tools.o $(SNPRINTF)
        $(CC) userlist.o ipc_c_tcp.o tools.o \
@@ -192,6 +191,7 @@ install-data:
                 `find help messages network -type f | grep -v CVS`; do \
                $(INSTALL_DATA) $$i $(prefix)/$$i; \
        done
+       chmod 700 $(prefix)/sendcommand
 
 install-doc:
        ./mkinstalldirs $(prefix)/techdoc
index de10d9f74b963302af0ad26a5893f6be404b8280..6b1bcb1f9ed684da0167f3495ae9cb9ea18366f0 100644 (file)
@@ -1,6 +1,5 @@
 Citadel/UX v5.50 showstoppers list
 ----------------------------------
-* Figure out a way to auto-launch expire functions (and other functions)
 
 Other things that might be nice to take care of:
 ------------------------------------------------
index 6658bc7a5918b969245ca01081a2f7e0ffea03ec..0f7995e3344623c9f95db1e78f8d0c4051c6de82 100644 (file)
@@ -129,6 +129,7 @@ int main(int argc, char **argv)
                        home_specified = 1;
                        }
                else {
+                       if (strlen(cmd)>0) strcat(cmd, " ");
                        strcat(cmd, argv[a]);
                        }
                }
@@ -150,6 +151,18 @@ int main(int argc, char **argv)
        serv_gets(buf);
        fprintf(stderr, "%s\n", buf);
 
+       if (buf[0]=='1') {
+               while (serv_gets(buf), strcmp(buf, "000")) {
+                       printf("%s\n", buf);
+                       }
+               }
+       else if (buf[0]=='4') {
+               do {
+                       if (fgets(buf, 255, stdin)==NULL) strcpy(buf, "000");
+                       if (strcmp(buf, "000")) serv_puts(buf);
+                       } while (strcmp(buf, "000"));
+               }
+
        fprintf(stderr, "sendcommand: processing ended.\n");
        cleanup(0);
        return 0;
index a407c51efb3043751f2b3cc1c590c0ee03c200e0..0fa8b7dd960a907a0cc83fcf7e30b376fda4b0b2 100644 (file)
@@ -5,12 +5,13 @@
  OVERVIEW
     
    The following utilities will be discussed in this document:
- aidepost   Post standard input to the Aide> room. NOTE: called by chat.c
- whobbs     Who is on the system (connected to the server, actually.)
- stats      Print the calling statistics & graph.
- msgform    Format a binary message to the screen (stdin or in a file)
- userlist   Print the userlist.
- readlog    Read the caller log
+ aidepost     Post standard input to the Aide> room
+ whobbs       Who is on the system
+ stats        Print the calling statistics & graph
+ msgform      Format a binary message to the screen (stdin or in a file)
+ userlist     Print the userlist
+ readlog      Read the caller log
+ sendcommand  Send a server command
    
    It is up to you to decide which utilities should be made accessible only
 to sysops. It is important that you set the file permissions correctly. All
@@ -99,7 +100,23 @@ file. This file records all times the Citadel/UX program has been started, and
 at what baud rate, as well as logins, proper logouts, loss of carrier (SIGHUP),
 bad password attempts, and new user logins.
      
+   
+  SENDCOMMAND
+   sendcommand will interpret its arguments (except for "-hDIRNAME") as a
+server command, which is sent to the server.  Commands which require textual
+input will read it from stdin.  Commands which generate textual output will
+be sent to stdout. 
+   This utility is intended to be used to enable Citadel server commands to be
+executed from shell scripts.  Review the script called "weekly" which ships
+with the Citadel distribution for an example of how this can be used.
  
+   NOTE: be sure that this utility is not world-executable.  It connects to the
+server in privileged mode, and therefore could present a security hole if not
+properly restricted.
+  
+  
   --------------------------------------------------------------------------
    
    That should cover all of the included utilities. Comments, suggestions,