mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r196: merging struct uuid from trunk
(This used to be commit 911a28361b
)
This commit is contained in:
parent
142f5604b5
commit
8ad3d8c9b0
@ -23,6 +23,22 @@
|
||||
#ifndef _NT_DOMAIN_H /* _NT_DOMAIN_H */
|
||||
#define _NT_DOMAIN_H
|
||||
|
||||
struct uuid
|
||||
{
|
||||
uint32 time_low;
|
||||
uint16 time_mid;
|
||||
uint16 time_hi_and_version;
|
||||
uint8 clock_seq[2];
|
||||
uint8 node[6];
|
||||
};
|
||||
#define UUID_SIZE 16
|
||||
|
||||
#define UUID_FLAT_SIZE 16
|
||||
typedef struct uuid_flat
|
||||
{
|
||||
uint8 info[UUID_FLAT_SIZE];
|
||||
} UUID_FLAT;
|
||||
|
||||
/* dce/rpc support */
|
||||
#include "rpc_dce.h"
|
||||
|
||||
|
@ -87,29 +87,15 @@ enum netsec_direction
|
||||
/* #define MAX_PDU_FRAG_LEN 0x1630 this is what wnt sets */
|
||||
#define MAX_PDU_FRAG_LEN 0x10b8 /* this is what w2k sets */
|
||||
|
||||
/*
|
||||
* Actual structure of a DCE UUID
|
||||
*/
|
||||
|
||||
typedef struct rpc_uuid
|
||||
{
|
||||
uint32 time_low;
|
||||
uint16 time_mid;
|
||||
uint16 time_hi_and_version;
|
||||
uint8 remaining[8];
|
||||
} RPC_UUID;
|
||||
|
||||
#define RPC_UUID_LEN 16
|
||||
|
||||
/* RPC_IFACE */
|
||||
typedef struct rpc_iface_info
|
||||
{
|
||||
RPC_UUID uuid; /* 16 bytes of rpc interface identification */
|
||||
struct uuid uuid; /* 16 bytes of rpc interface identification */
|
||||
uint32 version; /* the interface version number */
|
||||
|
||||
} RPC_IFACE;
|
||||
|
||||
#define RPC_IFACE_LEN (RPC_UUID_LEN + 4)
|
||||
#define RPC_IFACE_LEN (UUID_SIZE + 4)
|
||||
|
||||
struct pipe_id_info
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ typedef struct
|
||||
uint32 dnsname_ptr;
|
||||
uint32 forestname_ptr;
|
||||
|
||||
GUID domain_guid;
|
||||
struct uuid domain_guid;
|
||||
|
||||
UNISTR2 netbios_domain;
|
||||
|
||||
@ -110,7 +110,7 @@ typedef struct {
|
||||
uint32 trust_type;
|
||||
uint32 trust_attributes;
|
||||
uint32 sid_ptr;
|
||||
GUID guid;
|
||||
struct uuid guid;
|
||||
|
||||
UNISTR2 netbios_domain;
|
||||
UNISTR2 dns_domain;
|
||||
@ -124,7 +124,7 @@ struct ds_domain_trust {
|
||||
uint32 parent_index;
|
||||
uint32 trust_type;
|
||||
uint32 trust_attributes;
|
||||
GUID guid;
|
||||
struct uuid guid;
|
||||
|
||||
DOM_SID sid;
|
||||
char *netbios_domain;
|
||||
|
@ -275,7 +275,7 @@ typedef struct lsa_dns_dom_info
|
||||
UNIHDR hdr_dns_dom_name;
|
||||
UNIHDR hdr_forest_name;
|
||||
|
||||
GUID dom_guid; /* domain GUID */
|
||||
struct uuid dom_guid; /* domain GUID */
|
||||
|
||||
UNISTR2 uni_nb_dom_name;
|
||||
UNISTR2 uni_dns_dom_name;
|
||||
|
@ -113,13 +113,6 @@
|
||||
PROTECTED_SACL_SECURITY_INFORMATION|\
|
||||
PROTECTED_DACL_SECURITY_INFORMATION)
|
||||
|
||||
/* Globally Unique ID */
|
||||
#define GUID_SIZE 16
|
||||
typedef struct guid_info
|
||||
{
|
||||
uint8 info[GUID_SIZE];
|
||||
} GUID;
|
||||
|
||||
/* SEC_ACCESS */
|
||||
typedef struct security_info_info
|
||||
{
|
||||
@ -138,8 +131,8 @@ typedef struct security_ace_info
|
||||
|
||||
/* this stuff may be present when type is XXXX_TYPE_XXXX_OBJECT */
|
||||
uint32 obj_flags; /* xxxx_ACE_OBJECT_xxxx e.g present/inherited present etc */
|
||||
GUID obj_guid; /* object GUID */
|
||||
GUID inh_guid; /* inherited object GUID */
|
||||
struct uuid obj_guid; /* object GUID */
|
||||
struct uuid inh_guid; /* inherited object GUID */
|
||||
/* eof object stuff */
|
||||
|
||||
DOM_SID trustee;
|
||||
|
@ -48,8 +48,8 @@ void sec_ace_copy(SEC_ACE *ace_dest, SEC_ACE *ace_src)
|
||||
ace_dest->size = ace_src->size;
|
||||
ace_dest->info.mask = ace_src->info.mask;
|
||||
ace_dest->obj_flags = ace_src->obj_flags;
|
||||
memcpy(&ace_dest->obj_guid, &ace_src->obj_guid, GUID_SIZE);
|
||||
memcpy(&ace_dest->inh_guid, &ace_src->inh_guid, GUID_SIZE);
|
||||
memcpy(&ace_dest->obj_guid, &ace_src->obj_guid, sizeof(struct uuid));
|
||||
memcpy(&ace_dest->inh_guid, &ace_src->inh_guid, sizeof(struct uuid));
|
||||
sid_copy(&ace_dest->trustee, &ace_src->trustee);
|
||||
}
|
||||
|
||||
|
@ -624,23 +624,6 @@ char *sid_binstring(const DOM_SID *sid)
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
Print a GUID structure for debugging.
|
||||
*****************************************************************/
|
||||
|
||||
void print_guid(GUID *guid)
|
||||
{
|
||||
int i;
|
||||
|
||||
d_printf("%08x-%04x-%04x",
|
||||
IVAL(guid->info, 0), SVAL(guid->info, 4), SVAL(guid->info, 6));
|
||||
d_printf("-%02x%02x-", guid->info[8], guid->info[9]);
|
||||
for (i=10;i<GUID_SIZE;i++)
|
||||
d_printf("%02x", guid->info[i]);
|
||||
d_printf("\n");
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Tallocs a duplicate SID.
|
||||
********************************************************************/
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Unix SMB/CIFS implementation.
|
||||
* UUID server routines
|
||||
* Copyright (C) Theodore Ts'o 1996, 1997,
|
||||
* Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002.
|
||||
* Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002, 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
|
||||
@ -27,57 +27,47 @@
|
||||
#define TIME_OFFSET_HIGH 0x01B21DD2
|
||||
#define TIME_OFFSET_LOW 0x13814000
|
||||
|
||||
struct uuid {
|
||||
uint32 time_low;
|
||||
uint16 time_mid;
|
||||
uint16 time_hi_and_version;
|
||||
uint8 clock_seq[2];
|
||||
uint8 node[6];
|
||||
};
|
||||
|
||||
|
||||
static void uuid_pack(const struct uuid *uu, GUID *ptr)
|
||||
void smb_uuid_pack(const struct uuid uu, UUID_FLAT *ptr)
|
||||
{
|
||||
uint8 *out = ptr->info;
|
||||
|
||||
SIVAL(out, 0, uu->time_low);
|
||||
SSVAL(out, 4, uu->time_mid);
|
||||
SSVAL(out, 6, uu->time_hi_and_version);
|
||||
memcpy(out+8, uu->clock_seq, 2);
|
||||
memcpy(out+10, uu->node, 6);
|
||||
SIVAL(ptr, 0, uu.time_low);
|
||||
SSVAL(ptr, 4, uu.time_mid);
|
||||
SSVAL(ptr, 6, uu.time_hi_and_version);
|
||||
memcpy(ptr+8, uu.clock_seq, 2);
|
||||
memcpy(ptr+10, uu.node, 6);
|
||||
}
|
||||
|
||||
static void uuid_unpack(const GUID in, struct uuid *uu)
|
||||
void smb_uuid_unpack(const UUID_FLAT in, struct uuid *uu)
|
||||
{
|
||||
const uint8 *ptr = in.info;
|
||||
|
||||
uu->time_low = IVAL(ptr, 0);
|
||||
uu->time_mid = SVAL(ptr, 4);
|
||||
uu->time_hi_and_version = SVAL(ptr, 6);
|
||||
memcpy(uu->clock_seq, ptr+8, 2);
|
||||
memcpy(uu->node, ptr+10, 6);
|
||||
uu->time_low = IVAL(in.info, 0);
|
||||
uu->time_mid = SVAL(in.info, 4);
|
||||
uu->time_hi_and_version = SVAL(in.info, 6);
|
||||
memcpy(uu->clock_seq, in.info+8, 2);
|
||||
memcpy(uu->node, in.info+10, 6);
|
||||
}
|
||||
|
||||
void smb_uuid_generate_random(GUID *out)
|
||||
const struct uuid smb_uuid_unpack_static(const UUID_FLAT in)
|
||||
{
|
||||
GUID tmp;
|
||||
struct uuid uu;
|
||||
static struct uuid uu;
|
||||
|
||||
smb_uuid_unpack(in, &uu);
|
||||
return uu;
|
||||
}
|
||||
|
||||
void smb_uuid_generate_random(struct uuid *uu)
|
||||
{
|
||||
UUID_FLAT tmp;
|
||||
|
||||
generate_random_buffer(tmp.info, sizeof(tmp.info), True);
|
||||
uuid_unpack(tmp, &uu);
|
||||
smb_uuid_unpack(tmp, uu);
|
||||
|
||||
uu.clock_seq[0] = (uu.clock_seq[0] & 0x3F) | 0x80;
|
||||
uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000;
|
||||
uuid_pack(&uu, out);
|
||||
uu->clock_seq[0] = (uu->clock_seq[0] & 0x3F) | 0x80;
|
||||
uu->time_hi_and_version = (uu->time_hi_and_version & 0x0FFF) | 0x4000;
|
||||
}
|
||||
|
||||
char *smb_uuid_to_string(const GUID in)
|
||||
char *smb_uuid_to_string(const struct uuid uu)
|
||||
{
|
||||
struct uuid uu;
|
||||
char *out;
|
||||
|
||||
uuid_unpack(in, &uu);
|
||||
|
||||
asprintf(&out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
||||
uu.time_low, uu.time_mid, uu.time_hi_and_version,
|
||||
uu.clock_seq[0], uu.clock_seq[1],
|
||||
@ -87,13 +77,11 @@ char *smb_uuid_to_string(const GUID in)
|
||||
return out;
|
||||
}
|
||||
|
||||
const char *smb_uuid_string_static(const GUID in)
|
||||
const char *smb_uuid_string_static(const struct uuid uu)
|
||||
{
|
||||
struct uuid uu;
|
||||
static char out[37];
|
||||
|
||||
uuid_unpack(in, &uu);
|
||||
slprintf(out, sizeof(out) -1,
|
||||
slprintf(out, sizeof(out),
|
||||
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
||||
uu.time_low, uu.time_mid, uu.time_hi_and_version,
|
||||
uu.clock_seq[0], uu.clock_seq[1],
|
||||
@ -101,3 +89,86 @@ const char *smb_uuid_string_static(const GUID in)
|
||||
uu.node[3], uu.node[4], uu.node[5]);
|
||||
return out;
|
||||
}
|
||||
|
||||
BOOL smb_string_to_uuid(const char *in, struct uuid* uu)
|
||||
{
|
||||
BOOL ret = False;
|
||||
const char *ptr = in;
|
||||
char *end = (char *)in;
|
||||
int i;
|
||||
|
||||
if (!in || !uu) goto out;
|
||||
|
||||
uu->time_low = strtoul(ptr, &end, 16);
|
||||
if ((end - ptr) != 8 || *end != '-') goto out;
|
||||
ptr = (end + 1);
|
||||
|
||||
uu->time_mid = strtoul(ptr, &end, 16);
|
||||
if ((end - ptr) != 4 || *end != '-') goto out;
|
||||
ptr = (end + 1);
|
||||
|
||||
uu->time_hi_and_version = strtoul(ptr, &end, 16);
|
||||
if ((end - ptr) != 4 || *end != '-') goto out;
|
||||
ptr = (end + 1);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
int adj = 0;
|
||||
if (*ptr >= '0' && *ptr <= '9') {
|
||||
adj = '0';
|
||||
} else if (*ptr >= 'a' && *ptr <= 'f') {
|
||||
adj = 'a';
|
||||
} else if (*ptr >= 'A' && *ptr <= 'F') {
|
||||
adj = 'A';
|
||||
} else {
|
||||
goto out;
|
||||
}
|
||||
uu->clock_seq[i] = (*ptr - adj) << 4;
|
||||
ptr++;
|
||||
|
||||
if (*ptr >= '0' && *ptr <= '9') {
|
||||
adj = '0';
|
||||
} else if (*ptr >= 'a' && *ptr <= 'f') {
|
||||
adj = 'a';
|
||||
} else if (*ptr >= 'A' && *ptr <= 'F') {
|
||||
adj = 'A';
|
||||
} else {
|
||||
goto out;
|
||||
}
|
||||
uu->clock_seq[i] |= (*ptr - adj);
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (*ptr != '-') goto out;
|
||||
ptr++;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
int adj = 0;
|
||||
if (*ptr >= '0' && *ptr <= '9') {
|
||||
adj = '0';
|
||||
} else if (*ptr >= 'a' && *ptr <= 'f') {
|
||||
adj = 'a';
|
||||
} else if (*ptr >= 'A' && *ptr <= 'F') {
|
||||
adj = 'A';
|
||||
} else {
|
||||
goto out;
|
||||
}
|
||||
uu->node[i] = (*ptr - adj) << 4;
|
||||
ptr++;
|
||||
|
||||
if (*ptr >= '0' && *ptr <= '9') {
|
||||
adj = '0';
|
||||
} else if (*ptr >= 'a' && *ptr <= 'f') {
|
||||
adj = 'a';
|
||||
} else if (*ptr >= 'A' && *ptr <= 'F') {
|
||||
adj = 'A';
|
||||
} else {
|
||||
goto out;
|
||||
}
|
||||
uu->node[i] |= (*ptr - adj);
|
||||
ptr++;
|
||||
}
|
||||
|
||||
ret = True;
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
@ -1106,20 +1106,14 @@ static void dump_binary(const char *field, struct berval **values)
|
||||
}
|
||||
}
|
||||
|
||||
struct uuid {
|
||||
uint32 i1;
|
||||
uint16 i2;
|
||||
uint16 i3;
|
||||
uint8 s[8];
|
||||
};
|
||||
|
||||
static void dump_guid(const char *field, struct berval **values)
|
||||
{
|
||||
int i;
|
||||
GUID guid;
|
||||
UUID_FLAT guid;
|
||||
for (i=0; values[i]; i++) {
|
||||
memcpy(guid.info, values[i]->bv_val, sizeof(guid.info));
|
||||
printf("%s: %s\n", field, smb_uuid_string_static(guid));
|
||||
printf("%s: %s\n", field,
|
||||
smb_uuid_string_static(smb_uuid_unpack_static(guid)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1771,16 +1765,18 @@ BOOL ads_pull_uint32(ADS_STRUCT *ads,
|
||||
* @return boolean indicating success
|
||||
**/
|
||||
BOOL ads_pull_guid(ADS_STRUCT *ads,
|
||||
void *msg, GUID *guid)
|
||||
void *msg, struct uuid *guid)
|
||||
{
|
||||
char **values;
|
||||
UUID_FLAT flat_guid;
|
||||
|
||||
values = ldap_get_values(ads->ld, msg, "objectGUID");
|
||||
if (!values)
|
||||
return False;
|
||||
|
||||
if (values[0]) {
|
||||
memcpy(guid, values[0], sizeof(GUID));
|
||||
memcpy(&flat_guid.info, values[0], sizeof(UUID_FLAT));
|
||||
smb_uuid_unpack(flat_guid, guid);
|
||||
ldap_value_free(values);
|
||||
return True;
|
||||
}
|
||||
|
@ -313,7 +313,8 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
|
||||
}
|
||||
#ifdef HAVE_ADS
|
||||
else {
|
||||
GUID domain_guid;
|
||||
struct uuid domain_guid;
|
||||
UUID_FLAT flat_guid;
|
||||
pstring domain;
|
||||
pstring hostname;
|
||||
char *component, *dc, *q1;
|
||||
@ -340,8 +341,10 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
|
||||
DEBUG(2, ("Could not fetch DomainGUID for %s\n", domain));
|
||||
return;
|
||||
}
|
||||
memcpy(q, &domain_guid, sizeof(domain_guid));
|
||||
q += sizeof(domain_guid);
|
||||
|
||||
smb_uuid_pack(domain_guid, &flat_guid);
|
||||
memcpy(q, &flat_guid.info, UUID_FLAT_SIZE);
|
||||
q += UUID_FLAT_SIZE;
|
||||
|
||||
/* Forest */
|
||||
str_offset = q - q_orig;
|
||||
|
@ -440,8 +440,8 @@ static void send_wins_name_registration_response(int rcode, int ttl, struct pack
|
||||
Deal with a name refresh request to a WINS server.
|
||||
************************************************************************/
|
||||
|
||||
void wins_process_name_refresh_request(struct subnet_record *subrec,
|
||||
struct packet_struct *p)
|
||||
void wins_process_name_refresh_request( struct subnet_record *subrec,
|
||||
struct packet_struct *p )
|
||||
{
|
||||
struct nmb_packet *nmb = &p->packet.nmb;
|
||||
struct nmb_name *question = &nmb->question.question_name;
|
||||
@ -453,28 +453,36 @@ void wins_process_name_refresh_request(struct subnet_record *subrec,
|
||||
struct in_addr from_ip;
|
||||
struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0");
|
||||
|
||||
putip((char *)&from_ip,&nmb->additional->rdata[2]);
|
||||
putip( (char *)&from_ip, &nmb->additional->rdata[2] );
|
||||
|
||||
if(bcast) {
|
||||
/*
|
||||
* We should only get unicast name refresh packets here.
|
||||
* Anyone trying to refresh broadcast should not be going to a WINS
|
||||
* server. Log an error here.
|
||||
* Anyone trying to refresh broadcast should not be going
|
||||
* to a WINS server. Log an error here.
|
||||
*/
|
||||
|
||||
DEBUG(0,("wins_process_name_refresh_request: broadcast name refresh request \
|
||||
received for name %s from IP %s on subnet %s. Error - should not be sent to WINS server\n",
|
||||
nmb_namestr(question), inet_ntoa(from_ip), subrec->subnet_name));
|
||||
if( DEBUGLVL( 0 ) ) {
|
||||
dbgtext( "wins_process_name_refresh_request: " );
|
||||
dbgtext( "Broadcast name refresh request received " );
|
||||
dbgtext( "for name %s ", nmb_namestr(question) );
|
||||
dbgtext( "from IP %s ", inet_ntoa(from_ip) );
|
||||
dbgtext( "on subnet %s. ", subrec->subnet_name );
|
||||
dbgtext( "Error - Broadcasts should not be sent " );
|
||||
dbgtext( "to a WINS server\n" );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG(3,("wins_process_name_refresh_request: Name refresh for name %s \
|
||||
IP %s\n", nmb_namestr(question), inet_ntoa(from_ip) ));
|
||||
if( DEBUGLVL( 3 ) ) {
|
||||
dbgtext( "wins_process_name_refresh_request: " );
|
||||
dbgtext( "Name refresh for name %s IP %s\n",
|
||||
nmb_namestr(question), inet_ntoa(from_ip) );
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the name already exists.
|
||||
* If not, handle it as a name registration and return.
|
||||
*/
|
||||
|
||||
namerec = find_name_on_subnet(subrec, question, FIND_ANY_NAME);
|
||||
|
||||
/*
|
||||
@ -482,48 +490,62 @@ IP %s\n", nmb_namestr(question), inet_ntoa(from_ip) ));
|
||||
* treat it like a registration request. This allows us to recover
|
||||
* from errors (tridge)
|
||||
*/
|
||||
|
||||
if(namerec == NULL) {
|
||||
DEBUG(3,("wins_process_name_refresh_request: Name refresh for name %s and \
|
||||
the name does not exist. Treating as registration.\n", nmb_namestr(question) ));
|
||||
if( DEBUGLVL( 3 ) ) {
|
||||
dbgtext( "wins_process_name_refresh_request: " );
|
||||
dbgtext( "Name refresh for name %s ",
|
||||
nmb_namestr( question ) );
|
||||
dbgtext( "and the name does not exist. Treating " );
|
||||
dbgtext( "as registration.\n" );
|
||||
}
|
||||
wins_process_name_registration_request(subrec,p);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* if the name is present but not active,
|
||||
* simply remove it and treat the request
|
||||
* as a registration
|
||||
* if the name is present but not active, simply remove it
|
||||
* and treat the refresh request as a registration & return.
|
||||
*/
|
||||
if (namerec != NULL && !WINS_STATE_ACTIVE(namerec)) {
|
||||
DEBUG(5,("wins_process_name_refresh_request: Name (%s) in WINS was \
|
||||
not active - removing it.\n", nmb_namestr(question) ));
|
||||
if( DEBUGLVL( 5 ) ) {
|
||||
dbgtext( "wins_process_name_refresh_request: " );
|
||||
dbgtext( "Name (%s) in WINS ", nmb_namestr(question) );
|
||||
dbgtext( "was not active - removing it.\n" );
|
||||
}
|
||||
remove_name_from_namelist( subrec, namerec );
|
||||
namerec = NULL;
|
||||
wins_process_name_registration_request(subrec,p);
|
||||
wins_process_name_registration_request( subrec, p );
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that the group bits for the refreshing name and the
|
||||
* name in our database match.
|
||||
* name in our database match. If not, refuse the refresh.
|
||||
* [crh: Why RFS_ERR instead of ACT_ERR? Is this what MS does?]
|
||||
*/
|
||||
|
||||
if((namerec != NULL) && ((group && !NAME_GROUP(namerec)) || (!group && NAME_GROUP(namerec))) ) {
|
||||
DEBUG(3,("wins_process_name_refresh_request: Name %s group bit = %s \
|
||||
does not match group bit in WINS for this name.\n", nmb_namestr(question), group ? "True" : "False" ));
|
||||
if( (namerec != NULL) &&
|
||||
( (group && !NAME_GROUP(namerec))
|
||||
|| (!group && NAME_GROUP(namerec)) ) ) {
|
||||
if( DEBUGLVL( 3 ) ) {
|
||||
dbgtext( "wins_process_name_refresh_request: " );
|
||||
dbgtext( "Name %s ", nmb_namestr(question) );
|
||||
dbgtext( "group bit = %s does not match ",
|
||||
group ? "True" : "False" );
|
||||
dbgtext( "group bit in WINS for this name.\n" );
|
||||
}
|
||||
send_wins_name_registration_response(RFS_ERR, 0, p);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* For a unique name check that the person refreshing the name is one of the registered IP
|
||||
* addresses. If not - fail the refresh. Do the same for group names with a type of 0x1c.
|
||||
* Just return success for unique 0x1d refreshes. For normal group names update the ttl
|
||||
* and return success.
|
||||
* For a unique name check that the person refreshing the name is
|
||||
* one of the registered IP addresses. If not - fail the refresh.
|
||||
* Do the same for group names with a type of 0x1c.
|
||||
* Just return success for unique 0x1d refreshes. For normal group
|
||||
* names update the ttl and return success.
|
||||
*/
|
||||
|
||||
if((!group || (group && (question->name_type == 0x1c))) && find_ip_in_name_record(namerec, from_ip )) {
|
||||
if( (!group || (group && (question->name_type == 0x1c)))
|
||||
&& find_ip_in_name_record(namerec, from_ip) ) {
|
||||
/*
|
||||
* Update the ttl.
|
||||
*/
|
||||
@ -541,10 +563,25 @@ does not match group bit in WINS for this name.\n", nmb_namestr(question), group
|
||||
send_wins_name_registration_response(0, ttl, p);
|
||||
wins_hook("refresh", namerec, ttl);
|
||||
return;
|
||||
} else if((group && (question->name_type == 0x1c))) {
|
||||
/*
|
||||
* Added by crh for bug #1079.
|
||||
* Fix from Bert Driehuis
|
||||
*/
|
||||
if( DEBUGLVL( 3 ) ) {
|
||||
dbgtext( "wins_process_name_refresh_request: " );
|
||||
dbgtext( "Name refresh for name %s, ",
|
||||
nmb_namestr(question) );
|
||||
dbgtext( "but IP address %s ", inet_ntoa(from_ip) );
|
||||
dbgtext( "is not yet associated with " );
|
||||
dbgtext( "that name. Treating as registration.\n" );
|
||||
}
|
||||
wins_process_name_registration_request(subrec,p);
|
||||
return;
|
||||
} else if(group) {
|
||||
/*
|
||||
* Normal groups are all registered with an IP address of 255.255.255.255
|
||||
* so we can't search for the IP address.
|
||||
* Normal groups are all registered with an IP address of
|
||||
* 255.255.255.255 so we can't search for the IP address.
|
||||
*/
|
||||
update_name_ttl(namerec, ttl);
|
||||
send_wins_name_registration_response(0, ttl, p);
|
||||
@ -559,9 +596,12 @@ does not match group bit in WINS for this name.\n", nmb_namestr(question), group
|
||||
/*
|
||||
* Fail the refresh.
|
||||
*/
|
||||
|
||||
DEBUG(3,("wins_process_name_refresh_request: Name refresh for name %s with IP %s and \
|
||||
is IP is not known to the name.\n", nmb_namestr(question), inet_ntoa(from_ip) ));
|
||||
if( DEBUGLVL( 3 ) ) {
|
||||
dbgtext( "wins_process_name_refresh_request: " );
|
||||
dbgtext( "Name refresh for name %s with IP %s ",
|
||||
nmb_namestr(question), inet_ntoa(from_ip) );
|
||||
dbgtext( "and is IP is not known to the name.\n" );
|
||||
}
|
||||
send_wins_name_registration_response(RFS_ERR, 0, p);
|
||||
return;
|
||||
}
|
||||
|
@ -135,39 +135,38 @@ BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid)
|
||||
return True;
|
||||
}
|
||||
|
||||
BOOL secrets_store_domain_guid(const char *domain, GUID *guid)
|
||||
BOOL secrets_store_domain_guid(const char *domain, struct uuid *guid)
|
||||
{
|
||||
fstring key;
|
||||
|
||||
slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
|
||||
strupper_m(key);
|
||||
return secrets_store(key, guid, sizeof(GUID));
|
||||
return secrets_store(key, guid, sizeof(struct uuid));
|
||||
}
|
||||
|
||||
BOOL secrets_fetch_domain_guid(const char *domain, GUID *guid)
|
||||
BOOL secrets_fetch_domain_guid(const char *domain, struct uuid *guid)
|
||||
{
|
||||
GUID *dyn_guid;
|
||||
struct uuid *dyn_guid;
|
||||
fstring key;
|
||||
size_t size;
|
||||
GUID new_guid;
|
||||
struct uuid new_guid;
|
||||
|
||||
slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
|
||||
strupper_m(key);
|
||||
dyn_guid = (GUID *)secrets_fetch(key, &size);
|
||||
dyn_guid = (struct uuid *)secrets_fetch(key, &size);
|
||||
|
||||
DEBUG(6,("key is %s, size is %d\n", key, (int)size));
|
||||
|
||||
if ((NULL == dyn_guid) && (ROLE_DOMAIN_PDC == lp_server_role())) {
|
||||
if ((!dyn_guid) && (lp_server_role() == ROLE_DOMAIN_PDC)) {
|
||||
smb_uuid_generate_random(&new_guid);
|
||||
if (!secrets_store_domain_guid(domain, &new_guid))
|
||||
return False;
|
||||
dyn_guid = (GUID *)secrets_fetch(key, &size);
|
||||
dyn_guid = (struct uuid *)secrets_fetch(key, &size);
|
||||
if (dyn_guid == NULL)
|
||||
return False;
|
||||
}
|
||||
|
||||
if (size != sizeof(GUID))
|
||||
if (size != sizeof(struct uuid))
|
||||
{
|
||||
DEBUG(1,("UUID size %d is wrong!\n", (int)size));
|
||||
SAFE_FREE(dyn_guid);
|
||||
return False;
|
||||
}
|
||||
@ -245,7 +244,7 @@ uint32 get_default_sec_channel(void)
|
||||
/************************************************************************
|
||||
Routine to get the trust account password for a domain.
|
||||
The user of this function must have locked the trust password file using
|
||||
the above call.
|
||||
the above secrets_lock_trust_account_password().
|
||||
************************************************************************/
|
||||
|
||||
BOOL secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
|
||||
@ -569,7 +568,8 @@ BOOL secrets_store_ldap_pw(const char* dn, char* pw)
|
||||
* @return nt status code of rpc response
|
||||
**/
|
||||
|
||||
NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned int max_num_domains, int *num_domains, TRUSTDOM ***domains)
|
||||
NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned int max_num_domains,
|
||||
int *num_domains, TRUSTDOM ***domains)
|
||||
{
|
||||
TDB_LIST_NODE *keys, *k;
|
||||
TRUSTDOM *dom = NULL;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Unix SMB/CIFS implementation.
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-2000,
|
||||
* Copyright (C) Jean François Micouleau 1998-2000.
|
||||
* Copyright (C) Jean François Micouleau 1998-2000.
|
||||
* Copyright (C) Gerald Carter 2002-2003.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -2166,7 +2166,7 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
|
||||
nt_devmode->mediatype = 0;
|
||||
nt_devmode->dithertype = 0;
|
||||
|
||||
/* non utilisés par un driver d'imprimante */
|
||||
/* non utilisés par un driver d'imprimante */
|
||||
nt_devmode->logpixels = 0;
|
||||
nt_devmode->bitsperpel = 0;
|
||||
nt_devmode->pelswidth = 0;
|
||||
@ -2576,7 +2576,8 @@ static BOOL map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
|
||||
return True;
|
||||
}
|
||||
|
||||
static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2, GUID guid)
|
||||
static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
|
||||
struct uuid guid)
|
||||
{
|
||||
int i;
|
||||
REGVAL_CTR *ctr=NULL;
|
||||
@ -2588,7 +2589,7 @@ static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2, GUID guid)
|
||||
|
||||
regval_ctr_delvalue(ctr, "objectGUID");
|
||||
regval_ctr_addvalue(ctr, "objectGUID", REG_BINARY,
|
||||
(char *) &guid, sizeof(GUID));
|
||||
(char *) &guid, sizeof(struct uuid));
|
||||
}
|
||||
|
||||
static WERROR publish_it(NT_PRINTER_INFO_LEVEL *printer)
|
||||
@ -2601,7 +2602,7 @@ static WERROR publish_it(NT_PRINTER_INFO_LEVEL *printer)
|
||||
void *res = NULL;
|
||||
ADS_STRUCT *ads;
|
||||
const char *attrs[] = {"objectGUID", NULL};
|
||||
GUID guid;
|
||||
struct uuid guid;
|
||||
WERROR win_rc = WERR_OK;
|
||||
|
||||
ZERO_STRUCT(guid);
|
||||
@ -2785,7 +2786,8 @@ WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action)
|
||||
return win_rc;
|
||||
}
|
||||
|
||||
BOOL is_printer_published(Printer_entry *print_hnd, int snum, GUID *guid)
|
||||
BOOL is_printer_published(Printer_entry *print_hnd, int snum,
|
||||
struct uuid *guid)
|
||||
{
|
||||
NT_PRINTER_INFO_LEVEL *printer = NULL;
|
||||
REGVAL_CTR *ctr;
|
||||
@ -2813,8 +2815,8 @@ BOOL is_printer_published(Printer_entry *print_hnd, int snum, GUID *guid)
|
||||
return False;
|
||||
}
|
||||
|
||||
if (regval_size(guid_val) == sizeof(GUID))
|
||||
memcpy(guid, regval_data_p(guid_val), sizeof(GUID));
|
||||
if (regval_size(guid_val) == sizeof(struct uuid))
|
||||
memcpy(guid, regval_data_p(guid_val), sizeof(struct uuid));
|
||||
|
||||
return True;
|
||||
}
|
||||
@ -2824,7 +2826,8 @@ WERROR nt_printer_publish(Printer_entry *print_hnd, int snum, int action)
|
||||
{
|
||||
return WERR_OK;
|
||||
}
|
||||
BOOL is_printer_published(Printer_entry *print_hnd, int snum, GUID *guid)
|
||||
BOOL is_printer_published(Printer_entry *print_hnd, int snum,
|
||||
struct uuid *guid)
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
@ -538,7 +538,7 @@ NTSTATUS cli_lsa_query_info_policy(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
NTSTATUS cli_lsa_query_info_policy2(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
POLICY_HND *pol, uint16 info_class,
|
||||
char **domain_name, char **dns_name,
|
||||
char **forest_name, GUID **domain_guid,
|
||||
char **forest_name, struct uuid **domain_guid,
|
||||
DOM_SID **domain_sid)
|
||||
{
|
||||
prs_struct qbuf, rbuf;
|
||||
@ -602,7 +602,7 @@ NTSTATUS cli_lsa_query_info_policy2(struct cli_state *cli, TALLOC_CTX *mem_ctx,
|
||||
*domain_guid = talloc(mem_ctx, sizeof(**domain_guid));
|
||||
memcpy(*domain_guid,
|
||||
&r.info.dns_dom_info.dom_guid,
|
||||
sizeof(GUID));
|
||||
sizeof(struct uuid));
|
||||
}
|
||||
|
||||
if (domain_sid && r.info.dns_dom_info.ptr_dom_sid != 0) {
|
||||
|
@ -49,7 +49,7 @@ static BOOL ds_io_dominfobasic( const char *desc, prs_struct *ps, int depth, DSR
|
||||
if ( !prs_uint32("forestname_ptr", ps, depth, &p->forestname_ptr) )
|
||||
return False;
|
||||
|
||||
if ( !prs_uint8s(False, "domain_guid", ps, depth, p->domain_guid.info, GUID_SIZE) )
|
||||
if ( !smb_io_uuid("domain_guid", &p->domain_guid, ps, depth) )
|
||||
return False;
|
||||
|
||||
if ( !smb_io_unistr2( "netbios_domain", &p->netbios_domain, p->netbios_ptr, ps, depth) )
|
||||
@ -179,7 +179,7 @@ static BOOL ds_io_domain_trusts( const char *desc, prs_struct *ps, int depth, DS
|
||||
if ( !prs_uint32( "sid_ptr", ps, depth, &trust->sid_ptr ) )
|
||||
return False;
|
||||
|
||||
if ( !prs_uint8s(False, "guid", ps, depth, trust->guid.info, GUID_SIZE) )
|
||||
if ( !smb_io_uuid("guid", &trust->guid, ps, depth) )
|
||||
return False;
|
||||
|
||||
return True;
|
||||
|
@ -2142,7 +2142,7 @@ BOOL lsa_io_dns_dom_info(const char *desc, LSA_DNS_DOM_INFO *info,
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
if (!prs_uint8s(False, "dom_guid", ps, depth, info->dom_guid.info, GUID_SIZE))
|
||||
if ( !smb_io_uuid("dom_guid", &info->dom_guid, ps, depth) )
|
||||
return False;
|
||||
|
||||
if(!prs_align(ps))
|
||||
|
@ -322,6 +322,34 @@ BOOL smb_io_dom_sid2(const char *desc, DOM_SID2 *sid, prs_struct *ps, int depth)
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Reads or writes a struct uuid
|
||||
********************************************************************/
|
||||
|
||||
BOOL smb_io_uuid(const char *desc, struct uuid *uuid,
|
||||
prs_struct *ps, int depth)
|
||||
{
|
||||
if (uuid == NULL)
|
||||
return False;
|
||||
|
||||
prs_debug(ps, depth, desc, "smb_io_uuid");
|
||||
depth++;
|
||||
|
||||
if(!prs_uint32 ("data ", ps, depth, &uuid->time_low))
|
||||
return False;
|
||||
if(!prs_uint16 ("data ", ps, depth, &uuid->time_mid))
|
||||
return False;
|
||||
if(!prs_uint16 ("data ", ps, depth, &uuid->time_hi_and_version))
|
||||
return False;
|
||||
|
||||
if(!prs_uint8s (False, "data ", ps, depth, uuid->clock_seq, sizeof(uuid->clock_seq)))
|
||||
return False;
|
||||
if(!prs_uint8s (False, "data ", ps, depth, uuid->node, sizeof(uuid->node)))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
creates a STRHDR structure.
|
||||
********************************************************************/
|
||||
|
@ -34,7 +34,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x8a885d04, 0x1ceb, 0x11c9, \
|
||||
{ 0x9f, 0xe8, 0x08, 0x00, \
|
||||
{ 0x9f, 0xe8 }, \
|
||||
{ 0x08, 0x00, \
|
||||
0x2b, 0x10, 0x48, 0x60 } \
|
||||
}, 0x02 \
|
||||
}
|
||||
@ -43,7 +44,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x8a885d04, 0x1ceb, 0x11c9, \
|
||||
{ 0x9f, 0xe8, 0x08, 0x00, \
|
||||
{ 0x9f, 0xe8 }, \
|
||||
{ 0x08, 0x00, \
|
||||
0x2b, 0x10, 0x48, 0x60 } \
|
||||
}, 0x02 \
|
||||
}
|
||||
@ -52,7 +54,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x6bffd098, 0xa112, 0x3610, \
|
||||
{ 0x98, 0x33, 0x46, 0xc3, \
|
||||
{ 0x98, 0x33 }, \
|
||||
{ 0x46, 0xc3, \
|
||||
0xf8, 0x7e, 0x34, 0x5a } \
|
||||
}, 0x01 \
|
||||
}
|
||||
@ -61,7 +64,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x4b324fc8, 0x1670, 0x01d3, \
|
||||
{ 0x12, 0x78, 0x5a, 0x47, \
|
||||
{ 0x12, 0x78 }, \
|
||||
{ 0x5a, 0x47, \
|
||||
0xbf, 0x6e, 0xe1, 0x88 } \
|
||||
}, 0x03 \
|
||||
}
|
||||
@ -70,7 +74,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x12345778, 0x1234, 0xabcd, \
|
||||
{ 0xef, 0x00, 0x01, 0x23, \
|
||||
{ 0xef, 0x00 }, \
|
||||
{ 0x01, 0x23, \
|
||||
0x45, 0x67, 0x89, 0xab } \
|
||||
}, 0x00 \
|
||||
}
|
||||
@ -79,7 +84,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x3919286a, 0xb10c, 0x11d0, \
|
||||
{ 0x9b, 0xa8, 0x00, 0xc0, \
|
||||
{ 0x9b, 0xa8 }, \
|
||||
{ 0x00, 0xc0, \
|
||||
0x4f, 0xd9, 0x2e, 0xf5 } \
|
||||
}, 0x00 \
|
||||
}
|
||||
@ -88,7 +94,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x12345778, 0x1234, 0xabcd, \
|
||||
{ 0xef, 0x00, 0x01, 0x23, \
|
||||
{ 0xef, 0x00 }, \
|
||||
{ 0x01, 0x23, \
|
||||
0x45, 0x67, 0x89, 0xac } \
|
||||
}, 0x01 \
|
||||
}
|
||||
@ -97,7 +104,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x12345678, 0x1234, 0xabcd, \
|
||||
{ 0xef, 0x00, 0x01, 0x23, \
|
||||
{ 0xef, 0x00 }, \
|
||||
{ 0x01, 0x23, \
|
||||
0x45, 0x67, 0xcf, 0xfb } \
|
||||
}, 0x01 \
|
||||
}
|
||||
@ -106,7 +114,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x338cd001, 0x2244, 0x31f1, \
|
||||
{ 0xaa, 0xaa, 0x90, 0x00, \
|
||||
{ 0xaa, 0xaa }, \
|
||||
{ 0x90, 0x00, \
|
||||
0x38, 0x00, 0x10, 0x03 } \
|
||||
}, 0x01 \
|
||||
}
|
||||
@ -115,7 +124,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x12345678, 0x1234, 0xabcd, \
|
||||
{ 0xef, 0x00, 0x01, 0x23, \
|
||||
{ 0xef, 0x00 }, \
|
||||
{ 0x01, 0x23, \
|
||||
0x45, 0x67, 0x89, 0xab } \
|
||||
}, 0x01 \
|
||||
}
|
||||
@ -124,7 +134,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x0, 0x0, 0x0, \
|
||||
{ 0x00, 0x00, 0x00, 0x00, \
|
||||
{ 0x00, 0x00 }, \
|
||||
{ 0x00, 0x00, \
|
||||
0x00, 0x00, 0x00, 0x00 } \
|
||||
}, 0x00 \
|
||||
}
|
||||
@ -133,7 +144,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x4fc742e0, 0x4a10, 0x11cf, \
|
||||
{ 0x82, 0x73, 0x00, 0xaa, \
|
||||
{ 0x82, 0x73 }, \
|
||||
{ 0x00, 0xaa, \
|
||||
0x00, 0x4a, 0xe6, 0x73 } \
|
||||
}, 0x03 \
|
||||
}
|
||||
@ -142,7 +154,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x60a15ec5, 0x4de8, 0x11d7, \
|
||||
{ 0xa6, 0x37, 0x00, 0x50, \
|
||||
{ 0xa6, 0x37 }, \
|
||||
{ 0x00, 0x50, \
|
||||
0x56, 0xa2, 0x01, 0x82 } \
|
||||
}, 0x01 \
|
||||
}
|
||||
@ -151,7 +164,8 @@ interface/version dce/rpc pipe identification
|
||||
{ \
|
||||
{ \
|
||||
0x894de0c0, 0x0d55, 0x11d3, \
|
||||
{ 0xa3, 0x22, 0x00, 0xc0, \
|
||||
{ 0xa3, 0x22 }, \
|
||||
{ 0x00, 0xc0, \
|
||||
0x4f, 0xa3, 0x21, 0xa1 } \
|
||||
}, 0x01 \
|
||||
}
|
||||
@ -252,34 +266,6 @@ BOOL smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth)
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Reads or writes an RPC_UUID structure.
|
||||
********************************************************************/
|
||||
|
||||
static BOOL smb_io_rpc_uuid(const char *desc, RPC_UUID *uuid, prs_struct *ps, int depth)
|
||||
{
|
||||
if (uuid == NULL)
|
||||
return False;
|
||||
|
||||
prs_debug(ps, depth, desc, "smb_io_rpc_uuid");
|
||||
depth++;
|
||||
|
||||
if(!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32 ("data ", ps, depth, &uuid->time_low))
|
||||
return False;
|
||||
if(!prs_uint16 ("data ", ps, depth, &uuid->time_mid))
|
||||
return False;
|
||||
if(!prs_uint16 ("data ", ps, depth, &uuid->time_hi_and_version))
|
||||
return False;
|
||||
|
||||
if(!prs_uint8s (False, "data ", ps, depth, uuid->remaining, sizeof(uuid->remaining)))
|
||||
return False;
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Reads or writes an RPC_IFACE structure.
|
||||
********************************************************************/
|
||||
@ -292,7 +278,10 @@ static BOOL smb_io_rpc_iface(const char *desc, RPC_IFACE *ifc, prs_struct *ps, i
|
||||
prs_debug(ps, depth, desc, "smb_io_rpc_iface");
|
||||
depth++;
|
||||
|
||||
if (!smb_io_rpc_uuid( "uuid", &ifc->uuid, ps, depth))
|
||||
if (!prs_align(ps))
|
||||
return False;
|
||||
|
||||
if (!smb_io_uuid( "uuid", &ifc->uuid, ps, depth))
|
||||
return False;
|
||||
|
||||
if(!prs_uint32 ("version", ps, depth, &ifc->version))
|
||||
|
@ -5315,10 +5315,6 @@ static BOOL sam_io_user_info11(const char *desc, SAM_USER_INFO_11 * usr,
|
||||
|
||||
/*************************************************************************
|
||||
init_sam_user_infoa
|
||||
|
||||
unknown_5 = 0x0001 0000
|
||||
unknown_6 = 0x0000 04ec
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
void init_sam_user_info24(SAM_USER_INFO_24 * usr, char newpass[516], uint16 pw_len)
|
||||
|
@ -83,11 +83,11 @@ BOOL sec_io_ace(const char *desc, SEC_ACE *psa, prs_struct *ps, int depth)
|
||||
return False;
|
||||
|
||||
if (psa->obj_flags & SEC_ACE_OBJECT_PRESENT)
|
||||
if (!prs_uint8s(False, "obj_guid", ps, depth, psa->obj_guid.info, GUID_SIZE))
|
||||
if (!smb_io_uuid("obj_guid", &psa->obj_guid, ps,depth))
|
||||
return False;
|
||||
|
||||
if (psa->obj_flags & SEC_ACE_OBJECT_INHERITED_PRESENT)
|
||||
if (!prs_uint8s(False, "inh_guid", ps, depth, psa->inh_guid.info, GUID_SIZE))
|
||||
if (!smb_io_uuid("inh_guid", &psa->inh_guid, ps,depth))
|
||||
return False;
|
||||
|
||||
if(!smb_io_dom_sid("trustee ", &psa->trustee , ps, depth))
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Copyright (C) Paul Ashton 1997,
|
||||
* Copyright (C) Jeremy Allison 2001,
|
||||
* Copyright (C) Rafal Szczesniak 2002,
|
||||
* Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002.
|
||||
* Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002,
|
||||
*
|
||||
* 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
|
||||
@ -350,7 +350,7 @@ static NTSTATUS lsa_get_generic_sd(TALLOC_CTX *mem_ctx, SEC_DESC **sd, size_t *s
|
||||
|
||||
static void init_dns_dom_info(LSA_DNS_DOM_INFO *r_l, const char *nb_name,
|
||||
const char *dns_name, const char *forest_name,
|
||||
GUID *dom_guid, DOM_SID *dom_sid)
|
||||
struct uuid *dom_guid, DOM_SID *dom_sid)
|
||||
{
|
||||
if (nb_name && *nb_name) {
|
||||
init_unistr2(&r_l->uni_nb_dom_name, nb_name, UNI_FLAGS_NONE);
|
||||
@ -375,7 +375,7 @@ static void init_dns_dom_info(LSA_DNS_DOM_INFO *r_l, const char *nb_name,
|
||||
|
||||
/* how do we init the guid ? probably should write an init fn */
|
||||
if (dom_guid) {
|
||||
memcpy(&r_l->dom_guid, dom_guid, sizeof(GUID));
|
||||
memcpy(&r_l->dom_guid, dom_guid, sizeof(struct uuid));
|
||||
}
|
||||
|
||||
if (dom_sid) {
|
||||
@ -1105,7 +1105,6 @@ NTSTATUS _lsa_addprivs(pipes_struct *p, LSA_Q_ADDPRIVS *q_u, LSA_R_ADDPRIVS *r_u
|
||||
/* check if the privilege is already there */
|
||||
if (check_priv_in_privilege(map.priv_set, *luid_attr)){
|
||||
destroy_privilege(&map.priv_set);
|
||||
return NT_STATUS_NO_SUCH_PRIVILEGE;
|
||||
}
|
||||
|
||||
add_privilege(map.priv_set, *luid_attr);
|
||||
@ -1240,7 +1239,7 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I
|
||||
char *dns_name = NULL;
|
||||
char *forest_name = NULL;
|
||||
DOM_SID *sid = NULL;
|
||||
GUID guid;
|
||||
struct uuid guid;
|
||||
fstring dnsdomname;
|
||||
|
||||
ZERO_STRUCT(guid);
|
||||
|
@ -317,6 +317,42 @@ static BOOL api_net_logon_ctrl(pipes_struct *p)
|
||||
return True;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
api_ds_enum_dom_trusts:
|
||||
*************************************************************************/
|
||||
|
||||
#if 0 /* JERRY */
|
||||
static BOOL api_ds_enum_dom_trusts(pipes_struct *p)
|
||||
{
|
||||
DS_Q_ENUM_DOM_TRUSTS q_u;
|
||||
DS_R_ENUM_DOM_TRUSTS r_u;
|
||||
|
||||
prs_struct *data = &p->in_data.data;
|
||||
prs_struct *rdata = &p->out_data.rdata;
|
||||
|
||||
ZERO_STRUCT(q_u);
|
||||
ZERO_STRUCT(r_u);
|
||||
|
||||
DEBUG(6,("api_ds_enum_dom_trusts\n"));
|
||||
|
||||
if ( !ds_io_q_enum_domain_trusts("", data, 0, &q_u) ) {
|
||||
DEBUG(0,("api_ds_enum_domain_trusts: Failed to unmarshall DS_Q_ENUM_DOM_TRUSTS.\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
r_u.status = _ds_enum_dom_trusts(p, &q_u, &r_u);
|
||||
|
||||
if ( !ds_io_r_enum_domain_trusts("", rdata, 0, &r_u) ) {
|
||||
DEBUG(0,("api_ds_enum_domain_trusts: Failed to marshall DS_R_ENUM_DOM_TRUSTS.\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
DEBUG(6,("api_ds_enum_dom_trusts\n"));
|
||||
|
||||
return True;
|
||||
}
|
||||
#endif /* JERRY */
|
||||
|
||||
/*******************************************************************
|
||||
array of \PIPE\NETLOGON operations
|
||||
********************************************************************/
|
||||
@ -330,7 +366,10 @@ static struct api_struct api_net_cmds [] =
|
||||
{ "NET_SAMLOGOFF" , NET_SAMLOGOFF , api_net_sam_logoff },
|
||||
{ "NET_LOGON_CTRL2" , NET_LOGON_CTRL2 , api_net_logon_ctrl2 },
|
||||
{ "NET_TRUST_DOM_LIST", NET_TRUST_DOM_LIST, api_net_trust_dom_list },
|
||||
{ "NET_LOGON_CTRL" , NET_LOGON_CTRL , api_net_logon_ctrl }
|
||||
{ "NET_LOGON_CTRL" , NET_LOGON_CTRL , api_net_logon_ctrl },
|
||||
#if 0 /* JERRY */
|
||||
{ "DS_ENUM_DOM_TRUSTS", DS_ENUM_DOM_TRUSTS, api_ds_enum_dom_trusts }
|
||||
#endif /* JERRY */
|
||||
};
|
||||
|
||||
void netlog_get_pipe_fns( struct api_struct **fns, int *n_fns )
|
||||
|
@ -775,4 +775,21 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
|
||||
return status;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
_ds_enum_dom_trusts
|
||||
*************************************************************************/
|
||||
#if 0 /* JERRY -- not correct */
|
||||
NTSTATUS _ds_enum_dom_trusts(pipes_struct *p, DS_Q_ENUM_DOM_TRUSTS *q_u,
|
||||
DS_R_ENUM_DOM_TRUSTS *r_u)
|
||||
{
|
||||
NTSTATUS status = NT_STATUS_OK;
|
||||
|
||||
/* TODO: According to MSDN, the can only be executed against a
|
||||
DC or domain member running Windows 2000 or later. Need
|
||||
to test against a standalone 2k server and see what it
|
||||
does. A windows 2000 DC includes its own domain in the
|
||||
list. --jerry */
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif /* JERRY */
|
||||
|
@ -737,9 +737,9 @@ BOOL check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract,
|
||||
{
|
||||
if ( strequal(pipe_names[i].client_pipe, pname)
|
||||
&& (abstract->version == pipe_names[i].abstr_syntax.version)
|
||||
&& (memcmp(&abstract->uuid, &pipe_names[i].abstr_syntax.uuid, sizeof(RPC_UUID)) == 0)
|
||||
&& (memcmp(&abstract->uuid, &pipe_names[i].abstr_syntax.uuid, sizeof(struct uuid)) == 0)
|
||||
&& (transfer->version == pipe_names[i].trans_syntax.version)
|
||||
&& (memcmp(&transfer->uuid, &pipe_names[i].trans_syntax.uuid, sizeof(RPC_UUID)) == 0) )
|
||||
&& (memcmp(&transfer->uuid, &pipe_names[i].trans_syntax.uuid, sizeof(struct uuid)) == 0) )
|
||||
{
|
||||
struct api_struct *fns = NULL;
|
||||
int n_fns = 0;
|
||||
|
@ -7,8 +7,8 @@
|
||||
* Copyright (C) Marc Jacobsen 1999,
|
||||
* Copyright (C) Jeremy Allison 2001-2002,
|
||||
* Copyright (C) Jean François Micouleau 1998-2001,
|
||||
* Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002.
|
||||
* Copyright (C) Gerald (Jerry) Carter 2003.
|
||||
* Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002,
|
||||
* Copyright (C) Gerald (Jerry) Carter 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
|
||||
|
@ -3,7 +3,7 @@
|
||||
* RPC Pipe client / server routines
|
||||
* Copyright (C) Andrew Tridgell 1992-2000,
|
||||
* Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
|
||||
* Copyright (C) Jean François Micouleau 1998-2000,
|
||||
* Copyright (C) Jean François Micouleau 1998-2000,
|
||||
* Copyright (C) Jeremy Allison 2001-2002,
|
||||
* Copyright (C) Gerald Carter 2000-2003,
|
||||
* Copyright (C) Tim Potter 2001-2002.
|
||||
@ -4283,10 +4283,11 @@ static BOOL construct_printer_info_5(Printer_entry *print_hnd, PRINTER_INFO_5 *p
|
||||
static BOOL construct_printer_info_7(Printer_entry *print_hnd, PRINTER_INFO_7 *printer, int snum)
|
||||
{
|
||||
char *guid_str = NULL;
|
||||
GUID guid;
|
||||
UUID_FLAT guid;
|
||||
|
||||
if (is_printer_published(print_hnd, snum, &guid)) {
|
||||
asprintf(&guid_str, "{%s}", smb_uuid_string_static(guid));
|
||||
asprintf(&guid_str, "{%s}",
|
||||
smb_uuid_string_static(smb_uuid_unpack_static(guid)));
|
||||
strupper_m(guid_str);
|
||||
init_unistr(&printer->guid, guid_str);
|
||||
printer->action = SPOOL_DS_PUBLISH;
|
||||
|
@ -69,7 +69,7 @@ static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli,
|
||||
POLICY_HND pol;
|
||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||
DOM_SID *dom_sid;
|
||||
GUID *dom_guid;
|
||||
struct uuid *dom_guid;
|
||||
fstring sid_str;
|
||||
char *domain_name = NULL;
|
||||
char *dns_name = NULL;
|
||||
@ -128,7 +128,7 @@ static NTSTATUS cmd_lsa_query_info_policy(struct cli_state *cli,
|
||||
|
||||
if (info_class == 12) {
|
||||
printf("domain GUID is ");
|
||||
print_guid(&dom_guid);
|
||||
smb_uuid_string_static(*dom_guid);
|
||||
}
|
||||
done:
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user