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

811 Commits

Author SHA1 Message Date
Günther Deschner
3c70480f3b s3-util: add get/set_cmdline_auth_info_domain to user_auth_info struct.
Guenther
2009-09-11 00:36:59 +02:00
Zach Loafman
808a0d44f8 Allow for name array strings that don't end in a slash
Fix set_namearray to allow for strings that don't end in a slash. Also
remove unnecessary strdup()s.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-08-25 13:01:57 -07:00
Olaf Flebbe
5359e397ff make smbcontrol smbd ping work proper checking for arguments handle short pid_t correctly 2009-08-24 16:17:43 +02:00
Tim Prouty
161e182b65 s3: Remove is_ntfs_stream_name() and split_ntfs_stream_name()
Actually I moved split_ntfs_stream_name into torture.c which is the one
consumer of it.  This could probably be changed at some point.
2009-07-08 21:36:04 -07:00
Stefan Metzmacher
a14efbadd5 s3:util: let parent_dirname() correctly return toplevel filenames
metze
2009-07-01 12:53:41 +02:00
Andrew Kroeger
6c5c991304 s3: Call va_end() after all va_start()/va_copy() calls.
There are error paths in S3 where va_end() is not properly called after
va_start() or va_copy() have been called.

These issues were noted while performing an inspection for S4 bug #6129.  Thanks
to Erik Hovland <erik@hovland.org> for the original bug report.
2009-06-12 10:29:37 +02:00
Günther Deschner
bff54b90c3 util: move add_gid_to_array_unique to toplevel and add add_uid_to_array_unique.
Guenther
2009-05-29 13:49:58 +02:00
Marc VanHeyningen
a4887e250b s3: Allow child processes to exit gracefully if we are out of fds
When we run out of file descriptors for some reason, every new
connection forks a child that immediately panics causing smbd to
coredump.  This seems unnecessarily harsh; with this code change we
now catch that error and merely log a message about it and exit
without the core dump.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-05-27 13:16:17 -07:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
This patch introduces

struct stat_ex {
        dev_t           st_ex_dev;
        ino_t           st_ex_ino;
        mode_t          st_ex_mode;
        nlink_t         st_ex_nlink;
        uid_t           st_ex_uid;
        gid_t           st_ex_gid;
        dev_t           st_ex_rdev;
        off_t           st_ex_size;
        struct timespec st_ex_atime;
        struct timespec st_ex_mtime;
        struct timespec st_ex_ctime;
        struct timespec st_ex_btime; /* birthtime */
        blksize_t       st_ex_blksize;
        blkcnt_t        st_ex_blocks;
};
typedef struct stat_ex SMB_STRUCT_STAT;

It is really large because due to the friendly libc headers playing macro
tricks with fields like st_ino, so I renamed them to st_ex_xxx.

Why this change? To support birthtime, we already have quite a few #ifdef's at
places where it does not really belong. With a stat struct that we control, we
can consolidate the nanosecond timestamps and the birthtime deep in the VFS
stat calls.

At this moment it is triggered by a request to support the birthtime field for
GPFS. GPFS does not extend the system level struct stat, but instead has a
separate call that gets us the additional information beyond posix. Without
being able to do that within the VFS stat calls, that support would have to be
scattered around the main smbd code.

It will very likely break all the onefs modules, but I think the changes will
be reasonably easy to do.
2009-05-26 17:48:23 +02:00
Jelmer Vernooij
4c32978d97 Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() if
the system one is broken.
2009-04-20 23:58:26 +02:00
Günther Deschner
531af136f9 s3: remove POLICY_HND.
Guenther
2009-03-18 23:22:29 +01:00
Jeremy Allison
8dd1faaa29 Remove the global "struct cm_cred_struct" and associated calls, make
callers pass in a struct user_auth_info * instead. This commit causes
smbc_set_credentials() to print out a message telling callers to use
smbc_set_credentials_with_fallback() instead, as smbc_set_credentials()
has a broken API (no SMBCCTX * pointer). No more global variables used
in the connection manager API for client dfs calls.
Jeremy.
2009-03-17 14:53:06 -07:00
Jeremy Allison
382d8069ad Add some appropriate const.
Jeremy.
2009-03-16 16:38:15 -07:00
Steven Danneman
5a9f668dab s3: Remove madvise support
This reverts 193be432.  The MADVISE_PROTECT is inherited by all child
processes and cannot be unset.  The intention of the original patch was
to protect the parent process, but allow children to be killed in low
memory.  Since this isn't possible with the current API, reverting the
whole feature.
2009-03-04 11:07:27 -08:00
Volker Lendecke
202a31d96d Remove read_pkt 2009-02-24 20:40:48 +01:00
Steven Danneman
193be432a2 s3: Refactor of madvise() usage in c441f58d
* move to reinit_after_fork() to protect all Samba daemons
* only protect parent processes
2009-02-20 16:30:13 -08:00
Steven Danneman
116ce19b10 Moved become_daemon() and close_low_fds() to shared util lib 2009-02-20 16:30:12 -08:00
Volker Lendecke
0844cca1d5 Replace get_myname() with the talloc version from v3-3-test 2009-02-13 12:15:03 +01:00
Volker Lendecke
47cb572d40 Add read_pkt_send/recv 2009-02-10 18:29:34 +01:00
Volker Lendecke
d94e9c802c Remove the global variable "chain_size" 2009-01-31 11:09:39 +01:00
Tim Prouty
b8f7cdbd79 s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is
returned to the client.
2009-01-29 15:29:33 -08:00
Stefan Metzmacher
26e863e6dd s3: reinit_after_fork() should reinit the event context before the messaging context
Because messaging_reinit() may add events to the event context, which will
removed by event_context_reinit().

metze
2009-01-20 00:41:20 +01:00
Jeremy Allison
6fd867f036 Allow reinit_after_fork to be called safely from within swat and other binaries that don't have
an event context or a msg context. Fixes crash bug in swat.
Jeremy.
2009-01-15 15:52:41 -08:00
Steven Danneman
19a05bf2f4 Make STATEDIR and CACHEDIR configurable through ./configure and loadparm.c
If they are not explicitely set in either place both will default to LOCKDIR.

Signed-off-by: Michael Adam <obnox@samba.org>
2009-01-12 12:16:03 +01:00
Bo Yang
022e2f8199 clean event context after child is forked.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-01-05 15:07:31 +01:00
Volker Lendecke
972295f80a Rename parent_dirname_talloc() to parent_dirname() 2008-12-31 19:33:25 +01:00
Volker Lendecke
9b79181f15 Remove unused function parent_dirname 2008-12-31 19:33:25 +01:00
Volker Lendecke
8a507b1e7f Make use of TALLOC_MEMDUP in parent_dirname_talloc() 2008-12-31 19:33:24 +01:00
Volker Lendecke
add3d572d0 Remove unused function get_numlist() 2008-12-31 19:33:24 +01:00
Volker Lendecke
daeb3a190d Remove the global "cmdline_auth_info" from source3/lib/util.c
This involves changing all our clients, that's why it's so large.
2008-12-14 14:00:43 +01:00
Volker Lendecke
9a3be6f0f8 Move cli_trans_oob to lib/util.c
Rename it to trans_oob, it will be used in the server routines.
2008-11-28 08:24:37 +01:00
Jeremy Allison
8962be69c7 Make us clean under valgrind --leak-check=full by using talloc_autofree_context() instead of NULL.
Remove the code in memcache that does a TALLOC_FREE on stored pointers. That's a disaster waiting
to happen. If you're storing talloc'ed pointers, you can't know their lifecycle and they should
be deleted when their parent context is deleted, so freeing them at some arbitrary point later
will be a double-free.
Jeremy.
2008-11-06 20:48:13 -08:00
Jelmer Vernooij
f0c4829e82 Remove silly safe_free() function which is a wrapper around SAFE_FREE().
Since it's a function it just sets the local pointer to NULL and basically
is an equivalent to free().

It also claims it's being used for callbacks but isn't used that way
anywhere.
2008-10-19 13:06:14 +02:00
Jelmer Vernooij
b3b6d8f3f9 Fix const, dupes. 2008-10-18 15:00:18 +02:00
Jelmer Vernooij
2d89b52be8 Use separate make variables for libutil and libcrypto. 2008-10-18 14:28:40 +02:00
Jelmer Vernooij
519458a2fa Use shared util.c. 2008-10-18 14:27:13 +02:00
Jelmer Vernooij
842ea427bc Use standard va_copy. 2008-10-18 14:15:33 +02:00
Jelmer Vernooij
2fddd2e2d5 Share ndrdump implementation. 2008-10-13 15:58:45 +02:00
Volker Lendecke
ce47a2b2e3 Add a utility function to append a DATA_BLOB to a talloc object
(This used to be commit d8259cbe66)
2008-09-09 17:37:34 +02:00
Michael Adam
25f31194e5 Add modules_path() to construct paths to files in MODULESDIR.
Michael
(This used to be commit 5ef9da6f4f)
2008-08-15 23:19:57 +02:00
Jeremy Allison
03991ab073 Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.
Here is a patch to allow many subsystems to be re-initialized. The only
functional change I made was to remove the null context tracking, as the memory
allocated here is designed to be left for the complete lifetime of the program.
Freeing this early (when all smb contexts are destroyed) could crash other
users of talloc.
Jeremy.
(This used to be commit 8c630efd25)
2008-08-12 13:35:15 -07:00
Volker Lendecke
4dfb6c0347 Remove an unused variable, process.c has its static copy
(This used to be commit 59136544ec)
2008-08-10 11:33:15 +02:00
Günther Deschner
6a3b742db7 util: add policy_hnd_equal().
Guenther
(This used to be commit 6aca163e89)
2008-07-17 10:32:03 +02:00
Derrell Lipman
31262a59bc [BUG 5580] Allow access to DFS shares via libsmbclient
Brian Sheehan provided a nice patch intended for the 3.0 code base.  This
commit applies a similar patch for the 3.3 code base.  It adds a new public
function to libsmbclient -- smbc_set_credentials() -- that may be called from
the authentication callback when DFS referrals are in use.

Derrell
(This used to be commit 888f922bd0)
2008-07-08 20:44:39 -04:00
Volker Lendecke
dc2e8823d2 If no node number is given, default to the current node in smbcontrol
(This used to be commit b4b3b6b1c6)
2008-05-19 14:56:15 +02:00
Günther Deschner
e556dfbb93 util: add strip_hostname() to strip of leading '\\'.
Guenther
(This used to be commit dbf96120d8)
2008-05-09 14:59:19 +02:00
Volker Lendecke
6ed9b7c973 Make the namelist arg to set_namearray const
(This used to be commit e7ce4bce5c)
2008-05-05 18:28:58 +02:00
Günther Deschner
4d8836ab96 Fix client authentication with -P switch in client tools (Bug 5435).
Guenther
(This used to be commit d077ef64cd)
2008-05-05 16:59:53 +02:00
Volker Lendecke
0c4093a234 Fix CLEAR_IF_FIRST handling of messages.tdb
We now open messages.tdb even before we do the become_daemon. become_daemon()
involves a fork and an immediate exit of the parent, thus the
parent_is_longlived argument must be set to false in this case. The parent is
not really long lived :-)
(This used to be commit 4f4781c6d1)
2008-04-23 22:18:26 +02:00
Stefan Metzmacher
bd1b120c2d util: add reinit_after_fork() function
metze
(This used to be commit 5f6c3a4f6d)
2008-04-18 14:43:07 +02:00
Günther Deschner
16fca542d7 Move is_valid_policy_hnd() out of net.
Guenther
(This used to be commit aae4d91e72)
2008-04-08 19:54:57 +02:00
Gerald W. Carter
8940fd09a6 Patch from Nicholas Brealey <nick@brealey.org> to distinguish between WinXP and WinXP64.
Defines a new value for the %a variable when detecting a Windows XP 64-bit client.
(This used to be commit 0c94918fb5)
2008-03-31 14:34:43 -05:00
Tim Potter
54db183987 Adding missing calls to va_end().
Just a small commit to get a handle on this git thingy.  This patch
fixes some missing calls to va_end() to match various calls to va_start()
and VA_COPY().

Tim.
(This used to be commit ec367f307d)
2008-01-27 09:33:42 +01:00
Michael Adam
a60b913a37 Fix tab_depth: it should not create an extra debug header.
In pstring removal 4ae4b23586, the behaviour of tab_depth was
changed to create an extra debug header (by using the DEBUGLVL
macro).

This extracts the debug level check from DEBUGLVL into
a macro CHECK_DEBUGLVL without the debug header creation
and uses this instead of DEBUGLVL in tab_depth.

Michael
(This used to be commit cbc7d921fa)
2008-01-23 08:16:37 +01:00
Volker Lendecke
2411c6cb90 Add "split_ntfs_stream_name()" together with a torture test
(This used to be commit d813bd9e02)
2008-01-19 23:10:09 +01:00
Alexander Bokovoy
68694369fc Merge CTDB-related fixes from samba-ctdb 3.0 branch (http://samba.org/~tridge/3_0-ctdb)
Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbb)
2008-01-16 12:09:48 +03:00
Michael Adam
ba2a255282 Move transfer_file and transfer_file_internal to a module of their own.
Also, don't auto-generate prototypes of the (two) exported functions
but make a start in having handwritten prototypes in dedicated header
files (not in includes.h ... :-)

Michael
(This used to be commit 395f29d8b7)
2008-01-10 14:31:25 +01:00
Michael Adam
386caead47 Reformat some code I just touched.
Michael
(This used to be commit 4ed238b1e4)
2008-01-10 14:28:12 +01:00
Michael Adam
9f6d0479d7 Fix a really silly typo.
Michael
(This used to be commit 7b0af7cdc9)
2008-01-10 14:18:46 +01:00
Michael Adam
5661ac6a38 Correctly abstract the transfer_file mechanism with callbacks and void ptrs.
This removes the in_fsp and out_fsp global variables hack from smbd/vfs.c.

Michael
(This used to be commit b2e7cdc6e8)
2008-01-10 13:30:46 +01:00
Günther Deschner
02f67cfcfa Add free_local_machine_name().
Guenther
(This used to be commit f3ebb4f96b)
2008-01-07 14:53:07 +01:00
Jeremy Allison
3d7a8a9fa1 Fix missing return - should be void.
Jeremy.
(This used to be commit 45ae90b77e)
2008-01-05 01:16:09 -08:00
Jeremy Allison
9baa97a46e Add general '-e' option to enable smb encryption
on tools.
Jeremy.
(This used to be commit 757653966f)
2008-01-05 00:23:35 -08:00
Jeremy Allison
afc93255d1 Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
(This used to be commit d78045601a)
2007-12-26 17:12:36 -08:00
Jeremy Allison
c8071c3522 Use the %*s feature of snprintf to remove anothe static fstring.
Jeremy.
(This used to be commit 4ae4b23586)
2007-12-17 16:20:44 -08:00
Günther Deschner
68a9bd0bf6 Add split_domain_user() (not to mix with winbind variants).
Guenther
(This used to be commit bd5308e5f6)
2007-12-12 00:58:58 +01:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00
Jeremy Allison
9e8180b983 Remove pstrings completely except for smbctool (what does this do ?).
Don't build this for now.
Jeremy.
(This used to be commit 46b67fd82c)
2007-12-07 12:02:44 -08:00
Jeremy Allison
9e03d6117a *Really* fix the no password -N opt :-).
Jeremy.
(This used to be commit 187d8a94ea)
2007-12-06 19:15:56 -08:00
Jeremy Allison
9fdf2d0586 Get closer to building with smbmount. Move parameter line changes
into lib/util.c
Jeremy.
(This used to be commit 6ac5d81655)
2007-12-06 18:49:39 -08:00
Jeremy Allison
1b92ea5559 Remove pstrings from client/client.c by doing a large rewrite.
Mostly compiles....
Jeremy.
(This used to be commit c87f3eba9a)
2007-12-06 17:16:33 -08:00
Gerald (Jerry) Carter
5d22700782 Compile fix to the automount support. Patch from GlaDiaC.
(This used to be commit 487ab6e75e)
2007-12-05 11:52:35 -06:00
Jeremy Allison
3771ada352 Remove pstring from automount lookups. Remove premature optimization.
Jeremy.
(This used to be commit 6863fe51b5)
2007-12-04 17:48:38 -08:00
Günther Deschner
4a1fbf7bbf Fix build warning.
Guenther
(This used to be commit bf4881d777)
2007-11-30 01:45:06 +01:00
Jeremy Allison
68be9a8200 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Jeremy Allison
6c25260ec1 Remove more static fstring/pstrings. Fix socket option
set on wrong fd (-1).
Jeremy.
(This used to be commit 52fe04df8e)
2007-11-09 15:09:16 -08:00
Volker Lendecke
e63bcdd720 Remove the silly "user_socket_options" global variable
This is better done with a 'lp_do_parameter(-1, "socket options", ..);
(This used to be commit 814bed029e)
2007-11-09 15:11:54 +01:00
Jeremy Allison
3f006ca95a More pstring/fstring removal.
Jeremy.
(This used to be commit 7646f4b284)
2007-11-08 19:00:10 -08:00
Jeremy Allison
5f4693d8f8 Remove more pstring/fstrings.
Jeremy.
(This used to be commit 7a1de5b44e)
2007-11-08 18:50:07 -08:00
Jeremy Allison
7f97c6b96c Remove unneeded variable.
Jeremy.
(This used to be commit c21bc756e3)
2007-11-08 18:01:00 -08:00
Jeremy Allison
214bb0f119 Fix case where we have no dns domain name. Return a talloc of "".
Jeremy.
(This used to be commit ab8934844a)
2007-11-08 17:58:55 -08:00
Jeremy Allison
d40e47db4b Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
(This used to be commit 2a0173743d)
2007-11-08 17:25:45 -08:00
Jeremy Allison
78cdd6e7ec Fix state_path to take a const string, not use pstring.
Jeremy.
(This used to be commit 8c73e19f51)
2007-11-02 09:27:04 -07:00
Gerald (Jerry) Carter
8132a7b98b Patch from Debian Samba package maintainers:
Patch 1 of 3:

- Patch 1 adds the new variables
- Patch 2 makes uses of them for files belonging to the "state" path
  and the "code pages" path
  This patch seemed more easily acceptable, which explains why we
  separated it from patch 3
- Patch 3 reassigns files to the "cache" path. Indeed all "debatable"
  changes have been moved to that one

The point is adding:

- a path for non discardable state data: basically all TDB files
  that may need to be backed up
- a path for shared data: mostly codepage stuff
- a path for cache data to host files such as
  browse.dat, printers.tbd, <printer>.tdb

All these are currently mixed in "libdir" (${prefix}/lib/samba by default).
The patch keeps these new paths to point to ${prefix}/lib/samba by default
and does therefore not change the software behaviour.  Used alone, it just
adds unused variables...so it can safely be used in sources without any
behaviour change and no impact on Samba developers work.
(This used to be commit b7d2fadbef)
2007-11-01 13:00:10 -04:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Jeremy Allison
ce77126e68 Fix access control code to be IPv6/v4 protocol independent.
Make unix_wild_match() talloc, not pstring based.
Next will be name resolution code, and client code.
Jeremy.
(This used to be commit f6a01b82c5)
2007-10-16 11:33:37 -07:00
Jeremy Allison
666f50b01f Move to protocol independent code in most of lib/util_sock.c
We don't use gethostbyname any more except in one case where
we're looking for host aliases (I don't know how to do that
with getaddrinfo yet). New function should be getaddrinfo().
Next step will be fixing lib/access.c, and then changing
libsmb/namequery.c to cope with IPv6 address returns.
Jeremy.
(This used to be commit 4a56b697b6)
2007-10-15 16:11:48 -07:00
Jeremy Allison
8e54530b52 Add start of IPv6 implementation. Currently most of this is avoiding
IPv6 in winbindd, but moves most of the socket functions that were
wrongly in lib/util.c into lib/util_sock.c and provides generic
IPv4/6 independent versions of most things. Still lots of work
to do, but now I can see how I'll fix the access check code.
Nasty part that remains is the name resolution code which is
used to returning arrays of in_addr structs.
Jeremy.
(This used to be commit 3f6bd0e1ec)
2007-10-10 18:25:16 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Jeremy Allison
941544a951 r25505: Add a replacement (IPv4 only) implementation of getaddrinfo/freeaddrinfo
under the 2 clause *BSD license for future use in IPv6 code. Original
code was from PostgreSQL and I've maintained their license even though
I've rewritten large parts of it (I probably should donate this back
to them).
Jeremy.
(This used to be commit 760d993340)
2007-10-10 12:31:10 -05:00
Jeremy Allison
3fbd1ae54c r25472: Fix the interfaces code to detect IPv6 interfaces, using the
new standard getifaddrs() and freeifaddrs() interfaces. Currently
we only return IPv4 af_families. Needs fixing for binds to IPv6
but this has to be careful work.
Jeremy.
(This used to be commit 327875182c)
2007-10-10 12:31:06 -05:00
Günther Deschner
314cb03db1 r25396: Very obvious fix from Martin Zielinski.
Guenther
(This used to be commit 1f0d05807b)
2007-10-10 12:31:02 -05:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Volker Lendecke
ff0947fbed r24949: Remove some static buffers
(This used to be commit df648d47ff)
2007-10-10 12:30:29 -05:00
Volker Lendecke
3bcf187a0d r24903: One more tick in #if 0 code
(This used to be commit e0b4fb55e3)
2007-10-10 12:30:29 -05:00
Jeremy Allison
7b24eb65a0 r24759: Comment out the _nonnull calls for 3.2.x, as agreed with tridge.
Leaving the commented out code for now, in case I need to re-test
some stuff.
Jeremy
(This used to be commit 343be04643)
2007-10-10 12:30:18 -05:00
Volker Lendecke
944fe69d03 r24000: Add message_push_blob() and message_push_string().
The proposed new API convention is to start with a 0 bcc length and then
push things step by step. These routines reallocate the outbuf and
adjust the length and bcc fields as necessary.
(This used to be commit 624f1fe4f6)
2007-10-10 12:28:54 -05:00
Jeremy Allison
6b0e3194e3 r23847: As Dr. Volker says, "A pstring a day....".
Jeremy.
(This used to be commit 8adf81696a)
2007-10-10 12:28:34 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
9f7bb48dd3 r23594: Fix parsing of local pids if cluster support is compiled in but no
cluster is used
(This used to be commit 6beaa87da9)
2007-10-10 12:23:34 -05:00
James Peach
b1ce226af8 r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
(This used to be commit 171dc060e2)
2007-10-10 12:23:23 -05:00
Volker Lendecke
de565785f5 r23410: Merge the core of the cluster code.
I'm 100% certain I've forgotten to merge something, but the main code
should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and
messages_ctdbd.c.

There should be no changes to the non-cluster case, it does survive make
test on my laptop.

It survives some very basic tests with ctdbd enables, I did not do the
full test suite for clusters yet.

Phew...

Volker
(This used to be commit 15553d6327)
2007-10-10 12:23:14 -05:00
Volker Lendecke
ac3f08ddbe r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'm
doing this because for the clustering the marshalling is needed in more
than one place, so I wanted a decent routine to marshall a message_rec
struct which was not there before.

Tridge, this seems about the same speed as it used to be before, the
librpc/ndr overhead in my tests was under the noise.

Volker
(This used to be commit eaefd00563)
2007-10-10 12:22:17 -05:00
Volker Lendecke
e6383f4762 r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch.
This changes "struct process_id" to "struct server_id", keeping both is
just too much hassle. No functional change (I hope ;-))

Volker
(This used to be commit 0ad4b1226c)
2007-10-10 12:21:52 -05:00
Jeremy Allison
4ab6a8ebb7 r22564: Move the _strict -> _zeronull functions into lib/util.c
and out of talloc at tridge's request.
Jeremy.
(This used to be commit da78488b86)
2007-10-10 12:19:45 -05:00
Jeremy Allison
9263287a36 r22555: Ensure our paranoid malloc functions return NULL on
size == 0 so we have a known behavior.
Jeremy.
(This used to be commit 27c0f29708)
2007-10-10 12:19:44 -05:00
Jeremy Allison
0829e1ad1c r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message()
calls). This will allow the server to reflect back
the correct encryption context.
Jeremy.
(This used to be commit 2d80a96120)
2007-10-10 12:19:30 -05:00
Jeremy Allison
dc90cd89a7 r22389: Start preparing for multiple encryption contexts in the
server. Allow server to reflect back to calling client
the encryption context that was sent.
Jeremy.
(This used to be commit b49e90335d)
2007-10-10 12:19:30 -05:00
Jeremy Allison
afd637e926 r22050: Fix a couple of off-by-one errors in the rap
call patch. Jerry, this works now for displaying
shares on Win9x (and hopefully everything else
as well :-).
Jeremy.
(This used to be commit 728a4cc713)
2007-10-10 12:19:06 -05:00
Jeremy Allison
0a2cc569a1 r22045: As Volker noticed, skip_string's last argument is
redundent. Remove it.
Jeremy.
(This used to be commit 140881cfbb)
2007-10-10 12:19:05 -05:00
Jeremy Allison
e5358d6c55 r22042: Try and clean up my own mess using the API Volker
suggested. I now use :

BOOL is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off)
char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off)
char *get_safe_str_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off)
int get_safe_SVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval)
int get_safe_IVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval)

Volker, please criticize and comment. Thanks,

Jeremy.
(This used to be commit d47af7c926)
2007-10-10 12:19:04 -05:00
Volker Lendecke
074c1eb0ea r22019: Jeremy, this hopefully fixes the build farm currently. But I think we need
another get_safe_offset call that also includes the required buffer size.

Volker
(This used to be commit 6138be7e4a)
2007-10-10 12:19:02 -05:00
Jeremy Allison
261c004d7b r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,
but I've no option.
Jeremy.
(This used to be commit c3a565081d)
2007-10-10 12:19:01 -05:00
Jeremy Allison
0eefab112f r22011: As Metze suggested, use 0xFF 'E' <enc ctx> instead
of 0xFF 'S' <enc ctx>.
Jeremy.
(This used to be commit d8cd4fc91b)
2007-10-10 12:19:01 -05:00
Stefan Metzmacher
56ba447668 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
(This used to be commit fa322f0cc9)
2007-10-10 12:18:59 -05:00
Jeremy Allison
4a66d0e232 r21991: I hate Steve French :-). Add support for encryption
contexts....
Jeremy.
(This used to be commit ae8f3649f7)
2007-10-10 12:18:58 -05:00
Günther Deschner
761f60f83a r21854: Add gfree_interfaces() to gfree_all().
Guenther
(This used to be commit eb34ebd9e7)
2007-10-10 12:18:38 -05:00
Jeremy Allison
24cdd7c733 r21800: Check-in the DFS rewrite. I am still testing this but it
works from smbclient and Windows, and I am promising to
support and fix both client and server code moving forward.
Still need to test the RPC admin support but I haven't
changed that code.
Jeremy.
(This used to be commit 7a7862c01d)
2007-10-10 12:18:34 -05:00
Jeremy Allison
540911001d r21768: Fix the client dfs code such that smbclient can
process deep dfs links (ie. links that go to non root
parts of a share). Make the directory handling conanonical
in POSIX and Windows pathname processing.
dfs should not be fully working in client tools. Please
bug me if not.
Jeremy.
(This used to be commit 1c9e10569c)
2007-10-10 12:18:30 -05:00
Jeremy Allison
f76fe23e11 r21725: Fix for memalign used without test guards. Was
breaking the build on *BSD's. Tested by Herb.
Jeremy.
(This used to be commit 4816af5ce9)
2007-10-10 12:18:26 -05:00
Günther Deschner
5c0d13a8ae r21560: Convert name_to_fqdn to BOOL.
Guenther
(This used to be commit 28ce79629b)
2007-10-10 12:18:13 -05:00
Gerald Carter
56c1d7e507 r21525: Go ahead and checkin the mlock() & memalign() fixes so
others don't get stuck with the winbindd hang.
Still waiting on additional confirmation from Guenther
that this fixes thes issues he was observing as well.
But it's been running in my local tree for a day without
problems.
(This used to be commit 0d2b80c6c4)
2007-10-10 12:18:10 -05:00
Gerald Carter
e8783bcd00 r21262: Final part of BUG 4093: fix %a with Windows XP 64bit
(This used to be commit e2681eb4be)
2007-10-10 12:17:52 -05:00
Gerald Carter
7db1c6873c r21250: Partial fix for BUG 4093: Make %a expand to "Vista"
based on the flags2 values in the negprot request.

This also includes some code for testing the dialect
strings for "SMB 2.001" but this is unreliable as Vista
only sends that in the 1st negprot and caches the fact
that we don't support it.  Restartnig the WOrkstation
service on the client clears the cache.
(This used to be commit d781eeb0e4)
2007-10-10 12:17:51 -05:00
Volker Lendecke
113e21f0a5 r21084: Make the Samba4 files compile in Samba3, not activated yet.
Volker
(This used to be commit c24854433a)
2007-10-10 12:17:34 -05:00
Volker Lendecke
98c082489b r20394: This is a *VERY* early start of my work on notify.
Checking in because Jeremy was bugging me. Potentially this becomes quite
intrusive, I'm not sure if I should open a temporary branch for this.

Jeremy, Jerry, do you think 3_0 is the right place for this?

Volker
(This used to be commit bcf5c751cb)
2007-10-10 12:16:46 -05:00
Jeremy Allison
18f9156d96 r20110: Fix interaction between paranoid malloc checker
and lib/replace. Found by Herb - thanks !
Jeremy.
(This used to be commit 67c4d5e73f)
2007-10-10 12:16:25 -05:00
Jeremy Allison
63609fbb04 r20090: Fix a class of bugs found by James Peach. Ensure
we never mix malloc and talloc'ed contexts in the
add_XX_to_array() and add_XX_to_array_unique()
calls. Ensure that these calls always return
False on out of memory, True otherwise and always
check them. Ensure that the relevent parts of
the conn struct and the nt_user_tokens are
TALLOC_DESTROYED not SAFE_FREE'd.
James - this should fix your crash bug in both
branches.
Jeremy.
(This used to be commit 0ffca7559e)
2007-10-10 12:16:24 -05:00
Volker Lendecke
e28ae1f5fd r19080: Fix a potential NULL dereference
(This used to be commit 682b490c23)
2007-10-10 12:15:09 -05:00
Günther Deschner
a62f996c5a r18707: Fix the build when you have libnscd installed (which apparently no host
on the buildfarm has).

Guenther
(This used to be commit b0bb364df0)
2007-10-10 12:00:49 -05:00
Stefan Metzmacher
f21e9f5780 r18705: not all compilers like this
metze
(This used to be commit 2ec4bc0f52)
2007-10-10 12:00:49 -05:00
Günther Deschner
a3e1f7e44d r18703: Fix the annoying effect that happens when nscd is running:
We usually do not get the results from user/group script modifications
immediately. A lot of users do add nscd restart/refresh commands into
their scripts to workaround that while we could flush the nscd caches
directly using libnscd.

Guenther
(This used to be commit 7db6ce295a)
2007-10-10 12:00:49 -05:00
Simo Sorce
d6943ee546 r18534: Fix grammar
(This used to be commit 6c9b80bde3)
2007-10-10 11:51:48 -05:00
Simo Sorce
019c89a67e r18530: typos
(This used to be commit 8c5c4959ed)
2007-10-10 11:51:48 -05:00
Simo Sorce
f560ee201d r18529: warn the user that putting the machine host name on the
127.0.0.1 line in /etc/hosts is not ok for Kerberos.
(This used to be commit 85126391e1)
2007-10-10 11:51:47 -05:00
Volker Lendecke
2ad8731341 r18066: It's a bit pointless to send ourselves a signal just to check if we exist :-)
Volker
(This used to be commit 44105ff2ff)
2007-10-10 11:43:25 -05:00
Stefan Metzmacher
9c8a9d0ac4 r17922: sync samba3's talloc with samba4's and move the samba3 specific stuff to tallocmsg.c
metze
(This used to be commit 7704e3e51d)
2007-10-10 11:38:59 -05:00
Jeremy Allison
a64925ddff r17800: Start using struct timespec internally for file times
on the wire. This allows us to go to nsec resolution
for systems that support it. It should also now be
easy to add a correct "create time" (birth time)
for systems that support it (*BSD). I'll be watching
the build farm closely after this one for breakage :-).
Jeremy.
(This used to be commit 425280a1d2)
2007-10-10 11:38:48 -05:00
Volker Lendecke
0be131725f r17569: Make 'max smbd processes' more robust. Counting on the child to decrement a
tdb entry is not the most reliable way to count children correctly.

This increments the number of children after a fork and decrements it upon
SIGCLD. I'm keeping a list of children just for consistency checks, so that we
at least get a debug level 0 message if something goes wrong.

Volker
(This used to be commit eb45de167d)
2007-10-10 11:38:39 -05:00
Volker Lendecke
7ad912c264 r17231: Some patch cosmetics
(This used to be commit 736e55101b)
2007-10-10 11:38:21 -05:00
Jeremy Allison
5f0e9cc4e6 r17025: Remove one blank line - test checking in to two
branches simultaneously.....
Jeremy.
(This used to be commit 13e7fe540a)
2007-10-10 11:19:21 -05:00
Gerald Carter
9846cf3daf r16997: Simo's patch (based on repotr from Seth Elssworth of Quest) to try to be more robust in the precense of more broken /etc/hosts files when determining our fwdn
(This used to be commit 6413df8348)
2007-10-10 11:19:17 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
6d5a7494df r16386: Klockwork #lots. Ensure talloc_get_type_abort aborts
if handed a NULL pointer, not returns NULL.
Jeremy.
(This used to be commit d47ec4dc25)
2007-10-10 11:18:51 -05:00
James Peach
a51ce2bfbe r15509: Preserve errno in fcntl lock wrappers.
(This used to be commit 624318245f)
2007-10-10 11:16:55 -05:00
James Peach
826614ed16 r15508: Use clock_gettime for profiling timstamps if it is available. Use
the fastest clock available on uniprocessors.
(This used to be commit d448629282)
2007-10-10 11:16:55 -05:00
James Peach
5910e397d3 r15446: Tidy up the formatting of locking debug messages and make it more
consistent. Bring oplocks withing the purview of the locking debug
channel.
(This used to be commit e817cfd7d3)
2007-10-10 11:16:45 -05:00
James Peach
7a5ff0885d r15047: Add support for using libunwind to generate a backtrace. This is
primarily intended for ia64 systems where libunwind knows more about
the different ways of walking the stack that just about anything else.
(This used to be commit 256a19d722)
2007-10-10 11:16:00 -05:00
Jeremy Allison
fc13f28417 r15030: On a performace hunt... Remove as many extraneous
memset's as possible.
Jeremy.
(This used to be commit 1217ed392b)
2007-10-10 11:15:58 -05:00
Jeremy Allison
22dbd67708 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
(This used to be commit 08e52ead03)
2007-10-10 11:15:57 -05:00
Gerald Carter
bbf666e447 r15003: patch based on code from Arkady Glabek <aglabek@centeris.com> to ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms)
(This used to be commit 1e0b79e591)
2007-10-10 11:15:55 -05:00
James Peach
4fa5559800 r14898: This change is an attempt to improve the quality of the information that
is produced when a process exits abnormally.

First, we coalesce the core dumping code so that we greatly improve our
odds of being able to produce a core file, even in the case of a memory
fault. I've removed duplicates of dump_core() and split it in two to
reduce the amount of work needed to actually do the dump.

Second, we refactor the exit_server code path to always log an explanation
and a stack trace. My goal is to always produce enough log information
for us to be able to explain any server exit, though there is a risk
that this could produce too much log information on a flaky network.

Finally, smbcontrol has gained a smbd fault injection operation to test
the changes above. This is only enabled for developer builds.
(This used to be commit 56bc02d644)
2007-10-10 11:15:53 -05:00
Jeremy Allison
80afbe5cf5 r14751: Use the noreturn attribute to try and tell coverity that
smb_panic can't return.
Jeremy.
(This used to be commit ba9c98983e)
2007-10-10 11:15:45 -05:00
Jeremy Allison
1d3fd5201c r14746: Add the Samba4 replacements for opendir/readdir etc. to
Samba3 - with some 64-bit macro madness. Attempt to fix
the broken directory handling in the *BSD-of-the-month
club.
Jeremy.
(This used to be commit fd98427f64)
2007-10-10 11:15:45 -05:00
Jeremy Allison
7f57dc61cb r14703: Clarify the return codes for the POSIX locking case. This
was confusing.
Jeremy.
(This used to be commit bc1a605a39)
2007-10-10 11:15:44 -05:00
Stefan Metzmacher
250c02554e r14618: add --no-process-group to all server programms
to make the following possible:

timelimit 20000 bin/nmbd -F -S --no-process-group
timelimit 20000 bin/smbd -F -S --no-process-group

this is needed to 'make test' working without losing child processes

metze
(This used to be commit c3a9f30e2a)
2007-10-10 11:15:39 -05:00
Jeremy Allison
71272fc441 r13975: Re-fix Coverity #156 - I had left the hidden arg. inconsistent
between Realloc and realloc_array.
Jeremy.
(This used to be commit 841c9b1847)
2007-10-10 11:11:02 -05:00
Jeremy Allison
894358a8f3 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
(This used to be commit 1d710d06a2)
2007-10-10 11:10:59 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Jeremy Allison
10b5609a14 r12279: unix_mask_match has been broken for *ever*... (How).
Ensure it returns a BOOL.
Jerry (and anyone else) please check this, I think
all uses are now correct but could do with another
set of eyes. Essential for 3.0.21 release.
Jeremy.
(This used to be commit 0c7b8a7637)
2007-10-10 11:05:51 -05:00
Jeremy Allison
9d4760d119 r11446: Remove unused fn. Remove unneeded strncpy use.
Jeremy.
(This used to be commit d202aae3c8)
2007-10-10 11:05:16 -05:00
Jeremy Allison
bb9e7dd104 r11159: Added some const to fix warnings.
Jeremy.
(This used to be commit de27b0eef2)
2007-10-10 11:05:04 -05:00
Jeremy Allison
8d7c886671 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
(This used to be commit d720867a78)
2007-10-10 11:05:02 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Jeremy Allison
b07bc6b661 r9536: Fix one more DIR -> SMB_STRUCT_DIR typo.
Jeremy.
(This used to be commit c5b79a6709)
2007-10-10 11:01:12 -05:00
Jeremy Allison
5cb0c45cba r9325: Remember to ignore FILE_SHARE_DELETE when mapping to old share
modes for display.
Jeremy.
(This used to be commit f00d41a9dc)
2007-10-10 11:00:33 -05:00
Jeremy Allison
af8a691db1 r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work
into the tree). I'll test this over the weekend....
Jerry - in looking at the difference between the two trees there
seem to be some printing/ntprinting.c and registry changes we might
want to examine to try keep in sync.
Jeremy.
(This used to be commit c7fe18761e)
2007-10-10 10:58:18 -05:00
Jeremy Allison
19ca97a70f r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Jeremy Allison
7e509e9b99 r7842: With the patch I sent Steve yesterday this gives us complete POSIX pathnames.
ie. files containing : and \ can be accessed from Linux.
Jeremy.
(This used to be commit e9b8d23d61)
2007-10-10 10:57:59 -05:00
Gerald Carter
fed660877c r7415: * big change -- volker's new async winbindd from trunk
(This used to be commit a0ac9a8ffd)
2007-10-10 10:57:08 -05:00
Gerald Carter
f0c650a382 r6942: * merging the registry changes back to the 3.0 tree
* removing the testprns tool
(This used to be commit 81ffb0dbbb)
2007-10-10 10:56:57 -05:00
Jeremy Allison
fe0ce8dd8e r6890: Refactor printing interface to take offset into job. Fixes bug
where large print jobs can have out-of-order offsets. Bug found
by Arcady Chernyak <Arcady.Chernyak@efi.com>
Jeremy.
(This used to be commit 482f7e0e37)
2007-10-10 10:56:56 -05:00
Jeremy Allison
0483dd60de r6550: Move function make_dir_struct from util to dir.c
Jeremy.
(This used to be commit 5b86e3dcdf)
2007-10-10 10:56:45 -05:00
Herb Lewis
ed1f7121a3 r6502: add LOCKING debug class - pull PRINTINGDB class definition from trunk
so our numbers don't get out of sync
(This used to be commit 58e307664e)
2007-10-10 10:56:43 -05:00
Jeremy Allison
7981bd7f04 r6495: Bugfix for #2596 by James Peach @ SGI. Fix become_root link issues and one IRIX
stack backtrace bug.
Jeremy.
(This used to be commit c0b99c692b)
2007-10-10 10:56:43 -05:00
Volker Lendecke
2e0cac8e3e r6445: Make us survive the PARANOID_MALLOC_CHECKER. Should we enable that for
--enable-developer=yes?

Volker
(This used to be commit 61d40ac60d)
2007-10-10 10:56:41 -05:00
Volker Lendecke
d3d6126d94 r6351: This is quite a large and intrusive patch, but there are not many pieces that
can be taken out of it, so I decided to commit this in one lump. It changes
the passdb enumerating functions to use ldap paged results where possible. In
particular the samr calls querydispinfo, enumdomusers and friends have
undergone significant internal changes. I have tested this extensively with
rpcclient and a bit with usrmgr.exe. More tests and the merge to trunk will
follow later.

The code is based on a first implementation by Günther Deschner, but has
evolved quite a bit since then.

Volker
(This used to be commit f0bb44ac58)
2007-10-10 10:56:38 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
fa787af520 r6106: Fix bug #2551. It turns out that the incoming flags2 flag FLAGS2_LONG_PATH_COMPONENTS
determines if a reply is uppercased on a SMBsearch request, not the protocol level.
This could clear up quite a few hacks going forward I think.
Jeremy.
(This used to be commit 8c64cd368f)
2007-10-10 10:56:22 -05:00
Volker Lendecke
e84ead0cfd r6080: Port some of the non-critical changes from HEAD to 3_0. The main one is the
change in pdb_enum_alias_memberships to match samr.idl a bit closer.

Volker
(This used to be commit 3a67865169)
2007-10-10 10:56:20 -05:00
Jeremy Allison
fcfa75b2fc r6049: Ensure "dos filetime" checks file ACLs correctly. May fix Excel "read-only"
issue.
Jeremy.
(This used to be commit 80e788143a)
2007-10-10 10:56:18 -05:00
Jeremy Allison
445a9729f0 r6044: Ensure the old search calls always ask mask_match to translate
patterns like ????????.??? - even if using an NT1 protocol.
Matches W2K3 behavior.
Jeremy.
(This used to be commit 67f6473f50)
2007-10-10 10:56:18 -05:00
Jeremy Allison
143bf1202c r6022: Fix for bug #2533. Incorrect dir listings from OS/2 clients.
Jeremy.
(This used to be commit cf8949f684)
2007-10-10 10:56:16 -05:00
Gerald Carter
5d1cb8e79e r6014: rather large change set....
pulling back all recent rpc changes from trunk into
3.0.  I've tested a compile and so don't think I've missed
any files.  But if so, just mail me and I'll clean backup
in a couple of hours.

Changes include \winreg, \eventlog, \svcctl, and
general parse_misc.c updates.

I am planning on bracketing the event code with an
#ifdef ENABLE_EVENTLOG until I finish merging Marcin's
changes (very soon).
(This used to be commit 4e0ac63c36)
2007-10-10 10:56:15 -05:00
Jeremy Allison
91bf6cb6bf r5100: We should only care about case-sensitivity when *reading* an incoming
filename, not returning one. Makes us pass one more Samba4 RAW-SEARCH test.
Jeremy.
(This used to be commit 228d1e1649)
2007-10-10 10:55:15 -05:00
Jeremy Allison
8ac31b5034 r5066: A couple of small fixes from James Peach @ SGI.
Jeremy.
(This used to be commit 9d131e9419)
2007-10-10 10:55:13 -05:00
Jeremy Allison
c057e4591b r4581: From Derrell.Lipman@UnwiredUniverse.com. Use nanosleep instead of select
when we have it in smb_msleep.
Jeremy.
(This used to be commit 465c207ffb)
2007-10-10 10:53:48 -05:00
Jeremy Allison
e53d780628 r4120: Never, ever, doubt valgrind :-). Fix order of evaluation bug that's been in the
bitmap code for ever. Remove silly extra space in paranoid malloc.
Jeremy.
(This used to be commit 0a7d17bc9b)
2007-10-10 10:53:34 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
482f14871d r3946: Fix for bugid #2085 reported by Jason Mader <jason@ncac.gwu.edu>. Use consistent
enum type for Protocol extern.
Jeremy.
(This used to be commit 65dfae7ea4)
2007-10-10 10:53:26 -05:00
Günther Deschner
92e05b34ae r3650: Allow to call spoolss-server as "localhost".
Guenther
(This used to be commit 14a0292250)
2007-10-10 10:53:11 -05:00
Andrew Bartlett
4792a8de30 r2868: Well, I'm not quite sure what I'm doing back in Samba 3.0, but anyway...
I've been grumbling about under-efficient calls in SAMR, and finally
got around to fixing some of them.

We now call sys_getgroups() (which in turn calls initgroups(), until
glibc 3.4 is released) to figure out a user's group membership.  This
is far, far more efficient than scanning all the groups looking for a
match, and is still the 'posix way', just using an effiecient call.

The seperate issue of 'who is in this group' remains, but this one has
been biting some people.

I need to talk to VL about how best to exersise nasty corner cases,
but my initial tests hold strong.  (The code is also much simpiler
than before, which has to count for something :-)

Andrew Bartlett
(This used to be commit dc19f16169)
2007-10-10 10:52:55 -05:00
Andrew Tridgell
d9b8eaabc5 r2824: restored the is_case_sensitive option to ms_fnmatch() in Samba3. It is
very rarely used, but we sohuldn't be removing a feature in a minor
release of this kind.
(This used to be commit 4ce0505bc3)
2007-10-10 10:52:54 -05:00
Rafal Szczesniak
8199abf7d8 r2813: Fix the build.
At least temporarily, since I've got the impression that _real_ fix
is more complex...

rafal
(This used to be commit 982912f0c8)
2007-10-10 10:52:53 -05:00
Gerald Carter
31441aaa13 r2768: BUG 1519: save the hostname used in the open_printer_ex() for later reuse when filling in the spolss replies (also gets rid of get_called_name()
(This used to be commit 57db8ca91f)
2007-10-10 10:52:52 -05:00
Gerald Carter
278f9467f2 r2133: Several fixes:
* BUG 1627: fix for NIS compiles on HPUX 11.00, AIX 4.3 and 5.1
  patch from Olaf Flebbe <o.flebbe@science-computing.de>.
  Will need to watch this one in the build farm.

* Fix bug found by rwf@loonybin.net where the PRINT_ATTRIBUTE_PUBLISHED
  was getting reset by attempts to sanitize the defined attributes
  (PRINTER_ATTRIBUTE_SAMBA)

* Resolve name conflict on DEC OSF-5.1 (inspired by patch from
  Adharsh Praveen <rprav@india.hp.com>)

* Work around parsing error in the print change notify code
  (not that the alignment bug is still there but reording the
   entries in the array works around it).

* remove duplicate declaration of getprintprocdir from rpcclient.
(This used to be commit 7474c6a446)
2007-10-10 10:52:32 -05:00
Paul Green
3ced3cd8ae r1890: Cut down on debug messages from is_in_path. paulg
(This used to be commit 8b1c2126af)
2007-10-10 10:52:23 -05:00
Jeremy Allison
e948458a79 r1215: Intermediate checkin of the new keytab code. I need to make sure I
haven't broken krb5 ticket verification in the mainline code path,
also need to check with valgrind. Everything now compiles (MIT, need
to also check Heimdal) and the "net keytab" utility code will follow.
Jeremy.
(This used to be commit f0f2e28958)
2007-10-10 10:52:00 -05:00
Jeremy Allison
4dddfb74ae r1156: Ensure new remote arch of CIFSFS is seen.
Jeremy.
(This used to be commit 33fa4b8b27)
2007-10-10 10:51:57 -05:00
Gerald Carter
348b01ff77 r647: fix for setting the called name to by our IP if the called name was *SMBSERVER and *SMBSERV -- fixes issue with connecting to printers via \ip.ad.dr.ess\printer UNC path
(This used to be commit 8ee268f0ed)
2007-10-10 10:51:32 -05:00
Jeremy Allison
372dac6c98 r645: Patch from kawasa_r@itg.hitachi.co.jp to correctly enable core dumps.
Jeremy.
(This used to be commit ea41d69427)
2007-10-10 10:51:32 -05:00
Jeremy Allison
e0da56a848 r570: Remove lots of globals to handle case issues - move them
to connection struct entries (as they should have been from
the start). Jerry, once you've cut over to 3.0.4 release
branch I'll add this to 3.0 also.
- Jerry cut over :-).
Jeremy.
(This used to be commit 578a508509)
2007-10-10 10:51:30 -05:00
Andrew Bartlett
f58e6a9977 Given how often a panic has to do with malloc() problems, don't tempt
things more by calling SAFE_FREE() just before we exit our panic handler.

Andrew Bartlett
(This used to be commit d0b820562b)
2004-03-21 08:43:41 +00:00
Jeremy Allison
7942c2826b Merge from HEAD for Amanda group.
Apply Craig Barratt's fixes to allow multiple exlusion files and patterns.
Jeremy.
(This used to be commit 0272fac8ca)
2004-03-18 23:45:15 +00:00
Jeremy Allison
c9b7cbbfa5 Added strstr_m() function. Use in all places where we might run into mb
(should fix the mb service name problem, can't remember the bugid).
Jeremy.
(This used to be commit 94a272b9a8)
2004-03-09 00:17:14 +00:00
Jim McDonough
24df38dbc6 Janitor for tpot...bugzilla #1098, msleep already exists on aix
(This used to be commit 4319df7fdc)
2004-02-23 02:54:03 +00:00
Gerald Carter
df6d2db4ce merge from old APP_HEAD
* remove corrupt tdb and shutdown (only for printing tdbs, connections,
  sessionid & locking)
* decrement smbd counter in connections.tdb in smb_panic()
* various Makefile hack to get things to link

'max smbd processes' looks like it might be broken.  The counter KEY is not
being set.  Will look into that tomorrow.
(This used to be commit 6e22c5da92)
2004-02-12 05:24:02 +00:00
Jeremy Allison
90b5adc557 Added James Peach's fix for #1038.
Jeremy.
(This used to be commit 5379ad9824)
2004-02-11 19:07:02 +00:00
Jeremy Allison
2f2e5b0191 Fix up name canonicalization (needed for krb5 keytab support later).
Remove source_env handler (no longer used in any codepath).
Jeremy.
(This used to be commit 3a3e336030)
2004-01-30 18:38:48 +00:00
Gerald Carter
4b1e15a4f2 fix %a variable for Windows 2003 -> Win2K3
(This used to be commit 2f43a1c166)
2003-12-05 21:51:51 +00:00
Jeremy Allison
013a051103 Remove unneeded second open for filename ending in '.' now we know it's
a mangled name. Added const. Fix inspired by Andrew Bartlett ideas.
Jeremy.
(This used to be commit 87eb336d65)
2003-11-18 02:06:41 +00:00
Tim Potter
764e2f7d20 Undo accidentally committed stuff.
(This used to be commit 0a79519bc4)
2003-11-06 21:55:48 +00:00
Tim Potter
0cd8bc6be4 Ignore tallocdump binary.
(This used to be commit addeb1c6c9)
2003-11-06 21:51:08 +00:00
Tim Potter
fbb8f131c2 Fix more 64-bit printf warnings.
(This used to be commit 23443e3aa0)
2003-11-03 14:34:25 +00:00
Jeremy Allison
94f59f5492 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
(This used to be commit f35e9a8b90)
2003-09-05 19:59:55 +00:00
Herb Lewis
937041e3fd get rid of compiler warnings
(This used to be commit ae25e7746e)
2003-08-15 02:28:13 +00:00
Jeremy Allison
aed1610ec2 Fix for bugid #205 - work by Andrew Bartlet (modified to use
fixed buffer by me).
Jeremy.
(This used to be commit 6f68b8de47)
2003-08-12 04:25:26 +00:00
Jim McDonough
9f2e6167d2 Update my copyrights according to my agreement with IBM
(This used to be commit c9b209be2b)
2003-08-01 15:21:20 +00:00
Jim McDonough
f210ee9b99 Fix copyright statements for various pieces of Anthony Liguori's work.
(This used to be commit 15d2bc4785)
2003-08-01 14:47:39 +00:00
Gerald Carter
3a5dc7c2ec convert snprintf() calls using pstrings & fstrings
to pstr_sprintf() and fstr_sprintf() to try to standardize.
lots of snprintf() calls were using len-1; some were using
len.  At least this helps to be consistent.
(This used to be commit 9f835b85dd)
2003-07-23 12:33:59 +00:00
Andrew Bartlett
456f51bcbe Jeremy requested that I get my NTLMSSP patch into CVS. He didn't request
the schannel code, but I've included that anyway. :-)

