06.02.2024 12:34, Helmut Grohne:
...
An option I see here is to provide ABI-duality for libselinux:

-extern int matchpathcon_filespec_add(ino_t ino, int specind, const char *file);
+typedef unsigned long libselinux_ino_t;
+typedef uint64_t libselinux_ino64_t;
+extern int matchpathcon_filespec_add(libselinux_ino_t ino, int specind, const 
char *file);
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 && sizeof(unsigned long) 
< 8

It's good for a sketch to show an idea but it wont work in practice, -
you can't use sizeof(foo) in a preprocessor condition.  That's what
WORDSIZE #defines are for.  But it's a minor nit.

glibc already has all the support for LFS which can be used directly,
by copying code from any glibc header, like eg for lseek definition...

+extern int matchpathcon_filespec_add64(libselinux_ino64_t ino, int specind, 
const char *file);
+#define matchpathcon_filespec_add matchpathcon_filespec_add64
and keeping this #define here instead of using internal in-glibc
symbol redirection stuff.

And ofc we need to define the compat wrapper for matchpathcon_filespec_add
to the source, and the new 64bit symbol to libselinux.map, with the same
arch-specific condition.

/mjt

_______________________________________________
SELinux-devel mailing list
SELinux-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/selinux-devel

Reply via email to