Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
/* take a group id and return a filled struct group */
static struct group *wb_aix_getgrgid(gid_t gid)
{
/* take a group id and return a filled struct group */
static struct group *wb_aix_getgrgid(gid_t gid)
{
- struct winbindd_response response;
- struct winbindd_request request;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
struct group *grp;
NSS_STATUS ret;
logit("getgrgid %d\n", gid);
struct group *grp;
NSS_STATUS ret;
logit("getgrgid %d\n", gid);
- ZERO_STRUCT(response);
- ZERO_STRUCT(request);
-
request.data.gid = gid;
ret = winbindd_request_response(NULL, WINBINDD_GETGRGID,
request.data.gid = gid;
ret = winbindd_request_response(NULL, WINBINDD_GETGRGID,
/* take a group name and return a filled struct group */
static struct group *wb_aix_getgrnam(const char *name)
{
/* take a group name and return a filled struct group */
static struct group *wb_aix_getgrnam(const char *name)
{
- struct winbindd_response response;
- struct winbindd_request request;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
NSS_STATUS ret;
struct group *grp;
NSS_STATUS ret;
struct group *grp;
logit("getgrnam '%s'\n", name);
logit("getgrnam '%s'\n", name);
- ZERO_STRUCT(response);
- ZERO_STRUCT(request);
-
STRCPY_RETNULL(request.data.groupname, name);
ret = winbindd_request_response(NULL, WINBINDD_GETGRNAM,
STRCPY_RETNULL(request.data.groupname, name);
ret = winbindd_request_response(NULL, WINBINDD_GETGRNAM,
list of group id numbers to which the user belongs */
static char *wb_aix_getgrset(char *user)
{
list of group id numbers to which the user belongs */
static char *wb_aix_getgrset(char *user)
{
- struct winbindd_response response;
- struct winbindd_request request;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
NSS_STATUS ret;
int i, idx;
char *tmpbuf;
NSS_STATUS ret;
int i, idx;
char *tmpbuf;
logit("getgrset '%s'\n", r_user);
logit("getgrset '%s'\n", r_user);
- ZERO_STRUCT(response);
- ZERO_STRUCT(request);
-
STRCPY_RETNULL(request.data.username, r_user);
if (*user == WB_AIX_ENCODED) {
STRCPY_RETNULL(request.data.username, r_user);
if (*user == WB_AIX_ENCODED) {
/* take a uid and return a filled struct passwd */
static struct passwd *wb_aix_getpwuid(uid_t uid)
{
/* take a uid and return a filled struct passwd */
static struct passwd *wb_aix_getpwuid(uid_t uid)
{
- struct winbindd_response response;
- struct winbindd_request request;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
NSS_STATUS ret;
struct passwd *pwd;
logit("getpwuid '%d'\n", uid);
NSS_STATUS ret;
struct passwd *pwd;
logit("getpwuid '%d'\n", uid);
- ZERO_STRUCT(response);
- ZERO_STRUCT(request);
-
request.data.uid = uid;
ret = winbindd_request_response(NULL, WINBINDD_GETPWUID,
request.data.uid = uid;
ret = winbindd_request_response(NULL, WINBINDD_GETPWUID,
/* take a username and return a filled struct passwd */
static struct passwd *wb_aix_getpwnam(const char *name)
{
/* take a username and return a filled struct passwd */
static struct passwd *wb_aix_getpwnam(const char *name)
{
- struct winbindd_response response;
- struct winbindd_request request;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
NSS_STATUS ret;
struct passwd *pwd;
NSS_STATUS ret;
struct passwd *pwd;
logit("getpwnam '%s'\n", name);
logit("getpwnam '%s'\n", name);
- ZERO_STRUCT(response);
- ZERO_STRUCT(request);
-
STRCPY_RETNULL(request.data.username, name);
ret = winbindd_request_response(NULL, WINBINDD_GETPWNAM,
STRCPY_RETNULL(request.data.username, name);
ret = winbindd_request_response(NULL, WINBINDD_GETPWNAM,
static int wb_aix_lsuser(char *attributes[], attrval_t results[], int size)
{
NSS_STATUS ret;
static int wb_aix_lsuser(char *attributes[], attrval_t results[], int size)
{
NSS_STATUS ret;
- struct winbindd_request request;
- struct winbindd_response response;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
-
ret = winbindd_request_response(NULL, WINBINDD_LIST_USERS,
&request, &response);
if (ret != 0) {
ret = winbindd_request_response(NULL, WINBINDD_LIST_USERS,
&request, &response);
if (ret != 0) {
static int wb_aix_lsgroup(char *attributes[], attrval_t results[], int size)
{
NSS_STATUS ret;
static int wb_aix_lsgroup(char *attributes[], attrval_t results[], int size)
{
NSS_STATUS ret;
- struct winbindd_request request;
- struct winbindd_response response;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
-
ret = winbindd_request_response(NULL, WINBINDD_LIST_GROUPS,
&request, &response);
if (ret != 0) {
ret = winbindd_request_response(NULL, WINBINDD_LIST_GROUPS,
&request, &response);
if (ret != 0) {
}
request = (struct winbindd_request) {
}
request = (struct winbindd_request) {
+ .wb_flags = WBFLAG_FROM_NSS,
.extra_data.data = buf,
.extra_len = strlen(buf)+1,
};
.extra_data.data = buf,
.extra_len = strlen(buf)+1,
};
static int wb_aix_authenticate(char *user, char *pass,
int *reenter, char **message)
{
static int wb_aix_authenticate(char *user, char *pass,
int *reenter, char **message)
{
- struct winbindd_request request;
- struct winbindd_response response;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
NSS_STATUS result;
char *r_user = user;
NSS_STATUS result;
char *r_user = user;
*message = NULL;
/* Send off request */
*message = NULL;
/* Send off request */
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
-
if (*user == WB_AIX_ENCODED) {
r_user = decode_user(r_user);
if (!r_user) {
if (*user == WB_AIX_ENCODED) {
r_user = decode_user(r_user);
if (!r_user) {
*/
static int wb_aix_chpass(char *user, char *oldpass, char *newpass, char **message)
{
*/
static int wb_aix_chpass(char *user, char *oldpass, char *newpass, char **message)
{
- struct winbindd_request request;
- struct winbindd_response response;
+ struct winbindd_request request = {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+ struct winbindd_response response = {
+ .length = 0,
+ };
NSS_STATUS result;
char *r_user = user;
NSS_STATUS result;
char *r_user = user;
*message = NULL;
/* Send off request */
*message = NULL;
/* Send off request */
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
-
STRCPY_RET(request.data.chauthtok.user, r_user);
STRCPY_RET(request.data.chauthtok.oldpass, oldpass);
STRCPY_RET(request.data.chauthtok.newpass, newpass);
STRCPY_RET(request.data.chauthtok.user, r_user);
STRCPY_RET(request.data.chauthtok.oldpass, oldpass);
STRCPY_RET(request.data.chauthtok.newpass, newpass);