1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

1455 Commits

Author SHA1 Message Date
Jelmer Vernooij
b786c9a2ec Make debuglevel a string for use with debug classes
(This used to be commit fc29385029)
2002-08-29 16:35:33 +00:00
Jelmer Vernooij
2b2b0f7119 Put in intermediate version of new SAM system. It's not stable yet, code
might be ugly, etc - please don't blame me for anything but instead try to fix
the code :-). Compiling of the new sam system can be enabled with the
configure option --with-sam

Removing passdb/passgrp.c as it's unused
fix typo in utils/testparm.c
(This used to be commit 4b7de5ee23)
2002-08-28 04:54:43 +00:00
Jelmer Vernooij
61e4ee500f Make const
(This used to be commit b1ab3bec8d)
2002-08-28 04:21:11 +00:00
Tim Potter
f1597ae9d1 Some debugs for panic_action.
(This used to be commit 8f065f788b)
2002-08-28 02:11:24 +00:00
Simo Sorce
8f6c926a8f add a trivial seeking function to xfile (tseek) that does not do SEEK_CUR
and add commands reget and reput to smbclient that continues a transfer that has been onterrupted.

thanks to josef Zlomek that did the original patch.
(This used to be commit b275547c9e)
2002-08-27 09:07:08 +00:00
Andrew Bartlett
2560c73026 Updates!
- Don't print an uninitialised buffer in service.c
- Change some charcnv.c functions to take smb_ucs2_t ** instead of void **
- Update NTLMv2 code to use dynamic buffers
- Update experimental SMB signing code - still more work to do
- Move sys_getgrouplist() to SAFE_FREE() and do a DEBUG() on initgroups()
  failure.

Andrew Bartlett
(This used to be commit de1964f7fa)
2002-08-26 03:08:37 +00:00
Andrew Bartlett
9c7742727a Try to support non-root-mode systems without getgrouplist().
Andrew Bartlett
(This used to be commit 17096315a0)
2002-08-26 00:43:06 +00:00
Andrew Bartlett
014792fc03 Clarify function comments
(This used to be commit a613dde7ed)
2002-08-25 23:33:22 +00:00
Andrew Bartlett
b97a387c0f Patch from mimir to back out idra's attempted DOS mitigation patch.
(It broke port 139 name exchange)

I've been thinking about this, and doing is properly is actually rather
difficult - but I'll try and get somthing in there.  (My worry is what
smb_read_error should be set to, and how that interacts with the rest of
samba).

Andrew Bartlett
(This used to be commit 3e682867bb)
2002-08-25 21:46:49 +00:00
Simo Sorce
f38fc7b3b1 We never checked if the smb packet len is != 0
Should fix a supposed DoS too.
(This used to be commit f76e5b2677)
2002-08-23 15:01:07 +00:00
Andrew Bartlett
548203a0c4 We need to return the value here...
Andrew Bartlett
(This used to be commit 8fbc964f2f)
2002-08-23 12:31:36 +00:00
Andrew Tridgell
89586f0b7c added smb_xstrndup()
(This used to be commit 26fc20187d)
2002-08-22 22:53:33 +00:00
Andrew Tridgell
a10519049e added a useful unistr2 display function
(This used to be commit f458113364)
2002-08-22 22:44:06 +00:00
Tim Potter
3276da4314 Spelling fixes.
(This used to be commit 24fa84bda4)
2002-08-22 09:48:06 +00:00
Gerald Carter
7c4d1ba058 fix a few segfaults
(This used to be commit ccb02f7cfc)
2002-08-22 02:51:32 +00:00
Jelmer Vernooij
d3aa76cef5 Patch from Paul Green <Paul.Green@stratus.com> to be more POSIX-compatible
(This used to be commit addf29e676)
2002-08-21 19:59:23 +00:00
Volker Lendecke
1ea5e17f95 Fix debug level initialization for net.c
Volker
(This used to be commit 5af5326f13)
2002-08-21 11:48:05 +00:00
Jeremy Allison
f744db7a5d IFSTEST fixes for open fid, nametoolong.
Jeremy.
(This used to be commit e53a81261e)
2002-08-20 20:54:32 +00:00
Andrew Tridgell
e6fa31d6cb added a generic print_guid utility, and get the byte order handing
right
(This used to be commit ec2c17c56f)
2002-08-19 16:55:29 +00:00
Jelmer Vernooij
10e7ae7e74 remove 'admin log' parameter (discussed with Jeremy)
remove 'alternate permissions' parameter (deprecated and not used since 2.0) (discussed with tridge)
(This used to be commit 6e34651591)
2002-08-19 15:33:54 +00:00
Andrew Bartlett
8690b271a6 Move tridge's getgrouplist() replacement function from replace.c to a new
'system_smbd.c' file, where it can link with become_root() and unbecome_root(),
and therefore avoiding some nasty 'it workes on linux' bugs.

(The replacement function is implemented in terms of initgroups(), which is
naturally only avaliable to root).

Andrew Bartlett
(This used to be commit a91018dd02)
2002-08-17 07:09:22 +00:00
Andrew Bartlett
ba1d348265 The idea of this function is not to touch the argument, so make it const too...
(This used to be commit 8a63fe4505)
2002-08-17 04:56:38 +00:00
Tim Potter
88d321becd Merge of netbios namecache code from APPLIANCE_HEAD.
Tridge suggested a generic caching mechanism for Samba to avoid the
proliferation of little cache files hanging around limpet like in the
locks directory.  Someone should probably implement this at some
stage.
(This used to be commit dad31483b3)
2002-08-16 00:25:48 +00:00
Simo Sorce
10712f9a22 *** empty log message ***
(This used to be commit cb72eead70)
2002-08-15 13:25:25 +00:00
Jim McDonough
f3a15363d8 Use byteorder.h macros
(This used to be commit eb9004efc3)
2002-08-12 16:39:10 +00:00
Jim McDonough
d8d1d65958 Code to generate uuids for ADS setups. Uses our random generator but
conforms to standard OSF/DCE uuid format.
(This used to be commit 3b50c3b8cd)
2002-08-12 13:48:19 +00:00
Andrew Bartlett
dd5615c042 Make 'remote_machine' private to lib/substitute.c, and fix all the user to use
the new accessor functions.

Andrew Bartlett
(This used to be commit f393de2310)
2002-08-11 02:30:35 +00:00
Andrew Bartlett
6ddba1e99b Fix the %m security bug again - and try to make it harder to reintroduce in
future.

This moves us from fstrcpy() and global variables to 'get' and 'set' functions.

In particular, the 'set' function sainity-checks the input, in the same way as
we always have.

Andrew Bartlett
(This used to be commit e57a896f06)
2002-08-10 23:20:04 +00:00
Andrew Tridgell
4da476001e fixed a memory corruption bug in the wins code
(This used to be commit 3f6ca04003)
2002-08-06 00:56:39 +00:00
Andrew Tridgell
ab0b4e6f58 make sure we zero the unusued elements in a SID when parsing
(This used to be commit aa5beb63f1)
2002-07-31 09:32:45 +00:00
Andrew Tridgell
4516a14dbb added support for smbd listening on port 445 and 139. It now listens
on both by default, and you can specify a list of ports to listen on
either with "smb ports = " in smb.conf or using the -p option to smbd.

this is needed for proper netbiosless operation.
(This used to be commit 5dee0a7b5e)
2002-07-31 04:56:16 +00:00
Andrew Bartlett
01d9beba6c Make some of the charconv code a bit easier to read and work with - when we
are dealing with utf8 we may as well specify char** for the pointer, save
otherwise casting in the caller.

Andrew Bartlett
(This used to be commit 46021f85b6)
2002-07-30 09:21:57 +00:00
Tim Potter
362f534fa1 Our include popt is starting to get a bit old - fixed some compile
problems here.

Also fixed some non-constant initialisers in samsync.
(This used to be commit 33bd721473)
2002-07-29 23:50:54 +00:00
Tim Potter
6eaa06ac53 A place to store common popt routines.
(This used to be commit b5b64a4e90)
2002-07-29 09:23:01 +00:00
Simo Sorce
a4ec4acd61 found nasty bug in intl/lang_tdb.c tdb structure was not tested to not be null before close
this one fixes swat not working with browsers that set more then one language.

along the way implemented language priority in web/neg_lang.c with bubble sort

also changet str_list_make to be able to use a different separator string

Simo.
(This used to be commit 69765e4faa)
2002-07-28 18:10:39 +00:00
Andrew Tridgell
c4fcf56380 good security patch from Timothy.Sell@unisys.com
we could generate short passwords!
samba-patches 880
(This used to be commit 1466acba7e)
2002-07-28 06:08:30 +00:00
Andrew Bartlett
74d235ff1a It seems I didn't need to write a dup2() wrapper - as we already use it a
lot.  But as thats done, we might as well use it anyway.

Andrew Bartlett
(This used to be commit d78cce806d)
2002-07-28 02:20:15 +00:00
Andrew Bartlett
24675d99e5 Make it possible to query account policy values from pdbedit (set to come soon).
Update account_pol.c to use just uint32, rather then uint32 for paramaters,
int32 for storage.  (The int32 functions didn't have seperate return/status
values, uint32 functions use a pointer-paramater).

Move the #define -> string from a swtich to a table, so we can look it up
both ways.

Andrew Bartlett
(This used to be commit c5b5e3d653)
2002-07-24 05:26:32 +00:00
Andrew Tridgell
fef9d6187e implemented getgrouplist() for systems that don't have it and use it
in get_alias_user_groups(). The old method used getgrent() which is
extremely slow when the number of groups is large
(This used to be commit 44e92b6523)
2002-07-23 09:22:29 +00:00
Andrew Bartlett
afb7d1dc48 Another smattering of static and const
(This used to be commit 897cc4a610)
2002-07-21 03:26:10 +00:00
Tim Potter
27211c55e2 Don't try and sys_dup2(dbf->fd) if dbf == NULL.
(This used to be commit 0fd155a06c)
2002-07-20 21:56:26 +00:00
Andrew Bartlett
aff20d822c Add some const to try and get less warnings.
Andrew Bartlett
(This used to be commit 2a3d821c77)
2002-07-20 11:06:37 +00:00
Andrew Bartlett
714abda3e7 Add support for duplicating stderr into our logfiles.
This is for two things:  To allow panic actions etc to pump out backtraces to
stderr and to allow vangrind to put its stuff in a logfile - making it possible
to debug smbd when launched from inetd.

I've also cleaned up some of the duplicate names in procedures between smbd and
nmbd.

Andrew Bartlett
(This used to be commit 4bcb327319)
2002-07-20 07:02:45 +00:00
Andrew Bartlett
b96de65b26 Add a wrapper for dup2() to our system.c
Andrew Bartlett
(This used to be commit b24b6307f6)
2002-07-20 06:50:47 +00:00
Gerald Carter
39bbeff5b3 fixed a logic error in the sorted_tree_find_child() routine
that caused a valid search to fail.  The printing registry
view now works again.
(This used to be commit 2050859f03)
2002-07-20 02:42:04 +00:00
Gerald Carter
3c0a9c46d8 fixed seg fault in registry frontend caused by trying to
use a destroyed TALLOC_CTX*
(This used to be commit 432b9f8d7c)
2002-07-19 22:16:03 +00:00
Jeremy Allison
3c9e5a9416 Never ignore valgrind messages :-). Don't reference before the start
of a string....
Jeremy.
(This used to be commit 35f0fbd254)
2002-07-19 19:56:27 +00:00
Gerald Carter
9fe3bd1259 * refactored registry operations some. subkey lists and
registry values are now passed around in containers
  (REGSUBKEY_CTR & REGVAL_CTR) which each possess a TALLOC_CTX.

* removed subkey_specific_fn() from REGISTRY_OPS.  Is implemented
  in the form of a wrapper

* temporarily broke the printing registry ops.

* implemented inheritence for the data_p of nodes in a SORTED_TREE

* All REGISTRY_KEY instances now store a valid REGISTRY_HOOK since
  the default REGOSTRY_OPS structure is stored in the root of the
  cache_tree.

* Probably some other change I forgot....  T
(This used to be commit e7b55e8f01)
2002-07-19 18:49:44 +00:00
Andrew Tridgell
ce16d9a26d fixed line buffer mode in XFILE
thanks to tim for finding this bug
(This used to be commit 91bff75454)
2002-07-19 04:00:21 +00:00
Jeremy Allison
923a3a0e1c Previous fix was incorrect. len in string_sub and all_string_sub is
number of *bytes*. >= check was correct, the len=0 case needed changing
to len = ls + 1.
Jeremy.
(This used to be commit 06a4a6d30a)
2002-07-18 23:43:33 +00:00
Jeremy Allison
7f98456fb3 Add useful VALGRIND #ifdef.
Jeremy.
(This used to be commit 07716f3a23)
2002-07-18 23:28:47 +00:00
Jeremy Allison
4bc4a97e36 Fixed off-by-one in all_string_sub also.
Jeremy.
(This used to be commit 8b0e47fc1f)
2002-07-18 23:22:11 +00:00
Jeremy Allison
8e004fe00d Formatting fixups.
Jeremy.
(This used to be commit 4aa922a1af)
2002-07-18 23:21:45 +00:00
Jeremy Allison
687624fc18 Another bug found by valgrind. Don't AND a src length of -1.
Jeremy.
(This used to be commit a67079882d)
2002-07-18 23:01:44 +00:00
Gerald Carter
06ae9ac5d9 virtual registry framework with initial printing hooks.
(This used to be commit a43d9788fa)
2002-07-18 23:00:24 +00:00
Gerald Carter
2afc1ca42c The previous code would not allow things like string_sub(str, "\\", "/", 0).
It complained about an overflow of 0 bytes.

Jeremy please check since you modified this last.
(This used to be commit a5aad76006)
2002-07-18 22:55:48 +00:00
Andrew Tridgell
c238b5c6a1 don't use C++ comments in C - it doesn't work on many compilers
(This used to be commit cf853314f9)
2002-07-15 09:43:34 +00:00
Andrew Tridgell
369040ac5d fixed a problem with getgroups() where it could include our current
effective gid which could mean that the user gets group 0 in their
group list for acl interpretation

this is a replacement fix for the one richard did in 2.2 (which didn't
cope wiith variable behaviour depending on which nss module was in
use)
(This used to be commit cfc5ca3416)
2002-07-15 03:59:14 +00:00
Simo Sorce
050126e684 addedd new (t)alloc_sub_* functions
they will get a const string and return a (t)alloced epanded one.
also modified passdb/* stuff to use this one.
(This used to be commit d378ac1e2e)
2002-07-14 22:21:40 +00:00
Andrew Bartlett
d7bdcee189 make this a ZERO_STRUCTP for consitancy with the rest of Samba.
(This used to be commit 587a3d91b7)
2002-07-13 09:18:55 +00:00
Andrew Tridgell
a0489b36c1 fixed a stdin bug in XFILE that prevented 'print -' from working
(This used to be commit e66e354421)
2002-07-13 04:28:01 +00:00
Jeremy Allison
e40abc248f The changes in make_sec_desc to make us match W2K broke the marshalling/unmarshalling of
security descriptors. We need to calculate the maximum offset and set the offset
back after reading/writing every field in the SEC_DESC.
This was *nasty* to find....
Jeremy.
(This used to be commit 175d43980e)
2002-07-12 21:09:24 +00:00
Jeremy Allison
25148a148c *Experimental* new large-scaling printer code. Splits printing.tdb into
a separate tdb per printer, but only keeps (currently one) tdb open at
a time (although this is easily changed by changing a #define). Needs
scalability testing with large numbers of printers now....
Jeremy.
(This used to be commit b0909cfa14)
2002-07-11 00:06:29 +00:00
Simo Sorce
fe23e902c6 some support functions to ease the next commit.
(This used to be commit 4be1c882be)
2002-07-09 23:59:46 +00:00
Andrew Tridgell
7f42c53971 the last WINS update broke self registration when we are a WINS
server. The real problem is all the special cases we had for when we
are a wins server as opposed to when we are using a 'real' wins
server.

This patch removes the special cases. We now accept non-broadcast
packets from ourselves and we use ourselves as a wins server when we
are one. This gets rid of the special cases and simplifies things
quite a bit.

It all seems to work, but there are bound to be problems found later.
(This used to be commit 3e843d3015)
2002-07-09 14:17:26 +00:00
Andrew Bartlett
21b9280cf5 Kill off const warnings - add a pile of const to various places.
(This used to be commit 1de04ec473)
2002-07-08 02:14:57 +00:00
Andrew Bartlett
8dc39c1112 (this should have been part of the previous commit)
Add a function to display 'sid types' as strings - makes rpcclient outptut
and DEBUG() logs much eaiser to understand.

Move the enum for SID types to smb.h, becouse is really isn't LSA specific any
more.

Andrew Bartlett
(This used to be commit fc97398611)
2002-07-08 00:40:57 +00:00
Andrew Bartlett
dd118a176a Fix the forword prototype to be a static for this static function.
(This used to be commit bb1aa5e1d2)
2002-07-03 06:48:52 +00:00
Jeremy Allison
82176f4d85 Address the string_sub problem by changing len = 0 to mean "no expand".
Went through and checked all string_subs I could to ensure they're being
used correctly.
Jeremy.
(This used to be commit 17cae0d683)
2002-07-02 06:34:27 +00:00
Andrew Tridgell
9930b0b065 used findstatic.pl to make some variables static and remove some dead
code
(This used to be commit 91ad9041e9)
2002-07-01 09:12:41 +00:00
Andrew Tridgell
3563257247 bias the lookup sorting towards directly reachable IPs
(This used to be commit 514b91827a)
2002-07-01 05:39:32 +00:00
Andrew Tridgell
060b73bd8e don't warn on non-existant files in map_file(), let the caller handle any warning
(This used to be commit 98a119ee58)
2002-06-28 03:19:20 +00:00
Andrew Tridgell
5bc613c362 don't warn on the loading of zero length files. This fixes the
'valid.dat' warning
(This used to be commit 57101ef770)
2002-06-28 02:54:40 +00:00
Andrew Tridgell
551a4cd895 fixed a link problem with global_in_nmbd
(This used to be commit 9a3e323ec2)
2002-06-27 14:54:01 +00:00
Andrew Tridgell
223ddc3f2d The next phase in the WINS rewrite!
We now cope wiith multiple WINS groups and multiple failover servers
for release and refresh as well as registration. We also do the regitrations
in the same fashion as W2K does, where we don't try to register the next
IP in the list for a name until the WINS server has acked the previos IP.
This prevents us flooding the WINS server and also seems to make for much
more reliable multi-homed registration.

I also changed the dead WINS server code to mark pairs of IPs dead,
not individual IPs. The idea is that a WINS server might be dead from
the point of view of one of our interfaces, but not another, so we
need to keep talking to it on one while moving onto a failover WINS
server on the other interface. This copes much better with partial
LAN outages and weird routing tables.
(This used to be commit 313f2c9ff7)
2002-06-27 14:37:17 +00:00
Andrew Tridgell
caeaa0acb0 This commit finally gives us multiple wins server groups. We now
accept an extended syntax for 'wins server' like this:

  wins server = group1:192.168.2.10 group2:192.168.3.99 group1:192.168.0.1

The tags before the IPs don't mean anything, they are just a way of
grouping IPs together. If you use the old syntax (ie. no ':') then
an implicit group name of '*' is used. In general I'd recommend people
use interface names for the group names, but it doesn't matter much.

When we register in nmbd we try to register all our IPs with each group
of WINS servers. We keep trying until all of them are registered with
every group, falling back to the failover WINS servers for each group
as we go.

When we do a WINS lookup we try each of the WINS servers for each group.
If a WINS server for a group gives a negative answer then we give up
on that group and move to the next group. If it times out then
we move to the next failover wins server in the group.

In either case, if a WINS server doesn't respond then we mark it dead
for 10 minutes, to prevent lengthy waits for dead servers.
(This used to be commit e125f06058)
2002-06-26 12:17:11 +00:00
Andrew Tridgell
2842de9d7c made the wins list handling a littler clearer
(This used to be commit d03efabc4d)
2002-06-26 07:27:00 +00:00
Andrew Tridgell
5d61d02c15 mumble ... fix typo ... mumble
(This used to be commit 68be27cfea)
2002-06-26 07:23:35 +00:00
Andrew Tridgell
0dd78fbd7d fixed we_are_multihomed() to cope with dynamic interfaces (ie. don't
cache the result!)
(This used to be commit fc8aa198b1)
2002-06-26 07:23:00 +00:00
Andrew Tridgell
07f35f68e0 - completely rewrote the wins_srv.c code. It is now much simpler, and
gives us a good grounding to properly support multiple wins servers
for different interfaces (which will be coming soon ...)

- fixed our wins registration failover code to actually do failover!
We were not trying to register with a secondary wins server at all
when the primary was down. We now fallback correctly.

- fixed the multi-homed name registration packets so that they work
even in a non-connected network (ie. when one of our interfaces is not
routable from the wins server. Yes, this really happens in the real
world).
(This used to be commit a049360d5b)
2002-06-26 06:44:37 +00:00
Andrew Tridgell
de532c8333 fixed a bug in handling select in the main daemon - this stops the daemon spinning if a signal is received at an inconvenient moment
(This used to be commit d8d7dd523d)
2002-06-25 00:59:14 +00:00
Tim Potter
fdaf087daa Changed level of "bind succeded on port %d" debug to 10.
(This used to be commit de00428ef1)
2002-06-21 01:12:12 +00:00
Tim Potter
df1893d532 Fixed compiler warning.
(This used to be commit c29cef7f34)
2002-06-20 00:45:34 +00:00
Simo Sorce
a60e37096d more debug classess activated
(This used to be commit 897e64d2e0)
2002-06-18 09:20:13 +00:00
Gerald Carter
7b60e23040 compile warngin fixes merged from 2.2
(This used to be commit 29874f4b8f)
2002-06-17 15:33:13 +00:00
Tim Potter
aaf43bbc8f Fixed typo in debug.
(This used to be commit 41f036ab37)
2002-06-17 07:39:43 +00:00
Andrew Bartlett
249368f937 Simplify this code further. Just substitute %H, and let the normal code
paths handle the rest later.

Andrew Bartlett
(This used to be commit 09754ec797)
2002-06-15 13:05:37 +00:00
Andrew Bartlett
3c3814da25 Unsused function since last commit
(This used to be commit 957c865cee)
2002-06-15 12:40:37 +00:00
Andrew Bartlett
ac08646c37 Rework much of the service.c code:
The aim of this execise is to give the 'security>=user' code a straight paper
path.  Security=share will sill call authorise_login(), but otherwise we avoid
that mess.

This allow *much* more accurate error code reporting, beocuse we don't start
pretending that we can use the (nonexistant) password etc.

Also in this patch is code to create the 'homes' share at session setup time
(as we have done in the past - been broken recently) and to record this on
the user's vuser struct for later reference.  The changes here should also
allow for much better use of %H (some more changes to come here).

The service.c changes move a lot of code around, but are not as drastric
as they look...

(Also included is a fix to srv_srvsvc_nt.c where 'total_entries' not
'*total_entries' was compared).

This code is needs testing, but passes my basic tests.

I expect we have lost some functionality, but the stuff I had expected
to loose was already broken before I started.  In particular, we don't 'fall
back' to guest if the user cannot access a share (for security=user).  If you
want this kind of stuff then you really want security=share anyway.

Andrew Bartlett
(This used to be commit 4c0cbcaed9)
2002-06-15 12:38:13 +00:00
Andrew Bartlett
b075458ee7 This patch does 2 things:
It extends the 'server mutex' to conver security=server, becouse the connection
race condition exists here too, and while people *should* use security=domain,
some sites don't....

(This probably should be done in 2.2 as well).

Also, start to actually extract and use the information that the remote
server returns in the info3 struct.

The server mutex code is now in a new file.

Andrew Bartlett
(This used to be commit 9b0dabdf4e)
2002-06-15 11:15:31 +00:00
Andrew Bartlett
9026074f60 Add back sys_getpwnam() and freinds to the system.c interface, but don't
use the silly cache any more.  Also add group functions and fix a few callers.

Andrew Bartlett
(This used to be commit 41d4b94077)
2002-06-15 00:47:52 +00:00
Simo Sorce
e69fba0984 moved lp_list_* functions away from param/loadparm.c, put int lib/util_str.c
and renamed to str_list_* as it is a better name.
Elrond should be satisfied now :)
(This used to be commit 4ae260adb9)
2002-06-14 16:02:59 +00:00
Andrew Bartlett
0d7ac4bc2c Patch from ctrlsoft to make the pluggable passdb subsystem use an lp_list
rather than a string when configuring mulitple backends.

Also adjust some of the users of get_global_sam_sid() to cope with the fact
that it just might not exist (uninitialised, can't access secrets.tdb).

More places need conversion.

Add some const and remove silly casts.

Andrew Bartlett
(This used to be commit c264bf2ec9)
2002-06-14 02:58:03 +00:00
Andrew Bartlett
0886638844 Patch (from ctrlsoft <jelmer@nl.linux.org>) to poptify testparm, and the
modifications required to suppress the const warnings.

Andrew Bartlett
(This used to be commit ec4f1e9e2f)
2002-06-14 02:06:58 +00:00
Andrew Bartlett
baef1358d2 Add const, kill of useless casts and therefore eliminate warnings.
Andrew Bartlett
(This used to be commit 29490f2147)
2002-06-14 00:47:08 +00:00
Jeremy Allison
d179b19179 Ensure we save any older SIGALRM signal handler.
Jeremy.
(This used to be commit aa0a6f5532)
2002-06-13 22:49:13 +00:00
Andrew Bartlett
bad738e653 Latest patch from metze <metze@metzemix.de> to move most of samba across
to using SIDs instead of RIDs.

The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument.

The idea here is to prevent mistakes where the SID is implict, but isn't
the same one that we have in the struct.

Andrew Bartlett
(This used to be commit 04f9a8ff4c)
2002-06-13 14:06:08 +00:00
Simo Sorce
2d64b98807 few fixes from Elrond(elrond@samba-tng.org) and Billy O'Connor(billy@oconnoronline.net)
(This used to be commit 88718883e0)
2002-06-11 22:54:06 +00:00
Andrew Bartlett
959ff024da Remove "sids.h" as it really wasn't being used anywhere, and was exporting
the (now static) global_sam_sid.

The only place it was being used was to return global_sid_NULL to some
uid->sid functions - and I'm not convinced this is correct in any case.

Andrew Bartlett
(This used to be commit e2a76a7fc9)
2002-06-10 12:27:05 +00:00
Andrew Bartlett
b0ffabdcca Globally replace 'global_sam_sid' with get_global_sam_sid(), a self
initialising function.  This patch thanks to the work of
"Stefan (metze) Metzmacher" <metze@metzemix.de>

This is partly to enable the transition to SIDs in the the passdb.

Andrew Bartlett
(This used to be commit 96afea638e)
2002-06-07 14:33:33 +00:00
Andrew Bartlett
39d0a1b832 Move the code from lib/util_sid.c that deals with the global_sam_sid into
a file that is linked with the passdb.

This is to avoid linking insanity when this global becomes a self-initing
function.
(This used to be commit 743afd96cb)
2002-06-07 12:45:51 +00:00
Gerald Carter
aed3d69bc5 merge from 2.2
(This used to be commit ce2ddb7041)
2002-06-05 18:30:07 +00:00
Tim Potter
7841864940 Spelling fix.
(This used to be commit 39ec94bffe)
2002-06-05 07:11:22 +00:00
Jim McDonough
9a2261a92a Since includes.h isn't included here, VA_COPY has to be defined here. I don't
see any include file that is guaranteed to be here, so I'm defining it
locally.  Fixes AIX and Solaris builds.
(This used to be commit ca6bb47c22)
2002-06-03 13:37:52 +00:00
Andrew Tridgell
0bb6053946 put the ifdef for HAVE_VA_COPY in one place rather than in lots of
functions
(This used to be commit 1cf3228fdc)
2002-06-03 03:07:24 +00:00
Andrew Bartlett
e066e5e614 Updates to better report some NTSTATUS errors into PAM, and update to PAM
to correctly allow password changes on expired passwords.  (No security
implications, as its just a 'will I let you talk to the server' check).

pam_winbind checks the password prior to changing it, so that users don't
have to make up and type their new password when they havn't even got the
old one right.  This also helps with stacking etc.

Andrew Bartlett
(This used to be commit 2b78d49300)
2002-05-28 14:35:11 +00:00
Simo Sorce
34728ec659 move debug stuff from messages.c to debug.c (Elrond)
(This used to be commit 44df5a13bc)
2002-05-26 11:28:38 +00:00
Andrew Bartlett
20efe2fe6c Clean up a few unused functions, add a bit of static etc.
Importantly:

The removal of the silly 'delete user script' behaviour when secuity=domain.

I have left the name the same - as it still does the (previously documented,
but not in smb.conf(5)) sane behaviour of deleting users on request.

When we decide what to do with the 'add user' functionality, we might
rename it.

Andrew Bartlett
(This used to be commit cdcfe3671e)
2002-05-25 07:37:44 +00:00
Andrew Bartlett
fb70dbdffa Nobody uses this, and its really just a layer of internal implementation.
Make it static (till sombody needs its...)
(This used to be commit 89dc157320)
2002-05-23 14:24:59 +00:00
Jeremy Allison
a3c98a841b Merge of bugfixes from 2.2.
Jeremy.
(This used to be commit 5c8351228c)
2002-05-22 23:34:47 +00:00
Andrew Bartlett
b87eee9836 Add a bit more const, and kill of (finally!) sys_getpwnam and sys_getpwuid.
These might be reimplmented as simple pass-through functions, but all users
really should be doing 'getpwnam_alloc' or 'getpwuid_alloc' to ensure that
there are not shared static buffers.

I don't beleive we actually need a getpw*() cache inside samba - if we do
then I think we should look at our code design first.

(some of these changes are for platforms I don't have access to, but
they look sane)

Andrew Bartlett
(This used to be commit 9d8431b04f)
2002-05-22 12:44:45 +00:00
Andrew Bartlett
daec6cbbee Cleanups!
Make some code static, add some const to the PAM code, and make the plaintext
password code actually function - particulary without the requirement to
modify the 'struct passwd' (which it assumed was made up of fstrings)

This kills some particularly ugly code in lib/util_pw.c

Andrew Bartlett
(This used to be commit 302dad4990)
2002-05-22 12:14:28 +00:00
Andrew Bartlett
c2b867038a Fix a silly memory (getpnam_alloc()) leak spotted by Elrond, and move
the DATA_BLOB code into its own file.

It would be nice to go over some of the other util.c functions, and check
that we still use them all, and that we use them in more than one place.

Andrew Bartlett
(This used to be commit d0ea70fce5)
2002-05-22 11:25:43 +00:00
Gerald Carter
34278af77a merge from SAMBA_2_2
(This used to be commit 2424578c29)
2002-05-20 16:55:00 +00:00
Tim Potter
c523cce510 Fixed compiler warning.
(This used to be commit 793d9306e2)
2002-05-19 11:21:28 +00:00
Andrew Bartlett
80b22f6433 Keep the compiler happy
(This used to be commit 84ea2a434b)
2002-05-19 02:28:14 +00:00
Simo Sorce
2a02a76913 so here it is the code to introduce seriously debugggging classes.
this is a first step only passdb stuff has beein "classized".

 - so what can you do?
   set debug level to:  1 poasdb:10
   that will make all the code run at debug level 1 except the code in
   passdb/* files that will run at level 10
   TODO: fix the man page

 - also smbcontrol has this nice feature so smbcontrol smbd debug 3 passdb:5
   will set every smbd to have a default log level of 3 while passdb stuff
   will be at level 5

   and so no..

  minor cosmetic fix to pdbedit is there too
(This used to be commit be5c3b3f57)
2002-05-18 15:09:21 +00:00
Andrew Bartlett
ac03889168 Move client_receive_smb to clientgen.c as a static, as proposed by Elrond.
(only function that used it was unused, and this helps bring TNG and HEAD
closer)

Its also cleaner.

Andrew Bartlett
(This used to be commit 78f47c8333)
2002-05-18 13:19:38 +00:00
Andrew Bartlett
58e1fe62cc A few things in this commit:
cleanup some of the code in net_rpc_join re const warnings and
fstrings.

Passdb:

Make the %u and %U substituions in passdb work.
This is done by declaring these paramters to be 'const' and doing
the substitution manually.  I'm told this is us going full circle,
but I can't really see a better way.

Finally these things actually seem to work properly...

Make the lanman code use the pdb's recorded values for homedir etc
rather than the values from lp_*()

Add code to set the plaintext password in the passdb, where it can
decide how to store/set it.  For use with a future 'ldap password
change' option, or somthing like that...

Add pdb_unix, so as to remove the 'not in passdb' special cases from the
local_lookup_*() code.  Quite small, as it uses the new 'struct passwd ->
SAM_ACCOUNT' code that is now in just one place.  (also used by pdb_smbpasswd)

Other:
Fix up the adding of [homes] at session setup time to actually pass
the right string, that is the unix homedir, not the UNC path.

Fix up [homes] so that for winbind users is picks the correct name.
(bad interactions with the default domain code previously)

Change the rpc_server/srv_lsa_nt.c code to match NT when for the
SATUS_NONE_MAPPED reply:  This was only being triggered on
no queries, now it is on the 'no mappings' (ie all mappings failed).
Checked against Win2k.

Policy Question:  Should SID -> unix_user.234/unix_group.364 be
considered a mapping or not?  Currently it isn't.

Andrew Bartlett
(This used to be commit c28668068b)
2002-05-18 05:52:52 +00:00
Jim McDonough
27ecfceae1 Don't forget the semicolon, you fool!
(This used to be commit 1c9387330f)
2002-05-17 14:55:50 +00:00
Jim McDonough
c7523c5751 Fix usage of va_list passed as an arg. Use __va_copy before using it
when it exists.
(This used to be commit 85ab07bdc1)
2002-05-17 14:51:22 +00:00
Andrew Bartlett
e4672862fd Make Get_Pwnam use getpwnam_alloc() in an attempt to make it segfault rather
than allow silent reuse of stale static buffer.

Next step is to make this fn return that allocated buffer.
(This used to be commit e1daf816f3)
2002-05-17 14:19:36 +00:00
Andrew Bartlett
eed5094264 This removes --with-ssl from Samba.
This option was badly maintained, useless and confused our users and
distirbutors.  (its SSL, therfore it must be good...)

No windows client uses this protocol without help from an SSL tunnel.

I can't see any reason why setting up a unix-side SSL wrapper would
be any more difficult than the > 10 config options this mess added
to samba in any case.

On the Samba client end, I think the LIBSMB_PROG hack should be
sufficient to start stunnel on the unix side.  We might extend this
to take %i and %p (IP and port) if there is demand.

Andrew Bartlett
(This used to be commit b04561d3fd)
2002-05-17 12:42:39 +00:00
Jim McDonough
276e1928c4 Add __va_copy to talloc functions. talloc_asprintf was causing all kinds
of problems on Linux/390 systems...
(This used to be commit 2605e483b3)
2002-05-16 20:06:00 +00:00
Simo Sorce
282d069ff4 move vsyslog() from snprintf.c to replace.c
tx Elrond for prosecuting cleanness :)
(This used to be commit 2f30c2edfd)
2002-05-11 16:55:59 +00:00
Jeremy Allison
1bd3da9aef NT uses NT_STATUS_OBJECT_NAME_NOT_FOUND not NT_STATUS_NO_SUCH_FILE for ENOENT.
Jeremy.
(This used to be commit 2b49d727b0)
2002-05-09 17:44:42 +00:00
Jeremy Allison
30c80f90ad We were mapping the open of name1/name2 where name1 wasn't a directory
(ie. ENOTDIR) to the NT status code NT_STATUS_NOT_A_DIRECTORY. NT seems
to use NT_STATUS_OBJECT_PATH_NOT_FOUND. I'm hoping this will fix the
access binaries served from a Samba share bug...
Jeremy.
(This used to be commit 6f2b76c239)
2002-05-09 17:38:23 +00:00
Gerald Carter
27cd004bf2 merge from SAMBA_2_2
(This used to be commit c26ce496e8)
2002-05-09 17:35:42 +00:00
Gerald Carter
4db4e95ab2 pidfile merge from SAMBA_2_2 (including --with-fhs) and a few other minor things; compiles and shouldnt break, but needs testing
(This used to be commit 19b9b50d90)
2002-05-09 04:08:00 +00:00
Jeremy Allison
6337369a90 Merge in Jerry's called name fix.
Jeremy.
(This used to be commit 6d95792457)
2002-05-08 23:15:42 +00:00
Andrew Tridgell
193225dd42 patch from Alexander Bokovoy needed for dlopen on bsd systems
(This used to be commit 38fd99e841)
2002-04-24 11:43:02 +00:00
Jeremy Allison
ca2e14ddc3 We cannot set errno=0 in any of the wrapper calls as this breaks UNIX error
returns to the client.
Jeremy.
(This used to be commit 1d66e53a64)
2002-04-19 21:45:02 +00:00
Jeremy Allison
4f4d25d3e1 Fix different args to sys_fcntl without going varargs....
Jeremy.
(This used to be commit 65742067e0)
2002-04-19 17:30:27 +00:00
Jeremy Allison
8bc0e73a43 Fixed one more sendto.
Jeremy.
(This used to be commit 7adcc930ca)
2002-04-19 17:22:32 +00:00
Jeremy Allison
b63be4e1ab Added sys_fcntl (not to be used everywhere). Added sys_read/sys_write
for transfer_file.
Jeremy.
(This used to be commit c7ff521bab)
2002-04-19 03:05:38 +00:00
Jeremy Allison
e762f93821 Fixed sendto in oplock code.
Jeremy.
(This used to be commit 64974fa334)
2002-04-19 02:20:04 +00:00
Jeremy Allison
e41915d7c8 Fix send and recvfrom.
Jeremy.
(This used to be commit 8cbc24c3bd)
2002-04-19 02:15:10 +00:00
Jeremy Allison
302b581ddc First cut at fix for the EINTR problem... More needs to be done I think.
Jeremy.
(This used to be commit 48475a7a69)
2002-04-19 02:08:52 +00:00
Andrew Tridgell
6a9bc86d62 nicer strndup() function
(This used to be commit 546764f3cb)
2002-04-18 03:59:02 +00:00
Andrew Tridgell
e35ac78c49 make suure we get the return value from the pull_*() functions right
for both null terminated and buffer length terminated strings
(This used to be commit e8fbf853e0)
2002-04-17 02:37:46 +00:00
Simo Sorce
1416106736 sync with 2.2
(This used to be commit 18d5ffd835)
2002-04-16 22:56:08 +00:00
Andrew Tridgell
7c0301d100 stricter conditions on termination in strings
this was a very nasty bug with filename corruption and NT4 clients. The
exact termination conditions are quite critical ...
(This used to be commit a538efe7d0)
2002-04-16 22:55:39 +00:00
Simo Sorce
a32940d53e Fix incorrect zpadlen handling in fmtfp.
Thanks to Ollie Oldham <ollie.oldham@metro-optix.com> for spotting it.
few mods to make it easier to compile the tests.
addedd the "Ollie" test to the floating point ones.
(This used to be commit 415f9d92bc)
2002-04-16 22:38:04 +00:00
Andrew Tridgell
b66932e1a5 fixed the handling of STR_TERMINATE
(This used to be commit dbc6b137a8)
2002-04-16 12:07:12 +00:00
Andrew Tridgell
02f84c6bd0 i forgot to commit these parts of the string handling patch earlier. Sorry.
(This used to be commit bac0093a97)
2002-04-16 10:40:23 +00:00
Tim Potter
36514b65ee Fixed incorrect debug.
(This used to be commit 3b6df44ddc)
2002-04-15 01:55:57 +00:00
Andrew Bartlett
07e6ff5fcf Partly based on the work by mimir (Rafal Szczesniak
<mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly
enumerate its trusted domains - by exaimining the keys in the secrets.tdb file.

This patch has been tested with both NT4 and rpcclient/wbinfo, and adds
some extra functionality to talloc and rpc_parse to allow it to deal with
already unicode strings.

Finally, this cleans up some const warnings that were in net_rpc.c by pushing
another dash of const into the rpc client code.

Andrew Bartlett
(This used to be commit 0bdd94cb99)
2002-04-14 09:44:16 +00:00
Andrew Bartlett
163a855d26 Better handling of uid/gid -> RID and RID -> uid/gid code.
All uids and gids must create valid RIDs, becouse other code expects this, and
can't handle the failure case. (ACL code in particular)

Allow admins to adjust the base of the RID algorithm, so avoid clashes with
users brought in from NT (for example).

Put all the algorithm code back in one place, so that this change is global.

Better coping with NULL sid pointers - but it still breaks a lot of stuff.

BONUS: manpage entry for new paramater :-)

counter based rids for normal users in tdbsam is disabled for the timebeing,
idra and I will work out some things here soon I hope.

Andrew Bartlett
(This used to be commit 5275c94cdf)
2002-04-13 09:35:52 +00:00
Andrew Tridgell
5928c293ff added strndup() for systems that don't have it
(This used to be commit 7e92fb7453)
2002-04-11 15:27:22 +00:00
Andrew Tridgell
714518e550 this adds a completely new hash based mangling scheme
the hash for this scheme is *much* larger (approximately 31 bits) and
the code is written to be very fast, correctly handling multibyte
while not doing any actual multi-byte conversions in the vast majority
of cases

you can select this scheme using "mangling method = hash2", although I
may make it the default if it works out well.
(This used to be commit bb173c1a7e)
2002-04-11 09:56:38 +00:00