Cherry-pick MM-66789: Restrict log downloads to a root path for support packets (#35164)
Automatic Merge
Этот коммит содержится в:
@@ -106,7 +106,14 @@ func setupTestHelper(tb testing.TB, dbStore store.Store, sqlSettings *model.SqlS
|
||||
consoleLevel = mlog.LvlStdLog.Name
|
||||
}
|
||||
*memoryConfig.LogSettings.ConsoleLevel = consoleLevel
|
||||
*memoryConfig.LogSettings.FileLocation = filepath.Join(tempWorkspace, "logs", "mattermost.log")
|
||||
// Use a subdirectory within the logging root (from MM_LOG_PATH or default)
|
||||
// to ensure the path is within the allowed logging root for security validation.
|
||||
// Each test gets its own subdirectory based on the tempWorkspace name for isolation.
|
||||
testLogsDir := filepath.Join(config.GetLogRootPath(), filepath.Base(tempWorkspace))
|
||||
err = os.MkdirAll(testLogsDir, 0700)
|
||||
require.NoError(tb, err, "failed to create test logs directory")
|
||||
*memoryConfig.LogSettings.FileLocation = testLogsDir
|
||||
*memoryConfig.NotificationLogSettings.FileLocation = testLogsDir
|
||||
*memoryConfig.AnnouncementSettings.AdminNoticesEnabled = false
|
||||
*memoryConfig.AnnouncementSettings.UserNoticesEnabled = false
|
||||
*memoryConfig.PluginSettings.AutomaticPrepackagedPlugins = false
|
||||
|
||||
Ссылка в новой задаче
Block a user