-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 137-changlog
- Loading branch information
Showing
8 changed files
with
112 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Concurrent Technologies Corporation 2023 | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
use crate::error::Error; | ||
use crate::fapolicyd::FIFO_PIPE; | ||
use crate::pipe::Commands::{FlushCache, ReloadRules, ReloadTrust}; | ||
use std::io::Write; | ||
|
||
#[repr(u8)] | ||
enum Commands { | ||
ReloadTrust = 1, | ||
FlushCache = 2, | ||
ReloadRules = 3, | ||
} | ||
|
||
type CmdResult = Result<(), Error>; | ||
|
||
// 3 | ||
pub fn reload_rules() -> CmdResult { | ||
ReloadRules.send() | ||
} | ||
|
||
// 2 | ||
pub fn flush_cache() -> CmdResult { | ||
FlushCache.send() | ||
} | ||
|
||
// 1 | ||
pub fn reload_trust() -> CmdResult { | ||
ReloadTrust.send() | ||
} | ||
|
||
impl Commands { | ||
fn send(self) -> CmdResult { | ||
let mut fifo = std::fs::OpenOptions::new() | ||
.write(true) | ||
.read(false) | ||
.open(FIFO_PIPE)?; | ||
|
||
// the new line char is required here | ||
fifo.write_all(format!("{}\n", self as u8).as_bytes())?; | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
Summary: File Access Policy Analyzer | ||
Name: fapolicy-analyzer | ||
Version: 1.2.0 | ||
Version: 1.2.2 | ||
Release: 1%{?dist} | ||
|
||
SourceLicense: GPL-3.0-or-later | ||
|
@@ -128,5 +128,5 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop | |
%ghost %attr(640,root,root) %verify(not md5 size mtime) %{_localstatedir}/log/%{name}/%{name}.log | ||
|
||
%changelog | ||
* Mon Nov 06 2023 John Wass <[email protected]> 1.2.0-1 | ||
* Wed Dec 27 2023 John Wass <[email protected]> 1.2.2-1 | ||
- New release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Summary: File Access Policy Analyzer | ||
Name: fapolicy-analyzer | ||
Version: 1.2.0 | ||
Version: 1.2.2 | ||
Release: 1%{?dist} | ||
License: GPL-3.0-or-later | ||
URL: https://github.com/ctc-oss/fapolicy-analyzer | ||
|
@@ -53,7 +53,7 @@ BuildRequires: rust-byteorder-devel | |
BuildRequires: rust-cc-devel | ||
BuildRequires: rust-cfg-if-devel | ||
BuildRequires: rust-chrono-devel | ||
#BuildRequires: rust-confy-devel | ||
BuildRequires: rust-confy-devel | ||
BuildRequires: rust-crossbeam-channel-devel | ||
BuildRequires: rust-crossbeam-deque-devel | ||
BuildRequires: rust-crossbeam-epoch-devel | ||
|
@@ -87,16 +87,13 @@ BuildRequires: rust-parking_lot_core-devel | |
BuildRequires: rust-pkg-config-devel | ||
BuildRequires: rust-proc-macro-hack-devel | ||
BuildRequires: rust-proc-macro2-devel | ||
#BuildRequires: (crate(pyo3/default) >= 0.15.0 with crate(pyo3/default) < 0.16.0) | ||
#BuildRequires: (crate(pyo3-macros/default) >= 0.15.0 with crate(pyo3-macros/default) < 0.16.0) | ||
#BuildRequires: (crate(pyo3-build-config/default) >= 0.15.0 with crate(pyo3-build-config/default) < 0.16.0) | ||
#BuildRequires: (crate(pyo3-macros-backend/default) >= 0.15.0 with crate(pyo3-macros-backend/default) < 0.16.0) | ||
#BuildRequires: rust-pyo3-devel | ||
#BuildRequires: rust-pyo3-log-devel | ||
BuildRequires: rust-quote-devel | ||
BuildRequires: rust-rayon-devel | ||
BuildRequires: rust-rayon-core-devel | ||
BuildRequires: rust-remove_dir_all-devel | ||
#BuildRequires: rust-ring-devel | ||
BuildRequires: rust-ring-devel | ||
BuildRequires: rust-scopeguard-devel | ||
BuildRequires: rust-serde-devel | ||
BuildRequires: rust-serde_derive-devel | ||
|
@@ -111,7 +108,7 @@ BuildRequires: rust-time0.1-devel | |
BuildRequires: rust-toml-devel | ||
BuildRequires: rust-unicode-xid-devel | ||
BuildRequires: rust-unindent-devel | ||
#BuildRequires: rust-untrusted-devel | ||
BuildRequires: rust-untrusted-devel | ||
BuildRequires: rust-paste-devel | ||
BuildRequires: rust-indoc-devel | ||
|
||
|
@@ -233,5 +230,5 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop | |
%attr(755,root,root) %{_datadir}/applications/%{name}.desktop | ||
|
||
%changelog | ||
* Mon Nov 06 2023 John Wass <[email protected]> 1.2.0-1 | ||
* Wed Dec 27 2023 John Wass <[email protected]> 1.2.2-1 | ||
- New release |