From: Karel Zak <kzak@redhat.com>
To: Amit <amit.uttam@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: Return status of mnt_context_mount when helper is used
Date: Wed, 19 Sep 2012 12:06:38 +0200 [thread overview]
Message-ID: <20120919100638.GC9602@x2.net.home> (raw)
In-Reply-To: <loom.20120919T005618-428@post.gmane.org>
On Tue, Sep 18, 2012 at 11:08:16PM +0000, Amit wrote:
> Hello,
>
> When trying to mount samba shares using *mnt_context_mount*, the
> *mount.cifs* helper is called and used. This allows for automatic
> resolving of hostnames.
>
> However, if the hostname is not valid and the resolve fails,
> the call *mnt_context_mount* is still successful. Using
> *mnt_init_debug*, the mount.cifs helper returns an error code but this
> is not propagated to the status of mnt_context_mount or
> mnt_context_get_status.
docs:
* mnt_context_get_status:
* @cxt: mount context
*
* Global libmount status.
*
* The real exit code of the mount.type helper has to be tested
* by mnt_context_get_helper_status(). The mnt_context_get_status()
* only inform that exec() has been successful.
> This has been tried with util-linux 2.20.1 and the latest util-linux
> from git (as of today).
>
> Is there a way to check the return status of the helper?
>
> START TRACE
>
> mount error: could not resolve address for pmanalo-pc2: Unknown error
> libmount: CXT: [0x811010]: /sbin/mount.cifs executed [status=1]
> libmount: CXT: [0x811010]: don't update: external helper
> mount_cifs: mnt_context_mount return code = 0 status = 1
> mount_cifs: error:
> libmount: CXT: [0x811010]: <---- reset [status=1] ---->
> libmount: CACHE: [0x811350]: free
> libmount: CXT: [0x811010]: <---- free
See sys-utils/mount.c: mk_exit_code()
if (mnt_context_helper_executed(cxt))
mnt_context_get_helper_status(cxt);
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2012-09-19 10:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-18 23:08 Return status of mnt_context_mount when helper is used Amit
2012-09-19 10:06 ` Karel Zak [this message]
2012-09-19 22:14 ` Amit Uttamchandani
2012-09-20 10:12 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120919100638.GC9602@x2.net.home \
--to=kzak@redhat.com \
--cc=amit.uttam@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).