1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

2291 Commits

Author SHA1 Message Date
Luke Leighton
073c8652c1 pass_check.c could receive encrypted password: printing it out as a %s
results in garbage.  with no password length argument doing dump_data(
100, password, strlen(password)) is the next best alternative.
0001-01-01 00:00:00 +00:00
Luke Leighton
e0b5a866ce oops, accidentally committed clear-text password reading last week. 0001-01-01 00:00:00 +00:00
Luke Leighton
188d9a75ed Bejamin Kuit. #define MYSQL and MYSQL_ROW to void iff <mysql.h> not found. 0001-01-01 00:00:00 +00:00
Luke Leighton
167b0b20e3 spelling mistake, #ifdef'd out for non-developers (oops!) 0001-01-01 00:00:00 +00:00
Luke Leighton
4e89fbb7d9 oops, put -DDEBUG_PASSWORD in wrong place. 0001-01-01 00:00:00 +00:00
Luke Leighton
eb63fbdb68 Benjamin Kuit's mods. 0001-01-01 00:00:00 +00:00
Luke Leighton
d59a2e669a Benjamin Kuit's latest mysql mods. issue with "make proto" needs to be
resolved.
0001-01-01 00:00:00 +00:00
Luke Leighton
511ef8a58c added <mysql.h> autoconf test. 0001-01-01 00:00:00 +00:00
Luke Leighton
fdf61e1dab Benjamin Kuit's MYSQL SAM Database implementation.
Copyright (C) Benjamin Kuit <bj@mcs.uts.edu.au> 1999.
0001-01-01 00:00:00 +00:00
Luke Leighton
8b859797aa improving syntax / useability of rpcclient "shutdown" command:
rpcclient [-m messsage] [-t timeout] [-r or --reboot].
0001-01-01 00:00:00 +00:00
Matthew Chapman
cb5428308d Return either STATUS_BUFFER_OVERFLOW or ERRDOS/ERRmoredata depending on
whether the client supports 32-bit error codes.
0001-01-01 00:00:00 +00:00
Matthew Chapman
d1cc33bcb6 Added "lookupdomain" rpcclient command. Not particularly useful currently
(you can do "lookupdomain MYDOMAIN" and "lookupdomain BUILTIN" and the
results won't be too surprising), but it will come in useful testing the
new password database code I'm working on.
0001-01-01 00:00:00 +00:00
Matthew Chapman
7d03e6e219 Win9x user level security.
* Added SAMR_LOOKUP_DOMAIN (-> SamrLookupDomainInSamServer)

* Added real SAMR_ENUM_DOM_GROUPS (corresponding to
SamrEnumerateGroupsInDomain). The existing one is just an alias for
SamrQueryDisplayInformation (see below).

* Added three extra info levels to SAMR_QUERY_DISPINFO. Info level 3 is
what was previously SAMR_ENUM_DOM_GROUPS; info levels 4 and 5 are
simple user/group list requests used by Win9x and I suspect (haven't
checked) the "low speed connection" User Manager.

* Added another two aliases for SAMR_QUERY_DISPINFO, opcodes 0x30 and
0x33. Usually the first is with info level 3 and the second 4 but there is
some overlap so indeed these should be implemented as just aliases.

* Return ERRDOS/ERRmoredata on extra data instead of
STATUS_BUFFER_OVERFLOW for Win95's benefit. On a named pipe this results
in an SMBreadX as usual.

Still need to fix SAMR_QUERY_DOMAIN_INFO which has a hard-coded number of
users and groups - which Win95 proceeds to truncate at.
0001-01-01 00:00:00 +00:00
Luke Leighton
ec1b7000fd added jeremy's new c++-like code for parsing of security descriptors. 0001-01-01 00:00:00 +00:00
Luke Leighton
e164b5080c samr_lookup_names "none found" error needed corrections with empty lists. 0001-01-01 00:00:00 +00:00
Luke Leighton
2d5fc5c7cf last unix group not being listed. spotted by jacques sansdrap. 0001-01-01 00:00:00 +00:00
Luke Leighton
66e2787ab7 problem been there for months: reg_r_info not aligning after string buffer. 0001-01-01 00:00:00 +00:00
Michael Warfield
329ceaee49 Got to the bottom of another weird one...
Piping the output of smbmount back to autofs/automount was causing the
automount process to hang.  Reason was that automount was depending
on the pipe to close to continue on, rather than detecting the child
signal.  This occured with debug enabled and the daemon process was not
closing the stdout process.  Disabling debuging avoids the problem.
Debugging is turned off in the cvs repository and a warning placed over
the debugging option.
0001-01-01 00:00:00 +00:00
Luke Leighton
59f081069a rpcclient shutdown command 0001-01-01 00:00:00 +00:00
Luke Leighton
ba5919bcae bitmap to strings 0001-01-01 00:00:00 +00:00
Matthew Chapman
ce24191939 Always null-terminate strings.
Also some string length and sizeof(pointer) corrections.
0001-01-01 00:00:00 +00:00
Matthew Chapman
b314430b21 Always null-terminate strings. 0001-01-01 00:00:00 +00:00
Michael Warfield
ad8389804c Added caching of user password if it was entered via getpass. We were already
caching the password if it came from the command line or from the environment.
This completes the set and deals with the bloody nusance when reconnecting
a connection after we have gone daemon...  Grrr...

Added code to clean up the mount point following a catastrophic failure
during reconnect.  The smbmount daemon was exiting but leaving the mount
point in an unusable state.  If smbmount must exit following a reconnect
failure, we "unmount" the mount point and clean up mnttab.  Currently,
the unmount works, fixing some really ugly I/O errors and failure when
trying to remount.  The cleanup on mnttab still has problems.  This
is better than what it was and doesn't break anything that wasn't broken
before, so I'm committing this in even with the mnttab problem.  Will
commit the fix to that when I figure out what is busted there...

	-mhw-
0001-01-01 00:00:00 +00:00
Michael Warfield
4b4a706213 Fixed a glibc glitch in smbumount.c and reenabled some debugging
in smbmount.c
0001-01-01 00:00:00 +00:00
Luke Leighton
dad5baef19 const cast issues. [p.s - tidy work, matt!] 0001-01-01 00:00:00 +00:00
Luke Leighton
98ecb88704 const issues with byte mod / byte read macros. 0001-01-01 00:00:00 +00:00
Matthew Chapman
9ea91d89d2 Cut and paste error. 0001-01-01 00:00:00 +00:00
Matthew Chapman
a1d39af1ce UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination
string length (especially unistrcpy was rather dangerous; we were only
saved by the fact that datagrams are limited in size).
0001-01-01 00:00:00 +00:00
Luke Leighton
6a437cfb33 UNICODE issues. 0001-01-01 00:00:00 +00:00
Luke Leighton
73db80f341 the UNICODE issue... 0001-01-01 00:00:00 +00:00
Luke Leighton
b5396d3c6d enum dom users buffer was 0x80 not 0x8000. must fix "enumeration" code
as you need to make multiple enum dom users calls.
0001-01-01 00:00:00 +00:00
Luke Leighton
c1d65e9060 refinement of random ipc$ SMBtrans torture test. send requests, and
don't wait for responses :-)
0001-01-01 00:00:00 +00:00
Luke Leighton
d77de86858 uninitialised pointer being freed if lookupnames failed. oops. 0001-01-01 00:00:00 +00:00
Luke Leighton
c5109ff782 use jeremy's versions of the UNICODE routines. 0001-01-01 00:00:00 +00:00
Luke Leighton
3072044134 Having Well-known Domain Groups ("Domain Admins/Guests/Users") returned
under SID_NAME_ENUM 0x5 instead of 0x2 (Well-known group instead of
Domain Group) was making it impossible to view these groups from USRMGR.EXE.
0001-01-01 00:00:00 +00:00
Luke Leighton
56469578a1 groups and aliases being "manually" added which do not necessarily have
representation in the underlying database: removed this code.

for example, with the nt->unix mapping system (don't know about the ldap
one) if you want "Domain Admins" to appear you _must_ put it in the
domaingroup.map file.

the previous code was adding builtin aliases and well-known groups even
if they weren't in the domain maps.  bad idea.
0001-01-01 00:00:00 +00:00
Luke Leighton
fcaa121441 when multiple independent large rpc calls come in on the same pipe,
prev_pdu_file_offset was not being re-initialised to zero.
0001-01-01 00:00:00 +00:00
Luke Leighton
ac72fe1ab3 removal of the use of unistrn2 function: replace it with unistr2_to_str
which is more appropriate.
0001-01-01 00:00:00 +00:00
Luke Leighton
ddd3501982 pwdb_smb_to_sam was not returning NULL for nt name so that
pwdb_sam_map_names() was using a "blank" static string instead of
a NULL pointer for nt names.  NULL means over-ride, so the nt name
got left as "blank".

this causes nt clients to terminate with extreme prejudice.
0001-01-01 00:00:00 +00:00
Matthew Chapman
30a085bf80 Fix for NT BSOD problem. There's no reason to have two "NT usernames" running
around anyway.

The real problem is, once again, the brokenness of pwdb_sam_map_names et al.
This time it is deciding to return blank NT usernames, which NT's redirector
objects to.

I'm currently working on improving the pwdb/mapping code, should be ready in a
couple of weeks.
0001-01-01 00:00:00 +00:00
Luke Leighton
9084b7e33d UNICODE byte ordering issue: typecast to uint16* replaced with SSVAL() 0001-01-01 00:00:00 +00:00
Luke Leighton
9ab81caa06 reload_services needs to be called prior to init_files but after
get_myname.
0001-01-01 00:00:00 +00:00
Luke Leighton
d455c9d2c9 iteration of sam passwd entries was an order n-cubed algorithm due
to resolution of unix name to nt name being unnecessarily _inside_
another loop.
0001-01-01 00:00:00 +00:00
Luke Leighton
ed128c38a8 initialise my name (used in %h) prior to loading smb.conf files. 0001-01-01 00:00:00 +00:00
Luke Leighton
62118e15fe %s not $s 0001-01-01 00:00:00 +00:00
Luke Leighton
5b9a7278da corrections to get data stream for 2nd and subsequent pdus copied from
right place (forgot to subtract 0x18 header bytes)
0001-01-01 00:00:00 +00:00
Luke Leighton
f7dfa55a2e cache unix groups so that two-level getgrent calls don't occur. 0001-01-01 00:00:00 +00:00
Luke Leighton
f082f07e76 multiple dce/rpc PDUs failed to work after ntlmssp update was added. 0001-01-01 00:00:00 +00:00
Luke Leighton
d95bb252f8 server type announcements modified to include the "role" of the server:
domain member, pdc, bdc.
0001-01-01 00:00:00 +00:00
Michael Warfield
1cb8fcb33b Minor change to bring smbmount in the main branch in line with some bzero
to memset changes...
0001-01-01 00:00:00 +00:00
Luke Leighton
ce1ae86cbd comma after DOM_MAP_USER removed 0001-01-01 00:00:00 +00:00
Matthew Chapman
af83778abc Must set password length to 24 after we encrypt a password. 0001-01-01 00:00:00 +00:00
Matthew Chapman
1e3873111f Initialise NTTIME properly in make_reg_q_enum_key instead of using
unix_to_nt_time hack. Seems to me it's ignored anyway (dummy return
buffer?).
0001-01-01 00:00:00 +00:00
Matthew Chapman
e9c79c85e6 Fixed a domain functionality problem where NT clients would start
endlessly repeating a network SAMLOGON (hoping it to change, hmmm...).

