[13848] in Athena Bugs

home help back first fref pref prev next nref lref last post

sun4 7.7T: xess

daemon@ATHENA.MIT.EDU (Albert Dvornik)
Wed Sep 13 13:26:04 1995

To: bugs@MIT.EDU
Date: Wed, 13 Sep 1995 13:25:48 EDT
From: Albert Dvornik <bert@MIT.EDU>

System name:		infocalypse
Type and version:	SPARC/Classic 7.7T (2 update(s) to same version)
Display type:		cgthree

What were you trying to do?
	Give xess command-line options which include shell metacharacters.
	For instance:
		xess 'quoted$$string'

What's wrong:
	Xess expands shell metacharacters; for example, '$$' will be
	replaced by the PID of the xess invocation script, even though
	the argument was properly quoted in the invoking shell.

What should have happened:
	The Perl wrappers that are used to start Xess should use
	"exec" in ways which do not run "/bin/sh -c" to expand shell
	metacharacters.  (See suggested patches below.)

Please describe any relevant documentation references:
	See "Programming Perl" (the camel book), p.142, for
	explanation of when "exec" in Perl runs /bin/sh.

Suggested fix:
	The simplest solution to the problem is to call "exec" on a
	list instead of an interpolated string.  The behavior is
	the same when the arguments contain no shell metacharacters.

*** /mit/xess/arch/sun4m_53/bin/xess	Tue Jul 11 15:32:57 1995
--- xess	Wed Sep 13 13:11:43 1995
***************
*** 74,80 ****
  # -----------------------------------------------------------------------------
  $executable = "$bindir/$program";
  if ( -e $executable) {
!     exec ("$executable @args");
  }
  else {
      print <<EOM2
--- 74,80 ----
  # -----------------------------------------------------------------------------
  $executable = "$bindir/$program";
  if ( -e $executable) {
!     exec ($executable, @args);
  }
  else {
      print <<EOM2

*** /mit/xess_v3.0/arch/sun4m_53/bin/xess	Thu Jul 20 11:34:02 1995
--- xess	Wed Sep 13 13:11:17 1995
***************
*** 143,149 ****
      $resource_dir = "${libdir}/X11/app-defaults";
      &do_resources;
  
!     exec ("$executable @args");
  }
  else {
      print <<EOM2
--- 143,149 ----
      $resource_dir = "${libdir}/X11/app-defaults";
      &do_resources;
  
!     exec ($executable, @args);
  }
  else {
      print <<EOM2

home help back first fref pref prev next nref lref last post