From fdeea341ed1bae670382e45eb731db1b5838ad21 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Mar 1998 21:11:04 +0000 Subject: "For I have laboured mightily on Luke's code, and hath broken all I saw" - the book of Jeremy, chapter 1 :-). So here is the mega-merge of the NTDOM branch server code. It doesn't include the new client side pieces, we'll look at that later. This should give the same functionality, server wise, as the NTDOM branch does, only merged into the main branch. Any fixes to domain controler functionality should be added to the main branch, not the NTDOM branch. This code compiles without warnings on gcc2.8, but will need further testing before we are sure all the working functionality of the NTDOM server branch has been correctly carried over. I hereby declare the server side of the NTDOM branch dead (and all who sail in her :-). Jeremy. (This used to be commit 118ba4d77a33248e762a2cf843fb7cbc906ee6e7) --- source3/include/rpc_misc.h | 272 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 source3/include/rpc_misc.h (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h new file mode 100644 index 0000000000..5d4e385875 --- /dev/null +++ b/source3/include/rpc_misc.h @@ -0,0 +1,272 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + 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 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_MISC_H /* _RPC_MISC_H */ +#define _RPC_MISC_H + + +#include "rpc_dce.h" + +/* pipe string names */ +#define PIPE_SRVSVC "\\PIPE\\srvsvc" +#define PIPE_SAMR "\\PIPE\\samr" +#define PIPE_WINREG "\\PIPE\\winreg" +#define PIPE_WKSSVC "\\PIPE\\wkssvc" +#define PIPE_NETLOGON "\\PIPE\\NETLOGON" +#define PIPE_NTLSA "\\PIPE\\ntlsa" +#define PIPE_NTSVCS "\\PIPE\\ntsvcs" +#define PIPE_LSASS "\\PIPE\\lsass" +#define PIPE_LSARPC "\\PIPE\\lsarpc" + +/* well-known RIDs - Relative IDs */ + +/* RIDs - Well-known users ... */ +#define DOMAIN_USER_RID_ADMIN (0x000001F4L) +#define DOMAIN_USER_RID_GUEST (0x000001F5L) + +/* RIDs - well-known groups ... */ +#define DOMAIN_GROUP_RID_ADMINS (0x00000200L) +#define DOMAIN_GROUP_RID_USERS (0x00000201L) +#define DOMAIN_GROUP_RID_GUESTS (0x00000202L) + +/* RIDs - well-known aliases ... */ +#define DOMAIN_ALIAS_RID_ADMINS (0x00000220L) +#define DOMAIN_ALIAS_RID_USERS (0x00000221L) +#define DOMAIN_ALIAS_RID_GUESTS (0x00000222L) +#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L) + +#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) +#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) +#define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L) +#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L) + +#define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) + +/* ENUM_HND */ +typedef struct enum_hnd_info +{ + uint32 ptr_hnd; /* pointer to enumeration handle */ + uint32 handle; /* enumeration handle */ + +} ENUM_HND; + +/* LOOKUP_LEVEL - switch value */ +typedef struct lookup_level_info +{ + uint16 value; + +} LOOKUP_LEVEL; + +#define MAXSUBAUTHS 15 /* max sub authorities in a SID */ + +/* DOM_SID - security id */ +typedef struct sid_info +{ + uint8 sid_rev_num; /* SID revision number */ + uint8 num_auths; /* number of sub-authorities */ + uint8 id_auth[6]; /* Identifier Authority */ + uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ + +} DOM_SID; + +/* DOM_SID2 - security id */ +typedef struct sid_info_2 +{ + uint32 num_auths; /* length, bytes, including length of len :-) */ + + DOM_SID sid; + +} DOM_SID2; + +/* STRHDR - string header */ +typedef struct header_info +{ + uint16 str_max_len; + uint16 str_str_len; + uint32 buffer; /* non-zero */ + +} STRHDR; + +/* UNIHDR - unicode string header */ +typedef struct unihdr_info +{ + uint16 uni_max_len; + uint16 uni_str_len; + uint32 buffer; /* usually has a value of 4 */ + +} UNIHDR; + +/* UNIHDR2 - unicode string header and undocumented buffer */ +typedef struct unihdr2_info +{ + UNIHDR unihdr; + uint32 buffer; /* 32 bit buffer pointer */ + +} UNIHDR2; + +/* clueless as to what maximum length should be */ +#define MAX_UNISTRLEN 256 +#define MAX_STRINGLEN 256 + +/* UNISTR - unicode string size and buffer */ +typedef struct unistr_info +{ + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */ + +} UNISTR; + +/* UNINOTSTR2 - unicode string, size (in uint8 ascii chars) and buffer */ +/* pathetic. some stupid team of \PIPE\winreg writers got the concept */ +/* of a unicode string different from the other \PIPE\ writers */ +typedef struct uninotstr2_info +{ + uint32 uni_max_len; + uint32 undoc; + uint32 uni_buf_len; + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ + +} UNINOTSTR2; + +/* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ +typedef struct unistr2_info +{ + uint32 uni_max_len; + uint32 undoc; + uint32 uni_str_len; + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ + +} UNISTR2; + +/* STRING2 - string size (in uint8 chars) and buffer */ +typedef struct string2_info +{ + uint32 str_max_len; + uint32 undoc; + uint32 str_str_len; + uint8 buffer[MAX_STRINGLEN]; /* uint8 characters. **NOT** necessarily null-terminated */ + +} STRING2; + + +/* DOM_RID2 - domain RID structure for ntlsa pipe */ +typedef struct domrid2_info +{ + uint32 type; /* value is 5 */ + uint32 undoc; /* value is non-zero */ + uint32 rid; + uint32 rid_idx; /* don't know what this is */ + +} DOM_RID2; + +/* DOM_RID3 - domain RID structure for samr pipe */ +typedef struct domrid3_info +{ + uint32 rid; /* domain-relative (to a SID) id */ + uint32 type1; /* value is 0x1 */ + uint32 ptr_type; /* undocumented pointer */ + uint32 type2; /* value is 0x1 */ + +} DOM_RID3; + +/* DOM_RID4 - rid + user attributes */ +typedef struct domrid4_info +{ + uint32 unknown; + uint16 attr; + uint32 rid; /* user RID */ + +} DOM_RID4; + +/* DOM_CLNT_SRV - client / server names */ +typedef struct clnt_srv_info +{ + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_comp_name; /* client machine name */ + +} DOM_CLNT_SRV; + +/* DOM_LOG_INFO - login info */ +typedef struct log_info +{ + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + UNISTR2 uni_acct_name; /* account name */ + uint16 sec_chan; /* secure channel type */ + UNISTR2 uni_comp_name; /* client machine name */ + +} DOM_LOG_INFO; + +/* DOM_CLNT_INFO - client info */ +typedef struct clnt_info +{ + DOM_LOG_INFO login; + DOM_CRED cred; + +} DOM_CLNT_INFO; + +/* DOM_CLNT_INFO2 - client info */ +typedef struct clnt_info2 +{ + DOM_CLNT_SRV login; + uint32 ptr_cred; + DOM_CRED cred; + +} DOM_CLNT_INFO2; + +/* DOM_LOGON_ID - logon id */ +typedef struct logon_info +{ + uint32 low; + uint32 high; + +} DOM_LOGON_ID; + +/* ARC4_OWF */ +typedef struct arc4_owf_info +{ + uint8 data[16]; + +} ARC4_OWF; + + +/* DOM_GID - group id + user attributes */ +typedef struct gid_info +{ + uint32 g_rid; /* a group RID */ + uint32 attr; + +} DOM_GID; + +#define POL_HND_SIZE 20 + +/* POLICY_HND */ +typedef struct lsa_policy_info +{ + uint8 data[POL_HND_SIZE]; /* policy handle */ + +} POLICY_HND; + +#endif /* _RPC_MISC_H */ + -- cgit From 5d7c8375e4ffb017ef0f9eed7e619e533b3e8d12 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 24 Mar 1998 00:37:53 +0000 Subject: clientgen.c ipc.c smbpasswd.c: Fixes for warnings (from Herb). quotas.c: Linux quota fix. util.c: Ensure smb_read_error is zero in all calls that can set it. lib/rpc/include/rpc_misc.h lib/rpc/include/rpc_netlogon.h lib/rpc/parse/parse_misc.c lib/rpc/parse/parse_net.c lib/rpc/server/srv_netlog.c : Modify Luke's code to call SamOEMhash(). Jeremy. (This used to be commit 7f749708383b8b36c3f23a5fbc5cbdf39bc8e555) --- source3/include/rpc_misc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 5d4e385875..c6e0d8d5ee 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -243,12 +243,12 @@ typedef struct logon_info } DOM_LOGON_ID; -/* ARC4_OWF */ -typedef struct arc4_owf_info +/* OWF INFO */ +typedef struct owf_info { uint8 data[16]; -} ARC4_OWF; +} OWF_INFO; /* DOM_GID - group id + user attributes */ -- cgit From a4276507e43487f47445eab11d4ac1b080b3270e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 May 1998 01:30:40 +0000 Subject: chgpasswd.c: Added comments to #ifdefs ipc.c: Caused samba password changing not to be done if UNIX password changing requested and not successful. util.c: Added string_to_sid() and sid_to_string() functions. lib/rpc/client/cli_samr.c: lib/rpc/include/rpc_misc.h: lib/rpc/parse/parse_lsa.c: lib/rpc/parse/parse_misc.c: lib/rpc/parse/parse_net.c: lib/rpc/parse/parse_samr.c: lib/rpc/server/srv_lsa.c: lib/rpc/server/srv_lsa_hnd.c: lib/rpc/server/srv_netlog.c: lib/rpc/server/srv_samr.c: lib/rpc/server/srv_util.c: Changes so that instead of passing SIDs around as char *, they are converted to DOM_SID at the earliest opportunity, and passed around as that. Also added dynamic memory allocation of group sids. Preparing to auto-generate machine sid. Jeremy. (This used to be commit 134d6fa79c1b6b9505a2c84ba9bfb91dd3be76e5) --- source3/include/rpc_misc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index c6e0d8d5ee..7406916cce 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -85,6 +85,10 @@ typedef struct sid_info uint8 sid_rev_num; /* SID revision number */ uint8 num_auths; /* number of sub-authorities */ uint8 id_auth[6]; /* Identifier Authority */ + /* + * Note that the values in these uint32's are in *native* byteorder, + * not neccessarily little-endian...... JRA. + */ uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ } DOM_SID; -- cgit From ffe91d6443f2a3e19977ed97167dd100a42a3e9a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 1 Jun 1998 18:50:27 +0000 Subject: clientutil.c: Don't core dump if no controlling terminal available for password. passdb.c: lib/rpc/include/rpc_misc.h: First cut at automatic uid/gid to rid mapping. We can change this at a later date to make more bits available if neccessary. Jeremy. (This used to be commit 34f40474aba97118e1e80fe6259c686e46dc16b4) --- source3/include/rpc_misc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 7406916cce..e8ffcd4a16 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -62,6 +62,19 @@ #define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) +/* + * Masks for mappings between unix uid and gid types and + * NT RIDS. + */ + +/* Take the 3 bottom bits. */ +#define RID_TYPE_MASK 7 +#define RID_MULTIPLIER 8 + +/* The two common types for now. */ +#define USER_RID_TYPE 0 +#define GROUP_RID_TYPE 1 + /* ENUM_HND */ typedef struct enum_hnd_info { -- cgit From e85295d9241bcdad3723898ab8ad88d8f11d5f28 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Jun 1998 02:26:26 +0000 Subject: loadparm.c: Removed 'domain other sids' parameter. lib/rpc/include/rpc_lsa.h: Changed #defines for RPC calls - moved some, made LSA_LOOKUPNAMES correct. lib/rpc/include/rpc_misc.h: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. Changed bitmasks for uid to rid to be 1 bit. lib/rpc/parse/parse_misc.c: Changed make_unistr2 to put length as given, max length as one more. lib/rpc/server/srv_netlog.c: Removed 'domain other sids' parameter. lib/rpc/server/srv_samr.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. lib/rpc/server/srv_util.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. Jeremy. (This used to be commit 34c91840a3d8c252715dc2f749b7a3b171a5b74f) --- source3/include/rpc_misc.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e8ffcd4a16..3e1a6052b5 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -50,28 +50,28 @@ #define DOMAIN_GROUP_RID_GUESTS (0x00000202L) /* RIDs - well-known aliases ... */ -#define DOMAIN_ALIAS_RID_ADMINS (0x00000220L) -#define DOMAIN_ALIAS_RID_USERS (0x00000221L) -#define DOMAIN_ALIAS_RID_GUESTS (0x00000222L) -#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L) +#define BUILTIN_ALIAS_RID_ADMINS (0x00000220L) +#define BUILTIN_ALIAS_RID_USERS (0x00000221L) +#define BUILTIN_ALIAS_RID_GUESTS (0x00000222L) +#define BUILTIN_ALIAS_RID_POWER_USERS (0x00000223L) -#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) -#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) -#define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L) -#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L) +#define BUILTIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) +#define BUILTIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) +#define BUILTIN_ALIAS_RID_PRINT_OPS (0x00000226L) +#define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L) -#define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) +#define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L) /* * Masks for mappings between unix uid and gid types and * NT RIDS. */ -/* Take the 3 bottom bits. */ -#define RID_TYPE_MASK 7 -#define RID_MULTIPLIER 8 +/* Take the bottom bit. */ +#define RID_TYPE_MASK 1 +#define RID_MULTIPLIER 2 -/* The two common types for now. */ +/* The two common types. */ #define USER_RID_TYPE 0 #define GROUP_RID_TYPE 1 -- cgit From f1cd3cb54c6495db2a91c473f91c78d24622d98e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Jul 1998 00:06:29 +0000 Subject: Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com. ipc.c: loadparm.c: printing.c: Added code from to implement print queue pausing. New parameters are "queuepause command" and "queueresume command". util.c: Added fix for mount options in autmount map. lib/rpc/include/rpc_misc.h: Removed duplicate pipe names for Jean-Francois. Jeremy. (This used to be commit 559a9bf2bbdeae3e76ba9178779cd3a9537c4e91) --- source3/include/rpc_misc.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 3e1a6052b5..c03471ebfc 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -27,17 +27,6 @@ #include "rpc_dce.h" -/* pipe string names */ -#define PIPE_SRVSVC "\\PIPE\\srvsvc" -#define PIPE_SAMR "\\PIPE\\samr" -#define PIPE_WINREG "\\PIPE\\winreg" -#define PIPE_WKSSVC "\\PIPE\\wkssvc" -#define PIPE_NETLOGON "\\PIPE\\NETLOGON" -#define PIPE_NTLSA "\\PIPE\\ntlsa" -#define PIPE_NTSVCS "\\PIPE\\ntsvcs" -#define PIPE_LSASS "\\PIPE\\lsass" -#define PIPE_LSARPC "\\PIPE\\lsarpc" - /* well-known RIDs - Relative IDs */ /* RIDs - Well-known users ... */ -- cgit From 3acae62a876beab12390d24212be386876e73831 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 23 Oct 1998 21:45:16 +0000 Subject: added domain and local group structures. names may have to be 256 chars long not 128 (fstring) length. (This used to be commit 1e96e14e790e733bbd182a828b0db8727fead2a2) --- source3/include/rpc_misc.h | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index c03471ebfc..50daf27dfc 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -79,22 +79,6 @@ typedef struct lookup_level_info } LOOKUP_LEVEL; -#define MAXSUBAUTHS 15 /* max sub authorities in a SID */ - -/* DOM_SID - security id */ -typedef struct sid_info -{ - uint8 sid_rev_num; /* SID revision number */ - uint8 num_auths; /* number of sub-authorities */ - uint8 id_auth[6]; /* Identifier Authority */ - /* - * Note that the values in these uint32's are in *native* byteorder, - * not neccessarily little-endian...... JRA. - */ - uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ - -} DOM_SID; - /* DOM_SID2 - security id */ typedef struct sid_info_2 { -- cgit From 1e1c2ec93c204e6fd3ebba6dfb11e4fbc136e10c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 10 Nov 1998 19:05:00 +0000 Subject: rpcclient registry commands. (This used to be commit 36fcb4a6e643a05d06a2a273d74318fee7f2c647) --- source3/include/rpc_misc.h | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 50daf27dfc..e984a4842b 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -91,8 +91,8 @@ typedef struct sid_info_2 /* STRHDR - string header */ typedef struct header_info { - uint16 str_max_len; uint16 str_str_len; + uint16 str_max_len; uint32 buffer; /* non-zero */ } STRHDR; @@ -100,8 +100,8 @@ typedef struct header_info /* UNIHDR - unicode string header */ typedef struct unihdr_info { - uint16 uni_max_len; uint16 uni_str_len; + uint16 uni_max_len; uint32 buffer; /* usually has a value of 4 */ } UNIHDR; @@ -117,6 +117,7 @@ typedef struct unihdr2_info /* clueless as to what maximum length should be */ #define MAX_UNISTRLEN 256 #define MAX_STRINGLEN 256 +#define MAX_BUFFERLEN 512 /* UNISTR - unicode string size and buffer */ typedef struct unistr_info @@ -125,17 +126,34 @@ typedef struct unistr_info } UNISTR; -/* UNINOTSTR2 - unicode string, size (in uint8 ascii chars) and buffer */ +/* BUFHDR - buffer header */ +typedef struct bufhdr_info +{ + uint32 buf_max_len; + uint32 buf_len; + +} BUFHDR; + +/* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */ /* pathetic. some stupid team of \PIPE\winreg writers got the concept */ /* of a unicode string different from the other \PIPE\ writers */ -typedef struct uninotstr2_info +typedef struct buffer2_info { - uint32 uni_max_len; + uint32 buf_max_len; uint32 undoc; - uint32 uni_buf_len; + uint32 buf_len; uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ -} UNINOTSTR2; +} BUFFER2; + +/* BUFFER3 */ +typedef struct buffer3_info +{ + uint32 buf_max_len; + uint8 buffer[MAX_BUFFERLEN]; /* data */ + uint32 buf_len; + +} BUFFER3; /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ typedef struct unistr2_info @@ -157,6 +175,14 @@ typedef struct string2_info } STRING2; +/* UNISTR3 - XXXX not sure about this structure */ +typedef struct unistr3_info +{ + uint32 uni_str_len; + UNISTR str; + +} UNISTR3; + /* DOM_RID2 - domain RID structure for ntlsa pipe */ typedef struct domrid2_info -- cgit From 74d539f5573a3ed3ff1b96c54752a389da4c3e14 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 17 Nov 1998 16:19:04 +0000 Subject: - group database API. oops and oh dear, the threat has been carried out: the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION. (This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db) --- source3/include/rpc_misc.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e984a4842b..aa1f100dfb 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -56,13 +56,14 @@ * NT RIDS. */ -/* Take the bottom bit. */ -#define RID_TYPE_MASK 1 -#define RID_MULTIPLIER 2 - -/* The two common types. */ -#define USER_RID_TYPE 0 -#define GROUP_RID_TYPE 1 +/* Take the bottom bits. */ +#define RID_TYPE_MASK 2 +#define RID_MULTIPLIER 4 + +/* The three common types. */ +#define RID_TYPE_USER 0 +#define RID_TYPE_GROUP 1 +#define RID_TYPE_ALIAS 2 /* ENUM_HND */ typedef struct enum_hnd_info -- cgit From 59d4087160ba41aac724722dc29c4b6e4e3b69b0 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 25 Nov 1998 19:57:04 +0000 Subject: LsaLookupNames client call (first used as lookupnames command in rpcclient). (This used to be commit 68342a29a892e515cf2b22d759476d61944bcd59) --- source3/include/rpc_misc.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index aa1f100dfb..786aad32d2 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -188,29 +188,28 @@ typedef struct unistr3_info /* DOM_RID2 - domain RID structure for ntlsa pipe */ typedef struct domrid2_info { - uint32 type; /* value is 5 */ - uint32 undoc; /* value is non-zero */ - uint32 rid; - uint32 rid_idx; /* don't know what this is */ + uint8 type; /* value is SID_NAME_USE enum */ + uint32 rid; + uint32 rid_idx; /* referenced domain index */ } DOM_RID2; /* DOM_RID3 - domain RID structure for samr pipe */ typedef struct domrid3_info { - uint32 rid; /* domain-relative (to a SID) id */ - uint32 type1; /* value is 0x1 */ - uint32 ptr_type; /* undocumented pointer */ - uint32 type2; /* value is 0x1 */ + uint32 rid; /* domain-relative (to a SID) id */ + uint32 type1; /* value is 0x1 */ + uint32 ptr_type; /* undocumented pointer */ + uint32 type2; /* value is 0x1 */ } DOM_RID3; /* DOM_RID4 - rid + user attributes */ typedef struct domrid4_info { - uint32 unknown; - uint16 attr; - uint32 rid; /* user RID */ + uint32 unknown; + uint16 attr; + uint32 rid; /* user RID */ } DOM_RID4; -- cgit From 30038de4623bc827ee8019c569faf00583d1fe58 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 29 Nov 1998 20:03:33 +0000 Subject: weekend work. user / group database API. - split sam_passwd and smb_passwd into separate higher-order function tables - renamed struct smb_passwd's "smb_user" to "unix_user". added "nt_user" plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd password databases to fill in the blank entries that are not obtained from whatever password database API instance is being used. NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c for the only example outside of the password database APIs i could find. - added query_useraliases code to rpcclient. - dealt with some nasty interdependencies involving non-smbd programs and the password database API. this is still not satisfactorily resolved completelely, but it's the best i can do for now. - #ifdef'd out some password database options so that people don't mistakenly set them unless they recompile to _use_ those options. lots of debugging done, it's still not finished. the unix/NT uid/gid and user-rid/group-rid issues are better, but not perfect. the "BUILTIN" domain is still missing: users cannot be added to "BUILTIN" groups yet, as we only have an "alias" db API and a "group" db API but not "builtin-alias" db API... (This used to be commit 5d5d7e4de7d1514ab87b07ede629de8aa00519a1) --- source3/include/rpc_misc.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 786aad32d2..e41c61f882 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -43,12 +43,10 @@ #define BUILTIN_ALIAS_RID_USERS (0x00000221L) #define BUILTIN_ALIAS_RID_GUESTS (0x00000222L) #define BUILTIN_ALIAS_RID_POWER_USERS (0x00000223L) - #define BUILTIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) #define BUILTIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) #define BUILTIN_ALIAS_RID_PRINT_OPS (0x00000226L) #define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L) - #define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L) /* @@ -61,9 +59,9 @@ #define RID_MULTIPLIER 4 /* The three common types. */ -#define RID_TYPE_USER 0 -#define RID_TYPE_GROUP 1 -#define RID_TYPE_ALIAS 2 +#define RID_TYPE_USER 0 +#define RID_TYPE_GROUP 1 +#define RID_TYPE_ALIAS 2 /* ENUM_HND */ typedef struct enum_hnd_info @@ -213,6 +211,17 @@ typedef struct domrid4_info } DOM_RID4; +/* DOM_RID5 - rid, type & attributes */ +typedef struct domrid5_info +{ + uint32 ptr_unk; /* pointer to unk */ + uint32 unk; /* value is 0x1 */ + uint32 rid; /* RID */ + uint8 type; /* SID_NAME_USE_ENUM */ + uint16 attr; + +} DOM_RID5; + /* DOM_CLNT_SRV - client / server names */ typedef struct clnt_srv_info { -- cgit From 51534a4b97f09fc0f98d00e7a2730dddde496dd8 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 2 Dec 1998 01:13:02 +0000 Subject: adding group member code, made a start. found that the group members' rid is needed not the name (see DOMAIN_GRP_MEMBER) decided to go home. (This used to be commit 9337049dfc98becfa74522d418dae64a97c7a304) --- source3/include/rpc_misc.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e41c61f882..ff0d2cc49d 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -199,6 +199,7 @@ typedef struct domrid3_info uint32 type1; /* value is 0x1 */ uint32 ptr_type; /* undocumented pointer */ uint32 type2; /* value is 0x1 */ + uint32 unk; /* value is 0x2 */ } DOM_RID3; @@ -211,17 +212,6 @@ typedef struct domrid4_info } DOM_RID4; -/* DOM_RID5 - rid, type & attributes */ -typedef struct domrid5_info -{ - uint32 ptr_unk; /* pointer to unk */ - uint32 unk; /* value is 0x1 */ - uint32 rid; /* RID */ - uint8 type; /* SID_NAME_USE_ENUM */ - uint16 attr; - -} DOM_RID5; - /* DOM_CLNT_SRV - client / server names */ typedef struct clnt_srv_info { -- cgit From e8ac69c16877dd827719134dbce49f4aa3608c9d Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Thu, 18 Mar 1999 05:16:59 +0000 Subject: Adding LSA_OPENSECRET (-> LsarOpenSecret) and LSA_QUERYSECRET (-> LsarQuerySecret) on client side, including rpcclient command "querysecret" for others to play with. The major obstacle is working out the encryption algorithm used for the secret value. It definitely uses the NT hash as part of the key, and it seems the block size is 64 bits - probably DES based - but I can't work out what's done in between. Help required. (This used to be commit 365fa3b5fbf551670acc91f593138a7e91a5f7fa) --- source3/include/rpc_misc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index ff0d2cc49d..1c5689dd87 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -96,6 +96,15 @@ typedef struct header_info } STRHDR; +/* STRHDR2 - string header, 32-bit lengths */ +typedef struct header2_info +{ + uint32 str_str_len; + uint32 str_max_len; + uint32 buffer; + +} STRHDR2; + /* UNIHDR - unicode string header */ typedef struct unihdr_info { -- cgit From 43a460075a39148060d4193fcb9c62bfa4acc737 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 25 Mar 1999 13:54:31 +0000 Subject: SAM database "set user info". ---------------------------- - removed DOM_RID4 - removed SAMR_UNKNOWN_32 - added SAMR_SET_USERINFO (opcode 0x32) - added level 0x1 to SAMR_QUERY_DOM_INFO (needed for create user) - fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - added mod_sam21pwd_entry() - preparing to call mod_sam21pwd_entry() - added "user session key" to user_struct.dc. this is md4(nt#) and is needed to decode user's clear-text passwords in SAMR_SET_USERINFO. - split code out in chgpasswd.c to decode 516 byte password buffers. (This used to be commit 2e58ed742435befe419aa366c4052019fede8c23) --- source3/include/rpc_misc.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 1c5689dd87..3e4d52a038 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -212,15 +212,6 @@ typedef struct domrid3_info } DOM_RID3; -/* DOM_RID4 - rid + user attributes */ -typedef struct domrid4_info -{ - uint32 unknown; - uint16 attr; - uint32 rid; /* user RID */ - -} DOM_RID4; - /* DOM_CLNT_SRV - client / server names */ typedef struct clnt_srv_info { -- cgit From 53f0cd990c3d26e73b42266be35516d6db9621e0 Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Thu, 8 Apr 1999 05:35:53 +0000 Subject: Mainly BDC-related changes. * Added SEC_CHAN_BDC * Fix for endianness problem reported by Edan Idzerda . A BUFFER2 is really a "unibuf" in my terminology and we should treat it as such. * Added some more common NT structures (BIGINT, BUFHDR2, BUFFER4). * Added NET_SAM_SYNC (-> NetDatabaseSync2) RPC for account replication. Still experimental and incomplete, with a few too many NULL security descriptors lying around (must go look at Jeremy's SD code). Haven't worked out password encryption yet either. However, the XXX_INFO structures I've added to rpc_netlogon.h are quite nice as they give some insight into how these objects are stored in the SAM. (This used to be commit 74d6dec25d6b44e26d3895f789f1958d5f4639ee) --- source3/include/rpc_misc.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 3e4d52a038..eb345770ff 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -63,6 +63,15 @@ #define RID_TYPE_GROUP 1 #define RID_TYPE_ALIAS 2 +/* BIGINT - NT-style 64-bit integer */ +typedef struct bigint_info +{ + uint32 low; + uint32 high; + +} BIGINT; + + /* ENUM_HND */ typedef struct enum_hnd_info { @@ -142,6 +151,15 @@ typedef struct bufhdr_info } BUFHDR; +/* BUFHDR2 - another buffer header, with info level */ +typedef struct bufhdr2_info +{ + uint32 info_level; + uint32 length; /* uint8 chars */ + uint32 buffer; + +} BUFHDR2; + /* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */ /* pathetic. some stupid team of \PIPE\winreg writers got the concept */ /* of a unicode string different from the other \PIPE\ writers */ @@ -150,7 +168,7 @@ typedef struct buffer2_info uint32 buf_max_len; uint32 undoc; uint32 buf_len; - uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ + uint8 buffer[MAX_UNISTRLEN]; } BUFFER2; @@ -163,6 +181,14 @@ typedef struct buffer3_info } BUFFER3; +/* BUFFER4 - simple length and buffer */ +typedef struct buffer4_info +{ + uint32 buf_len; + uint8 buffer[MAX_BUFFERLEN]; + +} BUFFER4; + /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ typedef struct unistr2_info { -- cgit From be552ca3504ebd98da37e70bac1f10b248cf860b Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Tue, 27 Apr 1999 10:43:32 +0000 Subject: rpc_parse/parse_misc.c : defined a new BUFFER5 struct include/ntdomain.h : added rpc_spoolss.h include statement include/proto.h include/rpc_dce.h : added definition of RPC_ALTER_CONTEXT request & reply param/loadparm.c : 2 new options for NT printing support and some changes to initial values in the LPRNG case. rpc_parse/parse_prs.c : added prs_uint16s() rpc_parse/parse_rpc.c : added SYNT_SPOOLSS_V1 and code for the alter-context support. rpc_server/srv_pipe.c : alter-context support smbd/nttrans.c smbd/server.c include/rpc_misc.h Makefile.in include/smb.h Jean Francois (This used to be commit 4c515804b70254248e378a3f90f47e4c32639d29) --- source3/include/rpc_misc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index eb345770ff..2447e3307f 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -189,6 +189,13 @@ typedef struct buffer4_info } BUFFER4; +/* BUFFER5 */ +typedef struct buffer5_info +{ + uint32 buf_len; + uint16 *buffer; /* data */ +} BUFFER5; + /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ typedef struct unistr2_info { -- cgit From 896ecb48cab1d928224387f06ec63584bc6c6e99 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 15 Oct 1999 18:46:22 +0000 Subject: return results on prs_xxxxx() and all xxx_io_xxx() routines. the whole task is not complete, yet. xxx_io_xxx() routines that _call_ xxx_io_xxx() routines not done. prs_xxxx() covered by macros. considering doing xxx_io_xxxx in the same way. (This used to be commit 3b583f7be51434af98bc52b48dfa42c4602a3094) --- source3/include/rpc_misc.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 2447e3307f..ae1e3bf7d8 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -24,6 +24,43 @@ #ifndef _RPC_MISC_H /* _RPC_MISC_H */ #define _RPC_MISC_H +/* + * macros to wrap prs_xxxx routines. + */ +#define prs_uint8(name, ps, depth, data8) \ + if (!_prs_uint8(name, ps, depth, data8)) return False +#define prs_uint16(name, ps, depth, data16) \ + if (!_prs_uint16(name, ps, depth, data16)) return False +#define prs_hash1(ps, offset, sess_key) \ + if (!_prs_hash1(ps, offset, sess_key)) return False +#define prs_uint32(name, ps, depth, data32) \ + if (!_prs_uint32(name, ps, depth, data32)) return False +#define prs_uint8s(charmode, name, ps, depth, data8s, len) \ + if (!_prs_uint8s(charmode, name, ps, depth, data8s, len)) return False +#define prs_uint16s(charmode, name, ps, depth, data16s, len) \ + if (!_prs_uint16s(charmode, name, ps, depth, data16s, len)) return False +#define prs_uint32s(charmode, name, ps, depth, data32s, len) \ + if (!_prs_uint32s(charmode, name, ps, depth, data32s, len)) return False +#define prs_buffer2(charmode, name, ps, depth, str) \ + if (!_prs_buffer2(charmode, name, ps, depth, str)) return False +#define prs_string2(charmode, name, ps, depth, str) \ + if (!_prs_string2(charmode, name, ps, depth, str)) return False +#define prs_unistr2(charmode, name, ps, depth, str) \ + if (!_prs_unistr2(charmode, name, ps, depth, str)) return False +#define prs_unistr3(charmode, name, str, ps, depth) \ + if (!_prs_unistr3(charmode, name, str, ps, depth)) return False +#define prs_unistr(name, ps, depth, str) \ + if (!_prs_unistr(name, ps, depth, str)) return False +#define prs_string(name, ps, depth, str, len, max_buf_size) \ + if (!_prs_string(name, ps, depth, str, len, max_buf_size)) return False +#define prs_uint16_pre(name, ps, depth, data16, offset) \ + if (!_prs_uint16_pre(name, ps, depth, data16, offset)) return False +#define prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size) \ + if (!_prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size)) return False +#define prs_uint32_pre(name, ps, depth, data32, offset) \ + if (!_prs_uint32_pre(name, ps, depth, data32, offset)) return False +#define prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size) \ + if (!_prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size)) return False #include "rpc_dce.h" -- cgit From 003f7364fd54ccdd190d447e275b70b0f76e95f7 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 15 Oct 1999 20:00:30 +0000 Subject: adding error checking in parsing code (This used to be commit 4c98d71ebd3f1cdaef664d46c998c864af34632a) --- source3/include/rpc_misc.h | 108 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 88 insertions(+), 20 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index ae1e3bf7d8..ed8cbd96bb 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -28,39 +28,107 @@ * macros to wrap prs_xxxx routines. */ #define prs_uint8(name, ps, depth, data8) \ - if (!_prs_uint8(name, ps, depth, data8)) return False + if (!_prs_uint8(name, ps, depth, data8)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_uint16(name, ps, depth, data16) \ - if (!_prs_uint16(name, ps, depth, data16)) return False -#define prs_hash1(ps, offset, sess_key) \ - if (!_prs_hash1(ps, offset, sess_key)) return False + if (!_prs_uint16(name, ps, depth, data16)) \ + {\ + ps->offset = 0;\ + return False;\ + } +#define prs_hash1(x_ps, x_offset, x_sess_key) \ + if (!_prs_hash1(x_ps, x_offset, x_sess_key)) \ + {\ + x_ps->offset = 0;\ + return False;\ + } #define prs_uint32(name, ps, depth, data32) \ - if (!_prs_uint32(name, ps, depth, data32)) return False + if (!_prs_uint32(name, ps, depth, data32)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_uint8s(charmode, name, ps, depth, data8s, len) \ - if (!_prs_uint8s(charmode, name, ps, depth, data8s, len)) return False + if (!_prs_uint8s(charmode, name, ps, depth, data8s, len)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_uint16s(charmode, name, ps, depth, data16s, len) \ - if (!_prs_uint16s(charmode, name, ps, depth, data16s, len)) return False + if (!_prs_uint16s(charmode, name, ps, depth, data16s, len)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_uint32s(charmode, name, ps, depth, data32s, len) \ - if (!_prs_uint32s(charmode, name, ps, depth, data32s, len)) return False + if (!_prs_uint32s(charmode, name, ps, depth, data32s, len)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_buffer2(charmode, name, ps, depth, str) \ - if (!_prs_buffer2(charmode, name, ps, depth, str)) return False + if (!_prs_buffer2(charmode, name, ps, depth, str)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_string2(charmode, name, ps, depth, str) \ - if (!_prs_string2(charmode, name, ps, depth, str)) return False + if (!_prs_string2(charmode, name, ps, depth, str)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_unistr2(charmode, name, ps, depth, str) \ - if (!_prs_unistr2(charmode, name, ps, depth, str)) return False + if (!_prs_unistr2(charmode, name, ps, depth, str)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_unistr3(charmode, name, str, ps, depth) \ - if (!_prs_unistr3(charmode, name, str, ps, depth)) return False + if (!_prs_unistr3(charmode, name, str, ps, depth)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_unistr(name, ps, depth, str) \ - if (!_prs_unistr(name, ps, depth, str)) return False + if (!_prs_unistr(name, ps, depth, str)) \ + {\ + ps->offset = 0;\ + return False;\ + } #define prs_string(name, ps, depth, str, len, max_buf_size) \ - if (!_prs_string(name, ps, depth, str, len, max_buf_size)) return False -#define prs_uint16_pre(name, ps, depth, data16, offset) \ - if (!_prs_uint16_pre(name, ps, depth, data16, offset)) return False + if (!_prs_string(name, ps, depth, str, len, max_buf_size)) \ + {\ + ps->offset = 0;\ + return False;\ + } +#define prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset) \ + if (!_prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset)) \ + {\ + x_ps->offset = 0;\ + return False;\ + } #define prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size) \ - if (!_prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size)) return False -#define prs_uint32_pre(name, ps, depth, data32, offset) \ - if (!_prs_uint32_pre(name, ps, depth, data32, offset)) return False + if (!_prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size)) \ + {\ + ps->offset = 0;\ + return False;\ + } +#define prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset) \ + if (!_prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset)) \ + {\ + x_ps->offset = 0;\ + return False;\ + } #define prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size) \ - if (!_prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size)) return False + if (!_prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size)) \ + {\ + ps->offset = 0;\ + return False;\ + } #include "rpc_dce.h" -- cgit From 3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Dec 1999 13:27:58 +0000 Subject: first pass at updating head branch to be to be the same as the SAMBA_2_0 branch (This used to be commit 453a822a76780063dff23526c35408866d0c0154) --- source3/include/rpc_misc.h | 182 ++++++--------------------------------------- 1 file changed, 23 insertions(+), 159 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index ed8cbd96bb..b837c8a67c 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -24,111 +24,6 @@ #ifndef _RPC_MISC_H /* _RPC_MISC_H */ #define _RPC_MISC_H -/* - * macros to wrap prs_xxxx routines. - */ -#define prs_uint8(name, ps, depth, data8) \ - if (!_prs_uint8(name, ps, depth, data8)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_uint16(name, ps, depth, data16) \ - if (!_prs_uint16(name, ps, depth, data16)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_hash1(x_ps, x_offset, x_sess_key) \ - if (!_prs_hash1(x_ps, x_offset, x_sess_key)) \ - {\ - x_ps->offset = 0;\ - return False;\ - } -#define prs_uint32(name, ps, depth, data32) \ - if (!_prs_uint32(name, ps, depth, data32)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_uint8s(charmode, name, ps, depth, data8s, len) \ - if (!_prs_uint8s(charmode, name, ps, depth, data8s, len)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_uint16s(charmode, name, ps, depth, data16s, len) \ - if (!_prs_uint16s(charmode, name, ps, depth, data16s, len)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_uint32s(charmode, name, ps, depth, data32s, len) \ - if (!_prs_uint32s(charmode, name, ps, depth, data32s, len)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_buffer2(charmode, name, ps, depth, str) \ - if (!_prs_buffer2(charmode, name, ps, depth, str)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_string2(charmode, name, ps, depth, str) \ - if (!_prs_string2(charmode, name, ps, depth, str)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_unistr2(charmode, name, ps, depth, str) \ - if (!_prs_unistr2(charmode, name, ps, depth, str)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_unistr3(charmode, name, str, ps, depth) \ - if (!_prs_unistr3(charmode, name, str, ps, depth)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_unistr(name, ps, depth, str) \ - if (!_prs_unistr(name, ps, depth, str)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_string(name, ps, depth, str, len, max_buf_size) \ - if (!_prs_string(name, ps, depth, str, len, max_buf_size)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset) \ - if (!_prs_uint16_pre(x_name, x_ps, x_depth, x_data16, x_offset)) \ - {\ - x_ps->offset = 0;\ - return False;\ - } -#define prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size) \ - if (!_prs_uint16_post(name, ps, depth, data16, ptr_uint16, data_size)) \ - {\ - ps->offset = 0;\ - return False;\ - } -#define prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset) \ - if (!_prs_uint32_pre(x_name, x_ps, x_depth, x_data32, x_offset)) \ - {\ - x_ps->offset = 0;\ - return False;\ - } -#define prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size) \ - if (!_prs_uint32_post(name, ps, depth, data32, ptr_uint32, data_size)) \ - {\ - ps->offset = 0;\ - return False;\ - } #include "rpc_dce.h" @@ -148,10 +43,12 @@ #define BUILTIN_ALIAS_RID_USERS (0x00000221L) #define BUILTIN_ALIAS_RID_GUESTS (0x00000222L) #define BUILTIN_ALIAS_RID_POWER_USERS (0x00000223L) + #define BUILTIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) #define BUILTIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) #define BUILTIN_ALIAS_RID_PRINT_OPS (0x00000226L) #define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L) + #define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L) /* @@ -159,23 +56,13 @@ * NT RIDS. */ -/* Take the bottom bits. */ -#define RID_TYPE_MASK 2 -#define RID_MULTIPLIER 4 - -/* The three common types. */ -#define RID_TYPE_USER 0 -#define RID_TYPE_GROUP 1 -#define RID_TYPE_ALIAS 2 - -/* BIGINT - NT-style 64-bit integer */ -typedef struct bigint_info -{ - uint32 low; - uint32 high; - -} BIGINT; +/* Take the bottom bit. */ +#define RID_TYPE_MASK 1 +#define RID_MULTIPLIER 2 +/* The two common types. */ +#define USER_RID_TYPE 0 +#define GROUP_RID_TYPE 1 /* ENUM_HND */ typedef struct enum_hnd_info @@ -210,15 +97,6 @@ typedef struct header_info } STRHDR; -/* STRHDR2 - string header, 32-bit lengths */ -typedef struct header2_info -{ - uint32 str_str_len; - uint32 str_max_len; - uint32 buffer; - -} STRHDR2; - /* UNIHDR - unicode string header */ typedef struct unihdr_info { @@ -244,8 +122,8 @@ typedef struct unihdr2_info /* UNISTR - unicode string size and buffer */ typedef struct unistr_info { - uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */ - + /* unicode characters. ***MUST*** be little-endian. ***MUST*** be null-terminated */ + uint16 buffer[MAX_UNISTRLEN]; } UNISTR; /* BUFHDR - buffer header */ @@ -256,15 +134,6 @@ typedef struct bufhdr_info } BUFHDR; -/* BUFHDR2 - another buffer header, with info level */ -typedef struct bufhdr2_info -{ - uint32 info_level; - uint32 length; /* uint8 chars */ - uint32 buffer; - -} BUFHDR2; - /* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */ /* pathetic. some stupid team of \PIPE\winreg writers got the concept */ /* of a unicode string different from the other \PIPE\ writers */ @@ -273,7 +142,8 @@ typedef struct buffer2_info uint32 buf_max_len; uint32 undoc; uint32 buf_len; - uint8 buffer[MAX_UNISTRLEN]; + /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ + uint16 buffer[MAX_UNISTRLEN]; } BUFFER2; @@ -286,28 +156,14 @@ typedef struct buffer3_info } BUFFER3; -/* BUFFER4 - simple length and buffer */ -typedef struct buffer4_info -{ - uint32 buf_len; - uint8 buffer[MAX_BUFFERLEN]; - -} BUFFER4; - -/* BUFFER5 */ -typedef struct buffer5_info -{ - uint32 buf_len; - uint16 *buffer; /* data */ -} BUFFER5; - /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ typedef struct unistr2_info { uint32 uni_max_len; uint32 undoc; uint32 uni_str_len; - uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ + /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ + uint16 buffer[MAX_UNISTRLEN]; } UNISTR2; @@ -350,6 +206,15 @@ typedef struct domrid3_info } DOM_RID3; +/* DOM_RID4 - rid + user attributes */ +typedef struct domrid4_info +{ + uint32 unknown; + uint16 attr; + uint32 rid; /* user RID */ + +} DOM_RID4; + /* DOM_CLNT_SRV - client / server names */ typedef struct clnt_srv_info { @@ -422,4 +287,3 @@ typedef struct lsa_policy_info } POLICY_HND; #endif /* _RPC_MISC_H */ - -- cgit From b7ef313b3140af0813ed0fd94b0394d202e33f06 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Mon, 7 Feb 2000 16:27:03 +0000 Subject: spoolss include definitions J.F. (This used to be commit 853a1a3027dde7608027dc78f6e15789d5fc9152) --- source3/include/rpc_misc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index b837c8a67c..e96d6d4527 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -156,6 +156,13 @@ typedef struct buffer3_info } BUFFER3; +/* BUFFER5 */ +typedef struct buffer5_info +{ + uint32 buf_len; + uint16 *buffer; /* data */ +} BUFFER5; + /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ typedef struct unistr2_info { -- cgit From 0806cf75ff96dee6715610bd61e21cde08fa1c61 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 May 2000 14:28:46 +0000 Subject: added spool_io_printer_driver_info_level_6() thsi function and the associated header structure were autogenerated using a little awk based code geerator I wroe ths evening. I'll commit that next ... (This used to be commit 974813f0d4afb6c14ed27c48ab24b19932557f9f) --- source3/include/rpc_misc.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e96d6d4527..4f37a4b956 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -293,4 +293,10 @@ typedef struct lsa_policy_info } POLICY_HND; +typedef struct uint64_s +{ + uint32 low; + uint32 high; +} UINT64_S; + #endif /* _RPC_MISC_H */ -- cgit From a1bd6766172c91ae93a9c237cbfd8adca60e655c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 18 Jul 2000 05:16:30 +0000 Subject: Fixed some more client SPOOLSS functions. The following functions work now: - spoolenum - spoolopen - spoolgetprinter - spoolgetprinterdriver Items todo: - track down memory bug with spoolenumdata - fix spoolgetprinterdriverdir - fix spoolgetdata - fix display_job_info_ctr in spooljobs All part of the ongoing rpcclient work. Also included a new generic list ADT. Cleaner and simplier than the stuff in util_array.c i think (but then that's why I wrote it). --jerry (This used to be commit 381aba2c9a63faa53728f0520ac316478bc7a1c3) --- source3/include/rpc_misc.h | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 4f37a4b956..5ef4044cb4 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -21,11 +21,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "ntdomain.h" +#include "rpc_dce.h" + #ifndef _RPC_MISC_H /* _RPC_MISC_H */ #define _RPC_MISC_H -#include "rpc_dce.h" /* well-known RIDs - Relative IDs */ @@ -293,6 +295,39 @@ typedef struct lsa_policy_info } POLICY_HND; + +/* + * A client connection's state, pipe name, + * user credentials, etc... + */ +typedef struct _cli_auth_fns cli_auth_fns; +struct user_creds; +struct cli_connection { + + uint32 num_connections; + char *srv_name; + char *pipe_name; + struct user_creds usr_creds; + + struct cli_state *pCli_state; + + cli_auth_fns *auth; + + void *auth_info; + void *auth_creds; +}; + + +/* + * Associate a POLICY_HND with a cli_connection + */ +typedef struct rpc_hnd_node { + + POLICY_HND hnd; + struct cli_connection *cli; + +} RPC_HND_NODE; + typedef struct uint64_s { uint32 low; -- cgit From 5ec1642809d9de83da8c88c65d6595c6eb0270f5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 27 Jul 2000 00:47:19 +0000 Subject: Ok - this is a *BIG* change - but it fixes the problems with static strings in the RPC code. This change was prompted by trying to save a long (>256) character comment in the printer properties page. The new system associates a TALLOC_CTX with the pipe struct, and frees the pool on return of a complete PDU. A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx code, and is freed in the main loop. This code works with insure, and seems to be free of memory leaks and crashes (so far) but there are probably the occasional problem with code that uses UNISTRxx structs on the stack and expects them to contain storage without doing a init_unistrXX(). This means that rpcclient will probably be horribly broken. A TALLOC_CTX also needed associating with the struct cli_state also, to make the prs_xx code there work. The main interface change is the addition of a TALLOC_CTX to the prs_init calls - used for dynamic allocation in the prs_XXX calls. Now this is in place it should make dynamic allocation of all RPC memory on unmarshall *much* easier to fix. Jeremy. (This used to be commit 0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4) --- source3/include/rpc_misc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 5ef4044cb4..6e585e7a0e 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -125,7 +125,7 @@ typedef struct unihdr2_info typedef struct unistr_info { /* unicode characters. ***MUST*** be little-endian. ***MUST*** be null-terminated */ - uint16 buffer[MAX_UNISTRLEN]; + uint16 *buffer; } UNISTR; /* BUFHDR - buffer header */ @@ -145,7 +145,7 @@ typedef struct buffer2_info uint32 undoc; uint32 buf_len; /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ - uint16 buffer[MAX_UNISTRLEN]; + uint16 *buffer; } BUFFER2; @@ -153,7 +153,7 @@ typedef struct buffer2_info typedef struct buffer3_info { uint32 buf_max_len; - uint8 buffer[MAX_BUFFERLEN]; /* data */ + uint8 *buffer; /* Data */ uint32 buf_len; } BUFFER3; @@ -172,7 +172,7 @@ typedef struct unistr2_info uint32 undoc; uint32 uni_str_len; /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ - uint16 buffer[MAX_UNISTRLEN]; + uint16 *buffer; } UNISTR2; @@ -182,7 +182,7 @@ typedef struct string2_info uint32 str_max_len; uint32 undoc; uint32 str_str_len; - uint8 buffer[MAX_STRINGLEN]; /* uint8 characters. **NOT** necessarily null-terminated */ + uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ } STRING2; -- cgit From 394795e28b00eb95759938770cd24ee7c75ed39d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 4 Aug 2000 12:42:19 +0000 Subject: After talking with Jeremy and JF (and staring at packet traces between NT <-> NT), I've come to realize that UNISTR2 strings should be NULL terminated. jerry (This used to be commit c8f9e54beafcb0c0668f1510e7693dbf22485aa8) --- source3/include/rpc_misc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 6e585e7a0e..6fb2d63ed4 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -171,7 +171,9 @@ typedef struct unistr2_info uint32 uni_max_len; uint32 undoc; uint32 uni_str_len; - /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ + /* unicode characters. ***MUST*** be little-endian. + **must** be null-terminated and the uni_str_len should include + the NULL character */ uint16 *buffer; } UNISTR2; -- cgit From f296a8d087be261fee51a3a4664685bab1fb5ab1 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 8 Aug 2000 06:57:48 +0000 Subject: All changes related to rpcclient... - cleaned up some code - Fixed a few memory leaks of my own making - Add AddPrinterDriver(); I'm missing some of the semantics here as the call is done correctly, but I'm not getting all the information right in the DRIVER_INFO_3 struct I think. Will work on it tomorrow some more... --jerry (This used to be commit 3bf9a29f34ee4ade5180c5a0b0b9ff4aca7f0f08) --- source3/include/rpc_misc.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 6fb2d63ed4..d3e56634a9 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -306,7 +306,6 @@ typedef struct _cli_auth_fns cli_auth_fns; struct user_creds; struct cli_connection { - uint32 num_connections; char *srv_name; char *pipe_name; struct user_creds usr_creds; -- cgit From 9fede0dc0dbad51528cd1384023d24549c3f0ba4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 13 Nov 2000 23:03:34 +0000 Subject: Large commit which restructures the local password storage API. Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+) are broken, but they were somewhat broken before. :) The following functions implement the storage manipulation interface /*The following definitions come from passdb/pdb_smbpasswd.c */ BOOL pdb_setsampwent (BOOL update); void pdb_endsampwent (void); SAM_ACCOUNT* pdb_getsampwent (void); SAM_ACCOUNT* pdb_getsampwnam (char *username); SAM_ACCOUNT* pdb_getsampwuid (uid_t uid); SAM_ACCOUNT* pdb_getsampwrid (uint32 rid); BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass); BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override); BOOL pdb_delete_sam_account (char* username); There is also a host of pdb_set..() and pdb_get..() functions for manipulating SAM_ACCOUNT struct members. Note that the struct passdb_ops {} has gone away. Also notice that struct smb_passwd (formally in smb.h) has been moved to passdb/pdb_smbpasswd.c and is not accessed outisde of static internal functions in this file. All local password searches should make use of the the SAM_ACCOUNT struct and the previously mentioned functions. I'll write some documentation for this later. The next step is to fix the TDB passdb backend, then work on spliting the backends out into share libraries, and finally get the LDAP backend going. What works and may not: o domain logons from Win9x works o domain logons from WinNT 4 works o user and group enumeration as implemented by Tim works o file and print access works o changing password from Win9x & NT ummm...i'll fix this tonight :) If I broke anything else, just yell and I'll fix it. I think it should be fairly quite. -- jerry (This used to be commit 0b92d0838ebdbe24f34f17e313ecbf61a0301389) --- source3/include/rpc_misc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index d3e56634a9..1fbf87f134 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -335,4 +335,5 @@ typedef struct uint64_s uint32 high; } UINT64_S; + #endif /* _RPC_MISC_H */ -- cgit From 393bede7db6af546431cd5255e465b7b7b0e7c81 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Mar 2001 23:59:13 +0000 Subject: Sync up handle creation with 2.2 branch. We can now join AS/U domains and authenticate against them. Big/little endian issues fixed. Jeremy. (This used to be commit 0e6a34510ed598eaec7fe71a9c91fda528a4675c) --- source3/include/rpc_misc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 1fbf87f134..5152df8e0f 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -288,16 +288,16 @@ typedef struct gid_info } DOM_GID; -#define POL_HND_SIZE 20 - /* POLICY_HND */ typedef struct lsa_policy_info { - uint8 data[POL_HND_SIZE]; /* policy handle */ - + uint32 data1; + uint32 data2; + uint16 data3; + uint16 data4; + uint8 data5[8]; } POLICY_HND; - /* * A client connection's state, pipe name, * user credentials, etc... -- cgit From b840dce67639b8d270eaac27b29d7392981f55bd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 11 Mar 2001 22:26:28 +0000 Subject: Moved cruft out of smb.h into ntdomain.h where it belongs. dc struct now in pipe struct (where used) rather than user_struct. Secured machine account password changing in srv_netlog_nt.c - ensure that only the given machine can change its own password. May need to free this up later for NT admin tools, but this is a fail-safe secure position for now. Jeremy. (This used to be commit 46b12f2275dcd4b3114085160cd456441f9e921e) --- source3/include/rpc_misc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 5152df8e0f..428db938de 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -247,6 +247,19 @@ typedef struct log_info } DOM_LOG_INFO; +/* DOM_CHAL - challenge info */ +typedef struct chal_info +{ + uchar data[8]; /* credentials */ +} DOM_CHAL; + +/* DOM_CREDs - timestamped client or server credentials */ +typedef struct cred_info +{ + DOM_CHAL challenge; /* credentials */ + UTIME timestamp; /* credential time-stamp */ +} DOM_CRED; + /* DOM_CLNT_INFO - client info */ typedef struct clnt_info { -- cgit From d5c9172adadb83283e437578be7bad4368ad9f20 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 28 Aug 2001 06:43:43 +0000 Subject: Merge of sam sync code from TNG. Reverse-engineered the sam replication protocol from staring at hex dumps for a while. It's pretty similar to the sam sync protocol with a couple of different delta header types. I wasn't able to figure out the format of the privilege stuff - needs more time and a whiteboard. (-: The impressive bit is that the sam sync stuff from tng basically just worked thanks mainly to Luke Leighton's efforts in this area. (This used to be commit 3a60cb44f22d5f3f8c78a56ed8f5ea4794cd7ab3) --- source3/include/rpc_misc.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 428db938de..558c28459e 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -348,5 +348,24 @@ typedef struct uint64_s uint32 high; } UINT64_S; +/* BUFHDR2 - another buffer header, with info level */ +typedef struct bufhdr2_info +{ + uint32 info_level; + uint32 length; /* uint8 chars */ + uint32 buffer; + +} +BUFHDR2; + +/* BUFFER4 - simple length and buffer */ +typedef struct buffer4_info +{ + uint32 buf_len; + uint8 buffer[MAX_BUFFERLEN]; + +} +BUFFER4; + #endif /* _RPC_MISC_H */ -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/include/rpc_misc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 558c28459e..686f8e97e9 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. + Unix SMB/CIFS implementation. SMB parameters and setup Copyright (C) Andrew Tridgell 1992-1997 Copyright (C) Luke Kenneth Casson Leighton 1996-1997 -- cgit From 050b80356edea52f1bbb0a27599186ad84c18b73 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 19 Mar 2002 13:57:53 +0000 Subject: second step to gain free uid<->rid mapping we still need to free gid<->rid mapping and few other stuff (This used to be commit aa4b6f8181f34196a28951264dd8b631a5deef7f) --- source3/include/rpc_misc.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 686f8e97e9..7398b8ac57 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -33,11 +33,22 @@ /* RIDs - Well-known users ... */ #define DOMAIN_USER_RID_ADMIN (0x000001F4L) #define DOMAIN_USER_RID_GUEST (0x000001F5L) +#define DOMAIN_USER_RID_KRBTGT (0x000001F6L) /* RIDs - well-known groups ... */ #define DOMAIN_GROUP_RID_ADMINS (0x00000200L) #define DOMAIN_GROUP_RID_USERS (0x00000201L) #define DOMAIN_GROUP_RID_GUESTS (0x00000202L) +#define DOMAIN_GROUP_RID_COMPUTERS (0x00000203L) + +#define DOMAIN_GROUP_RID_CONTROLLERS (0x00000204L) +#define DOMAIN_GROUP_RID_CERT_ADMINS (0x00000205L) +#define DOMAIN_GROUP_RID_SCHEMA_ADMINS (0x00000206L) +#define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS (0x00000207L) + +/* is the following the right number? I bet it is --simo +#define DOMAIN_GROUP_RID_POLICY_ADMINS (0x00000208L) +*/ /* RIDs - well-known aliases ... */ #define BUILTIN_ALIAS_RID_ADMINS (0x00000220L) @@ -51,12 +62,16 @@ #define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L) #define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L) +#define BUILTIN_ALIAS_RID_RAS_SERVERS (0x00000229L) /* * Masks for mappings between unix uid and gid types and * NT RIDS. */ + +#define BASE_RID (0x000003E8L) + /* Take the bottom bit. */ #define RID_TYPE_MASK 1 #define RID_MULTIPLIER 2 -- cgit From 31f1c2172ca8a8a32c69a06a9388daecfc9c25ce Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 4 Apr 2002 06:55:32 +0000 Subject: If compiling with Insure, mallocate a byte of memory and attach it to the POLICY_HND structure when passing new handles back from the appropriate cli_* functions. When closing the policy handle free the memory. Insure (and indeed other memory checkers) should detect handles that have not been closed properly as memory leaks. Unfortunately this can only be done when the program terminates (set insure++.summarize leaks in your .psrc file) rather than when the policy handle falls out of scope. Looks like Jeremy has squished all the policy handle leaks at the moment but more are bound to crop up later. (This used to be commit 6dc80d625752f0a3ce6fd7b2278095529c6ec29f) --- source3/include/rpc_misc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 7398b8ac57..e47853c2a2 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -323,6 +323,18 @@ typedef struct lsa_policy_info uint16 data3; uint16 data4; uint8 data5[8]; + +#ifdef __INSURE__ + + /* To prevent the leakage of policy handles mallocate a bit of + memory when a policy handle is created and free it when the + handle is closed. This should cause Insure to flag an error + when policy handles are overwritten or fall out of scope without + being freed. */ + + char *marker; +#endif + } POLICY_HND; /* -- cgit From 4242eda183393b0535ac8ef880b4f441c60137af Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Jan 2003 17:22:48 +0000 Subject: merging some rpcclient and net functionality from HEAD (This used to be commit 7a4c87484237308cb3ad0d671687da7e0f6e733b) --- source3/include/rpc_misc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e47853c2a2..1b956826eb 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -210,6 +210,22 @@ typedef struct unistr3_info } UNISTR3; +/* an element in a unicode string array */ +typedef struct +{ + uint16 length; + uint16 size; + uint32 ref_id; + UNISTR2 string; +} UNISTR_ARRAY_EL; + +/* an array of unicode strings */ +typedef struct +{ + uint32 ref_id; + uint32 count; + UNISTR_ARRAY_EL *strings; +} UNISTR_ARRAY; /* DOM_RID2 - domain RID structure for ntlsa pipe */ typedef struct domrid2_info -- cgit From 734c6d8a513272c6e65ba60c62e21080c4339b8d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Jan 2003 21:09:56 +0000 Subject: Merging tridge's privillage client changes from HEAD. Jeremy. (This used to be commit 30a33920b4d834edc877cc0080291fbda983083a) --- source3/include/rpc_misc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 1b956826eb..7710489435 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -217,15 +217,15 @@ typedef struct uint16 size; uint32 ref_id; UNISTR2 string; -} UNISTR_ARRAY_EL; +} UNISTR2_ARRAY_EL; /* an array of unicode strings */ typedef struct { uint32 ref_id; uint32 count; - UNISTR_ARRAY_EL *strings; -} UNISTR_ARRAY; + UNISTR2_ARRAY_EL *strings; +} UNISTR2_ARRAY; /* DOM_RID2 - domain RID structure for ntlsa pipe */ typedef struct domrid2_info -- cgit From 17a3acafa89bfc6090b0767d05a00a7505003fcc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 28 Apr 2003 17:48:48 +0000 Subject: Use NTSTATUS as return value for smb_register_*() functions and init_module() function. Patch by metze with some minor modifications. (This used to be commit bc4b51bcb2daa7271c884cb83bf8bdba6d3a9b6d) --- source3/include/rpc_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 7710489435..d04a84d508 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -26,7 +26,7 @@ #ifndef _RPC_MISC_H /* _RPC_MISC_H */ #define _RPC_MISC_H - +#define SMB_RPC_INTERFACE_VERSION 1 /* well-known RIDs - Relative IDs */ -- cgit From c823b191ab476fc2583d6d6aaa1e2edb09cbb88e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 12 May 2003 18:12:31 +0000 Subject: And finally IDMAP in 3_0 We really need idmap_ldap to have a good solution with ldapsam, porting it from the prvious code is beeing made, the code is really simple to do so I am confident it is not a problem to commit this code in. Not committing it would have been worst. I really would have been able to finish also the group code, maybe we can put it into a followin release after 3.0.0 even if it may be an upgrade problem. The code has been tested and seem to work right, more testing is needed for corner cases. Currently winbind pdc (working only for users and not for groups) is disabled as I was not able to make a complete group code replacement that works somewhat in a week (I have a complete patch, but there are bugs) Simo. (This used to be commit 0e58085978f984436815114a2ec347cf7899a89d) --- source3/include/rpc_misc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index d04a84d508..a0572a0bfd 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -227,6 +227,22 @@ typedef struct UNISTR2_ARRAY_EL *strings; } UNISTR2_ARRAY; + +/* an element in a sid array */ +typedef struct +{ + uint32 ref_id; + DOM_SID2 sid; +} SID_ARRAY_EL; + +/* an array of sids */ +typedef struct +{ + uint32 ref_id; + uint32 count; + SID_ARRAY_EL *sids; +} SID_ARRAY; + /* DOM_RID2 - domain RID structure for ntlsa pipe */ typedef struct domrid2_info { -- cgit From f167cf594d41ce1133ecbd1d12f9d75d340f288b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 22 Sep 2003 22:08:53 +0000 Subject: Reformat - preparing to fix bug #480 (which will be ugly). Jeremy. (This used to be commit 605e257cab8041900ec9c6839c37e04d005a420e) --- source3/include/rpc_misc.h | 140 +++++++++++++++++++-------------------------- 1 file changed, 59 insertions(+), 81 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index a0572a0bfd..f9dd15c36b 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -85,49 +85,42 @@ typedef struct enum_hnd_info { uint32 ptr_hnd; /* pointer to enumeration handle */ uint32 handle; /* enumeration handle */ - } ENUM_HND; /* LOOKUP_LEVEL - switch value */ typedef struct lookup_level_info { - uint16 value; - + uint16 value; } LOOKUP_LEVEL; /* DOM_SID2 - security id */ typedef struct sid_info_2 { uint32 num_auths; /* length, bytes, including length of len :-) */ - DOM_SID sid; - } DOM_SID2; /* STRHDR - string header */ typedef struct header_info { - uint16 str_str_len; - uint16 str_max_len; - uint32 buffer; /* non-zero */ - + uint16 str_str_len; + uint16 str_max_len; + uint32 buffer; /* non-zero */ } STRHDR; /* UNIHDR - unicode string header */ typedef struct unihdr_info { - uint16 uni_str_len; - uint16 uni_max_len; - uint32 buffer; /* usually has a value of 4 */ - + uint16 uni_str_len; + uint16 uni_max_len; + uint32 buffer; /* usually has a value of 4 */ } UNIHDR; /* UNIHDR2 - unicode string header and undocumented buffer */ typedef struct unihdr2_info { - UNIHDR unihdr; - uint32 buffer; /* 32 bit buffer pointer */ - + UNIHDR unihdr; + uint32 buffer; /* 32 bit buffer pointer */ } UNIHDR2; /* clueless as to what maximum length should be */ @@ -138,16 +131,15 @@ typedef struct unihdr2_info /* UNISTR - unicode string size and buffer */ typedef struct unistr_info { - /* unicode characters. ***MUST*** be little-endian. ***MUST*** be null-terminated */ - uint16 *buffer; + /* unicode characters. ***MUST*** be little-endian. ***MUST*** be null-terminated */ + uint16 *buffer; } UNISTR; /* BUFHDR - buffer header */ typedef struct bufhdr_info { - uint32 buf_max_len; - uint32 buf_len; - + uint32 buf_max_len; + uint32 buf_len; } BUFHDR; /* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */ @@ -155,51 +147,47 @@ typedef struct bufhdr_info /* of a unicode string different from the other \PIPE\ writers */ typedef struct buffer2_info { - uint32 buf_max_len; - uint32 undoc; - uint32 buf_len; - /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ - uint16 *buffer; - + uint32 buf_max_len; + uint32 undoc; + uint32 buf_len; + /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ + uint16 *buffer; } BUFFER2; /* BUFFER3 */ typedef struct buffer3_info { - uint32 buf_max_len; - uint8 *buffer; /* Data */ - uint32 buf_len; - + uint32 buf_max_len; + uint8 *buffer; /* Data */ + uint32 buf_len; } BUFFER3; /* BUFFER5 */ typedef struct buffer5_info { - uint32 buf_len; - uint16 *buffer; /* data */ + uint32 buf_len; + uint16 *buffer; /* data */ } BUFFER5; /* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ typedef struct unistr2_info { - uint32 uni_max_len; - uint32 undoc; - uint32 uni_str_len; - /* unicode characters. ***MUST*** be little-endian. - **must** be null-terminated and the uni_str_len should include - the NULL character */ - uint16 *buffer; - + uint32 uni_max_len; + uint32 undoc; + uint32 uni_str_len; + /* unicode characters. ***MUST*** be little-endian. + **must** be null-terminated and the uni_str_len should include + the NULL character */ + uint16 *buffer; } UNISTR2; /* STRING2 - string size (in uint8 chars) and buffer */ typedef struct string2_info { - uint32 str_max_len; - uint32 undoc; - uint32 str_str_len; - uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ - + uint32 str_max_len; + uint32 undoc; + uint32 str_str_len; + uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ } STRING2; /* UNISTR3 - XXXX not sure about this structure */ @@ -266,85 +254,77 @@ typedef struct domrid3_info /* DOM_RID4 - rid + user attributes */ typedef struct domrid4_info { - uint32 unknown; - uint16 attr; - uint32 rid; /* user RID */ - + uint32 unknown; + uint16 attr; + uint32 rid; /* user RID */ } DOM_RID4; /* DOM_CLNT_SRV - client / server names */ typedef struct clnt_srv_info { - uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server name */ - uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_comp_name; /* client machine name */ - + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_comp_name; /* client machine name */ } DOM_CLNT_SRV; /* DOM_LOG_INFO - login info */ typedef struct log_info { - uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server name */ - UNISTR2 uni_acct_name; /* account name */ - uint16 sec_chan; /* secure channel type */ - UNISTR2 uni_comp_name; /* client machine name */ - + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + UNISTR2 uni_acct_name; /* account name */ + uint16 sec_chan; /* secure channel type */ + UNISTR2 uni_comp_name; /* client machine name */ } DOM_LOG_INFO; /* DOM_CHAL - challenge info */ typedef struct chal_info { - uchar data[8]; /* credentials */ + uchar data[8]; /* credentials */ } DOM_CHAL; /* DOM_CREDs - timestamped client or server credentials */ typedef struct cred_info { - DOM_CHAL challenge; /* credentials */ - UTIME timestamp; /* credential time-stamp */ + DOM_CHAL challenge; /* credentials */ + UTIME timestamp; /* credential time-stamp */ } DOM_CRED; /* DOM_CLNT_INFO - client info */ typedef struct clnt_info { - DOM_LOG_INFO login; - DOM_CRED cred; - + DOM_LOG_INFO login; + DOM_CRED cred; } DOM_CLNT_INFO; /* DOM_CLNT_INFO2 - client info */ typedef struct clnt_info2 { - DOM_CLNT_SRV login; - uint32 ptr_cred; - DOM_CRED cred; - + DOM_CLNT_SRV login; + uint32 ptr_cred; + DOM_CRED cred; } DOM_CLNT_INFO2; /* DOM_LOGON_ID - logon id */ typedef struct logon_info { - uint32 low; - uint32 high; - + uint32 low; + uint32 high; } DOM_LOGON_ID; /* OWF INFO */ typedef struct owf_info { - uint8 data[16]; - + uint8 data[16]; } OWF_INFO; /* DOM_GID - group id + user attributes */ typedef struct gid_info { - uint32 g_rid; /* a group RID */ - uint32 attr; - + uint32 g_rid; /* a group RID */ + uint32 attr; } DOM_GID; /* POLICY_HND */ @@ -355,7 +335,6 @@ typedef struct lsa_policy_info uint16 data3; uint16 data4; uint8 data5[8]; - #ifdef __INSURE__ /* To prevent the leakage of policy handles mallocate a bit of @@ -366,7 +345,6 @@ typedef struct lsa_policy_info char *marker; #endif - } POLICY_HND; /* -- cgit From d3b9384308e4b5130c9455b853edc4702d7af303 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Sep 2003 21:26:16 +0000 Subject: Fix for #480. Change the interface for init_unistr2 to not take a length but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string. This is not the case. Count it after conversion. Jeremy. (This used to be commit f82c273a42f930c7152cfab84394781744815e0e) --- source3/include/rpc_misc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index f9dd15c36b..aaaad55c20 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -148,7 +148,7 @@ typedef struct bufhdr_info typedef struct buffer2_info { uint32 buf_max_len; - uint32 undoc; + uint32 offset; uint32 buf_len; /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ uint16 *buffer; @@ -173,7 +173,7 @@ typedef struct buffer5_info typedef struct unistr2_info { uint32 uni_max_len; - uint32 undoc; + uint32 offset; uint32 uni_str_len; /* unicode characters. ***MUST*** be little-endian. **must** be null-terminated and the uni_str_len should include @@ -185,7 +185,7 @@ typedef struct unistr2_info typedef struct string2_info { uint32 str_max_len; - uint32 undoc; + uint32 offset; uint32 str_str_len; uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ } STRING2; @@ -403,5 +403,5 @@ typedef struct buffer4_info } BUFFER4; - +enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2 }; #endif /* _RPC_MISC_H */ -- cgit From ae8d35b2a2cead8a21a7c4f4bfbefa830384470e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 10 Dec 2003 21:13:44 +0000 Subject: Fix UNISTR2 length bug in LsaQueryInfo(3) that cause SID resolution to fail on local files on on domain members; bug 875 (This used to be commit c6594e35573186966a4d57404f1c06b98670db06) --- source3/include/rpc_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index aaaad55c20..29ae212185 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -403,5 +403,5 @@ typedef struct buffer4_info } BUFFER4; -enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2 }; +enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3 }; #endif /* _RPC_MISC_H */ -- cgit From 380e1607784e5d6fc5235b98790180b9eb0878c1 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 22 Dec 2003 21:48:06 +0000 Subject: add well known rid for pre win2k compatible access group; bug 897 (This used to be commit 33a1a374ebb44c839d995d11e1229767fc679678) --- source3/include/rpc_misc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 29ae212185..0c6eee3650 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -63,6 +63,7 @@ #define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L) #define BUILTIN_ALIAS_RID_RAS_SERVERS (0x00000229L) +#define BUILTIN_ALIAS_RID_PRE_2K_ACCESS (0x0000022aL) /* * Masks for mappings between unix uid and gid types and -- cgit From 111f62c00c31ac98d50c0a01e31cb1d44082be29 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 20 Dec 2004 12:52:33 +0000 Subject: r4287: Vampire SAM_DELTA_DOMAIN_INFO. Based on samba4-idl. The decoding of account-lockout-string is somewhat experimental though. Guenther (This used to be commit 721bf50d7446b8ce18bc1d45e17d4214d5a43d26) --- source3/include/rpc_misc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 0c6eee3650..ee8208e90e 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -395,6 +395,15 @@ typedef struct bufhdr2_info } BUFHDR2; +/* BUFHDR4 - another buffer header */ +typedef struct bufhdr4_info +{ + uint32 size; + uint32 buffer; + +} +BUFHDR4; + /* BUFFER4 - simple length and buffer */ typedef struct buffer4_info { -- cgit From 07fdfa2ce9762557c3be632f3e438a1f59970c5c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 8 Jan 2005 00:51:12 +0000 Subject: r4601: Removed any use of the MAX_XXX_STR style definitions. A little larger change than I'd hoped for due to formating changes to tidy up code. Jeremy. (This used to be commit a348f9221a9fe719dc6f0db6eb295575c2f95e1e) --- source3/include/rpc_misc.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index ee8208e90e..6abc85a4ca 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -124,11 +124,6 @@ typedef struct unihdr2_info uint32 buffer; /* 32 bit buffer pointer */ } UNIHDR2; -/* clueless as to what maximum length should be */ -#define MAX_UNISTRLEN 256 -#define MAX_STRINGLEN 256 -#define MAX_BUFFERLEN 512 - /* UNISTR - unicode string size and buffer */ typedef struct unistr_info { @@ -408,7 +403,7 @@ BUFHDR4; typedef struct buffer4_info { uint32 buf_len; - uint8 buffer[MAX_BUFFERLEN]; + uint8 *buffer; } BUFFER4; -- cgit From 5d1cb8e79edea9e8581d3c2c9dd297310cd9a98c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Mar 2005 23:26:33 +0000 Subject: r6014: rather large change set.... pulling back all recent rpc changes from trunk into 3.0. I've tested a compile and so don't think I've missed any files. But if so, just mail me and I'll clean backup in a couple of hours. Changes include \winreg, \eventlog, \svcctl, and general parse_misc.c updates. I am planning on bracketing the event code with an #ifdef ENABLE_EVENTLOG until I finish merging Marcin's changes (very soon). (This used to be commit 4e0ac63c36527cd8c52ef720cae17e84f67e7221) --- source3/include/rpc_misc.h | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 6abc85a4ca..16611fe955 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -1,6 +1,6 @@ /* Unix SMB/CIFS implementation. - SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 Copyright (C) Luke Kenneth Casson Leighton 1996-1997 Copyright (C) Paul Ashton 1997 @@ -28,6 +28,9 @@ #define SMB_RPC_INTERFACE_VERSION 1 +#define PRS_POINTER_CAST BOOL (*)(const char*, prs_struct*, int, void*) + + /* well-known RIDs - Relative IDs */ /* RIDs - Well-known users ... */ @@ -88,12 +91,6 @@ typedef struct enum_hnd_info uint32 handle; /* enumeration handle */ } ENUM_HND; -/* LOOKUP_LEVEL - switch value */ -typedef struct lookup_level_info -{ - uint16 value; -} LOOKUP_LEVEL; - /* DOM_SID2 - security id */ typedef struct sid_info_2 { @@ -138,17 +135,25 @@ typedef struct bufhdr_info uint32 buf_len; } BUFHDR; -/* BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer */ -/* pathetic. some stupid team of \PIPE\winreg writers got the concept */ -/* of a unicode string different from the other \PIPE\ writers */ -typedef struct buffer2_info -{ +/* + OLD COMMENT: + BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer + pathetic. some stupid team of \PIPE\winreg writers got the concept + of a unicode string different from the other \PIPE\ writers + + NEW COMMENT: + buffer used by \winreg\ calls to fill in arbitrary REG_XXX values. + It *may* look like a UNISTR2 but it is *not*. This is not a goof + by the winreg developers. It is a generic buffer +*/ + +typedef struct { uint32 buf_max_len; uint32 offset; uint32 buf_len; /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ uint16 *buffer; -} BUFFER2; +} REGVAL_BUFFER; /* BUFFER3 */ typedef struct buffer3_info @@ -177,6 +182,13 @@ typedef struct unistr2_info uint16 *buffer; } UNISTR2; +/* UNIHDR + UNISTR2* */ +typedef struct { + uint16 length; /* number of bytes not counting NULL terminatation */ + uint16 size; /* number of bytes including NULL terminatation */ + UNISTR2 *string; +} UNISTR4; + /* STRING2 - string size (in uint8 chars) and buffer */ typedef struct string2_info { -- cgit From 0aa89db9471330fd02db395c2eb387ac2dfef54f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 26 Mar 2005 06:52:56 +0000 Subject: r6071: * clean up UNISTR2_ARRAY ( really just an array of UNISTR4 + count ) * add some backwards compatibility to 'net rpc rights list' * verify privilege name in 'net rpc rights privileges ' in order to give back better error messages. (This used to be commit 0e29dc8aa384dfa6d2495beb8a9ffb5371e60a13) --- source3/include/rpc_misc.h | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 16611fe955..d5dc35f6c7 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -182,13 +182,6 @@ typedef struct unistr2_info uint16 *buffer; } UNISTR2; -/* UNIHDR + UNISTR2* */ -typedef struct { - uint16 length; /* number of bytes not counting NULL terminatation */ - uint16 size; /* number of bytes including NULL terminatation */ - UNISTR2 *string; -} UNISTR4; - /* STRING2 - string size (in uint8 chars) and buffer */ typedef struct string2_info { @@ -206,22 +199,18 @@ typedef struct unistr3_info } UNISTR3; -/* an element in a unicode string array */ -typedef struct -{ - uint16 length; - uint16 size; - uint32 ref_id; - UNISTR2 string; -} UNISTR2_ARRAY_EL; +/* UNIHDR + UNISTR2* */ -/* an array of unicode strings */ -typedef struct -{ - uint32 ref_id; +typedef struct { + uint16 length; /* number of bytes not counting NULL terminatation */ + uint16 size; /* number of bytes including NULL terminatation */ + UNISTR2 *string; +} UNISTR4; + +typedef struct { uint32 count; - UNISTR2_ARRAY_EL *strings; -} UNISTR2_ARRAY; + UNISTR4 *strings; +} UNISTR4_ARRAY; /* an element in a sid array */ -- cgit From 60dd0d0f9c277eb9852924aea81fee06b7395832 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 6 Apr 2005 03:08:25 +0000 Subject: r6221: format cleanup (got tied of looking for related structures) also remove unused SID_ARRAY structure.... (This used to be commit c8f808b0763f7abcc0d879057f4f17002e65b4e1) --- source3/include/rpc_misc.h | 319 ++++++++++++++++++++++++--------------------- 1 file changed, 168 insertions(+), 151 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index d5dc35f6c7..3cece400db 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -1,9 +1,10 @@ /* Unix SMB/CIFS implementation. - Copyright (C) Andrew Tridgell 1992-1997 - Copyright (C) Luke Kenneth Casson Leighton 1996-1997 - Copyright (C) Paul Ashton 1997 + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + Copyright (C) Gerald (Jerry) Carter 2005 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 @@ -27,11 +28,15 @@ #define _RPC_MISC_H #define SMB_RPC_INTERFACE_VERSION 1 - #define PRS_POINTER_CAST BOOL (*)(const char*, prs_struct*, int, void*) +enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3 }; + -/* well-known RIDs - Relative IDs */ + +/********************************************************************** + * well-known RIDs - Relative IDs + **********************************************************************/ /* RIDs - Well-known users ... */ #define DOMAIN_USER_RID_ADMIN (0x000001F4L) @@ -68,73 +73,83 @@ #define BUILTIN_ALIAS_RID_RAS_SERVERS (0x00000229L) #define BUILTIN_ALIAS_RID_PRE_2K_ACCESS (0x0000022aL) -/* + +/********************************************************************** * Masks for mappings between unix uid and gid types and * NT RIDS. - */ - + **********************************************************************/ #define BASE_RID (0x000003E8L) /* Take the bottom bit. */ -#define RID_TYPE_MASK 1 -#define RID_MULTIPLIER 2 +#define RID_TYPE_MASK 1 +#define RID_MULTIPLIER 2 /* The two common types. */ -#define USER_RID_TYPE 0 -#define GROUP_RID_TYPE 1 +#define USER_RID_TYPE 0 +#define GROUP_RID_TYPE 1 -/* ENUM_HND */ -typedef struct enum_hnd_info -{ + + +/********************************************************************** + * RPC policy handle used pretty much everywhere + **********************************************************************/ + +typedef struct { uint32 ptr_hnd; /* pointer to enumeration handle */ uint32 handle; /* enumeration handle */ } ENUM_HND; -/* DOM_SID2 - security id */ -typedef struct sid_info_2 -{ - uint32 num_auths; /* length, bytes, including length of len :-) */ - DOM_SID sid; -} DOM_SID2; -/* STRHDR - string header */ -typedef struct header_info -{ - uint16 str_str_len; - uint16 str_max_len; - uint32 buffer; /* non-zero */ -} STRHDR; -/* UNIHDR - unicode string header */ -typedef struct unihdr_info -{ - uint16 uni_str_len; - uint16 uni_max_len; - uint32 buffer; /* usually has a value of 4 */ -} UNIHDR; +/********************************************************************** + * RPC policy handle used pretty much everywhere + **********************************************************************/ -/* UNIHDR2 - unicode string header and undocumented buffer */ -typedef struct unihdr2_info -{ - UNIHDR unihdr; - uint32 buffer; /* 32 bit buffer pointer */ -} UNIHDR2; +typedef struct { + uint32 data1; + uint32 data2; + uint16 data3; + uint16 data4; + uint8 data5[8]; +#ifdef __INSURE__ -/* UNISTR - unicode string size and buffer */ -typedef struct unistr_info -{ - /* unicode characters. ***MUST*** be little-endian. ***MUST*** be null-terminated */ - uint16 *buffer; -} UNISTR; + /* To prevent the leakage of policy handles mallocate a bit of + memory when a policy handle is created and free it when the + handle is closed. This should cause Insure to flag an error + when policy handles are overwritten or fall out of scope without + being freed. */ -/* BUFHDR - buffer header */ -typedef struct bufhdr_info -{ + char *marker; +#endif +} POLICY_HND; + + +/********************************************************************** + * Buffer Headers -- use by SEC_DESC_BUF in winreg and netlogon code + **********************************************************************/ + +typedef struct { uint32 buf_max_len; uint32 buf_len; } BUFHDR; +typedef struct { + uint32 info_level; + uint32 length; /* uint8 chars */ + uint32 buffer; +} BUFHDR2; + +typedef struct { + uint32 size; + uint32 buffer; +} BUFHDR4; + + +/********************************************************************** + * Buffers use by winreg + **********************************************************************/ + /* OLD COMMENT: BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer @@ -151,59 +166,91 @@ typedef struct { uint32 buf_max_len; uint32 offset; uint32 buf_len; - /* unicode characters. ***MUST*** be little-endian. **NOT** necessarily null-terminated */ uint16 *buffer; } REGVAL_BUFFER; -/* BUFFER3 */ -typedef struct buffer3_info -{ +typedef struct buffer3_info { uint32 buf_max_len; - uint8 *buffer; /* Data */ + uint8 *buffer; /* Data */ uint32 buf_len; } BUFFER3; -/* BUFFER5 */ -typedef struct buffer5_info -{ + + +/********************************************************************** + * Buffers use by spoolss + **********************************************************************/ + +typedef struct { uint32 buf_len; uint16 *buffer; /* data */ } BUFFER5; -/* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ -typedef struct unistr2_info -{ + + +/********************************************************************** + * Buffers use by netlogon + **********************************************************************/ + +typedef struct { + uint32 buf_len; + uint8 *buffer; +} BUFFER4; + + + +/********************************************************************** + * Unicode and basic string headers + **********************************************************************/ + +typedef struct { + uint16 str_str_len; + uint16 str_max_len; + uint32 buffer; /* non-zero */ +} STRHDR; + +typedef struct { + uint16 uni_str_len; + uint16 uni_max_len; + uint32 buffer; +} UNIHDR; + +typedef struct { + UNIHDR unihdr; + uint32 buffer; /* 32 bit buffer pointer */ +} UNIHDR2; + + + +/********************************************************************** + * UNICODE string variations + **********************************************************************/ + + +typedef struct { /* UNISTR - unicode string size and buffer */ + uint16 *buffer; /* unicode characters. ***MUST*** be + little-endian. ***MUST*** be null-terminated */ +} UNISTR; + +typedef struct { /* UNISTR2 - unicode string size (in + uint16 unicode chars) and buffer */ uint32 uni_max_len; uint32 offset; uint32 uni_str_len; - /* unicode characters. ***MUST*** be little-endian. - **must** be null-terminated and the uni_str_len should include - the NULL character */ - uint16 *buffer; + uint16 *buffer; /* unicode characters. ***MUST*** be little-endian. + **must** be null-terminated and the uni_str_len + should include the NULL character */ } UNISTR2; -/* STRING2 - string size (in uint8 chars) and buffer */ -typedef struct string2_info -{ - uint32 str_max_len; - uint32 offset; - uint32 str_str_len; - uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ -} STRING2; - -/* UNISTR3 - XXXX not sure about this structure */ -typedef struct unistr3_info -{ +typedef struct { /* UNISTR3 - XXXX not sure about this structure */ uint32 uni_str_len; UNISTR str; } UNISTR3; -/* UNIHDR + UNISTR2* */ - -typedef struct { - uint16 length; /* number of bytes not counting NULL terminatation */ - uint16 size; /* number of bytes including NULL terminatation */ +typedef struct { /* UNIHDR + (UNISTR2*) */ + uint16 length; /* number of bytes not counting NULL terminatation */ + uint16 size; /* number of bytes including NULL terminatation */ UNISTR2 *string; } UNISTR4; @@ -213,39 +260,48 @@ typedef struct { } UNISTR4_ARRAY; -/* an element in a sid array */ -typedef struct -{ - uint32 ref_id; - DOM_SID2 sid; -} SID_ARRAY_EL; +/********************************************************************** + * String variations + **********************************************************************/ + +typedef struct { /* STRING2 - string size (in uint8 chars) and buffer */ + uint32 str_max_len; + uint32 offset; + uint32 str_str_len; + uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ +} STRING2; + + -/* an array of sids */ -typedef struct -{ - uint32 ref_id; - uint32 count; - SID_ARRAY_EL *sids; -} SID_ARRAY; + +/********************************************************************** + * Domain SID structures + **********************************************************************/ + +typedef struct { + uint32 num_auths; /* length, bytes, including length of len :-) */ + DOM_SID sid; +} DOM_SID2; + + +/********************************************************************** + * Domain SID structures + **********************************************************************/ /* DOM_RID2 - domain RID structure for ntlsa pipe */ -typedef struct domrid2_info -{ +typedef struct { uint8 type; /* value is SID_NAME_USE enum */ uint32 rid; uint32 rid_idx; /* referenced domain index */ - } DOM_RID2; -/* DOM_RID3 - domain RID structure for samr pipe */ -typedef struct domrid3_info -{ + +typedef struct { /* DOM_RID3 - domain RID structure for samr pipe */ uint32 rid; /* domain-relative (to a SID) id */ uint32 type1; /* value is 0x1 */ uint32 ptr_type; /* undocumented pointer */ uint32 type2; /* value is 0x1 */ uint32 unk; /* value is 0x2 */ - } DOM_RID3; /* DOM_RID4 - rid + user attributes */ @@ -256,6 +312,16 @@ typedef struct domrid4_info uint32 rid; /* user RID */ } DOM_RID4; +/* DOM_GID - group id + user attributes */ +typedef struct { + uint32 g_rid; /* a group RID */ + uint32 attr; +} DOM_GID; + +/********************************************************************** + * ???? + **********************************************************************/ + /* DOM_CLNT_SRV - client / server names */ typedef struct clnt_srv_info { @@ -317,32 +383,8 @@ typedef struct owf_info } OWF_INFO; -/* DOM_GID - group id + user attributes */ -typedef struct gid_info -{ - uint32 g_rid; /* a group RID */ - uint32 attr; -} DOM_GID; - -/* POLICY_HND */ -typedef struct lsa_policy_info -{ - uint32 data1; - uint32 data2; - uint16 data3; - uint16 data4; - uint8 data5[8]; -#ifdef __INSURE__ - /* To prevent the leakage of policy handles mallocate a bit of - memory when a policy handle is created and free it when the - handle is closed. This should cause Insure to flag an error - when policy handles are overwritten or fall out of scope without - being freed. */ - char *marker; -#endif -} POLICY_HND; /* * A client connection's state, pipe name, @@ -381,33 +423,8 @@ typedef struct uint64_s uint32 high; } UINT64_S; -/* BUFHDR2 - another buffer header, with info level */ -typedef struct bufhdr2_info -{ - uint32 info_level; - uint32 length; /* uint8 chars */ - uint32 buffer; - -} -BUFHDR2; -/* BUFHDR4 - another buffer header */ -typedef struct bufhdr4_info -{ - uint32 size; - uint32 buffer; -} -BUFHDR4; -/* BUFFER4 - simple length and buffer */ -typedef struct buffer4_info -{ - uint32 buf_len; - uint8 *buffer; -} -BUFFER4; - -enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3 }; #endif /* _RPC_MISC_H */ -- cgit From b137b7cc4720ca9d99eab2bb198be1b112c2e24c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 6 Apr 2005 22:27:55 +0000 Subject: r6228: remove BUFHDR2 and clean up LsaEnumTrustedDomains() Tested client and server code. (This used to be commit efb3ac4c69c72c0fa01c558951fa357893562bce) --- source3/include/rpc_misc.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 3cece400db..e93d6610ba 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -215,13 +215,6 @@ typedef struct { uint32 buffer; } UNIHDR; -typedef struct { - UNIHDR unihdr; - uint32 buffer; /* 32 bit buffer pointer */ -} UNIHDR2; - - - /********************************************************************** * UNICODE string variations **********************************************************************/ @@ -248,7 +241,7 @@ typedef struct { /* UNISTR3 - XXXX not sure about this structure */ } UNISTR3; -typedef struct { /* UNIHDR + (UNISTR2*) */ +typedef struct { /* Buffer wrapped around a UNISTR2 */ uint16 length; /* number of bytes not counting NULL terminatation */ uint16 size; /* number of bytes including NULL terminatation */ UNISTR2 *string; -- cgit From 466a825ce7a3c9a40a694608523f47e580c78415 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 7 Apr 2005 04:58:38 +0000 Subject: r6232: more cleanups; remove BUFFER3; rename BUFFER4 -> RPC_DATA_BLOB; rename REG_CREATE_VALE -> REG_SET_VALUE (This used to be commit 28d433351cf813c7fb57ebac0e0f4973c85f73e8) --- source3/include/rpc_misc.h | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e93d6610ba..dcc0ecc554 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -147,20 +147,12 @@ typedef struct { /********************************************************************** - * Buffers use by winreg + * Buffers **********************************************************************/ -/* - OLD COMMENT: - BUFFER2 - unicode string, size (in uint8 ascii chars) and buffer - pathetic. some stupid team of \PIPE\winreg writers got the concept - of a unicode string different from the other \PIPE\ writers - - NEW COMMENT: - buffer used by \winreg\ calls to fill in arbitrary REG_XXX values. - It *may* look like a UNISTR2 but it is *not*. This is not a goof - by the winreg developers. It is a generic buffer -*/ +/* buffer used by \winreg\ calls to fill in arbitrary REG_XXX values. + It *may* look like a UNISTR2 but it is *not*. This is not a goof + by the winreg developers. It is a generic buffer */ typedef struct { uint32 buf_max_len; @@ -169,34 +161,22 @@ typedef struct { uint16 *buffer; } REGVAL_BUFFER; -typedef struct buffer3_info { - uint32 buf_max_len; - uint8 *buffer; /* Data */ - uint32 buf_len; -} BUFFER3; - - - -/********************************************************************** - * Buffers use by spoolss - **********************************************************************/ +/* generic rpc version of the DATA_BLOB. Just a length and uint8 array */ typedef struct { uint32 buf_len; - uint16 *buffer; /* data */ -} BUFFER5; - - + uint8 *buffer; +} RPC_DATA_BLOB; /********************************************************************** - * Buffers use by netlogon + * Buffers use by spoolss (i might be able to replace it with + * an RPC_DATA_BLOB) **********************************************************************/ typedef struct { uint32 buf_len; - uint8 *buffer; -} BUFFER4; - + uint16 *buffer; /* data */ +} BUFFER5; /********************************************************************** -- cgit From f24d88cf9da46680d52b42b92bd484e7b09ce99b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 31 May 2005 13:46:45 +0000 Subject: r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1 (This used to be commit 9727d05241574042dd3aa8844ae5c701d22e2da1) --- source3/include/rpc_misc.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index dcc0ecc554..9f35450d95 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -129,17 +129,20 @@ typedef struct { * Buffer Headers -- use by SEC_DESC_BUF in winreg and netlogon code **********************************************************************/ +/* TODO: replace this with an encompassing buffer structure */ typedef struct { uint32 buf_max_len; uint32 buf_len; } BUFHDR; +/* this is a BUFHDR + a pointer to a buffer */ typedef struct { uint32 info_level; uint32 length; /* uint8 chars */ uint32 buffer; } BUFHDR2; +/* generic buffer ? wrapped around void*? */ typedef struct { uint32 size; uint32 buffer; @@ -152,7 +155,8 @@ typedef struct { /* buffer used by \winreg\ calls to fill in arbitrary REG_XXX values. It *may* look like a UNISTR2 but it is *not*. This is not a goof - by the winreg developers. It is a generic buffer */ + by the winreg developers. It is a generic buffer. buffer length + is stored in bytes (not # of uint16's) */ typedef struct { uint32 buf_max_len; @@ -215,10 +219,12 @@ typedef struct { /* UNISTR2 - unicode string size (in should include the NULL character */ } UNISTR2; +/* i think this is the same as a BUFFER5 used in the spoolss code --jerry */ +/* not sure about how the termination matches between the uint16 buffers thought */ + typedef struct { /* UNISTR3 - XXXX not sure about this structure */ uint32 uni_str_len; UNISTR str; - } UNISTR3; typedef struct { /* Buffer wrapped around a UNISTR2 */ -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/include/rpc_misc.h | 66 ++++++---------------------------------------- 1 file changed, 8 insertions(+), 58 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 9f35450d95..e5d91c1b63 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -21,9 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "ntdomain.h" -#include "rpc_dce.h" - #ifndef _RPC_MISC_H /* _RPC_MISC_H */ #define _RPC_MISC_H @@ -302,8 +299,7 @@ typedef struct { **********************************************************************/ /* DOM_CLNT_SRV - client / server names */ -typedef struct clnt_srv_info -{ +typedef struct clnt_srv_info { uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ UNISTR2 uni_logon_srv; /* logon server name */ uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ @@ -311,8 +307,7 @@ typedef struct clnt_srv_info } DOM_CLNT_SRV; /* DOM_LOG_INFO - login info */ -typedef struct log_info -{ +typedef struct log_info { uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ UNISTR2 uni_logon_srv; /* logon server name */ UNISTR2 uni_acct_name; /* account name */ @@ -321,89 +316,44 @@ typedef struct log_info } DOM_LOG_INFO; /* DOM_CHAL - challenge info */ -typedef struct chal_info -{ +typedef struct chal_info { uchar data[8]; /* credentials */ } DOM_CHAL; /* DOM_CREDs - timestamped client or server credentials */ -typedef struct cred_info -{ +typedef struct cred_info { DOM_CHAL challenge; /* credentials */ UTIME timestamp; /* credential time-stamp */ } DOM_CRED; /* DOM_CLNT_INFO - client info */ -typedef struct clnt_info -{ +typedef struct clnt_info { DOM_LOG_INFO login; DOM_CRED cred; } DOM_CLNT_INFO; /* DOM_CLNT_INFO2 - client info */ -typedef struct clnt_info2 -{ +typedef struct clnt_info2 { DOM_CLNT_SRV login; uint32 ptr_cred; DOM_CRED cred; } DOM_CLNT_INFO2; /* DOM_LOGON_ID - logon id */ -typedef struct logon_info -{ +typedef struct logon_info { uint32 low; uint32 high; } DOM_LOGON_ID; /* OWF INFO */ -typedef struct owf_info -{ +typedef struct owf_info { uint8 data[16]; } OWF_INFO; - - - - -/* - * A client connection's state, pipe name, - * user credentials, etc... - */ -typedef struct _cli_auth_fns cli_auth_fns; -struct user_creds; -struct cli_connection { - - char *srv_name; - char *pipe_name; - struct user_creds usr_creds; - - struct cli_state *pCli_state; - - cli_auth_fns *auth; - - void *auth_info; - void *auth_creds; -}; - - -/* - * Associate a POLICY_HND with a cli_connection - */ -typedef struct rpc_hnd_node { - - POLICY_HND hnd; - struct cli_connection *cli; - -} RPC_HND_NODE; - typedef struct uint64_s { uint32 low; uint32 high; } UINT64_S; - - - - #endif /* _RPC_MISC_H */ -- cgit From 0bf72b6e330a76bee502cb36c1cb80c46d47d33c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 6 Oct 2005 17:48:03 +0000 Subject: r10781: merging eventlog and svcctl code from trunk (This used to be commit f10aa9fb84bfac4f1a22b74d63999668700ffaac) --- source3/include/rpc_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e5d91c1b63..091ba3395e 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -27,7 +27,7 @@ #define SMB_RPC_INTERFACE_VERSION 1 #define PRS_POINTER_CAST BOOL (*)(const char*, prs_struct*, int, void*) -enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3 }; +enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3, UNI_STR_DBLTERMINATE = 4 }; -- cgit From e22d38bddef441eaaa5b0b0c5dbc92225e20f912 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Feb 2006 02:46:41 +0000 Subject: r13455: Prepare to add lookupnames2. Jeremy. (This used to be commit 2274709587bd1f27bea2eacf633182f20cd07b1e) --- source3/include/rpc_misc.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 091ba3395e..7b71e80c55 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -264,13 +264,20 @@ typedef struct { * Domain SID structures **********************************************************************/ -/* DOM_RID2 - domain RID structure for ntlsa pipe */ +/* DOM_RID - domain RID structure for ntlsa pipe */ typedef struct { uint8 type; /* value is SID_NAME_USE enum */ uint32 rid; uint32 rid_idx; /* referenced domain index */ -} DOM_RID2; +} DOM_RID; +/* DOM_RID2 - second domain RID structure for ntlsa pipe */ +typedef struct { + uint8 type; /* value is SID_NAME_USE enum */ + uint32 rid; + uint32 rid_idx; /* referenced domain index */ + uint32 unknown; +} DOM_RID2; typedef struct { /* DOM_RID3 - domain RID structure for samr pipe */ uint32 rid; /* domain-relative (to a SID) id */ -- cgit From 9132acff082381b32961eb2b3244b8fedd4df218 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 18 Feb 2006 00:27:31 +0000 Subject: r13553: Fix all our warnings at -O6 on an x86_64 box. Jeremy. (This used to be commit ea82958349a57ef4b7ce9638eec5f1388b0fba2a) --- source3/include/rpc_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 7b71e80c55..bad2089ac7 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -324,7 +324,7 @@ typedef struct log_info { /* DOM_CHAL - challenge info */ typedef struct chal_info { - uchar data[8]; /* credentials */ + unsigned char data[8]; /* credentials */ } DOM_CHAL; /* DOM_CREDs - timestamped client or server credentials */ -- cgit From a7552e677ed1c2df795c844987a7b7036c93bb35 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 2 Mar 2006 23:32:44 +0000 Subject: r13802: I *knew* ASU on sparc had to be good for *something* ! :-). Fix incorrect size understanding of sid name type (yes it's already correct in the Samba4 IDL :-). Jeremy. (This used to be commit 305a774d2880a57d1ebdf2ecf2d7e0b519695a33) --- source3/include/rpc_misc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index bad2089ac7..661d436859 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -266,14 +266,14 @@ typedef struct { /* DOM_RID - domain RID structure for ntlsa pipe */ typedef struct { - uint8 type; /* value is SID_NAME_USE enum */ + uint16 type; /* value is SID_NAME_USE enum */ uint32 rid; uint32 rid_idx; /* referenced domain index */ } DOM_RID; /* DOM_RID2 - second domain RID structure for ntlsa pipe */ typedef struct { - uint8 type; /* value is SID_NAME_USE enum */ + uint16 type; /* value is SID_NAME_USE enum */ uint32 rid; uint32 rid_idx; /* referenced domain index */ uint32 unknown; -- cgit From 8d5e7367b196cab1f06b3091f3431058777868d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 24 Aug 2006 20:27:42 +0000 Subject: r17806: Make NTTIME a UINT64_S rather than a separate structure consisting of two uint32s. (This used to be commit 3556a9c26cf7728e2435bb28e69958751e883ab9) --- source3/include/rpc_misc.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 661d436859..24c7150433 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -357,10 +357,5 @@ typedef struct owf_info { uint8 data[16]; } OWF_INFO; -typedef struct uint64_s -{ - uint32 low; - uint32 high; -} UINT64_S; #endif /* _RPC_MISC_H */ -- cgit From 5e1146ab5845169aba57dcd216f88589276e5df8 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 11 Sep 2006 22:02:34 +0000 Subject: r18404: * swap from POLICY_HND to the struct policy_handle from ndr/misc.h * move OUR_HANDLE macro to include/rpc_misc.h (This used to be commit 2b37079af2f569df7a58878150a61980c6fe06ee) --- source3/include/rpc_misc.h | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 24c7150433..91e0115b69 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -97,29 +97,12 @@ typedef struct { uint32 handle; /* enumeration handle */ } ENUM_HND; +typedef struct policy_handle POLICY_HND; - -/********************************************************************** - * RPC policy handle used pretty much everywhere - **********************************************************************/ - -typedef struct { - uint32 data1; - uint32 data2; - uint16 data3; - uint16 data4; - uint8 data5[8]; -#ifdef __INSURE__ - - /* To prevent the leakage of policy handles mallocate a bit of - memory when a policy handle is created and free it when the - handle is closed. This should cause Insure to flag an error - when policy handles are overwritten or fall out of scope without - being freed. */ - - char *marker; -#endif -} POLICY_HND; +#define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\ + ( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \ + "OTHER")), ((unsigned int)IVAL((hnd)->uuid.node,2)),\ + ((unsigned int)sys_getpid() ) /********************************************************************** -- cgit From 7ba2554d88a187ca1f4f40014363fdf9de2223a0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Sep 2006 23:57:32 +0000 Subject: r18802: Use the pidl-generated code for the srvsvc interface, both client and server code. This has had some basic testing. I'll do more during the next couple of days and hopefully also make RPC-SRVSVC from Samba4 pass against it. (This used to be commit ef10672399c4b82700dc431b4d93431ffdd42d98) --- source3/include/rpc_misc.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 91e0115b69..62bef2cb38 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -92,11 +92,6 @@ enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_ * RPC policy handle used pretty much everywhere **********************************************************************/ -typedef struct { - uint32 ptr_hnd; /* pointer to enumeration handle */ - uint32 handle; /* enumeration handle */ -} ENUM_HND; - typedef struct policy_handle POLICY_HND; #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\ -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/include/rpc_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 62bef2cb38..552aa95caf 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -8,7 +8,7 @@ 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 2 of the License, or + 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, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/include/rpc_misc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 552aa95caf..e50a52fea2 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -17,8 +17,7 @@ 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef _RPC_MISC_H /* _RPC_MISC_H */ -- cgit From e5a951325a6cac8567af3a66de6d2df577508ae4 Mon Sep 17 00:00:00 2001 From: "Gerald (Jerry) Carter" Date: Wed, 10 Oct 2007 15:34:30 -0500 Subject: [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab) --- source3/include/rpc_misc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e50a52fea2..53073c85be 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -92,6 +92,10 @@ enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_ **********************************************************************/ typedef struct policy_handle POLICY_HND; +typedef struct { + uint32 ptr_hnd; /* pointer to enumeration handle */ + uint32 handle; /* enumeration handle */ +} ENUM_HND; #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\ ( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \ -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/include/rpc_misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/rpc_misc.h') diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 53073c85be..3a3c61ecec 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -24,7 +24,7 @@ #define _RPC_MISC_H #define SMB_RPC_INTERFACE_VERSION 1 -#define PRS_POINTER_CAST BOOL (*)(const char*, prs_struct*, int, void*) +#define PRS_POINTER_CAST bool (*)(const char*, prs_struct*, int, void*) enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3, UNI_STR_DBLTERMINATE = 4 }; -- cgit