1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

1387 Commits

Author SHA1 Message Date
Jeremy Allison
478696e924 If 127.0.0.1 matches both allow & deny then allow. Patch from Steve Langasek vorlon@netexpress.net
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
07a21fcd23 This is the 'winbind default domain' patch from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

The idea is the domain\username is rather harsh for unix systems - people don't
expect to have to FTP, SSH and (in particular) e-mail with a username like
that.

This 'corrects' that - but is not without its own problems.

As you can see from the changes to files like username.c and wb_client.c (smbd's
winbind client code) a lot of assumptions are made in a lot of places about
lp_winbind_seperator determining a users's status as a domain or local user.

The main change I will shortly be making is to investigate and kill off
winbind_initgroups() - as far as I know it was a workaround for an old bug in
winbind itself (and a bug in RH 5.2) and should no longer be relevent.

I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters
to determine a user/groups's 'local' status, rather than the presence of the
seperator.

As such, this functionality is recommended for servers providing unix services,
but is currently less than optimal for windows clients.

(TODO: remove all references to lp_winbind_seperator() and
lp_winbind_use_default_domain() from smbd)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
1d86c7f942 A nice *big* change to the fundemental way we do things.
Samba (ab)uses the returns from getpwnam() a lot - in particular it keeps
them around for a long time - often past the next call...

This adds a getpwnam_alloc and a getpwuid_alloc to the collection.

These function as expected, returning a malloced structure that can be
free()ed with passwd_free(&passwd).

This patch also cuts down on the number of calls to getpwnam - mostly by
taking advantage of the fact that the passdb interface is already
case-insensiteve.

With this patch most of the recursive cases have been removed (that I know
of) and the problems are reduced further by not using the sys_ interface
in the new code.  This means that pointers to the cache won't be affected.
(This is a tempoary HACK, I intend to kill the password cache entirly).

The only change I'm a little worried about is the change to
rpc_server/srv_samr_nt.c for private groups.  In this case we are getting
groups from the new group mapping DB.  Do we still need to check for private
groups?  I've toned down the check to a case sensitve match with the new code,
but we might be able to kill it entirly.

I've also added a make_modifyable_passwd() function, that copies a passwd
struct into the form that the old sys_getpw* code provided.  As far as I can
tell this is only actually used in the pass_check.c crazies, where I moved
the final 'special case' for shadow passwords (out of _Get_Pwnam()).

The matching case for getpwent() is dealt with already, in lib/util_getent.c

Also included in here is a small change to register the [homes] share at vuid
creation rather than just in one varient of the session setup.  (This picks
up the SPNEGO cases).  The home directory is now stored on the vuid, and I
am hoping this might provide a saner way to do %H substitions.

TODO:  Kill off remaining Get_Pwnam_Modify calls (they are not needed), change
the remaining sys_getpwnam() callers to use getpwnam_alloc() and move
Get_Pwnam to return an allocated struct.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
c1b97226db Separate out get_user_home_dir() from get_user_home_service_dir().
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0fcca6c627 Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
16fcbf3c1c Fixup error mapping so we have only one table containing errno -> dos error -> NT STATUS
maps. Fixes problem with disk full returning incorrect error.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
cee0ec7274 Roll back PSTRING_SANCTIFY patch; just leave non-controversial type
and constness changes.
0001-01-01 00:00:00 +00:00
Martin Pool
bf513668cb #ifdef variable that's not used without dmalloc 0001-01-01 00:00:00 +00:00
Martin Pool
8d106dc1f4 Add constness to filenames passed to functions. 0001-01-01 00:00:00 +00:00
Martin Pool
682e7cd394 FIXME We should turn the global list off when using Insure++,
otherwise all the memory will be seen as still reachable.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7417d6f931 A couple of coding syle updates to follow the re-indent. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
e20d69d518 Re-indent these two functions to make it actually possible to understand their
contents...

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e6a3a01f79 I'm doing some things towards the NamedPipes game with lckl and he has asked me
to move this from being a static to matching its mate in lib/util_sock.c.

In any case, this should discorage anybody from using the 'wrong' version of
this function.  (ie the one from TNG, which needs a bit more error checking
depending on use).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
2603ab3c68 Round and round we go....
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
24ee18c77e Latest attempt at changeid.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
01ff6ce496 Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
85d3ffb270 Spelling fix. 0001-01-01 00:00:00 +00:00
Jeremy Allison
6210d4aa19 Getting ready to add UNIX extensions in HEAD also.
Jeremy
0001-01-01 00:00:00 +00:00
Martin Pool
bcb443c5c4 Add two more memory-debug smbcontrol messages: these ones should
prompt dmalloc to log information about what happening, so you can see
in flight why smbd is getting bloated.
0001-01-01 00:00:00 +00:00
Martin Pool
3ef135e91a Add UNUSED(paramname) macro to be used in parameter lists, to quieten
gcc warnings about unused parameters.

msg_pool_usage: assert msg_type is as expected.
0001-01-01 00:00:00 +00:00
Martin Pool
a823e3f8b2 Add harmless parentheses so that dmalloc doesn't get confused by a
variable called 'free'.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ec71f1732b Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endian
in tdb's. All except winbindd_idmap.... Hmmmmmm.
Jeremy.
0001-01-01 00:00:00 +00:00
Herb Lewis
39d6b31e14 merge changes from 2.2 branch to prevent smb.conf from changing debug level
of commands when specified on command line.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
08bb2dfec2 simple fix for creating blank data blobs 0001-01-01 00:00:00 +00:00
Andrew Bartlett
207ee8aac4 Add a talloc varient of the data_blob functions.
Also change the structure so it has its own (optional) 'free' pointer - so we
don't free() a talloc'ed version.

