[PR #5405] [MERGED] fix password variable shadowing #17786

Closed
opened 2025-11-02 15:46:52 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5405
Author: @adelowo
Created: 11/26/2018
Status: Merged
Merged: 11/26/2018
Merged by: @lafriks

Base: masterHead: fix_shadowed_variable


📝 Commits (1)

  • 31096c9 fix password variable shadowing

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 cmd/admin.go (+2 -1)

📄 Description

My bad. While the password is randomly generated, it doesn't actually get stored in
the original password variable as it is declared in a new scope with :=.

So an empty string will always be the password anytime -random-password-length is used


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5405 **Author:** [@adelowo](https://github.com/adelowo) **Created:** 11/26/2018 **Status:** ✅ Merged **Merged:** 11/26/2018 **Merged by:** [@lafriks](https://github.com/lafriks) **Base:** `master` ← **Head:** `fix_shadowed_variable` --- ### 📝 Commits (1) - [`31096c9`](https://github.com/go-gitea/gitea/commit/31096c96dc8fa3d3ffafce19da18a49b5313a2f1) fix password variable shadowing ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `cmd/admin.go` (+2 -1) </details> ### 📄 Description My bad. While the password is randomly generated, it doesn't actually get stored in the original `password` variable as it is declared in a new scope with `:=`. So an empty string will always be the password anytime `-random-password-length` is used --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 15:46:52 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17786