1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-18 08:23:51 +03:00
Commit Graph

415 Commits

Author SHA1 Message Date
Andrew Bartlett
7854a439ac Make the 'service' in make_connection() use an fstrcpy(), and an fstring,
becouse that is what it's input (reply_tcon_and_x) uses, and becouse we really
don't want supprises for service names.

Also remove a legacy #define, in favor of the lp_ equiv.

Andrew Bartlett
-
Jeremy Allison
6a2b7fd82c Ensure we return disk full by default on short writes.
Jeremy.
-
Andrew Bartlett
92a777d0ea BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
-
Simo Sorce
63a669475b fix for bad check spotted by Ray Simard <ray@sylvan-glade.com> -
Jeremy Allison
636ab292db Fix for old DOS client when veto files is set to /.*/
Jeremy.
-
Jeremy Allison
15f0bad1fc The element in fsp->print_job should be a RAP jobid, not a uint32 RPC
jobid. This was causing Win9x client "set name" calls to fail.
Still need one cleanup fix to finish.
Jeremy.
-
Jeremy Allison
2fe7504a08 Added Volker's directory fix - save the attributes
from the first call.
Jeremy.
-
Jeremy Allison
d41858b9e6 Reformat of reply.c before Volker's patch.
Jeremy.
-
Jeremy Allison
fc7d3faed7 Fixed nasty bug where file writes with start offsets in the range
0x80000000 -> 0xFFFFFFFF would fail as they were being cast
from IVAL (uint32) to SMB_OFF_T (off_t or off64_t, both *signed* types).
The sign extension would cause the offset to be treated as negative.
Thanks to Herb for helping me track this one down (IRIX is good for large
file tests :-).
Jeremy.
PS. That horrid EXEXIST thing has broken configure.....
-
Andrew Bartlett
323088259f As per Jeremy's request back this out, so as to re-gain the implicit length
check.

Andrew Bartlett
-
Andrew Bartlett
b072bb9c84 No need for fstring manipulation here (Tcon&X), just use string pointers.
Andrew Bartlett
-
Jeremy Allison
82b8f749a3 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.
-
Jeremy Allison
44db20f9f6 Ensure can_delete returns correct error code.
Jeremy.
-
Jeremy Allison
a77966645a Use sendfile in readbraw.
Jeremy.
-
Jeremy Allison
28466ff42c Added "use sendfile" per share option.
Jeremy.
-
Jeremy Allison
5881f0a226 Actually use sendfile if selected.
Jeremy.
-
Jeremy Allison
f956a4d29d Attempt to make broken Linux sendfile work.... Still in progress.
Jeremy.
-
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
-
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.
-
Jeremy Allison
640f061ab2 Formatting tidyups before I look at implementing the sendfile in READX.
Jeremy.
-
Jeremy Allison
237e36124c Ensure we've failed a lock with a lock denied message before automatically
pushing it onto the blocking queue.
Jeremy.
-
Jeremy Allison
c93b40f43d Fix missing braces around push lock call.
Jeremy.
-
Jeremy Allison
3c9d24d7c3 Added final Steve French patch for "required" attributes with old
dir listings. Added regression test in smbtorture (in HEAD) also.
Jeremy.
-
Jeremy Allison
f00102ba77 We shouldn't add printing flag here.
Jeremy.
-
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.
-
Andrew Tridgell
282a64b085 round lock timeouts in lockingX upwards to multiples of 1 second, so a
half second timout rounds to 1 not 0
-
Shirish Kalele
cbb6e2fbdb Add RESOLVE_DFSPATH to mkdir operations in HEAD. -
Andrew Bartlett
f393de2310 Make 'remote_machine' private to lib/substitute.c, and fix all the user to use
the new accessor functions.

Andrew Bartlett
-
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
-
Andrew Bartlett
6465c6727b Make it clear that the 'service' isn't to be touched. (Make it const).
Andrew Bartlett
-
Andrew Bartlett
2afa291404 Update the smbd reply code a little:
I don't like the idea of muliple netprots - becouse I see potential problems
with people being able to maniplate internal samba variables.

