From aa039810242445889daf5fdd686dd2e8f8c0f1ab Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Wed, 31 Mar 2021 13:27:31 +1100 Subject: [PATCH] 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. --- internal/notification/file_notifier.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/notification/file_notifier.go b/internal/notification/file_notifier.go index 819ef1208..ddbd2b0c9 100644 --- a/internal/notification/file_notifier.go +++ b/internal/notification/file_notifier.go @@ -37,10 +37,6 @@ func (n *FileNotifier) StartupCheck() (bool, error) { if !os.IsNotExist(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 {