mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
refractor(aa): newRuleFromLog -> newBaseFromLog
This commit is contained in:
parent
afc0a7cd3b
commit
cdab2588aa
@ -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
|
||||
|
||||
|
@ -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"])),
|
||||
}
|
||||
|
@ -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"],
|
||||
|
@ -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"],
|
||||
|
@ -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"],
|
||||
|
@ -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"],
|
||||
|
@ -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"],
|
||||
|
@ -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,
|
||||
|
@ -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"],
|
||||
|
@ -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"],
|
||||
|
@ -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"],
|
||||
|
@ -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"],
|
||||
|
@ -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"]},
|
||||
|
@ -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"],
|
||||
|
@ -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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user