Re: Prompting for passwords when mounting drives from /etc/fstab



On Fri, 2005-10-07 at 03:31 +0000, Nate Nielsen wrote:
> I'd like to again broach the issue of prompting for a password when
> mounting legacy drives from /etc/fstab.
> 
> Patch: http://bugzilla.gnome.org/attachment.cgi?id=50425
> Bug: http://bugzilla.gnome.org/show_bug.cgi?id=157650
> 
> Yes, I understand this is legacy stuff and not new and shiny like HAL
> and friends, but I believe that this functionality will fill a hole in
> many large organizations where such SMB, CIFS and other 'legacy' mounts
> are common place.
> 
> Now to specifics:
> 
> The problem of screen scraping...
> I'm not sure we can get around this. But the current code already does
> this in a much greater way than just searching for "password:". It
> parses the mount error messages. I believe this is an artifact of
> dealing with the legacy 'mount' command. If there's a way around it then
> that's great, but I haven't been able to come up with one.
> 
> Note that for many drives listen in /etc/fstab, it's impossible to tell
> ahead of time whether a password will be required or not. Also because
> mount uses helper modules to mount smb, cifs, and other such
> filesystems, it would be very involved to replace that code.
> 
> The problem of locale. Well because we already do "screen scraping" on
> the mount commands (to figure out the error codes etc...) the current
> mount code already runs mount and umount in the "C" locale.
> 
> The patch may need more work, but I figured I'd wait on the polish. I
> won't continue working on this if there's no hope of getting it committed.
> 
> Any thoughts?

I'd say that for the future, in Linux, this isn't extremely interesting,
as we should probably be using a pmount-style mount system. However, I
agree that there is a use for supporting "legacy" style mounts too.
Some comments on the latest patch (id 51535):

Why did you enable creating of GnomeVFSDrives from loopback mounts? We
explicitly disabled this because things like iso loopback files were
often in fstab, and people were badly confused by these showing up as
cdrom drives in Computer. 

Maybe you could reuse the _gnome_vfs_pty_open in modules/pty-open.c
instead of using openpty. I'm not sure the exact details here, but maybe
that code works on more systems? (We'd have to move the code of course.)

+ if ((!invoke_fill_auth (info, &password) || password == NULL) &&
+    (!invoke_full_auth (info, &password, &keyring, &save_password) || password == NULL)) {

This doesn't look really right. If the fill_auth succeeds, but the
stored password is wrong you'll never get the password dialog.

+  command = find_command (is_in_media ? PUMOUNT_COMMAND : UMOUNT_COMMAND);

I'm not sure this is right at all. /media is in the new LHS, and might
well be used with old-style mount systems. I'm not sure how this thing
is supposed to work though. David?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a maverick native American stage actor gone bad. She's a mistrustful 
antique-collecting opera singer from out of town. They fight crime! 




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