[Rpm-maint] [rpm-software-management/rpm] [WIP] Added fapolicyd plugin (#1475)

Radovan Sroka notifications at github.com
Fri Jan 15 11:41:06 UTC 2021


@radosroka commented on this pull request.



> +    fd = open(state->fifo_path, O_WRONLY);
+    if(fd == -1) {
+        rpmlog(RPMLOG_DEBUG, "Open: %s -> %s\n", state->fifo_path, strerror(errno));
+        return RPMRC_OK;
+    }
+
+    if (stat(state->fifo_path, &s) == -1) {
+        rpmlog(RPMLOG_DEBUG, "Stat: %s -> %s\n", state->fifo_path, strerror(errno));
+        close(fd);
+        return RPMRC_OK;
+    } else {
+
+        if (!S_ISFIFO(s.st_mode)) {
+            rpmlog(RPMLOG_DEBUG, "File: %s exists but it is not a pipe!\n", state->fifo_path);
+            close(fd);
+            return RPMRC_OK;

> Another thing, more of a question: AIUI fapolicyd can actually prevent upgrades from taking place, so if it's actually active on the system then shouldn't a failure to initialize actually be returned as a failure here - its far, far better to fail early than in the middle of transaction.

Well, I designed the plugin to not block RPM transaction at any circumstances. When there is no pipe, assumption is that daemon is not running so the plugin should skip execution of the methods.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1475#discussion_r558252460
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210115/e1fc98a3/attachment.html>


More information about the Rpm-maint mailing list