chroot.diff

Markus Friedl markus.friedl at informatik.uni-erlangen.de
Thu Jan 4 07:44:09 EST 2001


hi, what is the rationale for the while() loop? why multiple chroot's?

-markus

> +#   ifdef CHROOT
> +				user_dir = xstrdup(pw->pw_dir);
> +				new_root = user_dir + 1;                                                                                  
> +
> +				while((new_root = strchr(new_root, '.')) != NULL) {
> +	 			    new_root--;
> +				     if(strncmp(new_root, "/./", 3) == 0) {
> +				          *new_root = '\0';
> +				          new_root += 2;
> +
> +					  if(chroot(user_dir) != 0)
> +				               fatal("Couldn't chroot to user directory %s", user_dir);
> +
> +			   	          pw->pw_dir = new_root;
> +					  break;
> +				     }
> +				     new_root += 2;
> +				}
> +#   endif /* CHROOT */





More information about the openssh-unix-dev mailing list