mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
log file: if the path is not absolute make it relative to config dir
Also refuse to join invalid file name such as "." Fixes #85
This commit is contained in:
@@ -32,6 +32,9 @@ func initializeSQLiteProvider(basePath string) error {
|
||||
logSender = SQLiteDataProviderName
|
||||
if len(config.ConnectionString) == 0 {
|
||||
dbPath := config.Name
|
||||
if dbPath == "." {
|
||||
return fmt.Errorf("Invalid database path: %#v", dbPath)
|
||||
}
|
||||
if !filepath.IsAbs(dbPath) {
|
||||
dbPath = filepath.Join(basePath, dbPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user