diff options
author | Jeff Layton <jlayton@samba.org> | 2012-12-13 08:58:54 -0500 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2012-12-19 09:27:14 -0500 |
commit | d4f9df9159c5ac93b97c36b0f98ffbd318866e38 (patch) | |
tree | 68e480c67296af98aba217be5e13eb5e985d7cb9 | |
parent | b4dc50798e6baf026d6101ff3775ffc0c3a0e2f2 (diff) | |
download | cifs-utils-d4f9df9159c5ac93b97c36b0f98ffbd318866e38.tar.gz cifs-utils-d4f9df9159c5ac93b97c36b0f98ffbd318866e38.tar.bz2 cifs-utils-d4f9df9159c5ac93b97c36b0f98ffbd318866e38.zip |
cifs-utils: struct cifs_sid definition to new cifsidmap.h header
People who want to build a plugin for the idmapping routines will need a
header to describe the data types that they need. Add a cifsidmap.h file
and move the struct cifs_sid definition into it, along with the
constants needed to describe it.
Signed-off-by: Jeff Layton <jlayton@samba.org>
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | cifsacl.h | 12 | ||||
-rw-r--r-- | cifsidmap.h | 37 |
3 files changed, 40 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am index ff7a726..8964b37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,7 @@ mount_cifs_SOURCES = mount.cifs.c mtab.c resolve_host.c util.c mount_cifs_LDADD = $(LIBCAP) $(CAPNG_LDADD) $(RT_LDADD) man_MANS = mount.cifs.8 +include_HEADERS = cifsidmap.h bin_PROGRAMS = sbin_PROGRAMS = @@ -20,6 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "cifsidmap.h" + #ifndef _CIFSACL_H #define _CIFSACL_H @@ -96,9 +98,6 @@ #define COMPMASK 0x8 #define COMPALL (COMPSID|COMPTYPE|COMPFLAG|COMPMASK) -#define NUM_AUTHS (6) /* number of authority fields */ -#define SID_MAX_SUB_AUTHORITIES (15) /* max number of sub authority fields */ - /* * While not indicated here, the structs below represent on-the-wire data * structures. Any multi-byte values are expected to be little-endian! @@ -114,13 +113,6 @@ struct cifs_ntsd { uint32_t dacloffset; } __attribute__((packed)); -struct cifs_sid { - uint8_t revision; /* revision level */ - uint8_t num_subauth; - uint8_t authority[NUM_AUTHS]; - uint32_t sub_auth[SID_MAX_SUB_AUTHORITIES]; -} __attribute__((packed)); - struct cifs_ctrl_acl { uint16_t revision; /* revision level */ uint16_t size; diff --git a/cifsidmap.h b/cifsidmap.h new file mode 100644 index 0000000..9907618 --- /dev/null +++ b/cifsidmap.h @@ -0,0 +1,37 @@ +/* + * ID Mapping Plugin interface for cifs-utils + * Copyright (C) 2012 Jeff Layton (jlayton@samba.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include <stdint.h> + +#ifndef _CIFSIDMAP_H +#define _CIFSIDMAP_H + +#define NUM_AUTHS (6) /* number of authority fields */ +#define SID_MAX_SUB_AUTHORITIES (15) /* max number of sub authority fields */ + +/* + * Binary representation of a SID as presented to/from the kernel. Note that + * the sub_auth field is always stored in little-endian here. + */ +struct cifs_sid { + uint8_t revision; /* revision level */ + uint8_t num_subauth; + uint8_t authority[NUM_AUTHS]; + uint32_t sub_auth[SID_MAX_SUB_AUTHORITIES]; +} __attribute__((packed)); + +#endif /* _CIFSIDMAP_H */ |