Add support for kerberised NQNFS.

Reviewed by:
Submitted by:
Obtained from:
This commit is contained in:
dfr 1995-01-30 19:18:11 +00:00
parent 36afe918b7
commit 35bca936c2
2 changed files with 12 additions and 3 deletions

View File

@ -8,4 +8,12 @@ MOUNT= ${.CURDIR}/../mount
CFLAGS+= -DNFS -I${MOUNT}
.PATH: ${MOUNT}
.if exists(${DESTDIR}/usr/lib/libkrb.a) && (defined(MAKE_KERBEROS) \
|| defined(MAKE_EBONES))
CFLAGS+=-DKERBEROS
DPADD= ${LIBKRB} ${LIBDES}
LDADD= -lkrb -ldes
DISTRIBUTION= krb
.endif
.include <bsd.prog.mk>

View File

@ -400,10 +400,12 @@ main(argc, argv)
* is found.
*/
if (ncd.ncd_authuid != last_ruid) {
krb_set_tkt_string("");
char buf[512];
(void)sprintf(buf, "%s%d",
TKT_ROOT, ncd.ncd_authuid);
krb_set_tkt_string(buf);
last_ruid = ncd.ncd_authuid;
}
setreuid(ncd.ncd_authuid, 0);
if (krb_mk_req(&kt, "rcmd", inst, realm, 0) ==
KSUCCESS &&
kt.length <= (RPCAUTH_MAXSIZ - 2 * NFSX_UNSIGNED)) {
@ -412,7 +414,6 @@ main(argc, argv)
ncd.ncd_authstr = (char *)kt.dat;
nfssvc_flag = NFSSVC_MNTD | NFSSVC_GOTAUTH;
}
setreuid(0, 0);
#endif /* KERBEROS */
}
}