struct passwd * winbind_getpwnam(const char * name) { wbcErr result; struct passwd * tmp_pwd = NULL; struct passwd * pwd = NULL; result = wbcGetpwnam(name, &tmp_pwd); if (result != WBC_ERR_SUCCESS) return pwd; pwd = tcopy_passwd(talloc_tos(), tmp_pwd); wbcFreeMemory(tmp_pwd); return pwd; }
static bool wbinfo_get_userinfo(char *user) { wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE; struct passwd *pwd = NULL; wbc_status = wbcGetpwnam(user, &pwd); if (!WBC_ERROR_IS_OK(wbc_status)) { return false; } d_printf("%s:%s:%d:%d:%s:%s:%s\n", pwd->pw_name, pwd->pw_passwd, pwd->pw_uid, pwd->pw_gid, pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); return true; }