--- src/mount_davfs.c   2010-05-09 02:20:30 +0000                                                                                                           
+++ src/mount_davfs.c	2011-03-31 20:31:46 +0000
@@ -2174,18 +2174,33 @@
 
         } else if (applies && count == 2) {
 
-            if (system && strcmp(parmv[0], "dav_user") == 0) {
-                if (args->dav_user)
-                    free(args->dav_user);
-                args->dav_user = ne_strdup(parmv[1]); 
-            } else if (system && strcmp(parmv[0], "dav_group") == 0) {
-                if (args->dav_group)
-                    free(args->dav_group);
-                args->dav_group = ne_strdup(parmv[1]); 
-            } else if (system && strcmp(parmv[0], "ignore_home") == 0) {
-                if (args->ignore_home)
-                    free(args->ignore_home);
-                args->ignore_home = ne_strdup(parmv[1]); 
+            if (strcmp(parmv[0], "dav_user") == 0) {
+		if (system) {
+	                if (args->dav_user)
+        	            free(args->dav_user);
+	                args->dav_user = ne_strdup(parmv[1]);
+		} else {
+			error_at_line(0, 0, filename, lineno,
+                              _("system option in user configuration file"));
+		}		
+            } else if (strcmp(parmv[0], "dav_group") == 0) {
+		if (system) {
+	                if (args->dav_group)
+        	            free(args->dav_group);
+	                args->dav_group = ne_strdup(parmv[1]);
+		} else {
+			error_at_line(0, 0, filename, lineno,
+                              _("system option in user configuration file"));
+		}
+            } else if (strcmp(parmv[0], "ignore_home") == 0) {
+		if (system) {
+	                if (args->ignore_home)
+	                    free(args->ignore_home);
+			args->ignore_home = ne_strdup(parmv[1]); 
+		} else {
+			error_at_line(0, 0, filename, lineno,
+                              _("system option in user configuration file"));
+		}
             } else if (strcmp(parmv[0], "kernel_fs") == 0) {
                 if (args->kernel_fs)
                     free(args->kernel_fs);
@@ -2196,21 +2211,36 @@
                 if (args->servercert)
                     free(args->servercert);
                 args->servercert = ne_strdup(parmv[1]);
-            } else if (!system && strcmp(parmv[0], "secrets") == 0) {
-                if (args->secrets)
-                    free(args->secrets);
-                args->secrets = ne_strdup(parmv[1]); 
+            } else if (strcmp(parmv[0], "secrets") == 0) {
+		if (system) {
+			error_at_line(0, 0, filename, lineno,
+                              _("user option in system configuration file"));
+		} else {
+        	        if (args->secrets)
+        	            free(args->secrets);
+	                args->secrets = ne_strdup(parmv[1]); 
+		}
             } else if (strcmp(parmv[0], "clientcert") == 0) {
                 if (args->clicert)
                     free(args->clicert);
                 args->clicert = ne_strdup(parmv[1]);
-            } else if (system && strcmp(parmv[0], "proxy") == 0) {
-                if (split_uri(NULL, &args->p_host, &args->p_port, NULL,
-                              parmv[1]) != 0)
-                    error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                                  _("malformed line"));
-            } else if (system && strcmp(parmv[0], "use_proxy") == 0) {
-                args->useproxy = arg_to_int(parmv[1], 10, parmv[0]);
+            } else if (strcmp(parmv[0], "proxy") == 0) {
+		if (system) {
+                	if (split_uri(NULL, &args->p_host, &args->p_port, NULL,
+	                              parmv[1]) != 0)
+	                    error_at_line(EXIT_FAILURE, 0, filename, lineno,
+        	                          _("malformed line"));
+		} else {
+			error_at_line(0, 0, filename, lineno,
+                              _("system option in user configuration file"));
+		}
+            } else if (strcmp(parmv[0], "use_proxy") == 0) {
+		if (system) {
+                	args->useproxy = arg_to_int(parmv[1], 10, parmv[0]);
+		} else {
+			error_at_line(0, 0, filename, lineno,
+                              _("system option in non-system config"));
+		}
             } else if (strcmp(parmv[0], "ask_auth") == 0) {
                 args->askauth = arg_to_int(parmv[1], 10, parmv[0]);
             } else if (strcmp(parmv[0], "use_locks") == 0) {
@@ -2249,14 +2279,24 @@
                 if (args->s_charset)
                     free(args->s_charset);
                 args->s_charset = ne_strdup(parmv[1]);
-            } else if (system && strcmp(parmv[0], "cache_dir") == 0) {
-                if (args->sys_cache)
-                    free(args->sys_cache);
-                args->sys_cache = ne_strdup(parmv[1]); 
-            } else if (!system && strcmp(parmv[0], "cache_dir") == 0) {
-                if (args->cache_dir != NULL)
-                    free(args->cache_dir);
-                args->cache_dir = ne_strdup(parmv[1]); 
+            } else if (strcmp(parmv[0], "cache_dir") == 0) {
+		if (system) {
+                	if (args->sys_cache)
+	                    free(args->sys_cache);
+	                args->sys_cache = ne_strdup(parmv[1]); 
+		} else {
+			error_at_line(0, 0, filename, lineno,
+                              _("system option in user configuration file"));
+		}
+            } else if (strcmp(parmv[0], "cache_dir") == 0) {
+		if (system) {
+	                if (args->cache_dir != NULL)
+	                    free(args->cache_dir);
+	                args->cache_dir = ne_strdup(parmv[1]); 
+		} else {
+			error_at_line(0, 0, filename, lineno,
+                              _("user option in system configuration file"));
+		}
             } else if (strcmp(parmv[0], "backup_dir") == 0) {
                 if (args->backup_dir)
                     free(args->backup_dir);

