rpcclient is still supported. the -S server option has been dropped
(except on the command-line), in favour of specifying \\servername
or //servername as the first argument.
Luke Leighton [Thu, 10 Feb 2000 14:57:55 +0000 (14:57 +0000)]
yess :) fixed the client / server reusage mixup by adding code to msrpc_find
that checks the vuser_key. all client-side connections must now be separated
by the client's security context (vuser_key).
Luke Leighton [Thu, 10 Feb 2000 14:13:35 +0000 (14:13 +0000)]
interesting. this is quite a problem, i don't know the solution, yet.
client-side security contexts from msrpc functions *called* in smbd
are being confused with server-side security contexts in pass-through
(loop-back) msrpc functions!
Luke Leighton [Thu, 10 Feb 2000 05:50:11 +0000 (05:50 +0000)]
well _that_ was unbelievably easy!!! switched off read-only in netmon,
edited the opcode until i got the right one, then it turns out that
lsa_create_secret is identical to lsa_open_secret except for the opcode.
anyway, upshot is: added rpcclient createsecret command.
why am i doing this? :) because i want to add lsa_create_secret(),
lsa_set_secret() to lsarpcd, which will then allow me to create
trust accounts ($MACHINE.ACC) *without* writing them direct to
/usr/local/samba/private/DOMAINNAME.MACHINENAME.mac.
i'm fed up with rpcclient having passdb/*.c and groupdb/*.c code linked
in to it.
Tim Potter [Wed, 9 Feb 2000 23:47:04 +0000 (23:47 +0000)]
Preliminary commit of ntdom nss module allowing users and groups to be
resolved from a remote sam database on a nt machine. This is pretty
rough at the moment:
- server name hardcoded into winbindd.c
- single threaded, blocking server
- must rm -f /tmp/winbindd before running server
- no memory leak checking
- only _nss_ntdom_getpwnam_r function fully implemented
It's still pretty funky though. I'm only committing it for tridge and
jeremy to have a look. (-:
Luke Leighton [Wed, 9 Feb 2000 19:24:28 +0000 (19:24 +0000)]
replace standard_sub_basic() and samlogon_user with standard_sub_vuser.
currently code does NOT pick up correct user-context, so %U and %G will
NOT be substituted.
Luke Leighton [Tue, 8 Feb 2000 05:45:48 +0000 (05:45 +0000)]
policy link for rest of msrpc daemons.
fixing createuser command to take a -p option. currently, the default
action for samrtdbd if no password is specified is to set the account
to "DISABLED" and "NOPASSWORDREQUIRED". setting this with the
samuserset2 rpcclient command is a minor pain in the neck.
Luke Leighton [Tue, 8 Feb 2000 05:02:33 +0000 (05:02 +0000)]
this weird-looking code uses the user_struct* that was obtained from
an SMBsesssetupX to provide a response to api_WkstaUserLogon and
api_NetUserGetInfo.
IF my suspicions are correct, an api_NetUserGetInfo or api_WkstaUserLogon
against an anonymous IPC$ connection will produce a failure, resulting
in the Win9x client DROPPING the anonymous connection and re-establishing
an authenticated SMBsesssetupX.
this will cause the smbd server to get a NET_USER_INFO_3 structure from
either the PDC or from itself (MSRPC remote or MSRPC loop-back, doesn't
matter which, it's all the same to domain_client_validate()), thence the
api_Net... or api_Wksta... call to follow will be provided with the correct
user logon info.
it also means that we can start filling in some of the "stub" fields,
such as last_logon_time, with _real_ info. well, real, if netlogond
bothered to fill it in, but you get the idea :)
Luke Leighton [Tue, 8 Feb 2000 04:25:56 +0000 (04:25 +0000)]
1) made standard_sub_vuser take a const user_struct* instead of a const
vuser_key*. this stops stupid-amounts of linking to all sorts of
crap in programs like make_codepage and testprns, which know _nothing_
of users. the original link was just a temporary hack to get binaries.
2) make vuid_free_user_struct() free the vuser malloc'd structure, too.
Luke Leighton [Tue, 8 Feb 2000 03:43:58 +0000 (03:43 +0000)]
first stage of making some sort of "thread" context ... er, thing :) in
the msrpc code. it's not really threads, it's just a thread context,
so that if different thread-contexts are requested, then the msrpc daemon
will at least be able to switch user-security-context.
eventually, i will have to go so far as to be able to reconstruct PDUs
depending on the user context, but that will require one socket per
thread-context, and some means to set that up *inside* the Bind/Bind-Request
processing code [argh!], because that's what triggers a "new" user-context,
really.
Luke Leighton [Tue, 8 Feb 2000 00:36:10 +0000 (00:36 +0000)]
HOORAY! password setting is back. this through fixing policy handle
chain linking _and_ an odd bug where password_ok() was ZERO_STRUCTING
the NET_USER_INFO_3 structure and it was being stored in the vuser.tdb
table, blanking out the NT user info!
i added code to authorise_login() to get and then store the vuser info
after seeing it set vuser->guest = True.
Luke Leighton [Mon, 7 Feb 2000 23:46:09 +0000 (23:46 +0000)]
trying to sort out policy handle state info, and making a mess of it.
how to set up user-security-context info on a per-connection basis:
each POLICY_HND that is created must have a vuser_key associated with
it. this must be transferred from POLICY_HND to POLICY_HND (e.g
samr_open_domain(connect_pol, &domain_pol)
{
policy_link_key(connect_pol, domain_pol);
}
so that the user session key can be picked up from a chain of samr_connect(),
samr_open_domain(), samr_open_user(), samr_set_userinfo().
the only consistent info is the POLICY_HND, passed from one call to the next.
Luke Leighton [Mon, 7 Feb 2000 03:08:57 +0000 (03:08 +0000)]
argh. had to add a "minimalist" creds interface back in. reason:
pass-through (rpcclient->smbd->msrpcdaemon) doesn't know anything about
how to let msrpcdaemon "inherit" the credentials of the smbd process.
Luke Leighton [Sun, 6 Feb 2000 18:39:28 +0000 (18:39 +0000)]
we're back full circle! i removed the "creds" interface. it turns out
that there is, in the DCE/RPC bind request, a 32-bit field (assoc_gid).
i'm overloading that with the CALLER's pid. combined with the context_id
field, which is 16-bit, that can be overloaded with the smbd vuid, we
have sufficient info to make MSRPC calls over loop-back that reference
the correct vuid database.
Luke Leighton [Sun, 6 Feb 2000 05:17:28 +0000 (05:17 +0000)]
this is probably one of THE most reluctant commits i've ever made.
it's far-reaching, and necessary.
this adds a vuser_struct tdb database, with a key [smbd's pid, vuid].
smbd uses it in every instance of standard_sub() and standard_sub_vuser().
that's almost every single SMB call for any IPC$ access.
the next stage is to remove sesssetup_user, probably sessetup_user_list too,
and review all occurences of standard_sub_basic used by smbd because if
they use standard_sub_basic() they might be expecting to read sesssetup_user,
and if they do _that_, they should be using standard_sub_vuser() instead.
all i wanted was a means to get vuids across to msrpc daemons.
Luke Leighton [Sat, 5 Feb 2000 15:24:13 +0000 (15:24 +0000)]
netlogontdbd now links. i had to disable net_login_general() from
using "update encrypted" because the method used (update_smbpasswordfile)
is, as you can see, specific to the smbpasswd file!
i need to create a "create SAM user" function for this to be done properly.
Luke Leighton [Fri, 4 Feb 2000 23:41:30 +0000 (23:41 +0000)]
replacing enumeration of passdb/*.c in _net_sam_sync with _samr* API.
netlogontdbd fails to link (deliberately) because it's not linked
with the passdb/*.c API. by the time i'm finished, it will, because
there won't _be_ any references to the passdb/*.c API.
Luke Leighton [Fri, 4 Feb 2000 19:23:49 +0000 (19:23 +0000)]
consistency updates to luke howard's work. make sure it compiles
in non-ldap environments. luke, i did this by moving the typedefs
for LDAPDB and related typedefs to _outside_ the #ifdef WITH_NT5LDAP
Luke Leighton [Fri, 4 Feb 2000 17:58:45 +0000 (17:58 +0000)]
completes the patch to create and use standard_sub_vuser(). in some
instances i have added UID_FIELD_INVALID so that standard_sub_vuser
defaults to the same functionality and standard_sub_basic().
Luke Leighton [Fri, 4 Feb 2000 05:16:57 +0000 (05:16 +0000)]
ok, this _is_ as big as it looks, conceptually, and i haven't even
done what i wanted to: this is only preparation!!!!
i started off in smbd/lanman.c, and noticed that api_NetUserGetInfo
takes all its info from user_struct *vuser. i thought, that's odd,
that doesn't look right.
then i realised that the info there is exactly what is contained in
the NET_USER_INFO_3 structure: the return result from an NT Domain
User Logon.
various lights went on, and i realised that when an SMBsesssetupX
is carried out, internally, NT must do an NT Domain User Logon
with the SMB user's challenge/response password, and then store the
return result associated with the SMB session.
in this way, when an api_NetUserGetInfo call comes in, the CORRECT
info can be returned, not some faked-up information.
anyway, this commit is all the consequences of putting NET_USER_INFO_3
into user_struct, which feeds up through _several_ layers of function
calls. i sort-of understood that i needed to do this, but not quite.
the upshot of this is that user_struct now contains the REAL nt
domain username (in NET_USER_INFO_3) so the confusion between nt
user names and unix usernames now can be removed from samba code.
if you want a unix user name, you use vuser->unix_name.
if you want an NT user name, you use (UNISTR2*)vuser->usr.uni_user_name.
p.s it's in UNICODE :)
p.p.s if you want the RID of the user, it's vuser->usr.user_rid.
p.p.p.s there's over 25 NT-specific other bits of info in NET_USER_INFO_3
too!
Luke Leighton [Fri, 4 Feb 2000 04:59:31 +0000 (04:59 +0000)]
1) added void* state argument to tdb_traverse. guess what! there were
two places i found where it was appropriate to _use_ that third argument,
in locking.c and brlock.c! there was a static traverse_function and
i removed the static variable, typecast it to a void*, passed it to
tdb_traverse and re-cast it back to the traverse_function inside the
tdb_traverse function. this makes the use of tdb_traverse() reentrant,
which is never going to happen, i know, i just don't like to see
statics lying about when there's no need for them.
as i had to do in samba-tng, all uses of tdb_traverse modified to take
the new void* state argument.
2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient.
i don't know how the other samba team members would react if i deleted
rpcclient from cvs main. damn, that code's so old, it's unreal.
20 rpcclient commands, instead of about 70 in SAMBA_TNG.
Luke Leighton [Fri, 4 Feb 2000 00:23:34 +0000 (00:23 +0000)]
more fixing up netlogond. const issues. removed pass_check_smb() it
was a nuisance. someone should check that this is ok to do, cos i
got rid of an if (lp_null_passwords()) call! we now have ACB_PWNOTREQ
bits set on a per-user basis.