Displaying 20 results from an estimated 36 matches for "cleanup_aug_close".
2014 Sep 04
10
[PATCH 0/5] use augeas for /etc/shadow
Hi,
currently /etc/shadow is edited manually when needed (i.e. when setting
the password for an user), and it is not changed when removing users.
Import the upstream shadow.aug (currently in their development serie,
but not part of any released version yet), and use it only when the
augeas version is less than a potential 1.2.1 (covering also the case
when the new version is just 1.3.0).
Pino
2020 Jan 09
0
[PATCH v2 4/4] daemon: drop usage of C augeas library
...or ? aug_err_minor : "", \
- aug_err_details ? ": " : "", aug_err_details ? aug_err_details : ""); \
- } \
- } while (0)
-
-int augeas_version;
-
-void
-aug_read_version (void)
-{
- CLEANUP_AUG_CLOSE augeas *ah = NULL;
- int r;
- const char *str;
- int major = 0, minor = 0, patch = 0;
-
- if (augeas_version != 0)
- return;
-
- /* Optimization: do not load the files nor the lenses, since we are
- * only interested in the version.
- */
- ah = aug_init ("/", NULL, AUG_NO_ERR...
2020 Mar 09
0
[PATCH v3 3/3] daemon: drop usage of C augeas library
...or ? aug_err_minor : "", \
- aug_err_details ? ": " : "", aug_err_details ? aug_err_details : ""); \
- } \
- } while (0)
-
-int augeas_version;
-
-void
-aug_read_version (void)
-{
- CLEANUP_AUG_CLOSE augeas *ah = NULL;
- int r;
- const char *str;
- int major = 0, minor = 0, patch = 0;
-
- if (augeas_version != 0)
- return;
-
- /* Optimization: do not load the files nor the lenses, since we are
- * only interested in the version.
- */
- ah = aug_init ("/", NULL, AUG_NO_ERR...
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...link (filename);
- free (filename);
- }
-}
-
-void
-cleanup_close (void *ptr)
-{
- const int fd = * (int *) ptr;
-
- if (fd >= 0)
- close (fd);
-}
-
-void
-cleanup_fclose (void *ptr)
-{
- FILE *f = * (FILE **) ptr;
-
- if (f)
- fclose (f);
-}
+#include "daemon.h"
void
cleanup_aug_close (void *ptr)
@@ -79,9 +35,6 @@ cleanup_aug_close (void *ptr)
aug_close (aug);
}
-struct stringsbuf;
-extern void free_stringsbuf (struct stringsbuf *sb);
-
void
cleanup_free_stringsbuf (void *ptr)
{
diff --git a/daemon/cleanups.h b/daemon/cleanups.h
deleted file mode 100644
index a791244c...
2015 Jun 17
4
[PATCH 1/4] daemon: introduce free_stringsbuf
Simple shortcut to easily cleanup a stringsbuf.
---
daemon/daemon.h | 1 +
daemon/guestfsd.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 53cb797..bed4dbc 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -92,6 +92,7 @@ extern int add_string (struct stringsbuf *sb, const char *str);
extern int add_sprintf (struct stringsbuf *sb, const
2017 Apr 25
1
Re: [PATCH v8 4/8] New API: yara_load
...02cf94b 100644
> --- a/daemon/cleanups.c
> +++ b/daemon/cleanups.c
> @@ -62,6 +62,15 @@ cleanup_close (void *ptr)
> }
>
> void
> +cleanup_fclose (void *ptr)
> +{
> + FILE *f = * (FILE **) ptr;
> +
> + if (f)
> + fclose (f);
> +}
> +
> +void
> cleanup_aug_close (void *ptr)
> {
> augeas *aug = * (augeas **) ptr;
> diff --git a/daemon/cleanups.h b/daemon/cleanups.h
> index 6746e2744..a791244cb 100644
> --- a/daemon/cleanups.h
> +++ b/daemon/cleanups.h
> @@ -26,6 +26,7 @@ extern void cleanup_free (void *ptr);
> extern void cleanu...
2017 Mar 12
0
[PATCH v4 3/7] New API: yara_load
...rofree.c
diff --git a/daemon/cleanups.c b/daemon/cleanups.c
index 092e493d7..3102cf94b 100644
--- a/daemon/cleanups.c
+++ b/daemon/cleanups.c
@@ -62,6 +62,15 @@ cleanup_close (void *ptr)
}
void
+cleanup_fclose (void *ptr)
+{
+ FILE *f = * (FILE **) ptr;
+
+ if (f)
+ fclose (f);
+}
+
+void
cleanup_aug_close (void *ptr)
{
augeas *aug = * (augeas **) ptr;
diff --git a/daemon/cleanups.h b/daemon/cleanups.h
index 6746e2744..a791244cb 100644
--- a/daemon/cleanups.h
+++ b/daemon/cleanups.h
@@ -26,6 +26,7 @@ extern void cleanup_free (void *ptr);
extern void cleanup_free_string_list (void *ptr);
extern...
2016 Nov 09
0
[PATCH v2 2/6] New API: yara_load
...;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 (f);
+}
+
+void
cleanup_aug_close (void *ptr)
{
augeas *aug = * (augeas **) ptr;
@@ -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 (compi...
2016 Jan 21
0
[PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
...rings (* (char ***) ptr);
+}
+
+void
+cleanup_unlink_free (void *ptr)
+{
+ char *filename = * (char **) ptr;
+
+ if (filename) {
+ unlink (filename);
+ free (filename);
+ }
+}
+
+void
+cleanup_close (void *ptr)
+{
+ int fd = * (int *) ptr;
+
+ if (fd >= 0)
+ close (fd);
+}
+
+void
+cleanup_aug_close (void *ptr)
+{
+ augeas *aug = * (augeas **) ptr;
+
+ if (aug != NULL)
+ aug_close (aug);
+}
+
+struct stringsbuf;
+extern void free_stringsbuf (struct stringsbuf *sb);
+
+void
+cleanup_free_stringsbuf (void *ptr)
+{
+ free_stringsbuf ((struct stringsbuf *) ptr);
+}
diff --git a/daemon/cleanu...
2017 Apr 06
0
[PATCH v6 3/7] New API: yara_load
...rofree.c
diff --git a/daemon/cleanups.c b/daemon/cleanups.c
index 092e493d7..3102cf94b 100644
--- a/daemon/cleanups.c
+++ b/daemon/cleanups.c
@@ -62,6 +62,15 @@ cleanup_close (void *ptr)
}
void
+cleanup_fclose (void *ptr)
+{
+ FILE *f = * (FILE **) ptr;
+
+ if (f)
+ fclose (f);
+}
+
+void
cleanup_aug_close (void *ptr)
{
augeas *aug = * (augeas **) ptr;
diff --git a/daemon/cleanups.h b/daemon/cleanups.h
index 6746e2744..a791244cb 100644
--- a/daemon/cleanups.h
+++ b/daemon/cleanups.h
@@ -26,6 +26,7 @@ extern void cleanup_free (void *ptr);
extern void cleanup_free_string_list (void *ptr);
extern...
2017 Apr 24
0
[PATCH v8 4/8] New API: yara_load
...rofree.c
diff --git a/daemon/cleanups.c b/daemon/cleanups.c
index 092e493d7..3102cf94b 100644
--- a/daemon/cleanups.c
+++ b/daemon/cleanups.c
@@ -62,6 +62,15 @@ cleanup_close (void *ptr)
}
void
+cleanup_fclose (void *ptr)
+{
+ FILE *f = * (FILE **) ptr;
+
+ if (f)
+ fclose (f);
+}
+
+void
cleanup_aug_close (void *ptr)
{
augeas *aug = * (augeas **) ptr;
diff --git a/daemon/cleanups.h b/daemon/cleanups.h
index 6746e2744..a791244cb 100644
--- a/daemon/cleanups.h
+++ b/daemon/cleanups.h
@@ -26,6 +26,7 @@ extern void cleanup_free (void *ptr);
extern void cleanup_free_string_list (void *ptr);
extern...
2014 Aug 26
6
[PATCH 0/3] fix setting lvm filter with newer lvm2
Hi,
newer lvm2 releases don't have have uncommented "filter" lines, so the
current way to edit lvm.conf doesn't work anymore.
Instead, switch to augeas (with a "custom" len) for a cleaner and
working way to set the lvm filter.
Pino Toscano (3):
daemon: add add_sprintf
daemon: move AUGEAS_ERROR to the common header
daemon: lvm-filter: use augeas for setting the
2017 Apr 04
0
[PATCH v5 3/7] New API: yara_load
...rofree.c
diff --git a/daemon/cleanups.c b/daemon/cleanups.c
index 092e493d7..3102cf94b 100644
--- a/daemon/cleanups.c
+++ b/daemon/cleanups.c
@@ -62,6 +62,15 @@ cleanup_close (void *ptr)
}
void
+cleanup_fclose (void *ptr)
+{
+ FILE *f = * (FILE **) ptr;
+
+ if (f)
+ fclose (f);
+}
+
+void
cleanup_aug_close (void *ptr)
{
augeas *aug = * (augeas **) ptr;
diff --git a/daemon/cleanups.h b/daemon/cleanups.h
index 6746e2744..a791244cb 100644
--- a/daemon/cleanups.h
+++ b/daemon/cleanups.h
@@ -26,6 +26,7 @@ extern void cleanup_free (void *ptr);
extern void cleanup_free_string_list (void *ptr);
extern...
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 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
2020 Mar 09
4
[PATCH v3 0/3] Switch augeas APIs to OCaml
This reimplements the augeas APIs using ocaml-augeas (dropping all the
C code).
The behaviour seems unchanged, although I may have not tested all the
various corner cases.
Changes from v2:
- dropped patch #1, as it was applied already (was a real bugfix)
- rebased on master
Pino Toscano (3):
Revert "Revert "daemon: implement OptString for OCaml APIs""
daemon: move augeas
2020 Jan 09
5
[PATCH v2 0/4] Switch augeas APIs to OCaml
This reimplements the augeas APIs using ocaml-augeas (dropping all the
C code).
The behaviour seems unchanged, although I may have not tested all the
various corner cases.
Pino Toscano (4):
daemon: fix/enhance error reporting of Augeas exceptions
Revert "Revert "daemon: implement OptString for OCaml APIs""
daemon: move augeas APIs to OCaml
daemon: drop usage of C
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
2019 May 30
5
[PATCH 0/5] RFC: switch augeas APIs to OCaml
This synchronizes the embedded ocaml-augeas copy, and reimplements the
augeas APIs using it (dropping all the C code).
The behaviour seems unchanged, although I may have not tested all the
various corner cases.
Pino Toscano (5):
common/mlaugeas: Synchronize with latest ocaml-augeas
daemon: fix/enhance error reporting of Augeas exceptions
Revert "Revert "daemon: implement
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