File: fix_segfault_in_unlink

package info (click to toggle)
rsyncrypto 1.14-1.2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,552 kB
  • sloc: cpp: 3,459; sh: 1,221; makefile: 29
file content (17 lines) | stat: -rw-r--r-- 630 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Description: fix segfault
 This fixes a crash when using rsyncrypto to refresh an
 encrypted directory tree with --delete enabled.
 This happens because of an infinite recursion in autofd::unlink()
Author: Chris Boot <bootc@debian.org>
Last-Update: 2019-02-09
--- a/autofd.h
+++ b/autofd.h
@@ -216,7 +216,7 @@
     // unless it failed with ENOENT - the file already doesn't exist
     static int unlink(const char *pathname)
     {
-        bool success=unlink( pathname )==0;
+        bool success=::unlink( pathname )==0;
         if( !success && errno!=ENOENT )
             throw rscerror("Erasing file", errno, pathname );