mirror of
https://github.com/samba-team/samba.git
synced 2025-01-04 05:18:06 +03:00
0ce128e355
pdus, and then feeds them over either a "local" function call or a "remote"
function call to an msrpc service. the "remote" msrpc daemon, on the
other side of a unix socket, then calls the same "local" function that
smbd would, if the msrpc service were being run from inside smbd.
this allows a transition from local msrpc services (inside the same smbd
process) to remote (over a unix socket).
removed reference to pipes_struct in msrpc services. all msrpc processing
functions take rpcsrv_struct which is a structure containing state info
for the msrpc functions to decode and create pdus.
created become_vuser() which does everything not related to connection_struct
that become_user() does.
removed, as best i could, connection_struct dependencies from the nt spoolss
printing code.
todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific
info on a per-connection basis, and if the connection dies then so does
the info, and that's a fairly serious problem.
had to put pretty much everything that is in user_struct into parse_creds.c
to feed unix user info over to the msrpc daemons. why? because it's
expensive to do unix password/group database lookups, and it's definitely
expensive to do nt user profile lookups, not to mention pretty difficult
and if you did either of these it would introduce a complication /
unnecessary interdependency. so, send uid/gid/num_groups/gid_t* +
SID+num_rids+domain_group_rids* + unix username + nt username + nt domain
+ user session key etc. this is the MINIMUM info identified so far that's
actually implemented. missing bits include the called and calling
netbios names etc. (basically, anything that can be loaded into
standard_sub() and standard_sub_basic()...)
(This used to be commit aa3c659a8d
)
113 lines
3.4 KiB
C
113 lines
3.4 KiB
C
|
|
/*
|
|
* Unix SMB/Netbios implementation.
|
|
* Version 1.9.
|
|
* RPC Pipe client / server routines
|
|
* Copyright (C) Andrew Tridgell 1992-1997,
|
|
* Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
|
|
* Copyright (C) Paul Ashton 1997.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
|
|
#include "includes.h"
|
|
#include "nterr.h"
|
|
|
|
extern int DEBUGLEVEL;
|
|
extern pstring global_myname;
|
|
|
|
|
|
/*******************************************************************
|
|
create_wks_info_100
|
|
********************************************************************/
|
|
static void create_wks_info_100(WKS_INFO_100 *inf)
|
|
{
|
|
pstring my_name;
|
|
pstring domain;
|
|
|
|
DEBUG(5,("create_wks_info_100: %d\n", __LINE__));
|
|
|
|
pstrcpy (my_name, global_myname);
|
|
strupper(my_name);
|
|
|
|
pstrcpy (domain , lp_workgroup());
|
|
strupper(domain);
|
|
|
|
make_wks_info_100(inf,
|
|
0x000001f4, /* platform id info */
|
|
lp_major_announce_version(),
|
|
lp_minor_announce_version(),
|
|
my_name, domain);
|
|
}
|
|
|
|
/*******************************************************************
|
|
wks_reply_query_info
|
|
|
|
only supports info level 100 at the moment.
|
|
|
|
********************************************************************/
|
|
static void wks_reply_query_info(WKS_Q_QUERY_INFO *q_u,
|
|
prs_struct *rdata,
|
|
int status)
|
|
{
|
|
WKS_R_QUERY_INFO r_u;
|
|
WKS_INFO_100 wks100;
|
|
|
|
DEBUG(5,("wks_query_info: %d\n", __LINE__));
|
|
|
|
create_wks_info_100(&wks100);
|
|
make_wks_r_query_info(&r_u, q_u->switch_value, &wks100, status);
|
|
|
|
/* store the response in the SMB stream */
|
|
wks_io_r_query_info("", &r_u, rdata, 0);
|
|
|
|
DEBUG(5,("wks_query_info: %d\n", __LINE__));
|
|
}
|
|
|
|
/*******************************************************************
|
|
api_wks_query_info
|
|
********************************************************************/
|
|
static void api_wks_query_info( rpcsrv_struct *p, prs_struct *data,
|
|
prs_struct *rdata )
|
|
{
|
|
WKS_Q_QUERY_INFO q_u;
|
|
|
|
/* grab the net share enum */
|
|
wks_io_q_query_info("", &q_u, data, 0);
|
|
|
|
/* construct reply. always indicate success */
|
|
wks_reply_query_info(&q_u, rdata, 0x0);
|
|
}
|
|
|
|
|
|
/*******************************************************************
|
|
\PIPE\wkssvc commands
|
|
********************************************************************/
|
|
struct api_struct api_wks_cmds[] =
|
|
{
|
|
{ "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info },
|
|
{ NULL , 0 , NULL }
|
|
};
|
|
|
|
/*******************************************************************
|
|
receives a wkssvc pipe and responds.
|
|
********************************************************************/
|
|
BOOL api_wkssvc_rpc(rpcsrv_struct *p, prs_struct *data)
|
|
{
|
|
return api_rpcTNP(p, "api_wkssvc_rpc", api_wks_cmds, data);
|
|
}
|
|
|