remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995-2004 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -54,10 +54,10 @@ static char krb5ccname[128];
|
||||
static char krbtkfile[128];
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
In some cases is afs_gettktstring called twice (once before
|
||||
afs_verify and once after afs_verify).
|
||||
In some cases (rlogin with access allowed via .rhosts)
|
||||
In some cases (rlogin with access allowed via .rhosts)
|
||||
afs_verify is not called!
|
||||
So we can't rely on correct value in krbtkfile in some
|
||||
cases!
|
||||
@@ -100,7 +100,7 @@ set_spec_krbtkfile(void)
|
||||
snprintf (krbtkfile, sizeof(krbtkfile), "%s_XXXXXX", TKT_ROOT);
|
||||
fd = mkstemp(krbtkfile);
|
||||
close(fd);
|
||||
unlink(krbtkfile);
|
||||
unlink(krbtkfile);
|
||||
krb_set_tkt_string (krbtkfile);
|
||||
#endif
|
||||
#ifdef KRB5
|
||||
@@ -122,7 +122,7 @@ verify_krb5(struct passwd *pwd,
|
||||
krb5_error_code ret;
|
||||
krb5_ccache ccache;
|
||||
krb5_principal principal;
|
||||
|
||||
|
||||
ret = krb5_init_context(&context);
|
||||
if (ret) {
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_init_context failed: %d", ret);
|
||||
@@ -131,7 +131,7 @@ verify_krb5(struct passwd *pwd,
|
||||
|
||||
ret = krb5_parse_name (context, pwd->pw_name, &principal);
|
||||
if (ret) {
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_parse_name: %s",
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_parse_name: %s",
|
||||
krb5_get_err_text(context, ret));
|
||||
goto out;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ verify_krb5(struct passwd *pwd,
|
||||
set_krb5ccname(pwd->pw_uid);
|
||||
ret = krb5_cc_resolve(context, krb5ccname, &ccache);
|
||||
if(ret) {
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_cc_resolve: %s",
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_cc_resolve: %s",
|
||||
krb5_get_err_text(context, ret));
|
||||
goto out;
|
||||
}
|
||||
@@ -151,13 +151,13 @@ verify_krb5(struct passwd *pwd,
|
||||
TRUE,
|
||||
NULL);
|
||||
if(ret) {
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_verify_user: %s",
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_verify_user: %s",
|
||||
krb5_get_err_text(context, ret));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if(chown(krb5_cc_get_name(context, ccache), pwd->pw_uid, pwd->pw_gid)) {
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "chown: %s",
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "chown: %s",
|
||||
krb5_get_err_text(context, errno));
|
||||
goto out;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ verify_krb5(struct passwd *pwd,
|
||||
krb5_boolean get_v4_tgt;
|
||||
|
||||
krb5_get_default_realm(context, &realm);
|
||||
krb5_appdefault_boolean(context, "afskauthlib",
|
||||
krb5_appdefault_boolean(context, "afskauthlib",
|
||||
realm,
|
||||
"krb4_get_tickets", FALSE, &get_v4_tgt);
|
||||
if (get_v4_tgt) {
|
||||
@@ -188,14 +188,14 @@ verify_krb5(struct passwd *pwd,
|
||||
krb5_warn(context, ret, "converting creds");
|
||||
else {
|
||||
set_krbtkfile(pwd->pw_uid);
|
||||
tf_setup(&c, c.pname, c.pinst);
|
||||
tf_setup(&c, c.pname, c.pinst);
|
||||
}
|
||||
memset(&c, 0, sizeof(c));
|
||||
krb5_free_cred_contents(context, &cred);
|
||||
} else
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_cc_retrieve_cred: %s",
|
||||
syslog(LOG_AUTH|LOG_DEBUG, "krb5_cc_retrieve_cred: %s",
|
||||
krb5_get_err_text(context, ret));
|
||||
|
||||
|
||||
krb5_free_principal(context, mcred.server);
|
||||
}
|
||||
free (realm);
|
||||
@@ -205,7 +205,7 @@ verify_krb5(struct passwd *pwd,
|
||||
}
|
||||
|
||||
if (pag_set)
|
||||
krb5_afslog_uid_home(context, ccache, NULL, NULL,
|
||||
krb5_afslog_uid_home(context, ccache, NULL, NULL,
|
||||
pwd->pw_uid, pwd->pw_dir);
|
||||
}
|
||||
#endif
|
||||
@@ -225,7 +225,7 @@ verify_krb4(struct passwd *pwd,
|
||||
{
|
||||
int ret = 1;
|
||||
char lrealm[REALM_SZ];
|
||||
|
||||
|
||||
if (krb_get_lrealm (lrealm, 1) != KFAILURE) {
|
||||
set_krbtkfile(pwd->pw_uid);
|
||||
ret = krb_verify_user (pwd->pw_name, "", lrealm, password,
|
||||
@@ -281,7 +281,7 @@ afs_gettktstring (void)
|
||||
struct passwd *pwd;
|
||||
|
||||
if (!correct_tkfilename) {
|
||||
ptr = getenv("LOGNAME");
|
||||
ptr = getenv("LOGNAME");
|
||||
if (ptr != NULL && ((pwd = getpwnam(ptr)) != NULL)) {
|
||||
set_krb5ccname(pwd->pw_uid);
|
||||
#ifdef KRB4
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -113,7 +113,7 @@ parse_ctrl(int argc, const char **argv)
|
||||
for (j = 0; j < KRB4_CTRLS; j++)
|
||||
if (strcmp(argv[i], krb4_args[j].token) == 0)
|
||||
break;
|
||||
|
||||
|
||||
if (j >= KRB4_CTRLS)
|
||||
psyslog(LOG_ALERT, "unrecognized option [%s]", *argv);
|
||||
else
|
||||
@@ -192,7 +192,7 @@ verify_pass(pam_handle_t *pamh,
|
||||
old_ruid, old_euid, __LINE__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
switch(ret) {
|
||||
case KSUCCESS:
|
||||
return PAM_SUCCESS;
|
||||
@@ -260,7 +260,7 @@ krb4_auth(pam_handle_t *pamh,
|
||||
/* free(resp->resp); XXX */
|
||||
/* free(resp); XXX */
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ pam_sm_authenticate(pam_handle_t *pamh,
|
||||
uid = pw->pw_uid;
|
||||
set_tkt_string(uid);
|
||||
}
|
||||
|
||||
|
||||
if (strcmp(user, "root") == 0 && getuid() != 0)
|
||||
{
|
||||
pw = getpwuid(getuid());
|
||||
@@ -376,11 +376,11 @@ pam_sm_authenticate(pam_handle_t *pamh,
|
||||
if (ctrl_on(KRB4_REAFSLOG))
|
||||
if (ret == PAM_SUCCESS)
|
||||
pam_sm_setcred(pamh, PAM_REFRESH_CRED, argc, argv);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
|
||||
{
|
||||
parse_ctrl(argc, argv);
|
||||
@@ -416,7 +416,7 @@ pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
|
||||
psyslog(LOG_ALERT , "pam_sm_setcred: unknown flags 0x%x", flags);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 1999 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of KTH nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
@@ -35,13 +35,13 @@
|
||||
RCSID("$Id$");
|
||||
|
||||
#ifndef POSIX_GETPWNAM_R
|
||||
/*
|
||||
/*
|
||||
* These functions translate from the old Digital UNIX 3.x interface
|
||||
* to POSIX.1c.
|
||||
*/
|
||||
|
||||
int
|
||||
posix_getpwnam_r(const char *name, struct passwd *pwd,
|
||||
posix_getpwnam_r(const char *name, struct passwd *pwd,
|
||||
char *buffer, int len, struct passwd **result)
|
||||
{
|
||||
int ret = getpwnam_r(name, pwd, buffer, len);
|
||||
@@ -59,7 +59,7 @@ posix_getpwnam_r(const char *name, struct passwd *pwd,
|
||||
}
|
||||
|
||||
int
|
||||
posix_getpwuid_r(uid_t uid, struct passwd *pwd,
|
||||
posix_getpwuid_r(uid_t uid, struct passwd *pwd,
|
||||
char *buffer, int len, struct passwd **result)
|
||||
{
|
||||
int ret = getpwuid_r(uid, pwd, buffer, len);
|
||||
|
@@ -2,22 +2,22 @@
|
||||
* Copyright (c) 1995-2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
@@ -35,20 +35,20 @@
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
int
|
||||
int
|
||||
siad_init(void)
|
||||
{
|
||||
return SIADSUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
siad_chk_invoker(void)
|
||||
{
|
||||
SIA_DEBUG(("DEBUG", "siad_chk_invoker"));
|
||||
return SIADFAIL;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
siad_ses_init(SIAENTITY *entity, int pkgind)
|
||||
{
|
||||
struct state *s = malloc(sizeof(*s));
|
||||
@@ -166,21 +166,21 @@ doauth(SIAENTITY *entity, int pkgind, char *name)
|
||||
SIA_DEBUG(("DEBUG", "failed to getpwuid(%u)", ouid));
|
||||
return SIADFAIL;
|
||||
}
|
||||
snprintf(s->ticket, sizeof(s->ticket), "%s_%s_to_%s_%d",
|
||||
snprintf(s->ticket, sizeof(s->ticket), "%s_%s_to_%s_%d",
|
||||
TKT_ROOT, fpwd->pw_name, pwd->pw_name, getpid());
|
||||
if(strcmp(pwd->pw_name, "root") == 0){
|
||||
toname = fpwd->pw_name;
|
||||
toinst = pwd->pw_name;
|
||||
}
|
||||
}
|
||||
if(entity->authtype == SIA_A_REAUTH)
|
||||
if(entity->authtype == SIA_A_REAUTH)
|
||||
snprintf(s->ticket, sizeof(s->ticket), "%s", tkt_string());
|
||||
|
||||
|
||||
krb_set_tkt_string(s->ticket);
|
||||
|
||||
setuid(0); /* XXX fix for fix in tf_util.c */
|
||||
if(krb_kuserok(toname, toinst, realm, name)){
|
||||
SIA_DEBUG(("DEBUG", "%s.%s@%s is not allowed to login as %s",
|
||||
SIA_DEBUG(("DEBUG", "%s.%s@%s is not allowed to login as %s",
|
||||
toname, toinst, realm, name));
|
||||
return SIADFAIL;
|
||||
}
|
||||
@@ -192,9 +192,9 @@ doauth(SIAENTITY *entity, int pkgind, char *name)
|
||||
/* if this is most likely a local user (such as
|
||||
root), just silently return failure when the
|
||||
principal doesn't exist */
|
||||
if(ret != KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN &&
|
||||
if(ret != KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN &&
|
||||
ret != KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN)
|
||||
SIALOG("WARNING", "krb5_verify_user(%s): %s",
|
||||
SIALOG("WARNING", "krb5_verify_user(%s): %s",
|
||||
entity->name, error_message(ret));
|
||||
return SIADFAIL;
|
||||
}
|
||||
@@ -213,7 +213,7 @@ doauth(SIAENTITY *entity, int pkgind, char *name)
|
||||
/* since this is most likely a local user (such as
|
||||
root), just silently return failure when the
|
||||
principal doesn't exist */
|
||||
SIALOG("WARNING", "krb_verify_user(%s.%s): %s",
|
||||
SIALOG("WARNING", "krb_verify_user(%s.%s): %s",
|
||||
toname, toinst, krb_get_err_text(ret));
|
||||
return SIADFAIL;
|
||||
}
|
||||
@@ -225,9 +225,9 @@ doauth(SIAENTITY *entity, int pkgind, char *name)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
common_auth(sia_collect_func_t *collect,
|
||||
SIAENTITY *entity,
|
||||
static int
|
||||
common_auth(sia_collect_func_t *collect,
|
||||
SIAENTITY *entity,
|
||||
int siastat,
|
||||
int pkgind)
|
||||
{
|
||||
@@ -244,7 +244,7 @@ common_auth(sia_collect_func_t *collect,
|
||||
name = entity->name;
|
||||
if(entity->acctname)
|
||||
name = entity->acctname;
|
||||
|
||||
|
||||
if((collect != NULL) && entity->colinput) {
|
||||
int num;
|
||||
pr = prompts;
|
||||
@@ -260,13 +260,13 @@ common_auth(sia_collect_func_t *collect,
|
||||
}
|
||||
num = pr - prompts;
|
||||
if(num == 1){
|
||||
if((*collect)(240, SIAONELINER, (unsigned char*)"", num,
|
||||
if((*collect)(240, SIAONELINER, (unsigned char*)"", num,
|
||||
prompts) != SIACOLSUCCESS){
|
||||
SIA_DEBUG(("DEBUG", "collect failed"));
|
||||
return SIADFAIL | SIADSTOP;
|
||||
}
|
||||
} else if(num > 0){
|
||||
if((*collect)(0, SIAFORM, (unsigned char*)"", num,
|
||||
if((*collect)(0, SIAFORM, (unsigned char*)"", num,
|
||||
prompts) != SIACOLSUCCESS){
|
||||
SIA_DEBUG(("DEBUG", "collect failed"));
|
||||
return SIADFAIL | SIADSTOP;
|
||||
@@ -284,14 +284,14 @@ common_auth(sia_collect_func_t *collect,
|
||||
SIA_DEBUG(("DEBUG", "entity->password is null"));
|
||||
return SIADFAIL;
|
||||
}
|
||||
|
||||
|
||||
return doauth(entity, pkgind, name);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
siad_ses_authent(sia_collect_func_t *collect,
|
||||
SIAENTITY *entity,
|
||||
int
|
||||
siad_ses_authent(sia_collect_func_t *collect,
|
||||
SIAENTITY *entity,
|
||||
int siastat,
|
||||
int pkgind)
|
||||
{
|
||||
@@ -299,15 +299,15 @@ siad_ses_authent(sia_collect_func_t *collect,
|
||||
return common_auth(collect, entity, siastat, pkgind);
|
||||
}
|
||||
|
||||
int
|
||||
siad_ses_estab(sia_collect_func_t *collect,
|
||||
int
|
||||
siad_ses_estab(sia_collect_func_t *collect,
|
||||
SIAENTITY *entity, int pkgind)
|
||||
{
|
||||
SIA_DEBUG(("DEBUG", "siad_ses_estab"));
|
||||
return SIADFAIL;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
siad_ses_launch(sia_collect_func_t *collect,
|
||||
SIAENTITY *entity,
|
||||
int pkgind)
|
||||
@@ -317,8 +317,8 @@ siad_ses_launch(sia_collect_func_t *collect,
|
||||
SIA_DEBUG(("DEBUG", "siad_ses_launch"));
|
||||
if(s->valid){
|
||||
#ifdef SIA_KRB5
|
||||
chown(s->ticket + sizeof("FILE:") - 1,
|
||||
entity->pwd->pw_uid,
|
||||
chown(s->ticket + sizeof("FILE:") - 1,
|
||||
entity->pwd->pw_uid,
|
||||
entity->pwd->pw_gid);
|
||||
snprintf(env, sizeof(env), "KRB5CCNAME=%s", s->ticket);
|
||||
#endif
|
||||
@@ -352,7 +352,7 @@ siad_ses_launch(sia_collect_func_t *collect,
|
||||
return SIADSUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
siad_ses_release(SIAENTITY *entity, int pkgind)
|
||||
{
|
||||
SIA_DEBUG(("DEBUG", "siad_ses_release"));
|
||||
@@ -366,7 +366,7 @@ siad_ses_release(SIAENTITY *entity, int pkgind)
|
||||
return SIADSUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
siad_ses_suauthent(sia_collect_func_t *collect,
|
||||
SIAENTITY *entity,
|
||||
int siastat,
|
||||
@@ -408,7 +408,7 @@ siad_ses_reauthent (sia_collect_func_t *collect,
|
||||
krb5_ccache ccache;
|
||||
if(krb5_cc_resolve(s->context, s->ticket, &ccache) == 0) {
|
||||
k_setpag();
|
||||
if(k_afs_cell_of_file(entity->pwd->pw_dir,
|
||||
if(k_afs_cell_of_file(entity->pwd->pw_dir,
|
||||
cell, sizeof(cell)) == 0)
|
||||
krb5_afslog(s->context, ccache, cell, 0);
|
||||
krb5_afslog_home(s->context, ccache, 0, 0, entity->pwd->pw_dir);
|
||||
@@ -418,7 +418,7 @@ siad_ses_reauthent (sia_collect_func_t *collect,
|
||||
#ifdef SIA_KRB4
|
||||
if(k_hasafs()) {
|
||||
char cell[64];
|
||||
if(k_afs_cell_of_file(entity->pwd->pw_dir,
|
||||
if(k_afs_cell_of_file(entity->pwd->pw_dir,
|
||||
cell, sizeof(cell)) == 0)
|
||||
krb_afslog(cell, 0);
|
||||
krb_afslog_home(0, 0, entity->pwd->pw_dir);
|
||||
@@ -430,8 +430,8 @@ siad_ses_reauthent (sia_collect_func_t *collect,
|
||||
|
||||
int
|
||||
siad_chg_finger (sia_collect_func_t *collect,
|
||||
const char *username,
|
||||
int argc,
|
||||
const char *username,
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
SIA_DEBUG(("DEBUG", "siad_chg_finger"));
|
||||
@@ -441,8 +441,8 @@ siad_chg_finger (sia_collect_func_t *collect,
|
||||
#ifdef SIA_KRB5
|
||||
int
|
||||
siad_chg_password (sia_collect_func_t *collect,
|
||||
const char *username,
|
||||
int argc,
|
||||
const char *username,
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
return SIADFAIL;
|
||||
@@ -451,7 +451,7 @@ siad_chg_password (sia_collect_func_t *collect,
|
||||
|
||||
#ifdef SIA_KRB4
|
||||
static void
|
||||
sia_message(sia_collect_func_t *collect, int rendition,
|
||||
sia_message(sia_collect_func_t *collect, int rendition,
|
||||
const char *title, const char *message)
|
||||
{
|
||||
prompt_t prompt;
|
||||
@@ -467,7 +467,7 @@ init_change(sia_collect_func_t *collect, krb_principal *princ)
|
||||
char *msg;
|
||||
char tktstring[128];
|
||||
int ret;
|
||||
|
||||
|
||||
SIA_DEBUG(("DEBUG", "init_change"));
|
||||
prompt.prompt = (unsigned char*)"Old password: ";
|
||||
prompt.result = (unsigned char*)old_pw;
|
||||
@@ -484,11 +484,11 @@ init_change(sia_collect_func_t *collect, krb_principal *princ)
|
||||
SIA_DEBUG(("DEBUG", "ret = %d", ret));
|
||||
if(ret != SIACOLSUCCESS)
|
||||
return SIADFAIL;
|
||||
snprintf(tktstring, sizeof(tktstring),
|
||||
snprintf(tktstring, sizeof(tktstring),
|
||||
"%s_cpw_%u", TKT_ROOT, (unsigned)getpid());
|
||||
krb_set_tkt_string(tktstring);
|
||||
|
||||
ret = krb_get_pw_in_tkt(princ->name, princ->instance, princ->realm,
|
||||
|
||||
ret = krb_get_pw_in_tkt(princ->name, princ->instance, princ->realm,
|
||||
PWSERV_NAME, KADM_SINST, 1, old_pw);
|
||||
if (ret != KSUCCESS) {
|
||||
SIA_DEBUG(("DEBUG", "krb_get_pw_in_tkt: %s", krb_get_err_text(ret)));
|
||||
@@ -509,8 +509,8 @@ init_change(sia_collect_func_t *collect, krb_principal *princ)
|
||||
|
||||
int
|
||||
siad_chg_password (sia_collect_func_t *collect,
|
||||
const char *username,
|
||||
int argc,
|
||||
const char *username,
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
prompt_t prompts[2];
|
||||
@@ -555,7 +555,7 @@ again:
|
||||
prompts[1].min_result_length = MIN_KPW_LEN;
|
||||
prompts[1].max_result_length = sizeof(new_pw2) - 1;
|
||||
prompts[1].control_flags = SIARESINVIS;
|
||||
if((*collect)(120, SIAFORM, (unsigned char*)"", 2, prompts) !=
|
||||
if((*collect)(120, SIAFORM, (unsigned char*)"", 2, prompts) !=
|
||||
SIACOLSUCCESS) {
|
||||
dest_tkt();
|
||||
return SIADFAIL;
|
||||
@@ -569,11 +569,11 @@ again:
|
||||
sia_message(collect, SIAWARNING, "", com_right(et_list, ret));
|
||||
goto again;
|
||||
}
|
||||
|
||||
|
||||
memset(new_pw2, 0, sizeof(new_pw2));
|
||||
ret = kadm_init_link (PWSERV_NAME, KRB_MASTER, princ.realm);
|
||||
if (ret != KADM_SUCCESS)
|
||||
sia_message(collect, SIAWARNING, "Error initing kadmin connection",
|
||||
sia_message(collect, SIAWARNING, "Error initing kadmin connection",
|
||||
com_right(et_list, ret));
|
||||
else {
|
||||
des_cblock newkey;
|
||||
@@ -582,11 +582,11 @@ again:
|
||||
des_string_to_key(new_pw1, &newkey);
|
||||
ret = kadm_change_pw_plain((unsigned char*)&newkey, new_pw1, &pw_msg);
|
||||
memset(newkey, 0, sizeof(newkey));
|
||||
|
||||
|
||||
if (ret == KADM_INSECURE_PW)
|
||||
sia_message(collect, SIAWARNING, "Insecure password", pw_msg);
|
||||
else if (ret != KADM_SUCCESS)
|
||||
sia_message(collect, SIAWARNING, "Error changing password",
|
||||
sia_message(collect, SIAWARNING, "Error changing password",
|
||||
com_right(et_list, ret));
|
||||
}
|
||||
memset(new_pw1, 0, sizeof(new_pw1));
|
||||
@@ -595,7 +595,7 @@ again:
|
||||
sia_message(collect, SIAWARNING, "", "Password NOT changed.");
|
||||
else
|
||||
sia_message(collect, SIAINFO, "", "Password changed.");
|
||||
|
||||
|
||||
dest_tkt();
|
||||
if(ret)
|
||||
return SIADFAIL;
|
||||
@@ -605,37 +605,37 @@ again:
|
||||
|
||||
int
|
||||
siad_chg_shell (sia_collect_func_t *collect,
|
||||
const char *username,
|
||||
int argc,
|
||||
const char *username,
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
return SIADFAIL;
|
||||
}
|
||||
|
||||
int
|
||||
siad_getpwent(struct passwd *result,
|
||||
char *buf,
|
||||
int bufsize,
|
||||
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,
|
||||
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,
|
||||
siad_getpwnam (const char *name,
|
||||
struct passwd *result,
|
||||
char *buf,
|
||||
int bufsize,
|
||||
struct sia_context *context)
|
||||
{
|
||||
return SIADFAIL;
|
||||
@@ -654,29 +654,29 @@ siad_endpwent (struct sia_context *context)
|
||||
}
|
||||
|
||||
int
|
||||
siad_getgrent(struct group *result,
|
||||
char *buf,
|
||||
int bufsize,
|
||||
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,
|
||||
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,
|
||||
siad_getgrnam (const char *name,
|
||||
struct group *result,
|
||||
char *buf,
|
||||
int bufsize,
|
||||
struct sia_context *context)
|
||||
{
|
||||
return SIADFAIL;
|
||||
|
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 1999 - 2001 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of KTH nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
|
Reference in New Issue
Block a user