bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#4730: marked as done (23.1; tar-chown-entry corrupts tar file)


From: Emacs bug Tracking System
Subject: bug#4730: marked as done (23.1; tar-chown-entry corrupts tar file)
Date: Sat, 17 Oct 2009 04:45:09 +0000

Your message dated Sat, 17 Oct 2009 00:35:06 -0400
with message-id <address@hidden>
and subject line Re: bug#4730: 23.1; tar-chown-entry corrupts tar file
has caused the Emacs bug report #4730,
regarding 23.1; tar-chown-entry corrupts tar file
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact address@hidden
immediately.)


-- 
4730: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4730
Emacs Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 23.1; tar-chown-entry corrupts tar file Date: Thu, 15 Oct 2009 12:31:21 -0400 If I'm editing a tar file, and I change a subfile's owner or group, I
get the following:

Debugger entered--Lisp error: (cl-assertion-failed (not (or enable-multibyte-cha
racters (multibyte-string-p new-data-string))))
  signal(cl-assertion-failed ((not (or enable-multibyte-characters ...))))
  tar-alter-one-field(265 "root  tar-chown-entry("root")
  call-interactively(tar-chown-entry nil nil)

and tar will be unable to read that particular tar header. I'm
able to work around it with the following advice:

(defadvice tar-alter-one-field (around fix-multibyte-input)
  (let ((new-data-string (ad-get-arg 1)))
    (if (multibyte-string-p new-data-string)
        (ad-set-arg 1 (string-to-unibyte new-data-string)))
    ad-do-it))

This is on a Debian 4.0 box with GNU tar 1.16.

In GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2009-08-03 on discordia
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--with-x-toolkit=gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Tar

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <down-mouse-1> <mouse-1> C-x C-f f o o
<tab> . t <tab> <return> M-x t o g g l e - d e b u
g - <tab> e <tab> <return> O <C-backspace> r o o t
<return> <help-echo> <help-echo> <help-echo> <help-echo>
<down-mouse-1> <mouse-1> M-x r e p o <tab> r t - =
<backspace> e m a c s - b u g <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Parsing tar file...done
Loading vc-svn...done
Debug on Error enabled globally
Entering debugger...
Buffer foo.tar has shrunk a lot; auto save disabled in that buffer until next re
al save
Making completion list...


--- End Message ---
--- Begin Message --- Subject: Re: bug#4730: 23.1; tar-chown-entry corrupts tar file Date: Sat, 17 Oct 2009 00:35:06 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)
> If I'm editing a tar file, and I change a subfile's owner or group, I
> get the following:

> Debugger entered--Lisp error: (cl-assertion-failed (not (or
> enable-multibyte-cha
> racters (multibyte-string-p new-data-string))))
>   signal(cl-assertion-failed ((not (or enable-multibyte-characters ...))))
>   tar-alter-one-field(265 "root  tar-chown-entry("root")
>   call-interactively(tar-chown-entry nil nil)

Thank you.
I've installed the patch below which fixes it,


        Stefan


--- tar-mode.el.~1.141.~        2009-09-03 23:06:21.000000000 -0400
+++ tar-mode.el 2009-10-17 00:31:24.000000000 -0400
@@ -312,8 +313,12 @@
            link-p
            linkname
            uname-valid-p
-           (and uname-valid-p (substring string tar-uname-offset uname-end))
-           (and uname-valid-p (substring string tar-gname-offset gname-end))
+           (when uname-valid-p
+             (decode-coding-string
+              (substring string tar-uname-offset uname-end) coding))
+           (when uname-valid-p
+             (decode-coding-string
+              (substring string tar-gname-offset gname-end) coding))
            (tar-parse-octal-integer string tar-dmaj-offset tar-dmin-offset)
            (tar-parse-octal-integer string tar-dmin-offset tar-prefix-offset)
            ))))))
@@ -1013,7 +1018,10 @@
         (read-string "New UID string: " (tar-header-uname descriptor))))))
   (cond ((stringp new-uid)
         (setf (tar-header-uname (tar-current-descriptor)) new-uid)
-        (tar-alter-one-field tar-uname-offset (concat new-uid "\000")))
+        (tar-alter-one-field tar-uname-offset
+                              (concat (encode-coding-string
+                                       new-uid tar-file-name-coding-system)
+                                      "\000")))
        (t
         (setf (tar-header-uid (tar-current-descriptor)) new-uid)
         (tar-alter-one-field tar-uid-offset
@@ -1039,7 +1047,9 @@
   (cond ((stringp new-gid)
         (setf (tar-header-gname (tar-current-descriptor)) new-gid)
         (tar-alter-one-field tar-gname-offset
-          (concat new-gid "\000")))
+                              (concat (encode-coding-string
+                                       new-gid tar-file-name-coding-system)
+                                      "\000")))
        (t
         (setf (tar-header-gid (tar-current-descriptor)) new-gid)
         (tar-alter-one-field tar-gid-offset

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]