[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#294074: prcs-el: breaks opening files under unreadable directories



Package: prcs-el
Version: 1.3.3-3
Severity: important

It is possible for a directory to be executable but not readable, in
which case one can access its contents by name but not list them.  For
instance, the pam-tmpdir module I have installed sets up per-user
temporary directories under /tmp/user, which has rwx--x--x
permissions.

Attempting to open a file under such a directory in Emacs with prcs-el
installed blows out; I'm including a backtrace at the end of this
report.

As such, I'd suggest wrapping prcs-is-potentially-prcs-controlled's
call to directory-files with condition-case:

(condition-case nil (directory-files ...) (error nil))

(This may also help work around the bad interaction with ange-ftp
noted in that function's comments.)

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.27
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages prcs-el depends on:
ii  emacs21 [emacsen]             21.3+1-9   The GNU Emacs editor
ii  prcs                          1.3.3-3    The Project Revision Control Syste
ii  xemacs21                      21.4.16-1  Editor and kitchen sink
ii  xemacs21-mule [xemacs21]      21.4.16-1  Editor and kitchen sink -- Mule bi
ii  xemacs21-nomule [xemacs21]    21.4.16-1  Editor and kitchen sink -- Non-mul

-- no debconf information

Debugger entered--Lisp error: (file-error "Opening directory" "permission denied" "/tmp/user/")
  directory-files("/tmp/user/" t "^[A-Za-z0-9#%^_+:,][A-Za-z0-9#%^_+:,-=.]*\\.prj$")
  (save-excursion (set-buffer (get-buffer-create "*scratch*")) (directory-files test-dir t "^[A-Za-z0-9#%^_+:,][A-Za-z0-9#%^_+:,-=.]*\\.prj$"))
  (let* ((test-dir ...) (test-files ...)) (setq potential (nconc potential test-files)))
  (progn (setq idx (match-end 0)) (let* (... ...) (setq potential ...)))
  (if (string-match "/" dir idx) (progn (setq idx ...) (let* ... ...)) (setq stop t))
  (while (not stop) (if (string-match "/" dir idx) (progn ... ...) (setq stop t)))
  (let ((idx 0) (stop nil)) (while (not stop) (if ... ... ...)) nil)
  (catch (quote --cl-block-nil--) (let (... ...) (while ... ...) nil))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let ... ... nil)))
  (block nil (let (... ...) (while ... ...) nil))
  (do ((idx 0) (stop nil)) (stop nil) (if (string-match "/" dir idx) (progn ... ...) (setq stop t)))
  (let* ((dir ...) (potential nil)) (do (... ...) (stop nil) (if ... ... ...)) (reverse potential))
  prcs-is-potentially-prcs-controlled("/tmp/user/7286/pts_2/reportbug-bash-20050207-11217-biBW5s")
  (let ((--dolist-temp--27223 ...) try) (while --dolist-temp--27223 (setq try ...) (let ... ... ... ...) (setq --dolist-temp--27223 ...)) nil)
  (catch (quote --cl-block-nil--) (let (... try) (while --dolist-temp--27223 ... ... ...) nil))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let ... ... nil)))
  (block nil (let (... try) (while --dolist-temp--27223 ... ... ...) nil))
  (dolist (try (prcs-is-potentially-prcs-controlled name)) (let (...) (when ... ...) (set-buffer buf) (if ... ... ...)))
  (catch (quote --cl-block-iterate--) (dolist (try ...) (let ... ... ... ...)) nil)
  (cl-block-wrapper (catch (quote --cl-block-iterate--) (dolist ... ...) nil))
  (block iterate (dolist (try ...) (let ... ... ... ...)) nil)
  (save-excursion (block iterate (dolist ... ...) nil))
  (if (and (not treat-as-non-p-file) (string-match "\\.prj$" name)) (let (... ...) (save-excursion ... ... ...)) (save-excursion (block iterate ... nil)))
  (catch (quote --cl-block-prcs-is-prcs-controlled--) (if (and ... ...) (let ... ...) (save-excursion ...)))
  (cl-block-wrapper (catch (quote --cl-block-prcs-is-prcs-controlled--) (if ... ... ...)))
  (block prcs-is-prcs-controlled (if (and ... ...) (let ... ...) (save-excursion ...)))
  (let* ((get-descriptor-too ...) (treat-as-non-p-file ...)) (let (...) (while --keys--27218 ...)) (block prcs-is-prcs-controlled (if ... ... ...)))
  prcs-is-prcs-controlled("/tmp/user/7286/pts_2/reportbug-bash-20050207-11217-biBW5s" :get-descriptor-too t)
  (let* ((link ...) (link-ctld ...) (info ...)) (if link (if link-ctld ... ...) (when info ...)))
  prcs-maybe-put-into-controlled-mode()
  run-hooks(find-file-hooks)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer reportbug-bash-20050207-11217-biBW5s> "/tmp/user/7286/pts_2/reportbug-bash-20050207-11217-biBW5s" nil nil "/tmp/user/7286/pts_2/reportbug-bash-20050207-11217-biBW5s" (2227291 8449))
  find-file-noselect("/tmp/user/7286/pts_2/reportbug-bash-20050207-11217-biBW5s" nil nil nil)
  find-file("/tmp/user/7286/pts_2/reportbug-bash-20050207-11217-biBW5s")
  find-alternate-file("/tmp/user/7286/pts_2/reportbug-bash-20050207-11217-biBW5s")
  call-interactively(find-alternate-file)



Reply to: