1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

603 Commits

Author SHA1 Message Date
Jeremy Allison
da9fb5ba38 Don't try and open tdb secrets file in non-root/local mode.
Jeremy.
(This used to be commit e78a114425)
2001-07-06 21:53:32 +00:00
Tim Potter
2036ce8a5d A program to display a tree of domains, servers and shares similar to the
network neighbourhood graph.  Still needs a bit of work.
(This used to be commit 6b4559506d)
2001-07-06 10:49:34 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Tim Potter
d972dc06a1 Removed bogus server_n local variable in connect_one() function.
(This used to be commit 69d90a8af1)
2001-07-04 04:04:17 +00:00
Jeremy Allison
4a6ef39261 Small warning removal tidyup.
Jeremy.
(This used to be commit 5cf7bc582b)
2001-07-03 22:00:11 +00:00
Tim Potter
d90f7ef5ea Experimental support for joining a domain without creating an account in
server manager first.  Just use the -U parameter to smbpasswd when joining
the domain:

	smbpasswd -r PDC -j DOMAIN -U administrator%password

Should also work with domain users with the 'add workstation to domain'
user right.
(This used to be commit 937b96feaa)
2001-06-29 08:04:12 +00:00
Tim Potter
39a265ae20 Added some missing entries to usage().
Added -d option to set debug level.
(This used to be commit 9874df0c22)
2001-06-27 04:43:55 +00:00
Andrew Tridgell
b95a294a08 fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef instead of a define
(This used to be commit e2ecff419f)
2001-06-25 02:53:13 +00:00
Andrew Tridgell
53ca6d33ce added a -L option to smbpasswd to force it to run locally so we can test smbpasswd as non-root
(This used to be commit ab63520265)
2001-06-25 01:15:17 +00:00
Andrew Tridgell
91b8a8d1d2 next_token() was supposed to be a reentrant replacement for strtok(),
but the code suffered from bitrot and is not now reentrant. That means
we can get bizarre behaviour
i've fixed this by making next_token() reentrant and creating a
next_token_nr() that is a small non-reentrant wrapper for those lumps
of code (mostly smbclient) that have come to rely on the non-reentrant
behaviour
(This used to be commit 674ee2f1d1)
2001-06-21 09:10:42 +00:00
Jeremy Allison
6fb063b4d5 Warning fix from Andrew Bartlett.
Jeremy.
(This used to be commit 87f647715d)
2001-06-20 17:49:38 +00:00
Simo Sorce
82970b833c initial support for paramter type P_LIST
it will avoid problems with lists being longer than 1024 bytes
just now only ip list parameters have been converted to the new type
(hosts allow, hosts deny, ssl hosts, ssl hosts resign)
(This used to be commit e1572f85d6)
2001-06-20 16:54:32 +00:00
Andrew Tridgell
fcda2645f0 added a close-share smbcontrol message that forcibly closes a share in smbd (to allow unmount)
(This used to be commit 15b17a80db)
2001-06-20 03:05:09 +00:00
Andrew Tridgell
ffb63e4f8e moved all our torture code to a separate directory
(This used to be commit dd12c47645)
2001-06-19 02:02:19 +00:00
Andrew Tridgell
90b757f6bf torture code is moving to its own directory
(This used to be commit a4ef84e1a0)
2001-06-19 01:54:42 +00:00
Jeremy Allison
c1fbf761ce rpc_server/srv_srvsvc_nt.c: Don't test an uint32 for < 0.
utils/smbcacls.c: Set enum correctly.
Jeremy.
(This used to be commit 66f959e0ff)
2001-06-19 00:44:23 +00:00
Jeremy Allison
0c69d17653 New info level tester.
Jeremy.
(This used to be commit 9297ae69a7)
2001-06-18 23:31:22 +00:00
Andrew Tridgell
e324e21457 added a oplock break handler hook to the client code, this allows for more complete testing of oplocks from smbtorture and would also be essential if a client app ever really did want to use oplocks properly
(This used to be commit 3d4a3bfacd)
2001-06-18 08:26:15 +00:00
Tim Potter
df8713fdb9 Renamed -d option (make verbose) on smbstatus to -v.
Added -d <debuglevel> option.
(This used to be commit bdb9714380)
2001-06-13 05:36:28 +00:00
Jeremy Allison
5264e9a2a7 Set correct reply word in large writeX (greater than 64k) replies.
Also added smbtorture test for this.
Jeremy.
(This used to be commit 6d65556ae8)
2001-06-05 08:17:16 +00:00
Andrew Tridgell
05fc3e578c use LDSHFLAGS not -shared in several places
(This used to be commit 8ec9c87b5d)
2001-06-04 05:13:59 +00:00
Tim Potter
6dce5c47c6 If a debug class was explicitly set to zero the debug system would not
recognise it as there was no distinction made between zeroing a debug
class and just not setting it to anything.  I've added a
debuglevel_isset array in parallel with the debuglevel_class array to
fix this.

