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

4315 Commits

Author SHA1 Message Date
Jeremy Allison
369f5fd1d7 Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open
problem.
Jeremy.
(This used to be commit 0a40bc83e1)
2000-12-15 01:02:11 +00:00
Tim Potter
624431c98b Renamed parameters and variables called acl to the_acl as it conflicts
with a Solaris system call.
(This used to be commit 5e547ddcb5)
2000-12-14 05:38:05 +00:00
Tim Potter
237e74730c Cache lsa connection and policy handle for resolving names and sids.
(This used to be commit 09d2d972fd)
2000-12-14 03:27:53 +00:00
Tim Potter
56ee3e2e2f Convert names to sids when modifying ACLs. Convert sids to names when
displaying ACLs.
(This used to be commit 5001bbc64b)
2000-12-13 12:53:42 +00:00
Tim Potter
76dca9c1fb Don't print out the security descriptor type as it is automatically
calculated by the new make_sec_desc() function.
(This used to be commit 6fd5dc8145)
2000-12-12 06:14:01 +00:00
Tim Potter
cbddae005f Better error checking for ACL parsing.
Print an error when attempting to delete a non-existent ACL.
(This used to be commit d119782d0d)
2000-12-12 06:06:10 +00:00
Jeremy Allison
ccb5cbf175 Fixed very subtle bug returning correct error on an open, when we have
a choice of invalid share mode and access denied. We must return the
access denied by preference, but also remember to break the oplocks...
This is needed for multi-user MS-Access.
Jeremy.
(This used to be commit 7eb7241442)
2000-12-11 21:09:48 +00:00
Tim Potter
34402b75b5 Added undocumented -t command for testing parsing of acl entries.
Print out hex value for ace mask if we can't decode it.

We can now parse FULL,CHANGE,READ as well as combos of RWXDPO as ace mask
values.

Clarified usage message.

Bomb out if excess args are given.
(This used to be commit ed5bda119a)
2000-12-07 06:05:57 +00:00
Gerald Carter
b6e03bf737 added passdb editor (rough form with a few bugs) Should work
with all backends.


--jerry
(This used to be commit fc43c63f48)
2000-12-06 18:18:48 +00:00
Andrew Tridgell
3eee7625b1 added a comment
(This used to be commit 032442802f)
2000-12-04 07:38:06 +00:00
Andrew Tridgell
723c9b87e7 fixed the parsing again and got setting acls working with w2k
(This used to be commit 374d08be64)
2000-12-04 07:27:35 +00:00
Tim Potter
54100bac69 Added some cli_errstr() calls.
(This used to be commit faaa71a032)
2000-12-04 06:46:52 +00:00
Tim Potter
92abcbc040 Removed lsa lookup warnings (I'll remember).
Print an error if -M refers to a non-existent ACL.
(This used to be commit ee6f5a9672)
2000-12-04 06:43:36 +00:00
Andrew Tridgell
3d43b2db28 fixed setting ACLs on directories
(This used to be commit 117956ecb1)
2000-12-04 06:39:31 +00:00
Tim Potter
252e3ba128 Mask value now displayed as READ/CHANGE/FULL for standard permissions, or
RWXDPO for special permissions.

Append 0x to values printed as hex.

Spruced up the help message.
(This used to be commit 8a20318c56)
2000-12-04 06:14:28 +00:00
Andrew Tridgell
5092ad82ba removed SACL support (as it doesn't work with w2k if you ask for
SACLs)
(This used to be commit 52b27d75e1)
2000-12-04 04:58:40 +00:00
Andrew Tridgell
576a106d03 signed/unsigned warning fixed
(This used to be commit 71adecd163)
2000-12-04 03:27:02 +00:00
Andrew Tridgell
6399b62175 fixed acls set bug
(This used to be commit 44524958ed)
2000-12-04 02:01:57 +00:00
Andrew Tridgell
0884d6ab52 fixed SACL bug
(This used to be commit 077ee4a7ac)
2000-12-04 00:35:31 +00:00
Andrew Tridgell
a4c11729b2 - with -D only delete first match
- fixed delete bug
(This used to be commit 1e0d5f0695)
2000-12-04 00:33:08 +00:00
Andrew Tridgell
0cb1c512f1 - added help
- added add/modify/delete/set as separate operations
(This used to be commit cb324b53c6)
2000-12-03 12:41:28 +00:00
Andrew Tridgell
dc3251b460 cleaner parsing and default handling
(This used to be commit f8dbd2b799)
2000-12-03 11:05:11 +00:00
Andrew Tridgell
3b22b74f9d - better parsing
- started to add non-numeric support
(This used to be commit fd4c03aef6)
2000-12-03 08:35:11 +00:00
Andrew Tridgell
4fee254d67 getting/setting acls now works. The SIDs are still numeric, the next
step is to support usernames etc
(This used to be commit 6cea1647fc)
2000-12-03 07:36:15 +00:00
Andrew Tridgell
c93f686f01 added basic ability to dump remote file acls
(This used to be commit c6c90dc8e1)
2000-12-03 05:24:16 +00:00
Andrew Tridgell
83bd929883 a prootype program for querying/setting a security decsriptor on a
remote machine

it is by no means complete, expect more commits soon
(This used to be commit f2f9859b70)
2000-12-03 02:19:27 +00:00
Andrew Tridgell
08036f0f3d support smbcontrol sending messages to itself (for testing purposes)
(This used to be commit 5dfae86dab)
2000-11-17 01:20:03 +00:00
Jeremy Allison
cdac09614e Fix for a problem with the new messaging system. If a sender is using the
messaging system as a notification mechanism, and the speed of notification
greatly exceeds the speed of message recovery, then you get a massively (>75Mb)
growing tdb. If the message is a simple notification, then the message is
static, and you only need one of them in transit to a target process at
any one time.
This patch adds a BOOL "allow_duplicates" to the message_send_XX primitives.
If set to False, then before sending a message the sender checks the existing
message queue for a target pid for a duplicate of this message, and doesn't
add to it if one already exists.
Also added code into msgtest.c to test this.
Jeremy.
(This used to be commit 3aa7995660)
2000-11-16 21:38:24 +00:00
Jeremy Allison
6f58dd5871 Ok - fixed a bug in our levelII oplock code. We need to break a level II on
a byte range lock (write lock only, but Win2k breaks on read lock also so I
do the same) - if you think about why, this is obvious. Also fixed our client
code to do level II oplocks, if requested, and fixed the code where we would
assume the client wanted level II if it advertised itself as being level II
capable - it may not want that.
Jeremy.
(This used to be commit 213cd0b519)
2000-11-16 00:59:18 +00:00
Gerald Carter
9fede0dc0d Large commit which restructures the local password storage API.
Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+)
are broken, but they were somewhat broken before. :)

The following functions implement the storage manipulation interface

/*The following definitions come from  passdb/pdb_smbpasswd.c  */

BOOL pdb_setsampwent (BOOL update);
void pdb_endsampwent (void);
SAM_ACCOUNT* pdb_getsampwent (void);
SAM_ACCOUNT* pdb_getsampwnam (char *username);
SAM_ACCOUNT* pdb_getsampwuid (uid_t uid);
SAM_ACCOUNT* pdb_getsampwrid (uint32 rid);
BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass);
BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override);
BOOL pdb_delete_sam_account (char* username);

There is also a host of pdb_set..() and pdb_get..() functions for
manipulating SAM_ACCOUNT struct members.  Note that the struct
passdb_ops {} has gone away.  Also notice that struct smb_passwd
(formally in smb.h) has been moved to passdb/pdb_smbpasswd.c
and is not accessed outisde of static internal functions in this
file.  All local password searches should make use of the the SAM_ACCOUNT
struct and the previously mentioned functions.

I'll write some documentation for this later.  The next step is to fix
the TDB passdb backend, then work on spliting the backends out into
share libraries, and finally get the LDAP backend going.

What works and may not:

	o domain logons from Win9x 	works
	o domain logons from WinNT 4	works
	o user and group enumeration
		as implemented by Tim	works
	o file and print access		works
	o changing password from
		Win9x & NT		ummm...i'll fix this tonight :)

If I broke anything else, just yell and I'll fix it.  I think it
should be fairly quite.





-- jerry
(This used to be commit 0b92d0838e)
2000-11-13 23:03:34 +00:00
Jeremy Allison
20838bb9ed Merge of Herb's profiling code.
Jeremy.
(This used to be commit 3be056c71a)
2000-11-11 00:33:33 +00:00
Jeremy Allison
c97023b14c Merge in Herb's changes from 2.2.
Jeremy.
(This used to be commit 24d76c5fbd)
2000-11-10 22:07:57 +00:00
Herb Lewis
53ce2f7012 lib/messages.c add debug print for receipt of PING and
REQ_DEBUGLEVEL messages
utils/smbcontrol.c      allow "q" to exit interactive mode. Exit on error
                        from message_init.
(This used to be commit cda8c04391)
2000-10-12 17:58:40 +00:00
Herb Lewis
ca4acd520e print source PID in PONG and debuglevel message. Allow request debuglevel
message to go to any dest. Put timeout for commands that expect a reply.

sync with 2.2 branch
(This used to be commit 45632bb813)
2000-10-12 00:29:01 +00:00
Christopher R. Hertel
2cddf134e6 Simple cleanup, but I also changed the value of the dlevel parameter passed
to open_socket_in() from within the open_sockets() function.  This has some
effect on the way port numbers are assigned.  Basically, if we use the -r
switch we are saying 'use port 137'.  If we can't do that, there should
be an error message and a failure.  If we don't use -r then we simply select
the first available port.  The way it was working, if we selected -r and
port 137 was in use, wierd things would happen as open_socket_in() tried to
find another port.
(This used to be commit f09cb41ad8)
2000-10-11 16:24:20 +00:00
Herb Lewis
8719c27726 changes to sync with 2.2. tree
.cvsignore              remove config.h - not in this directory
include/profile.h       profile changes
lib/messages.c          added message to return debug level
libsmb/clierror.c       cast to get rid of compiler warning
libsmb/smbencrypt.c     cast to get rid of compiler warning
profile/profile.c       add flush profile stats changes for profile struct
rpc_parse/parse_samr.c  fix for compiler warning
rpc_server/srv_samr.c   cast to get rid of compiler warning
smbd/ipc.c              profile stats
message.c               profile stats
smbd/negprot.c          profile stats
smbd/nttrans.c          profile stats
smbd/trans2.c           profile stats
utils/smbcontrol.c      new flush stats command
(This used to be commit bbb24daa25)
2000-10-11 05:31:39 +00:00
Andrew Tridgell
d2f07bb765 don't use gets() !
(This used to be commit e4ea0a5975)
2000-10-10 05:05:35 +00:00
Jeremy Allison
74d4a3b741 Added Herb's fixes to HEAD.
Jeremy.
(This used to be commit 4862d2ab11)
2000-10-06 23:01:47 +00:00
Jeremy Allison
641d9223d2 utils/smbcontrol.c: Fixes from Herb for interactive use.
printing/nt_printing.c: No C++ comments please :-).
Jeremy.
(This used to be commit dd9f668108)
2000-09-29 20:08:00 +00:00
Andrew Tridgell
e600c12b6b use the 64 bit locking interface in locktest
(This used to be commit 1ece7f1ffd)
2000-09-29 04:43:07 +00:00
Luke Leighton
dda54bcd7d added NEGNOWAIT. sent to secure@microsoft.com
(This used to be commit b211793318)
2000-09-26 05:44:42 +00:00
Andrew Tridgell
7be9a4fd4c first cut at smbcontrol program. It currently allows syntax like:
smbcontrol nmbd debug 7
  smbcontrol smbd debug 9
  smbcontrol 3278 debug 1
  smbcontrol nmbd force-election
(This used to be commit 5f91c24636)
2000-09-13 07:07:17 +00:00
Andrew Tridgell
df89b48539 - fixed some memory leaks in the messages code
- added a MSG_PING message for performance testing.
(This used to be commit e779f834db)
2000-09-12 06:57:25 +00:00
Andrew Tridgell
f0ce4f7ae3 - changed the msg_type to be an int instead of an enum so that it is
easier to add new message types to messages.h without breaking old
binaries

- added a MSG_FORCE_ELECTION message to force nmbd to hold an election
(This used to be commit f1c49ca7ce)
2000-09-12 06:13:25 +00:00
Andrew Tridgell
fe47e8efe2 a simple test program I use to test the debug message system
(This used to be commit db1ec05f89)
2000-09-11 07:03:10 +00:00
Jeremy Allison
d8ad8a0d74 Fix for safe_free freeing static strings. From Robert August Vincent, II.
Jeremy.
(This used to be commit bd844fcd30)
2000-08-21 19:30:19 +00:00
Andrew Tridgell
0d7df3ee01 fixed help string
(This used to be commit 16afa46797)
2000-08-09 00:11:01 +00:00
Tim Potter
18db0514fd Fixed memory leaks in root and non-root password changing.
(This used to be commit f3a4f81a5e)
2000-07-26 03:55:17 +00:00
Christopher R. Hertel
ac56d8f848 Removed the sanity check on the WINS SERVER parameter because it simply
checked to see that only one server was listed.  As I am working on an
enhancement that allows multiple servers to be listed...this was a bit
contrary.  ;)
(This used to be commit 1b718f6767)
2000-07-18 20:15:15 +00:00
Andrew Tridgell
c1254449a2 the smbw sample prog
(This used to be commit 0afcc0d336)
2000-07-06 03:54:07 +00:00
Andrew Tridgell
7d9b43c8e0 slightly saner defaults
(This used to be commit fae3acc574)
2000-06-29 08:22:00 +00:00
Andrew Tridgell
b41b1daa36 add -d debuglevel option
(This used to be commit 448f21325f)
2000-06-15 09:31:34 +00:00
Christopher R. Hertel
30fdd204f4 If I use nmblookup to search for node ZOOB#1B and there is no such name
registered within the search space, nmblookup would report

  name_query failed to find name ZOOB

I've changed it to report any non-zero type, so the above message becomes

  name_query failed to find name ZOOB#1B

If the query is for ZOOB or even ZOOB#00 then the old style error message
is given.

Chris -)-----
(This used to be commit 5ecf0c6171)
2000-06-13 20:41:15 +00:00
Andrew Tridgell
cf868f3296 argv parsing fixes
(This used to be commit 502751cc62)
2000-06-13 15:47:44 +00:00
Andrew Tridgell
e281246010 allow for lots of connections per server
(This used to be commit 4bbc218922)
2000-06-13 15:47:23 +00:00
Andrew Tridgell
ec33db96d5 added -L switch to tell smbtorture to use oplocks
(This used to be commit 73033d0803)
2000-06-13 09:33:43 +00:00
Andrew Tridgell
8843a6379d Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
(This used to be commit b28cc4163b)
2000-06-11 05:57:58 +00:00
Andrew Tridgell
2db93dcc0f don't ue nasty /proc/locks hack by default
(This used to be commit 62d72dd67b)
2000-06-05 13:54:26 +00:00
Andrew Tridgell
7df31cb494 added locktest2
this uses 16 open file descriptors on 2 servers, with each server
accessed both via POSIX call and SMB calls. The idea is to test
NFS/SMB locking interaction.

