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
parent
1db23e5228
commit
aa03981024
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue