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

84 Commits

Author SHA1 Message Date
Jeremy Allison
934b92f5d0 r25238: Make the error returns from the string functions
always consistent. Return -1 on error, and ensure
we check for this. In cases where the dest is already
specified and we've been asked to terminate with a
null, ensure we always do so even on error.
Jeremy.
(This used to be commit abedd96786)
2007-10-10 12:30:53 -05:00
Jeremy Allison
3aaca8028e r25170: Remove pstring limits from ms_fnmatch and module load.
Jeremy.
(This used to be commit 764574ee05)
2007-10-10 12:30:48 -05:00
Jeremy Allison
eacd314057 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
(This used to be commit 39c211a702)
2007-10-10 12:30:44 -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
Andrew Tridgell
df2465298b r23783: Processing the UAS change message was causing problems on ppc64 Linux
systems. Rather than trying to fix this, it's much better just to
remove the code, as it serves no purpose at all (the message that is
generated is ignored by smbd).

This sort of parsing should really be done by PIDL generated code.
(This used to be commit 22e8404cef)
2007-10-10 12:28:21 -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
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
8c3f8e5697 r22911: Pass a messaging_context to message_send_all
(This used to be commit cc92ce665d)
2007-10-10 12:22:07 -05:00
Volker Lendecke
4aa44f7475 r22761: This introduces lib/conn_tdb.c with two main functions: connections_traverse
and connections_forall. This centralizes all the routines that did individual
tdb_open("connections.tdb") and direct tdb_traverse.

Volker
(This used to be commit e43e94cda1)
2007-10-10 12:21:55 -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
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
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
Jim McDonough
b449884661 r18660: Fix build, one uuid->GUID was missed.
(This used to be commit f8ea2069d4)
2007-10-10 11:52:20 -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
Gerald Carter
1ee9f9ad81 r2261: fix getdc mailslot checks; testing with Windows 98se, WinME, WinNT 4.0/200x/XP
(This used to be commit 8ad147508a)
2007-10-10 10:52:38 -05:00
Jeremy Allison
571cc4811b r2224: Make nmbd more robust against bad netbios packets.
Jeremy.
(This used to be commit dd9b17abd6)
2007-10-10 10:52:36 -05:00
Gerald Carter
8ad3d8c9b0 r196: merging struct uuid from trunk
(This used to be commit 911a28361b)
2007-10-10 10:51:13 -05:00
Jeremy Allison
ce0c99312c Use "unix netbios name" type unstring - 64 bytes long to manipulate netbios
names in nmbd. Allows conversion from dos codepage mb strings (ie. SJIS) to
expand to utf8 size on read.
Jeremy.
(This used to be commit 834d816caf)
2004-03-15 21:45:45 +00:00
Jeremy Allison
6b9dbbcd24 Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com (MORIYAMA Masayuki).
Don't use nstrings to hold workgroup and netbios names. The problem with them is that MB netbios
and workgroup names in unix charset (particularly utf8) may be up to 3x bigger than the name
when represented in dos charset (ie. cp932). So go back to using fstrings for these but
translate into nstrings (ie. 16 byte length values) for transport on the wire.
Jeremy.
(This used to be commit b4ea493599)
2004-03-13 02:16:21 +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
Andrew Bartlett
eade7ab769 A Samba DC is nothing special these days - so every domain controller
location packet from the client is not a DEBUG(1) event anymore...

(Yes, we printed this for each of these UDP packets...)

Andrew Bartlett
(This used to be commit 4ca0ab7506)
2004-01-24 10:46:55 +00:00
Tim Potter
9f154119e8 Final round of printf warnings fixes for the moment.
(This used to be commit 0519a7022b)
2003-11-06 22:11:08 +00:00
Jeremy Allison
231124ced9 Fixes to check for wraps which could cause coredumps.
Jeremy.
(This used to be commit ad06edd1bb)
2003-10-29 21:28:00 +00:00
Jeremy Allison
9fdc1363be Fix the character set handling properly in nmbd. Also fix bug where
iconv wasn't re-initialised on reading of "charset" parameters. This
caused workgroup name to be set incorrectly if it contained an
extended character.
Jeremy.
(This used to be commit 84ae44678a)
2003-08-27 01:25:01 +00:00
Jim McDonough
8c64504f7c Update my copyrights according to my agreement with IBM
(This used to be commit a2bd8f0bfa)
2003-08-01 15:30:44 +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
Jim McDonough
40c53cae2b Fix bug #98: DNS compression is required for proper building of the
netlogon for ads packet.  repeated DNS components will not be properly
encoded otherwise.
(This used to be commit 1e85a9ed8d)
2003-05-20 13:49:53 +00:00
Andrew Bartlett
1cba0a7579 Merge from HEAD:
- NTLMSSP over SPENGO (sesssion-setup-and-x) cleanup and code refactor.
  - also consequential changes to the NTLMSSP and SPNEGO parsing functions
  - and the client code that uses the same functions
 - Add ntlm_auth, a NTLMSSP authentication interface for use by applications
   like Squid and Apache.
  - also consquential changes to use common code for base64 encode/decode.
 - Winbind changes to support ntlm_auth (I don't want this program to need
   to read smb.conf, instead getting all it's details over the pipe).
 - nmbd changes for fstrcat() instead of fstrcpy().

Andrew Bartlett
(This used to be commit fbb46da79c)
2003-01-28 12:07:02 +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
Jim McDonough
9ce440e25d Stop using hacks for dns host/domain names.
(This used to be commit e707e2cc7c)
2002-12-03 19:38:27 +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
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
b2edf254ed sync 3.0 branch with head
(This used to be commit 3928578b52)
2002-08-17 17:00:51 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Martin Pool
bf65820af2 Add an output parameter to message_send_all that says how many
messages were sent, so you know how many replies to expect.

Const and doc religion.
(This used to be commit 22e510ea0d)
2001-12-21 00:37:49 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Volker Lendecke
f7fb26f675 How often did I read the CVS commit message
"Always compile before commit" :-((

Volker
(This used to be commit 69a3277fc5)
2001-09-27 16:28:50 +00:00
Volker Lendecke
29d3318437 From 2.2.
Volker
(This used to be commit 50ea73426f)
2001-09-26 16:47:02 +00:00
Simo Sorce
1f312492ec move to SAFE_FREE()
(This used to be commit 1446a1562b)
2001-09-17 04:35:51 +00:00
Andrew Tridgell
9a9ac2739b got rid of USE_TDB_MMAP_FLAG as its not needed any more
(This used to be commit c26e0d3f27)
2001-09-06 22:08:19 +00:00
Tim Potter
259d59084d Send a MSG_SMB_SAM_REPL when a UAS/SAM change netlogon message is
received.
(This used to be commit b7cf14bf84)
2001-08-28 06:08:31 +00:00
Tim Potter
c1f0d99013 Process the SAM/UAS change notification message.
(This used to be commit efcbcfaa48)
2001-08-24 19:28:08 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
4ab6182a0f AS/U on a sparc now joins and authenticates against a Samba PDC !
Jeremy.
(This used to be commit 28a0bc5f57)
2001-03-15 00:49:13 +00:00
Jeremy Allison
a7a4f4f67c Fixed wild pointer diff found by insure.
Jeremy.
(This used to be commit 158d9cada8)
2000-05-02 23:56:24 +00:00
Jeremy Allison
6259f51dd9 This is a *big* checkin that may break some things, but implements the
new open mechanism Andrew & I discussed.

config.sub:
configure: Included the QNX patch.

include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added ftruncate vfs call (needed).

Note that we will also need locking calls in the vfs (to be added).

lib/util_unistr.c:
nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump.
                          Also fix for sidsize DOS bug.

locking/locking.c: Check value of ret before using it for memdup.

printing/printing.c: Convert print_fsp_open to return an allocated fsp.

rpc_server/srv_lsa.c: Fix for NT domain logons.

I have removed all use of lp_share_modes() from the code (although I
left the parameter in the table for backwards compatibility). It no longer makes
sense for this to exist.

smbd/close.c: Removed lp_share_modes().
smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code.
smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail.

smbd/nttrans.c:
smbd/reply.c:
smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/
               open_file_stat to return an fsp from the call.

smbd/open.c: Changed all occurrences of open_file_shared/open_directory/
             open_file_stat to return an fsp from the call.

In addition I have fixed a long standing race condition in the deny mode
processing w.r.t. two smbd's creating a file. Andrew, please note that
your original idea of using open with O_EXCL in this case would not work
(I went over the races very carefully) and so we must re-check deny modes
*after* the open() call returns. This is because there is a race between
the open with O_EXCL and the lock of the share mode entry. Imagine the
case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL,
but is pre-empted before it locks the share modes and creates the deny
mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY
and a deny mode of DENY_NONE and the two opens would be allowed.

The *only* way to fix this race is to lock the share modes after the
open and then do the deny mode checks *after* this lock in the case
where the file did not originally exist.

This code will need extensive testing but seems to initially work.

Jeremy.
(This used to be commit ab0ecc39d6)
2000-04-22 00:33:16 +00:00
Andrew Tridgell
7b1c5392f7 updates from the TNG branch
(This used to be commit 36fb5bc72f)
2000-04-18 03:34:27 +00:00
Luke Leighton
f5da7470c3 logic for domainsidsize is if size is zero, there's no sid, so don't
advance over it and 4-byte align.

this _used_ to be "regardless of domainsidsize, advance by domainsidsize+3"
which is wrong.
(This used to be commit 5086e6425f)
2000-04-12 05:56:16 +00:00
Jeremy Allison
f6be38cae2 include/byteorder.h: ALIGN4/ALIGN2 macros.
include/includes.h: Added SMB_BIG_UINT_BITS.
lib/util.c: Removed align2/align4 - use macros.
libsmb/namequery.c: Use ALIGN2.
locking/locking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T.
                   Needed to move to hiding POSIX locks at a lower layer.
nmbd/nmbd_processlogon.c: Use ALIGN2/ALIGN4 macros.
smbd/blocking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T.
smbd/reply.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T.
Jeremy.
(This used to be commit 491eea8a20)
2000-04-11 19:44:54 +00:00