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

From: @zhoupengcheng11 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
This commit is contained in:
openeuler-ci-bot
2024-01-09 06:49:52 +00:00
committed by Gitee

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