r13222: Never assume mode_t is of type int.
authorSimo Sorce <idra@samba.org>
Sun, 29 Jan 2006 18:22:39 +0000 (18:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:06:18 +0000 (11:06 -0500)
We were trashing the stack on machines that define mode_t as uint16_t
(This used to be commit 6c15af31bcee1e82578b61cae10423b37c285f10)

source3/modules/vfs_recycle.c

index 28593f4fbb72a5126e662bc6d26a6828cfe3a2df..188c50be3e54e93b205c3c5943f5474c00c7f47f 100644 (file)
@@ -166,13 +166,13 @@ static int recycle_maxsize(vfs_handle_struct *handle)
 
 static mode_t recycle_directory_mode(vfs_handle_struct *handle)
 {
-       mode_t dirmode;
+       int dirmode;
        const char *buff;
 
        buff = lp_parm_const_string(SNUM(handle->conn), "recycle", "directory_mode", NULL);
 
        if (buff != NULL ) {
-               sscanf(buff, "%o", (int *)&dirmode);
+               sscanf(buff, "%o", &dirmode);
        } else {
                dirmode=S_IRUSR | S_IWUSR | S_IXUSR;
        }