Skip to content

Commit 0336274

Browse files
committed
refactor(userspace): Make Cflags in our .pc files more strict
Remove "-I${includedir}/libscap -I${includedir}/driver" from libscap.pc and libsinsp.pc. This means that consumers must use prefixed include paths, such as "#include <libscap/scap.h>" instead of "#include <scap.h>". However, those include directories contain several generic filenames such as settings.h, logger.h, plugin.h, user.h, and utils.h, and this reduces the risk of someone inadvertently including the wrong file. Signed-off-by: Gerald Combs <[email protected]>
1 parent 2b0684c commit 0336274

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

userspace/libscap/libscap.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Version: @FALCOSECURITY_LIBS_VERSION@
99
Requires: @LIBSCAP_PKGCONFIG_REQUIRES@
1010
Requires.private: @LIBSCAP_PKGCONFIG_REQUIRES_PRIVATE@
1111
Libs: -L${libdir} @LIBSCAP_LINK_LIBDIRS_FLAGS@ @LIBSCAP_LINK_LIBRARIES_FLAGS@
12-
Cflags: -I${includedir} -I${includedir}/libscap -I${includedir}/driver
12+
Cflags: -I${includedir}

userspace/libsinsp/fdinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525

2626
#include <unordered_map>
2727
#include <memory>
28-
#include <packed_data.h>
28+
#include <libsinsp/packed_data.h>
2929

3030
// fd type characters
3131
#define CHAR_FD_FILE 'f'

userspace/libsinsp/libsinsp.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Version: @FALCOSECURITY_LIBS_VERSION@
99
Requires: libscap @LIBSINSP_REQUIRES@
1010
Requires.private: @LIBSINSP_REQUIRES_PRIVATE@
1111
Libs: -L${libdir} @SINSP_PKG_CONFIG_LIBDIRS@ @SINSP_PKG_CONFIG_LIBS@
12-
Cflags: -I${includedir} -I${includedir}/libsinsp -I${includedir}/driver @SINSP_PKG_CONFIG_INCLUDES@
12+
Cflags: -I${includedir} @SINSP_PKG_CONFIG_INCLUDES@

userspace/libsinsp/threadinfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct iovec {
3131

3232
#include <functional>
3333
#include <memory>
34-
#include <sinsp_fdtable_factory.h>
34+
#include <libsinsp/sinsp_fdtable_factory.h>
3535
#include <libsinsp/fdtable.h>
3636
#include <libsinsp/thread_group_info.h>
3737
#include <libsinsp/state/table.h>

0 commit comments

Comments
 (0)