( Guess what I found in pwdb_init_sam...

  unix_to_nt_time(&user->logon_time, (time_t)-1);
  unix_to_nt_time(&user->logoff_time, (time_t)-1);
  unix_to_nt_time(&user->kickoff_time, (time_t)-1);
  ... )
0001-01-01 00:00:00 +00:00
Matthew Chapman
e1e3875057 Added init_nt_time function which initialises an NTTIME to -1. 0001-01-01 00:00:00 +00:00
Michael Warfield
c5608093e4 Ok... Yet another round of fixes for smbmount and autofs.
1)  The earlier fix for the smbmount race conditions broke the PID
	registration with smbfs.  That fix has been backed out and
	replaced by a signalling convention from the child smbmount
	process back to the parent telling the parent when it is safe
	to exit.

2)  Fixing all of this uncovered a NASTY deadly embrace between smbmount,
	smbmnt, and autofs.  This was caused by the setsid call in the
	daemon code.  The smbmnt process no longer was registered as
	"magic" because it was no longer in the autofs process group.
	Many many kudos and thanks to H Peter Anvin for giving me the
	clue to solving this agravating puzzle.  The setsid was moved
	down the where the child signals the parent and a warn left in
	its place in the daemonize code.

3)  Fixed (actually worked around with a BUTT UGLY HACK) a problem with
	SMB_GET_MOUNTPID in smbumount.c.  The smb_fs.h header file has
	the parameter to this ioctl defined as a uid_t.  Unfortunately
	that's a 32 bit quantity under glibc and it's currently a 16 bit
	quantity in kernel space.  Undefined the macro and redefined
	it with a parameter of __kernel_uid_t.  That should keep us
	out of trouble till I can have someone fix smb_fs.h in the
	kernel sources...
0001-01-01 00:00:00 +00:00
Luke Leighton
ad58cdfac6 fix for enumerate domain users (bug spotted by sean matthews).
also needed to use start index properly and generate next index.

both client and server code need to recognise error code 0x105
when there's not enough room to store all the users in one call.

sort this out another time.
0001-01-01 00:00:00 +00:00
Luke Leighton
6d14db6a6c removed encrypt-password code pre-cli_session_setup(), session setup
fn decides whether to encrypt password or not.
0001-01-01 00:00:00 +00:00
Luke Leighton
14080a564a uni_svc_name not uni_srv_name 0001-01-01 00:00:00 +00:00
Luke Leighton
a022710f1e rpcclient "Service Control Manager" svcenum [-i] command. 0001-01-01 00:00:00 +00:00
Luke Leighton
61c40982d6 error code cleanup 0001-01-01 00:00:00 +00:00
Luke Leighton
17f4c5a785 returned cli_session_setup to previous behaviour. added a couple of
validation checks and also added capability to send plaintext passwords.
send "ntpasslen" of zero to do this.  sending same plaintext password
for pass and ntpass arguments will result in previous behaviour of
encrypting password if server supports it.
0001-01-01 00:00:00 +00:00
Luke Leighton
f4dd8f6b56 Service Control Manager - service enumeration. 0001-01-01 00:00:00 +00:00
Luke Leighton
0ed70972d7 set_port warning / unused / global/local variable overlap issues
cmd_svcctl.c tests got put into cvs by mistake.
0001-01-01 00:00:00 +00:00
Christopher R. Hertel
0681f6946b Fuss fuss fuss.
Added missing default: statements to two switch blocks.

Chris -)-----
0001-01-01 00:00:00 +00:00
Luke Leighton
2a509e9606 - got client code cleartext passwords working again in cli_session_setup.
needed this for some tests.

- removed code that said "if lm password is not encrypted then encrypt both
  lm and nt passwords".  actually it said "if lm password length is not 24
  bytes and we're in security=user mode..."

  it didn't bother to check whether the nt password was NULL or not, and
  doing the encryption inside cli_session_setup is the wrong place.

- checked all instances where cli_session_setup is called with cleartext
  passwords that are expected to then be encrypted (see above) with the
  test "if pwlen != 24...".  there was only one: all the others either
  provide encrypted passwords, do null sessions or use
  cli_establish_connection.

* recommendation: use cli_establish_connection() in smbwrapper/smbw.c
0001-01-01 00:00:00 +00:00
Luke Leighton
03967986ec compilation errors due to addition of smb file handle parameter. 0001-01-01 00:00:00 +00:00
Richard Sharpe
f6c7819266 Putting back the -p flag in smbclient.
However, it seems that the -s flag
in smbclient is also ignored :-(
0001-01-01 00:00:00 +00:00
Richard Sharpe
3598d90a32 More changes to get SSL working with 2.x.x
Now, we have most of the configure support done, next
have to fix Makefile.in and other things ...
0001-01-01 00:00:00 +00:00
Richard Sharpe
524c4d2978 Fixing up configure to properly support ssl 0001-01-01 00:00:00 +00:00
Richard Sharpe
fb6048bb86 Adding first of the fixes for SSL.
A whole bunch of string variables in loadparm.c were
not being initialized properly.  Programs crashed as a result.

This set of code not tested, but same code tested elsewhere,
and all this guarded by #ifdef HAVE_SSL
0001-01-01 00:00:00 +00:00
Matthew Chapman
63d7822b9d In security=user mode we must allow cli_connect_serverlist to connect to our
own smbd process, rather than complaining about a password server loop.
0001-01-01 00:00:00 +00:00
Matthew Chapman
f530e289c6 Added load_interfaces in smbpasswd to allow name resolution by broadcast and
multiple interfaces. (Jeremy already committed this in SAMBA_2_0).
0001-01-01 00:00:00 +00:00
Richard Sharpe
57301a3eb4 A small change to clitar.c (really, I promise :-)
If we are writing the tar file to stdout, set dbf to stderr
so that we do not screw up tar output with log info etc.

Compiles clean and tested with 38MB backup. Honest :-)
0001-01-01 00:00:00 +00:00
Matthew Chapman
15bd172530 eclass != ERRDOS && num != ERRmoredata
is not the same as
!(eclass == ERRDOS && num == ERRmoredata)

