Skip to content

Commit

Permalink
Add support for kerberised NQNFS.
Browse files Browse the repository at this point in the history
Reviewed by:
Submitted by:
Obtained from:
  • Loading branch information
Doug Rabson authored and Doug Rabson committed Jan 30, 1995
1 parent 5439cc4 commit 34728d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions sbin/mount_nfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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>
7 changes: 4 additions & 3 deletions sbin/mount_nfs/mount_nfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -412,7 +414,6 @@ main(argc, argv)
ncd.ncd_authstr = (char *)kt.dat;
nfssvc_flag = NFSSVC_MNTD | NFSSVC_GOTAUTH;
}
setreuid(0, 0);
#endif /* KERBEROS */
}
}
Expand Down

0 comments on commit 34728d6

Please sign in to comment.