tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
wofi: do not follow symlinks in PATH
Gabriel Ebner
5 years ago
9b742a6a
280147c5
+44
2 changed files
expand all
collapse all
unified
split
pkgs
applications
misc
wofi
default.nix
do_not_follow_symlinks.patch
+5
pkgs/applications/misc/wofi/default.nix
···
13
13
nativeBuildInputs = [ pkg-config meson ninja wrapGAppsHook installShellFiles ];
14
14
buildInputs = [ wayland gtk3 ];
15
15
16
16
+
patches = [
17
17
+
# https://todo.sr.ht/~scoopta/wofi/121
18
18
+
./do_not_follow_symlinks.patch
19
19
+
];
20
20
+
16
21
postInstall = ''
17
22
installManPage man/wofi*
18
23
'';
+39
pkgs/applications/misc/wofi/do_not_follow_symlinks.patch
···
1
1
+
diff -r 3414ab984249 modes/run.c
2
2
+
--- a/modes/run.c Tue Aug 11 19:07:49 2020 -0700
3
3
+
+++ b/modes/run.c Sat Aug 22 13:39:52 2020 +0200
4
4
+
@@ -91,23 +91,10 @@
5
5
+
6
6
+
char* path = strdup(getenv("PATH"));
7
7
+
8
8
+
- struct map* paths = map_init();
9
9
+
-
10
10
+
char* save_ptr;
11
11
+
char* str = strtok_r(path, ":", &save_ptr);
12
12
+
do {
13
13
+
14
14
+
- str = realpath(str, NULL);
15
15
+
- if(str == NULL) {
16
16
+
- continue;
17
17
+
- }
18
18
+
- if(map_contains(paths, str)) {
19
19
+
- free(str);
20
20
+
- continue;
21
21
+
- }
22
22
+
-
23
23
+
- map_put(paths, str, "true");
24
24
+
-
25
25
+
DIR* dir = opendir(str);
26
26
+
if(dir == NULL) {
27
27
+
continue;
28
28
+
@@ -132,11 +119,9 @@
29
29
+
}
30
30
+
free(full_path);
31
31
+
}
32
32
+
- free(str);
33
33
+
closedir(dir);
34
34
+
} while((str = strtok_r(NULL, ":", &save_ptr)) != NULL);
35
35
+
free(path);
36
36
+
- map_free(paths);
37
37
+
map_free(cached);
38
38
+
map_free(entries);
39
39
+
}