1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

1712 Commits

Author SHA1 Message Date
Andrew Tridgell
534a90ca44 more splitting of server.c
created dosmode.c and filename.c
-
Andrew Tridgell
b3d7014643 now that we have no global arrays we can start to split up the monster
server.c without breaking things.

this splits off netprot.c and fileio.c for negprot and read/write/seek
handling respectively.
-
Andrew Tridgell
1eb9ae2996 added some optimisation for the case where the number of open files is
very large. files.c now promotes a files_struct to the top of the list
if it is used when it is more than 10 elements from the top.

also moved common linked list code for the 5 sets of linked lists that
I've created over the past few days into dlinklist.h (I've explained
to Chris why I didn't use the ubiqx code)
-
Andrew Tridgell
01b642a379 reduced the memory footprint a bit by changing some large static int
arrays to uchar
-
Andrew Tridgell
b7aaab1b6b moved connection_struct handling code into smbd/conn.c and changed it
to a linked list with bitmap format.
-
Andrew Tridgell
27da84b90d converted the policy code to use a linked list and bitmap. This saves
us a bit of memory.
-
Andrew Tridgell
068a862982 much cleaner chain pointer handling for both files and pipes.
the chain pointer is now stored as a static and is set whenever a
handle is created or extracted. This also makes the code less error
prone.
-
Andrew Tridgell
8bc2627ff2 some cleanups from the conversion of Pipes[] to a linked list. I also
removed most cases where a pnum is used and substituted a pipes_struct*.

in files.c I added a offset of 0x1000 to all file handles on the
wire. This makes it much less likely that bad parsing will give us the
wrong field.
-
Andrew Tridgell
f1c67a00b8 I think it is pretty much decided that the next major version will be
2.0, so I've updated version.h to reflect this. I've put in
"2.0.0-prealpha".
-
Andrew Tridgell
b3dd378575 - some tidying up in files.c
- handle null fsp in DEBUG() at end of reply_ntcreate_and_X(). Jeremy,
  can you fix this properly?

- get snum right in print queue code in ipc.c (it was broken by my
  connections_struct changes).
-
Andrew Tridgell
16228c185a fixed some bugs in the locking_slow code caused by the recent changes.
also fixed a couple of %s/%d bugs in locking slow that have been there
for a while but are now revealed by the gcc printf argument testing.
-
Andrew Tridgell
bf136b4fa8 added include of sys/resource.h -
Andrew Tridgell
79755ce970 got rid of the Files[] array completely (previously I'd just made it
private to files.c)

It now is a doubly linked list with a bitmap for allocated file
numbers. Similarly for the fd_ptr code. I also changed the default
maximum number of open files to 4096. The static cost is 1 bit per
file.

It all seems to work, and it passes the "does Sue scream" test, but if
you see weird behaviour then please investigate. With the volume of
new code that has gone in there are bound to be one or two bugs
lurking.

note that you must do a "make clean" before building this as many data
structures have changed in size.
-
Andrew Tridgell
f573a65b67 server.c: fixed a bug in close_file() with the new files.c handling code
bitmap.c: added bitmap hanlding code in preparation for increasing the
          default max open files to several thousand
-
Andrew Tridgell
3daee29636 changed find_free_file() to file_new(). -
Andrew Tridgell
b088c804f9 this checkin gets rid of the global Files[] array and makes it local
in files.c

it should now be faily easy to expand the default MAX_OPEN_FILES to
many thousands.
-
Andrew Tridgell
76e523907c use user instead of this_user to prevent global shadowing -
Andrew Tridgell
571b522bec some more dummy files to ignore -
Andrew Tridgell
d933a47be6 moved the printing related files to a separate printing/ directory. -
Jeremy Allison
1b9cbcd02e configure: Changes for extra headers.
configure.in: Source for header changes.
client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile.
include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers.
include/includes.h: Headers for the above.
include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int).
lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/debug.c: Fixed signal functs.
lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile.
lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile.
libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile.
locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile.
locking/shmem_sysv.c: Fixed error messages in sysV stuff.
nmbd/asyncdns.c: Fixed signal functs.
nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile.
passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile.
passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/nttrans.c: Fixed fsp code path.
smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem.
smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile.
smbd/trans2.c: Fixed core dump bug.
smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile.
Jeremy.
-
Andrew Tridgell
c7ee025ead this is the bug change to using connection_struct* instead of cnum.
Connections[] is now a local array in server.c