also split out the data_blob_clear() functionaility.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
a0cdec3acc Fixed nasty cast of tdb_delete in traversals.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8aee8211cd Don't use static memory, malloc it...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
73cf9d04f6 Fix the fix.... (sigh).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b52c3219d6 Fixed embarressing 16k strack trashing bug :-(.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
4877501da9 Make talloctort call talloc_describe_all before exiting 0001-01-01 00:00:00 +00:00
Martin Pool
86abefc172 Cope nicely with pools with no name. 0001-01-01 00:00:00 +00:00
Martin Pool
cd25d01e42 talloc accounting now includes number of chunks and bytes allocated. 0001-01-01 00:00:00 +00:00
Martin Pool
7cb8e95f93 Send back talloc allocation information when POOL_USAGE is received. 0001-01-01 00:00:00 +00:00
Martin Pool
53723e8748 Add talloc_asprintf_append, which grows an existing string buffer to
contain new print-formatted information.  (Also
talloc_vasprintf_append.)  Idea borrowed from glib.
0001-01-01 00:00:00 +00:00
Martin Pool
9b217dce7f smbd now sends a reply to MSG_REQ_POOL_USAGE, though it's pretty
boring so far.
0001-01-01 00:00:00 +00:00
Martin Pool
830a126a44 smbd should register to receive MSG_REQ_POOL_USAGE. Response should
be information about memory usage, but this is not done yet.
0001-01-01 00:00:00 +00:00
Martin Pool
53dd8b4539 If we receive a message that is not handled then emit a gentle warning
to the log.
0001-01-01 00:00:00 +00:00
Martin Pool
6bd5b7ce8e debug output on receipt of message. 0001-01-01 00:00:00 +00:00
Simo Sorce
c0904d9617 const religion 0001-01-01 00:00:00 +00:00
Andrew Tridgell
65e857b36e more irix -64 portability fixes 0001-01-01 00:00:00 +00:00
Andrew Tridgell
48aa90c48c - portablitity fixes for cc -64 on irix
- fixed gid* bug in rpc_server
0001-01-01 00:00:00 +00:00
Simo Sorce
ce7e89949a freeing the wrong pointer, sorry my mistake. 0001-01-01 00:00:00 +00:00
Simo Sorce
49f5cb7a3d util_sid.c - respect a const variabile (addedd strdup)
cli_reg.c  - indentation
pdb_ldap.c - some checks on init fns parameters
pdb_tdb.c  - some checks on init fns parameters + make sure we close the db on failure
0001-01-01 00:00:00 +00:00
Andrew Tridgell
da353bc539 fixed a typo in vsyslog() 0001-01-01 00:00:00 +00:00
Martin Pool
22e510ea0d Add an output parameter to message_send_all that says how many
messages were sent, so you know how many replies to expect.

Const and doc religion.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
cc6c263993 fixed warnings on irix and crash bug on big endian machines 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0cfd0a5e54 much better auto-init of valid_table[]. This should just about remove
the need for valid.dat
0001-01-01 00:00:00 +00:00
Andrew Tridgell
85f04fa61d mark '.' as a valid character 0001-01-01 00:00:00 +00:00
Martin Pool
e76d27fcdb Add --enable-dmalloc to link against the dmalloc malloc debugger.
It's not as strong as Insure, but it's free, reasonably efficient and
works on every platform.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ab2e55cdb3 Added AC_CHECK_FUNCS(syslog vsyslog).
nsswitch code uses vsyslog without checking for it.
Provide replacement for vsyslog in lib/snprintf if not found by configure.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c11c27b281 fixed sid_compare_domain() 0001-01-01 00:00:00 +00:00
Martin Pool
a7b052d991 Use less memory, but scribble all over it, just in case there's
something wrong with the way it's allocated.
0001-01-01 00:00:00 +00:00
Martin Pool
e2b080587c Doc how to reply to messages. 0001-01-01 00:00:00 +00:00
Martin Pool
4c6c03c8c7 Make TALLOC_CTX and talloc_chunk private to talloc.c.
Add a global singly-linked list of all active talloc pools, so that we
can eventually show how much memory is used for different purposes.
This also gives a check that pools are not being doubly freed.

talloc_init_named now handle a NULL name properly (ie does nothing)

Add accessor talloc_pool_name().
0001-01-01 00:00:00 +00:00
Martin Pool
7da982e926 Doc 0001-01-01 00:00:00 +00:00
Martin Pool
5dc2827b6e Doc 0001-01-01 00:00:00 +00:00
Martin Pool
e6be48671d Put PRINTF_ATTRIBUTE on talloc_init_named, talloc_asprintf,
talloc_vasprintf.
0001-01-01 00:00:00 +00:00
Martin Pool
5b6c22a209 Doc. 0001-01-01 00:00:00 +00:00
Martin Pool
25b97a7435 Start adding some debugging features to talloc based on Samba's
ancient mem_man.c:

Each TALLOC_CTX now has a field to store its purpose, to aid in
tracking down memory bloat.  A new call talloc_init_named() should be
used instead of talloc_init() so that this is set.

Added talloc_vasprintf to be called by varargs functions.
0001-01-01 00:00:00 +00:00
Martin Pool
e339066995 Add a very trivial talloc torture program, bin/talloctort. Not built
by default.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7b8fb8d85c Fixup JF's weird SID return :-).
Jeremy
0001-01-01 00:00:00 +00:00
Tim Potter
c15dec74a3 A fix to override the location of a user's home directory if it is
specified in the [homes] section of the smb.conf file.

Jeremy, can you take a look at this?  This is in response to someone on the
samba mailing list worrying about it.


Tim.

From: Phil Thompson <philnanne@mediaone.net>
To: samba@lists.samba.org
Subject: Different [homes] behavior in 2.2.2
X-Original-Date: Mon, 17 Dec 2001 23:09:28 -0500


Is it possible to configure samba to disregard the home directory in the
passwd file when using [homes]?  Even though an alternate "path" is set
in [homes], the service fails since the unix home directory is invalid
(nonexistent) on the server.

[...]

This behavior of validating the user's home dir as set in the passwd
files appears to be new
in 2.2.2 and the latest CVS. Anyway to work around this?
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
c44f4e9e33 tidy up debug
J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
505a1bdd15 obey "use mmap" on case tables 0001-01-01 00:00:00 +00:00
Jeremy Allison
6d03184f8c Added HPUX ACL code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
59e01a22c5 Added the group enum code from 2.2
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
d0614b2e66 I see no reasons why we should limit username lenght while checking
see bug 22130

jeremy, probably this should be fixed also in 2_2
0001-01-01 00:00:00 +00:00
Martin Pool
a4cc69d945 Explain why snprintf has to be overridden in this way. 0001-01-01 00:00:00 +00:00
Tim Potter
62dfda654b Typo spotting. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4a6d297686 make sid_binstring available without HAVE_ADS 0001-01-01 00:00:00 +00:00
Andrew Tridgell
fa1e7a62ac add smb_xvasprintf() panic wrapper around vasprintf 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
fef52c4b96 again an intrusive patch:
- removed the ugly as hell sam_logon_in_ssb variable, I changed a bit the
definition of standard_sub_basic() to cope with that.

- removed the smb.conf: 'domain admin group' and 'domain guest group'
parameters ! We're not playing anymore with the user's group RIDs !

- in get_domain_user_groups(), if the user's gid is a group, put it first
in the group RID list.

I just have to write an HOWTO now ;-)

        J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2b2155beae fixed an off by 1 bug in talloc_asprintf() 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
