Re: Patch: Prompt for required password when mounting a drive



Hi!

(I'm the pmount author, btw).

Alexander Larsson [2005-08-26 15:34 +0200]:
> On Tue, 2005-08-09 at 01:37 +0000, Nate Nielsen wrote:
> > When mounting a drive (listed in /etc/fstab) such as a an SMB, or
> > encrypted loop mount the 'mount' command will prompt for a password.
> > However when mounting that drive through gnome-vfs, there's nowhere for
> > the user to enter the required password.
> > 
> > This patch adds functionality to gnome-vfs so that when the 'mount'
> > command requests a password it prompts using a gnome-vfs-auth dialog.
> > 
> > Patch: http://bugzilla.gnome.org/attachment.cgi?id=50425
> > Bug: http://bugzilla.gnome.org/show_bug.cgi?id=157650
> > 
> > The 'mount' command prompts for passwords on /dev/tty. The patch opens a
> > tty and forks the 'mount' command with that as its stdin and stdout. It
> > then waits for a 'password:' string, etc...
> > 
> > This is a rough and incomplete patch, but I want to make sure this makes
> > sense and I haven't missed anything obvious.
> 
> I think there is one problem, locale. These days we run the mount
> command in the same locale as the invoking app, since pmount-like
> systems can bring up real UI to help mount the filesystem

Well, pmount itself does not really spawn a GUI, but you are right,
pmount is i18n'ed and already translated into some ten languages.

However, since smb mounts are not deemed "removable" (at least not
right now), and in particular because the affected mount is in fstab,
pmount immediately calls mount to do the actual job.

> Maybe this can be done in a better way within the pmount system? I don't
> really know well enough how that works, so I can't say definately. Maybe
> the hal/pmount people can tell. davidz?

So far the only support for passwords is with LUKS encrypted devices;
if you call pmount at the command line, it will just ask for the
password interactively. However, for GUI integration pmount also
supports the "--passphrase <file>" argument. For example, in Ubuntu we
hacked gnome-volume-manager to spawn a password dialog for encrypted
devices, create a pipe, shove the password into the pipe and let
pmount read the password from that pipe with this command. This works
fine, I just didn't submit it yet to upstream since it lacks some
features still.

I think this is the way to go for GUI'izing password entries.
gnome-volume-manager and gnome-vfs-daemon should ask for a passphrase
and pass it to mount/pmount rather than trying to modify and scan
/dev/tty. mount has the -p option which is roughly equivalent to
pmount's --passphrase (it just takes a file fd number rather than a
path). 

So, Nate, you should adapt your patch to use mount -p instead.

Does that help you a bit? If not, don't hesitate to ask.

Please CC me on followups, I'm not subscribed.

Thanks,

Martin
-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

Attachment: signature.asc
Description: Digital signature



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