The Samba-Bugzilla – Attachment 18285 Details for
Bug 15627
The pdbedit command does not limit the password length
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
add check for password length when adding users by pdbedit
add-password-length-check-for-pdbedit.patch (text/plain), 1.15 KB, created by
eaglegai
on 2024-04-11 14:38:01 UTC
(
hide
)
Description:
add check for password length when adding users by pdbedit
Filename:
MIME Type:
Creator:
eaglegai
Created:
2024-04-11 14:38:01 UTC
Size:
1.15 KB
patch
obsolete
>From 9ac5bafa5435e26467ba4240144a53c50daf4c2d Mon Sep 17 00:00:00 2001 >From: eaglegai <eaglegai@163.com> >Date: Wed, 10 Apr 2024 18:54:33 +0800 >Subject: [PATCH] add "min password length" check for pdbedit when adding users > >--- > source3/utils/pdbedit.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c >index ede4671..497aa04 100644 >--- a/source3/utils/pdbedit.c >+++ b/source3/utils/pdbedit.c >@@ -760,6 +760,7 @@ static int new_user(const char *username, const char *fullname, > struct dom_sid u_sid; > int flags; > int ret = -1; >+ uint32_t value; > > tosctx = talloc_tos(); > if (!tosctx) { >@@ -790,6 +791,16 @@ static int new_user(const char *username, const char *fullname, > goto done; > } > >+ if(!account_policy_get(PDB_POLICY_MIN_PASSWORD_LEN, &value)) { >+ fprintf (stderr, "Failed to get min password length!\n"); >+ goto done; >+ } >+ >+ if(value > strlen(pwd1)) { >+ fprintf (stderr, "Password is too short!\n"); >+ goto done; >+ } >+ > flags = LOCAL_ADD_USER | LOCAL_SET_PASSWORD; > > status = local_password_change(username, flags, pwd1, &err, &msg); >-- >2.33.0 > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15627
: 18285