From: Mike Frysinger <vapier@gentoo.org>
To: util-linux-ng@vger.kernel.org
Subject: [PATCH] umount: respect fs search path
Date: Thu, 16 Feb 2012 14:59:26 -0500 [thread overview]
Message-ID: <1329422366-576-1-git-send-email-vapier@gentoo.org> (raw)
This brings search path support to umount to match existing behavior
in fsck and mount.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
mount/umount.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/mount/umount.c b/mount/umount.c
index ad93e75..a6fcd33 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -100,7 +100,8 @@ static int fake = 0;
static int
check_special_umountprog(const char *node,
const char *type, int *status) {
- char umountprog[120];
+ char search_path[] = FS_SEARCH_PATH;
+ char *path, umountprog[150];
struct stat statbuf;
int res;
@@ -110,10 +111,16 @@ check_special_umountprog(const char *node,
if (type == NULL || strcmp(type, "none") == 0)
return 0;
- if (strlen(type) < 100) {
+ path = strtok(search_path, ":");
+ while (path) {
int type_opt = 0;
- sprintf(umountprog, "/sbin/umount.%s", type);
+ res = snprintf(umountprog, sizeof(umountprog), "%s/umount.%s",
+ path, type);
+ path = strtok(NULL, ":");
+ if (res < 0 || (size_t) res >= sizeof(umountprog))
+ continue;
+
res = stat(umountprog, &statbuf);
if (res == -1 && errno == ENOENT && strchr(type, '.')) {
/* If type ends with ".subtype" try without it */
--
1.7.8.4
next reply other threads:[~2012-02-16 19:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 19:59 Mike Frysinger [this message]
2012-02-24 10:36 ` [PATCH] umount: respect fs search path 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=1329422366-576-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=util-linux-ng@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