Unfortunately the NT NFS locking implementation is so badly broken
that we don't have anything to test against
(This used to be commit 581498fe6b)
2000-06-05 13:53:56 +00:00
Andrew Tridgell
92972280af added -O (use oplocks) option to locktest
(This used to be commit 56ba49382f)
2000-06-05 09:40:58 +00:00
Andrew Tridgell
cbeb0aa3f2 moved secrets fns into secrets.c
(This used to be commit 16355a9c66)
2000-06-03 06:34:40 +00:00
Andrew Tridgell
a0e1930489 fixed bugs in fdpass tests
(This used to be commit ee4f6335ad)
2000-05-27 00:29:10 +00:00
Andrew Tridgell
fae1164304 move srandom to after connect so random stuff in clientgen doesn't
change seed
(This used to be commit d9322d01e0)
2000-05-27 00:28:02 +00:00
Andrew Tridgell
d29f8af77b minor fixes
(This used to be commit 4d00314ec5)
2000-05-24 21:11:34 +00:00
Luke Leighton
0fca9817b1 2nd evil simultaneous read-write test. forks. one writer. others
are readers.  writes between 1 and 20 bytes.  reads as much as possible.
compares.  repeat until end of buffer (fixed size: 131072 bytes) reached.
(This used to be commit 26f51a7abb)
2000-05-24 07:29:45 +00:00
Andrew Tridgell
d87a20e8c5 we don't do "revalidate = yes" any more
(This used to be commit 289d3cac38)
2000-05-24 07:18:34 +00:00
Andrew Tridgell
9514925481 added -u hide_unlock_fails option
(This used to be commit fc8c460a61)
2000-05-24 07:15:54 +00:00
Andrew Tridgell
aabf523caf use \\ in front of filenames
(This used to be commit a92f8c8620)
2000-05-24 06:01:05 +00:00
Andrew Tridgell
c29b72cd4f use lp_workgroup()
use \\ in front of filenames
get short name via a separate trans2 level 260 call
(This used to be commit 5fd4dbf72e)
2000-05-24 05:56:34 +00:00
Andrew Tridgell
7fd62a26f7 use lp_workgroup()
use \\ in front of filenames
(This used to be commit 9c64f47c16)
2000-05-24 05:47:08 +00:00
Luke Leighton
fb66b3b6e6 torture test:
same cli_state:
open file rw/denynone, open *same* file r/denynone.
write to file (fd1) read from file (fd2).  compare.  repeat.

two cli_states:
open file rw/denynone (cli1), open *same* file r/denynone (cli2).
write to file (fd1) read from file (fd2).  compare.  repeat.
(This used to be commit 0a993f3783)
2000-05-24 05:40:03 +00:00
Tim Potter
6c52c1a5c7 Added -W workgroup command line option.
Added call to codepage_initialise().
(This used to be commit fcb8e2fbe2)
2000-05-22 23:38:56 +00:00
Andrew Tridgell
2958dfcdf8 added secrets.tdb and changed storage of trust account password to use
it
(This used to be commit 88ad00b82a)
2000-05-08 10:42:21 +00:00
Andrew Tridgell
5612f6a2aa signed/unsigned fixes so we can handle a lock base close to 2^32
(This used to be commit 0ce2ca5ccd)
2000-05-06 01:36:59 +00:00
Andrew Tridgell
044b569006 make debug easier to read
(This used to be commit c14a261644)
2000-05-05 01:26:52 +00:00
Andrew Tridgell
8ea45ac5ce make debug easier to read
(This used to be commit d64bb07f0a)
2000-05-05 01:20:25 +00:00
Andrew Tridgell
a6280d37c6 nasty hack to print posix locks
(This used to be commit efc9752f1e)
2000-05-05 01:11:23 +00:00
Andrew Tridgell
c7845863bb example of broken posix lock behaviour
(This used to be commit b3999f3b20)
2000-05-05 00:46:38 +00:00
Jeremy Allison
045469493c rpc_server/srv_lsa.c: Bring into sync with 2.0.x.
rpc_server/srv_pipe_hnd.c: Bring into sync with 2.0.x.
smbd/blocking.c: Improve blocking debug reporting.
utils/torture.c: Added check for NT locking bug.
Jeremy.
(This used to be commit e8ff6d3fb5)
2000-05-04 21:57:28 +00:00
Andrew Tridgell
f74ea2b78b parameterize the lock timeout
(This used to be commit 98ad4095cc)
2000-05-04 09:32:21 +00:00
Andrew Tridgell
0236a14bac added a test for the NT byte range lock into smbtorture
(This used to be commit 7cfd45cc56)
2000-05-04 09:31:57 +00:00
Andrew Tridgell
420d7e02dc an even simpler example of NT gettings its locking code wrong. This
one doesn't even need two connections to the box, just two file handles.

it is a very simple case actually, and one I think will happen quite a
lot in real life. I wonder how they haven't noticed it? I checked and
W2K has the same bug.
(This used to be commit 0b335e4158)
2000-05-04 08:58:07 +00:00
Andrew Tridgell
a7820eb9af need LOCKING_OBJ in locktest now
(This used to be commit 89e7199445)
2000-05-04 06:57:26 +00:00
Andrew Tridgell
876dd8d9aa more locktest improvements
the current preset tests show a very interesting NT bug - it sometimes
refuses a lock that it shouldn't.
(This used to be commit 85b5dc64cf)
2000-05-04 06:30:17 +00:00
Andrew Tridgell
9faf18a4b0 fixed message text
(This used to be commit 99e522023e)
2000-05-04 06:29:13 +00:00
Andrew Tridgell
a5da647e10 added -A analyze mode to locktest - it can now automatically prune
the list of locks that cause a failure
(This used to be commit 0beee59432)
2000-05-04 04:14:23 +00:00
Andrew Tridgell
e6bc1dd64d found a much simpler case that kills the posix locking
(This used to be commit b703cecf81)
2000-05-04 02:12:33 +00:00
Andrew Tridgell
1246072d99 fixed a uninit memory read that insure found
(This used to be commit 43fe5b98b4)
2000-05-04 02:01:48 +00:00
Andrew Tridgell
82e6018ad8 added ability to present lock tests
(This used to be commit 3fc6a467fc)
2000-05-04 01:40:51 +00:00
Andrew Tridgell
380d02c219 improved the lock test program
(This used to be commit a0a3931c6e)
2000-05-03 14:49:15 +00:00
Andrew Tridgell
1d3d724dd1 added a nasty lock testing program
it opens 2 connections to each of 2 servers, and opens 2 fnums on the
same file on each connection (a total of 8 file descriptors)

then it does random lock/unlock/reopen requests in a 100 byte range on
the file and compares the results from the 2 servers.

strangely enough, NT fails this test against itself right now - I'm
still trying to figure that out.
(This used to be commit 2f14d7c9bc)
2000-05-03 13:54:28 +00:00
Jeremy Allison
37a6e44ad8 Added read overlay write lock on same fnum test to locktest2.
Added locktest5 for locking stacks.
Jeremy.
(This used to be commit 65399ae1f0)
2000-05-03 02:24:56 +00:00
Jeremy Allison
830a9e571e locking/posix.c: Fixed double-free nasty crash bug found by insure.
utils/make_smbcodepage.c:
utils/make_unicodemap.c: Insure 'make install' fixes.
Jeremy.
(This used to be commit 3b25f7368b)
2000-05-01 19:43:50 +00:00
Andrew Tridgell
481ca7c67c handle the special rule of *.* for old style listings when old_list is
true
(This used to be commit cdf4c4c812)
2000-04-30 14:37:57 +00:00
Andrew Tridgell
23c0cb01ca added cli_list_old() to allow for old style directory listing from
masktest
(This used to be commit 8a5c8cfa0e)
2000-04-30 12:34:26 +00:00
Andrew Tridgell
3727e4aaac changed masktest to test the internal algorithm against one server,
rather than 2 servers
(This used to be commit 0e63b4b363)
2000-04-30 11:11:19 +00:00
Andrew Tridgell
71e7974f3f YIPEE!!!!!
We finally have a perfect emulation of Microsoft wildcard
matching. The routine ms_fnmatch() does wildcard matching with all MS
wildcards (including the unicode wildcards), and masktest against a
NT4 workstation with hundreds of thousands of random exmaples has not
found a single error.

amazingly it is only about 60 lines of code, but it has taken us years
to get it right. I didn't sleep much last night :)
(This used to be commit cc9e007cdf)
2000-04-30 04:45:16 +00:00
Jeremy Allison
36db78feda Fixed subtle unlocking bug when a file is closed. We need to store the
smbpid used when a file was opened in the files_struct. Else we use
the wrong global_smbpid when we are closing the file and trying to
remove the brl locks - this causes the brl locks to be left when the
file is closed as the samba_context check fails.
Jeremy.
(This used to be commit 2746e5602e)
2000-04-27 22:23:04 +00:00
Andrew Tridgell
65ec80c51d quick hack to get smbtorture working again
(This used to be commit 2d37c1f98f)
2000-04-27 07:36:06 +00:00
Andrew Tridgell
59c8a608c2 fixed a memory leak in nmblookup
(This used to be commit 49865ea06c)
2000-04-25 00:46:46 +00:00
Andrew Tridgell
da2da10117 load smb.conf and interfaces in masktest (to allow for netbios name
resolution)
(This used to be commit f007531742)
2000-03-26 09:20:47 +00:00
Jeremy Allison
08607c3e0c Fixed parsing issue with HP printer defs reported by HP.
Jeremy.
(This used to be commit 035272e6bc)
2000-03-14 22:04:35 +00:00
Luke Leighton
3958c39106 added a tcon test: make two tconXs with the same user/pass, open a file
with one of them and try to write to the file with the other.
(This used to be commit f8d3ce0419)
2000-03-07 21:55:42 +00:00
Jeremy Allison
50444a0b5f Fixed smbpasswd crash bugs found by Giulio.
Jeremy.
(This used to be commit 54440428e5)
2000-03-01 18:58:50 +00:00
Jeremy Allison
0f1eee5c7a client/client.c:
libsmb/clientgen.c: Fixes for Win2k smbclient browsing.
Other fixes implement smbpasswd -x user to delete users. Also allows swat
to do the same.
Jeremy.
(This used to be commit 9f6ad04676)
2000-02-25 22:25:25 +00:00
Jeremy Allison
3cf31a194f Added replacement functions sys_popen and sys_pclose. These are based
on the glibc source code and are safer than the traditional popen as
they don't use a shell to exec the requested command. Now we have
these functions they can be tightened up (environment etc.) as required
to make a safe popen. It should now be safe to add the environement
variable loading code to loadparm.c
Jeremy.
(This used to be commit b52e92b09d)
2000-02-15 19:36:47 +00:00
Andrew Tridgell
dacbb15e9f the beginnings of a fnmatch() based wildcard matching routine
(This used to be commit ef256de9d9)
2000-02-10 13:43:59 +00:00
Andrew Tridgell
94d68eb808 update masktest for new make_nmb_name() syntax
(This used to be commit 3609e835d4)
2000-02-09 14:17:12 +00:00
Andrew Tridgell
74f0d16da4 added masktest to head branch, in preparation for another assault on
the wildcard handling code
(This used to be commit 3f77690dad)
2000-02-09 14:10:08 +00:00
Luke Leighton
bbe275e95b 1) added void* state argument to tdb_traverse. guess what! there were
two places i found where it was appropriate to _use_ that third argument,
in locking.c and brlock.c!  there was a static traverse_function and
i removed the static variable, typecast it to a void*, passed it to
tdb_traverse and re-cast it back to the traverse_function inside the
tdb_traverse function.  this makes the use of tdb_traverse() reentrant,
which is never going to happen, i know, i just don't like to see
statics lying about when there's no need for them.

as i had to do in samba-tng, all uses of tdb_traverse modified to take
the new void* state argument.

2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient.
i don't know how the other samba team members would react if i deleted
rpcclient from cvs main.  damn, that code's so old, it's unreal.
20 rpcclient commands, instead of about 70 in SAMBA_TNG.
(This used to be commit 49d7f0afbc)
2000-02-04 04:59:31 +00:00
Andrew Tridgell
6389b81f9d renamed DENY to DENY1
added DENY2 test that checks all 648 deny combinations for the case
of two opens on the same connection
(This used to be commit 01d4c4784d)
2000-01-16 12:28:43 +00:00
Andrew Tridgell
b09e4c370e use GET_DENY_MODE() macro
(This used to be commit d9c3e0e61f)
2000-01-16 12:27:20 +00:00
Andrew Tridgell
54e1176ba1 added code to allow traversal of the byte range lock database
this is used with "smbstatus -B" to dump the lock list
(This used to be commit 5f02262914)
2000-01-16 11:14:44 +00:00
Andrew Tridgell
1359195c50 casts and defines to make solaris happy
(This used to be commit 77cf152c02)
2000-01-14 08:33:20 +00:00
Andrew Tridgell
82af221e4a we now pass all byte range locking tests
the last piece was to use a smb timeout slightly larger than the
locking timeout in bloking locks to prevent a race
(This used to be commit 1b54cb4a33)
2000-01-14 04:32:57 +00:00
Andrew Tridgell
2afd5d5eb5 some more work on the byte range locking
note the ugly global_smbpid - I hope that won't bethere for long, I
just didn't want to do two lots of major surgery at the one time.
Using global_smbpid avoids the big change of getting rid of our
inbuf/outbuf interface to reply routines. I'll do that once the
locking stuff passes all tests.
(This used to be commit f8bebf91ab)
2000-01-14 00:50:48 +00:00
Andrew Tridgell
cdb8c99fce greatly expanded the lock4 locking test. we now pass all but one test
- that should be fixed soon.
(This used to be commit 23bb936e1f)
2000-01-13 12:11:30 +00:00
Andrew Tridgell
0af00edf67 I'm currently designing a new locking system (using a tdb database!)
that will make us match NT semantics exactly and do away with the
horrible fd multiplexing in smbd.

this is some diag stuff to get me started.

- added the ability to do read or write locks in clientgen.c

- added a LOCK4 test to smbtorture. This produces a report on the server
and its locking capabilities. For example, NT4 gives this:

the same process cannot set overlapping write locks
the same process can set overlapping read locks
a different connection cannot set overlapping write locks
a different connection can set overlapping read locks
a different pid cannot set overlapping write locks
a different pid can set overlapping read locks
the same process can set the same read lock twice
the same process cannot set the same write lock twice
the same process cannot override a read lock with a write lock
the same process can override a write lock with a read lock
a different pid cannot override a write lock with a read lock
the same process cannot coalesce read locks
this server does strict write locking
this server does strict read locking


whereas Samba currently gives this:

the same process can set overlapping write locks
the same process can set overlapping read locks
a different connection cannot set overlapping write locks
a different connection can set overlapping read locks
a different pid can set overlapping write locks
a different pid can set overlapping read locks
the same process can set the same read lock twice
the same process can set the same write lock twice
the same process can override a read lock with a write lock
the same process can override a write lock with a read lock
a different pid can override a write lock with a read lock
the same process can coalesce read locks
this server does strict write locking
this server does strict read locking


win95 gives this - I don't understand why!

the same process cannot set overlapping write locks
the same process cannot set overlapping read locks
a different connection cannot set overlapping write locks
a different connection cannot set overlapping read locks
a different pid cannot set overlapping write locks
a different pid cannot set overlapping read locks
the same process cannot set the same read lock twice
the same process cannot set the same write lock twice
the same process cannot override a read lock with a write lock
the same process cannot override a write lock with a read lock
a different pid cannot override a write lock with a read lock
the same process cannot coalesce read locks
this server does strict write locking
this server does strict read locking
(This used to be commit 49637936b6)
2000-01-10 14:41:20 +00:00
Andrew Tridgell
c01663c1a9 extent smbtorture to test with both an exe file and a dat file
(This used to be commit dd2ce57504)
2000-01-08 11:37:45 +00:00
Andrew Tridgell
e8b5cb4515 cli_open() wasn't handling DENY_FCB or O_WRONLY correctly.
After fixing that I needed to use O_RDWR instead of O_WRONLY in
several places to avoid the silly bug in MS servers that doesn't allow
getattrE on a file opened with O_WRONLY
(This used to be commit e21aa4cb08)
2000-01-08 10:15:53 +00:00
Andrew Tridgell
6ba295ce0b added a DENY test that tests deny mode handling. It produces a matrix
of 324 lines (6*6*3*3) of all possible deny mode behaviour. This
allows us to compare with NT. We currently don't match :)
(This used to be commit 2071105b43)
2000-01-08 09:49:52 +00:00
Andrew Tridgell
171da4d787 this looks like a big commit, but it isn't really :)
This fixes our netbios scope handling. We now have a 'netbios scope' option
in smb.conf and the scope option is removed from make_nmb_name()

