Revision: 41788
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41788&view=rev
Author:   starseeker
Date:     2010-12-23 03:45:59 +0000 (Thu, 23 Dec 2010)

Log Message:
-----------
Remove the 'execute shell command' misfeature from vdeck.

Modified Paths:
--------------
    brlcad/trunk/NEWS
    brlcad/trunk/src/vdeck/vdeck.c

Modified: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS   2010-12-23 03:29:01 UTC (rev 41787)
+++ brlcad/trunk/NEWS   2010-12-23 03:45:59 UTC (rev 41788)
@@ -13,6 +13,7 @@
 --- 2010-12-XX  Release 7.18.2                                     ---
 ----------------------------------------------------------------------
 
+* remove shell execution from vdeck - Cliff Yapp
 
 ----------------------------------------------------------------------
 --- 2010-12-07  Release 7.18.0                                     ---

Modified: brlcad/trunk/src/vdeck/vdeck.c
===================================================================
--- brlcad/trunk/src/vdeck/vdeck.c      2010-12-23 03:29:01 UTC (rev 41787)
+++ brlcad/trunk/src/vdeck/vdeck.c      2010-12-23 03:45:59 UTC (rev 41788)
@@ -61,9 +61,6 @@
 #ifdef HAVE_SYS_TYPES_H
 #  include <sys/types.h>
 #endif
-#ifdef HAVE_SYS_WAIT_H
-#  include <sys/wait.h>
-#endif
 #include "bio.h"
 
 #include "vmath.h"
@@ -88,7 +85,6 @@
     "remove [object[s]]             Remove an object from current list.",
     "sort                           Sort table of contents alphabetically.",
     "toc [object[s]]                Table of contents of solids database.",
-    "! [shell command]              Execute a UNIX shell command.",
     "",
     "NOTE:",
     "First letter of command is sufficient, and all arguments are optional.",
@@ -177,7 +173,6 @@
 extern int             col_prt();
 extern int             match();
 extern int             delete();
-extern int             shell();
 extern int             cgarbs();
 extern int             redoarb();
 
@@ -323,14 +318,6 @@
            case RETURN :
                prompt( PROMPT );
                continue;
-           case SHELL :
-               if ( arg_list[1] == 0 )
-               {
-                   prompt( "enter shell command: " );
-                   (void) getcmd( arg_list, arg_ct );
-               }
-               (void) shell( arg_list );
-               break;
            case SORT_TOC :
                qsort( (genptr_t)toc_list, (unsigned)ndir,
                       sizeof(char *), sortFunc );
@@ -1349,66 +1336,7 @@
     /* XXX should free soltab list */
 }
 
-
 /**
- * s h e l l
- *
- * Execute shell command.
- */
-int
-shell(char *args[])
-{
-    char       *from, *to;
-    char               *argv[4], cmdbuf[MAXLN];
-    int                pid, ret, status;
-    int        i;
-
-    (void) signal( SIGINT, SIG_IGN );
-
-    /* Build arg vector.                                               */
-    argv[0] = "Shell( deck )";
-    argv[1] = "-c";
-    to = argv[2] = cmdbuf;
-    for ( i = 1; i < arg_ct; i++ ) {
-       from = args[i];
-       if ( (to + strlen( args[i] )) - argv[2] > MAXLN - 1 ) {
-           (void) fprintf( stderr, "\ncommand line too long\n" );
-           bu_exit( 10, NULL );
-       }
-       (void) printf( "%s ", args[i] );
-       while ( *from )
-           *to++ = *from++;
-       *to++ = ' ';
-    }
-    to[-1] = '\0';
-    (void) printf( "\n" );
-    argv[3] = 0;
-    if ( (pid = fork()) == -1 ) {
-       perror( "shell()" );
-       return -1;
-    } else     if ( pid == 0 ) {
-       /*
-        * CHILD process - execs a shell command
-        */
-       (void) signal( SIGINT, SIG_DFL );
-       (void) execv( "/bin/sh", argv );
-       perror( "/bin/sh -c" );
-       bu_exit( 99, NULL );
-    } else     /*
-                * PARENT process - waits for shell command
-                * to finish.
-                */
-       do {
-           if ( (ret = wait( &status )) == -1 ) {
-               perror( "wait( /bin/sh -c )" );
-               break;
-           }
-       } while ( ret != pid );
-    return 0;
-}
-
-
-/**
  * t o c
  *
  * Build a sorted list of names of all the objects accessable in the


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to