Added a couple of new debug classes which I might start filling out
to get smb, rpc header and rpc marshall/unmarshalling debugs tidied
up.

Fixed a bunch of cut&paste bugs in include/debug.h

Modified smbcontrol and the messaging system debug handler to like the
debuglevel_isset stuff.
(This used to be commit 391e7caf76)
2001-06-01 12:04:44 +00:00
Jeremy Allison
10211f53f9 Check sizes of data entries in connections.tdb before deciding they're crecs...
We will need this when we use finer grained locking for max connections.
Jeremy.
(This used to be commit c6cd42a679)
2001-05-15 18:12:02 +00:00
Andrew Tridgell
98da4768df remember to close tdb after use
(This used to be commit 8f8d7202cf)
2001-05-15 01:28:34 +00:00
Jeremy Allison
bc51512aad Fix crash in smbcontrol Gerald pointed out when no parameter given to debug.
Jeremy.
(This used to be commit ef687a2f6b)
2001-05-14 22:37:01 +00:00
Jeremy Allison
47cd09ee57 Don't check for passwd program if using pam change password.
Original patch from Andrew Bartlett.
Jeremy.
(This used to be commit aae779d0a3)
2001-05-10 06:53:19 +00:00
Anton Blanchard
9de17c5c38 need to do codepage_initialise() for smbtorture to work.
(This used to be commit 7a619ab81c)
2001-05-09 01:58:12 +00:00
Gerald Carter
30c4c04c2f Patch from Simo:
o sed 's/pdb_clear_sam/pdb_free_sam/g'
  o add pdb_reset_sam()
  o password changing should be ok now as well.
(This used to be commit 96d0e7c330)
2001-05-07 14:04:46 +00:00
Tim Potter
050b0307f0 Removed unused variable.
(This used to be commit 6bd197714a)
2001-05-07 06:05:30 +00:00
Andrew Tridgell
6056766247 merge some fixes from 2.2
(This used to be commit 7e57adf2a0)
2001-05-07 03:55:54 +00:00
Jean-François Micouleau
f35157f392 Big cleanup of passdb and backends.
I did some basic tests but I have probably broken something. Notably the
password changing. So don't cry ;-)

	J.F.
