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

1439 Commits

Author SHA1 Message Date
Gerald Carter
ee9cbf5807 sync with HEAD 0001-01-01 00:00:00 +00:00
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release 0001-01-01 00:00:00 +00:00
cvs2svn Import User
9a5541595f This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
760c0740ca Kill of Get_Pwnam_Modify and smb_getpwnam(). The latter assumes some things
that just don't apply any more - now that we always keep username and domain
seperate.  Also, the policy it was trying to permit is now implemented by the
auth code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
cfd1bf250b Merge of "profile acls" code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f4845b0213 Merge back Richard's FreeBSD sendfile fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
91e41ebe97 HPUX sendfile is now detected correctly.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a7781f91d8 Never, *ever* hold a mutex lock in the message database where there may
be traversals being attempted. Yes, this was from bitter experience (and
an out of control server :-). Also allow callers to break out of a tdb_chainlock
with sigalarm if desired.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5881f0a226 Actually use sendfile if selected.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f956a4d29d Attempt to make broken Linux sendfile work.... Still in progress.
Jeremy.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
dc3c14fc2b Put unixsocket calls between #ifdef HAVE_UNIXSOCKET's - required for Stratus VOS
(Double checked)
0001-01-01 00:00:00 +00:00
Jeremy Allison
7e2f9769c9 Use HAVE_SENDFILE64, not SENDFILE64.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
872dfd87cd Added fix for broken Linux (no sendfile64). When offset + count > 2GB
then return ENOSYS and let the upper layer handle it.
Jeremy
0001-01-01 00:00:00 +00:00
Jeremy Allison
9dad88e1d4 Fixed up FreeBSD sendfile code - only Solaris left then I can add the
configure tests...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d7024e8cb9 HPUX takes offset, not pointer to offset.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2b33a500a8 Fixup sendfile to match HPUX semantics with signal interrups. This was
fiddly.... :-(.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
fd772ca7b1 First cut at portable sendfile code. Only used in readX at the moment
and doesn't actually call sendfile. Needs to be vectored through the
VFS and tested on all supported platforms (Solaris/HPUX/FreeBSD/Linux).
Linux doesn't actually work (2.4.19 kernel) at the moment because it
doesn't have a 64-bit clean sendfile.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
05a202c287 added gencache implementation from mimir - thanks! 0001-01-01 00:00:00 +00:00
Herb Lewis
43a39e85b6 lowercase global_myname in %L substitution 0001-01-01 00:00:00 +00:00
Simo Sorce
29b4b9a2b5 configure.in:
reflect the new example/VFS/ directory organization

lib/substitue.c:
added helper functions needed by recycle bin
0001-01-01 00:00:00 +00:00
Andrew Bartlett
55ee289f58 As per the 'OK' at CIFS2002, only use the readline headers (and this crasy
#ifdef mess...) in readline.c, we don't need or use them in the rest of Samba.

(This OK was of course conditional on 'if you break it, you better fix it...')

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
601b56e04f patch from metze: add a 'vfs' debug class 0001-01-01 00:00:00 +00:00
Jeremy Allison
aca3337196 Add bcast_msg_flags to connection struct. Allows sender to filter when
sending broadcast messages. Also initial cut-down of printing notify
messages (not yet finished).
Jeremy.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
8fb4534212 Fix typo - Thanks Kai 0001-01-01 00:00:00 +00:00
Simo Sorce
58f912da47 wrong way to handle things, bug found by kai 0001-01-01 00:00:00 +00:00
Andrew Bartlett
9deada345c Add a bit of 'const' and move a lot of our 'repeditive' DEBUG() statements to
'DEBUGADD', so we don't repeat headers.  (Makes them much easier to read).

(Based on patch by kai)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Herb Lewis
29a8f21211 based on function prototype, the args were switched - this gave an error
on the IRIX compiler. could whoever put the FIXME message take a look and
see if it is still broken.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
0ea4bcb6b7 Move samr_make_sam_obj_sd to lib/util_seaccess.c. samtest now compiles and
links successfully!
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
fc29385029 Make debuglevel a string for use with debug classes 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
4b7de5ee23 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
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
b1ab3bec8d Make const 0001-01-01 00:00:00 +00:00
Tim Potter
8f065f788b Some debugs for panic_action. 0001-01-01 00:00:00 +00:00
Simo Sorce
b275547c9e 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.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
de1964f7fa 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
17096315a0 Try to support non-root-mode systems without getgrouplist().
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
a613dde7ed Clarify function comments 0001-01-01 00:00:00 +00:00
Andrew Bartlett
3e682867bb 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
0001-01-01 00:00:00 +00:00
Simo Sorce
f76e5b2677 We never checked if the smb packet len is != 0
Should fix a supposed DoS too.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8fbc964f2f We need to return the value here...
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Tridgell
26fc20187d added smb_xstrndup() 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f458113364 added a useful unistr2 display function 0001-01-01 00:00:00 +00:00
Tim Potter
24fa84bda4 Spelling fixes. 0001-01-01 00:00:00 +00:00
Gerald Carter
ccb02f7cfc fix a few segfaults 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
addf29e676 Patch from Paul Green <Paul.Green@stratus.com> to be more POSIX-compatible 0001-01-01 00:00:00 +00:00
Volker Lendecke
5af5326f13 Fix debug level initialization for net.c
Volker
0001-01-01 00:00:00 +00:00
Jeremy Allison
e53a81261e IFSTEST fixes for open fid, nametoolong.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ec2c17c56f added a generic print_guid utility, and get the byte order handing
right
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
6e34651591 remove 'admin log' parameter (discussed with Jeremy)
remove 'alternate permissions' parameter (deprecated and not used since 2.0) (discussed with tridge)
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
3928578b52 sync 3.0 branch with head 0001-01-01 00:00:00 +00:00
cvs2svn Import User
6938b5b98a This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
a91018dd02 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8a63fe4505 The idea of this function is not to touch the argument, so make it const too... 0001-01-01 00:00:00 +00:00
Tim Potter
dad31483b3 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.
0001-01-01 00:00:00 +00:00
Simo Sorce
cb72eead70 *** empty log message *** 0001-01-01 00:00:00 +00:00
Jim McDonough
eb9004efc3 Use byteorder.h macros 0001-01-01 00:00:00 +00:00
Jim McDonough
3b50c3b8cd Code to generate uuids for ADS setups. Uses our random generator but
conforms to standard OSF/DCE uuid format.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f393de2310 Make 'remote_machine' private to lib/substitute.c, and fix all the user to use
the new accessor functions.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e57a896f06 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
3f6ca04003 fixed a memory corruption bug in the wins code 0001-01-01 00:00:00 +00:00
Andrew Tridgell
aa5beb63f1 make sure we zero the unusued elements in a SID when parsing 0001-01-01 00:00:00 +00:00
Andrew Tridgell
5dee0a7b5e 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.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
46021f85b6 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
0001-01-01 00:00:00 +00:00
Tim Potter
33bd721473 Our include popt is starting to get a bit old - fixed some compile
problems here.

Also fixed some non-constant initialisers in samsync.
0001-01-01 00:00:00 +00:00
Tim Potter
b5b64a4e90 A place to store common popt routines. 0001-01-01 00:00:00 +00:00
Simo Sorce
69765e4faa 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1466acba7e good security patch from Timothy.Sell@unisys.com
we could generate short passwords!
samba-patches 880
0001-01-01 00:00:00 +00:00
Andrew Bartlett
d78cce806d 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c5b5e3d653 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
44e92b6523 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
897cc4a610 Another smattering of static and const 0001-01-01 00:00:00 +00:00
Tim Potter
0fd155a06c Don't try and sys_dup2(dbf->fd) if dbf == NULL. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
2a3d821c77 Add some const to try and get less warnings.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
4bcb327319 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
b24b6307f6 Add a wrapper for dup2() to our system.c
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
2050859f03 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
432b9f8d7c fixed seg fault in registry frontend caused by trying to
use a destroyed TALLOC_CTX*
0001-01-01 00:00:00 +00:00
Jeremy Allison
35f0fbd254 Never ignore valgrind messages :-). Don't reference before the start
of a string....
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
e7b55e8f01 * 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
0001-01-01 00:00:00 +00:00
Andrew Tridgell
91bff75454 fixed line buffer mode in XFILE
thanks to tim for finding this bug
0001-01-01 00:00:00 +00:00
Jeremy Allison
06a4a6d30a 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
07716f3a23 Add useful VALGRIND #ifdef.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8b0e47fc1f Fixed off-by-one in all_string_sub also.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
4aa922a1af Formatting fixups.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a67079882d Another bug found by valgrind. Don't AND a src length of -1.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
a43d9788fa virtual registry framework with initial printing hooks. 0001-01-01 00:00:00 +00:00
Gerald Carter
a5aad76006 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 0001-01-01 00:00:00 +00:00
Andrew Tridgell
cf853314f9 don't use C++ comments in C - it doesn't work on many compilers 0001-01-01 00:00:00 +00:00
Andrew Tridgell
cfc5ca3416 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)
0001-01-01 00:00:00 +00:00
Simo Sorce
d378ac1e2e 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.
0001-01-01 00:00:00 +00:00
cvs2svn Import User
b8d39651fb This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
587a3d91b7 make this a ZERO_STRUCTP for consitancy with the rest of Samba. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e66e354421 fixed a stdin bug in XFILE that prevented 'print -' from working 0001-01-01 00:00:00 +00:00
Jeremy Allison
175d43980e 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b0909cfa14 *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.
0001-01-01 00:00:00 +00:00
Simo Sorce
4be1c882be some support functions to ease the next commit. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3e843d3015 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.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
1de04ec473 Kill off const warnings - add a pile of const to various places. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
fc97398611 (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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
bb1aa5e1d2 Fix the forword prototype to be a static for this static function. 0001-01-01 00:00:00 +00:00