6c87e96149 added a boolean to the group mapping functions to specify if we need or
not the privileges. Usually we don't need them, so the memory is free
early.

lib/util_sid.c: added some helper functions to check an SID.

passdb/passdb.c: renamed local_lookup_rid() to local_lookup_sid() and pass
an RID all the way. If the group doesn't exist on the domain SID,
don't return a faked one as it can collide with a builtin one. Some rpc
structures have been badly designed, they return only rids and force the
client to do subsequent lsa_lookup_sid() on the domain sid and the builtin
sid !

rpc_server/srv_util.c: wrote a new version of get_domain_user_groups().
Only the samr code uses it atm. It uses the group mapping code instead of
a bloody hard coded crap. The netlogon code will use it too, but I have to
do some test first.

	J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e908f304a2 moved init_account_policy() to the right place 0001-01-01 00:00:00 +00:00
Andrew Tridgell
ea5d285721 const religion in talloc calls 0001-01-01 00:00:00 +00:00
Jeremy Allison
5215bcca15 winbindd friendly user_in_list code. Tested on a 65k user domain.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
708c0a8d16 Moved name_is_local to the correct place. Ooops.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8d41dfd149 Tidyup of lib/username. Add name_is_local fn to determine if name is
winbindd. Getting ready for efficiency fix in group lookups.
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bc28a8eebd added a tdb to store the account policy informations.
You can change them with either usermanager->policies->account
or from a command prompt on NT/W2K: net accounts /domain

we can add a rpc accounts to the net command. As the net_rpc.c is still
empty, I did not start. How should I add command to it ? Should I take the
rpcclient/cmd_xxx functions and call them from there ?

alse changed the SAM_UNK_INFO_3 parser, it's an NTTIME. This one is more
for jeremy ;-)

        J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
789833b44e put sid_to_name behind the winbindd backend interface
I spent quite a while trying to work out how to make this call
via ldap and failed. I then found that MS servers seem use rpc
for sid_to_name, and it works even when in native mode, I ended
up just implementing it via rpc
0001-01-01 00:00:00 +00:00
Andrew Tridgell
88241cab98 added a basic ADS backend to winbind. More work needed, but at
least basic operations work
0001-01-01 00:00:00 +00:00
Andrew Tridgell
21a366afbe re-enabled insure backtrace, calling /usr/bin/backtrace 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0216b0fca1 The beginnings of alternative backends for winbindd
This just splits off the dispinfo call behind a methods structure.
I'll split off a few more functions soon, then we will be ready for
LDAP replacement methods
0001-01-01 00:00:00 +00:00
Tim Potter
9712d3f15a Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
0001-01-01 00:00:00 +00:00
Jeremy Allison
518084a70d Ensured the %G substitution exactly matches what the man page states.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
624cb28271 fixed typo 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e6004062a5 fixed toupper_w() and friends on big-endian
this fixes the core dumps on sparc
0001-01-01 00:00:00 +00:00
Andrew Tridgell
80841f5763 2nd attempt at fixing lame char tables on big endian machines 0001-01-01 00:00:00 +00:00
Andrew Tridgell
568425709d fixed lame char tables on big endian machines 0001-01-01 00:00:00 +00:00
Andrew Tridgell
23ef22f117 fixed some krb5 ifdefs 0001-01-01 00:00:00 +00:00
Gerald Carter
c60aa6c06f merge from APPLIANCE_HEAD 0001-01-01 00:00:00 +00:00
Andrew Tridgell
8698f7ef3e turn off the insure xterm hack for now 0001-01-01 00:00:00 +00:00
Andrew Tridgell
91bc14f430 allow printing of NULL pointers with internal snprintf 0001-01-01 00:00:00 +00:00
Andrew Tridgell
96224fe2d4 reverted incorrect patch 0001-01-01 00:00:00 +00:00
Tim Potter
778f5f77a6 Got medieval on another pointless extern. Removed extern struct ipzero
and replaced with two functions:

	void zero_ip(struct in_adder *ip);
	BOOL is_zero_ip(struct in_addr ip);
0001-01-01 00:00:00 +00:00
Andrew Tridgell
058a5aee90 added "net join" command
this completes the first stage of the smbd ADS support
0001-01-01 00:00:00 +00:00
Martin Pool
a875b3a6e7 More better now. 0001-01-01 00:00:00 +00:00
Martin Pool
6ddd8e7bf6 Quieten gcc const warning.
doxyfy.
0001-01-01 00:00:00 +00:00
Tim Potter
039ea0a0b9 Don't initialise static pointers to NULL. 0001-01-01 00:00:00 +00:00
Tim Potter
8fc772c9e5 Removed TimeInit() call from every client program (except for one place
in smbd/process.c where the timezone is reinitialised.  Was replaced with
check for a static is_initialised boolean.
0001-01-01 00:00:00 +00:00
Jeremy Allison
694372b2c4 Merged in JohnR's ping messaging extension.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
233fe71fbb added strlcpy() and strlcat() 0001-01-01 00:00:00 +00:00
Jeremy Allison
48a848f748 We don't actually use the horror that was lib/util_array.c :-).
More deleted code - hurrah !
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
32480d7aff Rename xmalloc, xmemdup, xstrdup to smb_$1 to avoid conflicts with the
versions defined by libreadline on SCO (!).
0001-01-01 00:00:00 +00:00
Martin Pool
2c1e68d4ce Fix typo. 0001-01-01 00:00:00 +00:00
Martin Pool
b792c9317a Detect libreadline>=4.0, and set HAVE_NEW_LIBREADLINE. At the moment
this is only to get the cast right, but it might help with other parts
of the API that changed later.
0001-01-01 00:00:00 +00:00
Tim Potter
dfaafcd622 Added comment about why not to cast the assignment of
rl_attempted_completion_function to rl_completion_function_t.
0001-01-01 00:00:00 +00:00
Martin Pool
868999ad3c LIBDIR and LOCKDIR are dynamically configured too. 0001-01-01 00:00:00 +00:00
Martin Pool
c4b44cfc3f Oops, Tim says rl_completion_func_t doesn't exist in all versions of
readline.
0001-01-01 00:00:00 +00:00
Martin Pool
d0a0d27caa Quieten compiler warnings about a callback function prototype that has
changed in recent versions of Readline.
0001-01-01 00:00:00 +00:00
Simo Sorce
37edaeddce fixed some bugs. 0001-01-01 00:00:00 +00:00
Jeremy Allison
d70674312d Fixed detection of RedHat headers. Removed another file !
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
6bf2505cce I *love* removing code :-). Removed 4 files that weren't being used.
All this stuff was being pulled in due to *one* unneeded call to
fetch a domain SID which smbpasswd already puts in the database...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a7b45bfb71 Tidyups in the merge process.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
7c6529c081 FALSE -> False 0001-01-01 00:00:00 +00:00
Tim Potter
c8c7da237d Removed unused variable. 0001-01-01 00:00:00 +00:00
Jeremy Allison
763fd1c787 Look for DOMAIN\group in group lists and ask winbind.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
023514a0b6 messed up with patches, this should be the right one,
sorry
0001-01-01 00:00:00 +00:00
Simo Sorce
8bb5cb27c2 some bugfix and new functions,
modified mangle.c to use mosltly acnv_????() functions.
this should make also build farm happy
0001-01-01 00:00:00 +00:00
Simo Sorce
64dde3b64f fixed, moved and added some functions
note the useful acnv_uxu2 and acnv_u2ux functions in charcnv.c
0001-01-01 00:00:00 +00:00
Simo Sorce
8b494b0be3 add convert_string_allocate() function 0001-01-01 00:00:00 +00:00
Tim Potter
4f21ddb873 Removed totally annoying verbose debug in sid_to_string() 0001-01-01 00:00:00 +00:00
Jeremy Allison
16c5d279b9 Added missing strchr_wa.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
ee19f7efb6 a big one:
- old mangle code has gone, the new one based on tdb seem resonably ok
   probably the valid.dat table need to be updated to treat wild chars as
   invalid ones (work ok without it)
 - a LOT of new string manipulation function for unicode, they are somewhat
   tested but a review would not be bad
 - some new function I will need for the new unix_convert function I'm writing,
   this will be renamed filename_convert and use only unicode strings.
 - charconv, I attached a comment, if someone wnat to look if I'm right or
   just was hacking to late in the night to make a sane one :)

of course any bug is my responsibility an will be pleased to see patches if
you find any. :-)

Simo.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5dd3c7b3fb remove {} from default valid char list 0001-01-01 00:00:00 +00:00
Jeremy Allison
ee5e7ca547 Added NT_USER_TOKEN into server_info to fix extra groups problem.
Got "medieval on our ass" about const warnings (as many as I could :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
eeaa80aa09 zero the data, not a pointer to the data ... 0001-01-01 00:00:00 +00:00
Andrew Bartlett
3b5e72bda3 Small 'const' updates ahead of some AuthRewrite merging. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
0c8e9339d8 Parionia to ensure people don't install libsmb based programs setuid root.
libsmb has not been written to be setuid, with things like LIBSMB_PROG allowing
all sort of fun and games.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
b02ed7ee19 Add a bit of 'const' for the data_blob code.
Add a new data_blob_clear_free() function - that zero's out the buffer
when its done.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f019bed766 More spelling and grammer from Vance. <vance@digital-host.net>
Thanks!

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c95f5aeb93 This commit is number 4 of 4.
In particular this commit focuses on:

Actually adding the 'const' to the passdb interface, and the flow-on changes.

Also kill off the 'disp_info' stuff, as its no longer used.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes introduces a large dose of 'const' to the Samba tree.
There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

---

This finishes this line of commits off, your tree should now compile again :-)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e7634f81c5 This commit is number 3 of 4.
In particular this commit focuses on:

Changing the Get_Pwnam code so that it can work in a const-enforced
environment.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for 'const' in the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8f607810eb This commit is number 2 of 4.
In particular this commit focuses on:

The guts of the moving about inside passdb.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for the introduction of  a large dose of 'const' to
the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

passdb/

	- Kill off disp_info stuff, it isn't used any more - Kill off
	support for writing to the old smbpasswd format, it isn't relevent
	to Samba 3.0

	- Move around and modify the pdb_...() helper functions, adding
	one that sets the last changed  time to 'now' and that sets the
	must change time appropriately.

	- Remove the ugly forced update of the LCT- value in
	pdb_smbpasswd.  - Remove the implicit modification of the ACB
	flags when both NT and LM passwords are set.

	- Removed substation in pdb_getsampwnam output, as a single
	password change will render them  inoperable in any case (they
	will be substituted and stored)

	- Added a default RID to the init_sam_from_pw() function, based on
	our rid algorithm.

	- Added checks that an smbpasswd stored user has a uid-based RID.

	- Fail to store tdb based users without a RID

lib/
    - Change the substituion code to use global_myname if there is
      no connection (and therefore no called name) at the present time.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5a4d22dd66 smbd/notify_hash.c: Merged Herb's fix.
lib/debug.c: Fix for potential null pointer access.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5fda15463a A few spelling fixes from Vance. <vance@digital-host.net>
Thanks!
0001-01-01 00:00:00 +00:00
Jeremy Allison
57b8e6d742 Added || -> && fix from "Orwig, Paul" <PORWIG@PacificLife.com>.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
ef06de2a1c Removed unused function. 0001-01-01 00:00:00 +00:00
Herb Lewis
51cb4411df get rid of compiler warnings (casts and delete unused variables) 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3f919b4360 a quick fix to get rpcclient working again. This just disables
NTLMSSP in cli_establish_connection()

What we really need to do is kill off the pwd_cache code. It is horrible,
and assumes the challenge comes in the negprot reply.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d01a9e5974 Added xstrdup, removed static version from smbpasswd.c
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2cc262278f Added xmalloc - calls smb_panic on zero size or malloc fail.
Added xmemdup - calls xmalloc.
Made data_blob() call xmemdup.
Defensive programming (I still hate the no error checking... :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
b16a15a13e Converted a bunch of 0x85 constants to SMBkeepalive. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
9355f25165 removed an unused variable 0001-01-01 00:00:00 +00:00
Jeremy Allison
d8262286dd Merge Gerry's %G change from 2.2.2.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b74fda69bf added basic NTLMSSP support in smbd. This is still quite rough, and
loses things like username mapping. I wanted to get this in then
discuss it a bit to see how we want to split up the existing
session setup code
0001-01-01 00:00:00 +00:00
Andrew Tridgell
acd84ed762 return of vsnprintf doesn't include termination
thanks to simo for spotting this
0001-01-01 00:00:00 +00:00
Andrew Tridgell
8ca8875cd9 bit neater talloc_asprintf() implementation 0001-01-01 00:00:00 +00:00
Simo Sorce
7264d611ef introduce mangle backward compatibility functions
add talloc_asprintf()
0001-01-01 00:00:00 +00:00
Tim Potter
ffef3c3869 This file is really old and not used anymore. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
ab7f67677a first step in converting the head branch to use lang_tdb.c instead
of gettext for internationalisation support. There is more to do
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d330575856 initial kerberos/ADS/SPNEGO support in libsmb and smbclient. To
activate you need to:

- install krb5 libraries
- run configure
- build smbclient
- run kinit to get a TGT
- run smbclient with the -k option to choose kerberos auth
0001-01-01 00:00:00 +00:00
Simo Sorce
7895593929 old fixes I forgot to commit 0001-01-01 00:00:00 +00:00
Simo Sorce
53b95b3c0f initial support to error report in smbclient, useful when using smbclient -c in scripts.
Thanks to Claudio Cicali aka FleXer for the initial patch
0001-01-01 00:00:00 +00:00
Andrew Tridgell
67017619af fixed lame valid table 0001-01-01 00:00:00 +00:00
Andrew Tridgell
211aeffa1a fixed basic ucs2 operation on big endian boxes. Still a bit more to
do, but at least you can connect now.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1c221994f1 switched over to a new method of handling uppercase/lowercase mappings
for unicode strings. The new method relies on 3 files that are mmap'd
at startup to provide the mapping tables. The upcase.dat and
lowcase.dat tables should be the same on all systems. The valid.dat
table says what characters are valid in 8.3 names, and differs between
systems. I'm committing the japanese valid.dat here, in future we need
some way of automatically installing and choosing a appropriate table.

This commit also adds my mini tdb based gettext replacement in
intl/lang_tdb.c. I have not enabled this yet and have not removed the
old gettext code as the new code is still being looked at by Monyo.

Right now the code assumes that the upcase.dat, lowcase.dat and
valid.dat files are installed in the Samba lib directory. That is not
a good choice, but I'll leave them there until we work out the new
install directory structure for Samba 3.0.

simo - please look at the isvalid_w() function and think about using
it in your new mangling code. That should be the final step to
correctly passing the chargen test code from monyo.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9333bbeb76 Fixed up the change password bug when not using PAM.
The problem is we were trying to use mask_match as a generic
wildcard matcher for UNIX strings (like the password prompts).
We can't do that - we need a unix_wild_match (re-added into lib/util.c)
as the ms_fnmatch semantics for empty strings are completely wrong.
This caused partial reads to be accepted as correct passwd change
responses when they were not....
Also added paranioa test to stop passwd change being done as root
with no %u in the passwd program string.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
94403d8417 Fixed the bug with member servers in a Samba PDC hosted domain not allowing
other access. Problem was max time was being set to 0xffffffff, instead of
0x7fffffff.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
57196635d9 make strupper() and strlower() not modify the string if it doesn't
need modifying

that makes constant strings OK
0001-01-01 00:00:00 +00:00
Gerald Carter
c308459bda merge from 2.2 0001-01-01 00:00:00 +00:00
Andrew Bartlett
b648cc669d Add a few const statements to various odd bits of the tree. (Fixes some
warnings)
0001-01-01 00:00:00 +00:00
Gerald Carter
efc6df5a39 OpenSSL merge from 2.2 0001-01-01 00:00:00 +00:00
Jeremy Allison
bca6419447 Added Elrond patch to make se_access_check use NT datastructures, not Samba.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
4ade36446e - the inactive core of the new mangling code that use tdb
- some more utils for unicode string manipulation
0001-01-01 00:00:00 +00:00
Andrew Tridgell
fdc9952391 fixed the really awful performance problem with the stat cache when it
ran out of primes and used a power of two hash modulus. It ended up
sticking all the entries in just a few buckets. Yuck!
0001-01-01 00:00:00 +00:00
Andrew Tridgell
eb668b54af added a little smbtorture test for dumping the unicode table of a
server. This is just a framework right now - I want this to eventually
replace the win32 test code from monyo

The interesting this about this test is that it shows up a really
horrible performance bug in our stat cache code. I'll see if I can fix
it.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e13e8b190c allow all ucs2 chars in utf8, rather than mapping some to a single
char like libiconv does
0001-01-01 00:00:00 +00:00
Jeremy Allison
dfb58f2276 Fixed enumeration of large numbers of groups from a Samba DC.
Tidied up debug messages in lib/messages.c
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e558ab6ac8 fixed a silly off by 1 bug 0001-01-01 00:00:00 +00:00
Jeremy Allison
bc7963bd64 Ignore unmappable (NT Authority, BUILTIN etc.) SIDs in an ACL set.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
fd5c67d35a Fix (I hope) compile on HP-UX. Found by the build farm. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
2d507ec669 fixed ctemp in server and client. It turns out that ctemp on NT is completely broken, and it's pointless to emulate their brokenness completely in this case, but at least this makes us use approximately the same packet format. The spec is complelet wrong in this case 0001-01-01 00:00:00 +00:00
Simo Sorce
60e907b7e8 move to SAFE_FREE() 0001-01-01 00:00:00 +00:00
Andrew Bartlett
bc1385fc5e Restore the profiling data shmem parinoia. This whole area needs to be
fixed - an mmaped file or the like would be a good idea.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
2b83ad0396 added a new global option "hostname lookups = yes/no"
This should finally kill off the remaining places where we
attempt reverse lookups of the IP of the client. It may be that some
pam modules called via the session code will need "hostname lookups = yes"
but I've left it off by default as most sites don't need it and so
many sites have broken reverse maps
0001-01-01 00:00:00 +00:00
Andrew Tridgell
fe6679dffb convert more code to use XFILE 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f41c3bb80f declare dbf in one spot 0001-01-01 00:00:00 +00:00
Andrew Tridgell
7c2fe172c3 added xfile 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1af8bf34f1 replaced stdio in many parts of samba with a XFILE. XFILE is a cut-down
replacemnt of stdio that doesn't suffer from the 8-bit filedescriptor
limit that we hit with nasty consequences on some systems

I would eventually prefer us to have a configure test to see if we need
to replace stdio, but for now this code needs to be tested widely so
I'm enabling it by default.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
60d2973034 convert more code to using d_printf 0001-01-01 00:00:00 +00:00
Andrew Tridgell
266d8e6766 added "display charset" option in smb.conf, along with d_printf()
which should now be used instead of DEBUG(0) or printf() for
interactive messages

I have only converted client.c to use d_printf(), and the code hasn't
had much testing yet. Eventually we want all interactive code to use
d_printf(), plus SWAT
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c26e0d3f27 got rid of USE_TDB_MMAP_FLAG as its not needed any more 0001-01-01 00:00:00 +00:00
Tim Potter
4a01e24030 Started a cleanup of smbpasswd related stuff. I've created a new file
lib/smbpasswd.c which will contain routines related to manipulating
smbpasswd entries.

 - renamed and moved pdb_{get,set}hexpwd() functions
 - renamed and moved pdb_{decode,encode}acct_ctrl() functions
 - started hiding references to the cruftalicious
   NEW_PW_FORMAT_SPACE_PADDED_LEN constant
 - started gradual rename of references to acct_ctrl to acb_info which is
   the nomenclature used in MSDN and header files

There's still more work to be done.  Currently there are several places
where smbpasswd entries are iterated etc.  Ideally this should all happen
through the passdb system.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c05e794536 Merge of transfer file code from 2.2, fix for readbraw.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
dcd6e735f7 the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work 0001-01-01 00:00:00 +00:00
Tim Potter
06608971ed Fixed some compiler warnings. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
ad648c5cd8 more NTSTATUS/WERROR conversion 0001-01-01 00:00:00 +00:00
Tim Potter
14bc8283f2 Merge from TNG - function to initialise NTTIME structure. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
2d1829dfd0 fixed typo 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1d36250e33 converted another bunch of stuff to NTSTATUS 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1b778bc7d2 started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs 0001-01-01 00:00:00 +00:00
Jeremy Allison
7263949584 bzero is not used (deprecated) as it's a BSDism.
Syscalls must check for -1, not < 0 (POSIX).
Formating (tab) fixups.
Jeremy.
0001-01-01 00:00:00 +00:00
Christopher R. Hertel
efaa9ef5e7 Small changes to get ready for adding WINS failover to smbd and clients.
My plan is to change the lp_wins_server() function to lp_wins_server_list().
My reason being: With WINS failover the 'wins server' parameter may take a
list of WINS server names/IPs instead of just one.  If it's a list, then
calling lp_wins_server() won't give you what you expect (that is, a single
WINS server name or IP).  Instead, the functions in wins_srv.c should be
used.  You can get either the name or IP of the 'current' working WINS
server in the list.

