View | Details | Raw Unified | Return to bug 281003
Collapse All | Expand All

(-)usr.sbin/mountd/mountd.c (-4 / +40 lines)
Lines 2825-2831 do_opt(char **cpp, char **endcpp, struct exportlist *e Link Here
2825
{
2825
{
2826
	char *cpoptarg, *cpoptend;
2826
	char *cpoptarg, *cpoptend;
2827
	char *cp, *endcp, *cpopt, savedc, savedc2;
2827
	char *cp, *endcp, *cpopt, savedc, savedc2;
2828
	int allflag, usedarg;
2828
	int allflag, usedarg, fnd_equal;
2829
2829
2830
	savedc2 = '\0';
2830
	savedc2 = '\0';
2831
	cpopt = *cpp;
2831
	cpopt = *cpp;
Lines 2836-2849 do_opt(char **cpp, char **endcpp, struct exportlist *e Link Here
2836
	while (cpopt && *cpopt) {
2836
	while (cpopt && *cpopt) {
2837
		allflag = 1;
2837
		allflag = 1;
2838
		usedarg = -2;
2838
		usedarg = -2;
2839
		fnd_equal = 0;
2839
		if ((cpoptend = strchr(cpopt, ','))) {
2840
		if ((cpoptend = strchr(cpopt, ','))) {
2840
			*cpoptend++ = '\0';
2841
			*cpoptend++ = '\0';
2841
			if ((cpoptarg = strchr(cpopt, '=')))
2842
			if ((cpoptarg = strchr(cpopt, '='))) {
2842
				*cpoptarg++ = '\0';
2843
				*cpoptarg++ = '\0';
2844
				fnd_equal = 1;
2845
			}
2843
		} else {
2846
		} else {
2844
			if ((cpoptarg = strchr(cpopt, '=')))
2847
			if ((cpoptarg = strchr(cpopt, '='))) {
2845
				*cpoptarg++ = '\0';
2848
				*cpoptarg++ = '\0';
2846
			else {
2849
				fnd_equal = 1;
2850
			} else {
2847
				*cp = savedc;
2851
				*cp = savedc;
2848
				nextfield(&cp, &endcp);
2852
				nextfield(&cp, &endcp);
2849
				**endcpp = '\0';
2853
				**endcpp = '\0';
Lines 2856-2861 do_opt(char **cpp, char **endcpp, struct exportlist *e Link Here
2856
			}
2860
			}
2857
		}
2861
		}
2858
		if (!strcmp(cpopt, "ro") || !strcmp(cpopt, "o")) {
2862
		if (!strcmp(cpopt, "ro") || !strcmp(cpopt, "o")) {
2863
			if (fnd_equal == 1) {
2864
				syslog(LOG_ERR, "= after op: %s", cpopt);
2865
				return (1);
2866
			}
2859
			*exflagsp |= MNT_EXRDONLY;
2867
			*exflagsp |= MNT_EXRDONLY;
2860
		} else if (cpoptarg && (!strcmp(cpopt, "maproot") ||
2868
		} else if (cpoptarg && (!strcmp(cpopt, "maproot") ||
2861
		    !(allflag = strcmp(cpopt, "mapall")) ||
2869
		    !(allflag = strcmp(cpopt, "mapall")) ||
Lines 2894-2908 do_opt(char **cpp, char **endcpp, struct exportlist *e Link Here
2894
			usedarg++;
2902
			usedarg++;
2895
			opt_flags |= OP_NET;
2903
			opt_flags |= OP_NET;
2896
		} else if (!strcmp(cpopt, "alldirs")) {
2904
		} else if (!strcmp(cpopt, "alldirs")) {
2905
			if (fnd_equal == 1) {
2906
				syslog(LOG_ERR, "= after op: %s", cpopt);
2907
				return (1);
2908
			}
2897
			opt_flags |= OP_ALLDIRS;
2909
			opt_flags |= OP_ALLDIRS;
2898
		} else if (!strcmp(cpopt, "public")) {
2910
		} else if (!strcmp(cpopt, "public")) {
2911
			if (fnd_equal == 1) {
2912
				syslog(LOG_ERR, "= after op: %s", cpopt);
2913
				return (1);
2914
			}
2899
			*exflagsp |= MNT_EXPUBLIC;
2915
			*exflagsp |= MNT_EXPUBLIC;
2900
		} else if (!strcmp(cpopt, "webnfs")) {
2916
		} else if (!strcmp(cpopt, "webnfs")) {
2917
			if (fnd_equal == 1) {
2918
				syslog(LOG_ERR, "= after op: %s", cpopt);
2919
				return (1);
2920
			}
2901
			*exflagsp |= (MNT_EXPUBLIC|MNT_EXRDONLY|MNT_EXPORTANON);
2921
			*exflagsp |= (MNT_EXPUBLIC|MNT_EXRDONLY|MNT_EXPORTANON);
2902
			opt_flags |= OP_MAPALL;
2922
			opt_flags |= OP_MAPALL;
2903
		} else if (cpoptarg && !strcmp(cpopt, "index")) {
2923
		} else if (cpoptarg && !strcmp(cpopt, "index")) {
2904
			ep->ex_indexfile = strdup(cpoptarg);
2924
			ep->ex_indexfile = strdup(cpoptarg);
2905
		} else if (!strcmp(cpopt, "quiet")) {
2925
		} else if (!strcmp(cpopt, "quiet")) {
2926
			if (fnd_equal == 1) {
2927
				syslog(LOG_ERR, "= after op: %s", cpopt);
2928
				return (1);
2929
			}
2906
			opt_flags |= OP_QUIET;
2930
			opt_flags |= OP_QUIET;
2907
		} else if (cpoptarg && !strcmp(cpopt, "sec")) {
2931
		} else if (cpoptarg && !strcmp(cpopt, "sec")) {
2908
			if (parsesec(cpoptarg, ep))
2932
			if (parsesec(cpoptarg, ep))
Lines 2910-2919 do_opt(char **cpp, char **endcpp, struct exportlist *e Link Here
2910
			opt_flags |= OP_SEC;
2934
			opt_flags |= OP_SEC;
2911
			usedarg++;
2935
			usedarg++;
2912
		} else if (!strcmp(cpopt, "tls")) {
2936
		} else if (!strcmp(cpopt, "tls")) {
2937
			if (fnd_equal == 1) {
2938
				syslog(LOG_ERR, "= after op: %s", cpopt);
2939
				return (1);
2940
			}
2913
			*exflagsp |= MNT_EXTLS;
2941
			*exflagsp |= MNT_EXTLS;
2914
		} else if (!strcmp(cpopt, "tlscert")) {
2942
		} else if (!strcmp(cpopt, "tlscert")) {
2943
			if (fnd_equal == 1) {
2944
				syslog(LOG_ERR, "= after op: %s", cpopt);
2945
				return (1);
2946
			}
2915
			*exflagsp |= (MNT_EXTLS | MNT_EXTLSCERT);
2947
			*exflagsp |= (MNT_EXTLS | MNT_EXTLSCERT);
2916
		} else if (!strcmp(cpopt, "tlscertuser")) {
2948
		} else if (!strcmp(cpopt, "tlscertuser")) {
2949
			if (fnd_equal == 1) {
2950
				syslog(LOG_ERR, "= after op: %s", cpopt);
2951
				return (1);
2952
			}
2917
			*exflagsp |= (MNT_EXTLS | MNT_EXTLSCERT |
2953
			*exflagsp |= (MNT_EXTLS | MNT_EXTLSCERT |
2918
			    MNT_EXTLSCERTUSER);
2954
			    MNT_EXTLSCERTUSER);
2919
		} else {
2955
		} else {

Return to bug 281003