Fix some quirks. Might almost work with C2 now.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1656 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -202,8 +202,8 @@ common_auth(sia_collect_func_t *collect,
|
|||||||
{
|
{
|
||||||
char realm[REALM_SZ];
|
char realm[REALM_SZ];
|
||||||
int ret;
|
int ret;
|
||||||
struct passwd pw, *pwd;
|
struct passwd pw, *pwd, fpw, *fpwd;
|
||||||
char pwbuf[1024];
|
char pwbuf[1024], fpwbuf[1024];
|
||||||
struct state *s = (struct state*)entity->mech[pkgind];
|
struct state *s = (struct state*)entity->mech[pkgind];
|
||||||
|
|
||||||
if(getpwnam_r(entity->name, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0)
|
if(getpwnam_r(entity->name, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0)
|
||||||
@@ -215,9 +215,14 @@ common_auth(sia_collect_func_t *collect,
|
|||||||
toname = entity->name;
|
toname = entity->name;
|
||||||
toinst = "";
|
toinst = "";
|
||||||
if(entity->authtype == SIA_A_SUAUTH){
|
if(entity->authtype == SIA_A_SUAUTH){
|
||||||
struct passwd fpw, *fpwd;
|
uid_t ouid;
|
||||||
char fpwbuf[1024];
|
#ifdef SIAENTITY_HAS_OUID
|
||||||
if(getpwuid_r(getuid(), &fpw, fpwbuf, sizeof(fpwbuf), &fpwd) != 0)
|
ouid = entity->ouid;
|
||||||
|
#else
|
||||||
|
ouid = getuid();
|
||||||
|
#endif
|
||||||
|
if(getpwuid_r(ouid, &fpw,
|
||||||
|
fpwbuf, sizeof(fpwbuf), &fpwd) != 0)
|
||||||
return SIADFAIL;
|
return SIADFAIL;
|
||||||
snprintf(s->ticket, sizeof(s->ticket), TKT_ROOT "_%s_to_%s_%d",
|
snprintf(s->ticket, sizeof(s->ticket), TKT_ROOT "_%s_to_%s_%d",
|
||||||
fpwd->pw_name, pwd->pw_name, getpid());
|
fpwd->pw_name, pwd->pw_name, getpid());
|
||||||
@@ -274,9 +279,11 @@ siad_ses_launch(sia_collect_func_t *collect,
|
|||||||
char buf[MaxPathLen];
|
char buf[MaxPathLen];
|
||||||
static char env[MaxPathLen];
|
static char env[MaxPathLen];
|
||||||
struct state *s = (struct state*)entity->mech[pkgind];
|
struct state *s = (struct state*)entity->mech[pkgind];
|
||||||
chown(s->ticket, entity->pwd->pw_uid, entity->pwd->pw_gid);
|
if(s->valid){
|
||||||
snprintf(env, sizeof(env), "KRBTKFILE=%s", s->ticket);
|
chown(s->ticket, entity->pwd->pw_uid, entity->pwd->pw_gid);
|
||||||
putenv(env);
|
snprintf(env, sizeof(env), "KRBTKFILE=%s", s->ticket);
|
||||||
|
putenv(env);
|
||||||
|
}
|
||||||
if (k_hasafs()) {
|
if (k_hasafs()) {
|
||||||
char cell[64];
|
char cell[64];
|
||||||
k_setpag();
|
k_setpag();
|
||||||
@@ -310,3 +317,128 @@ siad_ses_suauthent(sia_collect_func_t *collect,
|
|||||||
return common_auth(collect, entity, siastat, pkgind);
|
return common_auth(collect, entity, siastat, pkgind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The following functions returns the default fail */
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_ses_reauthent (sia_collect_func_t *collect,
|
||||||
|
SIAENTITY *entity,
|
||||||
|
int siastat,
|
||||||
|
int pkgind)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_chg_finger (sia_collect_func_t *collect,
|
||||||
|
const char *username,
|
||||||
|
int argc,
|
||||||
|
char *argv[])
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_chg_passwd (sia_collect_func_t *collect,
|
||||||
|
const char *username,
|
||||||
|
int argc,
|
||||||
|
char *argv[])
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_chg_shell (sia_collect_func_t *collect,
|
||||||
|
const char *username,
|
||||||
|
int argc,
|
||||||
|
char *argv[])
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_getpwent(struct passwd *result,
|
||||||
|
char *buf,
|
||||||
|
int bufsize,
|
||||||
|
struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_getpwuid (uid_t uid,
|
||||||
|
struct passwd *result,
|
||||||
|
char *buf,
|
||||||
|
int bufsize,
|
||||||
|
struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_getpwnam (const char *name,
|
||||||
|
struct passwd *result,
|
||||||
|
char *buf,
|
||||||
|
int bufsize,
|
||||||
|
struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_setpwent (struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_endpwent (struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_getgrent(struct group *result,
|
||||||
|
char *buf,
|
||||||
|
int bufsize,
|
||||||
|
struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_getgrgid (gid_t gid,
|
||||||
|
struct group *result,
|
||||||
|
char *buf,
|
||||||
|
int bufsize,
|
||||||
|
struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_getgrnam (const char *name,
|
||||||
|
struct group *result,
|
||||||
|
char *buf,
|
||||||
|
int bufsize,
|
||||||
|
struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_setgrent (struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_endgrent (struct sia_context *context)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
siad_chk_user (const char *logname, int checkflag)
|
||||||
|
{
|
||||||
|
return SIADFAIL;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user