summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/util_hnd.c28
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c28
-rw-r--r--source3/rpc_server/srv_reg.c17
-rw-r--r--source3/smbd/server.c6
5 files changed, 70 insertions, 10 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 43780df9f8..38f868ef00 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3334,6 +3334,7 @@ BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
BOOL get_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd);
BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name);
+BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name);
BOOL close_lsa_policy_hnd(POLICY_HND *hnd);
/*The following definitions come from rpc_server/srv_netlog.c */
diff --git a/source3/lib/util_hnd.c b/source3/lib/util_hnd.c
index dabc5520ff..d53264a73e 100644
--- a/source3/lib/util_hnd.c
+++ b/source3/lib/util_hnd.c
@@ -271,9 +271,10 @@ BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name)
{
struct policy *p = find_lsa_policy(hnd);
- if (p && p->open) {
- DEBUG(3,("Setting policy pnum=%x name=%s\n",
- p->pnum, name));
+ if (p && p->open)
+ {
+ DEBUG(3,("Getting policy pnum=%x\n",
+ p->pnum));
fstrcpy(p->dev.reg.name, name);
return True;
@@ -284,6 +285,27 @@ BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name)
}
/****************************************************************************
+ set reg name
+****************************************************************************/
+BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name)
+{
+ struct policy *p = find_lsa_policy(hnd);
+
+ if (p && p->open)
+ {
+ DEBUG(3,("Setting policy pnum=%x name=%s\n",
+ p->pnum, name));
+
+ fstrcpy(name, p->dev.reg.name);
+ DEBUG(5,("getting policy reg name=%s\n", name));
+ return True;
+ }
+
+ DEBUG(3,("Error getting policy reg name\n"));
+ return False;
+}
+
+/****************************************************************************
close an lsa policy
****************************************************************************/
BOOL close_lsa_policy_hnd(POLICY_HND *hnd)
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index dabc5520ff..d53264a73e 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -271,9 +271,10 @@ BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name)
{
struct policy *p = find_lsa_policy(hnd);
- if (p && p->open) {
- DEBUG(3,("Setting policy pnum=%x name=%s\n",
- p->pnum, name));
+ if (p && p->open)
+ {
+ DEBUG(3,("Getting policy pnum=%x\n",
+ p->pnum));
fstrcpy(p->dev.reg.name, name);
return True;
@@ -284,6 +285,27 @@ BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name)
}
/****************************************************************************
+ set reg name
+****************************************************************************/
+BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name)
+{
+ struct policy *p = find_lsa_policy(hnd);
+
+ if (p && p->open)
+ {
+ DEBUG(3,("Setting policy pnum=%x name=%s\n",
+ p->pnum, name));
+
+ fstrcpy(name, p->dev.reg.name);
+ DEBUG(5,("getting policy reg name=%s\n", name));
+ return True;
+ }
+
+ DEBUG(3,("Error getting policy reg name\n"));
+ return False;
+}
+
+/****************************************************************************
close an lsa policy
****************************************************************************/
BOOL close_lsa_policy_hnd(POLICY_HND *hnd)
diff --git a/source3/rpc_server/srv_reg.c b/source3/rpc_server/srv_reg.c
index 18781d0cd0..10b9bac90c 100644
--- a/source3/rpc_server/srv_reg.c
+++ b/source3/rpc_server/srv_reg.c
@@ -187,23 +187,32 @@ static void reg_reply_info(REG_Q_INFO *q_u,
uint32 status = 0;
REG_R_INFO r_u;
- uint32 type = 1;
+ uint32 type = 0xcafeface;
BUFFER2 buf;
+ fstring name;
+
+ ZERO_STRUCT(buf);
DEBUG(5,("reg_info: %d\n", __LINE__));
- if (status == 0 && find_lsa_policy_by_hnd(&(q_u->pol)) == -1)
+ if (status == 0x0 && !get_lsa_policy_reg_name(&q_u->pol, name))
{
status = 0xC000000 | NT_STATUS_INVALID_HANDLE;
}
- if (status == 0)
+ if (status == 0 &&
+ strequal(name, "SYSTEM\\CurrentControlSet\\Control\\ProductOptions"))
{
char *key = "LanmanNT";
make_buffer2(&buf, key, strlen(key));
- make_reg_r_info(&r_u, &type, &buf, status);
+ type = 0x1;
+ }
+ else
+ {
+ status = 0x2; /* Win32 status code. ick */
}
+ make_reg_r_info(&r_u, &type, &buf, status);
/* store the response in the SMB stream */
reg_io_r_info("", &r_u, rdata, 0);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index c59e189a9d..590d8533b3 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -125,6 +125,8 @@ static BOOL open_sockets(BOOL is_daemon,int port,int port445)
int s;
int i;
+ memset(&fd_listenset, 0, sizeof(fd_listenset));
+
if (!is_daemon) {
return open_sockets_inetd();
}
@@ -186,11 +188,13 @@ max can be %d\n",
return(False);
fd_listenset[0] = s;
FD_SET(s,&listen_set);
+#if 0
s = open_server_socket(port445, interpret_addr(lp_socket_address()));
if (s == -1)
return(False);
fd_listenset[1] = s;
FD_SET(s,&listen_set);
+#endif
}
/* now accept incoming connections - forking a new process
@@ -221,11 +225,13 @@ max can be %d\n",
ClientPort = SMB_PORT;
break;
}
+#if 0
if(FD_ISSET(fd_listenset[i * 2 + 1],&lfds)) {
s = fd_listenset[i * 2 + 1];
ClientPort = SMB_PORT2;
break;
}
+#endif
}
/* Clear this so we don't look