[Bug 1111572] New: patch segfaults if it can't write *.orig
http://bugzilla.opensuse.org/show_bug.cgi?id=1111572 Bug ID: 1111572 Summary: patch segfaults if it can't write *.orig Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development Assignee: jdelvare@suse.com Reporter: suse-beta@cboltz.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Created attachment 785784 --> http://bugzilla.opensuse.org/attachment.cgi?id=785784&action=edit reproducer (tar.gz) Tumbleweed 20181009, patch-2.7.6-3.5.x86_64 I tried to apply a (non-matching) patch, and when patch tried to create the *.orig file, it printed a long list of error messages: # patch cleanprofile.py < changes.diff patch: **** Can't create file cleanprofile.py.orig : Permission denied patch: **** Can't create file cleanprofile.py.orig : Permission denied patch: **** Can't create file cleanprofile.py.orig : Permission denied patch: **** Can't create file cleanprofile.py.orig : Permission denied patch: **** Can't create file cleanprofile.py.orig : Permission denied [...] patch: **** Can't create file cleanprofile.py.orig : Permission denied patch: **** Can't create file cleanprofile.py.orig : Permission denied patch: **** Can't create file cleanprofile.py.orig : Permission denied patch: **** Can't create file cleanprofile.py.origSegmentation fault (core dumped) I'd expect _one_ "Permission denied" message, and no segfault. Reproducer: - unpack the attached tarball (as user) - chown root cleanprofile.py.orig (obviously as root) - run patch cleanprofile.py < changes.diff as user Note: This seems to be related to the files in the attached tarball. If I try with a simple one-line file and a boring patch, patch doesn't segfault. The reproducer files must have something special that send patch into an endless loop. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111572 http://bugzilla.opensuse.org/show_bug.cgi?id=1111572#c1 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CONFIRMED --- Comment #1 from Jean Delvare <jdelvare@suse.com> --- Thanks for reporting. I can reproduce the bug with the latest upstream version (from git repository). I can't reproduce the bug with the patch version in Leap 42.3 (patch-2.7.5-9.3.1). So this looks like a regression. I'll bisect it. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111572 http://bugzilla.opensuse.org/show_bug.cgi?id=1111572#c2 --- Comment #2 from Jean Delvare <jdelvare@suse.com> --- Note that the bug can be reproduced with: $ chmod -w cleanprofile.py.orig instead of: $ chown root cleanprofile.py.orig So it can be reproduced without being root on the test system. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111572 http://bugzilla.opensuse.org/show_bug.cgi?id=1111572#c3 --- Comment #3 from Jean Delvare <jdelvare@suse.com> --- Bisection points to this upstream commit: commit 66fdcf0e7c83a1e2eb4db97b9e24f224db656b65 Author: Andreas Gruenbacher Date: Tue Jul 19 22:40:40 2016 +0200 Fix broken git-style patch behavior I'll open an upstream bug. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111572 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- URL| |https://savannah.gnu.org/bu | |gs/index.php?54845 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111572 http://bugzilla.opensuse.org/show_bug.cgi?id=1111572#c4 Christian Boltz <suse-beta@cboltz.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |agruen@linbit.com --- Comment #4 from Christian Boltz <suse-beta@cboltz.de> --- According to https://savannah.gnu.org/bugs/index.php?54845 this was fixed in upstream git some months ago, but it seems there wasn't a new release since then. Therefore it's not too surprising that I can still reproduce this bug on current Tumbleweed ;-) - maybe you can convince upstream to do a release? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111572 http://bugzilla.opensuse.org/show_bug.cgi?id=1111572#c5 --- Comment #5 from OBSbugzilla Bot <bwiedemann+obsbugzillabot@suse.com> --- This is an autogenerated message for OBS integration: This bug (1111572) was mentioned in https://build.opensuse.org/request/show/976181 Factory / patch -- You are receiving this mail because: You are on the CC list for the bug.
participants (2)
-
bugzilla_noreply@novell.com
-
bugzilla_noreply@suse.com