* mime-play.el (mime-activate-mailcap-method): Don't use
[elisp/semi.git] / mime-play.el
index c766828..846f8cc 100644 (file)
@@ -151,10 +151,9 @@ specified, play as it.  Default MODE is \"play\"."
           (let ((command
                  (mime-format-mailcap-command
                   method
-                  (cons (cons 'filename name) situation))))
-            (binary-to-text-funcall
-             mime-play-messages-coding-system
-             #'start-process command mime-echo-buffer-name
+                  (cons (cons 'filename name) situation)))
+                 (coding-system-for-read mime-play-messages-coding-system))
+            (start-process command mime-echo-buffer-name
              shell-file-name shell-command-switch command))))
       (set-alist 'mime-mailcap-method-filename-alist process name)
       (set-process-sentinel process 'mime-mailcap-method-sentinel))))
@@ -351,11 +350,13 @@ It is registered to variable `mime-preview-quitting-method-alist'."
 The permission of the created directory becomes `700' (for the owner only).
 If the directory already exists and is writable by other users, an error
 occurs."
-  (let ((orig-modes (default-file-modes)))
-    (if (file-directory-p dir)
+  (let ((attr (file-attributes dir))
+       (orig-modes (default-file-modes)))
+    (if (and attr (eq (car attr) t)) ; directory already exists.
        (unless (or (memq system-type '(windows-nt ms-dos OS/2 emx))
-                   (eq (file-modes dir) 448))
-         (error "Invalid permission for %s" dir))
+                   (and (eq (nth 2 attr) (user-real-uid))
+                        (eq (file-modes dir) 448)))
+         (error "Invalid owner or permission for %s" dir))
       (unwind-protect
          (progn
            (set-default-file-modes 448)