adamwill / rpms / openscap

Forked from rpms/openscap 3 years ago
Clone

Blame SOURCES/make_is_local_fs_static_again.patch

fa2dd6
From 535c48739dc89efc76bfd267d3f39dca05cbebd1 Mon Sep 17 00:00:00 2001
fa2dd6
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
fa2dd6
Date: Thu, 6 Jun 2019 09:14:20 +0200
fa2dd6
Subject: [PATCH] Make is_local_fs static again
fa2dd6
fa2dd6
It isn't necessary to expose this function in public API.
fa2dd6
The function has been accidentaly introduced to public API
fa2dd6
in fff58197d9747a08d0fc23914a31fefbe44f07ea which hasn't
fa2dd6
been released yet, so it can be safe to remove it.
fa2dd6
---
fa2dd6
 src/OVAL/probes/fsdev.c                   |  4 ++--
fa2dd6
 src/OVAL/probes/public/fsdev.h            | 10 ----------
fa2dd6
 tests/API/probes/Makefile.am              |  3 ++-
fa2dd6
 tests/API/probes/test_fsdev_is_local_fs.c |  1 +
fa2dd6
 4 files changed, 5 insertions(+), 13 deletions(-)
fa2dd6
fa2dd6
diff --git a/src/OVAL/probes/fsdev.c b/src/OVAL/probes/fsdev.c
fa2dd6
index 9646cac80..f5f14ac2f 100644
fa2dd6
--- a/src/OVAL/probes/fsdev.c
fa2dd6
+++ b/src/OVAL/probes/fsdev.c
fa2dd6
@@ -79,7 +79,7 @@ static int fsdev_cmp(const void *a, const void *b)
fa2dd6
 #define DEVID_ARRAY_ADD  8
fa2dd6
 
fa2dd6
 #if defined(__linux__)
fa2dd6
-int is_local_fs(struct mntent *ment)
fa2dd6
+static int is_local_fs(struct mntent *ment)
fa2dd6
 {
fa2dd6
 // todo: would it be usefull to provide the choice during build-time?
fa2dd6
 #if 1
fa2dd6
@@ -129,7 +129,7 @@ int is_local_fs(struct mntent *ment)
fa2dd6
 }
fa2dd6
 
fa2dd6
 #elif defined(_AIX)
fa2dd6
-int is_local_fs(struct mntent *ment)
fa2dd6
+static int is_local_fs(struct mntent *ment)
fa2dd6
 {
fa2dd6
 	int i;
fa2dd6
 	struct vfs_ent *e;
fa2dd6
diff --git a/src/OVAL/probes/public/fsdev.h b/src/OVAL/probes/public/fsdev.h
fa2dd6
index bbead1aee..29a0462c8 100644
fa2dd6
--- a/src/OVAL/probes/public/fsdev.h
fa2dd6
+++ b/src/OVAL/probes/public/fsdev.h
fa2dd6
@@ -86,15 +86,5 @@ int fsdev_path(fsdev_t * lfs, const char *path);
fa2dd6
  */
fa2dd6
 int fsdev_fd(fsdev_t * lfs, int fd);
fa2dd6
 
fa2dd6
-#if defined(__linux__) || defined(_AIX)
fa2dd6
-/**
fa2dd6
- * Detemines whether a given mtab entry is a local file system.
fa2dd6
- * @param ment Structure returned by getmntent (see `man 3 getmntent`).
fa2dd6
- * @retval 1 if local
fa2dd6
- * @retval 0 otherwise
fa2dd6
- */
fa2dd6
-int is_local_fs(struct mntent *ment);
fa2dd6
-#endif
fa2dd6
-
fa2dd6
 #endif				/* FSDEV_H */
fa2dd6
 /// @}
fa2dd6
diff --git a/tests/API/probes/Makefile.am b/tests/API/probes/Makefile.am
fa2dd6
index 459e5f3af..fa9c26b54 100644
fa2dd6
--- a/tests/API/probes/Makefile.am
fa2dd6
+++ b/tests/API/probes/Makefile.am
fa2dd6
@@ -5,8 +5,9 @@ AM_CPPFLAGS = \
fa2dd6
 	-I$(top_srcdir)/src/CPE/public \
fa2dd6
 	-I$(top_srcdir)/src/CVE/public \
fa2dd6
 	-I${top_srcdir}/src/CVSS/public \
fa2dd6
-	-I$(top_srcdir)/src/OVAL/probes/SEAP/public \
fa2dd6
+	-I$(top_srcdir)/src/OVAL/probes \
fa2dd6
 	-I$(top_srcdir)/src/OVAL/probes/public \
fa2dd6
+	-I$(top_srcdir)/src/OVAL/probes/SEAP/public \
fa2dd6
 	-I$(top_srcdir)/src/OVAL/public \
fa2dd6
 	-I$(top_srcdir)/src/XCCDF/public \
fa2dd6
 	-I$(top_srcdir)/src/common/public \
fa2dd6
diff --git a/tests/API/probes/test_fsdev_is_local_fs.c b/tests/API/probes/test_fsdev_is_local_fs.c
fa2dd6
index e3b4691db..085a02a31 100644
fa2dd6
--- a/tests/API/probes/test_fsdev_is_local_fs.c
fa2dd6
+++ b/tests/API/probes/test_fsdev_is_local_fs.c
fa2dd6
@@ -28,6 +28,7 @@
fa2dd6
 #include <string.h>
fa2dd6
 #include <mntent.h>
fa2dd6
 #include "fsdev.h"
fa2dd6
+#include "fsdev.c"
fa2dd6
 
fa2dd6
 static int test_single_call()
fa2dd6
 {