This was causing smbclient to segfault on receiving certain errors.
0001-01-01 00:00:00 +00:00
Matthew Chapman
2b6f481885 Fixed typo in srv_samr.c where samr_add_groupmem and samr_del_groupmem were
the wrong way around.
0001-01-01 00:00:00 +00:00
Matthew Chapman
91c77f5432 Finally committing my LDAP changes.
* Added new APIs for modifying groups.
* RIDs are allocated similarly to NT, starting from 1000 and incrementing by 1
  for each new user/group.
* RIDs are now consistently in hex

* Fixed bugs reported by Allan Bjorklund <allan@umich.edu>:
   - ldap_close_connection is exported by OpenLDAP - changed to ldap_disconnect
   - Missing ldap_connect() in getusergroups functions
   - ldap_next_entry was being called too early while retrieving a sam_struct
   - LDAP globals should be extern in sampassldap.c

* Fixed bugs reported by Martin Hofbauer <mh@bacher.at>
   - Newly added workstation trust accounts had attributes DU rather than W.
   - User dn's were forced to start with "uid=XX" rather than using the existing
     dn.
0001-01-01 00:00:00 +00:00
Gerald Carter
175e598dcc Fixed the "You password will expire in 0 days. Would you like to
change it now?" message when you login to a Samba Controlled domain.

The fix is a hard coded 42 days from right now until you need to
change you pasword again time (see passdb/sampassdb.c:pwdb_smb_to_sam())

Also fixed getsmbfilepwent() so that it will read in the last password
change time correctly.

* Related to this lib/util_pwdb.c:StrnCaseCmp() returns 0 if the
strings match.  Chouldn't this be the pther way?  Oh well.  I
didn't change the return code as it was used in several
other cases (see lib/util_pwdb.c:pwdb_get_last_set_time())
0001-01-01 00:00:00 +00:00
Gerald Carter
cabc7e739c fixed an uninitialized variable in lookupsmbgrpgid() and
lookupsmbpwuid that was causing a SEGFAULT in smbd.
0001-01-01 00:00:00 +00:00
Christopher R. Hertel
300a8c9e50 While writing the man page, I realized that it was a bit silly not to accept
command-line parameters.  I've added that capability.  Of course, the man
page is now wrong.  Sigh.

Chris -)-----
0001-01-01 00:00:00 +00:00
Christopher R. Hertel
d2d6f0bf36 Sorry that this is going so slowly.
I've added debug2html to Makefile.in so that it compiles as part of the
normal build.  Fixed a typo in debug2html.c as well.

One problem:  I found it necessary to link with both $(PARAM_OBJ) and
              $(LIB_OBJ).  The result is an executable that is much larger
              than it really needs to be.
0001-01-01 00:00:00 +00:00
Luke Leighton
a15a3f95f2 fix for potential lsass.exe crashing due to negative response from
LsaLookupNames being incorrect.  this is a bit wierd: why would the
lsass.exe on the nt _client_ crash due to an LsaLookupNames response
from a samba _server_?
0001-01-01 00:00:00 +00:00
Luke Leighton
090512e187 adding start of remote lookup for domain member role. 0001-01-01 00:00:00 +00:00
Luke Leighton
2485b8e706 lib_sec_ctxt.o not .c 0001-01-01 00:00:00 +00:00
Richard Sharpe
47e36bed8f Fixed problems in debug code because I did not compile
first :-(
0001-01-01 00:00:00 +00:00
Richard Sharpe
b75af70990 Added some debugging to clitar ... 0001-01-01 00:00:00 +00:00
Jeremy Allison
7be5c8e8f7 Fixed tar recurse bug.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d5f05b4fae Fix bug with nmbd running wild due to recursion in retransmit_or_expire_response_records().
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ccf6443887 and in head branch:
make sure we include sys/mman.h if available
0001-01-01 00:00:00 +00:00
Christopher R. Hertel
782474f41e A while back, Andrew and I talked about making the debug parsing code a
better "fit" with other Samba code.  This is a small first step toward
doing what (I think) we agreed to do.

I've moved the key function from ubiqx/debugparse.c into lib/debug.c.  I
have also moved the enum from ubiqx/debugparse.h into the debug section in
smb.h.

The next thing to do is to get debug2html added into the Makefile.in so
that it is always produced when compiling the suite.

Chris -)-----
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ef5f752a4a on Linux force fcntl/mmap based shared memory and on other systems
force IPC/shmem based shared memory.
0001-01-01 00:00:00 +00:00
Luke Leighton
c2bcb3a286 server_cryptkey() now calling cli_connectserverlist(). stupid microsoft
idiotic *SMBSERVER connectionism added to cli_connect_serverlist().
also added check for protocol < LANMAN2.
0001-01-01 00:00:00 +00:00
Luke Leighton
0b2095e092 added sid_name_use array argument to lsa_lookup_names and lsa_lookup_sids. 0001-01-01 00:00:00 +00:00
Luke Leighton
2cce78aa00 trying to track down issues in get_home_dir(). 0001-01-01 00:00:00 +00:00
Luke Leighton
f4b8a28306 %U substitution should be unix user not nt user 0001-01-01 00:00:00 +00:00
Luke Leighton
c6f2f58c74 adding svcctl parsing code 0001-01-01 00:00:00 +00:00
Luke Leighton
870bccb174 bugfix in smb_err_msg 0001-01-01 00:00:00 +00:00
Luke Leighton
ca10eb4490 oops, util_pwdb.c appears to be included in PASSDB_OBJ not LIB_OBJ. 0001-01-01 00:00:00 +00:00
Luke Leighton
dacf5b152b adding some enumerate services code, client and server. 0001-01-01 00:00:00 +00:00
Luke Leighton
501617307f need to initialise global_myworkgroup 0001-01-01 00:00:00 +00:00
Andrew Tridgell
be697c9ef0 removed the SID stuff from the head branch as well.
This allows the removal of PASSDB_OBJ, RPC_CLIENT_OBJ and
RPC_PARSE_OBJ from nmbd in the head branch.

