Improve checking for the create_dirs permission

Do not allow implicit directory creation on file uploads if create_dirs
permission is not granted

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-04-06 12:42:22 +02:00
parent fcd97ee20d
commit 2ccb6c2672
18 changed files with 119 additions and 72 deletions

View File

@@ -150,7 +150,7 @@ func (fs *CryptFs) Open(name string, offset int64) (File, *pipeat.PipeReaderAt,
}
// Create creates or opens the named file for writing
func (fs *CryptFs) Create(name string, flag int) (File, *PipeWriter, func(), error) {
func (fs *CryptFs) Create(name string, flag, _ int) (File, *PipeWriter, func(), error) {
var err error
var f *os.File
if flag == 0 {