mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
File Audit Mode 0000 bug (#15759)
* adding file mode changes * add changelog * adding error * adding fmt changes
This commit is contained in:
@@ -78,9 +78,21 @@ func Factory(ctx context.Context, conf *audit.BackendConfig) (audit.Backend, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if m != 0 {
|
||||
switch m {
|
||||
case 0:
|
||||
// if mode is 0000, then do not modify file mode
|
||||
if path != "stdout" && path != "discard" {
|
||||
fileInfo, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mode = fileInfo.Mode()
|
||||
}
|
||||
default:
|
||||
mode = os.FileMode(m)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
b := &Backend{
|
||||
|
||||
Reference in New Issue
Block a user