#include <afs/dir.h>
#ifndef AFS_NT40_ENV
# include <afs/netutils.h>
+# include <afs/softsig.h>
#endif
#include "viced_prototypes.h"
#include "viced.h"
#include "host.h"
-#include <afs/softsig.h>
#if defined(AFS_SGI_ENV)
# include "sys/schedctl.h"
# include "sys/lock.h"
return afsconf_SuperUser(confDir, call, NULL);
}
+/**
+ * Return true if this name is a member of the local realm.
+ */
+int
+fs_IsLocalRealmMatch(void *rock, char *name, char *inst, char *cell)
+{
+ struct afsconf_dir *dir = (struct afsconf_dir *)rock;
+ afs_int32 islocal = 0; /* default to no */
+ int code;
+
+ code = afsconf_IsLocalRealmMatch(dir, &islocal, name, inst, cell);
+ if (code) {
+ ViceLog(0,
+ ("Failed local realm check; code=%d, name=%s, inst=%s, cell=%s\n",
+ code, name, inst, cell));
+ }
+ return islocal;
+}
+
static void
ResetCheckSignal(void)
{
/* rxkad options */
cmd_OptionAsFlag(opts, OPT_dotted, &rxkadDisableDotCheck);
if (cmd_OptionAsList(opts, OPT_realm, &optlist) == 0) {
- extern char local_realms[AFS_NUM_LREALMS][AFS_REALM_SZ];
- extern int num_lrealms;
for (; optlist != NULL; optlist=optlist->next) {
if (strlen(optlist->data) >= AFS_REALM_SZ) {
"characters.\n", AFS_REALM_SZ);
return -1;
}
-
- if (num_lrealms == -1)
- num_lrealms = 0;
- if (num_lrealms >= AFS_NUM_LREALMS) {
- printf("a maximum of %d -realm arguments can be "
- "specified.\n", AFS_NUM_LREALMS);
- return -1;
- }
-
- strncpy(local_realms[num_lrealms++], optlist->data, AFS_REALM_SZ);
- optlist = optlist->next;
+ afsconf_SetLocalRealm(optlist->data); /* overrides krb.conf file, if one */
}
}
exit(-1);
}
+ /* initialize audit user check */
+ osi_audit_set_user_check(confDir, fs_IsLocalRealmMatch);
+
/* Open FileLog on stdout, stderr, fd 1 and fd2 (for perror), sigh. */
#ifndef AFS_NT40_ENV
serverLogSyslogTag = "fileserver";