refractor(aa): newRuleFromLog -> newBaseFromLog

This commit is contained in:
Alexandre Pujol 2024-06-19 18:44:55 +01:00
parent afc0a7cd3b
commit cdab2588aa
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
15 changed files with 18 additions and 18 deletions

View File

@ -49,7 +49,7 @@ func newRule(rule []string) RuleBase {
}
}
func newRuleFromLog(log map[string]string) RuleBase {
func newBaseFromLog(log map[string]string) RuleBase {
comment := ""
fileInherit, noNewPrivs, optional := false, false, false

View File

@ -33,7 +33,7 @@ type Capability struct {
func newCapabilityFromLog(log map[string]string) Rule {
return &Capability{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Names: Must(toValues(CAPABILITY, "name", log["capname"])),
}

View File

@ -24,7 +24,7 @@ type ChangeProfile struct {
func newChangeProfileFromLog(log map[string]string) Rule {
return &ChangeProfile{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
ExecMode: log["mode"],
Exec: log["exec"],

View File

@ -42,7 +42,7 @@ func newDbusFromLog(log map[string]string) Rule {
peerName = log["name"]
}
return &Dbus{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Access: []string{log["mask"]},
Bus: log["bus"],

View File

@ -55,7 +55,7 @@ func newFileFromLog(log map[string]string) Rule {
return newLinkFromLog(log)
}
return &File{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Owner: isOwner(log),
Path: log["name"],
@ -114,7 +114,7 @@ type Link struct {
func newLinkFromLog(log map[string]string) Rule {
return &Link{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Owner: isOwner(log),
Path: log["name"],

View File

@ -25,7 +25,7 @@ type IOUring struct {
func newIOUringFromLog(log map[string]string) Rule {
return &IOUring{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Access: Must(toAccess(IOURING, log["requested"])),
Label: log["label"],

View File

@ -64,7 +64,7 @@ type Mount struct {
func newMountFromLog(log map[string]string) Rule {
return &Mount{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
MountConditions: newMountConditionsFromLog(log),
Source: log["srcname"],
@ -114,7 +114,7 @@ type Umount struct {
func newUmountFromLog(log map[string]string) Rule {
return &Umount{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
MountConditions: newMountConditionsFromLog(log),
MountPoint: log["name"],
@ -160,7 +160,7 @@ type Remount struct {
func newRemountFromLog(log map[string]string) Rule {
return &Remount{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
MountConditions: newMountConditionsFromLog(log),
MountPoint: log["name"],

View File

@ -39,7 +39,7 @@ func newMqueueFromLog(log map[string]string) Rule {
mqueueType = "sysv"
}
return &Mqueue{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Access: Must(toAccess(MQUEUE, log["requested"])),
Type: mqueueType,

View File

@ -72,7 +72,7 @@ type Network struct {
func newNetworkFromLog(log map[string]string) Rule {
return &Network{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
AddressExpr: newAddressExprFromLog(log),
Domain: log["family"],

View File

@ -16,7 +16,7 @@ type PivotRoot struct {
func newPivotRootFromLog(log map[string]string) Rule {
return &PivotRoot{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
OldRoot: log["srcname"],
NewRoot: log["name"],

View File

@ -27,7 +27,7 @@ type Ptrace struct {
func newPtraceFromLog(log map[string]string) Rule {
return &Ptrace{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Access: Must(toAccess(PTRACE, log["requested_mask"])),
Peer: log["peer"],

View File

@ -29,7 +29,7 @@ type Rlimit struct {
func newRlimitFromLog(log map[string]string) Rule {
return &Rlimit{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Key: log["key"],
Op: log["op"],
Value: log["value"],

View File

@ -41,7 +41,7 @@ type Signal struct {
func newSignalFromLog(log map[string]string) Rule {
return &Signal{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Access: Must(toAccess(SIGNAL, log["requested_mask"])),
Set: []string{log["signal"]},

View File

@ -36,7 +36,7 @@ type Unix struct {
func newUnixFromLog(log map[string]string) Rule {
return &Unix{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Access: Must(toAccess(UNIX, log["requested_mask"])),
Type: log["sock_type"],

View File

@ -16,7 +16,7 @@ type Userns struct {
func newUsernsFromLog(log map[string]string) Rule {
return &Userns{
RuleBase: newRuleFromLog(log),
RuleBase: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Create: true,
}