The Samba-Bugzilla – Attachment 16991 Details for
Bug 14883
smbclient login without password using '-N' fails with NT_STATUS_INVALID_PARAMETER on Samba AD DC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.15
0001-auth-creds-Guess-the-username-first-via-getpwuid-my_.patch (text/plain), 1.59 KB, created by
Andreas Schneider
on 2021-11-11 10:27:25 UTC
(
hide
)
Description:
patch for 4.15
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2021-11-11 10:27:25 UTC
Size:
1.59 KB
patch
obsolete
>From 61fd63d70578043de9f3bff1c3267c499dbf50a0 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Wed, 10 Nov 2021 12:06:51 +0100 >Subject: [PATCH] auth:creds: Guess the username first via getpwuid(my_id) > >If we have a container, we often don't have USER or LOGNAME set. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14883 > >Tested-by: Anoop C S <anoopcs@samba.org> >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Stefan Metzmacher <metze@samba.org> >(cherry picked from commit c28be4067463e582e378df402f812e510883d606) >--- > auth/credentials/credentials.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c >index 02a3cf3b354..c5a6ba6940c 100644 >--- a/auth/credentials/credentials.c >+++ b/auth/credentials/credentials.c >@@ -30,6 +30,7 @@ > #include "tevent.h" > #include "param/param.h" > #include "system/filesys.h" >+#include "system/passwd.h" > > /** > * Create a new credentials structure >@@ -1159,6 +1160,7 @@ _PUBLIC_ bool cli_credentials_guess(struct cli_credentials *cred, > { > const char *error_string; > const char *env = NULL; >+ struct passwd *pwd = NULL; > bool ok; > > if (lp_ctx != NULL) { >@@ -1168,6 +1170,17 @@ _PUBLIC_ bool cli_credentials_guess(struct cli_credentials *cred, > } > } > >+ pwd = getpwuid(getuid()); >+ if (pwd != NULL) { >+ size_t len = strlen(pwd->pw_name); >+ >+ if (len > 0 && len <= 1024) { >+ (void)cli_credentials_parse_string(cred, >+ pwd->pw_name, >+ CRED_GUESS_ENV); >+ } >+ } >+ > env = getenv("LOGNAME"); > if (env != NULL) { > size_t len = strlen(env); >-- >2.33.1 >
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
Flags:
anoopcs
:
review+
Actions:
View
Attachments on
bug 14883
:
16878
|
16990
| 16991