This applies in particular to remote names, so don't allow muliple session
requests either.

Also remove a pstrcpy() from the tcon code, we really don't need it.

Andrew Bartlett
-
Jeremy Allison
4ff64f6970 Gone back to explicit queue number passing as snum - removed encoding of
queueid in job number. This means we must have an internal tdb to store
mapping from 16 bit RAP jobid's to 32 bit RPC jobids.
Jeremy.
-
Andrew Tridgell
a877eae24b make sure we don't walk past the end of the current SMB buffer when
pulling a string
this might explain a serious filename corruption bug that Quantum QA spotted
-
Andrew Tridgell
b693917530 this fixes the displaying of free disk space for DOS6 clients. Win2000
changes its behaviour based on the negotiated protocol for the
SMBdskattr SMB
-
Andrew Tridgell
be23d87a17 This split the mangling code up to allow for the possibility of multiple
mangling implementation, selectable using "mangling method = " in smb.conf

It also tidies the interface a little, although it is still nasty.
-
Jeremy Allison
16015c07ea Added Shirish's client side caching policy change.
Jeremy.
-
Andrew Bartlett
ad8aa47057 Reintroduce the 2.2 name mangling code, until we get are more flexible solution.
Even for a hash/cache setup, this code needs some more work, in particular
it needs to use mangle_get_prefix() etc and to move to unicode internals.

Andrew Bartlett
-
Jeremy Allison
2475c09b35 Fixed the error bad path for recursive mkdir so mkdir \a\b\c\d works.
Forward ported some of the code tidyups from 2.2.
Jeremy.
-
Jeremy Allison
4eb29ac559 Removed unused variable.
Jeremy.
-
Jeremy Allison
3b1b8ac435 Fix the mp3 rename bug - also tidy up our open code and remove the special
cases for rename and unlink. Had to add desired_access into the share mode record.
Jeremy.
-
Jeremy Allison
504e5ef049 Remove the "stat open" code - make it inline. This should fix the
bugs with opening and renaming mp3 files, also the word rename
problems that people have had for a while.
Needs a make clean :-) make.
Also added JohnR's printing fix.
Jeremy.
-
Jeremy Allison
ad1e858d8e Sync up vfs changes from 2.2.x.
Jeremy.
-
Tim Potter
1f007d3ed4 Renamed get_nt_error_msg() to nt_errstr(). -
Gerald Carter
5760315c1d syncing up printing code with SAMBA_2_2 (already done some merges
in the reverse).

  * add in new printer change notify code from SAMBA_2_2

  * add in se_map_standard() from 2.2 in _spoolss_open_printer_ex()

  * sync up the _print_queue_struct in smb.h (why did someone change the
    user/file names in fs_user/fs_file (or vice-versa) ? )

  * sync up some cli_spoolss_XXX functions
-
Tim Potter
6a053fa770 Fixed bodgy printf arguments in debug statment.
Who would have guessed it - we now use floating point maths in Samba.
-
Jeremy Allison
8aa9860ea2 include/smb_macros.h: Don't round up an allocation if the size is zero.
"One of these locks is not like the others... One of these locks is not
quite the same" :-). When is a zero timeout lock not zero ? When it's
being processed by Windows 2000 of course.. This code change, ugly though
it is - completely fixes the foxpro/access multi-user file system database
problems that people have been having. I used a *wonderful* test program
donated by "Gerald Drouillard" <gerald@drouillard.ca> which allowed me
to completely reproduce this problem, and to finally determine the correct
fix. This also explains why Windows 2000 is *so slow* when responding to
the smbtorture lock tests. I *love* it when all these things come together
and finally make sense :-).
Jeremy.
-
Andrew Tridgell
72cb43b912 make sure we give an error for unknown lockingX locktype bits -
Jeremy Allison
d9cb1bf20a Mask off the aDIR on setfileinfo.
Jeremy.
-
Jeremy Allison
9243a9778e Added "nt status support" parameter. Fix offline synchronisation.
Jeremy.
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-