this was prompted by a bug in our PDC finding code where it didn't append
the scope to the query of the '*' name.
(This used to be commit b563be824b)
2000-01-07 06:55:36 +00:00
Andrew Tridgell
574788039f added the unexpected packet database (unexpected.tdb)
this means "nmblookup -S" now always works, even with broken servers
the database stores all unexpected replies and these can be accessed
by any client.
while doing this I cleaned up a couple of functions, and put in place
a better trn_id generator. in most places the code got quite a bit
simpler due to the addition of simple helper functions.

I haven't yet put the code in to take advantage of this for pdc
replies - that will be next. Jeremys pdc finding code will then work :)
(This used to be commit 280e6359d3)
2000-01-03 03:17:16 +00:00
Andrew Tridgell
9a781a8c6d - added tdb_flags option to tdb_open()
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the
  first attached process. Useful for non-persistent databases like our
  locking area (this will also make upgrades to new database layouts easier)
- use lock_path() in a couple of places
- leave connections database open while smbd running
- cleaned up some tdb code a little, using macros for constants
(This used to be commit 00e9da3ca5)
2000-01-02 23:00:27 +00:00
Andrew Tridgell
fc4e722127 improved error message in case the lock list is truncated
(This used to be commit f4ecc5a8e3)
1999-12-22 01:36:27 +00:00
Andrew Tridgell
488115dbce changed message is connections.tdb doesn't exist
(This used to be commit 835b9881c0)
1999-12-21 09:33:45 +00:00
Andrew Tridgell
4e1291a83f converted all our existing shared memory code to use a tdb database
instead of either sysv or mmap shared memory or lock files.

this means we can now completely remove
	locking_shm.c
	locking_slow.c
	shmem.c
	shmem_sysv.c
and lots of other things also got simpler

locking.c got a bit larger, but is much better compartmentalised now
(This used to be commit e48c2d9937)
1999-12-21 09:25:59 +00:00
Andrew Tridgell
69d24d869b first cut at using the tdb code for the connections structure, the
SWAT status page and smbstatus. It made the code _much_ simpler, I
wish we'd done a database module a long time ago!
(This used to be commit 4951755413)
1999-12-21 04:54:30 +00:00
Andrew Tridgell
0c4b1ea014 this was left out from the 2.0.6 merge
(This used to be commit 7067aeecab)
1999-12-21 03:05:38 +00:00
Andrew Tridgell
418ba2933f more files from 2.0.6
(This used to be commit 4a20579571)
1999-12-17 01:52:05 +00:00
Andrew Tridgell
32a965e09c 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0
(This used to be commit d7b2087865)
1999-12-13 13:35:20 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00
Luke Leighton
4f8a24522c final part of "first" phase converting over to msrpc daemon architecture.
done a minimal amout of clean-up in the Makefile, removing unnecessary
modules from the link stage.  this is not complete, yet, and will
involve some changes, for example to smbd, to remove dependencies on
the password database API that shouldn't be there.  for example,
smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa
API.

this first implementation has minor problems with not reinstantiating
the same services as the caller.  the "homes" service is a good example.
(This used to be commit caa5052522)
1999-12-12 20:03:42 +00:00
Gerald Carter
12ca139d5c OK. This code works on a RedHat 6.0 system. However smbpasswd
time out of sending the session setup on Solaris 2.6.  No idea.
I'll work on it some tomorrow.  This is to fix the "Unable to
setup password vectors" thingy.

Also changed an inet_aton() to inet_addr() as the former is
not very portable :-)

Luke,  I set the redir flag to false because the connection to
the smb-agent was failing and smbpasswd bombed.  Double check me
on this one.



-jc
(This used to be commit e1d2b174ca)
1999-12-09 07:06:12 +00:00
Luke Leighton
4ab9d91428 ABOUT TIME!!!!!!!!
damn, this one is bad.

started, at least two days ago, to add an authentication mechanism to
the smbd<->msrpc redirector/relay, such that sufficient unix / nt
information could be transferred across the unix socket to do a
become_user() on the other side of the socket.

it is necessary that the msrpc daemon inherit the same unix and nt
credentials as the smbd process from which it was spawned, until
such time as the msrpc daemon receives an authentication request
of its own, whereupon the msrpc daemon is responsible for authenticating
the new credentials and doing yet another become_user() etc sequence.
(This used to be commit 30c7fdd6ef)
1999-12-08 21:43:03 +00:00
Luke Leighton
854f35e20f created create_pipe_socket() function.
(This used to be commit a3af3b4312)
1999-12-05 00:13:17 +00:00
Luke Leighton
ddda7722a6 argh! how horrible! spent ages working out why packets weren't being
received properly when a UDP "retry" occurs.  it's because reads and
writes must be interleaved / matched.

scenario:

nmblookup connects to agent, sends request.

agent receives request, broadcasts it on 137.

agent RECEIVES 137 broadcast, sends it to nmblookup

agent receives RESPONSE to 137 broadcast, sends it to nmblookup.

if reads are not equally interspersed with writes, then second send
will fail.

if you think this is odd behaviour and that the agent should be filtering
its own UDP traffic, think again.

agent will be, potentially, redirecting nmbd traffic (including WINS
server) not just client programs.
(This used to be commit 43e158c426)
1999-12-04 23:40:21 +00:00
Luke Leighton
c41205e28f even more cool! nmb-agent moved over to new vagent style, too!
(This used to be commit 49c157eae4)
1999-12-04 22:05:59 +00:00
Luke Leighton
f6077db317 cool! created higher-order function table for agent redirection.
(This used to be commit 7bb2e55d0d)
1999-12-04 21:55:39 +00:00
Luke Leighton
9b44e117f9 more similar agent code
(This used to be commit 2c778313b8)
1999-12-04 20:43:45 +00:00
Luke Leighton
4503221852 nmb agent memory free problems
(This used to be commit b4306cbf06)
1999-12-04 20:29:03 +00:00
Luke Leighton
409798953d trying to make redirector agent code same base.
(This used to be commit 9ba9df453a)
1999-12-04 20:11:31 +00:00
Luke Leighton
f521205cb3 jeremy is going to hate me for this.
created an "nmb-agent" utility that, yes: it connects to the 137 socket
and accepts unix socket connections which it redirects onto port 137.

it uses the name_trn_id field to filter requests to the correct
location.

name_query() and name_status() are the first victims to use this
feature (by specifying a file descriptor of -1).
(This used to be commit d923bc8da2)
1999-12-04 19:14:37 +00:00
Luke Leighton
8a8a7da518 argh! you wouldn't believe what i had to do: use the mid (multiplex id)
to redirect multiple socket-based connnections onto a single client state.

argh!
(This used to be commit 06390e792c)
1999-12-04 00:49:13 +00:00
Luke Leighton
0ca1f87930 argh! smb-agent redirection client reusage is a nightmare!
moved smb-agent over to a single-process model instead of fork()
in order to reuse client connections.  except, of course, you
can't do a select() on the same socket connections!  argh!
(This used to be commit e9e5a34de8)
1999-12-03 23:36:53 +00:00
Luke Leighton
c2a3b11b07 starting "connection reuse" system in smb-agent. added version number
which isn't actually used right now :-)
(This used to be commit d54a64ae3a)
1999-12-03 22:02:03 +00:00
Luke Leighton
6eebe18fa9 smb-agent improvements. added -D (daemon) option. smb agent is
restricted to connections from the current user (socket is created
with current user uid).
(This used to be commit 5af076e4b7)
1999-12-03 19:55:34 +00:00
Luke Leighton
7d01f964ff cool! a unix socket smb redirector. code based on smbfilter and
ideas from ssh-agent.

the intent is to be able to share smb sessions using cli_net_use_add()
across multiple processes, where one process knows the target server
name, user name and domain, but not the smb password.
(This used to be commit 294b653f2e)
1999-12-03 18:16:08 +00:00
Luke Leighton
86ac6fa938 fixing joining to domain plus something weird going down with nt logins...
(This used to be commit cef258f1c9)
1999-12-01 19:25:51 +00:00
Luke Leighton
6ddfc68e04 sys_select added one more argument (read, write selectors).
(This used to be commit e4d92ff9df)
1999-12-01 02:15:14 +00:00
Luke Leighton
f8b82a7b95 first stages of removing struct cli_state* and uint16 fnum from all
msrpc client code.  the intent is to hide / abstract / associate
connection info behind policy handles.

this makes the msrpc functions look more and more like their nt equivalents.

who-hou!
(This used to be commit c01b18e632)
1999-11-24 20:24:33 +00:00
Luke Leighton
27b8df4d9b attempting to establish inter-domain trust relationships. modified
smbpasswd so it can be used to set up inter-domain trust account.
(This used to be commit 99ec0620c3)
1999-11-20 21:59:16 +00:00
Luke Leighton
d2d6144253 event log update, netsessenum, netconnenum update.
(This used to be commit 819af56074)
1999-08-18 20:33:49 +00:00
Luke Leighton
06b4627df0 patch from Michael Glauche to call get_status_connections() instead of
reading STATUS..LCK direct.
(This used to be commit d794e2eb51)
1999-08-18 00:12:19 +00:00
Matthew Chapman
8f54fdb01a BDC support.
Added -S (Synchronise) option to smbpasswd, which calls synchronise_passdb.
(This used to be commit 21c92d2497)
1999-07-22 10:55:41 +00:00
Luke Leighton
6a5a4e8186 BDC support.
(This used to be commit 2331aa32ab)
1999-07-21 00:32:09 +00:00
Luke Leighton
73891ca8e4 improving authentication code (tidyup).
(This used to be commit ab1a6aa42d)
1999-06-29 18:47:06 +00:00
Luke Leighton
cae3620b2e safe string error reporting functions (found a potential buffer overflow
of a pstrcpy into an fstring).
(This used to be commit ac0060443d)
1999-06-24 18:58:08 +00:00
Luke Leighton
810d9a1627 variation of random SMBtrans2. random delays in between reconnections
increased.  size of large random buffer decreased.  number of reconnection
attempts increased.
(This used to be commit 980a7b11f3)
1999-05-07 20:21:30 +00:00
Luke Leighton
94a4094f44 had to move day display names into lib/util, to get rpctorture to compile.
(This used to be commit 8c80742e4e)
1999-05-07 18:20:59 +00:00
Andrew Tridgell
4c5c9d6734 open_socket_in() takes a different number of parameters in the head
branch. We need that merge soon!
(This used to be commit 5fb06c603e)
1999-04-17 14:13:06 +00:00
Andrew Tridgell
a32c926289 damn, new files need to be added to the head branch first, I've told
other people this before then forgot myself :)
(This used to be commit a116228d37)
1999-04-17 14:06:57 +00:00
Tim Potter
94928d4de7 Modification to compile under egcs 2.91.63.
(This used to be commit d04c530836)
1999-04-11 00:27:43 +00:00
Matthew Chapman
a1d6f07e54 Mainly BDC-related changes.
* Added SEC_CHAN_BDC
* Added -b switch to smbpasswd (for a BDC (server) trust account).
* Propagate sec_chan into the various functions which change trust account
  passwords, so they can be used for domain control and inter-domain
  trusts.
(This used to be commit 6f2b37bfc5)
1999-04-08 05:37:15 +00:00
Andrew Tridgell
d330c907bd Ken McDonell from SGI was interested in adding some profiling
capabilities to Samba so that Samba could talk to the SGI PCP
(Performance Co-Pilot) apps.

This change adds a profiling shared memory area and uses it to count
two fairly trivial things, the number of uid switches and the number
of SMB packets processes. To add more just edit include/profile.h and
then increment it at the right place.

I've also added a -P switch to smbstatus to dump the profile area.
(This used to be commit ef3d61a80a)
1999-04-01 05:22:58 +00:00
Luke Leighton
fda194255c Beau Kuiper: provided patch so that passwords could only be changed by
root if the ACB_PWLOCK bit is set (on a per-user basis).  he also added
an extra smbpasswd option so that this bit can be modified from
command-line.
(This used to be commit 534fe319d9)
1999-03-19 05:00:39 +00:00
Luke Leighton
a3c6e96a22 mods to allow inter-domain trust accounts to be added to SAM database
using smbpasswd command.
(This used to be commit 62d499f832)
1999-03-09 01:21:57 +00:00
Luke Leighton
f02321a998 refinement of random ipc$ SMBtrans torture test. send requests, and
don't wait for responses :-)
(This used to be commit c1d65e9060)
1999-02-11 18:35:26 +00:00
Luke Leighton
8b6b6b57b5 use jeremy's versions of the UNICODE routines.
(This used to be commit c5109ff782)
1999-02-10 22:30:47 +00:00
Christopher R. Hertel
4423c27fe5 Fuss fuss fuss.
Added missing default: statements to two switch blocks.

Chris -)-----
(This used to be commit 0681f6946b)
1999-01-27 18:22:48 +00:00
Luke Leighton
0637d46d60 compilation errors due to addition of smb file handle parameter.
(This used to be commit 03967986ec)
1999-01-27 00:03:31 +00:00
Matthew Chapman
e10503d1a2 Added load_interfaces in smbpasswd to allow name resolution by broadcast and
multiple interfaces. (Jeremy already committed this in SAMBA_2_0).
(This used to be commit f530e289c6)
1999-01-18 01:32:45 +00:00
Christopher R. Hertel
8cb794707b While writing the man page, I realized that it was a bit silly not to accept
command-line parameters.  I've added that capability.  Of course, the man
page is now wrong.  Sigh.

Chris -)-----
(This used to be commit 300a8c9e50)
1998-12-29 20:43:01 +00:00
Christopher R. Hertel
7bf6e4d6a0 Sorry that this is going so slowly.
I've added debug2html to Makefile.in so that it compiles as part of the
normal build.  Fixed a typo in debug2html.c as well.

One problem:  I found it necessary to link with both $(PARAM_OBJ) and
              $(LIB_OBJ).  The result is an executable that is much larger
              than it really needs to be.
(This used to be commit d2d6f0bf36)
1998-12-28 22:34:08 +00:00
Christopher R. Hertel
dc003d8d40 A while back, Andrew and I talked about making the debug parsing code a
better "fit" with other Samba code.  This is a small first step toward
doing what (I think) we agreed to do.

I've moved the key function from ubiqx/debugparse.c into lib/debug.c.  I
have also moved the enum from ubiqx/debugparse.h into the debug section in
smb.h.

The next thing to do is to get debug2html added into the Makefile.in so
that it is always produced when compiling the suite.

Chris -)-----
(This used to be commit 782474f41e)
1998-12-16 18:50:54 +00:00
Luke Leighton
9c848ec329 removed nt_pipe_fnum from struct cli_state. need to be able to call
LsaLookupSids etc from within SamrQueryAliasMembers, for example.
fnum is now a parameter to client functions.  thanks to mike black
for starting the ball rolling.
(This used to be commit bee8f7fa6b)
1998-12-07 20:23:41 +00:00
Luke Leighton
04e382fb16 rpc_samr.h parse_samr.c srv_samr.c :
samr_query_aliasmembers (cool!)

util_pwdb.c sids.c nmbd.c server.c smbpasswd.c swat.c :

	pwdb_initialise(BOOL is_server) now creates / reads DOMAIN_NAME.SID
	if is_server is True, and does LsaQueryInfoPolicy(levels 3 and 5)
	to obtain member and pdc sids.
(This used to be commit 3e1eb4f26b)
1998-12-01 19:10:44 +00:00
Luke Leighton
dc879e9ca7 pwdb_initialise() in the wrong place: must load smb.conf first. thanks phil.
(This used to be commit 4b5bd4e18c)
1998-11-30 19:29:32 +00:00
Luke Leighton
30038de462 weekend work. user / group database API.
- split sam_passwd and smb_passwd into separate higher-order function tables

- renamed struct smb_passwd's "smb_user" to "unix_user".  added "nt_user"
plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd
password databases to fill in the blank entries that are not obtained
from whatever password database API instance is being used.

NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST
be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c
for the only example outside of the password database APIs i could find.

- added query_useraliases code to rpcclient.

- dealt with some nasty interdependencies involving non-smbd programs
and the password database API.  this is still not satisfactorily
resolved completelely, but it's the best i can do for now.

- #ifdef'd out some password database options so that people don't
mistakenly set them unless they recompile to _use_ those options.

lots of debugging done, it's still not finished.  the unix/NT uid/gid
and user-rid/group-rid issues are better, but not perfect.  the "BUILTIN"
domain is still missing: users cannot be added to "BUILTIN" groups yet,
as we only have an "alias" db API and a "group" db API but not "builtin-alias"
db API...
(This used to be commit 5d5d7e4de7)
1998-11-29 20:03:33 +00:00
Luke Leighton
c9b2f20efc fixing domain join and domain login problems
(This used to be commit 90a2466431)
1998-11-25 14:54:23 +00:00
Herb Lewis
735631539c update testparm with -s option so it doesn't require a carriage return
also allow specifying [host hostip] without [configfile]
updated man page
(This used to be commit 85fbd40102)
1998-11-19 21:17:58 +00:00
Jeremy Allison
9579b98237 Added OSF1 changes to HEAD (-lsecurity etc.)
groupdb/groupdb.c: Fixed compile error caught by IRIX compiler.
utils/smbpasswd.c: Fixed SunOS optind, optarg problem.
Jeremy.
(This used to be commit 30af39ae1e)
1998-11-18 22:04:24 +00:00
Jeremy Allison
768761820e Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.
Tidied up some of the mess (no other word for it). Still doesn't
compile cleanly. There are calls with incorrect parameters that
don't seem to be doing the right thing.

This code still needs surgery :-(.

Jeremy.
(This used to be commit 18ff93a9ab)
1998-11-17 20:50:07 +00:00
Luke Leighton
74d539f557 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e609)
1998-11-17 16:19:04 +00:00
Jeremy Allison
f4447df41b Added fixes for machine accounts.
Jeremy.
(This used to be commit 7aa644c2f9)
1998-11-16 20:19:57 +00:00
Andrew Tridgell
2db96e3047 fixes for OSF1 compilation
(This used to be commit 5be3c37f50)
1998-11-13 03:37:01 +00:00
Luke Leighton
31c4953088 sids in rpctorture changed from fstrings to DOM_SID
(This used to be commit bd09e00112)
1998-11-13 01:08:28 +00:00
Herb Lewis
ea2fa33f65 Removed code that used printf/fprintf in password changin libraries.
Now passes strings instead.
(This used to be commit 48af29bcc9)
1998-11-12 23:49:32 +00:00
Jeremy Allison
3a334e3e6c Fixed smbpasswd so that enabling a user who already has a password
doesn't require a new password entry. Sets the 'enable/disable' code
back to being symmetrical.
Jeremy.
(This used to be commit fa068a6db8)
1998-11-12 20:22:11 +00:00
Andrew Tridgell
29e36b7134 extracted the password change code from smbpasswd and used it in swat
instead of opening pipes and other horrible stuff.
(This used to be commit 49bf197103)
1998-11-12 07:06:48 +00:00
Andrew Tridgell
4f368d8b92 char -> uchar fix
(This used to be commit badc0f229a)
1998-11-12 06:24:18 +00:00
Andrew Tridgell
d85dcf86d5 largely rewrote smbpasswd so that the code is understandable. This
should allow us to call a function in swat rather than piping to
smbpasswd.

while doing this I also fixed quite a few "const char *" versus "char *" issues
that cropped up while using const to track down bugs in the code. This
led to changes in several generic functions.

The smbpasswd changes should be correct but they have not been
extensively tested. At least if I have introduced bugs then we should
be able to fix them more easily than before.
(This used to be commit 713864dd03)
1998-11-12 06:12:19 +00:00
Jeremy Allison
375e53826c include/local.h:
include/smb.h:
param/loadparm.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-).
printing/printing.c: Added J.F.'s latest fix.
rpc_parse/parse_misc.c:
parse_reg.c:
rpcclient/cmd_reg.c:
rpcclient/display.c: SGI compiler signed/unsigned issues.
smbd/reply.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-).
utils/testparm.c: Added extra test.
Jeremy.
(This used to be commit 9668a5ef50)
1998-11-10 20:51:25 +00:00
Andrew Tridgell
8c62b28e0e converted smbclient to use clientgen.c rather than clientutil.c
I did this when I saw yet another bug report complaining about
smbclient intermittently missing files. Rather than applying more
patches to smbclient it was better to move to the more robust
clientgen.c code.

The conversion wasn't perfect, I probably lost some features of
smbclient while doing it, but at least smbclient should be consistent
now. It if fails it should _always_ fail rather than giving people the
false impression of a reliable utility.

the tar stuff seems to work, but hasn't had much testing as I never
use it myself. I'm sure someone will find bugs in my conversion of
smbtar.c. It was quite tricky as it did a lot of its own SMB calls. It
now uses clientgen.c exclusively.

smbclient is still quite messy, but at least it doesn't build its own
SMB packets.

I haven't touched smbmount as I never use it. Mike, do you want to
convert smbmount to use clientgen.c?
(This used to be commit e14ca7765a)
1998-11-09 03:45:49 +00:00
Jeremy Allison
548b417d40 codepages/codepage_def.936: Updated comment.
param/loadparm.c: Removed "networkstation user login", "domain controller", and "domain sid" parameters.
passdb/passdb.c: Removed "networkstation user login" code and changed bug test code
                 to only check once for a bad password server. This will stop the
                 complaints of many "bad login" audit records in NT PDC logs.
utils/smbpasswd.c: Removed check for "domain controller".
Jeremy.
(This used to be commit d6e6e936b5)
1998-11-07 05:32:37 +00:00
Jeremy Allison
4bd1feb68c lib/charcnv.c: Improved debug comment.
libsmb/namequery.c: Fix to remove 2 second wait is we are doing a unicast
                    and got a reply.
smbd/dfree.c:
smbd/noquotas.c:
smbd/quotas.c: Fixes from Dejan Ilic <svedja@lysator.liu.se> for the quota
               code.
utils/smbpasswd.c: Fixes to allow smbpasswd to be called from swat.
Jeremy.
(This used to be commit b5981c0149)
1998-11-06 18:40:51 +00:00
Andrew Tridgell
fa164d91bd check return value of locking_init()
(This used to be commit 0efac70f75)
1998-11-05 12:40:37 +00:00
Jeremy Allison
5f4c35ab21 Added scripting option (-s) to smbpasswd.
Jeremy.
(This used to be commit 4f87a8cf99)
1998-11-04 00:57:00 +00:00
Jeremy Allison
01e04614c7 Makefile.in configure configure.in include/proto.h smbd/noquotas.c smbd/quotas.c:
Added quotas patch for autoconf from Dejan Ilic <svedja@lysator.liu.se>.
printing/printing.c: Filenames with spaces patch from Allan Bjorklund <allan@umich.edu>
utils/nmblookup.c: Fix usage() function.
smbd/reply.c: Split out the security=server and security=domain checks into
              check_server_security() and check_domain_security() to aid the
              writing of the 'hack' appliance mode invented by John Schimmel.
Jeremy.
(This used to be commit f09ab9b522)
1998-11-03 02:25:28 +00:00
Jeremy Allison
8851d1a150 Fix suggested by Nicholas.S.Jenkins@cdc.com - connect to the
password change server as anonymous - you don't need to have
logged on as the user to do the password change. Doh ! (Why
didn't *I* think of that one.... :-).
Jeremy.
(This used to be commit dd3bb250a6)
1998-10-30 23:53:04 +00:00
Christopher R. Hertel
f97ceef7ec I've moved the debugparse module files into the ubiqx directory because I
know that 'make proto' will ignore them there.  The debugparse.h header
file is included in includes.h, and includes.h is included in debugparse.c,
so all of the pieces "see" each other.  I've compiled and tested this,
and it does seem to work.  It's the same compromise model I used when
adding the ubiqx modules into the system, which is why I put it all into
the same directory.

Chris -)-----
(This used to be commit b6888faacd)
1998-10-28 20:33:35 +00:00
Christopher R. Hertel
e04759fbab Fixed a small bug in debug2html. It wasn't properly checking EOF. The
current status is "it works".  I need to add some syntax error recovery
and a usage message.  Basic stuff.

I've also modified Makefile.in.  If you want to compile it you'll have to
do a 'make debug2html', as I used smbtorture as a model.  We can decide
later if this tool is useful enough to be compiled always.

BTW, a 'make realclean' fails because the bin directory isn't empty.
That's because it doesn't delete optionally compiled files such as
smbtorture and debug2html (and because of the CVS subdirectory, but I
think that's only a problem for developers).

Chris -)-----
(This used to be commit e86fd87a38)
1998-10-27 23:28:29 +00:00
Christopher R. Hertel
ba91cb69be Here is the simple debug parser and the debug2html converter. Still to do:
* Debug message filtering.
  * I need to add all this to Makefile.in
    (If it looks at all strange I'll ask for help.)

If you want to compile debug2html, you'll need to do it by hand until I
make the changes to Makefile.in.  Sorry.

Chris -)-----
(This used to be commit fae161b905)
1998-10-26 23:21:37 +00:00
Andrew Tridgell
fb556e14f3 volker was concerned about unique inode numbers and smbsh. This set of
changes uses the unique index number from a SMB_QUERY_FILE_ALL_INFO to
try to provide inode numbers. If it is 0 then use the hash of the
filename as before.
(This used to be commit 2565ccf9de)
1998-10-24 08:08:05 +00:00
Luke Leighton
95056761c8 torture debug.
(This used to be commit 9760959664)
1998-10-22 23:05:55 +00:00
Luke Leighton
f0d3a44ffa enumeration tests (files, sessions, shares, connections).
hey, you can see how many connections succeed while the rpctorture
command is running!
(This used to be commit c1bf8f1099)
1998-10-22 22:54:00 +00:00
Luke Leighton
a0512ce5ff rpctorture command
(This used to be commit b4ae65e2d0)
1998-10-22 22:19:08 +00:00
Andrew Tridgell
e4678f5d1d fixed a connection bug in torture test
(This used to be commit 2b892130df)
1998-10-20 06:46:25 +00:00
Andrew Tridgell
bad4e66489 added maxfid test
(This used to be commit 710027a88a)
1998-10-16 23:08:10 +00:00
Andrew Tridgell
bc747b8a07 set recursion desired for bcast name query
(This used to be commit 53805112f1)
1998-10-14 16:45:24 +00:00
Luke Leighton
6909350ed9 dce/rpc
(This used to be commit 62fdeef1b7)
1998-10-08 23:57:46 +00:00
Andrew Tridgell
a813f38e2d - don't generate 0 params in torture
- handle 0 params in ipc.c
(This used to be commit c0dc8e87f0)
1998-10-08 06:49:00 +00:00
Andrew Tridgell
788263ba2f - fixed a bunch of warnings and minor errors
- got smbtorture to compile
- removed %D from some of lukes code - Luke, what is %D? it ain't
  portable anyway
(This used to be commit 91597c12fb)
1998-10-08 06:21:33 +00:00
Andrew Tridgell
4750ce1760 use 1 second resolution calls if possible
(This used to be commit 349469221a)
1998-10-08 02:28:21 +00:00
Andrew Tridgell
40984f6b55 - modified resolve_name() to take a name_type
- cleaned up resolve_name() (split into separate functions for each resolver)
- if can't find local master then use #1B name
- support listing of foreign workgroups in /smb/
(This used to be commit a4e607c17d)
1998-10-04 12:00:40 +00:00
Andrew Tridgell
f651787785 added lseek() support for directories
(This used to be commit 67ca971b0b)
1998-10-03 12:33:34 +00:00
Luke Leighton
bdbc959a9a - static function "create_new_hashes" was identical to "nt_lm_owf_gen".
create_new_hashes didn't zero the buffer for the md4hash: nt_lm_owf_gen
  did, because jeremy sorted this out a couple of days ago.  call
  nt_lm_owf_gen instead.

- call SMBOWFencrypt from SMBencrypt and SMBNTencrypt.

- added #ifdef DEBUG_PASSWORD debug password calls.
(This used to be commit a4e7cc3e46)
1998-10-02 18:45:07 +00:00
Andrew Tridgell
495eedb14f some changes in smbtorture as a result of clientgen interface changes
for smbwrapper

note that Lukes client changes broke smbtorture. This doesn't fix it,
but at least I didn't break it more than it was.
(This used to be commit 252b52091c)
1998-10-02 12:38:45 +00:00
Jeremy Allison
008fd97309 Fixed problems found in lint pass over the old code by <cpeterso@microsoft.com>.
These were the problems that still existed in the 2.0 branch.
Jeremy.
(This used to be commit 3fd28812f7)
1998-09-28 23:55:09 +00:00
Jeremy Allison
cf3a9741dc Changes to test in configure if capabilities are enabled on a system.
Changes to get Samba to compile cleanly with the IRIX compiler
with the options : -fullwarn -woff 1209,1174 (the -woff options
are to turn off warnings about unused function parameters and
controlling loop expressions being constants).
Split prototype generation as we hit a limit in IRIX nawk.
Removed "." code in smbd/filename.c (yet again :-).
Jeremy.
(This used to be commit e0567433bd)
1998-09-28 21:43:48 +00:00
Alexandre Oliva
cf971f88ac automated generation of .dummy files for each subdirectory;
dummy.in files are no longer needed, and new directories will be taken
care of automatically, at configure (or config.status --recheck) time
(This used to be commit 237a8e5fe6)
1998-09-28 00:14:36 +00:00
Richard Sharpe
ecd8ca2431 Fixed up more possibly uninitialized variables.
Now only two compilation warnings seem to be left.

Luke may want to check the changes I made.
(This used to be commit 2456c95c16)
1998-09-27 08:29:50 +00:00
Jeremy Allison
5f7ee36056 Makefile.in: Fixed bug with continuation line causing proto to fail.
Added $(PROGS) $(SPROGS) as targets for make clean.
acconfig.h: Added HAVE_IRIX_SPECIFIC_CAPABILITIES.
configure.in: Added sys/capability.h header check.
              Added function checks for srandom random srand rand.
              Added HAVE_IRIX_SPECIFIC_CAPABILITIES test.
includes.h: Added #include <sys/capability.h>.
ntdomain.h: Moved struct acct_info into here from smb.h
smb.h: Added KERNEL_OPLOCK_CAPABILITY define.
       Moved enum action_type into rpcclient.h
       Moved struct cli_state into client.h
       Moved struct nt_client_info, struct tar_client_info, struct client_info
             into rpcclient.h
lib/genrand.c: Changed to use sys_random() & friends.
lib/smbrun.c: Lose capabilities after fork.
lib/system.c: Added set_process_capability(), set_inherited_process_capability()
              sys_random(), sys_srandom().
lib/util.c: Added Ander's EFBIG lock check to fcntl_lock for 64 bit access to an
            32 bit mounted NFS filesystem.
nmbd/nmbd.c: Changed to use sys_random() & friends.
nmbd/nmbd_browsesync.c: Changed to use sys_random() & friends.
passdb/ldap.c: Missed one pdb_encode_acct_ctrl call.
passdb/passdb.c: Changed to Ander's code for ' ' characters.
passdb/smbpass.c: Added Ander's code to reset ACB_PWNOTREQ.
script/mkproto.awk: Added 'long' to prototypes.
smbd/chgpasswd.c: Lose capabilities after fork.
smbd/open.c: Do the mmap *after* the kernel oplock.
smbd/oplock.c: Removed stub code from kernel oplock path.
               Added set_process_capability(), set_inherited_process_capability() calls.
smbd/reply.c: Initialize count = 0, offset = 0.
smbd/server.c: Added set_process_capability(), set_inherited_process_capability() calls.
tests/summary.c: Ensure we have RANDOM or RAND.
utils/smbpasswd.c: Added Ander's code to reset ACB_PWNOTREQ.
utils/torture.c: Changed to use sys_random() & friends.

Jeremy.
(This used to be commit e8be306f23)
1998-09-25 23:40:49 +00:00
Luke Leighton
ff07b2e4a3 added wksinfo command to rpcclient, which don't work too good.
(This used to be commit 8d23da91cb)
1998-09-25 21:20:37 +00:00
Luke Leighton
66d5d73a5d added rpcclient program
(This used to be commit aa38f39d67)
1998-09-25 21:01:52 +00:00
Jeremy Allison
dc36d8768a Integration of Anders Blomdell <anders.blomdell@control.lth.se>'s
smbpasswd changes. Not exactly the same as his code - several
changes.
Jeremy.
(This used to be commit e96747a8e3)
1998-09-24 22:33:13 +00:00
Alexandre Oliva
e649750cb4 major autoconf clean-up
fix problems in builds with srcdir!=builddir
(This used to be commit 1ffc3b807a)
1998-09-21 09:07:08 +00:00
Andrew Tridgell
f6044c87c0 some cleanups to use ZERO_STRUCT() and friends
(This used to be commit 7b154dc431)
1998-09-05 13:24:20 +00:00
Andrew Tridgell
e9ea36e4d2 tridge the destroyer returns!
prompted by the interpret_security() dead code that Jean-Francois
pointed out I added a make target "finddead" that finds potentially
dead (ie. unused) code. It spat out 304 function names ...

I went through these are deleted many of them, making others static
(finddead also reports functions that are used only in the local
file).

in doing this I have almost certainly deleted some useful code. I may
have even prevented compilation with some compile options. I
apologise. I decided it was better to get rid of this code now and add
back the one or two functions that are needed than to keep all this
baggage.

So, if I have done a bit too much "destroying" then let me know. Keep
the swearing to a minimum :)

One bit I didn't do is the ubibt code. Chris, can you look at that?
Heaps of unused functions there. Can they be made static?
(This used to be commit 2204475c87)
1998-09-05 05:07:05 +00:00
Jeremy Allison
7bb86c1b13 Ok - this is the 64 bit widening check in. It changes the configure
to check for stat64 and friends, and then changes much of Samba
to use the data type SMB_OFF_T for file size information.

stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide
the 64 bit calls if needed.

Note that this still does not expose 64 bit functionality to the
client, as the changes to the reply_xxx smb's are not yet done.

This code change should make these changes possible.

Still to do before full 64 bit-ness to the client:

fcntl lock code.
statfs code
widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T
types being in place).

Let me know if wierd things happen after this check-in and I'll
fix them :-).

Jeremy.
(This used to be commit 14500936c3)
1998-09-03 18:40:31 +00:00
Jeremy Allison
1855627413 More abstraction of file system data types, to move to a 64
bit file interface for the NT SMB's.

Created a new define, SMB_STRUCT_STAT that currently is
defined to be struct stat - this wil change to a user
defined type containing 64 bit info when the correct
wrappers are written for 64 bit stat(), fstat() and lstat()
calls.

Also changed all sys_xxxx() calls that were previously just
wrappers to the same call prefixed by a dos_to_unix() call
into dos_xxxx() calls. This makes it explicit when a pathname
translation is being done, and when it is not.

Now, all sys_xxx() calls are meant to be wrappers to mask
OS differences, and not silently converting filenames on
the fly.

Jeremy.
(This used to be commit 28aa182dbf)
1998-09-01 20:11:54 +00:00
Andrew Tridgell
61b5fd6f32 bounds check next_token() to prevent possible buffer overflows
(This used to be commit 3eade55dc7)
1998-08-31 03:11:42 +00:00
Andrew Tridgell
085c66aea5 some smbtorture hacks (random IPC calls)
(This used to be commit b32a346a1c)
1998-08-25 06:42:09 +00:00
Andrew Tridgell
1a5a571b41 and get the message right ...
(This used to be commit 0d641d0ceb)
1998-08-21 07:29:42 +00:00
Andrew Tridgell
cc32fc2af0 silly me.
perms on lock dir should be 755 not 644.
(This used to be commit 930a4292e9)
1998-08-21 07:25:57 +00:00
Andrew Tridgell
852519282d testparm now prints a warning if the lock directory doesn't have 0644
permissions.
(This used to be commit 10303a78d4)
1998-08-20 03:11:46 +00:00
Andrew Tridgell
127655cc88 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.
(This used to be commit b088c804f9)
1998-08-15 07:27:34 +00:00
Jeremy Allison
e13aeea928 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.
(This used to be commit 1b9cbcd02e)
1998-08-15 01:19:26 +00:00
Andrew Tridgell
b9623ab59e 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.
(This used to be commit c7ee025ead)
1998-08-14 17:38:29 +00:00
Herb Lewis
b6808ed8b2 return to old behaviour of dumping ALL parameters
(This used to be commit aa5648ce83)
1998-08-13 16:32:20 +00:00
Andrew Tridgell
65a29b0ca5 the rest of the binaries now compile and link
(This used to be commit 7fecc3d5a2)
1998-08-10 01:25:32 +00:00
Andrew Tridgell
59e2e2c7d8 a few more things compile.
I'll do the rest tomorrow.
(This used to be commit b92ce41c54)
1998-08-09 14:58:51 +00:00
Andrew Tridgell
64578c0589 merge from the autoconf2 branch to the main branch
(This used to be commit 3bda7ac417)
1998-07-29 03:08:05 +00:00
Richard Sharpe
981e1b0f7e Updates smbstatus to have a -S and -L flag.
Also updated the documentation :-)

The code is ugly, we need to rewrite smbstatus someday.
(This used to be commit a2a9f55a76)
1998-07-24 01:08:31 +00:00
Jeremy Allison
f5866fd4ba Fixed bug found by Richard Sharpe. After increasing files_struct size by
MAX_OPEN_DIRECTORIES for nttrans I forgot to update the code that
enumerates the array.
Created new MAX_FNUMS in local.h, changed all code that iterates
through the files_struct array to use this.
(sorry Richard).
Jeremy.
(This used to be commit 339b102222)
1998-07-22 13:59:19 +00:00
Jeremy Allison
59d07445b6 loadparm.c:
With apologies to Charlton Heston and Pierre Boule.

    "You damn fools, you finally did it".

    Changed default security mode to be security=user.
    Yes this is a big (although small in code) change.
    It's something we've been discussing for a while, to
    finally wean people off the legacy security=share mode
    which is *never* what you want.

    Jeremy.

nmbd_incomingrequests.c: Bug fix for nmbd core dumps caused by overrun.
                         Found by <samuel@public.szonline.net>.
nttrans.c: More NT smb stuff.
reply.c: Unlink will overwrite an existing file. Well you learn
         something new about POSIX every day. :-).
server.c: Tidyup unreadable code.
smbpasswd.c: Code to allow -U remote_username to allow ordinary
             users to change remote passwords if their NT username
             is different from their UNIX username.
             Patch from <torbjorn.lindh@allgon.se>.

Jeremy.
(This used to be commit 4eccb47cfb)
1998-07-14 21:23:59 +00:00
Paul Blackman
c069bd8eea This change ensures that only the processes/locked files that
belong to -uUsername are printed when running 'smbstatus -uUsername'
PaulB
(This used to be commit da08e48687)
1998-05-30 02:25:11 +00:00
Jeremy Allison
9bd7e1e887 loadparm.c: Added machine password timeout parameter - set to 7 days be default.
password.c: Added code to tell server.c when machine password needs changing.
server.c: Change machine password in idle cycles if it needs it.
smbpassfile.c: Fixed up length calculations for machine password file.
smbpasswd.c: Moved domain joining code/machine password changing code.
lib/rpc/client/cli_netlogon.c: And this is where it now lives.
Jeremy.
(This used to be commit b8fedca619)
1998-05-27 00:30:52 +00:00
Jeremy Allison
d1d010a995 Put a do_global_tests() function that will be expanded to
test all the heuristics we know about for validating smb.conf
file.
Jeremy.
(This used to be commit 76dec5b04e)
1998-05-22 01:51:14 +00:00
Jeremy Allison
118827376f Abstracted all the crappy password interfaces through an indirect
function table, selectable at compile time. This should make the
code that implements all the password functions much cleaner, as
it's now very clear exactly what a particular password database
needs to provide to Samba.
Jeremy.
(This used to be commit 27ca536ad9)
1998-05-18 23:57:28 +00:00
Jeremy Allison
ffab54750f chgpasswd.c: Changed back to getsmb... from getsam...
ldap.c: Stoped dummy_function being prototyped.
loadparm.c: Fixed slprintf sizes.
nisppass.c: Fixed safe_strcpy sizes.
nmbd_processlogon.c: Changed back to getsmb... from getsam...
nttrans.c: Just a dump of new code.
passdb.c: Moved stuff around a lot - stopped any lookups by rid. This
          needs to be indirected through a function table (soon).
password.c: Changed back to getsmb... from getsam...
reply.c: Changed back to getsmb... from getsam...
slprintf.c: Fixed prototype problems.
smb.h: Fixed prototype problems.
smbpass.c: Changed to getsmbfile....
smbpasswd.c: Changed back to getsmb... from getsam...
lib/rpc/server/srv_netlog.c: Changed back to getsmb... from getsam...
lib/rpc/server/srv_samr.c: Fixed rid lookup - use uid or gid lookup.
lib/rpc/server/srv_util.c: Changed back to getsmb... from getsam...
Jeremy.
(This used to be commit 7d332b2493)
1998-05-18 21:30:57 +00:00
Jeremy Allison
94a39bd9a2 Change getpwnam to Get_Pwnam(xx , True) to allow lazy matching
in /etc/passwd. Fix from "Mike Black" <mblack@csihq.com>.
Jeremy.
(This used to be commit 0146883f85)
1998-05-15 23:10:46 +00:00
Jeremy Allison
ee9a61841a includes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don't
have vsnprintf.
locking_slow.c: slight tidy.
make_smbcodepage.c: Use safe_strcpy instead of pstrcpy.
nmbd_winsserver.c: Use pstrcpy instead of fstrcpy.
smbmount.c: Fixed reported bug.
util.c: Removed old fstrcpy/fstrcat functions.
Jeremy.
(This used to be commit f257d2e4ba)
1998-05-12 22:11:24 +00:00
Jeremy Allison
f888868f46 This is a security audit change of the main source.
It removed all ocurrences of the following functions :

sprintf
strcpy
strcat

The replacements are slprintf, safe_strcpy and safe_strcat.

It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.

Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.

Jeremy.
(This used to be commit 2d77445400)
1998-05-12 00:55:32 +00:00
Jeremy Allison
05eb22f77c reply.c: Added code to not overwrite sesssetup_user when in share level security
and null session setup done.
smbpasswd.c: Fix from Gerald Carter <cartegw@Eng.Auburn.EDU> to fix incorrect
             use of pointer.
Jeremy.
(This used to be commit 69ace07609)
1998-05-11 17:53:37 +00:00
Luke Leighton
f004d84f68 ldap back-end database development
Makefile:

	created PASSBD_OBJ group

includes.h:

	added #ifdef USE_LDAP to #include <ldap> headers

ldap.c:

	- renamed "_machine" to "_trust" everywhere.
	- added sam_passwd support routines
	- removed get_ldappwd_entry function: replaced with get_sampwd_entry
	- removed getldappwnam/uid: replaced with getsampwnam/uid
	- other messing about bits which are probably going to annoy the
	  hell out of jean-francois (sorry!)

mkproto.awk:

	- added stuff to wrap ldap.c protos with #ifdef USE_LDAP
	- added uid_t and gid_t return results to the prototype generation

passdb.c:

	- created getsam21pwent, add_sam21pwd_entry, mod_sam21pwd_entry.
	- modified getsampwnam/uid and created getsam21pwnam/rid functions
	  to replace the local get_smbpwd_entry() and get_ldappwd_entry()
	  functions, which jeremy didn't like anyway because they were
	  dual-purpose.
	- added utility routines which are or may be useful to all the
	  password database routines.

password.c:

	- renamed "machine_" to "trust_" everywhere.

smbpass.c:

	- removed get_smbpwd_entry function: replaced it with get_sampwd_entry
	  functions in passdb.c
	- moved code that decoded acct_ctrl into passdb.c
	- moved encode_acct_ctrl into passdb.c
	- removed getsmbpwnam/uid: replaced with getsampwnam/uid
	- renamed "machine_" to "trust_" everywhere.

smbpasswd.c:

	- renamed "machine_" to "trust_" everywhere.

util.c:

	- moved gethexpwd function into passdb.c

lib/rpc/server/srv_util.c:

	- moved user_rid_to_uid, group_rid_to_rid etc etc into passdb.c
(This used to be commit 673ab50c4c)
1998-05-11 15:56:01 +00:00
Andrew Tridgell
3dfc0c8472 changed to use slprintf() instead of sprintf() just about
everywhere. I've implemented slprintf() as a bounds checked sprintf()
using mprotect() and a non-writeable page.

This should prevent any sprintf based security holes.
(This used to be commit ee09e9dadb)
1998-05-11 06:38:36 +00:00
Luke Leighton
b543829dfc moving gethexpwd into util.c, because it's used in both smbpass.c and ldap.c
(This used to be commit abe261b2f5)
1998-05-07 19:59:32 +00:00
Jeremy Allison
51f88b4f7c Fixed changed calls to machine password locking code.
Jeremy.
(This used to be commit dfdc9b0b1e)
1998-05-07 02:06:53 +00:00
Jeremy Allison
3eae1e3f8e Added patch from Bruce Tenison <btenison@dibbs.net> to allow encrypted
passwords to be stored over time, allowing a smbpasswd file migration.
Adds new parameter "update encrypted".
Will also add to 1.9.18 branch.
Docs update to follow.
Jeremy.
(This used to be commit 5d3e874d78)
1998-04-30 01:39:22 +00:00
Jeremy Allison
90177708aa Makefile: Added files to smbpasswd.c.
loadparm.c: Patch from tim@quiknet.com for static string problems.
server.c: Setup global_myname.
smbpass.c: Fix up locking. Add machine_password_delete() call.
smbpasswd.c: Added provisional code to add to a domain.
lib/rpc/client/cli_login.c: Fixed incorrect cred_hash3 call when setting machine password.
lib/rpc/server/srv_netlog.c: Fixed incorrect cred_hash3 call when setting machine password.
Jeremy.
(This used to be commit 6a7164233e)
1998-04-29 22:27:26 +00:00
Jeremy Allison
e7ac86607c This looks like a big change but really isn't.
It is changing the global variables "myname" and "myworkgroup"
to "global_myname" and "global_myworkgroup" respectively.

This is to make it very explicit when we are messing
with a global (don't ask - it makes the domain client
code much clearer :-).

Jeremy.
(This used to be commit 866406bfe3)
1998-04-25 01:12:08 +00:00
Jeremy Allison
002a47de8e clientgen.c: Added rap error codes to cli_error, moved from smbpasswd.c
password.c: Changed global cli -> pw_cli, removed strtok (bad strtok, bad :-)
use in security=server, started to extend security=domain code.
smbpasswd.c: Removed rap error code functions.
Jeremy.
(This used to be commit 0f00b8fce1)
1998-04-23 20:12:17 +00:00
Jeremy Allison
6733e2b36e includes.h: Added John's redhat fix for QSORT_CAST.
smbpass.c: Added lock depth code so calls to pw_file_lock() can be nested.
           Fixed codedump problems in add_smbpwd_entry().
smbpasswd.c: Removed all the code that manipulated the password file
             directly. Now *all* smbpasswd file changes are done through
             the interfaces defined in smbpass.c This should make
             the life of people adding alternate backend databases
             *much* easier.
lib/rpc/server/srv_netlog.c: Removed debug messages used to debug
                             machine password changing.
Jeremy.
(This used to be commit c9f61be08f)
1998-04-18 02:00:39 +00:00
Jeremy Allison
f9a96f060b clientgen.c: Changes 'cli_xxx_' calls to use the following
regularized parameter syntax:

   setup, setup_count, max_setup_count,
   params, params_count, max_params_count,
   data, data_count, max_data_count,

