summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/domain_namemap.c2
-rw-r--r--source3/lib/sids.c2
-rw-r--r--source3/lib/util.c27
-rw-r--r--source3/lib/util_pwdb.c11
4 files changed, 40 insertions, 2 deletions
diff --git a/source3/lib/domain_namemap.c b/source3/lib/domain_namemap.c
index fb6ecf2acf..ed4325a4d7 100644
--- a/source3/lib/domain_namemap.c
+++ b/source3/lib/domain_namemap.c
@@ -891,6 +891,8 @@ static BOOL lookup_remote_ntname(const char *ntname, DOM_SID *sid, uint8 *type)
uint8 *types;
const char *names[1];
+ DEBUG(5,("lookup_remote_ntname: %s\n", ntname));
+
if (!cli_connect_serverlist(&cli, lp_passwordserver()))
{
return False;
diff --git a/source3/lib/sids.c b/source3/lib/sids.c
index 7eb968a435..c75168ee56 100644
--- a/source3/lib/sids.c
+++ b/source3/lib/sids.c
@@ -196,7 +196,7 @@ BOOL get_domain_sids(DOM_SID *sid3, DOM_SID *sid5, char *servers)
if (!cli_connect_serverlist(&cli, servers))
{
- DEBUG(0,("get_member_domain_sid: unable to initialise client connection.\n"));
+ DEBUG(0,("get_domain_sids: unable to initialise client connection.\n"));
return False;
}
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 8a9452ee00..9a4d0d9e25 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2931,6 +2931,33 @@ void out_ascii(FILE *f, unsigned char *buf,int len)
}
}
+void out_struct(FILE *f,char *buf1,int len, int per_line)
+{
+ unsigned char *buf = (unsigned char *)buf1;
+ int i;
+
+ if (len<=0)
+ {
+ return;
+ }
+
+ fprintf(f, "{\n\t");
+ for (i=0;i<len;)
+ {
+ fprintf(f, "0x%02X",(int)buf[i]);
+ i++;
+ if (i != len)
+ {
+ fprintf(f, ", ");
+ }
+ if (i%per_line == 0 && i != len)
+ {
+ fprintf(f, "\n\t");
+ }
+ }
+ fprintf(f, "\n};\n");
+}
+
void out_data(FILE *f,char *buf1,int len, int per_line)
{
unsigned char *buf = (unsigned char *)buf1;
diff --git a/source3/lib/util_pwdb.c b/source3/lib/util_pwdb.c
index f78bdfff5d..0bf0cd9c4f 100644
--- a/source3/lib/util_pwdb.c
+++ b/source3/lib/util_pwdb.c
@@ -625,7 +625,16 @@ BOOL pwdb_initialise(BOOL is_server)
}
else
{
- if (!get_domain_sids(&global_member_sid, &global_sam_sid, global_myname))
+ char *srvs;
+ if (lp_server_role() == ROLE_DOMAIN_PDC)
+ {
+ srvs = global_myname;
+ }
+ else
+ {
+ srvs = lp_passwordserver();
+ }
+ if (!get_domain_sids(&global_member_sid, &global_sam_sid, srvs))
{
return False;
}