Chris -)-----
0001-01-01 00:00:00 +00:00
Christopher R. Hertel
3031e7acdc Fussing with debug lines in open_socket_in(). I cleaned up some slightly
funky code that was simply setting a local int to 0 or 1 and also added
calls to strerror() in some of the debug lines.

The use of the dlevel parameter in this function is a little awkward.
There should probably be some comments about it in the source.
0001-01-01 00:00:00 +00:00
Herb Lewis
0f08e79030 fixes big endian unistring problems. Need to check that it didn't
break little-endian machines.
0001-01-01 00:00:00 +00:00
Herb Lewis
f942397d65 get rid of old debug code and possible socket leak 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a896dc299e better error reporting for servers that don't do port 445 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3eba9606f7 a bunch of fixes from the sflight to seattle
in particular:
 - fixed NT status code for a bunch of ops
 - fixed handling of protocol levels in ms_fnmatch
0001-01-01 00:00:00 +00:00
Jeremy Allison
94128f9f37 More Realloc fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c452eb0fbb removed unused file 0001-01-01 00:00:00 +00:00
Simo Sorce
fa8e55b8b4 this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.

someone should port this fix to 2.2 also.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8c5e5f8c84 Added Mike Davidsons Tru64 ACL patch.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
688da3c41d Use the new client error api. 0001-01-01 00:00:00 +00:00
Simo Sorce
7f33c01688 Change all realloc() statements to Realloc() (ecxept for tdb.c)
changed some code to exploit the fact that Realloc(NULL, size) == malloc(size)
fixed some possible mem leaks, or seg faults.

thanks to andreas moroder (mallocs not checked in client/client.c, client/smbumount.c)
0001-01-01 00:00:00 +00:00
Simo Sorce
f87924aec4 me stupid.
never commit without building.
sorry.
0001-01-01 00:00:00 +00:00
Simo Sorce
b29a549cdd Some fixes about malloc/Realloc and mem leak
thanks to andreas moroder
0001-01-01 00:00:00 +00:00
Jeremy Allison
d862be4b68 Oops. Typo.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d82efc61ef Pidfile check can be read-only. Removed old ifdef in password.c
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
840802f106 Added "use mmap" for HPUX.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
324ba0512e Fix from Michael Davidson <md@caldera.com> for DEC OSF/1 ACLs (ie.
Digital UNIX).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
df00e5dcea need to push smb_search strings in client charset 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e6773b08a4 got rid of INFO: msgs at debug level 1 0001-01-01 00:00:00 +00:00
Andrew Tridgell
2ec59f731d ucs2 is always a multiple of 2 bytes
this gets rid of a bunch of iconv warnings
0001-01-01 00:00:00 +00:00
Simo Sorce
7257d07563 Convert other parameters (read list, write list, valid users...) to the P_LIST format.
changed functions to use list instead of strings
addedd lp_list_substitute function
0001-01-01 00:00:00 +00:00
Jeremy Allison
eea1c30df2 Fix case insensitive password change code.
Fixed crash bug with un-zeroed talloced memory.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
594f84b4e3 changed the iconv interface to go via ucs2 for all conversions. This
fixes some problems wih some character sets and allows for using
internal charsets in conjunction with ionv charsets
this makes us slower but more correct. speed will come later.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e236a3e29e switch from UCS2 to UCS-2LE 0001-01-01 00:00:00 +00:00
Tim Potter
f0b7593ef5 ^$&%&*$&)% readline uses \n characters instead of letting the terminal wrap
the screen.  This mucks up expect something severe.  )-:

