From 842886d6570d57457c2a6d91f2960535c50b591c Mon Sep 17 00:00:00 2001 From: Packit Service Date: Nov 06 2020 06:10:52 +0000 Subject: Apply patch autofs-5.1.4-dont-allow-trailing-slash-in-master-map-mount-points.patch patch_name: autofs-5.1.4-dont-allow-trailing-slash-in-master-map-mount-points.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index 1e5ec15..a7bb89d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ xx/xx/2018 autofs-5.1.5 - use_hostname_for_mounts shouldn't prevent selection among replicas. - fix monotonic_elapsed. - Makefiles.rules: remove 'samples' from SUBDIRS. +- dont allow trailing slash in master map mount points. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/lib/master_parse.y b/lib/master_parse.y index 42e03c2..761ade9 100644 --- a/lib/master_parse.y +++ b/lib/master_parse.y @@ -749,6 +749,7 @@ int master_parse_entry(const char *buffer, unsigned int default_timeout, unsigne struct map_source *source; unsigned int logopt = logging; unsigned int m_logopt = master->logopt; + size_t mp_len; int ret; local_init_vars(); @@ -763,6 +764,10 @@ int master_parse_entry(const char *buffer, unsigned int default_timeout, unsigne return 0; } + mp_len = strlen(path); + while (mp_len && path[--mp_len] == '/') + path[mp_len] = 0; + nc = master->nc; /* Add null map entries to the null map cache */