1 |
commit: 388a0ec1751688351781ddfd6175bc4e902356d1 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 25 01:00:45 2021 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 25 01:01:30 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=388a0ec1 |
7 |
|
8 |
sys-process/incron: Fix crash when accessing path of.. |
9 |
|
10 |
...created/moved dir in watched directory. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/785448 |
13 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
14 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
15 |
|
16 |
.../incron/files/incron-0.5.12-issue25.patch | 40 ++++++++++++++++++++++ |
17 |
...14.ebuild => incron-0.5.12_p20191114-r1.ebuild} | 7 ++-- |
18 |
2 files changed, 45 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/sys-process/incron/files/incron-0.5.12-issue25.patch b/sys-process/incron/files/incron-0.5.12-issue25.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..8883aec180a |
23 |
--- /dev/null |
24 |
+++ b/sys-process/incron/files/incron-0.5.12-issue25.patch |
25 |
@@ -0,0 +1,40 @@ |
26 |
+https://bugs.gentoo.org/785448 |
27 |
+ |
28 |
+Origin: https://github.com/ar-/incron/issues/25#issuecomment-583796322 |
29 |
+ |
30 |
+--- old/usertable.cpp |
31 |
++++ new/usertable.cpp |
32 |
+@@ -370,20 +370,21 @@ void UserTable::OnEvent(InotifyEvent& rEvt) |
33 |
+ { |
34 |
+ InotifyWatch* pW = rEvt.GetWatch(); |
35 |
+ IncronTabEntry* pE = FindEntry(pW); |
36 |
++ std::string pW_path = pW->GetPath(); |
37 |
+ |
38 |
+ // no entry found - this shouldn't occur |
39 |
+ if (pE == NULL) |
40 |
+ return; |
41 |
+ |
42 |
+ // discard event if user has no access rights to watch path |
43 |
+- if (!(m_fSysTable || MayAccess(pW->GetPath(), DONT_FOLLOW(rEvt.GetMask())))) |
44 |
++ if (!(m_fSysTable || MayAccess(pW_path, DONT_FOLLOW(rEvt.GetMask())))) |
45 |
+ return; |
46 |
+ |
47 |
+ //#if 0 |
48 |
+ // log output for each dir + file + event |
49 |
+ std::string events; |
50 |
+ rEvt.DumpTypes(events); |
51 |
+- syslog(LOG_INFO, "PATH (%s) FILE (%s) EVENT (%s)", pW->GetPath().c_str() , IncronTabEntry::GetSafePath(rEvt.GetName()).c_str() , events.c_str()); |
52 |
++ syslog(LOG_INFO, "PATH (%s) FILE (%s) EVENT (%s)", pW_path.c_str() , IncronTabEntry::GetSafePath(rEvt.GetName()).c_str() , events.c_str()); |
53 |
+ //#endif |
54 |
+ |
55 |
+ // add new watch for newly created subdirs |
56 |
+@@ -422,7 +423,7 @@ void UserTable::OnEvent(InotifyEvent& rEvt) |
57 |
+ else { |
58 |
+ cmd.append(cs.substr(oldpos, pos-oldpos)); |
59 |
+ if (cs[px] == '@') { // base path |
60 |
+- cmd.append(IncronTabEntry::GetSafePath(pW->GetPath())); |
61 |
++ cmd.append(IncronTabEntry::GetSafePath(pW_path)); |
62 |
+ oldpos = pos + 2; |
63 |
+ } |
64 |
+ else if (cs[px] == '#') { // file name |
65 |
+ |
66 |
|
67 |
diff --git a/sys-process/incron/incron-0.5.12_p20191114.ebuild b/sys-process/incron/incron-0.5.12_p20191114-r1.ebuild |
68 |
similarity index 88% |
69 |
rename from sys-process/incron/incron-0.5.12_p20191114.ebuild |
70 |
rename to sys-process/incron/incron-0.5.12_p20191114-r1.ebuild |
71 |
index 28928d33fc2..7e7ab9ba0fb 100644 |
72 |
--- a/sys-process/incron/incron-0.5.12_p20191114.ebuild |
73 |
+++ b/sys-process/incron/incron-0.5.12_p20191114-r1.ebuild |
74 |
@@ -1,4 +1,4 @@ |
75 |
-# Copyright 1999-2020 Gentoo Authors |
76 |
+# Copyright 1999-2021 Gentoo Authors |
77 |
# Distributed under the terms of the GNU General Public License v2 |
78 |
|
79 |
EAPI="7" |
80 |
@@ -20,7 +20,10 @@ IUSE="" |
81 |
DEPEND="" |
82 |
RDEPEND="" |
83 |
|
84 |
-PATCHES=( "${FILESDIR}"/${PN}-0.5.12-use-execl-instead-system.patch ) |
85 |
+PATCHES=( |
86 |
+ "${FILESDIR}"/${PN}-0.5.12-use-execl-instead-system.patch |
87 |
+ "${FILESDIR}"/${PN}-0.5.12-issue25.patch |
88 |
+) |
89 |
|
90 |
# < 2.6.18 => INOTIFY, >= 2.6.18 => INOTIFY_USER |
91 |
# It should be ok to expect at least 2.6.18 |