File: 0001-Rename-variable-mount-to-mount_dir-to-avoid-calling-.patch

package info (click to toggle)
rdiff-backup-fs 1.0.0-7
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 940 kB
  • sloc: sh: 3,800; ansic: 2,941; makefile: 23
file content (117 lines) | stat: -rw-r--r-- 3,799 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
From 9a60b26d8a1e7e7240569561c96006817279b78f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu@mailbox.org>
Date: Wed, 19 Apr 2017 18:05:06 +0200
Subject: Rename variable mount to mount_dir to avoid calling it as function.

Looks like the dynamic linker uses here the variable "mount" from
rdiff-backup-fs.c that gets later called by fuse library.

Program received signal SIGSEGV, Segmentation fault.
0x80015110 in mount ()
(gdb) bt
#0  0x80015110 in mount ()
#1  0xb7f8ff03 in fuse_mount_sys (mnt_opts=0x800163a8 "rw,nosuid,nodev", mo=0xbffff398, 
    mnt=0x80016288 "/home/benutzer/rdiff-backup-fs-test/mnt") at mount.c:499
#2  fuse_kern_mount (mountpoint=0x80016288 "/home/benutzer/rdiff-backup-fs-test/mnt", args=0xbffff550) at mount.c:607
#3  0xb7f8b89c in fuse_mount_compat25 (mountpoint=0x80016288 "/home/benutzer/rdiff-backup-fs-test/mnt", args=0xbffff550) at helper.c:488
#4  0xb7f8b908 in fuse_mount_common (mountpoint=0x80016288 "/home/benutzer/rdiff-backup-fs-test/mnt", args=args@entry=0xbffff550)
    at helper.c:248
#5  0xb7f8b9de in fuse_setup_common (argc=2, argv=0xbffff5f4, op=0x80015200 <operations>, op_size=180, mountpoint=0xbffff5b4, 
    multithreaded=0xbffff5b8, fd=0x0, user_data=0x0, compat=0) at helper.c:298
#6  0xb7f8bb5d in fuse_main_common (argc=<optimized out>, argv=<optimized out>, op=<optimized out>, op_size=180, user_data=0x0, compat=0)
    at helper.c:363
#7  0x8000112f in run (argc=3, argv=0xbffff6d4) at rdiff-backup-fs.c:37
#8  0x80000f3b in main (argc=3, argv=0xbffff6d4) at rdiff-backup-fs.c:43
(gdb) print mount
$1 = 0x80016020 "/home/benutzer/rdiff-backup-fs-test/mnt"

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858316
---
 externs.h         | 2 +-
 initialize.c      | 2 +-
 parse.c           | 8 ++++----
 rdiff-backup-fs.c | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/externs.h b/externs.h
index 029dd5c..3cbe455 100644
--- a/externs.h
+++ b/externs.h
@@ -5,7 +5,7 @@
 
 #include <fuse.h>
 
-extern char *mount;
+extern char *mount_dir;
 // directory where data directory should be created
 extern char *tmp_dir;
 // directory where file system's data will be kept
diff --git a/initialize.c b/initialize.c
index 0cc1b65..be32014 100644
--- a/initialize.c
+++ b/initialize.c
@@ -5,7 +5,7 @@
 
 void check_mount(){
     
-    if (gpthpro(&mount) != 0)
+    if (gpthpro(&mount_dir) != 0)
     	fail(ERR_NO_MOUNT);
             
 };
diff --git a/parse.c b/parse.c
index f919f7a..0fccc58 100644
--- a/parse.c
+++ b/parse.c
@@ -138,9 +138,9 @@ void parse_repo(struct file_system_info *fsinfo, int argc, char** argv, int *ind
 
 void parse_mount(char *arg){
 
-    if (mount != NULL)
+    if (mount_dir != NULL)
 		fail(ERR_PARAMETRES);
-    if (gstrcpy(&mount, arg) != 0)
+    if (gstrcpy(&mount_dir, arg) != 0)
     	fail(-1);
 
 };
@@ -160,12 +160,12 @@ int parse(struct file_system_info *fsinfo, int argc, char **argv){
     for (i = 1; i < argc; i++){
 		if (isOption(argv[i]) == 1)
 	    	parse_option(fsinfo, argc, argv, &i);
-		else if (mount == NULL)
+		else if (mount_dir == NULL)
 	    	parse_mount(argv[i]);
 		else
 	    	parse_repo(fsinfo, argc, argv, &i);
 	};
-    if (mount == NULL)
+    if (mount_dir == NULL)
 		fail(ERR_NO_MOUNT);
     if (fsinfo->repo_count == 0)
 		fail(ERR_NO_REPO);
diff --git a/rdiff-backup-fs.c b/rdiff-backup-fs.c
index c97abbb..a15014b 100644
--- a/rdiff-backup-fs.c
+++ b/rdiff-backup-fs.c
@@ -7,7 +7,7 @@
 
 #include <fuse.h>
 
-char *mount = NULL;
+char *mount_dir = NULL;
 char *tmp_dir = NULL;
 char *data_dir = NULL;
 
@@ -28,7 +28,7 @@ int run(int argc, char **argv){
     initialize(file_system_info);
     
     args[0] = argv[0];
-    args[1] = mount;
+    args[1] = mount_dir;
     args[2] = "-d";
     
     if (debug)
-- 
2.11.0