diff --git a/CHANGELOG b/CHANGELOG index acec8e5..ffcaacc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -59,6 +59,7 @@ xx/xx/2018 autofs-5.1.5 - remove unused function reverse_mnt_list(). - remove a couple of old debug messages. - fix amd entry memory leak. +- fix unlink_mount_tree() not umounting mounts. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/daemon/direct.c b/daemon/direct.c index 210f20f..28db167 100644 --- a/daemon/direct.c +++ b/daemon/direct.c @@ -264,10 +264,6 @@ static int unlink_mount_tree(struct autofs_point *ap, struct list_head *list) { struct list_head *p; int rv, ret; - pid_t pgrp = getpgrp(); - char spgrp[20]; - - sprintf(spgrp, "pgrp=%d", pgrp); ret = 1; list_for_each(p, list) { @@ -275,9 +271,6 @@ static int unlink_mount_tree(struct autofs_point *ap, struct list_head *list) mnt = list_entry(p, struct mnt_list, list); - if (strstr(mnt->opts, spgrp)) - continue; - if (strcmp(mnt->fs_type, "autofs")) rv = spawn_umount(ap->logopt, "-l", mnt->path, NULL); else diff --git a/daemon/indirect.c b/daemon/indirect.c index d38c212..1311f4c 100644 --- a/daemon/indirect.c +++ b/daemon/indirect.c @@ -44,19 +44,10 @@ static int unlink_mount_tree(struct autofs_point *ap, struct mnt_list *mnts) { struct mnt_list *this; int rv, ret; - pid_t pgrp = getpgrp(); - char spgrp[20]; - - sprintf(spgrp, "pgrp=%d", pgrp); ret = 1; this = mnts; while (this) { - if (strstr(this->opts, spgrp)) { - this = this->next; - continue; - } - if (strcmp(this->fs_type, "autofs")) rv = spawn_umount(ap->logopt, "-l", this->path, NULL); else diff --git a/include/mounts.h b/include/mounts.h index ec85ae9..0cb4a89 100644 --- a/include/mounts.h +++ b/include/mounts.h @@ -53,7 +53,6 @@ struct mnt_list { char *fs_name; char *fs_type; char *opts; - pid_t owner; /* * List operations ie. get_mnt_list. */ diff --git a/lib/mounts.c b/lib/mounts.c index fb7504d..7e82beb 100644 --- a/lib/mounts.c +++ b/lib/mounts.c @@ -798,7 +798,6 @@ struct mnt_list *get_mnt_list(const char *table, const char *path, int include) struct mntent *mnt; struct mnt_list *ent, *mptr, *last; struct mnt_list *list = NULL; - char *pgrp; size_t len; if (!path || !pathlen || pathlen > PATH_MAX) @@ -879,15 +878,6 @@ struct mnt_list *get_mnt_list(const char *table, const char *path, int include) return NULL; } strcpy(ent->opts, mnt->mnt_opts); - - ent->owner = 0; - pgrp = strstr(mnt->mnt_opts, "pgrp="); - if (pgrp) { - char *end = strchr(pgrp, ','); - if (end) - *end = '\0'; - sscanf(pgrp, "pgrp=%d", &ent->owner); - } } endmntent(tab); @@ -1068,7 +1058,6 @@ struct mnt_list *tree_make_mnt_tree(const char *table, const char *path) struct mntent *mnt; struct mnt_list *ent, *mptr; struct mnt_list *tree = NULL; - char *pgrp; size_t plen; int eq; @@ -1147,15 +1136,6 @@ struct mnt_list *tree_make_mnt_tree(const char *table, const char *path) } strcpy(ent->opts, mnt->mnt_opts); - ent->owner = 0; - pgrp = strstr(mnt->mnt_opts, "pgrp="); - if (pgrp) { - char *end = strchr(pgrp, ','); - if (end) - *end = '\0'; - sscanf(pgrp, "pgrp=%d", &ent->owner); - } - mptr = tree; while (mptr) { int elen = strlen(ent->path);