(This used to be commit a4a4c02b12)
2001-05-04 15:44:27 +00:00
Jeremy Allison
548d16869a Fixed SHM_R/SHM_W warnings by moving sys/ipc.h and sys/shm.h into includes.h
and using autoconf tests.
Added "restrict acl with mask" parameter.
Jeremy.
(This used to be commit 7792e32ba7)
2001-05-03 19:47:30 +00:00
Jeremy Allison
f5eab4421c Fixup smbcacls. Don't return memory already freed, don't free memory allocated
with talloc.
Jeremy.
(This used to be commit 0ae0d024f5)
2001-05-01 23:07:30 +00:00
Andrew Tridgell
7e82811d2d fixed some uninitialised variables
(This used to be commit 5d899e51a4)
2001-05-01 04:05:53 +00:00
Gerald Carter
e40449fa72 rpcclient merge from 2.2 (including Jeremy's non-void return fix)
(This used to be commit 0a6ceed279)
2001-04-28 00:32:56 +00:00
Jeremy Allison
b238f4a2ff rpcclient/rpcclient.c: Non-void return in void function.
smbd/sec_ctx.c: Fixed potential memory leak spotted by
Kenichi Okuyama@Tokyo Research Lab, IBM-Japan, Co.
utils/nmblookup.c: gcc warning on Solaris fix.
Jeremy.
(This used to be commit 1be60597cd)
2001-04-28 00:05:11 +00:00
Jeremy Allison
8f11c24b74 More gcc compile on solaris tidyups.
Jeremy.
(This used to be commit 956201c4fb)
2001-04-27 22:42:10 +00:00
Herb Lewis
55d0bdbf4a fix typo
(This used to be commit ed2dfae0e5)
2001-04-24 18:53:15 +00:00
Herb Lewis
57007050da don't allow both add and delete user to be set at the same time
(This used to be commit 9db84de46a)
2001-04-24 16:44:28 +00:00
Jeremy Allison
2df39394fe This little piece of insanity is inspired by the
fact that an NT client can open a file for O_RDONLY,
but set the create disposition to FILE_EXISTS_TRUNCATE.
If the client *can* write to the file, then it expects to
truncate the file, even though it is opening for readonly.
Quicken uses this stupid trick in backup file creation...
Thanks *greatly* to "David W. Chapman Jr." <dwcjr@inethouston.net>
for helping track this one down. It didn't bite us in 2.0.x
as we always opened files read-write in that release.
Jeremy.
(This used to be commit 5baef56831)
2001-04-14 20:47:30 +00:00
Jeremy Allison
819482c071 Fixed potential file descriptor leak with MS-Access fix.
Jeremy.
(This used to be commit 192887fe72)
2001-04-13 20:49:11 +00:00
Jeremy Allison
2ef68c7e92 Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812)
2001-04-13 19:12:06 +00:00
Jeremy Allison
3a38f122d9 Added SMB_ prefix to enums that clash with Solaris ACL definitions.
Jeremy.
(This used to be commit 493d2c316a)
2001-04-11 01:34:37 +00:00
Jeremy Allison
fd6e9d6db9 utils/torture.c: Added one more delete on close test.
smbd/notify_kernel.c: This code was wrong I believe. It was structured to only
return a changenotify event on being called from timeout processing (t != 0).
The kernel changenotify events should fire on *asynchronous* processing (EINTR
return from select caused by the realtime signal delivery) with t == 0.
Reported by Juergen Hasch (Hasch@t-online.de).
ANDREW PLEASE CHECK THIS !
Currently the hash style changenotify is done on async processing as well
as timeout processing. As this is expensive we may want to revisit doing this
and maybe set it to fire only on timeout processing.
Jeremy.
(This used to be commit f952380c5d)
2001-03-30 21:53:33 +00:00
Jeremy Allison
9874ebc3d3 Added one more test - just to make sure flag can be unset.
Jeremy.
(This used to be commit 54960b9c8d)
2001-03-30 06:31:22 +00:00
Jeremy Allison
0be5f29179 Expanded delete on close test to 6 cases. I now understand the semantics of
this and the FILE_SHARE_DELETE flag exactly. The bad news is it means our
share mode handling is broken (again :-).
Jeremy.
(This used to be commit a55ed1a91d)
2001-03-30 06:22:14 +00:00
Jeremy Allison
e51ffc8111 Changed to using GENERIC_XX constants instead of hex values to make
delete test explicit.
Jeremy.
(This used to be commit cb5963af0e)
2001-03-30 02:48:06 +00:00
Jeremy Allison
74c81cd628 Added delete on close test that has allowed me to determine how w2k
behaves in this situation.
Jeremy.
(This used to be commit b0266fe0a8)
2001-03-30 00:35:47 +00:00
Jeremy Allison
de368e09cb Fix for ENOSPC from DCB.
Jeremy.
(This used to be commit 55fcd71eec)
2001-03-27 00:28:01 +00:00
Jeremy Allison
1452c2d8c4 Fix from Ryo Kawahara <rkawa@lbe.co.jp> to make SWAT correctly write and smb.conf
file in utf8.
Jeremy.
(This used to be commit 42052d6079)
2001-03-26 23:13:02 +00:00
Jeremy Allison
da8805b377 groupdb/mapping.c:
include/proto.h: Fix missing (void) in proto.
rpc_server/srv_samr_nt.c: Fix user private group problem by filtering out groups that
							clash with users.
