Skip to content

Commit

Permalink
[CIFS] Add worker function for Get ACL cifs style
Browse files Browse the repository at this point in the history
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Steve French committed Jan 12, 2006
1 parent 94bc2be commit 0a4b92c
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 20 deletions.
4 changes: 3 additions & 1 deletion fs/cifs/CHANGES
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Version 1.40
------------
Use fsuid (fsgid) more consistently instead of uid (gid). Improve performance
of readpages by eliminating one extra memcpy.
of readpages by eliminating one extra memcpy. Allow update of file size
from remote server even if file is open for write as long as mount is
directio.

Version 1.39
------------
Expand Down
5 changes: 3 additions & 2 deletions fs/cifs/cifs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
#define CIFS_MOUNT_DIRECT_IO 8 /* do not write nor read through page cache */
#define CIFS_MOUNT_NO_XATTR 0x10 /* if set - disable xattr support */
#define CIFS_MOUNT_MAP_SPECIAL_CHR 0x20 /* remap illegal chars in filenames */
#define CIFS_MOUNT_POSIX_PATHS 0x40 /* Negotiate posix pathnames if possible. */
#define CIFS_MOUNT_UNX_EMUL 0x80 /* Network compat with SFUnix emulation */
#define CIFS_MOUNT_POSIX_PATHS 0x40 /* Negotiate posix pathnames if possible. */
#define CIFS_MOUNT_UNX_EMUL 0x80 /* Network compat with SFUnix emulation */
#define CIFS_MOUNT_NO_BRL 0x100 /* No sending byte range locks to srv */
#define CIFS_MOUNT_CIFS_ACL 0x200 /* send ACL requests to non-POSIX srv */

struct cifs_sb_info {
struct cifsTconInfo *tcon; /* primary mount */
Expand Down
2 changes: 2 additions & 0 deletions fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ struct cifsTconInfo {
atomic_t num_hardlinks;
atomic_t num_symlinks;
atomic_t num_locks;
atomic_t num_acl_get;
atomic_t num_acl_set;
#ifdef CONFIG_CIFS_STATS2
unsigned long long time_writes;
unsigned long long time_reads;
Expand Down
89 changes: 78 additions & 11 deletions fs/cifs/cifspdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ typedef union smb_com_session_setup_andx {
/* STRING PrimaryDomain */
/* STRING NativeOS */
/* STRING NativeLanMan */
} __attribute__((packed)) old_req; /* pre-NTLM (LANMAN2.1) request format */
} __attribute__((packed)) old_req; /* pre-NTLM (LANMAN2.1) req format */

struct { /* default (NTLM) response format */
struct smb_hdr hdr; /* wct = 3 */
Expand All @@ -540,7 +540,7 @@ typedef union smb_com_session_setup_andx {
unsigned char NativeOS[1]; /* followed by */
/* unsigned char * NativeLanMan; */
/* unsigned char * PrimaryDomain; */
} __attribute__((packed)) old_resp; /* pre-NTLM (LANMAN2.1) response format */
} __attribute__((packed)) old_resp; /* pre-NTLM (LANMAN2.1) response */
} __attribute__((packed)) SESSION_SETUP_ANDX;

