*** fshd.py	2004-08-13 14:29:37.000000000 -0700
--- /tmp/fshd.py	2005-06-04 11:58:58.190232888 -0700
***************
*** 30,36 ****
  import fshconfig
  
  class remote:
!     def __init__(self, method, login, server, background_wanted):
          self.__background_wanted = background_wanted
  	in_fd, self.w = os.pipe()
  	self.r, out_fd = os.pipe()
--- 30,36 ----
  import fshconfig
  
  class remote:
!     def __init__(self, method, login, server, background_wanted, in_fshd):
          self.__background_wanted = background_wanted
  	in_fd, self.w = os.pipe()
  	self.r, out_fd = os.pipe()
***************
*** 42,48 ****
  	    cmd = [method]
  	    if login != 0:
  		cmd = cmd + ["-l", login]
! 	    cmd = cmd + [server, 'in.fshd']
  	    os.dup2(in_fd, 0)
  	    os.dup2(out_fd, 1)
  	    os.close(in_fd)
--- 42,48 ----
  	    cmd = [method]
  	    if login != 0:
  		cmd = cmd + ["-l", login]
! 	    cmd = cmd + [server, in_fshd]
  	    os.dup2(in_fd, 0)
  	    os.dup2(out_fd, 1)
  	    os.close(in_fd)
***************
*** 180,186 ****
  
  class fshd:
      def __init__(self, server, method, login, use_l_flag, background_wanted,
!                  timeout):
  	# Connect to server using method.  Parse away leading
  	# noice until we receive "^fsh ".  Check the version number.
          sockname, sockdir = fshlib.fshd_socket(server, method, login)
--- 180,186 ----
  
  class fshd:
      def __init__(self, server, method, login, use_l_flag, background_wanted,
!                  timeout, in_fshd):
  	# Connect to server using method.  Parse away leading
  	# noice until we receive "^fsh ".  Check the version number.
          sockname, sockdir = fshlib.fshd_socket(server, method, login)
***************
*** 197,203 ****
              else:
                  raise
  	self.r = remote(method, use_l_flag and login, server,
!                         background_wanted)
          self.sessions = {}
          self.listen = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
  	self.listen.setblocking(0)
--- 197,203 ----
              else:
                  raise
  	self.r = remote(method, use_l_flag and login, server,
!                         background_wanted, in_fshd)
          self.sessions = {}
          self.listen = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
  	self.listen.setblocking(0)
***************
*** 364,371 ****
              "of ssh.\n"
              "  -l login              Log in as user ``login''.\n"
              "  -T --timeout=timeout  Set idle timeout (in seconds); exit when "
!             "no session\n                        has existed for this long. "
!             "0 disables the timeout.\n")
  
      sys.exit(ret)
  
--- 364,372 ----
              "of ssh.\n"
              "  -l login              Log in as user ``login''.\n"
              "  -T --timeout=timeout  Set idle timeout (in seconds); exit when "
!             "no session\n                        has existed for this long."
!             "0 disables the timeout.\n"
! 	    "  -p --path path        Path to in.fshd on remote system\n")
  
      sys.exit(ret)
  
***************
*** 375,385 ****
      use_l_flag = 0
      print_version = 0
      b_flag = 0
      timeout = fshconfig.default_fshd_timeout
      try:
! 	opts, args = getopt.getopt(sys.argv[1:], "hr:l:bVT:",
                                     ["version", "help", "background",
!                                     "timeout="])
      except getopt.error, msg:
  	sys.stderr.write(str(msg) + "\n")
  	sys.exit(1)
--- 376,387 ----
      use_l_flag = 0
      print_version = 0
      b_flag = 0
+     in_fshd = 'in.fshd' # Assuming it somewhere on the path
      timeout = fshconfig.default_fshd_timeout
      try:
! 	opts, args = getopt.getopt(sys.argv[1:], "hr:l:p:bVT:",
                                     ["version", "help", "background",
!                                     "timeout=", "path"])
      except getopt.error, msg:
  	sys.stderr.write(str(msg) + "\n")
  	sys.exit(1)
***************
*** 397,403 ****
  	    usage(0)
          elif opt == "-T" or opt == "--timeout":
              timeout = string.atof(val)
!         else:
              assert 0
      if print_version:
  	fshlib.print_version("fshd")
--- 399,407 ----
  	    usage(0)
          elif opt == "-T" or opt == "--timeout":
              timeout = string.atof(val)
! 	elif opt == "-p" or opt == "--path":
!        	    in_fshd = val
! 	else:
              assert 0
      if print_version:
  	fshlib.print_version("fshd")
***************
*** 414,420 ****
                  if eno != errno.EBADF:
                      raise
  
!     s = fshd(args[0], method, login, use_l_flag, b_flag, timeout)
      s.toploop()
  
  if __name__ == '__main__':
--- 418,424 ----
                  if eno != errno.EBADF:
                      raise
  
!     s = fshd(args[0], method, login, use_l_flag, b_flag, timeout, in_fshd)
      s.toploop()
  
  if __name__ == '__main__':