This patch revives the client-side NTLMSSP support for RPC named pipes
in Samba, and cleans up the client and server schannel code.  The use of the
new code is enabled by the 'sign', 'seal' and 'schannel' commands in
rpcclient.

The aim was to prove that our separate NTLMSSP client library actually
implements NTLMSSP signing and sealing as per Microsoft's NTLMv1 implementation,
in the hope that knowing this will assist us in correctly implementing
NTLMSSP signing for SMB packets.  (Still not yet functional)

This patch replaces the NTLMSSP implementation in rpc_client/cli_pipe.c with
calls to libsmb/ntlmssp.c.  In the process, we have gained the ability to
use the more secure NT password, and the ability to sign-only, instead of
having to seal the pipe connection.  (Previously we were limited to sealing,
and could only use the LM-password derived key).

Our new client-side NTLMSSP code also needed alteration to cope with our
comparatively simple server-side implementation.  A future step is to replace
it with calls to the same NTLMSSP library.

Also included in this patch is the schannel 'sign only' patch I submitted to
the team earlier.  While not enabled (and not functional, at this stage) the
work in this patch makes the code paths *much* easier to follow.  I have also
included similar hooks in rpccleint to allow the use of schannel on *any* pipe.

rpcclient now defaults to not using schannel (or any other extra per-pipe
authenticiation) for any connection.  The 'schannel' command enables schannel
for all pipes until disabled.

This code is also much more secure than the previous code, as changes to our
cli_pipe routines ensure that the authentication footer cannot be removed
by an attacker, and more error states are correctly handled.

(The same needs to be done to our server)

Andrew Bartlett
(This used to be commit 5472ddc9ea)
2003-07-14 08:46:32 +00:00
Volker Lendecke
0b07d432cc Add const
(This used to be commit 2f7658d9ba)
2003-07-10 14:12:37 +00:00
Jeremy Allison
ce72beb2b5 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
(This used to be commit ff222716a0)
2003-07-03 19:11:31 +00:00
Gerald Carter
f51d769dd3 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
(This used to be commit d7f7fcda42)
2003-06-25 17:41:05 +00:00
Volker Lendecke
ea1cec68bb Const fixes by metze
Volker
(This used to be commit c0e35f3be8)
2003-06-17 09:40:35 +00:00
Tim Potter
797add4a73 Fixed unused variable warning.
(This used to be commit cdbe47a5d5)
2003-05-27 07:26:04 +00:00
Alexander Bokovoy
e8573c8fa9 Add NT quota support. Patch from Stefan (metze) Metzemacher
1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab
2. Disabled by default and when requested, will be probed and enabled only on Linux where it works
3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far
Documentation to follow
(This used to be commit 4bf022ce9e)
2003-05-12 01:20:17 +00:00
Andrew Bartlett
8de48f3093 Make our 'get DNS domain name' code try a bit harder - if gethostname() doesn't
include a domain portion, do a gethostbyname() lookup on that name.

Use this name in our PolicyPrimaryDomainInformation reply (_lsa_query_info2)
that Win2k uses when trying to trust us as a trusted domain.

(We need to do a better mapping between our Netbios and Win2k domain names,
but this will do for now - particularly annoying is the way this possibly needs
to map with our kerberos realm).

Andrew Bartlett
(This used to be commit 3be0327103)
2003-04-22 07:28:41 +00:00
Andrew Bartlett
c75af6b980 Merge whitespace and const from HEAD
(This used to be commit 88fdc36f93)
2003-04-21 13:05:51 +00:00
Jelmer Vernooij
b5fd86aee1 Only declare backtrace variables when using them
(This used to be commit 429b373453)
2003-04-16 14:51:02 +00:00
Jelmer Vernooij
10bf059b62 Backport my backtrace patch from HEAD
(This used to be commit 66fcf6b493)
2003-04-14 21:49:49 +00:00
Tim Potter
44fa3b90e0 Merge removal of some unused functions. Commit mistakenly included with
new rpc echo pipe.
(This used to be commit b7af3cda28)
2003-04-14 00:12:28 +00:00
Andrew Bartlett
1f499a79f5 (merge from HEAD)
Small clenaup patches:
 - safe_string.h - don't assume that __FUNCTION__ is available
 - process.c - use new workaround from safe_string.h for the same
 - util.c - Show how many bytes we smb_panic()ed trying to smb_xmalloc()
 - gencache.c - Keep valgrind quiet by always null terminating.
 - clistr.c - Add copyright
 - srvstr.h - move srvstr_push into a .c file again, as a real function.
 - srvstr.c - revive, with 'safe' checked srvstr_push
 - loadparm.c - set a default for the display charset.

 - connection.c - use safe_strcpy()
Andrew Bartlett
(This used to be commit c91e76bddb)
2003-03-22 13:47:42 +00:00
Jeremy Allison
d332200c25 Merge in the developer string options from HEAD. We need to ensure 3.0
is as stable as possible in the string department and some pain now
will help later :-).
Jeremy.
(This used to be commit 86e3eddac6)
2003-03-18 01:48:11 +00:00
Andrew Bartlett
ad0d6509a7 Merge from HEAD:
- Make ReadDirName return a const char*.

 - Consequential changes from that

 - mark our fstring/pstring assumptions in function prototypes

Andrew Bartlett
(This used to be commit 10b53d7c6f)
2003-03-17 22:56:13 +00:00
Gerald Carter
128e7edaaf fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before dereferencing
(This used to be commit 7bc5fc729f)
2003-03-14 23:06:06 +00:00
Gerald Carter
fd56ede2b6 adding some initiaial code to sert %a to Win2K3 (using Native LanMan string from .NET RC2)
(This used to be commit e074cab810)
2003-03-12 15:41:39 +00:00
Gerald Carter
0d30cdf66c additional fix for CR 601
* distinguish WinXP from Win2k
  * add a 1/3 of a second delay in OpenPrinter
    in order to trigger a LAN/WAN optimization in
    2k clients.
(This used to be commit c7712fa054)
2003-02-27 21:22:36 +00:00
Andrew Bartlett
266ec4aac0 Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.
Andrew Bartlett
(This used to be commit 9ef0d40c3f)
2003-02-24 03:09:08 +00:00
Jim McDonough
49d3f7bc81 merge from HEAD - enable dynamic RPC modules
(This used to be commit d9c485b010)
2003-02-14 00:48:28 +00:00
Jeremy Allison
ac49b63c1c Memory leak fix from Leo Qiu <leoxqiu@yahoo.com>.
Jeremy.
(This used to be commit efd52f6ca7)
2003-01-24 19:19:25 +00:00
Gerald Carter
f5d5df9644 patch to include support for daemontools from Michael Handler
(This used to be commit a8db1b611d)
2003-01-03 17:39:30 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Andrew Bartlett
43059acb95 Merge from HEAD - add PRINTF_ATTRIBUTE to a few more functions.
(This used to be commit 9e5297131c)
2003-01-03 03:24:23 +00:00
Jeremy Allison
39c78bf516 Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.
Jeremy.
(This used to be commit ec4ed45563)
2002-12-11 23:54:40 +00:00
Jeremy Allison
ccdfed5587 Ensure global_scope() returns "", not the NULL string. Froma tpot fix.
Jeremy.
(This used to be commit 0ff254264e)
2002-12-06 19:59:04 +00:00
Jim McDonough
4225a857c9 fns for retrieving dns host name and domain name (get rid of lp_realm hacks).
(This used to be commit eda83b6d13)
2002-12-03 19:36:53 +00:00
Jeremy Allison
2f194322d4 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8)
2002-11-12 23:20:50 +00:00