#include <unistd.h>
#include <com_err.h>
+#ifdef HAVE_KRB4
#include <krb.h>
+#endif
EXEC SQL INCLUDE sqlca;
return MR_DOWN;
}
- status = krb_get_svc_in_tkt(REG_SVR_PRINCIPAL, REG_SVR_INSTANCE,
- krb_realmofhost(hostname), MOIRA_SNAME,
- shorthostname, 3, KEYFILE);
- if (status)
- status += ERROR_TABLE_BASE_krb;
- else
- status = mr_krb5_auth("reg_svr");
+ status = mr_krb5_auth("reg_svr");
if (status)
{
com_err(whoami, status, "authenticating to moira");
if (count != 0)
return MR_IN_USE;
+ EXEC SQL SELECT COUNT(login) INTO :count FROM userhistory
+ WHERE login = :username;
+ if (sqlca.sqlcode)
+ return MR_DBMS_ERR;
+ if (count != 0)
+ return MR_IN_USE;
+
return MR_SUCCESS;
}