Date: Sun, 22 Mar 2020 18:35:11 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r359221 - projects/nfs-over-tls/usr.sbin/mountd Message-ID: <202003221835.02MIZBfO086049@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sun Mar 22 18:35:11 2020 New Revision: 359221 URL: https://svnweb.freebsd.org/changeset/base/359221 Log: Add the "-tls" and "-tlscert" export options to mountd.c. Unfortunately, flags in the export structure is an int and not a uint64_t, so I had to hack around that. This needs to be fixed properly. Modified: projects/nfs-over-tls/usr.sbin/mountd/mountd.c Modified: projects/nfs-over-tls/usr.sbin/mountd/mountd.c ============================================================================== --- projects/nfs-over-tls/usr.sbin/mountd/mountd.c Sun Mar 22 18:27:28 2020 (r359220) +++ projects/nfs-over-tls/usr.sbin/mountd/mountd.c Sun Mar 22 18:35:11 2020 (r359221) @@ -1482,7 +1482,7 @@ get_exportlist_one(int passno) */ has_host = FALSE; anon = def_anon; - exflags = MNT_EXPORTED; + exflags = MNTEX_EXPORTED; got_nondir = 0; opt_flags = 0; ep = (struct exportlist *)NULL; @@ -1868,7 +1868,7 @@ get_exportlist(int passno) LOGDEBUG("doing passno=0"); /* * Clear flag that notes if a public fh has been exported. - * It is set by do_mount() if MNT_EXPUBLIC is set for the entry. + * It is set by do_mount() if MNTEX_PUBLIC is set for the entry. */ has_publicfh = 0; @@ -2697,14 +2697,14 @@ do_opt(char **cpp, char **endcpp, struct exportlist *e } } if (!strcmp(cpopt, "ro") || !strcmp(cpopt, "o")) { - *exflagsp |= MNT_EXRDONLY; + *exflagsp |= MNTEX_RDONLY; } else if (cpoptarg && (!strcmp(cpopt, "maproot") || !(allflag = strcmp(cpopt, "mapall")) || !strcmp(cpopt, "root") || !strcmp(cpopt, "r"))) { usedarg++; parsecred(cpoptarg, cr); if (allflag == 0) { - *exflagsp |= MNT_EXPORTANON; + *exflagsp |= MNTEX_EXPORTANON; opt_flags |= OP_MAPALL; } else opt_flags |= OP_MAPROOT; @@ -2737,9 +2737,9 @@ do_opt(char **cpp, char **endcpp, struct exportlist *e } else if (!strcmp(cpopt, "alldirs")) { opt_flags |= OP_ALLDIRS; } else if (!strcmp(cpopt, "public")) { - *exflagsp |= MNT_EXPUBLIC; + *exflagsp |= MNTEX_PUBLIC; } else if (!strcmp(cpopt, "webnfs")) { - *exflagsp |= (MNT_EXPUBLIC|MNT_EXRDONLY|MNT_EXPORTANON); + *exflagsp |= (MNTEX_PUBLIC|MNTEX_RDONLY|MNTEX_EXPORTANON); opt_flags |= OP_MAPALL; } else if (cpoptarg && !strcmp(cpopt, "index")) { ep->ex_indexfile = strdup(cpoptarg); @@ -2750,6 +2750,10 @@ do_opt(char **cpp, char **endcpp, struct exportlist *e return (1); opt_flags |= OP_SEC; usedarg++; + } else if (!strcmp(cpopt, "tls")) { + *exflagsp |= MNTEX_TLS; + } else if (!strcmp(cpopt, "tlscert")) { + *exflagsp |= MNTEX_TLSCERT; } else { syslog(LOG_ERR, "bad opt %s", cpopt); return (1); @@ -3139,7 +3143,7 @@ do_mount(struct exportlist *ep, struct grouplist *grp, * If this is the public directory, get the file handle * and load it into the kernel via the nfssvc() syscall. */ - if ((exflags & MNT_EXPUBLIC) != 0) { + if ((exflags & MNTEX_PUBLIC) != 0) { fhandle_t fh; char *public_name;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003221835.02MIZBfO086049>