On Thu, Nov 29, 2007 at 09:04:53AM -0700, LaMont Jones wrote:
> From: Timo Sirainen <[EMAIL PROTECTED]>
> 
> Report missing helper program if mount device doesn't exist, which most
> likely means a non-local filesystem mount which might need a helper program.
> 
> See: http://bugs.debian.org/452330
> 
> Signed-off-by: LaMont Jones <[EMAIL PROTECTED]>
> ---
>  mount/mount.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/mount/mount.c b/mount/mount.c
> index 99ad970..b870eb6 100644
> --- a/mount/mount.c
> +++ b/mount/mount.c
> @@ -1227,7 +1227,15 @@ try_mount_one (const char *spec0, const char *node0, 
> const char *types0,
>              "       missing codepage or helper program, or other error"),
>              spec);
>  
> -     if (stat(spec, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)
> +     if (stat(spec, &statbuf) < 0) {
> +       if (errno == ENOENT) {
> +         char mountprog[120];
> +         snprintf(mountprog, sizeof(mountprog), "/sbin/mount.%s", types);
> +         if (stat(mountprog, &statbuf) < 0)
> +           error(_("       You might need a helper program: %s"), mountprog);
> +       }

 This not a good solution. The "types" could be comma-separated list
 of FS types. This solution also produces unexpected suggestions like
 /sbin/mount.ext3...

 What about to use any more generic message like

  "For several filesystems (e.g. nfs, cifs) you might need a
  /sbin/mount.<type> helper program."


    Karel

-- 
 Karel Zak  <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to