/*1* fs/cifs/cifsacl.h2*3* Copyright (c) International Business Machines Corp., 20074* Author(s): Steve French ([email protected])5*6* This library is free software; you can redistribute it and/or modify7* it under the terms of the GNU Lesser General Public License as published8* by the Free Software Foundation; either version 2.1 of the License, or9* (at your option) any later version.10*11* This library is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See14* the GNU Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public License17* along with this library; if not, write to the Free Software18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19*/2021#ifndef _CIFSACL_H22#define _CIFSACL_H232425#define NUM_AUTHS 6 /* number of authority fields */26#define NUM_SUBAUTHS 5 /* number of sub authority fields */27#define NUM_WK_SIDS 7 /* number of well known sids */28#define SIDNAMELENGTH 20 /* long enough for the ones we care about */29#define DEFSECDESCLEN 192 /* sec desc len contaiting a dacl with three aces */3031#define READ_BIT 0x432#define WRITE_BIT 0x233#define EXEC_BIT 0x13435#define UBITSHIFT 636#define GBITSHIFT 33738#define ACCESS_ALLOWED 039#define ACCESS_DENIED 14041#define SIDOWNER 142#define SIDGROUP 243#define SIDLEN 150 /* S- 1 revision- 6 authorities- max 5 sub authorities */4445#define SID_ID_MAPPED 046#define SID_ID_PENDING 147#define SID_MAP_EXPIRE (3600 * HZ) /* map entry expires after one hour */48#define SID_MAP_RETRY (300 * HZ) /* wait 5 minutes for next attempt to map */4950struct cifs_ntsd {51__le16 revision; /* revision level */52__le16 type;53__le32 osidoffset;54__le32 gsidoffset;55__le32 sacloffset;56__le32 dacloffset;57} __attribute__((packed));5859struct cifs_sid {60__u8 revision; /* revision level */61__u8 num_subauth;62__u8 authority[6];63__le32 sub_auth[5]; /* sub_auth[num_subauth] */64} __attribute__((packed));6566struct cifs_acl {67__le16 revision; /* revision level */68__le16 size;69__le32 num_aces;70} __attribute__((packed));7172struct cifs_ace {73__u8 type;74__u8 flags;75__le16 size;76__le32 access_req;77struct cifs_sid sid; /* ie UUID of user or group who gets these perms */78} __attribute__((packed));7980struct cifs_wksid {81struct cifs_sid cifssid;82char sidname[SIDNAMELENGTH];83} __attribute__((packed));8485struct cifs_sid_id {86unsigned int refcount; /* increment with spinlock, decrement without */87unsigned long id;88unsigned long time;89unsigned long state;90char *sidstr;91struct rb_node rbnode;92struct cifs_sid sid;93};9495#ifdef __KERNEL__96extern struct key_type cifs_idmap_key_type;97extern const struct cred *root_cred;98#endif /* KERNEL */99100extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *);101102#endif /* _CIFSACL_H */103104105