Closed sheperdsonbrown closed 2 years ago
When you use the tar file from people.redhat.com, you do not need to run autogen.sh. That is only needed if you are building from the git repo. Unpack the tar file, run configure, and then make. Fapolicyd is not built for RHEL 7 because the kernel lacks the FANOTIFY machinery to allow it to work. I have no idea if it builds with the older libraries.
Thanks very much for the clarification. Not sure if this is related to an issue with older libraries, but I've configured the system (fapolicy files in /etc/fapolicyd) and went to run from /src via:
# ./fapolicyd --permissive --debug
Loaded 9 rules
Changed to uid 1003
Initializing the database
Database migration will be performed.
Failed writing db version No such file or directory
If this is outside scope of original question more than happy to close this issue. I've made sure to add the fapolicyd user to root/user group. Not sure where to add the directory for said operation to complete.
The trust database lives in /var/lib/fapolicyd If that directory does not exist on your system, then you should create one.
Hi @stevegrubb
Apologies to rehash this thread, but I am encountering another problem after removing autogen.sh from the rpm build (as suggested above).
The make script seems to run fine but I've encountered some deep issue when trying to link fapolicyd with the fapolicyd-selinux package.
make[3]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/src'
make[2]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/src'
Making all in init
make[2]: Entering directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/init'
file -C -m ../init/fapolicyd-magic
make[2]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/init'
Making all in doc
make[2]: Entering directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/doc'
Making all in rules.d
make[2]: Entering directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/rules.d'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/rules.d'
make[2]: Entering directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1'
make[2]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1'
make[1]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1'
+ pushd fapolicyd-selinux-0.4
~/rpmbuild/BUILD/fapolicyd-1.1/fapolicyd-selinux-0.4 ~/rpmbuild/BUILD/fapolicyd-1.1
+ make
make -f /usr/share/selinux/devel/Makefile fapolicyd.pp
make[1]: Entering directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/fapolicyd-selinux-0.4'
Compiling targeted fapolicyd module
/usr/bin/checkmodule: loading policy configuration from tmp/fapolicyd.tmp
fapolicyd.te:45:ERROR 'syntax error' at token 'mmap_read_files_pattern' on line 4068:
mmap_read_files_pattern(fapolicyd_t, fapolicyd_var_lib_t, fapolicyd_var_lib_t)
/usr/bin/checkmodule: error(s) encountered while parsing configuration
make[1]: *** [tmp/fapolicyd.mod] Error 1
make[1]: Leaving directory `/home/fapolicyd/rpmbuild/BUILD/fapolicyd-1.1/fapolicyd-selinux-0.4'
make: *** [fapolicyd.pp] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.8KWkNL (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.8KWkNL (%prep)
This looks like a selinux policy problem. It should be filed against that repo so that this issue can go back to closed. Not sure what the problem is, but the selinux policy is tightly coupled to the version of selinux on the system. If there is a mismatch, it could break like above.
It means that the macro definition cannot be found in your system's selinux-policy. It is either old or not Red Hat based. You can find the definition and copy it to the beginning of .te file but there can be other missing macros.
Thanks for the insight. I am attempting to build on AL2 currently which has been a huge headache. I'll open up the issue for troubleshooting in the correct location!
Does fapolicyd not build for RHEL 7?
I cannot build rpm correctly with os dependencies for amazon linux 2:
uname -r > 5.10.96-90.460.amzn2.x86_64
rpm -E %{rhel} > 7
cat /etc/os-release > NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" HOME_URL="https://amazonlinux.com/"
I've also used the compiled version from http://people.redhat.com/sgrubb/fapolicyd/index.html
165