so nmbd just went on a diet :)
0001-01-01 00:00:00 +00:00
Luke Leighton
e5ee965f8d adding "Service Control Manager" commands to rpcclient. 0001-01-01 00:00:00 +00:00
Jeremy Allison
b993081db1 Adding George's Mac extension code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
60c3e2f14d Adding George's Mac extension include files.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
f36cf3b6a7 ldap_getpw() also needs to be (void) 0001-01-01 00:00:00 +00:00
Luke Leighton
f11eb41658 compilation warnings due to missing (void) in ldap_close_connection. 0001-01-01 00:00:00 +00:00
Luke Leighton
d06d636994 adding srvsvc pipe. 0001-01-01 00:00:00 +00:00
Luke Leighton
2bc031e8fa added ldap files by Matthew Chapman. 0001-01-01 00:00:00 +00:00
Luke Leighton
8b36c7c08f Matthew Chapman spotted that smbpasschange was assuming the existence
of a private/smbpasswd file, this will not be the case for other
database APIs.  removed startsmbdb and endsmbpwdb calls because
add_smbpwd_entry() and mod_smbpwd_entry() don't need them.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5e2844d5ed fixed warnings (and potential errors) due to integer overflow when
creating locking masks
0001-01-01 00:00:00 +00:00
Luke Leighton
d11859041d updated for Matt Chapman's ldap code 0001-01-01 00:00:00 +00:00
Luke Leighton
57e0254946 issues spotted by herb. 0001-01-01 00:00:00 +00:00
Luke Leighton
2c438c86cb matthew chapman's ldap code, to date. plus docs! 0001-01-01 00:00:00 +00:00
Luke Leighton
8a85d7abed bugs in rpcclient. add_aliasmem uses a DOM_SID2 not a DOM_SID. 0001-01-01 00:00:00 +00:00
Luke Leighton
657f46edfb first attempt at making unix setuid/setgid code that is independent of
cnums and snums.
0001-01-01 00:00:00 +00:00
Luke Leighton
bee8f7fa6b removed nt_pipe_fnum from struct cli_state. need to be able to call
LsaLookupSids etc from within SamrQueryAliasMembers, for example.
fnum is now a parameter to client functions.  thanks to mike black
for starting the ball rolling.
0001-01-01 00:00:00 +00:00
Luke Leighton
b8175702ef - lib/unix_sec_ctxt.c
attempt at taking lib/uid.c and getting a unix security context
	change module that is independent of "cnums" and "snums".
	a security context is needed for pipes, not just IPC$ or other
	services.

- group database API

	added add_group/alias_member, del_group/alias_member,
	del_group/alias_entry functions.  del_builtin_entry() is
	deliberately set to NULL to cause an exception, you cannot
	delete builtin aliases.

- parse_lsa.c srv_lsa.c

	fixed lookup_names code, it was a load of trash and didn't do
	anything.

- cmd_samr.c rpcclient.c srv_samr.c

	added "deletegroup", "deletealias", "delaliasmem", "delgroupmem",
	"addgroupmem", "addaliasmem", "createalias", "creategroup", to
	both client and server code.

	server code calls into unix stubs right now, which don't actually
	do anything.  the only instance where they are expected to do
	anything is in appliance mode NOT even in the ldap code or anything.

	client code modified to call samr_lookup_names() for group code
	(because we can) and lsa_lookup_names() for alias code (because
	we have to).

- srv_lookup.c

	oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name
	instead of DOMAIN, name.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
783d4b3477 oops - lock test was the wrong way around 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f7ad78e369 fixed pidfile handling to check for a lock on the file, so we can be
sure it is a samba process that is running.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5287f3d19b Sync up critical kernel oplock bugfix. I don't want to lose
this....
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
bf15343def added delete domain group and local group and delete domain group member. 0001-01-01 00:00:00 +00:00
Luke Leighton
aabb4b3bc5 fixing "addgroupmem" and "enumgroups -m" commands, samr_open_group()
needed a flags fields as you get 0x0000 0010 and 0x0000 001f unknown
values for different purposes, no-one's going to tell us what they
are and i don't CARE!
0001-01-01 00:00:00 +00:00
Luke Leighton
165b15a8ca - oops, i got "add alias member" and "delete alias member" swapped.
- samr_enum_dom_users, the first 4 bytes is some sort of garbage,
  nt5-beta2 clears them out to zeros whereas nt4 does not.
  fixed bug where we were assuming that the first 4 bytes of a
  response _had_ to be non-zero.

- cli_lsarpc.c: forgot to append the rid on the lsa_lookup_names()
  client call.

- added in "addaliasmem" and "addgroupmem" commands.  the addaliasmem
  command actually turned out to be a "delaliasmem" :-) :-)

- parse_lsa.c: moved assert array check to after the size of useable
  array space is set...
0001-01-01 00:00:00 +00:00
Luke Leighton
eacc5e581a - renamed do_samr_xxx to samr_xxx
- renamed do_lsa_xxx to lsa_xxx

- added "enumgroups [-m]" command, enumerates groups, shows members.
- added cmd_sam_add_groupmem(), need to call these in rpcclient.c
- added cmd_sam_add_aliasmem(), need to call these in rpcclient.c

- modified "enumaliases [-m]" command

- improved "enumgroups" and "enumaliases" to display names not just RIDS/SIDs.

- renamed "samr_unknown_12" to "samr_lookup_rids".

- added the following client-side functions:

	get_samr_query_groupmem()
	get_samr_query_aliasmem()
	get_samr_query_groupinfo()
	samr_enum_dom_groups()
	samr_enum_dom_aliases()
	samr_add_aliasmem()
	samr_add_groupmem()

- improved display output (display.c)
0001-01-01 00:00:00 +00:00
Luke Leighton
4771d5451b added createalias command to rpcclient 0001-01-01 00:00:00 +00:00
Luke Leighton
1e5d81c154 create domain group command (creategroup) added to rpcclient.
renamed do_samr_xxxx to samr_xxxx.
0001-01-01 00:00:00 +00:00
Luke Leighton
ef58e48bc9 moved get_unixgroups it will be needed by the unix instance of the group
DB API
0001-01-01 00:00:00 +00:00
Luke Leighton
50fa4822df jean-f spotted race condition on generation of sam sid, from starting
nmbd and smbd.  nmbd is now client: smbd is solely responsible for
creating sam_name.SID
0001-01-01 00:00:00 +00:00
Luke Leighton
81be1e6076 jean-f spotted bug in test for existence of MACHINE.SID and SAM_NAME.SID. 0001-01-01 00:00:00 +00:00
Luke Leighton
13a656b0e5 adding group parsing: add/modify/delete/add members. 0001-01-01 00:00:00 +00:00
Luke Leighton
74f826af36 jeremy's going to do me in, again.
jean-francois' going to get annoyed, again.
andrew's going to threaten to take cvs access away, again.

missed compilation of this file when updating sam_unknown_12 call.
0001-01-01 00:00:00 +00:00
Luke Leighton
e39c0c76ae spotted the mistake in group_info1 parsing. 0001-01-01 00:00:00 +00:00
Luke Leighton
78a86c6496 added rid and sid_name_use to DOMAIN_GRP_MEMBER, for use in group member
query.

domain groups now work, hurrah!  only thing is that the description is
one character long, don't know why (which is wierd in itself).
0001-01-01 00:00:00 +00:00
Luke Leighton
9bce7340d6 ERRmoredata is an acceptable error code, it is not an error. 0001-01-01 00:00:00 +00:00
Luke Leighton
a74b6dcc76 removed check on name of domain having to be right, etc etc. 0001-01-01 00:00:00 +00:00
Luke Leighton
9266137fcb trailing backslashes spotted by andrej. 0001-01-01 00:00:00 +00:00
Luke Leighton
779a7aa30d issues spotted by andrej: %s\\%s not %s\%s 0001-01-01 00:00:00 +00:00
Luke Leighton
1c478ca172 string_to_sid was using next_token() this is bad as it stops you from
being able to use next_token() outside of string_to_sid calls.
use strchr instead
0001-01-01 00:00:00 +00:00
John Terpstra
195b860b46 Updated HEAD branch version to 2.1.0-prealpha in response to a user
complaint about confusion because both the HEAD and SAMBA_2_0 reported
the same version info.
0001-01-01 00:00:00 +00:00
Luke Leighton
9337049dfc adding group member code, made a start. found that the group members'
rid is needed not the name (see DOMAIN_GRP_MEMBER) decided to go home.
0001-01-01 00:00:00 +00:00
Luke Leighton
585d47644d ok. unix-nt mapping code issues
need to check, when looking up group members, that a group member is
a unix user [being mapped to an nt user] FIRST then if that fails
check that a group member is a unix group [being mapped to an nt group].

why?  because you can have group names in a unix /etc/group file with
the same name as users.

this _might_ be a problem...
0001-01-01 00:00:00 +00:00
Luke Leighton
9d4e810e7d check server role before doing nt user to unix user mapping 0001-01-01 00:00:00 +00:00
Luke Leighton
f7f2516df4 query_aliasmem code. it works (hurrah). 0001-01-01 00:00:00 +00:00
Luke Leighton
bfb75e58ce fixing smbpasswd to link to smbd to obtain domain sid 0001-01-01 00:00:00 +00:00
Luke Leighton
3e1eb4f26b rpc_samr.h parse_samr.c srv_samr.c :
samr_query_aliasmembers (cool!)

util_pwdb.c sids.c nmbd.c server.c smbpasswd.c swat.c :

	pwdb_initialise(BOOL is_server) now creates / reads DOMAIN_NAME.SID
	if is_server is True, and does LsaQueryInfoPolicy(levels 3 and 5)
	to obtain member and pdc sids.
0001-01-01 00:00:00 +00:00
Luke Leighton
faffcb3c89 andrej spotted that entries _not_ in domain map user were being refused.
modified map_nt_and_unix_names() to never refuse a mapping (returns void
now not BOOL).
0001-01-01 00:00:00 +00:00
Luke Leighton
2c0d91e64a hm. removed the "if failed to map nt name to unix name, fail tcon call"
restriction and "domain user map" seems to work.