I might have broken something with this change. In particular the
oplock code is suspect and some .dll files aren't being oplocked when
I expected them to be. I'll look at it after I've got some sleep.
-
Andrew Tridgell
6f9228b011 remove an unused variable -
Andrew Tridgell
7446540017 define INADDR_NONE if not already defined -
Jeremy Allison
b68e756ff5 Makefile.in: Changed so that make proto will work with ldap & nisplus.
locking/locking.c: Made #ifdef'ed out functions static for Make proto.
lib/util.c: Re-instated old mask_match code for UNIX filesystem checks
            only. Client calls use the new mask_match code. Changed the
            name of the old function to unix_mask_match.
Jeremy.
-
John Blair
2ba4b66a74 Added the '--with-netatalk' option to turn Netatalk support on at
compile-time.
-
John Blair
1313451f21 Added the APPLEDOUBLE macro for the name of the directory containing
a file's Macintosh resource fork (normally .AppleDouble under Netatalk).
-
John Blair
05a5243d84 Uh... I'm checking stuff in. Jeremy will by *so* pleased :)
netatalk.c contains the meat of the code required to move Macintosh resource
forks around when Windows users manipulate files created by a mac.  This
allows for greater integration between netatalk and Samba, but is, of course,
potentially a recipe for disaster.  All the netatalk related code is insulated
by #ifdefs from the standard build.
-
Herb Lewis
3eff609b7a move smbd/print_svid.o from SMBD_OBJ1 to PARAM_OBJ so that nmbd, swat, etc.
will link when SYSV is defined. We may want to restructure this later and
move this to param instead of smbd ???
-
Herb Lewis
aa5648ce83 return to old behaviour of dumping ALL parameters -
Jeremy Allison
83c54b01ba HAVE_STATVFS should be STAT_STAVFS (caused printing to break on IRIX).
Jeremy.
-
Jeremy Allison
c9695bdf2e More blocking lock code - still #ifdef'ed out - under development.
Jeremy.
-
Christopher R. Hertel
8880fc58fa Debug output formatting change. I'm trying to combine log lines that
really should be together.  Chris -)-----
-
Christopher R. Hertel
c626828471 Changed a call to fflush(dbg) to dbgflush(). -
Christopher R. Hertel
a97460869f I've added a dbgflush() function to debug.c. Calling this will cause the
debug format buffer to be written out (and reset).  fflush() is also called
to force the issue.  I replaced the call to fflush() in client.c with a
call to dbgflush(), which seems to have fixed the problem that Andrew was
working on (i.e., that the prompt was not displayed when using smbclient).

Chris -)-----
-
Andrew Tridgell
638ee7d265 fixed the nested comment - Jeremy, do you want that unbecome_user() or
not?
-
Jeremy Allison
ddfbcc0581 include/smb.h: Removed dir_ptr. Not needed.
locking/locking.c: First cut a blocking lock code. #ifdef'ed out for now.
locking/locking_shm.c: Removed dir_ptr. Not needed.
smbd/nttrans.c: More work on ChangeNotify - return is not an error and needs
                to be handled as a nttrans with zero params. Removed dir_ptr. Not needed.
smbd/reply.c:
smbd/server.c:
smbd/trans2.c: Removed dir_ptr. Not needed.

Hmmm. At the moment smbclient is broken - doesn't issue prompt correctly.
This needs looking at.

