[PATCH master rhel6-branch] Add more sanity checks to the mountpoint (#592185)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resolves: rhbz#592185
---
 partIntfHelpers.py |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/partIntfHelpers.py b/partIntfHelpers.py
index c2b77f8..9fb2f72 100644
--- a/partIntfHelpers.py
+++ b/partIntfHelpers.py
@@ -83,10 +83,25 @@ def sanityCheckMountPoint(mntpt):
     """Sanity check that the mountpoint is valid.
 
     mntpt is the mountpoint being used.
+
+    The Rules
+        Start with one /
+        Don't end with /
+        No spaces
+        No /../
+        No /./
+        No //
+        Don't end with /..
+        Don't end with /.
     """
     if not mntpt.startswith("/") or \
        (len(mntpt) > 1 and mntpt.endswith("/")) or \
-       " " in mntpt:
+       " " in mntpt or \
+       "/../" in mntpt or \
+       "/./" in mntpt or \
+       "//" in mntpt or \
+       mntpt.endswith("/..") or \
+       mntpt.endswith("/.") :
            return _("The mount point %s is invalid.  Mount points must start "
                     "with '/' and cannot end with '/', and must contain "
                     "printable characters and no spaces.") % mntpt
-- 
1.6.6.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux