static NSS_STATUS _nss_winbind_getpwent_solwrap (nss_backend_t* be, void *args) { NSS_STATUS ret; char* buffer = NSS_ARGS(args)->buf.buffer; int buflen = NSS_ARGS(args)->buf.buflen; struct passwd* result = (struct passwd*) NSS_ARGS(args)->buf.result; int* errnop = &NSS_ARGS(args)->erange; char logmsg[80]; ret = _nss_winbind_getpwent_r(result, buffer, buflen, errnop); if(ret == NSS_STATUS_SUCCESS) { snprintf(logmsg, 79, "_nss_winbind_getpwent_solwrap: Returning user: %s\n", result->pw_name); NSS_DEBUG(logmsg); NSS_ARGS(args)->returnval = (void*) result; } else { snprintf(logmsg, 79, "_nss_winbind_getpwent_solwrap: Returning error: %d.\n",ret); NSS_DEBUG(logmsg); } return ret; }
int netbsdwinbind_getpwent(void *nsrv, void *nscb, va_list ap) { struct passwd **retval = va_arg(ap, struct passwd **); int rv, rerrno; *retval = NULL; rv = _nss_winbind_getpwent_r(&_winbind_passwd, _winbind_passwdbuf, sizeof(_winbind_passwdbuf), &rerrno); if (rv == NS_SUCCESS) *retval = &_winbind_passwd; return rv; }
int netbsdwinbind_getpwent_r(void *nsrv, void *nscb, va_list ap) { int *retval = va_arg(ap, int *); struct passwd *pw = va_arg(ap, struct passwd *); char *buffer = va_arg(ap, char *); size_t buflen = va_arg(ap, size_t); struct passwd **result = va_arg(ap, struct passwd **); int rv, rerrno; *result = NULL; rerrno = 0; rv = _nss_winbind_getpwent_r(pw, buffer, buflen, &rerrno); if (rv == NS_SUCCESS) *result = pw; else *retval = rerrno; return rv; }