]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/directory.c
add dperm and fperm permissions default
[netatalk.git] / etc / afpd / directory.c
index 81fa9754e7376a163d09695374de570508804c0f..a108561e06ca26ffc38051ed44f6cbfe225df90a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.87 2008-09-01 15:18:36 didg Exp $
+ * $Id: directory.c,v 1.90 2009-01-30 04:57:42 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -439,9 +439,7 @@ static void dir_hash_del(const struct vol *vol, struct dir *dir)
 /* remove the node from the tree. this is just like insertion, but
  * different. actually, it has to worry about a bunch of things that
  * insertion doesn't care about. */
-static void dir_remove( vol, dir )
-struct vol     *vol;
-struct dir     *dir;
+static void dir_remove( const struct vol *vol _U_, struct dir  *dir)
 {
 #ifdef REMOVE_NODES
     struct ofork *of, *last;
@@ -1891,7 +1889,7 @@ int setdirparams(const struct vol *vol,
             ma.ma_world = *buf++;
             ma.ma_group = *buf++;
             ma.ma_owner = *buf++;
-            mpriv = mtoumode( &ma ) | vol->v_perm;
+            mpriv = mtoumode( &ma ) | vol->v_dperm;
             if (dir_rx_set(mpriv) && setdirmode( vol, upath, mpriv) < 0 ) {
                 err = set_dir_errors(path, "setdirmode", errno);
                 bitmap = 0;
@@ -1920,7 +1918,7 @@ int setdirparams(const struct vol *vol,
                 change_parent_mdate = 1;
                 memcpy( &upriv, buf, sizeof( upriv ));
                 buf += sizeof( upriv );
-                upriv = ntohl (upriv) | vol->v_perm;
+                upriv = ntohl (upriv) | vol->v_dperm;
                 if (dir_rx_set(upriv)) {
                     /* maybe we are trying to set perms back */
                     if ( setdirunixmode(vol, upath, upriv) < 0 ) {
@@ -2146,8 +2144,8 @@ setdirparam_done:
 
 
 int afp_syncdir(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj  *obj;
-char    *ibuf, *rbuf;
+AFPObj  *obj _U_;
+char    *ibuf, *rbuf _U_;
 int     ibuflen _U_, *rbuflen;
 {
     DIR                  *dp;
@@ -2187,7 +2185,8 @@ int     ibuflen _U_, *rbuflen;
     if ( fsync ( dfd ) < 0 ) {
         LOG(log_error, logtype_afpd, "syncdir(%s): ddir(%d) %s", dir->d_u_name, dfd, strerror(errno) );
     }
-   
+    closedir(dp);
+    
     return ( AFP_OK );
 }