smbd/posix_acls.c: Ensure default ACE's are sensible.
utils/pdbedit.c: Fix from Simo Sorce.
Jeremy.
(This used to be commit 29414fe0d6)
2001-03-23 02:14:08 +00:00
Jean-François Micouleau
810ea03f9b can delete mapping from command line now.
J.F.
(This used to be commit 287d9fb068)
2001-03-23 01:19:21 +00:00
Jean-François Micouleau
0053bd8b80 first pass of the new group mapping code
J.F.
(This used to be commit 7154deb026)
2001-03-23 00:50:31 +00:00
Andrew Tridgell
90890ef9fc added -E option (for exit on errors)
forced exclusion of filenames containing only '.' as NT rejects those
(This used to be commit a83ff172f2)
2001-03-21 06:44:49 +00:00
Andrew Tridgell
85a18b2c0c latest attempt at lanman1 wildcard matching
(This used to be commit 32361fc53e)
2001-03-21 05:54:09 +00:00
Gerald Carter
762c6e3f84 patches from Simo. Couple of snity things
(This used to be commit af3f2a30c6)
2001-03-14 20:17:27 +00:00
Jeremy Allison
c4a84783a6 Added JF's new util.
Jeremy.
(This used to be commit 96bcfdcded)
2001-03-11 00:45:07 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
6ed9b52862 Ooops - forgot to check the rpcclient and smbcacls compile with the new
code :-(.
Jeremy.
(This used to be commit 70beabf73b)
2001-02-28 01:38:12 +00:00
Andrew Tridgell
1d67fe4dbe better handling of '.'
better verbose print
(This used to be commit 1f8b8a7189)
2001-02-27 12:04:49 +00:00
Andrew Tridgell
acaf04b7cc remove some test code
(This used to be commit 2c509c9860)
2001-02-27 06:13:32 +00:00
Andrew Tridgell
dccf44d752 almost there with lanman1 wildcards. We now seem to correctly handle
'<', '>', '"' and '?' when combined with '.'. The '*' character is
proving troublesome.
(This used to be commit 0a55d9a17b)
2001-02-27 06:11:59 +00:00
Andrew Tridgell
54f5661b43 I have now found that despite initial appearences the lanman1 wildcard
algorithm does *not* match separately on base and extension.

I also added a -v option to masktest for verbose output
(This used to be commit 76c8fa5cd1)
2001-02-27 04:18:12 +00:00
Andrew Tridgell
0d54de536c made some LANMAN1 wildcard progress
it now handles -M LANMAN1 -f '.x' -m '?x' nicely
(This used to be commit e7ccb9be6d)
2001-02-26 06:53:42 +00:00
Andrew Tridgell
571a04613b made some progress in masktest
it now handles the server renaming files on create
(This used to be commit 85ce14f36d)
2001-02-26 05:13:19 +00:00
Andrew Tridgell
f7602aaaa6 a snapshot of my attempts to get wildcard matching right for LANMAN1
clients. This is not complete and not correct - expect some more work
on this soon
(This used to be commit 06d158d5e9)
2001-02-25 23:47:27 +00:00
Andrew Tridgell
7082b61c4b make sure denied aces are first
(This used to be commit b0b49a4b28)
2001-02-23 07:25:49 +00:00
Andrew Tridgell
46807bd187 cast the qsort
(This used to be commit 703d9f5cb3)
2001-02-23 07:21:50 +00:00
Andrew Tridgell
8d070c60fc - fixed the sort_acl bug, sorting now works right
- don't allow setting of duplicate ACEs
- fixed a ACE delete bug
(This used to be commit 61293979ce)
2001-02-23 07:20:11 +00:00
Andrew Tridgell
b4096748dd don't crash on null acl sort
(This used to be commit 5934137741)
2001-02-22 06:35:54 +00:00
Andrew Tridgell
6022747b5b fixed character set init in smbw_sample
(This used to be commit c43593ad06)
2001-02-22 06:24:28 +00:00
Andrew Tridgell
4e1de143b3 - workaround filer lsa lookup bug for unknown sids
- add \ at start of name if not needed (another filer workaround)
(This used to be commit 48ab6297a1)
2001-02-22 06:22:20 +00:00
Andrew Tridgell
9ccbc1de06 cope with filer/NT/samba all in one binary. yeah.
we now don't open rw for acls
(This used to be commit c0f57c3fe6)
2001-02-22 03:40:01 +00:00
Andrew Tridgell
7fb8d5a00b fixed a crash bug in smbpasswd
(the user can come from optarg, so we can't free it)
(This used to be commit 56ffb58eff)
2001-02-21 04:13:47 +00:00
Andrew Tridgell
6cb19fbd3a don't need _uni hack now
(This used to be commit f191271986)
2001-02-20 23:53:06 +00:00
Andrew Tridgell
ca677a6d8d playing with CAP_NT_SMBS
(This used to be commit 3eff509a65)
2001-02-20 10:13:04 +00:00
Jeremy Allison
94fc44a93c Merge of JohnR's changes to appliance-head, JF's changes to 2.2,
updated the POSIX_ACL code to be in sync.
Jeremy.
(This used to be commit c0517d6f4e)
2001-02-12 16:18:02 +00:00
Tim Potter
a699e9b572 Some systems don't support SEC_RIGHTS_MAXIMUM_ALLOWED for lsa_open_policy()
but NT sends 0x2000000 so we might as well do it too.
(This used to be commit 394e17645b)
2001-01-23 17:33:35 +00:00
David O'Neill
ea1e6f9e7b Changes from APPLIANCE_HEAD:
source/lib/smbpasswd.c
        - Only call load_interfaces() when doing a network related
          operation.  This means you can add, remove, enable or disable
          smbpasswd entries without a network.  Changing passwords always
          requires a network.
(This used to be commit e2193c3a36)
2001-01-11 23:21:17 +00:00
Richard Sharpe
dca808cbc4 Needed a callback arg on cli_list ...
(This used to be commit d45e667a74)
2001-01-05 13:11:29 +00:00
Richard Sharpe
92ebc81734 I need a callback arg for cli_NetServerEnum and cli_RNetShareEnum, so I had
to modifiy any routine that calls it to pass NULL and so forth.

Should have no impact. It compiles OK.
(This used to be commit 7f862e387f)
2001-01-04 11:35:55 +00:00
Tim Potter
1459f1022c Return appropriate exit codes for various situations:
0 for success
    1 if operation failed
    2 command line parse error
(This used to be commit b4773618ac)
2000-12-21 23:36:25 +00:00
Tim Potter
ca727bd638 Don't call string_to_sid after cli_lsa_lookup_names() fails.
Can't use space as a ACL separator as it breaks NT user/group names that
contain spaces (i.e most of the default ones).

The MSDN is contradictory over the exact ordering of ACE entries in an ACL.
However NT4 gives a "The information may have been modified by a computer
running Windows NT 5.0" if denied ACEs do not appear before allowed ACEs.
Sort ACE list before calling cli_set_secdesc().
(This used to be commit 01a89978ff)
2000-12-21 06:21:26 +00:00
Tim Potter
855bcea38e Some systems seem to only accept a ntcreate&x with a unicode filename
despite samba negotiating ascii filenames.  Retry with unicode pathnames
if the ascii version fails.

Convert all forward slashes to backslashes in the filename argument.
(This used to be commit 935b77573e)
2000-12-21 05:28:39 +00:00
Tim Potter
d15bef816d Cleaned up SidToString() and StringToSid() exit paths.
Can now use user%password format in $USER environment variable.  -U option
is now optional.
(This used to be commit e21f2ef4fb)
2000-12-21 00:12:59 +00:00
Andrew Tridgell
abb9a2de72 implemented a much nicer name_status() interface. It now returns a
list of structures rather than the dodgy parsing code we had before

this also gets smbw working correctly with no initial workgroup (using
name_status_find on __MSBROWSE__ returns)
(This used to be commit f2be88a873)
2000-12-20 03:22:51 +00:00
Jeremy Allison
8325948287 Added -C username and -G username that allow a user (usually Administrator)
to change the ownership or group ownership of a file to any arbitrary user
from the UNIX command line.
This will show the people who quote NT manuals at us about how this is
"impossible" how their operating system really works :-).
Jeremy.
(This used to be commit 12f88c9ba7)
2000-12-16 00:08:05 +00:00
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