Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • W Waarp Gateway
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Applications
  • Waarp Gateway
  • Waarp Gateway
  • Issues
  • #353
Closed
Open
Issue created Dec 08, 2022 by Maxime Robert@maxime.robertDeveloper

getHistory can fetch transfer_history it doesn't own

pkg/admin/rest/history.go Is missing a WHERE condition for owner=conf.GlobalConf.GatewayName on the db.Get

//nolint:dupl // duplicated code is about a different type
func getHist(r *http.Request, db *database.DB) (*model.HistoryEntry, error) {
	val := mux.Vars(r)["history"]

	id, err := strconv.ParseUint(val, 10, 64) //nolint:gomnd // no need for a constant here
	if err != nil || id == 0 {
		return nil, notFound("'%s' is not a valid transfer ID", val)
	}

	var history model.HistoryEntry
	if err := db.Get(&history, "id=?", id).Run(); err != nil {
		if database.IsNotFound(err) {
			return nil, notFound("transfer %v not found", id)
		}

		return nil, err
	}

	return &history, nil
}
Edited Dec 08, 2022 by Maxime Robert
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking