samba.git
24 years agoThis commit was manufactured by cvs2svn to create tag samba-misc-tags/tng/release-alpha-0-1
cvs2svn Import User [Tue, 8 Feb 2000 17:40:36 +0000 (17:40 +0000)]
This commit was manufactured by cvs2svn to create tag
'release-alpha-0-1'.

24 years agopreparing for release of alpha.0.1
Samba Release Account [Tue, 8 Feb 2000 17:40:35 +0000 (17:40 +0000)]
preparing for release of alpha.0.1

24 years agohm, someone changed open_socket_in and didn't do a make proto :)
Luke Leighton [Tue, 8 Feb 2000 16:34:46 +0000 (16:34 +0000)]
hm, someone changed open_socket_in and didn't do a make proto :)

24 years agocreating user alias groups and user domain groups.
Luke Leighton [Tue, 8 Feb 2000 09:10:47 +0000 (09:10 +0000)]
creating user alias groups and user domain groups.

24 years agodisabled but pwnotreq accounts were being allowed login access, i don't
Luke Leighton [Tue, 8 Feb 2000 05:48:25 +0000 (05:48 +0000)]
disabled but pwnotreq accounts were being allowed login access, i don't
think this should be allowed.  disabled is disabled, end of story.

24 years agopolicy link for rest of msrpc daemons.
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.

24 years agothis weird-looking code uses the user_struct* that was obtained from
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 :)

24 years ago1) made standard_sub_vuser take a const user_struct* instead of a const
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.

24 years agofirst stage of making some sort of "thread" context ... er, thing :) in
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.

i hope.

24 years agoPort of rebind argument to lib/util_sock:open_socket_in() function.
Tim Potter [Tue, 8 Feb 2000 03:13:38 +0000 (03:13 +0000)]
Port of rebind argument to lib/util_sock:open_socket_in() function.

24 years agoHOORAY! password setting is back. this through fixing policy handle
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.

i'm not sure i like that code...

24 years agohmm, looks like there's a bug in become_unix_sec_ctx(), it does a
Luke Leighton [Tue, 8 Feb 2000 00:15:08 +0000 (00:15 +0000)]
hmm, looks like there's a bug in become_unix_sec_ctx(), it does a
become_initial_uid and _then_ checks to see if the context hasn't
changed.  odd.

24 years agofinally got bugs fixed in rpcclient samuserset command. hint: don't
Luke Leighton [Tue, 8 Feb 2000 00:02:15 +0000 (00:02 +0000)]
finally got bugs fixed in rpcclient samuserset command.  hint: don't
typecast things to void*...

24 years agotrying to sort out policy handle state info, and making a mess of it.
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.

24 years agomissed one vuid to user_key conversion.
Luke Leighton [Mon, 7 Feb 2000 20:06:25 +0000 (20:06 +0000)]
missed one vuid to user_key conversion.

24 years agoSpelling flame. (-:
Tim Potter [Mon, 7 Feb 2000 05:26:41 +0000 (05:26 +0000)]
Spelling flame.  (-:

24 years agoargh. had to add a "minimalist" creds interface back in. reason:
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.

i forgot about that.

24 years agooops, i put the lm# in the trust account not the nt#.
Luke Leighton [Mon, 7 Feb 2000 02:41:56 +0000 (02:41 +0000)]
oops, i put the lm# in the trust account not the nt#.

24 years agoAdded *.lo to .cvsignore file.
Tim Potter [Mon, 7 Feb 2000 01:24:41 +0000 (01:24 +0000)]
Added *.lo to .cvsignore file.

24 years agonew loop-back authentication mechanism.
Luke Leighton [Sun, 6 Feb 2000 20:38:47 +0000 (20:38 +0000)]
new loop-back authentication mechanism.

24 years agowe're back full circle! i removed the "creds" interface. it turns out
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.

24 years agomake proto
Luke Leighton [Sun, 6 Feb 2000 16:54:45 +0000 (16:54 +0000)]
make proto

24 years agopatch from sander for svcctl conversion.
Luke Leighton [Sun, 6 Feb 2000 16:50:56 +0000 (16:50 +0000)]
patch from sander for svcctl conversion.

24 years agoimplemented invalidate_vuid as a tdb_delete.
Luke Leighton [Sun, 6 Feb 2000 05:30:23 +0000 (05:30 +0000)]
implemented invalidate_vuid as a tdb_delete.

24 years agothis is probably one of THE most reluctant commits i've ever made.
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.

24 years ago*sigh*. libsamnt5ldap doesn't compile. libsamtdb shouldn't be compiled
Luke Leighton [Sat, 5 Feb 2000 23:37:02 +0000 (23:37 +0000)]
*sigh*.  libsamnt5ldap doesn't compile.  libsamtdb shouldn't be compiled
either - not on a make install, anyway!

24 years agoadded libsampass* to install-lib SHARED_LIBS.
Luke Leighton [Sat, 5 Feb 2000 20:33:30 +0000 (20:33 +0000)]
added libsampass* to install-lib SHARED_LIBS.

24 years agoadding functions that are common-code between samrtdbd and samrnt5ldapd
Luke Leighton [Sat, 5 Feb 2000 18:19:35 +0000 (18:19 +0000)]
adding functions that are common-code between samrtdbd and samrnt5ldapd
so as not to waste luke howard's time.

security checks in netlogond on _net_srv_pwset(): account-type checking.

24 years agopatch from elrond for _lsa_query_info_policy conversion.
Luke Leighton [Sat, 5 Feb 2000 17:43:03 +0000 (17:43 +0000)]
patch from elrond for _lsa_query_info_policy conversion.

elrond, could you please collapse reply_xxx() functions into api_xxx()
as they are static?  makes the code look cleaner!  thx!

24 years agonetlogontdbd now links. i had to disable net_login_general() from
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.

24 years agoreplacing enumeration of passdb/*.c in _net_sam_sync with _samr* API.
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.

24 years agofinally getting somewhere by creating an _samr* API as a library.
Luke Leighton [Fri, 4 Feb 2000 22:38:07 +0000 (22:38 +0000)]
finally getting somewhere by creating an _samr* API as a library.

the idea is to never, ever call passdb/*.c or groupdb/*.c functions
[which are an abomination] but to use _samr_*() instead.

e.g, smbpasswd calls _samr_set_userinfo() instead of mod_smbpwd_entry().

24 years agodummy functions need to be unique.
Luke Leighton [Fri, 4 Feb 2000 21:13:39 +0000 (21:13 +0000)]
dummy functions need to be unique.

24 years agoconsistency updates to luke howard's work. make sure it compiles
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

24 years agopatch from luke howard to do a passdb/*.c-compatible nt5 ldap schema.
Luke Leighton [Fri, 4 Feb 2000 18:58:18 +0000 (18:58 +0000)]
patch from luke howard to do a passdb/*.c-compatible nt5 ldap schema.

he also created a samrnt5ldapd, this is the beginning of it.

24 years agomake proto
Luke Leighton [Fri, 4 Feb 2000 18:38:31 +0000 (18:38 +0000)]
make proto

24 years agopatch from Elrond for _lsa_lookup_sids conversion. starting with
Luke Leighton [Fri, 4 Feb 2000 18:23:58 +0000 (18:23 +0000)]
patch from Elrond for _lsa_lookup_sids conversion.  starting with
creating [unused] UNISTR2* dynamic memory allocation routines.

24 years agocompletes the patch to create and use standard_sub_vuser(). in some
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().

24 years agocreating vuser-specific substitution function standard_sub_vuser().
Luke Leighton [Fri, 4 Feb 2000 16:58:54 +0000 (16:58 +0000)]
creating vuser-specific substitution function standard_sub_vuser().

24 years agook, this _is_ as big as it looks, conceptually, and i haven't even
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!

24 years agoacb_info in usr21, not acct_ctrl
Luke Leighton [Fri, 4 Feb 2000 00:35:24 +0000 (00:35 +0000)]
acb_info in usr21, not acct_ctrl

24 years agomore fixing up netlogond. const issues. removed pass_check_smb() it
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.

is that ok?

24 years agolooking to fix nt error message reporting in rpc client code
Luke Leighton [Thu, 3 Feb 2000 23:57:16 +0000 (23:57 +0000)]
looking to fix nt error message reporting in rpc client code

24 years agoanother removal of get_smbpwd_entry() calls.
Luke Leighton [Thu, 3 Feb 2000 23:38:57 +0000 (23:38 +0000)]
another removal of get_smbpwd_entry() calls.

the last one to do here is the sam sync code, which needs improvements
anyway.

24 years agoohh YESS! this is so COOL!
Luke Leighton [Thu, 3 Feb 2000 21:46:41 +0000 (21:46 +0000)]
ohh YESS!  this is so COOL!

implemented get_md4pwd(), instead of in terms of get_smbpwd_entry(),
in terms of _samr_xxx() api calls.

it does this:

_samr_connect
_samr_open_domain
_samr_lookup_user
_samr_open_user
_samr_query_userinfo(info level 0x12, just added, to get password hash :-)
_samr_close
_samr_close
_samr_close

and what do you know?  it actually worked!

24 years agocreating _samr_set_userinfo info level 0x12.
Luke Leighton [Thu, 3 Feb 2000 21:09:07 +0000 (21:09 +0000)]
creating _samr_set_userinfo info level 0x12.
adding code to report security attack if api_samr_set_userinfo is called
with info level 0x12.

24 years agomake proto
Luke Leighton [Thu, 3 Feb 2000 20:07:16 +0000 (20:07 +0000)]
make proto

24 years agoignore libtool
Luke Leighton [Thu, 3 Feb 2000 20:03:50 +0000 (20:03 +0000)]
ignore libtool

24 years agopatch from elrond for make_dom_refs to UNICODE
Luke Leighton [Thu, 3 Feb 2000 20:03:08 +0000 (20:03 +0000)]
patch from elrond for make_dom_refs to UNICODE

24 years agoclean-up of sander's netlogon patch, it didn't compile.
Luke Leighton [Thu, 3 Feb 2000 20:01:31 +0000 (20:01 +0000)]
clean-up of sander's netlogon patch, it didn't compile.

24 years agopatch from ignacio to get --with-ldap compiling.
Luke Leighton [Thu, 3 Feb 2000 18:18:51 +0000 (18:18 +0000)]
patch from ignacio to get --with-ldap compiling.

24 years agopatch from sander striker for netlogon api conversion
Luke Leighton [Thu, 3 Feb 2000 17:01:18 +0000 (17:01 +0000)]
patch from sander striker for netlogon api conversion

24 years agocompile error SAM_USER_INFO_16 no exist.
Luke Leighton [Thu, 3 Feb 2000 16:53:44 +0000 (16:53 +0000)]
compile error SAM_USER_INFO_16 no exist.

24 years agomake proto
Luke Leighton [Thu, 3 Feb 2000 08:07:31 +0000 (08:07 +0000)]
make proto

24 years agoattempting to debug samr_set_userinfo. definite memory corruption.
Luke Leighton [Thu, 3 Feb 2000 08:06:38 +0000 (08:06 +0000)]
attempting to debug samr_set_userinfo.  definite memory corruption.

24 years agoattempting to track down a weird sam_set_userinfo bug. maybe this is
Luke Leighton [Thu, 3 Feb 2000 07:58:05 +0000 (07:58 +0000)]
attempting to track down a weird sam_set_userinfo bug.  maybe this is
another memory corruption.

24 years agofixed a couple of bugs about where the sam tdb databases are stored.
Luke Leighton [Thu, 3 Feb 2000 06:29:09 +0000 (06:29 +0000)]
fixed a couple of bugs about where the sam tdb databases are stored.
created a /usr/local/samba/sam directory, which must be world-readable,
in which world-readable but root-only-writeable sam tdb databases are
created.

i will obfuscate the passwords with a syskey (root-only-accessible), later.

24 years agocommented out marshalling code for SAM_USER_INFO_12, which is the NT
Luke Leighton [Thu, 3 Feb 2000 05:37:02 +0000 (05:37 +0000)]
commented out marshalling code for SAM_USER_INFO_12, which is the NT
and LM#es in-the-clear.  these can ONLY be accessed, therefore, by
calling _samr_query_userinfo() NOT by calling api_samr_query_userinfo()
and therefore NOT by calling samr_query_userinfo() EITHER.

24 years agoadded samr_query_userinfo() info level 0x12. returns LM# + NT# in-the-clear.
Luke Leighton [Thu, 3 Feb 2000 05:34:26 +0000 (05:34 +0000)]
added samr_query_userinfo() info level 0x12.  returns LM# + NT# in-the-clear.

added EXPLICIT code that BANS info level 0x12 from being returned
over-the-wire.  hey, actually, why did i add info level 0x12 to
parse_samr.c _anyway_????

*muur*!

24 years agocreated a sam tdb init function. needed to create sam tdb databases
Luke Leighton [Thu, 3 Feb 2000 05:09:39 +0000 (05:09 +0000)]
created a sam tdb init function.  needed to create sam tdb databases
as root, and "prep" them with domains / aliases etc (well-known)
but adding the well-known aliases comes later, because there's no
code for that, yet!

24 years agomissed _more_ code from sean millichamp.
Luke Leighton [Thu, 3 Feb 2000 05:03:04 +0000 (05:03 +0000)]
missed _more_ code from sean millichamp.

24 years agomissed some stuff from sean. how???
Luke Leighton [Thu, 3 Feb 2000 04:59:36 +0000 (04:59 +0000)]
missed some stuff from sean.  how???

24 years agoDocumentation updates for examples/VFS
Tim Potter [Thu, 3 Feb 2000 04:12:05 +0000 (04:12 +0000)]
Documentation updates for examples/VFS

24 years agovery minor cleanup / review. nice work, sean!
Luke Leighton [Thu, 3 Feb 2000 03:37:36 +0000 (03:37 +0000)]
very minor cleanup / review.  nice work, sean!

24 years agohooray! usrmgr "user" view works with samtdb! at last.
Luke Leighton [Thu, 3 Feb 2000 01:56:43 +0000 (01:56 +0000)]
hooray!  usrmgr "user" view works with samtdb!  at last.

24 years ago_finally_. lots of messing about, got samr_query_sec_obj working in samrtdbd
Luke Leighton [Thu, 3 Feb 2000 01:50:19 +0000 (01:50 +0000)]
_finally_.  lots of messing about, got samr_query_sec_obj working in samrtdbd

24 years agoin an attempt to create samrtdbd, i noticed comments that sam op code 0x3
Luke Leighton [Thu, 3 Feb 2000 00:58:59 +0000 (00:58 +0000)]
in an attempt to create samrtdbd, i noticed comments that sam op code 0x3
is actually a query security object call.  *dur*!  explains why that
code was such a mess :)

added rpcclient samquerysec command to help write a proper opcode 0x3
response (first the client, now the server :)

24 years agopatch from sean millichamp for net_file_enum conversion
Luke Leighton [Wed, 2 Feb 2000 23:04:55 +0000 (23:04 +0000)]
patch from sean millichamp for net_file_enum conversion

24 years agopatch from elrond to do more libraritising (rpc_parse/*.c).
Luke Leighton [Wed, 2 Feb 2000 21:56:25 +0000 (21:56 +0000)]
patch from elrond to do more libraritising (rpc_parse/*.c).

patch from elrond starting on lsa_lookup_names conversion.

patch from sander for netlogond conversion.

24 years agoThis commit was manufactured by cvs2svn to create branch 'SAMBA_TNG'.
cvs2svn Import User [Wed, 2 Feb 2000 21:56:21 +0000 (21:56 +0000)]
This commit was manufactured by cvs2svn to create branch 'SAMBA_TNG'.

24 years agopatch frm elrond to fix samr_lookup_rids. thanks!
Luke Leighton [Wed, 2 Feb 2000 21:30:02 +0000 (21:30 +0000)]
patch frm elrond to fix samr_lookup_rids.  thanks!

24 years agopatch from sean millichamp for srv_net_conn_enum conversion
Luke Leighton [Wed, 2 Feb 2000 20:15:40 +0000 (20:15 +0000)]
patch from sean millichamp for srv_net_conn_enum conversion

24 years agotrying to get enough info into a SAM_USER_INFO_21 to get usrmgr.exe working.
Luke Leighton [Tue, 1 Feb 2000 23:56:08 +0000 (23:56 +0000)]
trying to get enough info into a SAM_USER_INFO_21 to get usrmgr.exe working.

24 years agodebugging broken unicode-string-compare
Luke Leighton [Tue, 1 Feb 2000 23:19:41 +0000 (23:19 +0000)]
debugging broken unicode-string-compare

24 years agoconverted spoolss code to use the dynamic void* handle system that the
Luke Leighton [Tue, 1 Feb 2000 22:07:47 +0000 (22:07 +0000)]
converted spoolss code to use the dynamic void* handle system that the
rest of the server code uses.  jean-francois, if you wanted to
dynamically allocate the print notify structures, they could be
freed automatically by a free_print_hnd_info() function, see
samrd/srv_samr_tdb.c for at least 3 examples and rpc_client/cli_connect.c
for another.

24 years agojean-f's idea to return an NT_STATUS #define instead of 0x0
Luke Leighton [Tue, 1 Feb 2000 20:32:16 +0000 (20:32 +0000)]
jean-f's idea to return an NT_STATUS #define instead of 0x0

elrond's patch to convert lsa_enum_trust_doms.

24 years agotidyup. created samrtdbd because it's smarter than having --with-samtdb.
Luke Leighton [Tue, 1 Feb 2000 08:08:24 +0000 (08:08 +0000)]
tidyup.  created samrtdbd because it's smarter than having --with-samtdb.
can now test each of them by just terminating samrd and running samrtdb.
samrtdbd has to be explicitly made.

commented out all passdb/*.c and groupdb/*.c code from sam tdb.

bug-fix.  samrsetuser2 now has a -c[lear] acb bits as well as a -s[et] acb
tests showed that samr_set_userinfo2 container was set up wrong.

24 years agorenamed some of the unknown samr functions because, well... we know their names!
Luke Leighton [Tue, 1 Feb 2000 06:51:01 +0000 (06:51 +0000)]
renamed some of the unknown samr functions because, well... we know their names!

24 years agoadded two new proto files. messing with rpc_samr.h, reordering the
Luke Leighton [Tue, 1 Feb 2000 06:25:18 +0000 (06:25 +0000)]
added two new proto files.  messing with rpc_samr.h, reordering the
#define list to see what opcodes are missing.

24 years agodunno what these are, it's late and i'm tired. i think they're bug-fixes.
Luke Leighton [Tue, 1 Feb 2000 05:54:41 +0000 (05:54 +0000)]
dunno what these are, it's late and i'm tired.  i think they're bug-fixes.
i also added rpc_client_proto.h and libsmb_proto.h but they're not yet
used.

24 years agomake proto
Luke Leighton [Tue, 1 Feb 2000 05:07:19 +0000 (05:07 +0000)]
make proto

24 years agopatch from sean millichamp for _srv_sess_enum conversion
Luke Leighton [Tue, 1 Feb 2000 05:03:27 +0000 (05:03 +0000)]
patch from sean millichamp for _srv_sess_enum conversion

24 years agodebugging some memory corruption. stop freeing NULL pointers, for a start.
Luke Leighton [Tue, 1 Feb 2000 04:51:14 +0000 (04:51 +0000)]
debugging some memory corruption.  stop freeing NULL pointers, for a start.

24 years agoInitialise num_names and names variables to avoid crash bug in
Tim Potter [Tue, 1 Feb 2000 04:38:36 +0000 (04:38 +0000)]
Initialise num_names and names variables to avoid crash bug in
cmd_sam_lookup_rids() function.

24 years agofixing up samtdb _sam_set_userinfo() at info levels 23 and 24, and
Luke Leighton [Tue, 1 Feb 2000 02:53:38 +0000 (02:53 +0000)]
fixing up samtdb _sam_set_userinfo() at info levels 23 and 24, and
_sam_set_userinfo2 at level 16.

24 years agosystem_name not server_name
Luke Leighton [Tue, 1 Feb 2000 01:55:29 +0000 (01:55 +0000)]
system_name not server_name

24 years agominor tidyup of sean's share enum work.
Luke Leighton [Tue, 1 Feb 2000 00:45:26 +0000 (00:45 +0000)]
minor tidyup of sean's share enum work.

added a samtdb _samr_query_dispinfo function, users only.

24 years agopatch from sean millichamp for _net_srv_get_info and _net_share_enum.
Luke Leighton [Tue, 1 Feb 2000 00:37:00 +0000 (00:37 +0000)]
patch from sean millichamp for _net_srv_get_info and _net_share_enum.

24 years agocreated samtdb _sam_lookup_names (only does users at the moment).
Luke Leighton [Tue, 1 Feb 2000 00:14:47 +0000 (00:14 +0000)]
created samtdb _sam_lookup_names (only does users at the moment).
_really_ need a UNICODE string library.

24 years agobug-fix in api call of samr_lookup_rids (oops).
Luke Leighton [Mon, 31 Jan 2000 23:25:08 +0000 (23:25 +0000)]
bug-fix in api call of samr_lookup_rids (oops).

implementing a samtdb samr_lookup_rids, it only does users right now.
i _meant_ to do samr_lookup_names so i could see if samr_query_userinfo
was working *duur*!

24 years agoimplemented samtdb _samr_query_userinfo() level 21 only.
Luke Leighton [Mon, 31 Jan 2000 22:43:35 +0000 (22:43 +0000)]
implemented samtdb _samr_query_userinfo() level 21 only.

24 years agoimproved samtdb create user command to actually check things like:
Luke Leighton [Mon, 31 Jan 2000 22:09:28 +0000 (22:09 +0000)]
improved samtdb create user command to actually check things like:

- does the account name already exist? (use _sam_lookup_names to check)?

- do an ntname to unixname to uid to create-me-a-rid and use that
as the rid for the user.  i use sursalgdomonly.c to do this.

24 years agocreated an algorithmic surs table implementation, it does the local
Luke Leighton [Mon, 31 Jan 2000 21:17:53 +0000 (21:17 +0000)]
created an algorithmic surs table implementation, it does the local
SAM database only.  it doesn't do BUILTIN (and it won't, ever).
it doesn't do domain member SAM (and it won't, ever).

but i need it as a first implementation for the samtdb database.

24 years agopatch from elrond for _lsa_open_secret conversion.
Luke Leighton [Mon, 31 Jan 2000 20:33:22 +0000 (20:33 +0000)]
patch from elrond for _lsa_open_secret conversion.

24 years agofrom elrond. this patch is NOT as large as it looks.
Luke Leighton [Mon, 31 Jan 2000 19:58:56 +0000 (19:58 +0000)]
from elrond.  this patch is NOT as large as it looks.

we're trying to subdivide the code down into independent libraries,
and that includes first the prototypes (starting with rpc_parse_proto.h)
and then moving on to the structures.

the idea is to be able to do --enable-maintainer-mode and not damn well
have EVERYTHING recompile if a make proto is done!

24 years agowhoa! implemented tdb _samr_enum_dom_users(). amazingly simple code.
Luke Leighton [Mon, 31 Jan 2000 07:23:44 +0000 (07:23 +0000)]
whoa!  implemented tdb _samr_enum_dom_users().  amazingly simple code.

24 years agoadded a tdb_create_user and implemented tdb's _samr_create_dom_user().
Luke Leighton [Mon, 31 Jan 2000 06:50:02 +0000 (06:50 +0000)]
added a tdb_create_user and implemented tdb's _samr_create_dom_user().
currently the RID is hard-coded to 1000 so that i can get _something_
in the user tdb database, and i can then implement _samr_enum_dom_users().

24 years agosome ideas are JUST so cool, i can't get over it.
Luke Leighton [Mon, 31 Jan 2000 06:00:43 +0000 (06:00 +0000)]
some ideas are JUST so cool, i can't get over it.

created the following two functions:

int prs_tdb_store(TDB_CONTEXT *tdb, int flgs, prs_struct *pk, prs_struct *pd);
void prs_tdb_fetch(TDB_CONTEXT *tdb, prs_struct *pk, prs_struct *pd);

they are SO cool, it's unbelievable.  one prs_struct is used as a key,
the other as data.  they are used like this, which does a lookup of a
UNICODE domain name to look up the SID associated with it.

andrew, i'm in love with the tdb database code!

the point of using smb_io_unistr2 and smb_io_dom_sid is that these create
NDR (network data representation) flattened versions of the two
variable-length data structures, uni_domain and sid.  so it's an optimal
usage of pre-existing functions and also a reasonably optimal use of
database space (i cannot be bothered to write better disk-space-saving code
because these smb_io_() functions already exist).

p.s did i say i love the tdb code, already?

static uint32 tdb_lookup_domain(TDB_CONTEXT *tdb,
const UNISTR2* uni_domain,
DOM_SID *sid)
{
prs_struct key;
prs_struct data;
UNISTR2 uni_dom_copy;

copy_unistr2(&uni_dom_copy, uni_domain);

prs_init(&key, 0, 4, False);
if (!smb_io_unistr2("dom", &uni_dom_copy, True, &key, 0))
{
return NT_STATUS_NO_MEMORY;
}

prs_tdb_fetch(tdb, &key, &data);

if (!smb_io_dom_sid("sid", sid, &data, 0))
{
prs_free_data(&key);
prs_free_data(&data);
return NT_STATUS_NO_SUCH_DOMAIN;
}

prs_free_data(&key);
prs_free_data(&data);

return 0x0;
}

24 years agosam tdb code-split. implementing each of sam db, dom db, usr db, grp db,
Luke Leighton [Mon, 31 Jan 2000 05:14:33 +0000 (05:14 +0000)]
sam tdb code-split.  implementing each of sam db, dom db, usr db, grp db,
als db in separate modules.

24 years agostarted on samtdb.
Luke Leighton [Mon, 31 Jan 2000 03:39:40 +0000 (03:39 +0000)]
started on samtdb.

- added a passdb_path() function, returns a path to the password directory,
currently same as lock_path()

- added an extra parameter (void*) to tdb_traverse(), needed instead of
having to provide static data structures accessed by the higher order
function, you pass in a void* pointer and that gets called in to the
traverse function.

- created a unistr2upper which is a botch-job, it won't cope with non-ascii
alphabets.  oh well.

- hack-job creates sam.tdb which contains SIDs for the main sam domain
(global_sam_name) and the BUILTIN domain.

- got _samr_connect() and _samr_connect_anon() working.  and _samr_close().
and _samr_lookup_domain().  and _samr_enum_domains().  that concludes
the necessary work for the first level.  the next level is, say...
_samr_open_domain() and associated routines, which is going to be fun,
including samr_enum_dom_users() etc...