Skip to content

Commit 6c6a783

Browse files
committed
apparmor: touch-up comments
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 786e525 commit 6c6a783

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apparmor/apparmor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func InstallDefault(name string) error {
6363
// Figure out the daemon profile.
6464
daemonProfile := "unconfined"
6565
if currentProfile, err := os.ReadFile("/proc/self/attr/current"); err == nil {
66-
// Normally profiles are suffixed by " (enforcing)" or similar. AppArmor
66+
// Normally profiles are suffixed by " (enforce)" or similar. AppArmor
6767
// profiles cannot contain spaces so this doesn't restrict daemon profile
6868
// names.
6969
if profile, _, _ := strings.Cut(string(currentProfile), " "); profile != "" {
@@ -110,6 +110,9 @@ func isLoaded(name string, fileName string) (bool, error) {
110110

111111
scanner := bufio.NewScanner(file)
112112
for scanner.Scan() {
113+
// Normally profiles are suffixed by " (enforce)" or similar. AppArmor
114+
// profiles cannot contain spaces so this doesn't restrict daemon profile
115+
// names.
113116
if prefix, _, ok := strings.Cut(scanner.Text(), " "); ok && prefix == name {
114117
return true, nil
115118
}

0 commit comments

Comments
 (0)