(and if a reply is needed)

   *reply_params, *reply_data_len
   *reply_data, *reply_data_len

This allows the pointers and the lengths
that relate to these pointers to be next
to each other in the parameter list. This
makes seeing what you are passing to these
functions much easier to see.

Getting ready for adding the lib/rpc/client
functions needed to do security=domain.

torture.c: Fixed it so it uses / rather than \\
internally for the //machine/share syntax.

Jeremy.
(This used to be commit 38350ea8b9)
1998-04-17 22:44:01 +00:00
Jeremy Allison
373d7c6257 Changing of machine passwords now works !!!!!!
smbdes.c: Added cred_hash3.
smbpasswd.c: Fixes for adding a machine account (needs more work).
lib/rpc/server/srv_netlog.c: Turn on the machine password changing
code by default (calls cred_hash3).
Jeremy.
(This used to be commit 50aa513b96)
1998-04-17 19:29:51 +00:00
Jeremy Allison
041a292c43 ipc.c: Fix for printer queue spinning with Win95.
nmbd.c: Fix for always overwriting log despite append setting.
smb.h: Addition of last time password changed entry to account info.
smbpass.c: Changes to support last time changed field in smbpasswd file.
smbpasswd.c: Changes to support last time changed field in smbpasswd file.
util.c: Fix for always overwriting log despite append setting.
Jeremy.
(This used to be commit eb4fe9ecdf)
1998-04-15 20:00:41 +00:00
Jeremy Allison
2a53d6f707 Modified interfaces to getting smb password entries from
get_smbpwd_entry (now an internal function to smbpass.c)
to a more UNIX-like :

getsmbpwnam() - get entry by name.
getsmbpwuid() - get entry by uid.

Changed the type returned by the smbpasswd enumeration
functions to be a void * so that people don't come to
depend on it being a FILE *.

These abstractions should make it much easier to
replace the smbpasswd file with a better backend
in future.

Other files changed are to match the above changes.

Jeremy.
(This used to be commit 1161cfb7f2)
1998-04-14 00:41:59 +00:00
Jeremy Allison
cac6a060af Changes to allow Samba to be compiled with -Wstrict-prototypes
with gcc. (Not a big change although it looks like it :-).

Jeremy.
(This used to be commit cd2613c572)
1998-04-13 19:24:06 +00:00
Andrew Tridgell
fc9065b360 some hacks to the torture code
(This used to be commit 02786747ee)
1998-04-12 02:53:17 +00:00
Jeremy Allison
af80d8e98f Makefile, loadparm.c, server.c, smb.h, util.c: Patch from
stn@techfak.uni-kiel.de (Stefan Nehlsen) to get homes from
the NIS+ map.
smbpasswd.c: Tidy up of cli_state structure.
Jeremy.
(This used to be commit fc2295e0f5)
1998-04-09 20:48:48 +00:00
Jeremy Allison
db55744684 Added check for getpwnam returning NULL.
Jeremy.
(This used to be commit 81cbfaacb1)
1998-04-07 17:44:02 +00:00
Jeremy Allison
852dc76c60 Added extra remote password changing error codes from lmerr.h on NT.
Jeremy.
(This used to be commit 38391b51cd)
1998-03-30 20:12:12 +00:00
Jeremy Allison
6cd35ce945 client.c: Fixed problem where debug level on command line was overridden by smb.conf.
smbpasswd.c: Removed bugs I put in yesterday (thanks Luke :-) and added error
message reporting for remote password changing.
Jeremy.
(This used to be commit 6a3394a285)
1998-03-26 19:11:31 +00:00
Jeremy Allison
039761b05c Added the ability to differentiate between workstation and server
accounts when adding machine account types.
Jeremy.
(This used to be commit a402b5070f)
1998-03-26 02:22:08 +00:00
Jeremy Allison
1edcbd31fc smbpass.c: Made unknown accounts ending in '$' server accounts, not
workstation.
smbpasswd.c: Added code to count down from last machine account
to add correct uid when adding a machine account.
Jeremy.
(This used to be commit 0601a41993)
1998-03-26 02:14:40 +00:00
Jeremy Allison
8c5c093b96 Added writing of '[XXX]' account control bits into gcos
field when adding a user via smbpasswd.
Jeremy.
(This used to be commit 607c64fadb)
1998-03-24 21:44:49 +00:00
Jeremy Allison
242e7ae4d6 Updated smbpasswd to allow root to add machine accounts, and allow
root to disable users and set them to "NO PASSWORD".
Not quite finished with machine account stuff yet, but everything
compiles.
Jeremy.
(This used to be commit c66966ff00)
1998-03-24 21:04:36 +00:00
Jeremy Allison
5d7c8375e4 clientgen.c ipc.c smbpasswd.c: Fixes for warnings (from Herb).
quotas.c: Linux quota fix.
util.c: Ensure smb_read_error is zero in all calls that can set it.
lib/rpc/include/rpc_misc.h lib/rpc/include/rpc_netlogon.h
lib/rpc/parse/parse_misc.c lib/rpc/parse/parse_net.c
lib/rpc/server/srv_netlog.c : Modify Luke's code to call
SamOEMhash().

Jeremy.
(This used to be commit 7f74970838)
1998-03-24 00:37:53 +00:00
Andrew Tridgell
93b3c58136 - added a check for broken RH5 include files. With the standard RH5
includes (ie. unpatched RH5) Samba gets file corruption because of the
incorrect definition of the shmid_ds structure. Updating your RH5
installation of glibc-devel fixes this.

- don't try to fcntl_lock() a read-only fd in shmem.c

- allow level 0 debug messages to get through in smbstatus
(This used to be commit 45553771f9)
1998-03-22 01:31:50 +00:00
Jeremy Allison
7abbf368f9 Adding the same changes to HEAD as were added to BRANCH_1_9_18.
Changed smbpasswd to be client-server for a normal user, rather
than accessing the private/smbpasswd file directly (it still accesses
this file directly when run as root, so root can add users/change a
users password without knowing the old password).

A shakeout of this change is that smbpasswd can now be used to
change a users password on a remote NT machine (yep - you heard
that one right - we can now change a NT password from UNIX !!!!!).

Jeremy.
(This used to be commit 20770b6f1c)
1998-03-19 20:06:47 +00:00
Andrew Tridgell
59d7006b05 - added "Full View"/"Normal View" on the "view config" page
- added the ability to auto-refresh the status page. There is a
  problem with this (it can kill inetd!). Hopefully we can fix that.
(This used to be commit 4488d8932f)
1998-03-17 11:44:16 +00:00
Andrew Tridgell
d360320618 - added the ability to kill off individual connections from SWAT (from
the status page)
- split the claim_connection() code into its own file
- fixed the claim_connection() code to lock the file when manipulating
  it
- always claim a null connection at startup
- fixed a bug in the pidfile code
(This used to be commit abd4a17e21)
1998-03-15 02:37:52 +00:00
Andrew Tridgell
b85346942e another makeover of loadparm to support new stuff in swat and
testparm.

In particular I added:

- ability to optionally save default values of all parameters when
  calling lp_load(). This can then be used to save only non-default
  parameters in lp_dump(). This makes the saved smb.conf (and viewed
  parameters in testparm) much shorter

- ability to not load ipc share in lp_load()

- separators in parm_table[] so parameters can be grouped logically.

- flag to mark parameters that are local but which should be also
  viewed as global as far as parameters editing is concerned
(This used to be commit f9af35da26)
1998-03-14 08:27:41 +00:00
Jeremy Allison
fdeea341ed "For I have laboured mightily on Luke's code, and hath broken
all I saw" - the book of Jeremy, chapter 1 :-).

So here is the mega-merge of the NTDOM branch server code.
It doesn't include the new client side pieces, we'll look
at that later.

This should give the same functionality, server wise, as
the NTDOM branch does, only merged into the main branch.

Any fixes to domain controler functionality should be
added to the main branch, not the NTDOM branch.

This code compiles without warnings on gcc2.8, but will
need further testing before we are sure all the working
functionality of the NTDOM server branch has been
correctly carried over.

I hereby declare the server side of the NTDOM branch
dead (and all who sail in her :-).

Jeremy.
(This used to be commit 118ba4d77a)
1998-03-11 21:11:04 +00:00
Herb Lewis
4c6230afd2 fix core dumps on Solaris 2.5 systems found by Orn Asgeirsson
(This used to be commit bafc776892)
1998-03-11 17:44:27 +00:00
Jeremy Allison
834ef56244 nmbd_incomingdgrams.c: Fix for typo.
nmbd_sendannounce.c: Remote announcement was announcing to the wrong name !
nmblookup.c: Fix for substitutions not seeing hostname.
testparm.c: Fix for substitutions not seeing hostname.
wsmbstatus.c: Fix for substitutions not seeing hostname.
util.c: Change read_udp_socket to use sockaddr_in rather than dubiously
messing around with an opaque data type (sockaddr).
Jeremy.
(This used to be commit 776ccf5c06)
1998-02-24 17:59:34 +00:00
Jeremy Allison
46c795da5d Fixed warnings with gcc (assignments inside if statements).
Jeremy.
(This used to be commit 1a9e25d3bc)
1998-01-23 08:35:15 +00:00
Herb Lewis
458a678fd2 changes to correctly use some HP printer inf files
(This used to be commit ab894c3e1d)
1998-01-23 07:59:29 +00:00
Jeremy Allison
55f400bd84 This is *not* a big change (although it looks like one).
This is merely updating the Copyright statements from 1997 to 1998.
It's a once a year thing :-).
NO OTHER CHANGES WERE MADE.
Jeremy.
(This used to be commit b9c1697723)
1998-01-22 13:27:43 +00:00
Herb Lewis
12d50e30ec fix problems with using inf files from HP for DesignJet 750C (C3195A)
(This used to be commit 4e258eecf7)
1998-01-21 09:17:51 +00:00
Jeremy Allison
fec28f2def Makefile: Added new codepage - 866.
charset.c: Supporting code for codepage 866.
clientutil.c: Fix compile bug in little-used #define.
includes.h: Supporting code for codepage 866.
make_smbcodepage.c: Supporting code for codepage 866.
pcap.c: Fix bug for lpstat.
Jeremy.
(This used to be commit 6040d7a39e)
1998-01-16 06:29:38 +00:00
Herb Lewis
153a95a338 added printout of file list to stderr so you know what files you need to
copy to your printer$ share
(This used to be commit bdfa5c7099)
1998-01-03 05:12:10 +00:00
Herb Lewis
0a5073e985 fixes to make_printerdef.c to generate a correct printers.def file
changes to ipc.c to use new printers.def file
(This used to be commit 52e275c4cc)
1998-01-01 13:55:28 +00:00
Jeremy Allison
64f0348a3f This is it ! The mega-merge of the JRA_NMBD_REWRITE branch
back into the main tree.
For the cvs logs of all the files starting nmbd_*.c, look
in the JRA_NMBD_REWRITE branch. That branch has now been
discontinued.
Jeremy.
(This used to be commit d80b0cb645)
1997-12-13 14:16:07 +00:00
Andrew Tridgell
ebe7c7a173 added cli_rmdir and cli_mkdir
added test in smbtorture for the server updating the directory modify
time when a file is added to a directory

cleanup in smbtorture so no garbage files are left on the server
(This used to be commit 3a5e07f1e9)
1997-11-24 13:44:52 +00:00
Andrew Tridgell
931d0150b0 added a SMB_QUERY_FILE_ALL_INFO test into smbtorture
W95 doesn't seem to support this call.
(This used to be commit 162947c6e6)
1997-11-23 07:26:42 +00:00
Andrew Tridgell
c16d132bf9 added some QPATHINFO and QFILEINFO tests into smbtorture.
This tests for things like midnight access times, sticky create times
and word reversed INFO_STANDARD returns
(This used to be commit 89141de14e)
1997-11-23 05:55:44 +00:00
Andrew Tridgell
a1c5442abb test SMBsetatr as well
(This used to be commit 2f29c24ba7)
1997-11-23 03:09:59 +00:00
Andrew Tridgell
8bf0f359f3 added a test for the NT SMBgetatr bug in smbtorture
added support for choosing the protocol level in smbtorture (-m option)

use -1 for null date in cli_close()

get the attributes right in cli_open()
(This used to be commit d64d40a6ec)
1997-11-23 02:41:22 +00:00
Andrew Tridgell
6a6653f815 changed nmblookup to only set recursion_desired in queries if the -R
option is used.
(This used to be commit 4561b8242e)
1997-11-19 23:50:02 +00:00
Jeremy Allison
9f804556c4 loadparm.c : Added "veto oplock files" parameter.
make_printerdef.c: Fixed warning.
quotas.c: Fixed irix root errors.
server.c: Fixed oplock reference count bug.
smb.h: Added IS_VETO_OPLOCK_PATH().
Jeremy.
(This used to be commit c28487df63)
1997-11-17 19:16:38 +00:00
Andrew Tridgell
30dfa00877 added code to test the cli_NetServerEnum() function in clientgen.c
(This used to be commit 4933ba49b5)
1997-11-11 02:51:20 +00:00
Jeremy Allison
77aec4ae63 Rolled back tree state to 11:59pm 8th November 1997 EST to
remove problems.
Jeremy
(This used to be commit 4a36ac236c)
1997-11-10 19:23:17 +00:00
Luke Leighton
e357d91068 attempting to mark up 32 bit error codes, needed for NT domains.
separated out smb server-mode password validation into a separate file.
added called and calling netbios names to client gen state: referenced
section in rfc1002.txt.
created workstation trust account checking code in ntclient.c

there might be a bug in reply_session_setup_andX.  i indented and added { }
around single-line if statements: the lm password checking code now doesn't
look right (around the GUEST_SESSSETUP bits).  *no code semantics have been
changed by the indentation process*.
(This used to be commit f27966957f)
1997-11-09 17:30:10 +00:00
Andrew Tridgell
fbb57e5923 a few more tests added, including one that tests whether the server
understand the full range of byte offsets in locking requests. Samba
doesn't (due to the 31 bit limitation in fcntl locking)
(This used to be commit af1f408a05)
1997-11-08 05:33:45 +00:00
Andrew Tridgell
a90d206131 added two more sets of tests to the smbtorture test. The tests I added
are ones that I know Samba fails. They are:

  1) correct support for retaining locks over a close (ie. the server
     must not use posix semantics)
  2) support for lock timeouts
  3) the server supports multiple locking contexts on the one SMB
  connection, distinguished by PID.
  4) the server correctly fails overlapping locks made by the same PID (this
     goes against POSIX behaviour, which is why it is tricky to implement)
  5) the server denies unlock requests by an incorrect client PID

I've been discussing with Jeremy ways that we can re-implement the
locking code to handle these correctly. This test code will be useful
to see that we have got it right.
(This used to be commit 097781e299)
1997-11-08 04:02:05 +00:00
Andrew Tridgell
ba5086d03e no asm/signal.h for linux as this is not portable
add auto username from LOGNAME for smbtorture

proto fix in ufc.c
(This used to be commit f13dbdf307)
1997-11-06 06:50:21 +00:00
Andrew Tridgell
60e8211021 don't print the progress so often - it slows down the client too much
(This used to be commit cc6e770663)
1997-11-01 23:43:12 +00:00
Andrew Tridgell
6a0590d709 set O_CREAT on lock file
(This used to be commit 32fecea63b)
1997-11-01 13:28:21 +00:00
Andrew Tridgell
224c40a523 a simple SMB torture tester. This will allow us to evaluate locking
techniques more accurately.
(This used to be commit 054e3b2ae3)
1997-11-01 13:22:16 +00:00
Andrew Tridgell
d5fdd84ffa - cleanup some warnings
- redo the prototypes
(This used to be commit 31dcb51e05)
1997-10-31 02:40:55 +00:00
Andrew Tridgell
87ea4b93ec damn. We need root privilages to do semaphore operations even if we
have done the semget() as root.  The problem is that become_root() and
unbecome_root() are so slow!

