Displaying 20 results from an estimated 24 matches for "have_yara".
Did you mean:
have_data
2016 Nov 09
0
[PATCH v2 2/6] New API: yara_load
....am
@@ -200,6 +200,7 @@ guestfsd_SOURCES = \
wc.c \
xattr.c \
xfs.c \
+ yara.c \
zero.c \
zerofree.c
diff --git a/daemon/cleanups.c b/daemon/cleanups.c
index 092e493..a02e521 100644
--- a/daemon/cleanups.c
+++ b/daemon/cleanups.c
@@ -24,6 +24,12 @@
#include <augeas.h>
+#ifdef HAVE_YARA
+
+#include <yara.h>
+
+#endif /* !HAVE_YARA */
+
#include "cleanups.h"
/* Use by the CLEANUP_* macros. Do not call these directly. */
@@ -62,6 +68,15 @@ cleanup_close (void *ptr)
}
void
+cleanup_fclose (void *ptr)
+{
+ FILE *f = * (FILE **) ptr;
+
+ if (f)
+ fclose (...
2016 Nov 09
9
[PATCH v2 0/6] Feature: Yara file scanning
v2:
- Fix yara dependency in packagelist
- Use pkg-config where available
- Improve longdesc of yara_load API
- Fix libyara initialization and finalization
- Import CLEANUP_FCLOSE
- Add custom CLEANUP_DESTROY_YARA_COMPILER
- Add rules compilation error callback
- Other small fixes according to comments
Matteo Cafasso (6):
appliance: add yara dependency
New API: yara_load
New API:
2019 Dec 10
2
Re: Libguestfs with Yara rules error
...page for
>
> If we check the manual, in guestfs appears guestfs_yara_load function so
> libyara is installed. I installed and compiled it from tarballs.
This function:
https://github.com/libguestfs/libguestfs/blob/4aa4edf972bc8df8869cdcaa4ab4f40b63a626cf/daemon/yara.c#L308
returns 1 if HAVE_YARA is defined. This is defined by this
./configure test:
https://github.com/libguestfs/libguestfs/blob/4aa4edf972bc8df8869cdcaa4ab4f40b63a626cf/m4/guestfs-daemon.m4#L128
In other words it depends how libguestfs was configured. Where
did you get libguestfs from? How was it compiled?
Rich.
--
Ri...
2016 Nov 09
0
[PATCH v2 1/6] appliance: add yara dependency
...HAVE_LIBTSK], [1], [Define to 1 if The Sleuth Kit library (libtsk) is available.])
], [])
],[AC_MSG_WARN([The Sleuth Kit library (libtsk) not found])])
+
+dnl yara library (optional)
+PKG_CHECK_MODULES([YARA], [libyara],[
+ AC_SUBST([YARA_CFLAGS])
+ AC_SUBST([YARA_LIBS])
+ AC_DEFINE([HAVE_YARA],[1],[yara library found at compile time.])
+],[
+ AC_CHECK_LIB([yara],[yr_initialize],[
+ AC_CHECK_HEADER([yara.h],[
+ AC_SUBST([YARA_LIBS], [-lyara])
+ AC_DEFINE([HAVE_YARA], [1], [Define to 1 if Yara library is available.])
+ ], [])
+ ],[AC_MSG_WARN([Yar...
2016 Dec 18
0
[PATCH v3 1/6] appliance: add yara dependency
...HAVE_LIBTSK], [1], [Define to 1 if The Sleuth Kit library (libtsk) is available.])
], [])
],[AC_MSG_WARN([The Sleuth Kit library (libtsk) not found])])
+
+dnl yara library (optional)
+PKG_CHECK_MODULES([YARA], [libyara],[
+ AC_SUBST([YARA_CFLAGS])
+ AC_SUBST([YARA_LIBS])
+ AC_DEFINE([HAVE_YARA],[1],[yara library found at compile time.])
+],[
+ AC_CHECK_LIB([yara],[yr_initialize],[
+ AC_CHECK_HEADER([yara.h],[
+ AC_SUBST([YARA_LIBS], [-lyara])
+ AC_DEFINE([HAVE_YARA], [1], [Define to 1 if Yara library is available.])
+ ], [])
+ ],[AC_MSG_WARN([Yar...
2017 Mar 12
0
[PATCH v4 2/7] appliance: add yara dependency
...HAVE_LIBTSK], [1], [Define to 1 if The Sleuth Kit library (libtsk) is available.])
], [])
],[AC_MSG_WARN([The Sleuth Kit library (libtsk) not found])])
+
+dnl yara library (optional)
+PKG_CHECK_MODULES([YARA], [libyara],[
+ AC_SUBST([YARA_CFLAGS])
+ AC_SUBST([YARA_LIBS])
+ AC_DEFINE([HAVE_YARA],[1],[yara library found at compile time.])
+],[
+ AC_CHECK_LIB([yara],[yr_initialize],[
+ AC_CHECK_HEADER([yara.h],[
+ AC_SUBST([YARA_LIBS], [-lyara])
+ AC_DEFINE([HAVE_YARA], [1], [Define to 1 if Yara library is available.])
+ ], [])
+ ],[AC_MSG_WARN([Yar...
2017 Apr 06
0
[PATCH v6 2/7] appliance: add yara dependency
...HAVE_LIBTSK], [1], [Define to 1 if The Sleuth Kit library (libtsk) is available.])
], [])
],[AC_MSG_WARN([The Sleuth Kit library (libtsk) not found])])
+
+dnl yara library (optional)
+PKG_CHECK_MODULES([YARA], [libyara],[
+ AC_SUBST([YARA_CFLAGS])
+ AC_SUBST([YARA_LIBS])
+ AC_DEFINE([HAVE_YARA],[1],[yara library found at compile time.])
+],[
+ AC_CHECK_LIB([yara],[yr_initialize],[
+ AC_CHECK_HEADER([yara.h],[
+ AC_SUBST([YARA_LIBS], [-lyara])
+ AC_DEFINE([HAVE_YARA], [1], [Define to 1 if Yara library is available.])
+ ], [])
+ ],[AC_MSG_WARN([Yar...
2017 Mar 12
0
[PATCH v4 3/7] New API: yara_load
...>
+#include <stdbool.h>
+#include <rpc/xdr.h>
+#include <rpc/types.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "daemon.h"
+#include "actions.h"
+#include "optgroups.h"
+#include "guestfs_protocol.h"
+
+#ifdef HAVE_YARA
+
+#include <yara.h>
+
+#define CLEANUP_DESTROY_YARA_COMPILER \
+ __attribute__((cleanup(cleanup_destroy_yara_compiler)))
+
+struct write_callback_data {
+ int fd;
+ uint64_t written;
+};
+
+/* Yara compiled rules. */
+static YR_RULES *rules = NULL;
+static bool i...
2017 Mar 12
8
[PATCH v4 0/7] Feature: Yara file scanning
Rebase patches on top of 1.37.1.
No changes since last series.
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am
2017 Apr 06
0
[PATCH v6 3/7] New API: yara_load
...>
+#include <stdbool.h>
+#include <rpc/xdr.h>
+#include <rpc/types.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "daemon.h"
+#include "actions.h"
+#include "optgroups.h"
+#include "guestfs_protocol.h"
+
+#ifdef HAVE_YARA
+
+#include <yara.h>
+
+#define CLEANUP_DESTROY_YARA_COMPILER \
+ __attribute__((cleanup(cleanup_destroy_yara_compiler)))
+
+struct write_callback_data {
+ int fd;
+ uint64_t written;
+};
+
+/* Yara compiled rules. */
+static YR_RULES *rules = NULL;
+static bool i...
2017 Apr 24
0
[PATCH v8 4/8] New API: yara_load
...>
+#include <stdbool.h>
+#include <rpc/xdr.h>
+#include <rpc/types.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "daemon.h"
+#include "actions.h"
+#include "optgroups.h"
+#include "guestfs_protocol.h"
+
+#ifdef HAVE_YARA
+
+#include <yara.h>
+
+#ifdef HAVE_ATTRIBUTE_CLEANUP
+#define CLEANUP_DESTROY_YARA_COMPILER \
+ __attribute__((cleanup(cleanup_destroy_yara_compiler)))
+#else
+#define CLEANUP_DESTROY_YARA_COMPILER
+#endif
+
+struct write_callback_data {
+ int fd;
+ uint64_t writ...
2017 Apr 04
0
[PATCH v5 3/7] New API: yara_load
...>
+#include <stdbool.h>
+#include <rpc/xdr.h>
+#include <rpc/types.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "daemon.h"
+#include "actions.h"
+#include "optgroups.h"
+#include "guestfs_protocol.h"
+
+#ifdef HAVE_YARA
+
+#include <yara.h>
+
+#define CLEANUP_DESTROY_YARA_COMPILER \
+ __attribute__((cleanup(cleanup_destroy_yara_compiler)))
+
+struct write_callback_data {
+ int fd;
+ uint64_t written;
+};
+
+/* Yara compiled rules. */
+static YR_RULES *rules = NULL;
+static bool i...
2016 Dec 18
6
[PATCH v3 0/6] Feature: Yara file scanning
v3:
- allow to load multiple rule files
- added optional namespace parameter to yara_load
- move destructor logic in yara module
- use generic file upload logic
- use generic temporary path function
Matteo Cafasso (6):
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
2016 Nov 21
2
Re: [PATCH v2 2/6] New API: yara_load
...]
> diff --git a/daemon/cleanups.c b/daemon/cleanups.c
> index 092e493..a02e521 100644
> --- a/daemon/cleanups.c
> +++ b/daemon/cleanups.c
> @@ -78,3 +93,16 @@ cleanup_free_stringsbuf (void *ptr)
> {
> free_stringsbuf ((struct stringsbuf *) ptr);
> }
> +
> +#ifdef HAVE_YARA
> +
> +void
> +cleanup_destroy_yara_compiler (void *ptr)
> +{
> + YR_COMPILER *compiler = * (YR_COMPILER **) ptr;
> +
> + if (compiler != NULL)
> + yr_compiler_destroy (compiler);
> +}
> +
This should rather be directly in daemon/yara.c, since libyara would be
us...
2017 Apr 06
14
[PATCH v6 0/7] Feature: Yara file scanning
v6:
- use new test functions
- fix yara_detection struct field names
- revert yara_load function to initial version
With Pino we were exploring the idea of allowing Users to load multiple
rule files with subsequent calls to yara_load API.
https://www.redhat.com/archives/libguestfs/2016-November/msg00119.html
It turns out impractical due to YARA API limitations. It is possible
to load multiple
2017 Feb 19
9
[PATCH v3 0/7] Feature: Yara file scanning
Rebase patches on top of 1.35.25.
No changes since last series.
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am
2017 Apr 04
13
[PATCH v5 0/7] Feature: Yara file scanning
v5:
- rebase on top of 1.37.9
- add missing actions_yara.* files
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am
2017 Apr 24
10
[PATCH v8 0/8] Feature: Yara file scanning
v8:
- Ignore returned value in daemon/upload.c
- Report serialization errors in lib/yara.c
Matteo Cafasso (8):
daemon: ignore unused return value in upload function
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in
2017 Apr 25
8
[PATCH v9 0/7] Feature: Yara file scanning
v9:
- fixes according to comments
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am | 4 +-
2019 Dec 21
1
Re: Libguestfs with Yara rules error
...stfs appears guestfs_yara_load function so
>>> libyara is installed. I installed and compiled it from tarballs.
>> This function:
>>
>> https://github.com/libguestfs/libguestfs/blob/4aa4edf972bc8df8869cdcaa4ab4f40b63a626cf/daemon/yara.c#L308
>>
>> returns 1 if HAVE_YARA is defined. This is defined by this
>> ./configure test:
>>
>> https://github.com/libguestfs/libguestfs/blob/4aa4edf972bc8df8869cdcaa4ab4f40b63a626cf/m4/guestfs-daemon.m4#L128
>>
>> In other words it depends how libguestfs was configured. Where
>> did you get l...