res = snprintf(mountprog, sizeof(mountprog), "%s/mount.%s",
path, type);
path = strtok(NULL, ":");
- if (res >= sizeof(mountprog) || res < 0)
+ if (res < 0 || (size_t) res >= sizeof(mountprog))
continue;
res = stat(mountprog, &statbuf);
#ifdef HAVE_LIBMOUNT_MOUNT
static void
verbose_mount_info(const char *spec, const char *node, const char *type,
- const char *opts, int flags)
+ const char *opts)
{
struct my_mntent mnt;
#ifdef HAVE_LIBMOUNT_MOUNT
update_mtab_entry(flags);
if (verbose)
- verbose_mount_info(loop ? loopfile : spec, node, tp, mo, flags);
+ verbose_mount_info(loop ? loopfile : spec, node, tp, mo);
#else
if (!(mounttype & MS_PROPAGATION))
update_mtab_entry(loop ? loopfile : spec,
* returns: 0: no exec was done, 1: exec was done, status has result
*/
static int
-check_special_umountprog(const char *spec, const char *node,
+check_special_umountprog(const char *node,
const char *type, int *status) {
char umountprog[120];
struct stat statbuf;
on a non-fatal error. We lock/unlock around each umount. */
static int
umount_one (const char *spec, const char *node, const char *type,
- const char *opts, struct mntentchn *mc) {
+ struct mntentchn *mc) {
int umnt_err = 0;
int isroot;
int res = 0;
* Call umount.TYPE for types that require a separate umount program.
* All such special things must occur isolated in the types string.
*/
- if (check_special_umountprog(spec, node, type, &status))
+ if (check_special_umountprog(node, type, &status))
return status;
block_signals(SIG_BLOCK);
mc = mc0;
while (res && mc) {
res = umount_one(mc->m.mnt_fsname, mc->m.mnt_dir,
- mc->m.mnt_type, mc->m.mnt_opts, mc);
+ mc->m.mnt_type, mc);
mc = getmntdirbackward(file, mc);
}
mc = mc0;
while (res && mc) {
res = umount_one(mc->m.mnt_fsname, mc->m.mnt_dir,
- mc->m.mnt_type, mc->m.mnt_opts, mc);
+ mc->m.mnt_type, mc);
mc = getmntdevbackward(file, mc);
}
return res;
if (matching_type (mc->m.mnt_type, types)
&& matching_opts (mc->m.mnt_opts, test_opts)) {
errors |= umount_one (mc->m.mnt_fsname, mc->m.mnt_dir,
- mc->m.mnt_type, mc->m.mnt_opts, mc);
+ mc->m.mnt_type, mc);
}
}
/*
* umount helper call based on {u,p}helper= mount option
*/
-static int check_helper_umountprog(const char *spec, const char *node,
+static int check_helper_umountprog(const char *node,
const char *opts, const char *name,
int *status)
{
helper = get_option_value(opts, name);
if (helper)
- return check_special_umountprog(spec, node, helper, status);
+ return check_special_umountprog(node, helper, status);
return 0;
}
/*
* helper - umount helper (e.g. pam_mount)
*/
- if (check_helper_umountprog(arg, arg, mc->m.mnt_opts,
+ if (check_helper_umountprog(arg, mc->m.mnt_opts,
"helper=", &status))
return status;
}
/*
* uhelper - unprivileged umount helper (e.g. HAL/udisks mounts)
*/
- if (check_helper_umountprog(arg, arg, mc->m.mnt_opts,
+ if (check_helper_umountprog(arg, mc->m.mnt_opts,
"uhelper=", &status))
return status;
if (mc)
return umount_one_bw (file, mc);
else
- return umount_one (arg, arg, arg, arg, NULL);
+ return umount_one (arg, arg, arg, NULL);
}
int