The Samba-Bugzilla – Attachment 2131 Details for
Bug 4094
pam_winbind always logs errors for unknown users
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
dont use pam_winbind_request for WINBINDD_GETPWNAM
samba-3.0.23-pam_winbind-validuser.patch (text/plain), 1.57 KB, created by
Lars Heete
on 2006-09-08 10:40:53 UTC
(
hide
)
Description:
dont use pam_winbind_request for WINBINDD_GETPWNAM
Filename:
MIME Type:
Creator:
Lars Heete
Created:
2006-09-08 10:40:53 UTC
Size:
1.57 KB
patch
obsolete
>--- samba-3.0.23a/source/nsswitch/pam_winbind.c.valid_user 2006-09-08 17:07:24.000000000 +0200 >+++ samba-3.0.23a/source/nsswitch/pam_winbind.c 2006-09-08 17:07:34.000000000 +0200 >@@ -610,33 +610,38 @@ > * sure it's really a winbind user, this is important when stacking PAM > * modules in the 'account' or 'password' facility. */ > >- struct passwd *pwd = NULL; > struct winbindd_request request; > struct winbindd_response response; >- int ret; > > ZERO_STRUCT(request); > ZERO_STRUCT(response); > >- pwd = getpwnam(user); >- if (pwd == NULL) { >- return 1; >- } >- > strncpy(request.data.username, user, > sizeof(request.data.username) - 1); > >- ret = pam_winbind_request_log(pamh, ctrl, WINBINDD_GETPWNAM, &request, &response, user); >+ /* Fill in request and send down pipe */ >+ init_request(&request, WINBINDD_GETPWNAM); > >- switch (ret) { >- case PAM_USER_UNKNOWN: >- return 1; >- case PAM_SUCCESS: >- return 0; >- default: >- break; >- } >- return -1; >+ if (write_sock(&request, sizeof(request), 0) == -1) { >+ _pam_log(LOG_ERR, "write to socket failed!"); >+ close_sock(); >+ return -1; >+ } >+ >+ /* Wait for reply */ >+ if (read_reply(&response) == -1) { >+ _pam_log(LOG_ERR, "read from socket failed!"); >+ close_sock(); >+ return -1; >+ } >+ >+ /* We are done with the socket - close it and avoid mischeif */ >+ close_sock(); >+ >+ if (response.result != WINBINDD_OK) >+ return 1; >+ >+ return 0; > } > > static char *_pam_delete(register char *xx)
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 4094
:
2131
|
2141