Skip to contentSkip to conversation

ksmbd-tools: set a minimum character limit for password

PATCH In review Namjae Jeon 1 participant 2 messages Oct 9, 2021 – Oct 10, 2021 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Namjae Jeon

author maintainer
#0 lore raw

PATCH 1/1 ksmbd-tools: set a minimum character limit for password

Set minimum password length with 8 characters by default to protect passwords vulnerable.

---
 adduser/user_admin.c | 5 +++++
 1 file changed, 5 insertions(+)
adduser/user_admin.c +5 -0
index 4e85915..36b9ad2 100644
@@ -119,6 +119,11 @@ again:
 		goto again;
 	}
 
+	if (len <= 7) {
+		pr_err("Minimum password length is 8 characters\n");
+		goto again;
+	}
+
 	*sz = len;
 	free(pswd2);
 	return pswd1;
Signature · 1 line
2.25.1

A message that is not in the archive (sent off-list or not yet received): CAH2r5mtcGY1Aomh1LHDs=gwL68TEEmD9Qzf17+4C34MpqHhuqw@mail.gmail.com

author maintainer
#2 lore raw

2021-10-10 0:12 GMT+09:00, Steve French <[email protected]>:

Quoted 1 line

Maybe make it configurable but default to 8 as minimum!

Okay. I will check it.

Thanks!

Quoted 32 lines · On Sat, Oct 9, 2021, 00:49 Namjae Jeon <[email protected]> wrote:
Quoted 29 lines

Set minimum password length with 8 characters by default to protect passwords vulnerable.

---
 adduser/user_admin.c | 5 +++++
 1 file changed, 5 insertions(+)
adduser/user_admin.c +5 -1
index 4e85915..36b9ad2 100644
@@ -119,6 +119,11 @@ again:
                goto again;
        }
 
+       if (len <= 7) {
+               pr_err("Minimum password length is 8 characters\n");
+               goto again;
+       }
+
        *sz = len;
        free(pswd2);
        return pswd1;
--

2.25.1