bugGNU patch - Bugs: bug #31795, Fails to patch a broken symlink...

 
 

bug #31795: Fails to patch a broken symlink when using --backup and multiple filesystems

Submitter:  Loïc Minier <lool>
Submitted:  Mon 06 Dec 2010 12:15:36 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 06 Dec 2010 11:00:59 AM UTC, comment #2: 

Oh right, sorry about that; I'm using Debian/Ubuntu's patch which is from version 2.6 (Debian version 2.6-3).

Sorry for not checking against trunk, I should have thought of that

Loïc Minier <lool>
Mon 06 Dec 2010 10:46:36 AM UTC, comment #1: 

This bug no longer exists in the latest Alpha versions; patch will now refuse to patch symlinks:

  $ patch --version
  GNU patch 2.6.1.108-7fae
  [...]
  $ patch -p0 --backup [...]
  File bar is not a regular file -- can't patch

Next time, please report which version of patch the bug is against.  Thanks.

Andreas Gruenbacher <agruen>
Group administrator
Mon 06 Dec 2010 12:15:36 AM UTC, original submission:  

Hi there

While working with "quilt" on a Debian package, it would fail in my home dir but not in /tmp.  I could create a small test case with patch alone.

When patching a symlink to a non-existent directory and using --backup, patch renames some files from TMPDIR (/tmp by default) into the current directory. This fails if it's not on the same filesystem.

Here's a test case:
mkdir test; cd test
ln -sf foo/foo bar
patch -p0 --backup <<EOF
diff bar bar
--- /dev/null
+++ bar
@@ -0,0 +1 @@
+coin
EOF

This fails with:
patching file bar
patch: ** Can't create file bar : No such file or directory

/!\ This only fails if your current directory is in a different filesystem than /tmp.

This works around the bug: mkdir ./tmp; TMPDIR=./tmp

I've also filed this at https://bugs.launchpad.net/ubuntu/+source/patch/+bug/685538

Cheers,

Loïc Minier <lool>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by agruen (Posted a comment)
  • -email is unavailable- added by lool (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-06 agruen StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code