Rush has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/333230 )

Change subject: labstore: check should search for exact mount match
......................................................................


labstore: check should search for exact mount match

The way nfs-mount-manager looks for a mount point is too permissive and
could match other mount point. For example if one has:

 none on /srv/home/jenkins-deploy/tmpfs type tmpfs

"nfs-mount-manager check /home" would emit a match.

Harness the regex with ^ and $ to only take in account exact matches.

Bug: T155820
Change-Id: I8a934e84f78e6ce3170deb70990f6a403959feef
---
M modules/labstore/files/nfs-mount-manager
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Hashar: Looks good to me, but someone else must approve
  Rush: Verified; Looks good to me, approved



diff --git a/modules/labstore/files/nfs-mount-manager 
b/modules/labstore/files/nfs-mount-manager
index c2b1d66..c4bc5d7 100644
--- a/modules/labstore/files/nfs-mount-manager
+++ b/modules/labstore/files/nfs-mount-manager
@@ -21,7 +21,7 @@
         check)
 
             if cat /proc/mounts | /usr/bin/awk '{print $2}' \
-                | /bin/grep -qs $2; then
+                | /bin/grep -qs "^$2$"; then
                 echo "It's mounted."
             else
                 echo "It's not mounted."

-- 
To view, visit https://gerrit.wikimedia.org/r/333230
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a934e84f78e6ce3170deb70990f6a403959feef
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Chasemp <r...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Madhuvishy <mviswanat...@wikimedia.org>
Gerrit-Reviewer: Rush <r...@wikimedia.org>
Gerrit-Reviewer: Tim Landscheidt <t...@tim-landscheidt.de>
Gerrit-Reviewer: Yuvipanda <yuvipa...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to