privsep patch, Please test (take 3)

Kevin Steves kevin at atomicgears.com
Fri Jun 7 10:05:57 EST 2002


On Wed, Jun 05, 2002 at 06:22:39PM -0700, Tim Rice wrote:
> -#if  defined(HAVE_MMAP) && defined(MAP_ANON)
> +#ifdef HAVE_MMAP
> +#ifdef HAVE_MMAP_ANON_SHARED
>  	address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
>  	    -1, 0);
> +#elif defined(HAVE_MMAP_DEV_ZERO_SHARED)
> +	address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED,
> +	    open("/dev/zero", O_RDWR), 0);
> +#elif defined(HAVE_MMAP_ANON_PRIVATE)
> +	address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_PRIVATE,
> +	    -1, 0);
> +#elif defined(HAVE_MMAP_DEV_ZERO_PRIVATE)
> +	address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_PRIVATE,
> +	    open("/dev/zero", O_RDWR), 0);
> +#endif
>  	if (address == MAP_FAILED)
>  		fatal("mmap(%lu)", (u_long)size);
>  #else

hmm, more ifdefs.  can there be xmmap() so there's one line of diff
between openbsd?  and again, i think we should use mm if possible.

> --- openssh/session.c.old	Sun May 12 20:25:02 2002
> +++ openssh/session.c	Wed May 29 07:39:22 2002
> @@ -1089,10 +1089,11 @@
>  			exit(1);
>  		}
>  		/* Initialize the group list. */
> -		if (initgroups(pw->pw_name, pw->pw_gid) < 0) {
> -			perror("initgroups");
> -			exit(1);
> -		}
> +		if (strcmp(pw->pw_name, SSH_PRIVSEP_USER))
> +			if (initgroups(pw->pw_name, pw->pw_gid) < 0) {
> +				perror("initgroups");
> +				exit(1);
> +			}

why are we doing this?



More information about the openssh-unix-dev mailing list