[Splashy-devel] splashy and cryptsetup

Luis Mondesi lemsx1 at gmail.com
Sat Jul 26 16:39:06 UTC 2008


Is this against Splashy from git?
Splashy tries to chroot to the real root right after it's properly  
setup. That resolves keyboard handling issues for us.

On Jul 26, 2008, at 4:47 AM, John Hughes <john at Calva.COM> wrote:

> Once again splashy and cryptsetup don't get along.
>
> I've just submitted a bug against cryptsetup, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=492451
>
> My fix is the attached patch.
>
> I thought about trying to do it via a popen of /sbin/slashy_update,  
> but the horrors of shell quoting put me off.
>
>
> --- cryptsetup-1.0.6/debian/askpass.c	2008-07-26 10:20:13.000000000  
> +0200 +++ cryptsetup-1.0.6-jh/debian/askpass.c	2008-07-26 10:09:56.000000000 
>  +0200 @@ -40,6 +40,9 @@ #include #include #include +#include  
> +#include +#include #define DEBUG 0 @@ -361,6 +364,68 @@ } / 
> *** 
> *** 
> *** 
> ********************************************************************  
> + * splashy functions * +  
> *** 
> *** 
> *** 
> *** 
> *****************************************************************/ +  
> +/* It might be better style to just do a popen of splashy_update ?  
> */ + +#define SPLASHY_SOCK	"\0/splashy" +static size_t splashyused =  
> 0; +static size_t splashysize = 0; +static char *splashybuf = NULL;  
> + +static int +splashy_prepare(const char *prompt) +{ +	int fd; +	 
> struct sockaddr addr = {AF_UNIX, SPLASHY_SOCK}; +	struct iovec  
> iov[2]; + +	if ((fd = socket (PF_UNIX, SOCK_STREAM, 0)) == -1) { +  
> return -1; +	} + +	if (connect (fd, &addr, sizeof addr) == -1) { +	  
> close (fd); +	 return -1; +	} + +	iov[0].iov_base = "getpass "; +	 
> iov[0].iov_len = strlen ("getpass "); +	iov[1].iov_base = prompt; +	 
> iov[1].iov_len = strlen (prompt) + 1; + +	if (writev (fd, iov, 2) ==  
> -1) { + close (fd); +	 return -1; +	} + +	/* Shutdown write? */ + +	 
> return fd; +} + +static bool +splashy_read(int fd, char **buf,  
> size_t *size) +{ +	debug("In splashy_read\n"); +	if  
> (fifo_common_read(fd, &splashybuf, &splashyused, &splashysize)) { +  
> *buf = splashybuf; +	 *size = splashyused; +	 return true; +	} + +	 
> return false; +} + + +static void +splashy_finish(int fd) +{ +	 
> fifo_common_finish (fd, &splashybuf, &splashyused, &splashysize); +}  
> + +/ 
> *** 
> *** 
> *** 
> ********************************************************************  
> * fifo functions *  
> *** 
> *** 
> *** 
> *** 
> *****************************************************************/  
> #define FIFO_PATH "/lib/cryptsetup/passfifo" @@ -512,6 +577,7 @@  
> static struct method methods[] = { { "usplash", usplash_prepare,  
> usplash_read, usplash_finish, false, true, -1 }, +	{ "splashy",  
> splashy_prepare, splashy_read, splashy_finish, false, true, -1 },  
> { "fifo", fifo_prepare, fifo_read, fifo_finish, false, true, -1 },  	 
> { "console", console_prepare, console_read, console_finish, false,  
> true, -1 } };
> _______________________________________________
> Splashy-devel mailing list
> Splashy-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/splashy-devel



More information about the Splashy-devel mailing list