禁止非root用户使用upgrade更新数据库

This commit is contained in:
zhoupengcheng
2024-01-04 20:24:45 +08:00
parent 0860885b9c
commit 290f06504d

View File

@@ -881,6 +881,10 @@ func (s *ProfileServer) Tuning(stream PB.ProfileMgr_TuningServer) error {
UpgradeProfile method update the db file
*/
func (s *ProfileServer) UpgradeProfile(profileInfo *PB.ProfileInfo, stream PB.ProfileMgr_UpgradeProfileServer) error {
if config.TransProtocol == "tcp" {
return fmt.Errorf("the upgrade command cannot be executed through TCP connections.")
}
isLocalAddr, err := SVC.CheckRpcIsLocalAddr(stream.Context())
if err != nil {
return err