amazing.
0001-01-01 00:00:00 +00:00
Luke Leighton
f5cedb8c96 fix to domain_namemap (domain, ntname wrong way round oops)
stupid compile errors with file_rename() call just created.
0001-01-01 00:00:00 +00:00
Luke Leighton
51c1c31768 adding some samr parsing calls (group / alias adding / deleting)
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists.
0001-01-01 00:00:00 +00:00
Luke Leighton
474f94f419 attempting to fix "domain user map" up, but it's a bit complicated.
i may simply go for a response in the NetSamLogon returning the
unix username, forcing the NT user to appear to be a unix user,
however even that is fraught with implications.

might just have to go the whole hog and do this tuple thing,
"unix_name + nt_name" always associated together...


issue with api_net_sam_logon, getsam21pwent() being called twice,
the second time overwriting static buffer data (argh) so had to
make a copy.

noticed a nested "become_root()"/"unbecome_root()" which will have
to be tracked down...
0001-01-01 00:00:00 +00:00
Luke Leighton
c5ba5fa6fe passdb.c now calls getpwnam() which returns results in a static buffer.
a call _outside_ of this was _also_ calling getpwnam.   the calls to
getsmbpwnam() were therefore overwriting the static buffer.
0001-01-01 00:00:00 +00:00
Luke Leighton
4b5bd4e18c pwdb_initialise() in the wrong place: must load smb.conf first. thanks phil. 0001-01-01 00:00:00 +00:00
Michael Warfield
12739f0456 Earlier fix for smbmount timing window was the wrong patch.
My bad...  Earlier one was the patch from the CIFS conference that
didn't work, this fixes...
0001-01-01 00:00:00 +00:00
Luke Leighton
3257b72c6e moving rpc/rpc.h to after netinet.h 0001-01-01 00:00:00 +00:00
Luke Leighton
603c5f6df8 another attempt at a fix on connect_serverlist()... 0001-01-01 00:00:00 +00:00
Luke Leighton
58c0f0a77c builtin alias password API 0001-01-01 00:00:00 +00:00
Luke Leighton
c0efc35b27 andrej spotted problem with connect_serverlist (starts off assuming
a connection succeeds...).
0001-01-01 00:00:00 +00:00
Luke Leighton
e4930f5f48 - adding builtin[alias]db.
- lib/sids.c:

	generate_sam_sid() modified to take a domain name: it now
	generates "DOMAIN_NAME.SID".  reasons:

	1) if you run multiple samba servers on the same machine
	under different netbios names as members of a domain,
	they won't all use the same SID, which is a _big_ mistake
	but it would happen _by default_.

	2) we have (had) a problem with sid_to_string() and string_to_sid()
	which cause SIDs to be incorrectly read.  one of the major
	reasons for *NOT* making this change was so as not to disrupt
	existing users.  but as they will be anyway by this bug,
	we might as well go ahead.

- passdb/smbpass.c:

	wanted to change the meaning of the name in the smbpasswd
	file to an "nt" name not a "unix" name.  this is probably
	not a good idea: reverted this.

- output formatting / bug-fixing in rpcclient query_useraliases code.
0001-01-01 00:00:00 +00:00
Luke Leighton
776abe3fe5 cvs getting it wrong. again. 0001-01-01 00:00:00 +00:00
Luke Leighton
e717b89840 enabling optimisation switches on some compiler warnings 0001-01-01 00:00:00 +00:00
Luke Leighton
b1d1c1337c "retired" two modules to preserve their cvs history.
added their replacements, added sam password database API modules
0001-01-01 00:00:00 +00:00
Luke Leighton
5d5d7e4de7 weekend work. user / group database API.
- split sam_passwd and smb_passwd into separate higher-order function tables

- renamed struct smb_passwd's "smb_user" to "unix_user".  added "nt_user"
plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd
password databases to fill in the blank entries that are not obtained
from whatever password database API instance is being used.

NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST
be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c
for the only example outside of the password database APIs i could find.

- added query_useraliases code to rpcclient.

- dealt with some nasty interdependencies involving non-smbd programs
and the password database API.  this is still not satisfactorily
resolved completelely, but it's the best i can do for now.

- #ifdef'd out some password database options so that people don't
mistakenly set them unless they recompile to _use_ those options.

lots of debugging done, it's still not finished.  the unix/NT uid/gid
and user-rid/group-rid issues are better, but not perfect.  the "BUILTIN"
domain is still missing: users cannot be added to "BUILTIN" groups yet,
as we only have an "alias" db API and a "group" db API but not "builtin-alias"
db API...
0001-01-01 00:00:00 +00:00
Andrew Tridgell
21d779bf7d removed include of net/route.h because it prevents compilation under
SCO 3.2 (including it also requires lots of streams stuff, making it a
total mess).

If this causes problems on some other platform then please add a
comment stating what platform and why the include is needed so we can
work out how to test for it properly.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
702263bba5 don't allow ".." in service name when doing "default service"
processing.
0001-01-01 00:00:00 +00:00
Tim Potter
5c0e31982e Now uninstalls man pages from correct source location.
Fix by Andrej Borsenkow <borsenkow.msk@sni.de>
0001-01-01 00:00:00 +00:00
Andrew Tridgell
386a3bfd33 make the help links appear in a separate window, so you can read the
docs and do configuration at the same time.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d3fa0dd7a8 better layout of password options. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
ed4d1062b2 install all html docs in yodl help directory 0001-01-01 00:00:00 +00:00
Tim Potter
c44b418d6f Replaced ZERO_STRUCT() with ZERO_STRUCTP() in cli_connect_serverlist().
Fix by Matt Chapman <m.chapman@student.unsw.edu.au>
0001-01-01 00:00:00 +00:00
Luke Leighton
e4ee653870 we have a problem: resolution of "Primary Group RID" which we assumed
would only be a domain group rid.  it can also be a local group rid,
which causes us problems in attempting to turn a unix gid into the
correct rid (domain group or local group).