I've provided two options. The default is to set the semaphores (but
_not_ the shared memory) world writeable so that a become_root() isn't
needed. Otherwise you can define SECURE_SEMAPHORES and pay the
performance penalty.
(This used to be commit 2bbd8d2cbc)
1997-10-29 02:59:22 +00:00
Jeremy Allison
ecb952f913 Utility code to produce printer definition files from MS files.
Part of code to support Windows 95 automated printer driver installs.
Written by Jean-Francois Micouleau <Jean-Francois.Micouleau@utc.fr>.
(This used to be commit 6e9f817414)
1997-10-28 23:58:31 +00:00
Andrew Tridgell
c79e0abdd7 fix cast
(This used to be commit af13f5e178)
1997-10-28 14:55:47 +00:00
Andrew Tridgell
71d648cdb4 change the default file permissions on the SHARE_MEM_FILE* to
0644. smbstatus now gets only read permission on the share files and
does no locking.

also get rid of some unnecessary umask(0) calls. smbd always runs with
umask(0)
(This used to be commit c6ac10170d)
1997-10-27 14:27:17 +00:00
Andrew Tridgell
2058763455 added -U option to nmblookup. This is similar to -B except that it
forces the client to send a unicast instead of a broadcast netbios
packet. This is useful for diagnostics.
(This used to be commit 57e0fac614)
1997-10-26 07:50:28 +00:00
Andrew Tridgell
e5c319186d Implemented asynchronous DNS lookups in nmbd.
I realised this afternoon just how easy it is to add this, so I
thought I'd implement it while the idea was fresh.

nmbd forks at startup and uses a pipe to talk to its child. The child
does the DNS lookups and the file descriptor of the child is added to
the main select loop.

While I was doing this I discovered a bug in nmbd that explains why
the dns proxy option has been so expensive. The DNS cache entries in
the WINS list were never being checked, which means we always did a
DNS lookup even if we have done it before and it is in cache. I'm sure
this used to work (I tested the DNS cache when I added it) so someone
broke it :-(

Anyway, the async DNS gets rid of the problem completely. I'll commit
just the fix to the DNS cache bug to the 1.9.17 tree.

You can disable async DNS by adding -DSYNC_DNS to the compile flags.
(This used to be commit 178e27de07)
1997-10-22 11:02:00 +00:00
Andrew Tridgell
3e670e4057 a major share modes reorganisation.
The shares modes code is now split into separate files. The shared
memory implementation is in locking_shm.c. The slow implementation is
in locking_slow.c

It is all controlled by a struct share_ops structure that has function
pointers to the implementation of all the functions needed by a share
modes implementation. An initialisation function sets up this
structure. This will make adding new implementations easy and clean.

This also allowed me to get rid of the ugly code in smbstatus. Now
status.c links to the locking code and calls methods in share_ops.

I also renamed some things and generally organised things in a much
cleaner fashion. Defines and structures specific to each
implementation have been moved to the appropriate file and out of
smb.h.
(This used to be commit 65ab9adaa0)
1997-10-20 08:46:00 +00:00
Andrew Tridgell
a25205bfc5 reverted a change made by Luke at his request.
Luke, when you don't know what has been changed in the CVS tree I
highly recommend you point your browser at:

	http://samba.anu.edu.au/cgi-bin/cvsweb/samba/source

If you click on a filename you can then see all the commits and
changes that have been made to it over time. You can also download any
version of the file or find the differences between any two versions.

All of this is not dependent on the state of your local CVS sandbox,
so it can be used to find out the "true" state of the tree at any
time.

If you suspect some sort of CVS problem (like a change getting
reverted) then please use the above URL to work out what has
happened. You should be able to see exactly who made what changes and
when.
(This used to be commit 3fc48246ee)
1997-10-13 13:49:50 +00:00
Luke Leighton
2259e56a94 byteorder.h :
debugging output wasn't (still isn't) perfect.

credentials.c lsaparse.c smbparse.c :

	added DEBUG strings.

pipes.c :

	lost some changes, to do with setup of RPC headers.  arg.
(This used to be commit 9fdd697d17)
1997-10-13 12:21:56 +00:00
Jeremy Allison
805749baab nmblookup.c: Added -A ability to do status on ip address.
smb.h: Added defines we will need for NT SMB calls.
trans2.c: Fixed SMB_QUERY_FILE_ALT_NAME_INFO return - this is only
for short name returns (and only used when you negotiate NT SMB calls
to boot !).
Jeremy (jallison@whistle.com)
(This used to be commit 53915bd160)
1997-10-10 01:32:26 +00:00
Jeremy Allison
2e92be3aaf client.c: Changed shadowed variable.
locking.c: Removed USE_OPLOCKS - now the default.
params.c: Removed unused variable.
proto.h: Updated.
reply.c: Removed USE_OPLOCKS - now the default.
server.c: Removed USE_OPLOCKS - now the default.
smb.h: Removed USE_OPLOCKS - now the default.
smbparse.c: Changed shadowed variable.
status.c: Removed USE_OPLOCKS - now the default.
util.c: Removed USE_OPLOCKS - now the default.
Jeremy (jallison@whistle.com)
(This used to be commit b93509846d)
1997-10-06 17:52:25 +00:00
Christopher R. Hertel
e722d70776 nmblookup.c:
I've added a -r option.  When specified, nmblookup will attempt to bind
  to port 137.  In order for this to work, the user must be root and the
  port must be available (i.e., nmbd not running).  If either condition is
  not met, nmblookup will default to normal behavior; it will try to bind
  to a free port above 7999.  I also removed an artifact.  The -p <port>
  option was being accepted but falling through to the default, which was
  the usage message.  I removed "p:" from the getopt() list.

params.c:
  Rewritten.  The scanning is much more linear, and I found and fixed a
  few bugs.  I don't like the way that the scratch buffer is handled,
  but I believe that it is an improvement over the previous version.

Chris -)-----
(This used to be commit 09dc951f2a)
1997-10-04 01:07:47 +00:00
Jeremy Allison
5864551aef OPLOCK CHECK-IN - oplocks are now *OPERATIONAL* !!!!
Yipeee. At least as far as I can check in a short time :-).

local.h: Changed OPLOCK_BREAK_TIMEOUT to 30 seconds.
locking.c: Big changes to delete oplocks on a share mode entry.
proto.h: updated.
reply.c: Added oplock break code in lockingX reply & readbraw reply.
server.c: Add batch oplock code. Force server shutdown if client fails
          to respond to oplock break.
smb.h: Fix silly slow share mode oplock define bug.
status.c: Add oplock status info.

Jeremy (jallison@whistle.com)
(This used to be commit 4c83d37239)
1997-10-01 23:32:22 +00:00
Jeremy Allison
cef59090bb Adding Andrews buffer overflow fixes into the main branch.
Jeremy (jallison@whistle.com)
(This used to be commit e7eb1f044d)
1997-09-26 18:55:29 +00:00
Andrew Tridgell
d55427c85f - if the user already exists then ignore the -add command
- change the way the smbpasswd file is auto-created if it doesn't
exist. It didn't work under IRIX for some unknown reason

The smbpasswd.c code is really a bit of a mess. We should probably
rewrite it sometime.
(This used to be commit 6e3697ad12)
1997-09-15 06:36:55 +00:00
Andrew Tridgell
552818e60e - change a lot of occurances of errno to use strerror(errno). We can't
assume all our users are programmers :-)

- automatically create the smbpasswd file if it doesn't exist when
running smbpasswd.
(This used to be commit 1d2361bd2d)
1997-09-15 05:43:37 +00:00
Andrew Tridgell
33a003de40 This commit does 3 main things:
1) put the encryption code in by default, with no #ifdef. It is still
disabled by default so you need to add "encrypt passwords = yes" in
smb.conf but at least all binaries will have it.

2) cleanup the kanji code so it compiles with no warnings

3) get rid of lots of uses of ugly non-portable C code. The main
offender being things like "register" but also remove uses of the
"const" keyword as there are compilers out there that don't support it
and even those that do often complain about its usage. Users don't
like warnings :-(

There is still some work to do. We need to replace the md4 code with
our own implementation. The current code (from rfc1186) is PD but is
not very portable. The new RFC (rfc1320) is more portable but adds
copyright restrictions. I'll do a from-scratch MD4 soon.

We also need to test that what I've implemented is portable. It should
be, but I'm too tired right now to test it on anything other than
intel linux.
(This used to be commit db917c62c1)
1997-09-14 16:37:18 +00:00
Jeremy Allison
30416c0b8a charcnv.c client.c clitar.c kanji.c kanji.h loadparm.c
mangle.c smb.h util.c:

  Big merge to allow KANJI support to be in the main
binary without explicitly compiling with it.

locking.c: Fix for smbstatus not being able to read files.
namepacket.c: Removed unneccesary debug statement.
trans2.c: Added Luke's proposed fix (ifdefed out until further testing).
nmblookup.c: Fixed bug where query fails and status is done on bogus IP.

Jeremy (jallison@whistle.com)
(This used to be commit 9196255022)
1997-09-11 20:17:32 +00:00
Andrew Tridgell
77df5c87c6 fix a couple of "declaration shadows previous local" warnings.
(This used to be commit c30f6a74d0)
1997-09-11 02:30:00 +00:00
Andrew Tridgell
646a721960 add the stdout parameter to lp_dump()
(This used to be commit 77f5bc8705)
1997-09-11 02:19:23 +00:00
Jeremy Allison
e7e49a6e6a client.c: Made sure myhostname was initialised before substitutions.
status.c: Made sure myhostname was initialised before substitutions.
server.c
trans2.c: Moved OS/2 WPS fix.
Jeremy (jallison@whistle.com)
(This used to be commit 8a12b6a4f0)
1997-09-05 21:32:32 +00:00
Jeremy Allison
57408548f3 Adding codepage definition files and codepage file compiler/decompiler.
Adding install/uninstall scripts for compiled codepage files.
Preparing for dynamic codepage loading.
Jeremy (jallison@whistle.com)
(This used to be commit e3fc9533bd)
1997-08-30 01:13:39 +00:00
Samba Release Account
e9269c67a5 Makefile: Changed for HPUX10 tidyup.
includes.h:	Changed for HPUX10 tidyup.
ipc.c:		Fixed bug where getting local server list from NT browsers would
            fail.
nmbsync.c:	Fixed bug where getting local server list from NT browsers would
            fail.
proto.h:	Changed for crash bug on SCO with USE_MMAP.
quotas.c:	Added OSF quotas (patch from Bret Giddings <bret@essex.ac.uk>).
            Rolled back solaris uid change - I think it was wrong.
reply.c:	Changed for crash bug on SCO with USE_MMAP.
server.c:	Removed Lukes changes. Changed for crash bug on SCO with USE_MMAP.
smb.h:		Changed for crash bug on SCO with USE_MMAP.
smbpasswd.c:Fixed crash bug with Lukes changes.
uid.c:		Removed Lukes changes.
util.c:		Fixed I18N bug with extended char filenames and widelinks = no.
Jeremy (jallison@whistle.com)
(This used to be commit bf1c79f7fd)
1997-08-19 19:22:26 +00:00
Samba Release Account
1330324e7b bug in num. arguments detection that stopped the -add option working
lkcl
(This used to be commit e025ffa0aa)
1997-08-09 13:29:02 +00:00
Samba Release Account
049640c8b6 updated smbpasswd to take the password on the command-line.
two sets of operation:

as root: specify username password.
as user: specify old password  new password

this will allow shell scripts (like adduser) to include smbpasswd.

lkcl
(This used to be commit 7e5f1681bd)
1997-08-06 14:35:23 +00:00
Samba Release Account
b95057c127 Fixed bug with -add code that put wrong password in nt md4 field.
Jeremy (jallison@whistle.com)
(This used to be commit aabb18953b)
1997-07-21 16:58:10 +00:00
Samba Release Account
612111c7a1 charset.c: Split charset_initialise() into 2 - a charset_initialise() and
a codepage_initialise(). Fixes problem with initialising dos map
            twice.
charset.h:  Changes to support charset changes.
client.c:   Changes to support charset changes.
loadparm.c:	follow symlinks parameter from David Clerc <David.Clerc@cui.unige.ch>
nmbd.c:		Changes to support charset changes.
nmblookup.c:Changes to support charset changes.
proto.h:	Changes to support charset changes.
reply.c:	Don't call security=server with no user/no password guest. Fix from
            Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu>
server.c:   follow symlinks code from David Clerc <David.Clerc@cui.unige.ch>
smbpasswd.c:Changes to support charset changes.
status.c:	Changes to support charset changes.
testparm.c: Changes to support charset changes.
testprns.c: Changes to support charset changes.
uid.c:		Fixed log message with no \n.
Jeremy (jallison@whistle.com)
(This used to be commit 2a28a6e5e4)
1997-07-18 20:21:32 +00:00
Samba Release Account
0378cd5a8c Added -a option (for Andrew:-). Fixed bug where users with
"NO PASSWORD" couldn't change their passwords.
Jeremy (jallison@whistle.com)
(This used to be commit 87d17af008)
1997-07-10 20:15:48 +00:00
Samba Release Account
c6e63aa896 Makefile: Added quoata changes for Linux from Thorvald Natvig
Makefile.RPM:	Added quoata changes for Linux from Thorvald Natvig
charset.c:	Large changes to add multiple client code pages.
charset.h:	Changed charset_initialise() proto.
client.c:	Fixed message sending bug. Changed charset_initialise().
ipc.c:		Fixed #ifdef compile problems.
loadparm.c:	Added "client code page" option.
nmbd.c:		Changed charset_initialise(). Fixed lmhosts read.
nmblookup.c:	Changed charset_initialise().
proto.h:	Added lp_client_code_page(void).
quotas.c:	Added quoata changes for Linux from Thorvald Natvig
reply.c:	Changed debug level. Made SMBecho ignore tid.
server.c:	Changed charset_initialise().
smb.h:		Added DEFAULT_CLIENT_CODE_PAGE as 850.
smbpasswd.c:	Changed charset_initialise().
status.c:	Changed charset_initialise().
testparm.c:	Changed charset_initialise().
testprns.c:	Changed charset_initialise().
Jeremy Allison (jallison@whistle.com)
(This used to be commit 957025bace)
1997-06-11 01:03:06 +00:00
Samba Release Account
aa864415c5 dir.c: Fixed double slash issue.
includes.h: Changed to ifdef FAST_SHARE_MODES.
ipc.c:  Changed lp_workgroup() to myworkgroup.
loadparm.c:  Added new shared mem parameters. Added Luke's fix.
locking.c: Rewrite to do share modes better (both fast and slow modes).
nameannounce.c:  Changed lp_workgroup() to myworkgroup. Added Luke's fix.
nameconf.c:  Changed lp_workgroup() to myworkgroup.
namedbname.c:  Improved debug.
namedbserver.c:  Changed lp_workgroup() to myworkgroup.
namedbsubnet.c:  Added Luke's fix - rewritten somewhat.
namedbwork.c:  Changed lp_workgroup() to myworkgroup.
nameelect.c:  Added Luke's fix - rewritten somewhat.
nameresp.c:  Stoped shadowing global.
nameserv.c:  Added Luke's fix - Improved debug.
nameservreply.c:  Improved debug.
namework.c:  Changed lp_workgroup() to myworkgroup.
nmbd.c:  Added Luke's fix - Changed lp_workgroup() to myworkgroup.
pipes.c:   Changed lp_workgroup() to myworkgroup.
proto.h:   Added Luke's fix, added smb_shm_ proto's.
reply.c:  Changed lp_workgroup() to myworkgroup.
server.c:  Rewrite to do share modes better (both fast and slow modes).
shmem.c:  Rewrite to do share modes better (both fast and slow modes).
smb.h:  Rewrite to do share modes better (both fast and slow modes).
status.c:  Rewrite to do share modes better (both fast and slow modes).
trans2.c:  Fixed double slash issue.
util.c:  Tidied up, created myworkgroup.
Jeremy Allison (jallison@whistle.com).
(This used to be commit 2a1711eaaf)
1997-05-20 00:32:51 +00:00
Samba Release Account
441855fe0e status.c: Added brief option. Patch from ccctim@mailbox.ucdavis.edu
client.c: Added translation of '/' characters to '\' characters. Suggested by friedl@mtndew.com (Stephen J. Friedl)
charcn.c: Fix for iso8859-2 (Eastern European) conversions based on a patch from Miroslaw M. Maczka <elvisbze@polbox.com>
(This used to be commit 27708a73ce)
1997-05-08 21:17:59 +00:00
Samba Release Account
0f1f0ceb95 'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com)
Wed May  7 1997: Update for 1.9.17alpha1 release - 'browsefix release'
designed to make browsing across subnets work.

byteorder.h:	Updated copyright to 1997.
charcnv.c:      Updated copyright to 1997.
charset.c 	Updated copyright to 1997.
charset.h	Updated copyright to 1997.
client.c	Updated copyright to 1997.
clientutil.c	Updated copyright to 1997.
dir.c		Updated copyright to 1997.
fault.c		Updated copyright to 1997.
includes.h	Updated copyright to 1997.
interface.c	Updated copyright to 1997.
ipc.c		Updated copyright to 1997.
kanji.c		Updated copyright to 1997.
kanji.h		Updated copyright to 1997.
loadparm.c	Updated copyright to 1997.
locking.c	Updated copyright to 1997.
mangle.c	Updated copyright to 1997.
message.c	Updated copyright to 1997.
nameannounce.c

	Made use of WINS subnet explicit.
Added reset_announce_timer() so announcement
can be made immediately when we become a master.
Expanded code to do sync with dmb.

namebrowse.c

	Removed redundent checks for AM_MASTER in
sync code. Made use of WINS subnet explicit.

namedbname.c	Made use of WINS subnet explicit.
namedbresp.c	Made use of WINS subnet explicit.
namedbserver.c	Made use of WINS subnet explicit.

namedbsubnet.c

	Explicitly add workgroup to WINS subnet
when we become a dmb. Made use of WINS subnet explicit.

namedbwork.c

	Made use of WINS subnet explicit. Removed
redundent check_work_servertype() function.

nameelect.c

	Explicitly add workgroup to WINS subnet
when we become a master browser. Made use of WINS subnet explicit.

namelogon.c	Updated copyright to 1997.
namepacket.c	Updated copyright to 1997.
namequery.c	Updated copyright to 1997.

nameresp.c

	Made use of WINS subnet explicit. Made nmbd fail if
configured as master browser and one exists already.

nameserv.c

	Made use of WINS subnet explicit. Remove redundent
logon server and domain master code.

nameserv.h	Add emumerate subnet macros.
nameservreply.c	Made use of WINS subnet explicit.
nameservresp.c	Updated copyright to 1997.

namework.c

	Made use of WINS subnet explicit. Updated code to
add sync browser entries to add subnet parameter.

nmbd.c

	Added sanity check for misconfigured nmbd.

nmblib.c	Updated copyright to 1997.
nmblookup.c	Updated copyright to 1997.
nmbsync.c

	Removed redundent AM_ANY_MASTER check.

params.c	Updated copyright to 1997.
password.c	Updated copyright to 1997.
pipes.c		Updated copyright to 1997.
predict.c	Updated copyright to 1997.
printing.c	Updated copyright to 1997.

proto.h

	Changed protos for new nmbd code.

quotas.c	Updated copyright to 1997.
replace.c	Updated copyright to 1997.
reply.c		Updated copyright to 1997.
server.c	Updated copyright to 1997.
shmem.c		Updated copyright to 1997.
smb.h		Updated copyright to 1997.
smbencrypt.c	Updated copyright to 1997.
smbpasswd.c	Updated copyright to 1997.
smbrun.c	Updated copyright to 1997.
status.c	Updated copyright to 1997.
system.c	Updated copyright to 1997.
testparm.c	Updated copyright to 1997.
testprns.c	Updated copyright to 1997.
time.c		Updated copyright to 1997.
trans2.c	Updated copyright to 1997.
trans2.h	Updated copyright to 1997.
uid.c		Updated copyright to 1997.
username.c	Updated copyright to 1997.
util.c		Updated copyright to 1997.
version.h

	Changed to 1.9.17alpha1.
(This used to be commit cf23a155a1)
1997-05-08 01:14:17 +00:00
Samba Release Account
869f24e0b1 locking.c proto.h shmem.c smb.h status.c :
Changed shm_ prefixes to smb_shm_ prefixes as shm_ is a POSIX.4
prefix. Updated fd code in FAST_SHARE_MODE code
to work with new fd indirection.
quotas.c: Fixed #ifdef not on position zero.
Jeremy. (jra@cygnus.com).
(This used to be commit c9a9d56642)
1997-01-15 01:53:25 +00:00
Samba Release Account
8bc7d6bebd Makefile: Changes to split Solaris into Solaris2.3 and previous, and 2.4 and after from Paul Eggert.
Makefile: Added AMIGA changes from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>.
charset.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
charset.h: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
clitar.c: Patch to re-sync after read fail from (lost contributor name, sorry).
includes.h: Patch for AMIGA from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>
includes.h: Patch for SunOS atexit by Jeremy (jra@cygnus.com)
interface.c: Patch for AMIGA from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>
kanji.h: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
locking.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
locking.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
pipes.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
proto.h: Patch to fix file locking from Jeremy (jra@cygnus.com)
reply.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
server.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
server.c: Patch for FAST_SHARE_MODE fix from (lost contributor name, sorry).
smb.h: Patch to fix file locking from Jeremy (jra@cygnus.com)
smb.h: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
status.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
statuc.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
system.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
trans2.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
trans2.c: Patch to fix volume name reported to Win95 from Jeremy (jra@cygnus.com)
util.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
util.c: Patch to fix client_name from continuously returning UNKNOWN (from various contributors).
version.h: Update to 1.9.16p10.
(This used to be commit 03d28fa32e)
1997-01-09 18:02:17 +00:00
Samba Release Account
c97bb2f272 nmblookup was looking for 0x1b (domain master browser) not 0x1d (local
master browser) names with the -M switch.

lkcl
(This used to be commit f27a9ccc97)
1996-11-06 20:14:24 +00:00
Andrew Tridgell
dfa2b456c7 - continue when failing to load config file in nmblookup and smbclient
- fix important bug in nmbd where it set the return code for a
negative name response to 0 (which means success!)
(This used to be commit bfa816cc8f)
1996-10-07 11:06:34 +00:00
Andrew Tridgell
e5893bdfbe I have fixed quite a few important bugs in this commit.
Luke, can you take special note of the bug fixes to nmbd so you can
propogate them to your new code.

- rewrote the code that used to use fromhost(). We now call
gethostbyaddr() only if necessary and a maximum of once per
connection. Calling gethostbyaddr() causes problems on some systems so
avoiding it if possible is a good thing :-)

