#include <mit-copyright.h>
#include "sms_private.h"
+#include <ctype.h>
#include <krb.h>
#include <krb_et.h>
sms_params params_st;
char *args[2];
int argl[2];
- char realm[REALM_SZ];
- char host[BUFSIZ];
+ char realm[REALM_SZ], host[BUFSIZ], *p;
register sms_params *params = ¶ms_st;
sms_params *reply = NULL;
CHECK_CONNECTED;
- /*
- * Build a Kerberos authenticator.
- * The "service" and "instance" should not be hardcoded here.
- */
+ /* Build a Kerberos authenticator. */
bzero(host, sizeof(host));
if (status = sms_host(host, sizeof(host) - 1))
return status;
strcpy(realm, krb_realmofhost(host));
+ for (p = host; *p && *p != '.'; p++)
+ if (isupper(*p))
+ *p = tolower(*p);
+ *p = 0;
- status = krb_mk_req(&auth, "sms", "sms", realm, 0);
+ status = krb_mk_req(&auth, MOIRA_SNAME, host, realm, 0);
if (status != KSUCCESS) {
status += ERROR_TABLE_BASE_krb;
return status;