Don't use readline if the CLI_NO_READLINE environment variable is set.
0001-01-01 00:00:00 +00:00
Tim Potter
e5b62b4961 It looks like the rpc client code in libsmb hasn't been converted to the
new internal string stuff.  The main problem is that some unicode strings
are null terminated and some aren't.  There's no rhyme or reason to it -
some pipes have 99% of the strings terminated and some have 99%
unterminated.  To avoid having to actually know the termination policy, I
propose a set of functions that take a UNISTR2* and use the length
contained there.

Added rpcstr_pull_unistr2_string() function to convert a unicode string of
dubious termination to a fstring.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1436c9f424 removed some unnecessary code 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a83d506e5c much better handling of broken DNS servers
we no longer lookup our own name when we create a socket in
open_socket_in(). That makes things work much better with the
broken DNS server at VA
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9449544428 added sec_initial_uid() function so we can ask if a file is owned by
the initial uid
0001-01-01 00:00:00 +00:00
Andrew Tridgell
66632782c5 fixed the auto-initialisation of the iconv descriptors 0001-01-01 00:00:00 +00:00
Andrew Bartlett
8df8e84144 Add backend encryption support for NTLMv2.
The leg-work for this was done by the folks at samba-tng.org, I'm just bringing
it accross to HEAD.

The MD5 implementation is seperatly derived, and does not have the copyright
problems that the one in TNG has.

Also add const to a few places where it makes sence.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f4359b5f7f fixed strrchr_m 0001-01-01 00:00:00 +00:00
Jeremy Allison
ed5a1f70c6 Wrapped dlerror() in the same way as the other dlxxx() calls.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
67ca6cd8eb formatting fixes 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e9c53606de check for initialisation in convert_string()
otherwise initial load in smb.conf can fail
0001-01-01 00:00:00 +00:00
Andrew Tridgell
95a9a1814f fixed a silly bug in the internal UTF8 implementation 0001-01-01 00:00:00 +00:00
Andrew Tridgell
c3a21fc0f2 got rid of insanely verbose debug messages on startup 0001-01-01 00:00:00 +00:00
Andrew Tridgell
9a9da44455 fixed inetd operation as non-root 0001-01-01 00:00:00 +00:00
Andrew Tridgell
25c4b3f193 added some comments and removed an unnecessary check 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f6f9e95dd9 use alpha_strcpy on DNS names 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0c61e54f15 optimised the 7 bit case for utf8 conversion 0001-01-01 00:00:00 +00:00
Andrew Tridgell
42648a7aad make sure we reset the shift state on error for charsets like SJIS 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d39d8429d1 unicode string length is twice longer ;-) 0001-01-01 00:00:00 +00:00
Andrew Tridgell
76d83e7f70 added builtin support for UTF8 0001-01-01 00:00:00 +00:00
Andrew Tridgell
bf81826851 more portability fixes 0001-01-01 00:00:00 +00:00
Andrew Tridgell
7a5c24c219 portability fixes 0001-01-01 00:00:00 +00:00
Andrew Tridgell
815ca75274 got rid of __FUNCTION__ debug 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a03992f19b fixed uninitialised variable 0001-01-01 00:00:00 +00:00
Andrew Tridgell
57e7df8ae5 missed a couple of strchr calls 0001-01-01 00:00:00 +00:00
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e0f6863a11 Fixed warnings and made const-safe so it has the correct prototype.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d99ce6a5e3 fixed socketpair_tcp for OpenBSD 0001-01-01 00:00:00 +00:00
Simo Sorce
4e0299d4c0 - sorry, forgot to check a pointer 0001-01-01 00:00:00 +00:00
Jeremy Allison
1ab31e5db5 Made talloc_realloc() semantics match realloc(). JF was complaining :-).
realloc(NULL) == malloc. realloc(p,0) == free() - a no-op in talloc.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
db36ed1d80 "netbios aliases" and "interfaces" options change from P_STRING to P_LIST 0001-01-01 00:00:00 +00:00
Jeremy Allison
c24e6b41ea Ensured all the system calls in msdfs.c go through the vfs layer.
Added vfs calls to symlink() and readlink() with appropriate configure
checks.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
30411d4004 Replaced memcpy() with memmove() to make safe_strcpy() safe for overlapping
source and destination.
0001-01-01 00:00:00 +00:00
Jeremy Allison
39d4131a45 Syncup between 2.2 and HEAD.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d8e5409ebb on sco2 socketpair_tcp needs a bind 0001-01-01 00:00:00 +00:00
Andrew Tridgell
87f90d48d8 handle EISCONN in socketpair_tcp
this should get the auto-tests working on IRIX
0001-01-01 00:00:00 +00:00
Jeremy Allison
e88da9dcc7 Ensure numeric group or user names don't get misinterpreted.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
72f63f5144 make sure we have BOOL in autoconf usage of util_sec.c 0001-01-01 00:00:00 +00:00
Andrew Tridgell
55109a7525 - make the regresison test mode code build in by default. This should
allow us to have test targets without special configure options
- fixed make proto so that it actually does something
0001-01-01 00:00:00 +00:00
Simo Sorce
7420e2f789 fix compiler warnings 0001-01-01 00:00:00 +00:00
Jeremy Allison
e059fffd03 Added other_safe_chars to alpha_strcpy(). Needs testing but is a better
fix for the problem.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5cbb210673 Fix for race condition found by Herb where we can end up with a NULL dbf.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7e8e6ae9a8 added the ability to test smbd safely as an ordinary user. The way it works is
that libsmb/ creates a local tcp socket then launches smbd as a subprocess
attached to that socket. smbd thinks it is being launched from inetd.

to use it do the following:

- compile with -DSMB_REGRESSION_TEST
- run like this (also works with smbtorture etc)
    export SMBD_TEST=1
    export LIBSMB_PROG=bin/smbd
    smbclient //server/share -Uuser%pass

