Subject: Re: bug#1741: 23.0.60; vc fail to register file while logged as /su:: with tramp

From: Dan Nicolaescu <[email-masked]>
Date: Tue, 7 Apr 2009 09:57:18 -0700 (PDT)

Thierry Volpiatto <[email-masked]> writes:

  > Please write in English if possible, because the Emacs maintainers
  > usually do not have translators to read other languages for them.
  > 
  > Your bug report will be posted to the [email-masked] mailing list.
  > 
  > Please describe exactly what actions triggered the bug
  > and the precise symptoms of the bug:
  > 
  > Hi, 
  > i can't register a file with vc/rcs when i am logged as root throught
  > tramp.
  > 1) C-x v i
  > 2) Create RCS dir (y/n) ==> The dir is created.
  > 3) But now ==> _Here the debug output_:
  > 
  > ,----
  > | Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  > |   file-exists-p(nil)
  > |   vc-insert-file(nil "^[0-9]")
  > |   vc-rcs-fetch-master-state("/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   vc-rcs-working-revision("/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   apply(vc-rcs-working-revision "/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   vc-call-backend(RCS working-revision "/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   vc-working-revision("/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   vc-default-mode-line-string(RCS "/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   apply(vc-default-mode-line-string RCS "/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   vc-call-backend(RCS mode-line-string "/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   vc-mode-line("/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   run-hook-with-args(vc-mode-line "/su:[email-masked]:/usr/local/bin/editeur.sh")
  > |   vc-resynch-window("/su:[email-masked]:/usr/local/bin/editeur.sh" t t)
  > |   vc-resynch-buffer("/su:[email-masked]:/usr/local/bin/editeur.sh" t t)
  > | 
  > | [...]
  > | 
  > | [G70600 G70601 rev comment file --cl-dolist-temp-- 
  > | message "Registering %s... " mapc vc-file-clearprops vc-call-backend
  > |   register nil vc-file-setprop 
  > | vc-backend "Registering %s... done"] 6] (quote --files--) (quote --backend--) --cl-rest--)))
  > |   vc-register(nil)
  > |   call-interactively(vc-register nil nil)
  > `----
  > 
  > _And if i want to delete RCS directory from dired_:
  > 
  > ,----
  > | (file-error Couldn't delete /su:[email-masked]:/usr/local/bin/RCS)
  > `----
  > 
  > However if i open an emacs  root session i can register my file as
  > normal.

What happens is that vc-check-master-templates gets called with
"/su:[email-masked]:/usr/local/bin/editeur.sh", and it calls 
(file-exists-p "/su:[email-masked]:/usr/local/bin/editeur.sh")
which returns nil.

There's a few other `file-exists-p' calls in vc*.el, so it's likely that
other things can go wrong if this one instance is somehow fixed.

If someone familiar with what tramp needs wants to get this to work,
about all vc calls need to be tested to make sure they don't do
something that tramp can't do.