[Xorp-cvs] XORP cvs commit: xorp/etc/templates xorp/fea xorp/libxorp xorp/rtrmgr

Pavlin Radoslavov pavlin@icir.org
Mon, 10 Oct 2005 04:50:50 GMT


CVSROOT:	/usr/local/share/doc/apache/cvs
Module name:	xorp
Changes by:	pavlin@xorpc.icir.org	2005-10-10 04:50:50 UTC

XORP CVS repository


Modified files:
	etc/templates misc.cmds 
	fea           click_socket.cc click_socket.hh ifconfig_set.hh 
	              ifconfig_set_click.cc 
	libxorp       popen.cc popen.hh run_command.cc run_command.hh 
	              test_run_command.cc 
	rtrmgr        op_commands.cc op_commands.hh op_commands.yy 
	              task.cc task.hh y.opcmd_tab.cc 

Log message:
	* Modify the popen2() implementation so now it executes directly the
	  command rather than running it via "sh -c".
	
	* Modify the popen2() API:
	  - supply the arguments as a list of strings
	  - add an extra flag "redirect_stderr_to_stdout" to specify whether
	    the stderr should be redirected to stdout.
	
	* Apply few fixes to popen2(): use _exit(127) instead of exit(127),
	  set the sockets in non-buffered mode, etc.
	
	* Refactor the implementation of class RunCommand:
	  - Use the new popen2() implementation, so now class RunCommand
	    is used to execute the command directly rather than via "sh -c"
	
	  - Add a new class RunShellCommand that executes a command
	    via "sh -c".
	* Update test_run_command.cc to reflect the above changes. Also,
	  add additional testing.
	
	* Update the rest of the XORP code to use either the modified
	  RunCommand or the new RunShellCommand. Basically, the FEA
	  and the xorpsh operational commands use RunCommand, while the
	  execution of configurational commands defined inside the
	  rtrmgr *.tp use RunShellCommand.
	  The reason the operational commands are executed directly
	  is to prevent the user from sneaking-in extra commands
	  (e.g., see Bugzilla entry 219).
	  The reason the configurational commands are still executed via
	  "sh -c" is to preserve the configurational flexibility
	  (e.g., running more than one command, etc).
	
	  This fixes bugzilla entry #219
	
	* Now the stderr of all operational commands is redirected to stdout
	  and printed inside the xorpsh. The reason is because some commands
	  (e.g., ping and traceroute) print some of the result on stderr
	  instead of stdout. Note that the redirection is done inside popen2()
	  otherwise the stdout and stderr output may appear out-of-order
	  inside xorpsh.
	
	* Remove the explicit stderr to stdout redirection inside the
	  misc.cmds because it is not needed anymore (now the stderr to
	  stdout redirection is enabled by default for all operational
	  commands.
	
	Bugzilla URL:   http://www.xorp.org/bugzilla/show_bug.cgi?id=219

Revision  Changes                                 Path
1.6       +7 -3;  commitid: e2034349eadb7ea6;     xorp/etc/templates/misc.cmds
1.27      +21 -10;  commitid: e2034349eadb7ea6;   xorp/fea/click_socket.cc
1.20      +3 -3;  commitid: e2034349eadb7ea6;     xorp/fea/click_socket.hh
1.39      +2 -2;  commitid: e2034349eadb7ea6;     xorp/fea/ifconfig_set.hh
1.29      +7 -4;  commitid: e2034349eadb7ea6;     xorp/fea/ifconfig_set_click.cc
1.6       +98 -36;  commitid: e2034349eadb7ea6;   xorp/libxorp/popen.cc
1.4       +6 -2;  commitid: e2034349eadb7ea6;     xorp/libxorp/popen.hh
1.10      +73 -36;  commitid: e2034349eadb7ea6;   xorp/libxorp/run_command.cc
1.7       +208 -25;  commitid: e2034349eadb7ea6;  xorp/libxorp/run_command.hh
1.8       +124 -31;  commitid: e2034349eadb7ea6;  xorp/libxorp/test_run_command.cc
1.58      +33 -26;  commitid: e2034349eadb7ea6;   xorp/rtrmgr/op_commands.cc
1.33      +9 -8;  commitid: e2034349eadb7ea6;     xorp/rtrmgr/op_commands.hh
1.15      +6 -6;  commitid: e2034349eadb7ea6;     xorp/rtrmgr/op_commands.yy
1.54      +25 -25;  commitid: e2034349eadb7ea6;   xorp/rtrmgr/task.cc
1.34      +36 -34;  commitid: e2034349eadb7ea6;   xorp/rtrmgr/task.hh
1.23      +6 -6;  commitid: e2034349eadb7ea6;     xorp/rtrmgr/y.opcmd_tab.cc