obviously you need to setup a smb.conf etc. Using --prefix to configure
is useful.

The aim of all this stuff is to add a decent set of regression tests
to the build farm, so we know if smbd actually runs correctly on all the
platforms, not just builds. We can run smbtorture, masktest, locktest etc,
plus a bunch of smbclient scripts and any new tests we write.

This doesn't help much with nmbd (at least not yet) but its a good start.
0001-01-01 00:00:00 +00:00
Tim Potter
5f4889beb9 Spelling fix. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
7a96ca313e the BAD_PTR idea in talloc.h is actually a bad idea - it means callers have no way of telling if the call really failed 0001-01-01 00:00:00 +00:00
Andrew Tridgell
674ee2f1d1 next_token() was supposed to be a reentrant replacement for strtok(),
but the code suffered from bitrot and is not now reentrant. That means
we can get bizarre behaviour
i've fixed this by making next_token() reentrant and creating a
next_token_nr() that is a small non-reentrant wrapper for those lumps
of code (mostly smbclient) that have come to rely on the non-reentrant
behaviour
0001-01-01 00:00:00 +00:00
Simo Sorce
e1572f85d6 initial support for paramter type P_LIST
it will avoid problems with lists being longer than 1024 bytes
just now only ip list parameters have been converted to the new type
(hosts allow, hosts deny, ssl hosts, ssl hosts resign)
0001-01-01 00:00:00 +00:00
Jeremy Allison
db5b82e53a Added patches to remove Linux specific XFS ACLs. These are now handled by the
generic Linux ACL code.
rpc_server/srv_samr_nt.c: Don't delete a policy handle before it's created.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
720fea5360 Removed silly Get_Hostbyname() wrapper as DNS names are case-insensitive
and the use of this function only increased timeouts when Samba queries
a broken DNS server.
0001-01-01 00:00:00 +00:00
Jeremy Allison
24eea8a309 Fix from TAKAHASHI Motonobu <monyo@samba.gr.jp> for multibyte conversion
problems.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d989f8bd3e lib/util_getent.c: removed debug code.
smbd/posix_acls.c: Attempt to fix the "lose default acl" problem in Solaris.
Needs testing.
lib/sysacls.c: Typo fix.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e0f88cabfc Found & fixed memory bug. num+1 * sizeof(x) != (num+1)*sizeof(x)........
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
bd750def13 Fixed typo in Solaris and UnixWare ACLs.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1b3977c536 *Wonderful* patch from Andrew Bartlett that will help ensure tdb's are
cleaned on clients abending connections. Thanks Andrew !
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
81b5a628d1 Herb's IRIX fix for deleting default ACLs.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5853f1dc42 AIX has no default acls.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5668512ffa Added sys_acl_delete_def_file for UnixWare and Solaris from
Michael Davidson <michael_davidson@pacbell.net>.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a8532b193d Added sys_acl_delete_def_file() - needed as part of NT ACL editing fix.
Will add changes for other supported ACL systems shortly (Herb, I may
need help with the IRIX one).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5a15831b9a Changes to use new genrand code that got missed while I was in Japan.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
8ec9c87b5d use LDSHFLAGS not -shared in several places 0001-01-01 00:00:00 +00:00
Tim Potter
391e7caf76 If a debug class was explicitly set to zero the debug system would not
recognise it as there was no distinction made between zeroing a debug
class and just not setting it to anything.  I've added a
debuglevel_isset array in parallel with the debuglevel_class array to
fix this.

Added a couple of new debug classes which I might start filling out
to get smb, rpc header and rpc marshall/unmarshalling debugs tidied
up.

Fixed a bunch of cut&paste bugs in include/debug.h

Modified smbcontrol and the messaging system debug handler to like the
debuglevel_isset stuff.
0001-01-01 00:00:00 +00:00
Jeremy Allison
6594a59263 Rename bzero -> memset.
Check returns from *all* mallocs (including strdups).
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
adb61490af Fixed compiler warning. 0001-01-01 00:00:00 +00:00
Simo Sorce
97dbb54a13 4 new functions to retrieve single linked list of group and passwd entries
+ a fix to an infinite loop in srv_samr_nt.c caused by misuse of
setgrent/getgrent/endgrent solved by these new functions
0001-01-01 00:00:00 +00:00
Jeremy Allison
19145bae72 Fixup the large_writex problem (a large_writex can send a full 64k of data,
we already have space for this we just need to understand the length correctly).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b2867ddfa2 Fix for random stream generator.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c6cd42a679 Check sizes of data entries in connections.tdb before deciding they're crecs...
We will need this when we use finer grained locking for max connections.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e8ab89fbc0 string_hash() should be static. hash_clear() should be void.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
eea43a5a91 Added talloc_strdup() funcion. 0001-01-01 00:00:00 +00:00
Jeremy Allison
fa6a5bf94a Needs to be >=, not just >.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
df2e306171 Fix for problem with "" string in trim_string(). Pointed out by Ben Winslow <rain@bluecherry.net>.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
9ee43d61be Added sid_peek_rid() function to return the rid of a sid. Saves mucking
around with copying a sid to a temporary variable and using sid_split_rid().
0001-01-01 00:00:00 +00:00
Tim Potter
f0b8ff4eeb Bumped up debug level on set socket options from 3 to 5. 0001-01-01 00:00:00 +00:00
Tim Potter
831b0983bd Hey what happened to my debug messages? Early exit from reopen_logs()
if using stdout_logging.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
78f448b7d4 removed need for scandir in client.c
fixed possible bug with readdirname on systems with NAMELEN != strlen
0001-01-01 00:00:00 +00:00
Tim Potter
59f95416b6 Preliminary merge of winbind into HEAD. Note that this compiles and links
but I haven't actually run it yet so it probably doesn't work.  (-:
0001-01-01 00:00:00 +00:00
Andrew Tridgell
a69532ffde fix interfaces.c for aix 3.2.5 0001-01-01 00:00:00 +00:00
Tim Potter
da5a0f5c5b Some versions of readline don't have rl_completion_func_t. )-:
Spotted by http://build.samba.org/
0001-01-01 00:00:00 +00:00
Tim Potter
063c2dea92 Fixed compiler warning. 0001-01-01 00:00:00 +00:00