makesyscred.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*
* This module makes the "AUTH_SYS" credential and stores it in the credential
* table.
*/
#include <stdio.h>
#include <pwd.h>
#include "nisaddcred.h"
extern char *strchr();
int
char *np;
char *p;
char *d;
char *flavor; /* Ignored. */
{
int grplist[32];
int ngrps, i;
char sysname[32],
*s,
luid[16],
lgids[64],
buf[16],
pname[1024],
tname[1024];
return (0);
}
s = strchr(p, ',');
if (! s) {
return (0);
}
s++;
if (! pw) {
/*
* If NIS+ is the name service for the passwd data,
* maybe this answer came from an out of date replica
* server. So lets try the NIS+ Master server.
*/
if (err == NIS_NOTFOUND)
"%s: no password entry for uid %d\n",
program_name, uid);
else
"%s: could not get the password entry for uid %d: %s\n",
return (0);
}
}
if (ngrps == -1) {
perror("initgroups:");
return (0);
}
}
if (ngrps == -1) {
perror("getgroups:");
return (0);
}
lgids[0] = '\0';
for (i = 0; i < ngrps; i++) {
if (i+1 < ngrps)
else
}
case NIS_TRYAGAIN :
i = 0;
break;
case NIS_PERMISSION :
i = 0;
break;
case NIS_SUCCESS :
i = 1;
break;
default :
break;
}
return (i);
}
char *
char *flavor) /* Ignored. */
{
static char myname[64];
int uid;
if (! pw) {
/*
* If NIS+ is the name service for the passwd data,
* maybe this answer came from an out of date replica
* server. So lets try the NIS+ Master server.
*/
if (err == NIS_NOTFOUND)
"%s: no password entry for uid %d\n",
program_name, uid);
else
"%s: could not get the password entry for uid %d: %s\n",
return (NULL);
}
}
return (myname);
}