Revision: 53466
          http://brlcad.svn.sourceforge.net/brlcad/?rev=53466&view=rev
Author:   brlcad
Date:     2012-11-06 02:38:54 +0000 (Tue, 06 Nov 2012)
Log Message:
-----------
remove the '\!' command from nirt.  It's considered rather evil 
security-endangering bad practice and is highly dubiously appropriate for this 
tool to offer anyways.

Modified Paths:
--------------
    brlcad/trunk/doc/docbook/system/man1/en/nirt.xml
    brlcad/trunk/src/nirt/command.c
    brlcad/trunk/src/nirt/nirt.c
    brlcad/trunk/src/nirt/nirt.h

Modified: brlcad/trunk/doc/docbook/system/man1/en/nirt.xml
===================================================================
--- brlcad/trunk/doc/docbook/system/man1/en/nirt.xml    2012-11-06 02:32:28 UTC 
(rev 53465)
+++ brlcad/trunk/doc/docbook/system/man1/en/nirt.xml    2012-11-06 02:38:54 UTC 
(rev 53466)
@@ -463,16 +463,6 @@
     </listitem>
   </varlistentry>
   <varlistentry>
-    <term><emphasis remap="B" role="B">! [</emphasis><emphasis 
remap="I">command</emphasis><emphasis remap="B" role="B">]</emphasis></term>
-    <listitem>
-      <para>
-       Executes the shell pipeline <emphasis remap="I">command.</emphasis>  If 
this command is
-       invoked with no arguments, <command>nirt</command> spins off a 
subshell, executing the
-       program named in the environment variable SHELL.
-      </para>
-    </listitem>
-  </varlistentry>
-  <varlistentry>
     <term><emphasis remap="B" role="B">?</emphasis></term>
     <listitem>
       <para>

Modified: brlcad/trunk/src/nirt/command.c
===================================================================
--- brlcad/trunk/src/nirt/command.c     2012-11-06 02:32:28 UTC (rev 53465)
+++ brlcad/trunk/src/nirt/command.c     2012-11-06 02:38:54 UTC (rev 53466)
@@ -162,47 +162,6 @@
 }
 
 void
-sh_esc(char *buffer)
-{
-    int ret;
-    static char *shell = "";
-    static char *last_cmd = "";
-    char *rshell = NULL;
-
-    while (isspace((int)*buffer)) {
-       ++buffer;
-    }
-
-    if (*buffer == '!') {
-       ret = system(last_cmd);
-       if (ret == -1)
-           perror("system");
-    } else if (*buffer) {
-       ret = system(buffer);
-       if (ret == -1)
-           perror("system");
-       last_cmd = buffer;
-    } else {
-       if ((*shell == '\0') && (shell = getenv("SHELL")) == 0) {
-#ifndef _WIN32
-           shell = DFLT_SHELL;
-#else
-           shell = "cmd.exe";
-#endif
-       }
-
-       /* sanitize path to shell */
-       rshell = bu_realpath(shell, NULL);
-
-       ret = system(rshell);
-       if (ret == -1)
-           perror("system");
-
-       bu_free(rshell, "free realpath");
-    }
-}
-
-void
 grid_coor(char *buffer, com_table *ctp, struct rt_i *UNUSED(rtip))
 {
     extern int str_dbl();  /* function to convert string to double */

Modified: brlcad/trunk/src/nirt/nirt.c
===================================================================
--- brlcad/trunk/src/nirt/nirt.c        2012-11-06 02:32:28 UTC (rev 53465)
+++ brlcad/trunk/src/nirt/nirt.c        2012-11-06 02:38:54 UTC (rev 53466)
@@ -65,7 +65,6 @@
     { "bot_mintie", bot_mintie, "Get/Set value for rt_bot_mintie (0 means do 
not use pieces, default is 4294967295)", "min_tie" },
     { "libdebug", cm_libdebug, "set/query librt debug flags", "hex_flag_value" 
},
     { "debug", cm_debug, "set/query nirt debug flags", "hex_flag_value" },
-    { "!", sh_esc, "escape to the shell", NULL },
     { "q", quit, "quit", NULL },
     { "?", show_menu, "display this help menu", NULL },
     { (char *)NULL, NULL, (char *)NULL, (char *)NULL }

Modified: brlcad/trunk/src/nirt/nirt.h
===================================================================
--- brlcad/trunk/src/nirt/nirt.h        2012-11-06 02:32:28 UTC (rev 53465)
+++ brlcad/trunk/src/nirt/nirt.h        2012-11-06 02:38:54 UTC (rev 53466)
@@ -138,7 +138,6 @@
 extern void read_mat(struct rt_i *rtip);
 extern void report(int outcom_type);
 extern void set_diameter(struct rt_i *);
-extern void sh_esc(char *buffer);
 extern void shoot(char *buffer, com_table *ctp, struct rt_i *rtip);
 extern void show_menu();
 extern void state_file(const char* buffer, com_table* ctp, struct rt_i *rtip);

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


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to