? src/.deps
? src/Makefile
? src/Makefile.in
? src/mount.davfs
? src/umount.davfs
Index: src/cache.c
===================================================================
RCS file: /sources/davfs2/davfs2/src/cache.c,v
retrieving revision 1.42
diff -u -r1.42 cache.c
--- src/cache.c	15 Aug 2013 17:22:25 -0000	1.42
+++ src/cache.c	8 Nov 2013 12:24:36 -0000
@@ -193,6 +193,9 @@
 static mode_t default_file_mode;
 static mode_t default_dir_mode;
 
+/* New files take the group id of the directory in which they are created? */
+static int grpid;
+
 /* Directory for cached files and directories. */
 static char *cache_dir;
 
@@ -590,6 +593,8 @@
     default_file_mode = args->file_mode;
     default_dir_mode = args->dir_mode;
 
+    grpid = args->grpid;
+
     table_size = args->table_size;
     table = xcalloc(table_size, sizeof(*table));
 
@@ -901,7 +906,7 @@
     (*nodep)->path = path;
     (*nodep)->name = xstrdup(name);
     (*nodep)->uid = uid;
-    (*nodep)->gid = pw->pw_gid;
+    (*nodep)->gid = grpid ? parent->gid : pw->pw_gid;
     int ret = create_cache_file(*nodep);
 
     if (!ret)
@@ -1026,7 +1031,7 @@
         (*nodep)->path = path;
         (*nodep)->name = xstrdup(name);
         (*nodep)->uid = uid;
-        (*nodep)->gid = pw->pw_gid;
+        (*nodep)->gid = grpid ? parent -> gid : pw->pw_gid;
         (*nodep)->smtime = (*nodep)->mtime;
         (*nodep)->utime = (*nodep)->mtime;
         delete_cache_file(parent);
Index: src/defaults.h
===================================================================
RCS file: /sources/davfs2/davfs2/src/defaults.h,v
retrieving revision 1.9
diff -u -r1.9 defaults.h
--- src/defaults.h	13 Aug 2013 19:48:26 -0000	1.9
+++ src/defaults.h	8 Nov 2013 12:24:36 -0000
@@ -103,6 +103,9 @@
    May be overridden by system config file and user config file. */
 #define DAV_FUSE_BUF_SIZE 32
 
+/* Whether to make new files automatically owned by the parent directory 
+   group. Defaults to no */
+#define DAV_GRPID 0
 
 /* File mode */
 /* ========= */
Index: src/mount_davfs.c
===================================================================
RCS file: /sources/davfs2/davfs2/src/mount_davfs.c,v
retrieving revision 1.63
diff -u -r1.63 mount_davfs.c
--- src/mount_davfs.c	13 Aug 2013 19:48:26 -0000	1.63
+++ src/mount_davfs.c	8 Nov 2013 12:24:37 -0000
@@ -1426,6 +1426,8 @@
         NOEXEC,
         DEV,
         NODEV,
+	GRPID,
+	NOGRPID,
         ASYNC,
         AUTO,
         NOAUTO,
@@ -1452,6 +1454,8 @@
         [NOEXEC] = "noexec",
         [DEV] = "dev",
         [NODEV] = "nodev",
+        [GRPID] = "grpid",
+        [NOGRPID] = "nogrpid",
         [ASYNC] = "async",
         [AUTO] = "auto",
         [NOAUTO] = "noauto",
@@ -1519,6 +1523,12 @@
         case DIR_MODE:
             args->dir_mode = arg_to_int(argument, 8, suboptions[so]);
             break;
+        case GRPID:
+            args->grpid = 1;
+            break;
+        case NOGRPID:
+            args->grpid = 0;
+            break;
         case USER:
             args->user = 1;
             break;
@@ -1588,6 +1598,7 @@
     args->netdev = DAV_NETDEV;
     args->mopts = DAV_MOPTS;
     args->buf_size = DAV_FUSE_BUF_SIZE;
+    args->grpid = DAV_GRPID;
 
     args->dir_mode = DAV_DIR_MODE;
     args->file_mode = DAV_FILE_MODE;
@@ -1649,6 +1660,8 @@
     syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
            "  buf_size: %llu KiB", (unsigned long long) args->buf_size);
     syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
+           "  grpid: %i", args->grpid);
+    syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
            "  fsuid: %i", args->fsuid);
     syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
            "  fsgid: %i", args->fsgid);
@@ -2472,6 +2485,7 @@
              "    conf=        : absolute path of user configuration file\n"
              "    uid=         : owner of the filesystem (username or numeric id)\n"
              "    gid=         : group of the filesystem (group name or numeric id)\n"
+	     "    [no]grpid    : (don't) make new files take the group id of the directory in which they are created\n"
              "    file_mode=   : default file mode (octal)\n"
              "    dir_mode=    : default directory mode (octal)\n"));
     printf(_("    ro           : mount read-only\n"
Index: src/mount_davfs.h
===================================================================
RCS file: /sources/davfs2/davfs2/src/mount_davfs.h,v
retrieving revision 1.18
diff -u -r1.18 mount_davfs.h
--- src/mount_davfs.h	12 Aug 2013 16:49:17 -0000	1.18
+++ src/mount_davfs.h	8 Nov 2013 12:24:37 -0000
@@ -53,6 +53,7 @@
     unsigned long int mopts;  /* Command line */
     char *add_mopts;
     size_t buf_size;          /* User config file, system config file */
+    int grpid;
     /* File mode */
     uid_t fsuid;              /* Command line */
     gid_t fsgid;              /* Command line */