- added the "fake oplocks" option. See the docs in smb.conf(5) and
Speed.txt

- fixed a serious bug in nmbd where it would try a DNS lookup on
FIND_SELF queries. This caused a lot of unnecessary (and incorrect)
DNS lookups to happen. FIND_SELF queries should only go to the
internal name tables.

- don't set FIND_SELF for name queries if we are a wins proxy, as we
are supposed to be answering queries for other hosts.

- fixed a bug in nmbd which had "if (search | FIND_LOCAL)" instead of
"if (search & FIND_LOCAL)". Luke, this was in nameservreply.c

- the above 3 bugs together meant that DNS queries were being cached,
but the cache wasn't being used, so every query was going to DNS, no
wonder nmbd has been chewing so much CPU time! Another side effect was
that queries on names in lmhosts weren't being answered for bcast
queries with "wins proxy" set.

- ignore the maxxmit for seconday session setups (see CIFS spec)

- close user opened files in a uLogoffX for user level security (see
CIFS spec)

- added uid into the files struct to support the above change
(This used to be commit ea472b7217)
1996-10-05 10:41:13 +00:00
Andrew Tridgell
e23f2b9cef - changed the umask handling. We now set the umask to 0 and explicitly
set the mode on all created files. I think this is a better policy.

- change the debug levels on some items

- fix a charset handling bug which affected foreign and extended
charset users

- no longer switch back to the original directory when idle, instead
switch to / as the original directory may not be readable by ordinary
users.

- fix some bugs where the create mode of files was not being
explicitly set (it was relying on the umask and using fopen). Not a
big bug as it only affected obscure commands like the messaging ops.

- got rid of the lock code in the lpq cache as its no longer needed

- rewrote smbrun to be faster and to remove the security hole. We now
don't actually need a external smbrun binary, its all done by smbd.

- add a more explicit warning about uids and gids of -1 or 65535
(This used to be commit 5aa735c940)
1996-10-04 09:31:07 +00:00
Andrew Tridgell
5a2f52b79e - a huge pile of changes from Luke which implement the browse.conf
stuff and also fix a pile of nmbd bugs. Unfortunately I found it very
hard to disentangle the new features from the bug fixes so I am
putting in the new code. I hope this is the last big pile of changes
to the 1.9.16 series!
(This used to be commit 20b6203dac)
1996-10-02 14:09:22 +00:00
Andrew Tridgell
0c33046a0a - added "netbios name" option in smb.conf to make controlling the name
that samba uses possible

- added "socket address" option to allow virtual SMB servers (on
systems with IP aliasing line Linux)

- disabled FAST_SHARE_MODES by default in Linux as older Linux boxes
can't do shared writeable mappings. We really need autoconf ...

- added new option types in loadparm so a string type can be specified
ot be uppercase only, this is used for the workgroup and netbios name
options

- auto-create the lock directory if it doesn't exist in shared mem
startup

- get rid of announce_backup()

- change a few comments in nmbd code

- rewrote the chaining code completely. Hopefully it will handle any
depth chains now.

- added LPRng support
(This used to be commit e9eac6cd49)
1996-08-19 11:17:29 +00:00
Andrew Tridgell
efb8113d00 - made FAST_SHARE_MODES standard for Linux
- you can now press enter after a password prompt with "smbclient -L
hostname" and it will use a blank username and password, the same as
if you used -U%

- changed the wins.dat store code to not go via a string variable
(just use fprintf instead)

- removed a "unsigned long" that luke put back in, changing it to
uint32 to keep 64 bit machines happy. Naughtly luke!

- allow guest non-connnected print queue listings so ms client 3 can
work
(This used to be commit 917160dee6)
1996-08-17 14:27:12 +00:00
Andrew Tridgell
47673b32ed - added FAST_SHARE_MODES code
- added some named pipe code from Jim
(This used to be commit c94866e9e4)
1996-08-15 15:11:34 +00:00
Samba Release Account
3ffb30e8be local_only NetServerEnum syncs can now be issued.
bug spotted in nameservresp.c - arguments to test subnet the response
is received on (same_net()) were the wrong way round (ccm@shentel.net)

samba was adding WORKGROUP(1e) as a unique not a group name: fixed this

bug in reply_name_status() and reply_name_query(): WINS entries weren't
being looked up.

name status reply adds local SELF entries to WINS SELF entries: some
SELF entries are only added locally, while others are only added via
WINS. name status needs to have both, combined.

a sync will only occur when an ANN_LocalMasterAnnouncement is received, NOT
an ANN_HostAnnouncement or an ANN_DomainAnnouncement.

when samba is a member of a workgroup, it looks for (using a wins server)
and announces to its domain master. NAME_QUERY_ANNOUNCE_HOST - yet another
'state' - has been created to do this: do the name query on the wins server
and send the announce host to the answer to this query.

jeremy @ vantive wrote the original code to do this, which used the
name_query() function.  i'm trying to avoid name_query: it times out and
generally messes things up, but using queue_netbios_packet() and
queue_netbios_pkt_wins() is... not intuitive?

lkcl with help from jra
(This used to be commit 6e932e4bae)
1996-08-01 17:49:40 +00:00
Samba Release Account
25b30c08dc lots of changes to nmbd
lkcl
(This used to be commit 45d3b26447)
1996-07-17 18:33:36 +00:00
Samba Release Account
ed2639ebe2 luke's first attempt at using cvs
accidentally updated the Makefile

updated the name database structure (again!). this time, there is one
name database per local interface. there is also a pseudo-interface on
ip 255.255.255.255. its purpose is to store WINS name entries. all the
local interface name databases store SELF names only. the WINS name
database stores non-special browser names.

added wins.dat file: records WINS entries in ascii format. this is reloaded
when nmbd restarts.

added repeating code for response packets. timer is in seconds only at the
moment.

updated the response queue code to deal with samba registering with a
WINS server a bit better (added more cases when a response isn't received).
tidied up the response packet processing code and expire_response_queue()
code. added cross references between response received and await-response
expired code.

added over-zealous code that checks all machines that register with samba
as a WINS server (every 10 minutes i think): to see whether they are still
alive or not (see rfc1001.txt)

bug reported by terry@ren.pc.athabascau.ca: DNSFAILed names _stay_ as
DNSFAIL, even though the machine may come back up and REGISTER.

removed update_from_reg() function. it's not necessary, and it does too much.

added code that announces on each local interface samba's ttl as zero and
servertype as zero when nmbd is kill -TERMed

first attempt at putting the first functionality of samba browsing back in
(remote subnets should have samba appear in a workgroup specified through
the lmhosts file)

lots of other miscellaneous tidying up / chopping about.
(This used to be commit 7e8c60cfe5)
1996-06-29 18:49:20 +00:00
Andrew Tridgell
7e3b4a1c0d got rid of a lot of redundent header files as we now globally generate
prototypes automatically using "make proto". This is much less prone
to error than the old method of manually adding prototypes
(This used to be commit b551dc98f7)
1996-06-10 04:38:24 +00:00
Andrew Tridgell
4eba893b02 - added comments to byteorder.h explaining how it works.
- fixed problem with installscripts if srcdir is not set
- fixed ptr init bug in interface.c
- changed default lookup type in nmblookup to match nbtstat under NT
- new quotas fixes for sunos and solaris
(This used to be commit e775576f02)
1996-06-08 04:33:37 +00:00
Andrew Tridgell
b9ae225b28 - added interface.c and removed all the references to myip, bcast_ip
and Netmask, instead replacing them with calls to routines in
interface.c

- got rid of old MAXINT define

- added code to ensure we only return one entry for each name in the ipc
enum routines

- added new_only option to add_netbios_entry() to prevent overwriting
of important names

- minor time handling fixup
(This used to be commit 7ed71b73ae)
1996-06-06 11:43:09 +00:00
Andrew Tridgell
a2c1623827 a huge pile of changes :-)
The biggest thing is the integration of Lukes new nmbd. Its still
largely untested, so we will really need some feedback

I've also added auto prototype generation and cleaned up a lot of
minor things as a result
(This used to be commit 0d8dcfa13c)
1996-06-04 06:42:03 +00:00
Andrew Tridgell
58734631b4 Lots of changes!
- add faq info on NT printer handling
- add "delete readonly" option to help rcs users
- add stuff to man pages on new printer options
- add "proxy name resolution" option
- add "command string" -c option to smbclient (thanks Ken)
- split time functions into time.c
- rearrange the quotas stuff a bit and fix some bugs
- complete rehash of the time handling code thanks to Paul Eggert
- fix nmblookup output a bit
- add plp print queue parsing from Bertrand Wallrich
(This used to be commit 635b56f19c)
1996-05-31 15:13:29 +00:00
Andrew Tridgell
1956d13494 cleanups to make thinsg compile cleanly
(This used to be commit 39fbeb04ae)
1996-05-29 07:47:47 +00:00
Andrew Tridgell
efdeaf4cf6 - added hostname support to smbstatus
- fix a bug where -s would not be recognised
(This used to be commit 03744dc0cd)
1996-05-05 11:34:03 +00:00
Samba Release Account
0e8fd33987 Initial version imported to CVS
(This used to be commit 291551d807)
1996-05-04 07:50:46 +00:00