From e1032cb059564007663e9854e5f2ed16ae8aaf47 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Apr 16 2021 22:13:56 +0000 Subject: Apply patch autofs-5.1.6-fix-browse-dir-not-re-created-on-symlink-expire.patch patch_name: autofs-5.1.6-fix-browse-dir-not-re-created-on-symlink-expire.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index 311f467..bd176b8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -115,6 +115,7 @@ xx/xx/2018 autofs-5.1.5 - remove unused function dump_master(). - fix additional typing errors. - make bind mounts propagation slave by default. +- fix browse dir not re-created on symlink expire. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/daemon/automount.c b/daemon/automount.c index ec11d5a..8451161 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -651,6 +651,25 @@ int umount_multi(struct autofs_point *ap, const char *path, int incl) "failed to remove symlink %s", path); return 1; } + /* Check if the autofs mount has browse mode enabled. + * If so re-create the directory entry. + */ + if (ap->flags | MOUNT_FLAG_GHOST) { + int ret; + + /* If the browse directory create fails log an + * error and continue anyway since the expire + * has succeeded. + */ + ret = mkdir_path(path, mp_mode); + if (ret && errno != EEXIST) { + char buf[MAX_ERR_BUF]; + char *estr; + estr = strerror_r(errno, buf, MAX_ERR_BUF); + warn(ap->logopt, + "mkdir_path %s failed: %s", path, estr); + } + } /* Check for an external mount and attempt umount if needed */ mounts_mutex_lock(ap); entry = __master_find_amdmount(ap, path);