Re: My new problem with running losetup at boot time for encryptedroot.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



roconnor@xxxxxxxxxx wrote:
> I also tried adding the flag `-p0' to the losetup command.  This also
> works.  Of course, there is no prompt, and the password appears in plain
> text on the console.  Obviously that isn't an acceptable solution.

At first I thought this could be library dependency problem, but if -p0
works, that means losetup and gpg library dependencies are OK.

> I guess that there is something strange going on between how losetup calls
> gnupg and how gnupg gets and manipluates the console to prompt for and get
> the password (without echoing to the console), but I really don't know how
> to proceed to debugging this.  Maybe someone more familiar with losetup
> and the linux boot process may have some idea what may have changed in
> this Kubuntu upgrade that would cause the problem I described.

Password prompt comes from losetup that calls getpass() library funtion.
Then losetup starts gpg and sends the password to gpg via a pipe.

Can you make sure that a /dev/tty device node exists at the time losetup
runs in your boot script? If I remember correctly, getpass() library funtion
opens /dev/tty device.

What happens if you add this line to your boot script right before losetup
is called?

    mknod /dev/tty c 5 0


Plan B:
~~~~~~~
Can you change one line of util-linux mount/lomount.c main() function, so
that line number 1240:

        setlocale(LC_ALL, "");

becomes this:

        setlocale(LC_ALL, ""); ioctl(0, TIOCSCTTY, 0);

That ioctl() sets controlling tty if not already set.

-- 
Jari Ruusu  1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9  DB 1D EB E3 24 0E A9 DD

-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/


[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux