setfstab()/getfstab()

Robert Watson rwatson at FreeBSD.ORG
Wed Apr 2 13:38:00 PST 2003


On Wed, 2 Apr 2003, Matthew N. Dodd wrote:

> On Wed, 2 Apr 2003, Robert Watson wrote:
> > Hmm.  Maybe an issetugid() check before using the environmental variable?
> 
> Something like this? (whitespace damaged)

Yes, that looks reasonable to me.

> %%%
> @@ -226,7 +254,13 @@
>                 LineNo = 0;
>                 return(1);
>         }
> -       if ((_fs_fp = fopen(_PATH_FSTAB, "r")) != NULL) {
> +       if (fsp_set == 0) {
> +               if (issetugid())
> +                       setfstab(NULL);
> +               else
> +                       setfstab(getenv("PATH_FSTAB"));
> +       }
> +       if ((_fs_fp = fopen(path_fstab, "r")) != NULL) {
>                 LineNo = 0;
>                 return(1);
>         }
> %%%
> 
> 
> -- 
> | Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
> | winter at jurai.net |       2 x '84 Volvo 245DL        | ix86,sparc,pmax |
> | http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |
> 



More information about the freebsd-fs mailing list