Jeremy.
-
Christopher R. Hertel
c69727bd29 Quick fix for a small problem. If you run 'nmbd -?' you'd get the usage
message *but the daemon would start anyway*.  I've added a call to exit()
in the default: case of the option processing loop.

Chris -)-----
-
Christopher R. Hertel
53b433e6ab I've come up with a different scheme for doing the DEBUG() and DEBUGADD()
macros that meets the RVALUE requirement and doesn't use the (a?b:c) format
that Andrew called "ugly".  I've added the new macros but kept the old
macros within a #if 0..#else..#endif block in case I've missed somthing.

Basically, I've used

  (void)( (a) && (b) )

or

  (void)( (a) && (b) && (c) )

instead of

  ( (a) ? (void)(b) : (void)(c) )

or similar.  I have this compiled and running now.

Here's the diff:

$ cvs diff smb.h
Enter passphrase for RSA key 'crh@Ruby':
Index: smb.h
===================================================================
RCS file: /data/cvs/samba/source/include/smb.h,v
retrieving revision 1.172
diff -r1.172 smb.h
143a144,145
> #if 0
>
150a153,164
>
> #else
>
> #define DEBUG( level, body ) \
>   (void)( (DEBUGLEVEL >= (level)) \
>        && (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \
>        && (dbgtext body) )
>
> #define DEBUGADD( level, body ) \
>   (void)( (DEBUGLEVEL >= (level)) && (dbgtext body) )
>
> #endif

Chris -)-----
-
Christopher R. Hertel
8fedcfc48d Cleaned up some lint warnings (functions with return values that were
ignored).
-
Herb Lewis
5f5562ff60 strip out extra spaces from smbclient output that were added recently -
Christopher R. Hertel
efa67d6b2b Removed a stray semicolon in the DEBUGADD() macro. -
Christopher R. Hertel
fd7eaed59e I've added a test for lp_loaded() so that timestamps *will* be output
before the config file has been loaded.  Otherwise the default is no
timestamp.

Chris -)-----
-
Andrew Tridgell
5ae0401281 fixed a nasty bug in debug.c
Debug1() was being called like this:

      Debug1( format_bufr );

but if format_bufr contains any %s or other % arguments (such as when
processing a smb.conf file containing % macros) then smbd dies a
horrible death.

The quick fix is to use:

	Debug1( "%s", format_bufr);
-
Andrew Tridgell
83122bae22 make sure that a fault cannot occur twice. The new Debug1() code is
causing seg faults on my machine and because the fault code calls
DEBUG() it is looping!

now to find the bug in the Debug1() code ...
-
Jeremy Allison
4ac3091e57 Makefile.in: Added CHECK target back in (at Herb's request). Added
manpath in (although we don't currently use it).
client/client.c: Added John Blair's fixes for "put -".
include/nterr.h: Added NT_STATUS_NOTIFY_ENUM_DIR error code.
smbd/nttrans.c: Added in devious fix for one-shot NT change notify bug.
Jeremy.
-
Herb Lewis
5fc8b4a1d5 update for new directory structure -
Jeremy Allison
9d010e721c Makefile.in: Fixed make clean bug with CVS directory in bin/.
include/smb.h: Fixed bugs in Debug macro's with SGI compiler.
smbd/trans2.c: Fixed bug reported by Zoltan Palmai <ZSPA@chevron.com>
               PR#8903 where get_lanman2_dir_entry() could return a
               mangled name as a resume key and call_trans2findnext()
               wasn't doing the same.
Jeremy.
-
Andrew Tridgell
162141d3b3 moved access.c into lib/ from smbd/ as it is needed by testparm. I
modified it not to need any smbd specific structures and instead pass
things from smbd.
-
Andrew Tridgell
90d93889d7 split the system password checking routines out of smbd/password.c and
into passdb/pass_check.c. This means SWAT no longer needs to link to
smbd/password.c
-
Andrew Tridgell
745d38bfe7 moved username.c into lib/ so we no longer $(PASSDB_OBJ) in most
utilities
-