Can not save ldap-user config in site admin page. #6053

Closed
opened 2025-11-02 06:43:52 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @sanigo on GitHub (Sep 27, 2020).

  • Gitea version (or commit ref): 1.12.4
  • Git version: 2.12.2
  • Operating system: Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When save users that are from ldap, gitea complains Password length cannot be less than 6 characters.

Screenshots

截屏2020-09-27 上午10 43 44
Originally created by @sanigo on GitHub (Sep 27, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.12.4 - Git version: 2.12.2 - Operating system: Linux - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description When save users that are from ldap, gitea complains `Password length cannot be less than 6 characters.` ## Screenshots <img width="1450" alt="截屏2020-09-27 上午10 43 44" src="https://user-images.githubusercontent.com/3064634/94354543-9f308a00-00ae-11eb-804c-73876d95213e.png"> <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/bug label 2025-11-02 06:43:52 -06:00
Author
Owner

@zeripath commented on GitHub (Sep 29, 2020):

This is interesting because Password length cannot be less then x characters is auth.password_too_short

Now presuming you are posting to:

/admin/users/:id

That matches:

3878e985b6/routers/routes/routes.go (L450)

i.e.

3878e985b6/routers/admin/users.go (L200-L201)

then this can only be emitted:

3878e985b6/routers/admin/users.go (L227-L233)

So the question is why is the form.Password not empty...

@zeripath commented on GitHub (Sep 29, 2020): This is interesting because Password length cannot be less then x characters is `auth.password_too_short` Now presuming you are posting to: `/admin/users/:id` That matches: https://github.com/go-gitea/gitea/blob/3878e985b66cc6d4cb4d2b0e7406d5cf91af6191/routers/routes/routes.go#L450 i.e. https://github.com/go-gitea/gitea/blob/3878e985b66cc6d4cb4d2b0e7406d5cf91af6191/routers/admin/users.go#L200-L201 then this can only be emitted: https://github.com/go-gitea/gitea/blob/3878e985b66cc6d4cb4d2b0e7406d5cf91af6191/routers/admin/users.go#L227-L233 So the question is why is the form.Password not empty...
Author
Owner

@zeripath commented on GitHub (Sep 29, 2020):

Probably the safest thing to do is to ignore this setting unless it would have been shown - and in fact we should definitely do that.

@zeripath commented on GitHub (Sep 29, 2020): Probably the safest thing to do is to ignore this setting unless it would have been shown - and in fact we should definitely do that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6053