From 5733f731a911478492315af288c1a674ec038452 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 13 Oct 2003 21:26:10 +0000 Subject: So here it is a non-intrusive patch with my latest work on gums (the laternative to the current passdb). Currently it is run through a comatibility module in the passdb layer, with a subset of the functionality it may provide. It is still work in progress, but as someone asked me about it, and as it should make no difference to the normal code, I tought it was a good idea to put it into. It adds a dependency on perl. I know it is not very nice, but I'm sure we will work out a solution for that. As always blame me if I break something, but try to fix yourself, as I am busy-busy-busy :-) Simo. (This used to be commit 7b3c94b5cfc1a9ceb430613353a937345f2eda74) --- source3/include/genparser_samba.h | 5 ++ source3/include/gums.h | 172 +++++++++++++++++++++----------------- source3/include/includes.h | 4 + source3/include/passdb.h | 77 +++++++++++++++-- source3/include/tdbsam2.h | 107 ++++++++++++++++++------ 5 files changed, 256 insertions(+), 109 deletions(-) (limited to 'source3/include') diff --git a/source3/include/genparser_samba.h b/source3/include/genparser_samba.h index 172ff2362c..213d51da87 100644 --- a/source3/include/genparser_samba.h +++ b/source3/include/genparser_samba.h @@ -55,4 +55,9 @@ const struct parse_struct pinfo_luid_attr_info[] = { {"luid", 1, sizeof(LUID), offsetof(struct LUID_ATTR, luid), 0, NULL, 0, gen_dump_LUID, gen_parse_LUID}, {NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; +const struct parse_struct pinfo_data_blob_info[] = { +{"length", 0, sizeof(int), offsetof(DATA_BLOB, length), 0, NULL, 0, gen_dump_int, gen_parse_int}, +{"data", 1, sizeof(char), offsetof(DATA_BLOB, data), 0, "length", 0, gen_dump_char, gen_parse_char}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + #endif /* _GENPARSER_SAMBA_H */ diff --git a/source3/include/gums.h b/source3/include/gums.h index 789acc269f..9ce2ec4e56 100644 --- a/source3/include/gums.h +++ b/source3/include/gums.h @@ -24,14 +24,60 @@ #define GUMS_VERSION_MAJOR 0 #define GUMS_VERSION_MINOR 1 #define GUMS_OBJECT_VERSION 1 +#define GUMS_INTERFACE_VERSION 1 -#define GUMS_OBJ_DOMAIN 1 -#define GUMS_OBJ_NORMAL_USER 2 -#define GUMS_OBJ_GROUP 3 -#define GUMS_OBJ_ALIAS 4 -#define GUMS_OBJ_WORKSTATION_TRUST 5 -#define GUMS_OBJ_SERVER_TRUST 6 -#define GUMS_OBJ_DOMAIN_TRUST 7 +#define GUMS_OBJ_DOMAIN 0x10 +#define GUMS_OBJ_NORMAL_USER 0x20 +#define GUMS_OBJ_GROUP 0x30 +#define GUMS_OBJ_ALIAS 0x31 +#define GUMS_OBJ_PRIVILEGE 0x40 + +/* define value types */ +#define GUMS_SET_PRIMARY_GROUP 0x1 +#define GUMS_SET_SEC_DESC 0x2 + +#define GUMS_SET_NAME 0x10 +#define GUMS_SET_DESCRIPTION 0x11 +#define GUMS_SET_FULL_NAME 0x12 + +/* user specific type values */ +#define GUMS_SET_LOGON_TIME 0x20 +#define GUMS_SET_LOGOFF_TIME 0x21 +#define GUMS_SET_KICKOFF_TIME 0x23 +#define GUMS_SET_PASS_LAST_SET_TIME 0x24 +#define GUMS_SET_PASS_CAN_CHANGE_TIME 0x25 +#define GUMS_SET_PASS_MUST_CHANGE_TIME 0x26 + + +#define GUMS_SET_HOME_DIRECTORY 0x31 +#define GUMS_SET_DRIVE 0x32 +#define GUMS_SET_LOGON_SCRIPT 0x33 +#define GUMS_SET_PROFILE_PATH 0x34 +#define GUMS_SET_WORKSTATIONS 0x35 +#define GUMS_SET_UNKNOWN_STRING 0x36 +#define GUMS_SET_MUNGED_DIAL 0x37 + +#define GUMS_SET_LM_PASSWORD 0x40 +#define GUMS_SET_NT_PASSWORD 0x41 +#define GUMS_SET_PLAINTEXT_PASSWORD 0x42 +#define GUMS_SET_UNKNOWN_3 0x43 +#define GUMS_SET_LOGON_DIVS 0x44 +#define GUMS_SET_HOURS_LEN 0x45 +#define GUMS_SET_HOURS 0x46 +#define GUMS_SET_BAD_PASSWORD_COUNT 0x47 +#define GUMS_SET_LOGON_COUNT 0x48 +#define GUMS_SET_UNKNOWN_6 0x49 + +#define GUMS_SET_MUST_CHANGE_PASS 0x50 +#define GUMS_SET_CANNOT_CHANGE_PASS 0x51 +#define GUMS_SET_PASS_NEVER_EXPIRE 0x52 +#define GUMS_SET_ACCOUNT_DISABLED 0x53 +#define GUMS_SET_ACCOUNT_LOCKOUT 0x54 + +/*group specific type values */ +#define GUMS_ADD_SID_LIST 0x60 +#define GUMS_DEL_SID_LIST 0x61 +#define GUMS_SET_SID_LIST 0x62 typedef struct gums_user { @@ -52,17 +98,18 @@ typedef struct gums_user char *workstations; /* login from workstations string */ char *unknown_str; /* don't know what this is, yet. */ char *munged_dial; /* munged path name and dial-back tel number */ - + DATA_BLOB lm_pw; /* .data is Null if no password */ DATA_BLOB nt_pw; /* .data is Null if no password */ - - uint32 unknown_3; /* 0x00ff ffff */ - + + uint16 acct_ctrl; /* account type & status flags */ uint16 logon_divs; /* 168 - number of hours in a week */ uint32 hours_len; /* normally 21 bytes */ uint8 *hours; - - uint32 unknown_5; /* 0x0002 0000 */ + + uint16 bad_password_count; /* 0 */ + uint16 logon_count; /* 0 */ + uint32 unknown_3; /* 0x00ff ffff */ uint32 unknown_6; /* 0x0000 04ec */ } GUMS_USER; @@ -70,7 +117,7 @@ typedef struct gums_user typedef struct gums_group { uint32 count; /* Number of SIDs */ - DOM_SID **members; /* SID array */ + DOM_SID *members; /* SID array */ } GUMS_GROUP; @@ -80,10 +127,20 @@ typedef struct gums_domain } GUMS_DOMAIN; +typedef struct gums_privilege +{ + LUID_ATTR *privilege; /* Privilege Type */ + + uint32 count; + DOM_SID *members; + +} GUMS_PRIVILEGE; + union gums_obj_p { GUMS_USER *user; GUMS_GROUP *group; GUMS_DOMAIN *domain; + GUMS_PRIVILEGE *priv; }; typedef struct gums_object @@ -118,47 +175,47 @@ typedef struct gums_commit_set uint32 type; /* Object type */ DOM_SID sid; /* Object Sid */ uint32 count; /* number of changes */ - GUMS_DATA_SET **data; + GUMS_DATA_SET *data; } GUMS_COMMIT_SET; -typedef struct gums_privilege +typedef struct gums_priv_commit_set { TALLOC_CTX *mem_ctx; - uint32 type; /* Object Type */ - uint32 version; /* Object Version */ - uint32 seq_num; /* Object Sequence Number */ - - LUID_ATTR *privilege; /* Privilege Type */ - char *name; /* Object Name */ - char *description; /* Object Description */ + uint32 type; /* Object type */ + char *name; /* Object Sid */ + uint32 count; /* number of changes */ + GUMS_DATA_SET *data; - uint32 count; - DOM_SID **members; - -} GUMS_PRIVILEGE; +} GUMS_PRIV_COMMIT_SET; typedef struct gums_functions { + /* module data */ + TALLOC_CTX *mem_ctx; + char *name; + void *private_data; + void (*free_private_data)(void **); + /* Generic object functions */ - NTSTATUS (*get_domain_sid) (DOM_SID **sid, const char* name); + NTSTATUS (*get_domain_sid) (DOM_SID *sid, const char* name); NTSTATUS (*set_domain_sid) (const DOM_SID *sid); NTSTATUS (*get_sequence_number) (void); - NTSTATUS (*new_object) (DOM_SID **sid, const char *name, const int obj_type); + NTSTATUS (*new_object) (DOM_SID *sid, const char *name, const int obj_type); NTSTATUS (*delete_object) (const DOM_SID *sid); NTSTATUS (*get_object_from_sid) (GUMS_OBJECT **object, const DOM_SID *sid, const int obj_type); - NTSTATUS (*get_object_from_name) (GUMS_OBJECT **object, const char *name, const int onj_type); + NTSTATUS (*get_object_from_name) (GUMS_OBJECT **object, const char *name, const int obj_type); /* This function is used to get the list of all objects changed since b_time, it is used to support PDC<->BDC synchronization */ NTSTATUS (*get_updated_objects) (GUMS_OBJECT **objects, const NTTIME base_time); - NTSTATUS (*enumerate_objects_start) (void *handle, const DOM_SID *sid, const int obj_type); + NTSTATUS (*enumerate_objects_start) (void **handle, const DOM_SID *sid, const int obj_type); NTSTATUS (*enumerate_objects_get_next) (GUMS_OBJECT **object, void *handle); NTSTATUS (*enumerate_objects_stop) (void *handle); @@ -167,7 +224,7 @@ typedef struct gums_functions NTSTATUS (*set_object) (const GUMS_OBJECT *object); /* set object values function */ - NTSTATUS (*set_object_values) (DOM_SID *sid, uint32 count, GUMS_DATA_SET **data_set); + NTSTATUS (*set_object_values) (DOM_SID *sid, uint32 count, GUMS_DATA_SET *data_set); /* Group related functions */ NTSTATUS (*add_members_to_group) (const DOM_SID *group, const DOM_SID **members); @@ -191,50 +248,15 @@ typedef struct gums_functions } GUMS_FUNCTIONS; -/* define value types */ -#define GUMS_SET_PRIMARY_GROUP 0x1 -#define GUMS_SET_SEC_DESC 0x2 - -#define GUMS_SET_NAME 0x10 -#define GUMS_SET_DESCRIPTION 0x11 -#define GUMS_SET_FULL_NAME 0x12 +typedef NTSTATUS (*gums_init_function)( + struct gums_functions *, + const char *); -/* user specific type values */ -#define GUMS_SET_LOGON_TIME 0x20 -#define GUMS_SET_LOGOFF_TIME 0x21 -#define GUMS_SET_KICKOFF_TIME 0x23 -#define GUMS_SET_PASS_LAST_SET_TIME 0x24 -#define GUMS_SET_PASS_CAN_CHANGE_TIME 0x25 -#define GUMS_SET_PASS_MUST_CHANGE_TIME 0x26 +struct gums_init_function_entry { - -#define GUMS_SET_HOME_DIRECTORY 0x31 -#define GUMS_SET_DRIVE 0x32 -#define GUMS_SET_LOGON_SCRIPT 0x33 -#define GUMS_SET_PROFILE_PATH 0x34 -#define GUMS_SET_WORKSTATIONS 0x35 -#define GUMS_SET_UNKNOWN_STRING 0x36 -#define GUMS_SET_MUNGED_DIAL 0x37 - -#define GUMS_SET_LM_PASSWORD 0x40 -#define GUMS_SET_NT_PASSWORD 0x41 -#define GUMS_SET_PLAINTEXT_PASSWORD 0x42 -#define GUMS_SET_UNKNOWN_3 0x43 -#define GUMS_SET_LOGON_DIVS 0x44 -#define GUMS_SET_HOURS_LEN 0x45 -#define GUMS_SET_HOURS 0x46 -#define GUMS_SET_UNKNOWN_5 0x47 -#define GUMS_SET_UNKNOWN_6 0x48 - -#define GUMS_SET_MUST_CHANGE_PASS 0x50 -#define GUMS_SET_CANNOT_CHANGE_PASS 0x51 -#define GUMS_SET_PASS_NEVER_EXPIRE 0x52 -#define GUMS_SET_ACCOUNT_DISABLED 0x53 -#define GUMS_SET_ACCOUNT_LOCKOUT 0x54 - -/*group specific type values */ -#define GUMS_ADD_SID_LIST 0x60 -#define GUMS_DEL_SID_LIST 0x61 -#define GUMS_SET_SID_LIST 0x62 + const char *name; + gums_init_function init_fn; + struct gums_init_function_entry *prev, *next; +}; #endif /* _GUMS_H */ diff --git a/source3/include/includes.h b/source3/include/includes.h index 29bb53980f..452b489547 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -806,6 +806,10 @@ extern int errno; #include "rpc_secdes.h" +#include "genparser.h" + +#include "gums.h" + #include "nt_printing.h" #include "msdfs.h" diff --git a/source3/include/passdb.h b/source3/include/passdb.h index a4b2bcff3f..cd9c57a991 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -177,6 +177,15 @@ typedef struct sam_group { } SAM_GROUP; +typedef struct _GROUP_INFO { + struct pdb_methods *methods; + DOM_SID sid; + enum SID_NAME_USE sid_name_use; + fstring nt_name; + fstring comment; +} GROUP_INFO; + + /***************************************************************** Functions to be implemented by the new (v2) passdb API ****************************************************************/ @@ -192,26 +201,28 @@ typedef struct pdb_context { struct pdb_methods *pdb_methods; struct pdb_methods *pwent_methods; - + /* These functions are wrappers for the functions listed above. They may do extra things like re-reading a SAM_ACCOUNT on update */ NTSTATUS (*pdb_setsampwent)(struct pdb_context *, BOOL update); - + void (*pdb_endsampwent)(struct pdb_context *); - + NTSTATUS (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user); - + NTSTATUS (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); - + NTSTATUS (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); NTSTATUS (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); - + NTSTATUS (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); - + NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + /* group mapping functions: to be removed */ + NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, DOM_SID sid); NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, gid_t gid); @@ -232,6 +243,30 @@ typedef struct pdb_context GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + /* group functions */ + + NTSTATUS (*pdb_get_group_info_by_sid)(struct pdb_context *context, GROUP_INFO *info, const DOM_SID *group); + + NTSTATUS (*pdb_get_group_list)(struct pdb_context *context, GROUP_INFO **info, const enum SID_NAME_USE sid_name_use, int *num_groups); + + NTSTATUS (*pdb_get_group_sids)(struct pdb_context *context, const DOM_SID *group, DOM_SID **members, int *num_members); + + NTSTATUS (*pdb_add_group)(struct pdb_context *context, const SAM_GROUP *group); + + NTSTATUS (*pdb_update_group)(struct pdb_context *context, const SAM_GROUP *group); + + NTSTATUS (*pdb_delete_group)(struct pdb_context *context, const DOM_SID *group); + + NTSTATUS (*pdb_add_sid_to_group)(struct pdb_context *context, const DOM_SID *group, const DOM_SID *member); + + NTSTATUS (*pdb_remove_sid_from_group)(struct pdb_context *context, const DOM_SID *group, const DOM_SID *member); + + NTSTATUS (*pdb_get_group_info_by_name)(struct pdb_context *context, GROUP_INFO *info, const char *name); + + NTSTATUS (*pdb_get_group_info_by_nt_name)(struct pdb_context *context, GROUP_INFO *info, const char *nt_name); + + NTSTATUS (*pdb_get_group_uids)(struct pdb_context *context, const DOM_SID *group, uid_t **members, int *num_members); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -262,7 +297,9 @@ typedef struct pdb_methods NTSTATUS (*update_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); - + + /* group mapping functions: to be removed */ + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); @@ -283,6 +320,30 @@ typedef struct pdb_methods GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + /* group functions */ + + NTSTATUS (*get_group_info_by_sid)(struct pdb_methods *methods, GROUP_INFO *info, const DOM_SID *group); + + NTSTATUS (*get_group_list)(struct pdb_methods *methods, GROUP_INFO **info, const enum SID_NAME_USE sid_name_use, int *num_groups); + + NTSTATUS (*get_group_sids)(struct pdb_methods *methods, const DOM_SID *group, DOM_SID **members, int *num_members); + + NTSTATUS (*add_group)(struct pdb_methods *methods, const SAM_GROUP *group); + + NTSTATUS (*update_group)(struct pdb_methods *methods, const SAM_GROUP *group); + + NTSTATUS (*delete_group)(struct pdb_methods *methods, const DOM_SID *group); + + NTSTATUS (*add_sid_to_group)(struct pdb_methods *methods, const DOM_SID *group, const DOM_SID *member); + + NTSTATUS (*remove_sid_from_group)(struct pdb_methods *methods, const DOM_SID *group, const DOM_SID *member); + + NTSTATUS (*get_group_info_by_name)(struct pdb_methods *methods, GROUP_INFO *info, const char *name); + + NTSTATUS (*get_group_info_by_nt_name)(struct pdb_methods *methods, GROUP_INFO *info, const char *nt_name); + + NTSTATUS (*get_group_uids)(struct pdb_methods *methods, const DOM_SID *group, uid_t **members, int *num_members); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); diff --git a/source3/include/tdbsam2.h b/source3/include/tdbsam2.h index 047b4e7c90..b99e16586b 100644 --- a/source3/include/tdbsam2.h +++ b/source3/include/tdbsam2.h @@ -20,33 +20,46 @@ /* ALL strings assumes UTF8 as encoding */ -GENSTRUCT struct tdbsam2_domain_data { - uint32 xcounter; /* counter to be updated at any change */ +#ifndef TDBSAM2_H +#define TDBSAM2_H - SEC_DESC *sec_desc; /* Security Descriptor */ - DOM_SID *dom_sid; /* The Domain SID */ - char *name; _NULLTERM /* NT Domain Name */ - char *description; _NULLTERM /* Descritpion (Gecos) */ +/* IMPORTANT: these structures must follow closely the GUMS_OBJECTs + * structures as they will be casted over !! + * the GUMS_OBJECT union is unrolled here into four tdbsam2 + * objects cause genstruct is not able to follow arbitrary unions */ +GENSTRUCT struct domain_sub_structure +{ uint32 next_rid; /* The Next free RID */ }; -GENSTRUCT struct tdbsam2_user_data { +GENSTRUCT struct tdbsam2_domain_data +{ + TALLOC_CTX *mem_ctx; + + uint32 type; + uint32 version; uint32 xcounter; /* counter to be updated at any change */ SEC_DESC *sec_desc; /* Security Descriptor */ - DOM_SID *user_sid; /* The User SID */ - char *name; _NULLTERM /* NT User Name */ + + DOM_SID *dom_sid; /* The Domain SID */ + char *name; _NULLTERM /* NT Domain Name */ char *description; _NULLTERM /* Descritpion (Gecos) */ + struct domain_sub_structure *dss; +}; + +GENSTRUCT struct user_sub_structure +{ DOM_SID *group_sid; /* The Primary Group SID */ - NTTIME *logon_time; - NTTIME *logoff_time; - NTTIME *kickoff_time; - NTTIME *pass_last_set_time; - NTTIME *pass_can_change_time; - NTTIME *pass_must_change_time; + NTTIME logon_time; + NTTIME logoff_time; + NTTIME kickoff_time; + NTTIME pass_last_set_time; + NTTIME pass_can_change_time; + NTTIME pass_must_change_time; char *full_name; _NULLTERM /* The Full Name */ char *home_dir; _NULLTERM /* Home Directory */ @@ -57,39 +70,81 @@ GENSTRUCT struct tdbsam2_user_data { char *unknown_str; _NULLTERM /* Guess ... Unknown */ char *munged_dial; _NULLTERM /* Callback Number */ - /* passwords are 16 byte leght, pointer is null if no password */ - uint8 *lm_pw_ptr; _LEN(16) /* Lanman hashed password */ - uint8 *nt_pw_ptr; _LEN(16) /* NT hashed password */ + DATA_BLOB lm_pw; /* .data is Null if no password */ + DATA_BLOB nt_pw; /* .data is Null if no password */ + uint16 acct_ctrl; /* account flags */ uint16 logon_divs; /* 168 - num of hours in a week */ uint32 hours_len; /* normally 21 */ uint8 *hours; _LEN(hours_len) /* normally 21 bytes (depends on hours_len) */ + uint16 bad_password_count; /* 0 */ + uint16 logon_count; /* 0 */ uint32 unknown_3; /* 0x00ff ffff */ - uint32 unknown_5; /* 0x0002 0000 */ uint32 unknown_6; /* 0x0000 04ec */ }; -GENSTRUCT struct tdbsam2_group_data { +GENSTRUCT struct tdbsam2_user_data +{ + TALLOC_CTX *mem_ctx; + + uint32 type; + uint32 version; uint32 xcounter; /* counter to be updated at any change */ SEC_DESC *sec_desc; /* Security Descriptor */ + + DOM_SID *user_sid; /* The User SID */ + char *name; _NULLTERM /* NT User Name */ + char *description; _NULLTERM /* Descritpion (Gecos) */ + + struct user_sub_structure *uss; +}; + +GENSTRUCT struct group_sub_structure +{ + uint32 count; /* number of sids */ + DOM_SID *members; _LEN(count) /* SID array */ +}; + +GENSTRUCT struct tdbsam2_group_data +{ + TALLOC_CTX *mem_ctx; + + uint32 type; + uint32 version; + uint32 xcounter; /* counter to be updated at any change */ + + SEC_DESC *sec_desc; /* Security Descriptor */ + DOM_SID *group_sid; /* The Group SID */ char *name; _NULLTERM /* NT Group Name */ char *description; _NULLTERM /* Descritpion (Gecos) */ + struct group_sub_structure *gss; +}; + +GENSTRUCT struct priv_sub_structure +{ + LUID_ATTR *privilege; /* Privilege */ + uint32 count; /* number of sids */ - DOM_SID **members; _LEN(count) /* SID array */ + DOM_SID *members; _LEN(count) /* SID array */ }; -GENSTRUCT struct tdbsam2_privilege_data { +GENSTRUCT struct tdbsam2_priv_data +{ + TALLOC_CTX *mem_ctx; + + uint32 type; + uint32 version; uint32 xcounter; /* counter to be updated at any change */ - LUID_ATTR *privilege; /* Privilege */ - char *name; _NULLTERM /* NT User Name */ + DOM_SID *null_sid; + char *name; _NULLTERM /* Privilege Name */ char *description; _NULLTERM /* Descritpion (Gecos) */ - uint32 count; /* number of sids */ - DOM_SID **members; _LEN(count) /* SID array */ + struct priv_sub_structure *pss; }; +#endif /* TDBSAM2_H */ -- cgit From cd5245fbb9f800dae7c5f705d8f34f86ff7f2ff1 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 14 Oct 2003 02:55:13 +0000 Subject: Ignore autogenerated tdbsam2_parse_info.h (This used to be commit bb2b8906a05109d5ba8ffff6c250d90d8658d444) --- source3/include/.cvsignore | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/.cvsignore b/source3/include/.cvsignore index 7dff121f14..6f72267aaa 100644 --- a/source3/include/.cvsignore +++ b/source3/include/.cvsignore @@ -1,7 +1,8 @@ build_env.h config.h -stamp-h -proto.h -wrepld_proto.h config.h.in +proto.h +stamp-h +tdbsam2_parse_info.h version.h +wrepld_proto.h -- cgit From 4162ac5972cd5735e4184fdf7f4142801b7eb54c Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 14 Oct 2003 07:43:41 +0000 Subject: sorry folks, forgot to cvs add/remove before commit. (This used to be commit 0ed85e6a2dff0953dbbd5ff4723ef6941ec32850) --- source3/include/tdbsam2_parse_info.h | 164 +++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 source3/include/tdbsam2_parse_info.h (limited to 'source3/include') diff --git a/source3/include/tdbsam2_parse_info.h b/source3/include/tdbsam2_parse_info.h new file mode 100644 index 0000000000..f1b2936c47 --- /dev/null +++ b/source3/include/tdbsam2_parse_info.h @@ -0,0 +1,164 @@ +/* This is an automatically generated file - DO NOT EDIT! */ + +int gen_dump_struct_domain_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_domain_sub_structure(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_domain_sub_structure[] = { +{"next_rid", 0, sizeof(uint32), offsetof(struct domain_sub_structure, next_rid), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_domain_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_domain_sub_structure, p, ptr, indent); +} +int gen_parse_struct_domain_sub_structure(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_domain_sub_structure, ptr, str); +} + +int gen_dump_struct_tdbsam2_domain_data(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_tdbsam2_domain_data(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_tdbsam2_domain_data[] = { +{"mem_ctx", 1, sizeof(TALLOC_CTX), offsetof(struct tdbsam2_domain_data, mem_ctx), 0, NULL, 0, gen_dump_TALLOC_CTX, gen_parse_TALLOC_CTX}, +{"type", 0, sizeof(uint32), offsetof(struct tdbsam2_domain_data, type), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"version", 0, sizeof(uint32), offsetof(struct tdbsam2_domain_data, version), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"xcounter", 0, sizeof(uint32), offsetof(struct tdbsam2_domain_data, xcounter), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"sec_desc", 1, sizeof(SEC_DESC), offsetof(struct tdbsam2_domain_data, sec_desc), 0, NULL, 0, gen_dump_SEC_DESC, gen_parse_SEC_DESC}, +{"dom_sid", 1, sizeof(DOM_SID), offsetof(struct tdbsam2_domain_data, dom_sid), 0, NULL, 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, +{"name", 1, sizeof(char), offsetof(struct tdbsam2_domain_data, name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"description", 1, sizeof(char), offsetof(struct tdbsam2_domain_data, description), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"dss", 1, sizeof(struct domain_sub_structure), offsetof(struct tdbsam2_domain_data, dss), 0, NULL, 0, gen_dump_struct_domain_sub_structure, gen_parse_struct_domain_sub_structure}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_tdbsam2_domain_data(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_tdbsam2_domain_data, p, ptr, indent); +} +int gen_parse_struct_tdbsam2_domain_data(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_tdbsam2_domain_data, ptr, str); +} + +int gen_dump_struct_user_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_user_sub_structure(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_user_sub_structure[] = { +{"group_sid", 1, sizeof(DOM_SID), offsetof(struct user_sub_structure, group_sid), 0, NULL, 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, +{"logon_time", 0, sizeof(NTTIME), offsetof(struct user_sub_structure, logon_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, +{"logoff_time", 0, sizeof(NTTIME), offsetof(struct user_sub_structure, logoff_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, +{"kickoff_time", 0, sizeof(NTTIME), offsetof(struct user_sub_structure, kickoff_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, +{"pass_last_set_time", 0, sizeof(NTTIME), offsetof(struct user_sub_structure, pass_last_set_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, +{"pass_can_change_time", 0, sizeof(NTTIME), offsetof(struct user_sub_structure, pass_can_change_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, +{"pass_must_change_time", 0, sizeof(NTTIME), offsetof(struct user_sub_structure, pass_must_change_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, +{"full_name", 1, sizeof(char), offsetof(struct user_sub_structure, full_name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"home_dir", 1, sizeof(char), offsetof(struct user_sub_structure, home_dir), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"dir_drive", 1, sizeof(char), offsetof(struct user_sub_structure, dir_drive), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"logon_script", 1, sizeof(char), offsetof(struct user_sub_structure, logon_script), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"profile_path", 1, sizeof(char), offsetof(struct user_sub_structure, profile_path), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"workstations", 1, sizeof(char), offsetof(struct user_sub_structure, workstations), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"unknown_str", 1, sizeof(char), offsetof(struct user_sub_structure, unknown_str), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"munged_dial", 1, sizeof(char), offsetof(struct user_sub_structure, munged_dial), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"lm_pw", 0, sizeof(DATA_BLOB), offsetof(struct user_sub_structure, lm_pw), 0, NULL, 0, gen_dump_DATA_BLOB, gen_parse_DATA_BLOB}, +{"nt_pw", 0, sizeof(DATA_BLOB), offsetof(struct user_sub_structure, nt_pw), 0, NULL, 0, gen_dump_DATA_BLOB, gen_parse_DATA_BLOB}, +{"acct_ctrl", 0, sizeof(uint16), offsetof(struct user_sub_structure, acct_ctrl), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, +{"logon_divs", 0, sizeof(uint16), offsetof(struct user_sub_structure, logon_divs), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, +{"hours_len", 0, sizeof(uint32), offsetof(struct user_sub_structure, hours_len), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"hours", 1, sizeof(uint8), offsetof(struct user_sub_structure, hours), 0, "hours_len", 0, gen_dump_uint8, gen_parse_uint8}, +{"bad_password_count", 0, sizeof(uint16), offsetof(struct user_sub_structure, bad_password_count), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, +{"logon_count", 0, sizeof(uint16), offsetof(struct user_sub_structure, logon_count), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, +{"unknown_3", 0, sizeof(uint32), offsetof(struct user_sub_structure, unknown_3), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"unknown_6", 0, sizeof(uint32), offsetof(struct user_sub_structure, unknown_6), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_user_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_user_sub_structure, p, ptr, indent); +} +int gen_parse_struct_user_sub_structure(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_user_sub_structure, ptr, str); +} + +int gen_dump_struct_tdbsam2_user_data(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_tdbsam2_user_data(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_tdbsam2_user_data[] = { +{"mem_ctx", 1, sizeof(TALLOC_CTX), offsetof(struct tdbsam2_user_data, mem_ctx), 0, NULL, 0, gen_dump_TALLOC_CTX, gen_parse_TALLOC_CTX}, +{"type", 0, sizeof(uint32), offsetof(struct tdbsam2_user_data, type), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"version", 0, sizeof(uint32), offsetof(struct tdbsam2_user_data, version), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"xcounter", 0, sizeof(uint32), offsetof(struct tdbsam2_user_data, xcounter), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"sec_desc", 1, sizeof(SEC_DESC), offsetof(struct tdbsam2_user_data, sec_desc), 0, NULL, 0, gen_dump_SEC_DESC, gen_parse_SEC_DESC}, +{"user_sid", 1, sizeof(DOM_SID), offsetof(struct tdbsam2_user_data, user_sid), 0, NULL, 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, +{"name", 1, sizeof(char), offsetof(struct tdbsam2_user_data, name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"description", 1, sizeof(char), offsetof(struct tdbsam2_user_data, description), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"uss", 1, sizeof(struct user_sub_structure), offsetof(struct tdbsam2_user_data, uss), 0, NULL, 0, gen_dump_struct_user_sub_structure, gen_parse_struct_user_sub_structure}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_tdbsam2_user_data(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_tdbsam2_user_data, p, ptr, indent); +} +int gen_parse_struct_tdbsam2_user_data(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_tdbsam2_user_data, ptr, str); +} + +int gen_dump_struct_group_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_group_sub_structure(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_group_sub_structure[] = { +{"count", 0, sizeof(uint32), offsetof(struct group_sub_structure, count), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"members", 1, sizeof(DOM_SID), offsetof(struct group_sub_structure, members), 0, "count", 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_group_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_group_sub_structure, p, ptr, indent); +} +int gen_parse_struct_group_sub_structure(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_group_sub_structure, ptr, str); +} + +int gen_dump_struct_tdbsam2_group_data(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_tdbsam2_group_data(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_tdbsam2_group_data[] = { +{"mem_ctx", 1, sizeof(TALLOC_CTX), offsetof(struct tdbsam2_group_data, mem_ctx), 0, NULL, 0, gen_dump_TALLOC_CTX, gen_parse_TALLOC_CTX}, +{"type", 0, sizeof(uint32), offsetof(struct tdbsam2_group_data, type), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"version", 0, sizeof(uint32), offsetof(struct tdbsam2_group_data, version), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"xcounter", 0, sizeof(uint32), offsetof(struct tdbsam2_group_data, xcounter), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"sec_desc", 1, sizeof(SEC_DESC), offsetof(struct tdbsam2_group_data, sec_desc), 0, NULL, 0, gen_dump_SEC_DESC, gen_parse_SEC_DESC}, +{"group_sid", 1, sizeof(DOM_SID), offsetof(struct tdbsam2_group_data, group_sid), 0, NULL, 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, +{"name", 1, sizeof(char), offsetof(struct tdbsam2_group_data, name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"description", 1, sizeof(char), offsetof(struct tdbsam2_group_data, description), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"gss", 1, sizeof(struct group_sub_structure), offsetof(struct tdbsam2_group_data, gss), 0, NULL, 0, gen_dump_struct_group_sub_structure, gen_parse_struct_group_sub_structure}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_tdbsam2_group_data(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_tdbsam2_group_data, p, ptr, indent); +} +int gen_parse_struct_tdbsam2_group_data(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_tdbsam2_group_data, ptr, str); +} + +int gen_dump_struct_priv_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_priv_sub_structure(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_priv_sub_structure[] = { +{"privilege", 1, sizeof(LUID_ATTR), offsetof(struct priv_sub_structure, privilege), 0, NULL, 0, gen_dump_LUID_ATTR, gen_parse_LUID_ATTR}, +{"count", 0, sizeof(uint32), offsetof(struct priv_sub_structure, count), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"members", 1, sizeof(DOM_SID), offsetof(struct priv_sub_structure, members), 0, "count", 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_priv_sub_structure(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_priv_sub_structure, p, ptr, indent); +} +int gen_parse_struct_priv_sub_structure(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_priv_sub_structure, ptr, str); +} + +int gen_dump_struct_tdbsam2_priv_data(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); +int gen_parse_struct_tdbsam2_priv_data(TALLOC_CTX *mem_ctx, char *, const char *); +static const struct parse_struct pinfo_tdbsam2_priv_data[] = { +{"mem_ctx", 1, sizeof(TALLOC_CTX), offsetof(struct tdbsam2_priv_data, mem_ctx), 0, NULL, 0, gen_dump_TALLOC_CTX, gen_parse_TALLOC_CTX}, +{"type", 0, sizeof(uint32), offsetof(struct tdbsam2_priv_data, type), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"version", 0, sizeof(uint32), offsetof(struct tdbsam2_priv_data, version), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"xcounter", 0, sizeof(uint32), offsetof(struct tdbsam2_priv_data, xcounter), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, +{"null_sid", 1, sizeof(DOM_SID), offsetof(struct tdbsam2_priv_data, null_sid), 0, NULL, 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, +{"name", 1, sizeof(char), offsetof(struct tdbsam2_priv_data, name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"description", 1, sizeof(char), offsetof(struct tdbsam2_priv_data, description), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, +{"pss", 1, sizeof(struct priv_sub_structure), offsetof(struct tdbsam2_priv_data, pss), 0, NULL, 0, gen_dump_struct_priv_sub_structure, gen_parse_struct_priv_sub_structure}, +{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; + +int gen_dump_struct_tdbsam2_priv_data(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { + return gen_dump_struct(mem_ctx, pinfo_tdbsam2_priv_data, p, ptr, indent); +} +int gen_parse_struct_tdbsam2_priv_data(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { + return gen_parse_struct(mem_ctx, pinfo_tdbsam2_priv_data, ptr, str); +} + -- cgit From 311d739eb761e8a90777e20fd545a00965393eb4 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 15 Oct 2003 17:41:25 +0000 Subject: created a new target: genparse this target will build parse file with genstruct it is the duty of the developer to commit updated files this is made to make build platforms independent of a working perl installation as always been with samba so currently you need to run: make genparse and commit: cvs ci include/tdbsam2_parse_info.h if you change anything in genparse/genstruct code or tdbsam2 code. Simo. (This used to be commit 7e2d5da2dcfad32b733c28535490e98e578bcc3a) --- source3/include/.cvsignore | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/.cvsignore b/source3/include/.cvsignore index 6f72267aaa..3827fdf70d 100644 --- a/source3/include/.cvsignore +++ b/source3/include/.cvsignore @@ -3,6 +3,5 @@ config.h config.h.in proto.h stamp-h -tdbsam2_parse_info.h version.h wrepld_proto.h -- cgit From 6b5f7e70d727d927fd8537cd4fce29f9154be088 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 17 Oct 2003 15:02:38 +0000 Subject: Add endpoint mapper rpc definitions (This used to be commit e604a9c0788a006663e7f939059c4120c1df3648) --- source3/include/rpc_epmapper.h | 115 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 source3/include/rpc_epmapper.h (limited to 'source3/include') diff --git a/source3/include/rpc_epmapper.h b/source3/include/rpc_epmapper.h new file mode 100644 index 0000000000..57ac8e2522 --- /dev/null +++ b/source3/include/rpc_epmapper.h @@ -0,0 +1,115 @@ +/* + Unix SMB/CIFS implementation. + Endpoint mapper data definitions + Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003 + + 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. +*/ + +#define EPM_HANDLE_LEN 20 + +/* ordinal for the mapping interface */ + +#define EPM_MAP_PIPE_NAME 0x03 + +/* some of the different connection protocols and their IDs from Windows */ + +#define EPM_FLOOR_UUID 0x0d /* floor contains UUID */ +#define EPM_FLOOR_RPC 0x0b /* tower is for connection-oriented rpc */ +#define EPM_FLOOR_TCP 0x07 /* floor contains tcp port number */ +#define EPM_FLOOR_IP 0x09 /* floor contains IP address */ +#define EPM_FLOOR_NMPIPES 0x10 /* floor contains remote named pipe name */ +#define EPM_FLOOR_NETBIOS 0x11 /* floor contains netbios address */ +#define EPM_FLOOR_NETBEUI 0x12 /* floor contains netbeui address */ +#define EPM_FLOOR_SOCKET 0x20 + +#define EPM_PIPE_NM "epmapper" + +#define MAX_TOWERS 1 + +typedef struct +{ + uint8 data[EPM_HANDLE_LEN]; +} EPM_HANDLE; + +typedef struct +{ + struct { + uint16 length; + uint8 protocol; + struct { + RPC_UUID uuid; + uint16 version; + } uuid; + } lhs; + struct { + uint16 length; + uint16 unknown; + struct { + uint16 port; + } tcp; + struct { + uint8 addr[4]; + } ip; + } rhs; +} EPM_FLOOR; + +typedef struct +{ + uint32 referent_id; + uint32 max_length; + uint32 length; + uint16 num_floors; + EPM_FLOOR *floors; + uint8 unknown; +} EPM_TOWER; + +typedef struct +{ + EPM_HANDLE handle; + EPM_TOWER *tower; + EPM_HANDLE term_handle; /* in/out */ + uint32 max_towers; +} EPM_Q_MAP; + +typedef struct +{ + uint32 max_count; + uint32 offset; + uint32 count; + EPM_TOWER *towers; +} EPM_TOWER_ARRAY; + +typedef struct +{ + EPM_HANDLE handle; + uint32 num_results; + EPM_TOWER_ARRAY *results; + uint32 status; +} EPM_R_MAP; + + +/* port mapping entries to be read */ + +typedef struct _mapper_entries{ + uint8 protocol ; + RPC_IFACE uuid_info ; /* needs to be zeroed if no specific uuid */ + uint16 port ; + char pipe_name[40] ; + char srv_name[20] ; + uint8 srv_port[4] ; + char func_name[16][16]; /* array of up to 16 functions available */ +} mapper_entries; + -- cgit From d807bc12fb1d208de9b4f9e2532810cf1a9e3695 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 17 Oct 2003 15:07:23 +0000 Subject: Add epmapper pipe (This used to be commit 041c17bd665ea5fa771b111d7008036fb3e7b72f) --- source3/include/ntdomain.h | 1 + source3/include/smb.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index ccbc190c59..66057424ca 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -402,5 +402,6 @@ struct acct_info #include "rpc_dfs.h" #include "rpc_ds.h" #include "rpc_echo.h" +#include "rpc_epmapper.h" #endif /* _NT_DOMAIN_H */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 8c6f47f23f..1e4c48132a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -194,6 +194,7 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN]; #define PIPE_SPOOLSS "\\PIPE\\spoolss" #define PIPE_NETDFS "\\PIPE\\netdfs" #define PIPE_ECHO "\\PIPE\\rpcecho" +#define PIPE_EPM "\\PIPE\\epmapper" #define PIPE_NETLOGON_PLAIN "\\NETLOGON" @@ -207,7 +208,8 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN]; #define PI_SPOOLSS 7 #define PI_NETDFS 8 #define PI_ECHO 9 -#define PI_MAX_PIPES 10 +#define PI_EPM 10 +#define PI_MAX_PIPES 11 /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef struct nttime_info -- cgit From bfcb776abd1ead323963912efef2641e0bc41a03 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 20 Oct 2003 16:50:14 +0000 Subject: more 2.2.x compatibility fixes - allow user looksup in the kerb5 sesssetup to fall back to 'user' instaed of failing is REA.LM\user doesn't exist. also fix include line in smb_acls.h as requested by metze (This used to be commit 5ccf6baad7ffb1f992aaf24b41ef5c83362cf613) --- source3/include/smb_acls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_acls.h b/source3/include/smb_acls.h index e7edb62bde..2bde6caeda 100644 --- a/source3/include/smb_acls.h +++ b/source3/include/smb_acls.h @@ -195,7 +195,7 @@ typedef struct SMB_ACL_T { /* Donated by Medha Date, mdate@austin.ibm.com, for IBM */ -#include "/usr/include/acl.h" +#include typedef uint *SMB_ACL_PERMSET_T; -- cgit From 2cfb3e9b7046fe2db330a292aed71f1c27688a16 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Mon, 20 Oct 2003 18:35:12 +0000 Subject: Several updates: - add support for named pipe and netbios queries in parse code - fix map request structure...unknown byte was alignment - add sample of named pipe over netbios query in rpcclient (comment only) (This used to be commit 71dcdf54e60204d6b499d25d8759ed20fc7a021a) --- source3/include/rpc_epmapper.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/rpc_epmapper.h b/source3/include/rpc_epmapper.h index 57ac8e2522..1b5b6b1876 100644 --- a/source3/include/rpc_epmapper.h +++ b/source3/include/rpc_epmapper.h @@ -30,7 +30,8 @@ #define EPM_FLOOR_RPC 0x0b /* tower is for connection-oriented rpc */ #define EPM_FLOOR_TCP 0x07 /* floor contains tcp port number */ #define EPM_FLOOR_IP 0x09 /* floor contains IP address */ -#define EPM_FLOOR_NMPIPES 0x10 /* floor contains remote named pipe name */ +#define EPM_FLOOR_NMPIPES 0x0f /* floor contains remote named pipe name */ +#define EPM_FLOOR_LRPC 0x10 /* floor contains local named pipe name */ #define EPM_FLOOR_NETBIOS 0x11 /* floor contains netbios address */ #define EPM_FLOOR_NETBEUI 0x12 /* floor contains netbeui address */ #define EPM_FLOOR_SOCKET 0x20 @@ -63,6 +64,7 @@ typedef struct struct { uint8 addr[4]; } ip; + char string[MAXHOSTNAMELEN+3]; /* hostname + \\ + null term */ } rhs; } EPM_FLOOR; -- cgit From 6fe9423fc69f3c1a79d0e45ac47d0b3228e4d4d6 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Mon, 20 Oct 2003 21:10:18 +0000 Subject: Update structures after ethereal showed some marshalling/unmarshalling errors. (This used to be commit 9d0f322a851f487cea320e57076213435e5c6481) --- source3/include/rpc_epmapper.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_epmapper.h b/source3/include/rpc_epmapper.h index 1b5b6b1876..de3a2cb08d 100644 --- a/source3/include/rpc_epmapper.h +++ b/source3/include/rpc_epmapper.h @@ -70,7 +70,6 @@ typedef struct typedef struct { - uint32 referent_id; uint32 max_length; uint32 length; uint16 num_floors; @@ -80,7 +79,8 @@ typedef struct typedef struct { - EPM_HANDLE handle; + EPM_HANDLE handle; + uint32 tower_ref_id; EPM_TOWER *tower; EPM_HANDLE term_handle; /* in/out */ uint32 max_towers; @@ -91,6 +91,7 @@ typedef struct uint32 max_count; uint32 offset; uint32 count; + uint32 *tower_ref_ids; EPM_TOWER *towers; } EPM_TOWER_ARRAY; -- cgit From 87a6e23fcc9bffdb9947aa4d9ff8469eabdadb30 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 21 Oct 2003 04:46:23 +0000 Subject: Merge of mmap blacklist fix from HEAD. (This used to be commit ff29be16e74361b02b0b7fbd83e393d68ae5b897) --- source3/include/includes.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 452b489547..fba2eabbe1 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1319,4 +1319,11 @@ BOOL get_krb5_smb_session_key(krb5_context context, krb5_auth_context auth_conte #endif #define FALSE __ERROR__XX__DONT_USE_FALSE +/* If we have blacklisted mmap() try to avoid using it accidentally by + undefining the HAVE_MMAP symbol. */ + +#ifdef MMAP_BLACKLIST +#undef HAVE_MMAP +#endif + #endif /* _INCLUDES_H */ -- cgit From 2710c35e549bb7775a8efe3265b105e594ad26ba Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Oct 2003 23:38:18 +0000 Subject: Put strcasecmp/strncasecmp on the banned list (except for needed calls in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at all and I really want to discourage that. Jeremy. (This used to be commit 5c050a735f86927c7ef2a98b6f3a56abe39e4674) --- source3/include/safe_string.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/include') diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h index 07578b2424..cb3f37c484 100644 --- a/source3/include/safe_string.h +++ b/source3/include/safe_string.h @@ -47,6 +47,20 @@ #endif /* sprintf */ #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__; +/* + * strcasecmp/strncasecmp aren't an error, but it means you're not thinking about + * multibyte. Don't use them. JRA. + */ +#ifdef strcasecmp +#undef strcasecmp +#endif +#define strcasecmp __ERROR__XX__NEVER_USE_STRCASECMP__; + +#ifdef strncasecmp +#undef strncasecmp +#endif +#define strncasecmp __ERROR__XX__NEVER_USE_STRCASECMP__; + #endif /* !_SPLINT_ */ #ifdef DEVELOPER -- cgit From 0604336c3c985bded8aa20a211b2e62e5439deb7 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Thu, 23 Oct 2003 06:35:45 +0000 Subject: Apply the changes to libsmbclient that derrell has contributed. Fix some of the problems with this. From: Derrell.Lipman@unwireduniverse.com (This used to be commit 8e3d2708c5e5a9968aeb9a6fe6c828aa8a5b22a9) --- source3/include/libsmbclient.h | 864 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 864 insertions(+) (limited to 'source3/include') diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index f5d653f697..afcafeed81 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -5,6 +5,7 @@ Copyright (C) Richard Sharpe 2000 Copyright (C) John Terpsra 2000 Copyright (C) Tom Jansen (Ninja ISD) 2002 + Copyright (C) Derrell Lipman 2003 This program is free software; you can redistribute it and/or modify @@ -65,6 +66,9 @@ #include #include #include +#include + +#define SMBC_BASE_FD 10000 /* smallest file descriptor returned */ #define SMBC_WORKGROUP 1 #define SMBC_SERVER 2 @@ -113,6 +117,20 @@ struct smbc_dirent char name[1]; }; +/* + * Flags for smbc_setxattr() + * Specify a bitwise OR of these, or 0 to add or replace as necessary + */ +#define SMBC_XATTR_FLAG_CREATE 0x1 /* fail if attr already exists */ +#define SMBC_XATTR_FLAG_REPLACE 0x2 /* fail if attr does not exist */ + + +#ifndef ENOATTR +# define ENOATTR ENOENT /* No such attribute */ +#endif + + + /**@ingroup structure * Structure that represents a print job. @@ -358,6 +376,27 @@ struct _SMBCCTX { off_t (*telldir) (SMBCCTX *c, SMBCFILE *dir); int (*lseekdir)(SMBCCTX *c, SMBCFILE *dir, off_t offset); int (*fstatdir)(SMBCCTX *c, SMBCFILE *dir, struct stat *st); + int (*chmod)(SMBCCTX *c, const char *fname, mode_t mode); + int (*utimes)(SMBCCTX *c, + const char *fname, struct timeval *tbuf); + int (*setxattr)(SMBCCTX *context, + const char *fname, + const char *name, + const void *value, + size_t size, + int flags); + int (*getxattr)(SMBCCTX *context, + const char *fname, + const char *name, + const void *value, + size_t size); + int (*removexattr)(SMBCCTX *context, + const char *fname, + const char *name); + int (*listxattr)(SMBCCTX *context, + const char *fname, + char *list, + size_t size); /** callable functions for printing */ @@ -499,6 +538,30 @@ SMBCCTX * smbc_init_context(SMBCCTX * context); int smbc_init(smbc_get_auth_data_fn fn, int debug); +/**@ingroup misc + * Set or retrieve the compatibility library's context pointer + * + * @param context New context to use, or NULL. If a new context is provided, + * it must have allocated with smbc_new_context() and + * initialized with smbc_init_context(), followed, optionally, + * by some manual changes to some of the non-internal fields. + * + * @return The old context. + * + * @see smbc_new_context(), smbc_init_context(), smbc_init() + * + * @note This function may be called prior to smbc_init() to force + * use of the next context without any internal calls to + * smbc_new_context() or smbc_init_context(). It may also + * be called after smbc_init() has already called those two + * functions, to replace the existing context with a new one. + * Care should be taken, in this latter case, to ensure that + * the server cache and any data allocated by the + * authentication functions have been freed, if necessary. + */ + +SMBCCTX * smbc_set_context(SMBCCTX * new_context); + /**@ingroup file * Open a file on an SMB server. * @@ -1008,6 +1071,807 @@ int smbc_chown(const char *url, uid_t owner, gid_t group); */ int smbc_chmod(const char *url, mode_t mode); +/**@ingroup attribute + * Change the last modification time on a file + * + * @param url The smb url of the file or directory to change + * the modification time of + * + * @param tbuf A timeval structure which contains the desired + * modification time. NOTE: Only the tv_sec field is + * used. The tv_usec (microseconds) portion is ignored. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - EPERM Permission was denied. + * + */ +int smbc_utimes(const char *url, struct timeval *tbuf); + +#ifdef HAVE_UTIME_H +/**@ingroup attribute + * Change the last modification time on a file + * + * @param url The smb url of the file or directory to change + * the modification time of + * + * @param utbuf A utimebuf structure which contains the desired + * modification time. NOTE: Although the structure contains + * an access time as well, the access time value is ignored. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - ENOMEM No memory was available for internal needs + * - EPERM Permission was denied. + * + */ +int smbc_utime(const char *fname, struct utimbuf *utbuf); +#endif + +/**@ingroup attribute + * Set extended attributes for a file. This is used for modifying a file's + * security descriptor (i.e. owner, group, and access control list) + * + * @param url The smb url of the file or directory to set extended + * attributes for. + * + * @param name The name of an attribute to be changed. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter should contain a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @param value The value to be assigned to the specified attribute name. + * This buffer should contain only the attribute value if the + * name was of the "system.nt_sec_desc." + * form. If the name was of the "system.nt_sec_desc.*" form + * then a complete security descriptor, with name:value pairs + * separated by tabs, commas, or newlines (not spaces!), + * should be provided in this value buffer. A complete + * security descriptor will contain one or more entries + * selected from the following: + * + * REVISION: + * OWNER: + * GROUP: + * ACL::// + * + * The revision of the ACL specifies the internal Windows NT + * ACL revision for the security descriptor. If not specified + * it defaults to 1. Using values other than 1 may cause + * strange behaviour. + * + * The owner and group specify the owner and group sids for + * the object. If the attribute name (either '*+' with a + * complete security descriptor, or individual 'owner+' or + * 'group+' attribute names) ended with a plus sign, the + * specified name is resolved to a SID value, using the + * server on which the file or directory resides. Otherwise, + * the value should be provided in SID-printable format as + * S-1-x-y-z, and is used directly. The + * associated with the ACL: attribute should be provided + * similarly. + * + * @param size The number of the bytes of data in the value buffer + * + * @param flags A bit-wise OR of zero or more of the following: + * SMBC_XATTR_FLAG_CREATE - + * fail if the named attribute already exists + * SMBC_XATTR_FLAG_REPLACE - + * fail if the attribute does not already exist + * + * If neither flag is specified, the specified attributes + * will be added or replace existing attributes of the same + * name, as necessary. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * or one of the parameters is not of a correct + * form + * - ENOMEM No memory was available for internal needs + * - EEXIST If the attribute already exists and the flag + * SMBC_XATTR_FLAG_CREAT was specified + * - ENOATTR If the attribute does not exist and the flag + * SMBC_XATTR_FLAG_REPLACE was specified + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + * @note Attribute names are compared in a case-insensitive + * fashion. All of the following are equivalent, although + * the all-lower-case name is the preferred format: + * system.nt_sec_desc.owner + * SYSTEM.NT_SEC_DESC.OWNER + * sYsTeM.nt_sEc_desc.owNER + * + */ +int smbc_setxattr(const char *url, + const char *name, + const void *value, + size_t size, + int flags); + + +/**@ingroup attribute + * Set extended attributes for a file. This is used for modifying a file's + * security descriptor (i.e. owner, group, and access control list). The + * POSIX function which this maps to would act on a symbolic link rather than + * acting on what the symbolic link points to, but with no symbolic links in + * SMB file systems, this function is functionally identical to + * smbc_setxattr(). + * + * @param url The smb url of the file or directory to set extended + * attributes for. + * + * @param name The name of an attribute to be changed. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter should contain a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @param value The value to be assigned to the specified attribute name. + * This buffer should contain only the attribute value if the + * name was of the "system.nt_sec_desc." + * form. If the name was of the "system.nt_sec_desc.*" form + * then a complete security descriptor, with name:value pairs + * separated by tabs, commas, or newlines (not spaces!), + * should be provided in this value buffer. A complete + * security descriptor will contain one or more entries + * selected from the following: + * + * REVISION: + * OWNER: + * GROUP: + * ACL::// + * + * The revision of the ACL specifies the internal Windows NT + * ACL revision for the security descriptor. If not specified + * it defaults to 1. Using values other than 1 may cause + * strange behaviour. + * + * The owner and group specify the owner and group sids for + * the object. If the attribute name (either '*+' with a + * complete security descriptor, or individual 'owner+' or + * 'group+' attribute names) ended with a plus sign, the + * specified name is resolved to a SID value, using the + * server on which the file or directory resides. Otherwise, + * the value should be provided in SID-printable format as + * S-1-x-y-z, and is used directly. The + * associated with the ACL: attribute should be provided + * similarly. + * + * @param size The number of the bytes of data in the value buffer + * + * @param flags A bit-wise OR of zero or more of the following: + * SMBC_XATTR_FLAG_CREATE - + * fail if the named attribute already exists + * SMBC_XATTR_FLAG_REPLACE - + * fail if the attribute does not already exist + * + * If neither flag is specified, the specified attributes + * will be added or replace existing attributes of the same + * name, as necessary. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * or one of the parameters is not of a correct + * form + * - ENOMEM No memory was available for internal needs + * - EEXIST If the attribute already exists and the flag + * SMBC_XATTR_FLAG_CREAT was specified + * - ENOATTR If the attribute does not exist and the flag + * SMBC_XATTR_FLAG_REPLACE was specified + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + * @note Attribute names are compared in a case-insensitive + * fashion. All of the following are equivalent, although + * the all-lower-case name is the preferred format: + * system.nt_sec_desc.owner + * SYSTEM.NT_SEC_DESC.OWNER + * sYsTeM.nt_sEc_desc.owNER + * + */ +int smbc_lsetxattr(const char *url, + const char *name, + const void *value, + size_t size, + int flags); + + +/**@ingroup attribute + * Set extended attributes for a file. This is used for modifying a file's + * security descriptor (i.e. owner, group, and access control list) + * + * @param fd A file descriptor associated with an open file (as + * previously returned by smbc_open(), to get extended + * attributes for. + * + * @param name The name of an attribute to be changed. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter should contain a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @param value The value to be assigned to the specified attribute name. + * This buffer should contain only the attribute value if the + * name was of the "system.nt_sec_desc." + * form. If the name was of the "system.nt_sec_desc.*" form + * then a complete security descriptor, with name:value pairs + * separated by tabs, commas, or newlines (not spaces!), + * should be provided in this value buffer. A complete + * security descriptor will contain one or more entries + * selected from the following: + * + * REVISION: + * OWNER: + * GROUP: + * ACL::// + * + * The revision of the ACL specifies the internal Windows NT + * ACL revision for the security descriptor. If not specified + * it defaults to 1. Using values other than 1 may cause + * strange behaviour. + * + * The owner and group specify the owner and group sids for + * the object. If the attribute name (either '*+' with a + * complete security descriptor, or individual 'owner+' or + * 'group+' attribute names) ended with a plus sign, the + * specified name is resolved to a SID value, using the + * server on which the file or directory resides. Otherwise, + * the value should be provided in SID-printable format as + * S-1-x-y-z, and is used directly. The + * associated with the ACL: attribute should be provided + * similarly. + * + * @param size The number of the bytes of data in the value buffer + * + * @param flags A bit-wise OR of zero or more of the following: + * SMBC_XATTR_FLAG_CREATE - + * fail if the named attribute already exists + * SMBC_XATTR_FLAG_REPLACE - + * fail if the attribute does not already exist + * + * If neither flag is specified, the specified attributes + * will be added or replace existing attributes of the same + * name, as necessary. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * or one of the parameters is not of a correct + * form + * - ENOMEM No memory was available for internal needs + * - EEXIST If the attribute already exists and the flag + * SMBC_XATTR_FLAG_CREAT was specified + * - ENOATTR If the attribute does not exist and the flag + * SMBC_XATTR_FLAG_REPLACE was specified + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + * @note Attribute names are compared in a case-insensitive + * fashion. All of the following are equivalent, although + * the all-lower-case name is the preferred format: + * system.nt_sec_desc.owner + * SYSTEM.NT_SEC_DESC.OWNER + * sYsTeM.nt_sEc_desc.owNER + * + */ +int smbc_fsetxattr(int fd, + const char *name, + const void *value, + size_t size, + int flags); + + +/**@ingroup attribute + * Get extended attributes for a file. + * + * @param url The smb url of the file or directory to get extended + * attributes for. + * + * @param name The name of an attribute to be retrieved. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter will return a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @param value A pointer to a buffer in which the value of the specified + * attribute will be placed (unless size is zero). + * + * @param size The size of the buffer pointed to by value. This parameter + * may also be zero, in which case the size of the buffer + * required to hold the attribute value will be returned, + * but nothing will be placed into the value buffer. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * or one of the parameters is not of a correct + * form + * - ENOMEM No memory was available for internal needs + * - EEXIST If the attribute already exists and the flag + * SMBC_XATTR_FLAG_CREAT was specified + * - ENOATTR If the attribute does not exist and the flag + * SMBC_XATTR_FLAG_REPLACE was specified + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + */ +int smbc_getxattr(const char *url, + const char *name, + const void *value, + size_t size); + + +/**@ingroup attribute + * Get extended attributes for a file. The POSIX function which this maps to + * would act on a symbolic link rather than acting on what the symbolic link + * points to, but with no symbolic links in SMB file systems, this function + * is functionally identical to smbc_getxattr(). + * + * @param url The smb url of the file or directory to get extended + * attributes for. + * + * @param name The name of an attribute to be retrieved. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter will return a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @param value A pointer to a buffer in which the value of the specified + * attribute will be placed (unless size is zero). + * + * @param size The size of the buffer pointed to by value. This parameter + * may also be zero, in which case the size of the buffer + * required to hold the attribute value will be returned, + * but nothing will be placed into the value buffer. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * or one of the parameters is not of a correct + * form + * - ENOMEM No memory was available for internal needs + * - EEXIST If the attribute already exists and the flag + * SMBC_XATTR_FLAG_CREAT was specified + * - ENOATTR If the attribute does not exist and the flag + * SMBC_XATTR_FLAG_REPLACE was specified + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + */ +int smbc_lgetxattr(const char *url, + const char *name, + const void *value, + size_t size); + + +/**@ingroup attribute + * Get extended attributes for a file. + * + * @param fd A file descriptor associated with an open file (as + * previously returned by smbc_open(), to get extended + * attributes for. + * + * @param name The name of an attribute to be retrieved. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter will return a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @param value A pointer to a buffer in which the value of the specified + * attribute will be placed (unless size is zero). + * + * @param size The size of the buffer pointed to by value. This parameter + * may also be zero, in which case the size of the buffer + * required to hold the attribute value will be returned, + * but nothing will be placed into the value buffer. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * or one of the parameters is not of a correct + * form + * - ENOMEM No memory was available for internal needs + * - EEXIST If the attribute already exists and the flag + * SMBC_XATTR_FLAG_CREAT was specified + * - ENOATTR If the attribute does not exist and the flag + * SMBC_XATTR_FLAG_REPLACE was specified + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + */ +int smbc_fgetxattr(int fd, + const char *name, + const void *value, + size_t size); + + +/**@ingroup attribute + * Remove extended attributes for a file. This is used for modifying a file's + * security descriptor (i.e. owner, group, and access control list) + * + * @param url The smb url of the file or directory to remove the extended + * attributes for. + * + * @param name The name of an attribute to be removed. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter will return a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - ENOMEM No memory was available for internal needs + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + */ +int smbc_removexattr(const char *url, + const char *name); + + +/**@ingroup attribute + * Remove extended attributes for a file. This is used for modifying a file's + * security descriptor (i.e. owner, group, and access control list) The POSIX + * function which this maps to would act on a symbolic link rather than acting + * on what the symbolic link points to, but with no symbolic links in SMB file + * systems, this function is functionally identical to smbc_removexattr(). + * + * @param url The smb url of the file or directory to remove the extended + * attributes for. + * + * @param name The name of an attribute to be removed. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter will return a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - ENOMEM No memory was available for internal needs + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + */ +int smbc_lremovexattr(const char *url, + const char *name); + + +/**@ingroup attribute + * Remove extended attributes for a file. This is used for modifying a file's + * security descriptor (i.e. owner, group, and access control list) + * + * @param fd A file descriptor associated with an open file (as + * previously returned by smbc_open(), to get extended + * attributes for. + * + * @param name The name of an attribute to be removed. Names are of + * one of the following forms: + * + * system.nt_sec_desc. + * system.nt_sec_desc.* + * system.nt_sec_desc.*+ + * + * where is one of: + * + * revision + * owner + * owner+ + * group + * group+ + * acl: + * acl+: + * + * In the forms "system.nt_sec_desc.*" and + * "system.nt_sec_desc.*+", the asterisk and plus signs are + * literal, i.e. the string is provided exactly as shown, and + * the value parameter will return a complete security + * descriptor with name:value pairs separated by tabs, + * commas, or newlines (not spaces!). + * + * The plus sign ('+') indicates that SIDs should be mapped + * to names. Without the plus sign, SIDs are not mapped; + * rather they are simply converted to a string format. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - ENOMEM No memory was available for internal needs + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + */ +int smbc_fremovexattr(int fd, + const char *name); + + +/**@ingroup attribute + * List the supported extended attribute names associated with a file + * + * @param url The smb url of the file or directory to list the extended + * attributes for. + * + * @param list A pointer to a buffer in which the list of attributes for + * the specified file or directory will be placed (unless + * size is zero). + * + * @param size The size of the buffer pointed to by list. This parameter + * may also be zero, in which case the size of the buffer + * required to hold all of the attribute names will be + * returned, but nothing will be placed into the list buffer. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - ENOMEM No memory was available for internal needs + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + * @note This function always returns all attribute names supported + * by NT file systems, regardless of wether the referenced + * file system supports extended attributes (e.g. a Windows + * 2000 machine supports extended attributes if NTFS is used, + * but not if FAT is used, and Windows 98 doesn't support + * extended attributes at all. Whether this is a feature or + * a bug is yet to be decided. + */ +int smbc_listxattr(const char *url, + char *list, + size_t size); + +/**@ingroup attribute + * List the supported extended attribute names associated with a file The + * POSIX function which this maps to would act on a symbolic link rather than + * acting on what the symbolic link points to, but with no symbolic links in + * SMB file systems, this function is functionally identical to + * smbc_listxattr(). + * + * @param url The smb url of the file or directory to list the extended + * attributes for. + * + * @param list A pointer to a buffer in which the list of attributes for + * the specified file or directory will be placed (unless + * size is zero). + * + * @param size The size of the buffer pointed to by list. This parameter + * may also be zero, in which case the size of the buffer + * required to hold all of the attribute names will be + * returned, but nothing will be placed into the list buffer. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - ENOMEM No memory was available for internal needs + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + * @note This function always returns all attribute names supported + * by NT file systems, regardless of wether the referenced + * file system supports extended attributes (e.g. a Windows + * 2000 machine supports extended attributes if NTFS is used, + * but not if FAT is used, and Windows 98 doesn't support + * extended attributes at all. Whether this is a feature or + * a bug is yet to be decided. + */ +int smbc_llistxattr(const char *url, + char *list, + size_t size); + +/**@ingroup attribute + * List the supported extended attribute names associated with a file + * + * @param fd A file descriptor associated with an open file (as + * previously returned by smbc_open(), to get extended + * attributes for. + * + * @param list A pointer to a buffer in which the list of attributes for + * the specified file or directory will be placed (unless + * size is zero). + * + * @param size The size of the buffer pointed to by list. This parameter + * may also be zero, in which case the size of the buffer + * required to hold all of the attribute names will be + * returned, but nothing will be placed into the list buffer. + * + * @return 0 on success, < 0 on error with errno set: + * - EINVAL The client library is not properly initialized + * - ENOMEM No memory was available for internal needs + * - EPERM Permission was denied. + * - ENOTSUP The referenced file system does not support + * extended attributes + * + * @note This function always returns all attribute names supported + * by NT file systems, regardless of wether the referenced + * file system supports extended attributes (e.g. a Windows + * 2000 machine supports extended attributes if NTFS is used, + * but not if FAT is used, and Windows 98 doesn't support + * extended attributes at all. Whether this is a feature or + * a bug is yet to be decided. + */ +int smbc_flistxattr(int fd, + char *list, + size_t size); /**@ingroup print * Print a file given the name in fname. It would be a URL ... -- cgit From 6258550534050e59a80ae8e39d9fb308b2e648fb Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 24 Oct 2003 13:38:13 +0000 Subject: New files for support of initshutdown pipe. Win2k doesn't respond properly to all requests on the winreg pipe, so we need to handle this new pipe. First part of fix for bug #534 (This used to be commit 532fab74c12d8c55872c2bad2abead2647f919d7) --- source3/include/rpc_shutdown.h | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 source3/include/rpc_shutdown.h (limited to 'source3/include') diff --git a/source3/include/rpc_shutdown.h b/source3/include/rpc_shutdown.h new file mode 100644 index 0000000000..b8e50b835f --- /dev/null +++ b/source3/include/rpc_shutdown.h @@ -0,0 +1,70 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup + Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003. + + 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_SHUTDOWN_H /* _RPC_SHUTDOWN_H */ +#define _RPC_SHUTDOWN_H + + +/* Implemented */ +#define SHUTDOWN_INIT 0x00 +#define SHUTDOWN_ABORT 0x01 +/* NOT IMPLEMENTED +#define SHUTDOWN_INIT_EX 0x02 +*/ + +/* SHUTDOWN_Q_INIT */ +typedef struct q_shutodwn_init_info +{ + uint32 ptr_server; + uint16 server; + uint32 ptr_msg; + UNIHDR hdr_msg; /* shutdown message */ + UNISTR2 uni_msg; /* seconds */ + uint32 timeout; /* seconds */ + uint8 force; /* boolean: force shutdown */ + uint8 reboot; /* boolean: reboot on shutdown */ + +} SHUTDOWN_Q_INIT; + +/* SHUTDOWN_R_INIT */ +typedef struct r_shutdown_init_info +{ + NTSTATUS status; /* return status */ + +} SHUTDOWN_R_INIT; + +/* SHUTDOWN_Q_ABORT */ +typedef struct q_shutdown_abort_info +{ + uint32 ptr_server; + uint16 server; + +} SHUTDOWN_Q_ABORT; + +/* SHUTDOWN_R_ABORT */ +typedef struct r_shutdown_abort_info +{ + NTSTATUS status; /* return status */ + +} SHUTDOWN_R_ABORT; + + +#endif /* _RPC_SHUTDOWN_H */ + -- cgit