]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Now that only the Section names are case-insensitive
authorSteve Dickson <steved@redhat.com>
Fri, 7 Aug 2009 18:34:42 +0000 (14:34 -0400)
committerSteve Dickson <steved@redhat.com>
Sun, 16 Aug 2009 21:06:44 +0000 (17:06 -0400)
the mount code has to make sure the the mount options
given to the kernel are in the correct case.

Fixed a couple of warnings on #ifndefs

Signed-off-by: Steve Dickson <steved@redhat.com>
support/include/conffile.h
support/nfs/conffile.c
utils/mount/configfile.c

index b2635812aebe62530d0cab2074bc8773be245c8d..132a149069e5da08b211a8fd8d7c7cd2171abb67 100644 (file)
@@ -64,4 +64,14 @@ extern int      conf_remove(int, char *, char *);
 extern int      conf_remove_section(int, char *);
 extern void     conf_report(void);
 
+/*
+ * Convert letter from upper case to lower case
+ */
+static inline void upper2lower(char *str)
+{
+       char c;
+
+       while ((c = tolower(*str)))
+               *str++ = c;
+}
 #endif                         /* _CONFFILE_H_ */
index 97dc88a06df6762547336959238882ae2f809bc2..b19b73923f7ba8d89e268381ffa96cf4f831ca50 100644 (file)
@@ -119,18 +119,6 @@ conf_hash(char *s)
        return hash;
 }
 
-/*
- * Convert letter from upper case to lower case
- */
-static inline void upper2lower(char *str)
-{
-       char *ptr = str;
-
-       while (*ptr) 
-               *ptr++ = tolower(*ptr);
-}
-
-
 /*
  * Insert a tag-value combination from LINE (the equal sign is at POS)
  */
index cad8c52f7ef72e112e529ea5860558a95b7ecf8f..e347b0ebcaf3fed77f86b873c25a3e77b6bd5ec7 100644 (file)
 #define NFSMOUNT_GLOBAL_OPTS "NFSMount_Global_Options"
 #endif
 
-#ifndef NFSMOUNT_MOUNTPOINT  "MountPoint"
+#ifndef NFSMOUNT_MOUNTPOINT
 #define NFSMOUNT_MOUNTPOINT "MountPoint"
 #endif
 
-#ifndef NFSMOUNT_SERVER "Server"
+#ifndef NFSMOUNT_SERVER
 #define NFSMOUNT_SERVER "Server"
 #endif
 
@@ -83,6 +83,9 @@ char *mountopts_alias(char *opt, int *argtype)
                *argtype = mnt_alias_tab[i].argtype;
                return mnt_alias_tab[i].opt;
        }
+       /* Make option names case-insensitive */
+       upper2lower(opt);
+
        return opt;
 }
 /*
@@ -202,7 +205,7 @@ conf_parse_mntopts(char *section, char *arg, char *opts)
                 * Do not overwrite options if already exists 
                 */
                snprintf(buf, BUFSIZ, "%s=", node->field);
-               if (opts && strstr(opts, buf) != NULL)
+               if (opts && strcasestr(opts, buf) != NULL)
                        continue;
                if (lookup_entry(node->field) != NULL)
                        continue;