#define CIFS_NETWORK_OPSYS "CIFS VFS Client for Linux"
Expand Down Expand Up @@ -1007,10 +1007,49 @@ typedef struct smb_com_setattr_rsp {

/* empty wct response to setattr */

/***************************************************/
/* NT Transact structure defintions follow */
/* Currently only ioctl and notify are implemented */
/***************************************************/
/*******************************************************/
/* NT Transact structure defintions follow */
/* Currently only ioctl, acl (get security descriptor) */
/* and notify are implemented */
/*******************************************************/
typedef struct smb_com_ntransact_req {
struct smb_hdr hdr; /* wct >= 19 */
__u8 MaxSetupCount;
__u16 Reserved;
__le32 TotalParameterCount;
__le32 TotalDataCount;
__le32 MaxParameterCount;
__le32 MaxDataCount;
__le32 ParameterCount;
__le32 ParameterOffset;
__le32 DataCount;
__le32 DataOffset;
__u8 SetupCount; /* four setup words follow subcommand */
/* SNIA spec incorrectly included spurious pad here */
__le16 SubCommand; /* 2 = IOCTL/FSCTL */
/* SetupCount words follow then */
__le16 ByteCount;
__u8 Pad[3];
__u8 Parms[0];
} __attribute__((packed)) NTRANSACT_REQ;

typedef struct smb_com_ntransact_rsp {
struct smb_hdr hdr; /* wct = 18 */
__u8 Reserved[3];
__le32 TotalParameterCount;
__le32 TotalDataCount;
__le32 ParameterCount;
__le32 ParameterOffset;
__le32 ParameterDisplacement;
__le32 DataCount;
__le32 DataOffset;
__le32 DataDisplacement;
__u8 SetupCount; /* 0 */
__u16 ByteCount;
/* __u8 Pad[3]; */
/* parms and data follow */
} __attribute__((packed)) NTRANSACT_RSP;

typedef struct smb_com_transaction_ioctl_req {
struct smb_hdr hdr; /* wct = 23 */
__u8 MaxSetupCount;
Expand All @@ -1025,11 +1064,11 @@ typedef struct smb_com_transaction_ioctl_req {
__le32 DataOffset;
__u8 SetupCount; /* four setup words follow subcommand */
/* SNIA spec incorrectly included spurious pad here */
__le16 SubCommand;/* 2 = IOCTL/FSCTL */
__le16 SubCommand; /* 2 = IOCTL/FSCTL */
__le32 FunctionCode;
__u16 Fid;
__u8 IsFsctl; /* 1 = File System Control, 0 = device control (IOCTL)*/
__u8 IsRootFlag; /* 1 = apply command to root of share (must be DFS share)*/
__u8 IsFsctl; /* 1 = File System Control 0 = device control (IOCTL) */
__u8 IsRootFlag; /* 1 = apply command to root of share (must be DFS) */
__le16 ByteCount;
__u8 Pad[3];
__u8 Data[1];
Expand All @@ -1049,9 +1088,35 @@ typedef struct smb_com_transaction_ioctl_rsp {
__u8 SetupCount; /* 1 */
__le16 ReturnedDataLen;
__u16 ByteCount;
__u8 Pad[3];
} __attribute__((packed)) TRANSACT_IOCTL_RSP;

#define CIFS_ACL_OWNER 1
#define CIFS_ACL_GROUP 2
#define CIFS_ACL_DACL 4
#define CIFS_ACL_SACL 8

typedef struct smb_com_transaction_qsec_req {
struct smb_hdr hdr; /* wct = 19 */
__u8 MaxSetupCount;
__u16 Reserved;
__le32 TotalParameterCount;
__le32 TotalDataCount;
__le32 MaxParameterCount;
__le32 MaxDataCount;
__le32 ParameterCount;
__le32 ParameterOffset;
__le32 DataCount;
__le32 DataOffset;
__u8 SetupCount; /* no setup words follow subcommand */
/* SNIA spec incorrectly included spurious pad here */
__le16 SubCommand; /* 6 = QUERY_SECURITY_DESC */
__le16 ByteCount; /* bcc = 3 + 8 */
__u8 Pad[3];
__u16 Fid;
__u16 Reserved2;
__le32 AclFlags;
} __attribute__((packed)) QUERY_SEC_DESC_REQ;

typedef struct smb_com_transaction_change_notify_req {
struct smb_hdr hdr; /* wct = 23 */
__u8 MaxSetupCount;
Expand All @@ -1072,10 +1137,12 @@ typedef struct smb_com_transaction_change_notify_req {
__u8 WatchTree; /* 1 = Monitor subdirectories */
__u8 Reserved2;
__le16 ByteCount;
/* __u8 Pad[3];*/
/* __u8 Pad[3];*/
/* __u8 Data[1];*/
} __attribute__((packed)) TRANSACT_CHANGE_NOTIFY_REQ;

/* BB eventually change to use generic ntransact rsp struct
and validation routine */
typedef struct smb_com_transaction_change_notify_rsp {
struct smb_hdr hdr; /* wct = 18 */
__u8 Reserved[3];
Expand Down
3 changes: 3 additions & 0 deletions fs/cifs/cifsproto.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ extern int CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon,
const char *fileName, const char * ea_name,
const void * ea_value, const __u16 ea_value_len,
const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon,
__u16 fid, char *acl_inf, const int buflen,
const int acl_type /* ACCESS vs. DEFAULT */);
extern int CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon,
const unsigned char *searchName,
char *acl_inf, const int buflen,const int acl_type,
Expand Down
Loading

0 comments on commit 0a4b92c

Please sign in to comment.