!1 Package init
From: @zhengyaohui Reviewed-by: @small_leek Signed-off-by: @small_leek
This commit is contained in:
commit
5e5a3178a9
@ -0,0 +1,24 @@
|
||||
From: Dmitry Bogatov <KAction@gnu.org>
|
||||
Date: Sat, 4 Mar 2017 21:13:38 +0300
|
||||
Subject: [PATCH] Fix segfault with csv output when filename contains comma
|
||||
|
||||
Double `csv_escape()'ing filename is logic error, but root of the
|
||||
problem was that passing `csv' buffer back into `csv_escape()' caused
|
||||
endless loop over `static char csv[MAXLEN]', and buffer overflow.
|
||||
---
|
||||
src/inotifywait.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/inotifywait.c b/src/inotifywait.c
|
||||
index 98aadd4..6e17007 100644
|
||||
--- a/src/inotifywait.c
|
||||
+++ b/src/inotifywait.c
|
||||
@@ -119,7 +119,7 @@ void validate_format( char * fmt ) {
|
||||
void output_event_csv( struct inotify_event * event ) {
|
||||
char *filename = csv_escape(inotifytools_filename_from_wd(event->wd));
|
||||
if (filename != NULL)
|
||||
- printf("%s,", csv_escape(filename));
|
||||
+ printf("%s,", filename);
|
||||
|
||||
printf("%s,", csv_escape( inotifytools_event_to_str( event->mask ) ) );
|
||||
if ( event->len > 0 )
|
||||
33
0006-Fix-buffer-overrun-in-inotifytools.c.patch
Normal file
33
0006-Fix-buffer-overrun-in-inotifytools.c.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From: Dmitry Bogatov <KAction@debian.org>
|
||||
Date: Tue, 6 Aug 2019 16:36:24 +0000
|
||||
Subject: Fix buffer overrun in inotifytools.c
|
||||
|
||||
The following code
|
||||
|
||||
char *names[2+sizeof(int)/sizeof(char*)];
|
||||
|
||||
was supposed to allocate enough space on stack to fit two `char *' and one
|
||||
`int'. Problem is that when sizeof(int) < sizeof(char *), which is likely on
|
||||
64-bit systems, it caused expression `sizeof(int)/sizeof(char*)' evaluate to 0,
|
||||
resulting in buffer overrun.
|
||||
|
||||
Detected by GCC-9 new diagnostics.
|
||||
|
||||
Closes: #925717
|
||||
---
|
||||
libinotifytools/src/inotifytools.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libinotifytools/src/inotifytools.c b/libinotifytools/src/inotifytools.c
|
||||
index b3feca3..ce4ccd5 100644
|
||||
--- a/libinotifytools/src/inotifytools.c
|
||||
+++ b/libinotifytools/src/inotifytools.c
|
||||
@@ -859,7 +859,7 @@ void inotifytools_set_filename_by_filename( char const * oldname,
|
||||
void inotifytools_replace_filename( char const * oldname,
|
||||
char const * newname ) {
|
||||
if ( !oldname || !newname ) return;
|
||||
- char *names[2+sizeof(int)/sizeof(char*)];
|
||||
+ char *names[2+sizeof(int)/sizeof(char*) + 1];
|
||||
names[0] = (char*)oldname;
|
||||
names[1] = (char*)newname;
|
||||
*((int*)&names[2]) = strlen(oldname);
|
||||
BIN
inotify-tools-3.14.tar.gz
Normal file
BIN
inotify-tools-3.14.tar.gz
Normal file
Binary file not shown.
62
inotify-tools.spec
Normal file
62
inotify-tools.spec
Normal file
@ -0,0 +1,62 @@
|
||||
Name: inotify-tools
|
||||
Version: 3.14
|
||||
Release: 1
|
||||
Summary: Command line utilities for inotify
|
||||
License: GPLv2
|
||||
URL: https://github.com/inotify-tools
|
||||
Source0: http://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-%{version}.tar.gz
|
||||
Patch1: 0005-Fix-segfault-with-csv-output-when-filename-contains-.patch
|
||||
Patch2: 0006-Fix-buffer-overrun-in-inotifytools.c.patch
|
||||
BuildRequires: gcc autoconf doxygen
|
||||
%description
|
||||
inotify-tools is a set of command-line programs for Linux providing
|
||||
a simple interface to inotify. These programs can be used to monitor
|
||||
and act upon filesystem events.
|
||||
|
||||
%package devel
|
||||
Summary: Headers and libraries for building apps that use libinotifytools
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%description devel
|
||||
This package contains headers and libraries required to build applications
|
||||
that use the libinotifytools library.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%build
|
||||
%configure \
|
||||
--disable-dependency-tracking \
|
||||
--disable-static \
|
||||
--enable-doxygen
|
||||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
||||
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
make install DESTDIR=%{buildroot}
|
||||
find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
|
||||
rm -rf %{buildroot}/%{_datadir}/doc/
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%doc AUTHORS COPYING ChangeLog NEWS README
|
||||
%{_bindir}/inotifywait
|
||||
%{_bindir}/inotifywatch
|
||||
%{_libdir}/libinotifytools.so.*
|
||||
%{_mandir}/man1/inotifywait.1*
|
||||
%{_mandir}/man1/inotifywatch.1*
|
||||
|
||||
%files devel
|
||||
%doc libinotifytools/src/doc/html/*
|
||||
%dir %{_includedir}/inotifytools/
|
||||
%{_includedir}/inotifytools/inotify.h
|
||||
%{_includedir}/inotifytools/inotify-nosys.h
|
||||
%{_includedir}/inotifytools/inotifytools.h
|
||||
%{_libdir}/libinotifytools.so
|
||||
|
||||
%changelog
|
||||
* Tue Sep 7 2021 zhengyaohui <zhengyaohui1@huawei.com> - 3.14-1
|
||||
- package init
|
||||
Loading…
x
Reference in New Issue
Block a user