fix(notification): don't remove file based notifier on start up (#1862)

Attempting to run Authelia with least privilege principle as the `nobody` user and a file based notifier will cause issues during start up as the user cannot remove the notification file.

Given that ioutil.WriteFile truncates the file before writing the removal should not be necessary.

Fixes #1846.
pull/1873/head
Amir Zarrinkafsh 2021-03-31 13:27:31 +11:00 committed by GitHub
parent 1db23e5228
commit aa03981024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 4 deletions

View File

@ -37,10 +37,6 @@ func (n *FileNotifier) StartupCheck() (bool, error) {
if !os.IsNotExist(err) { if !os.IsNotExist(err) {
return false, err return false, err
} }
} else {
if err = os.Remove(n.path); err != nil {
return false, err
}
} }
if err := ioutil.WriteFile(n.path, []byte(""), fileNotifierMode); err != nil { if err := ioutil.WriteFile(n.path, []byte(""), fileNotifierMode); err != nil {