[linux-cifs-client] [jra@samba.org: Making mknod work with the CIFS client.]

Jeremy Allison jra at samba.org
Mon Jul 12 22:46:00 GMT 2004


----- Forwarded message from Jeremy Allison <jra at samba.org> -----

X-Original-To: jra at samba.org
Delivered-To: jra at samba.org
Date: Mon, 12 Jul 2004 15:42:23 -0700
From: Jeremy Allison <jra at samba.org>
To: Steven French <sfrench at us.ibm.com>
Cc: jra at samba.org, jerry at samba.org, samba-technical at samba.org
Subject: Making mknod work with the CIFS client.
Reply-To: Jeremy Allison <jra at samba.org>
User-Agent: Mutt/1.4.1i

Hi Steve,

	I've just committed some changes to make the SMB_SET_FILE_UNIX_BASIC
call working correctly for mknod again - I'm hoping to persuade Jerry to get
this into 3.0.5 official (it's fairly benign).

The only problem is that your client code doesn't set the file type
in the mknod call. The cifs_mknod() function calls down to 
CIFSSMBUnixSetPerms() which then calls the SMB_SET_FILE_UNIX_BASIC,
but never sets the __u32 Type field in the FILE_UNIX_BASIC_INFO
struct on the stack.

It needs to be set from mode field by splitting out the 
S_IFIFO, S_IFSOCK, S_IFCHR, S_IFBLK bits from the mode
and mapping them to the Samba constants in the type field :

#define UNIX_TYPE_CHARDEV 3
#define UNIX_TYPE_BLKDEV 4
#define UNIX_TYPE_FIFO 5
#define UNIX_TYPE_SOCKET 6

In addition, I've noticed a couple of calls to CIFSSMBUnixSetPerms()
with uid/gid pairs of the current client values, not -1. I think
all calls to SMB_SET_FILE_UNIX_BASIC should have uid/gid as -1
unless it's a chown call, as the server, not the client, determines
the uid/gid pairs to set on a file.

Jeremy.

----- End forwarded message -----


More information about the linux-cifs-client mailing list