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.