sooo.... the fix is _in_ there, we just can't use it because it causes
link / knock-on problems in nmbd.
0001-01-01 00:00:00 +00:00
Luke Leighton
a24f6eb00b yeehaah got users to be included in S-1-5-xxx-yyy-zzz's local groups.
now need search capability on S-1-5-20, which will need argh, a
"group database API" on S-1-5-20, and the ability to add BUILTIN\Admins
etc to "local group map" argh.
0001-01-01 00:00:00 +00:00
Luke Leighton
591c63e3e1 fixing group database issues 0001-01-01 00:00:00 +00:00
Jeremy Allison
6acb4b68f6 Makefile.in: Added maintainer mode fixes.
aclocal.m4: Added AC_LIBTESTFUNC.
configure.in: Fixed -lsecurity -lsec problems.
client.c: dos_ fixes.
groupdb/aliasunix.c: Dead code removal.
include/includes.h: Added default PRINTCAP_NAME.
lib/genrand.c: dos_ fixes.
lib/replace.c: Added strtoul.
lib/system.c: dos_ fixes.
lib/util.c: dos_ fixes.
lib/util_sid.c: Signed/unsigned fixes.
lib/util_str.c: removed bad const.
locking/locking_slow.c: dos_ fixes.
printing/printing.c: dos_ fixes.
rpc_server/srv_samr.c: Dead code removal.
rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN !
smbd/dir.c: dos_ fixes.
smbd/open.c: dos_ fixes.
smbd/oplock.c: dos_ fixes.
smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes.

Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
68342a29a8 LsaLookupNames client call (first used as lookupnames command in rpcclient). 0001-01-01 00:00:00 +00:00
Luke Leighton
90a2466431 fixing domain join and domain login problems 0001-01-01 00:00:00 +00:00
Luke Leighton
06b9100c1c clearer debug comments 0001-01-01 00:00:00 +00:00
Luke Leighton
6de2b03d1c oops, forgot to rename smbfilegrp to smbunixgrp. 0001-01-01 00:00:00 +00:00
Luke Leighton
53b49b44e1 sorting out difference between aliases and groups in the cases where
unix groups are not explicitly mapped.

i.e as a PDC or BDC you can have domain groups, as a member of a domain
you cannot.

as a member of a domain, unmapped unix groups are assumed to be aliases,
and as a PDC or BDC, unmapped unix groups are assumed to be unix groups.

there is _one_ other check needed with aliases to be added: unmapped unix
groups that have the same name as an NT group on the PDC (for which i will
need to write an LsaLookupNames call) should be assumed to be domain groups
on the PDC.
0001-01-01 00:00:00 +00:00
Luke Leighton
2bcc540af8 jean-francois pointed out problem with "lp_domain_role()" code, you
could never be a PDC.
0001-01-01 00:00:00 +00:00
Luke Leighton
b67d66a1e9 initialise not initialize... 0001-01-01 00:00:00 +00:00
Jeremy Allison
252dd8b892 Fixed oplock test path spec bug.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
81b9020891 Fixed -Wall -Wshadow warning.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
403f53d696 uninitialised counter 0001-01-01 00:00:00 +00:00
Luke Leighton
c89642ff3f yp_prot.h and ypclnt.h correct: ypprot.h and yp_clnt.h wrong... 0001-01-01 00:00:00 +00:00
Luke Leighton
d502388234 re-added ypprot.h and yp_clnt.h 0001-01-01 00:00:00 +00:00
Luke Leighton
53339b6389 re-added includes for yp_prot.h and yp_clnt.h 0001-01-01 00:00:00 +00:00
Luke Leighton
0fdac4b42f get rid of __wait boring warning, caused by rpc/clnt.h 0001-01-01 00:00:00 +00:00
Luke Leighton
22802195ed cvs being STUPID 0001-01-01 00:00:00 +00:00
Luke Leighton
30b3f339f8 remove unused variable 0001-01-01 00:00:00 +00:00
Luke Leighton
16ac5c89b7 unused variable removed 0001-01-01 00:00:00 +00:00
Luke Leighton
ba78b5932a cvs being STUPID 0001-01-01 00:00:00 +00:00
Luke Leighton
10e4cbd264 cvs is acting wierd. 0001-01-01 00:00:00 +00:00
Luke Leighton
8af860394f someone had added code to convert rids to rids, assuming that the rids
in the file were gids: they are not.
0001-01-01 00:00:00 +00:00
Luke Leighton
82b6292dff remove / add / attempt to stop remove didn't work. 0001-01-01 00:00:00 +00:00
Luke Leighton
e76f593b35 unix instance of group database API 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e93491953a replace ' with _ as well 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a3357ab493 changed string_sub() to replace " ; and ` in the inserted string with _
use all_string_sub() if you don't want this.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
bdcee2557b deleted some old DEBUG() code that wasn't used 0001-01-01 00:00:00 +00:00
Andrew Tridgell
42d2509c9f global change from samba.anu.edu.au to samba.org 0001-01-01 00:00:00 +00:00
Richard Sharpe
8594c4bcae Added changes to smbtar submitted by Sandy Whitesel
Added some extra documentation for smbclient

Grr, Jeremy beat me to a bug fix in client.c

Will have to get Jeremy to tell me how to check out SAMBA_2_0 :-)
0001-01-01 00:00:00 +00:00