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

1340 Commits

Author SHA1 Message Date
Gerald W. Carter
4d2f71e53f Manually merge Steven Danneman's patch for SPNEGO auth to a trusted
Win2008 domain (merged from v3-0-test).

   commit 8dc4e97977
   Author: Steven Danneman <sdanneman@isilon.com>
   Date:   Wed May 7 13:34:26 2008 -0700

      spnego SPN fix when contacting trusted domains

      cli_session_setup_spnego() was not taking into consideration the situation
      where we're connecting to a trusted domain, specifically one (like W2K8)
      which doesn't return a SPN in the NegTokenInit.

      This caused two problems:

      1) When guessing the SPN using kerberos_get_default_realm_from_ccache() we
      were always using our default realm, not the realm of the domain we're
      connecting to.

      2) When falling back on NTLMSSP for authentication we were passing the name
      of the domain we're connecting to for use in our credentials when we should be
      passing our own workgroup name.

      The fix for both was to split the single "domain" parameter into
      "user_domain" and "dest_realm" parameters.  We use the "user_domain"
      parameter to pass into the NTLM call, and we used "dest_realm" to create an SPN
      if none was returned in the NegTokenInit2 packet.  If no "dest_realm" is
      provided we assume we're connecting to our own domain and use the credentials
      cache to build the SPN.

      Since we have a reasonable guess at the SPN, I removed the check that defaults
      us directly to NTLM when negHint is empty.
(This used to be commit b78b14c88e)
2008-05-23 16:01:45 -05:00
Michael Adam
a8045b1339 rpc_client: make rpc_pipe_open_tcp_port and rpc_pipe_get_tcp_port static.
Slim the interface...

Michael
(This used to be commit 9971118c23)
2008-05-22 11:30:04 +02:00
Michael Adam
b398a96b09 rpc_client: use endpoint mapper to get the port for rpc_pipe_open_tcp().
Michael
(This used to be commit f7db445c82)
2008-05-22 11:29:57 +02:00
Volker Lendecke
e8d25443c1 Add client support for NCACN_UNIX_STREAM
(This used to be commit 24ac40518f)
2008-05-21 23:35:25 +02:00
Volker Lendecke
78022953e7 rpccli_schannel_bind_data only needs the schannel key
(This used to be commit be5d54a363)
2008-05-21 23:35:25 +02:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Jeremy Allison
ce4145319e Remove conn_find_byname now it's no longer used in
the msdfs.c code.
Jeremy
(This used to be commit 54556df561)
2008-05-19 17:19:18 -07:00
Michael Adam
1ef69fcf21 build: freeze proto.h
Michael
(This used to be commit ff7f0cad2e)
2008-05-18 22:58:07 +02:00
Andrew Tridgell
15bf58b257 auto-build proto.h if its not there, but don't make it depend
on anything. Delete proto.h from CVS
(This used to be commit 8a37df73ec)
2001-06-22 02:33:27 +00:00
Jeremy Allison
3a6019b0eb Merging Gerry's spoolss changes.
Jeremy.
(This used to be commit 6b4a70cd82)
2001-06-21 17:46:14 +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
Andrew Tridgell
4ff011d88e Added STR_NOALIGN flags to clistr and srvstr fns. Yes, NT actually does
send unaligned unicode strings sometimes!
Fixed our handling of the workgroup name tacked on the end of the
NT1 negprot response (a unaligned unicode)
fixed a couple of places where we should be using the message_end fns instead
of pre-calculated buffer lengths
(This used to be commit 86613493a9)
2001-06-21 05:38:28 +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
Tim Potter
567612291e make proto
(This used to be commit d0b37d1a62)
2001-06-20 07:13:55 +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
Jeremy Allison
9203386063 INFO_24 sometimes has a 2 byte length, sometimes doesn't. Safer to not
depend on it...
Jeremy.
(This used to be commit 0fe11c329f)
2001-06-19 19:56:06 +00:00
Jeremy Allison
809c025878 Added patches to remove Linux specific XFS ACLs. These are now handled by the
generic Linux ACL code.
rpc_server/srv_samr_nt.c: Don't delete a policy handle before it's created.
Jeremy.
(This used to be commit db5b82e53a)
2001-06-18 20:27:35 +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
7b01c627c6 Removed silly Get_Hostbyname() wrapper as DNS names are case-insensitive
and the use of this function only increased timeouts when Samba queries
a broken DNS server.
(This used to be commit 720fea5360)
2001-06-18 05:42:18 +00:00
Jeremy Allison
af604fe769 Modified version of Jim's 0x27 and 0x28 Win9x Secdesc patch.
Jeremy.
(This used to be commit 5690ec77c8)
2001-06-16 00:32:13 +00:00
Jeremy Allison
438e89b187 Jim McDonough's parse patches for Win9x get SD calls.
Jeremy.
(This used to be commit bc366f3153)
2001-06-15 20:08:12 +00:00
Tim Potter
2b49ec356a Prototype update.
(This used to be commit 402639926f)
2001-06-15 07:22:27 +00:00
Tim Potter
f81489d02d Oops - proto.h contained junk from another workarea.
(This used to be commit 2ad921d126)
2001-06-13 06:54:45 +00:00
Tim Potter
5eee0f1968 Added some msdfs client routines.
(This used to be commit 13df2304b3)
2001-06-13 06:37:02 +00:00
Jeremy Allison
8209eda774 Make message receive fn static.
Jeremy.
(This used to be commit d8807b1922)
2001-06-13 01:08:27 +00:00
Jeremy Allison
a80a96b745 Added sys_acl_delete_def_file() - needed as part of NT ACL editing fix.
Will add changes for other supported ACL systems shortly (Herb, I may
need help with the IRIX one).
Jeremy.
(This used to be commit a8532b193d)
2001-06-08 19:29:57 +00:00
Jeremy Allison
3414c71f6d Extra stuff for large readwrite support.
Jeremy.
(This used to be commit 4338ee78c3)
2001-06-08 03:02:34 +00:00
Tim Potter
1dfbc939d3 Prototypes update.
(This used to be commit 6dfe98f602)
2001-06-06 07:29:12 +00:00
Tim Potter
9ebe63bf79 Update prototype file.
(This used to be commit bdb76938e2)
2001-06-02 23:03:18 +00:00
Tim Potter
26bc8adcaa Oops.
(This used to be commit 9e1d9a3a44)
2001-06-01 12:11:33 +00:00
Andrew Tridgell
ff1dd1721d new proto.h
(This used to be commit 823ba34342)
2001-05-30 06:16:24 +00:00
Simo Sorce
bbf5ea221a 4 new functions to retrieve single linked list of group and passwd entries
+ a fix to an infinite loop in srv_samr_nt.c caused by misuse of
setgrent/getgrent/endgrent solved by these new functions
(This used to be commit 97dbb54a13)
2001-05-29 07:34:01 +00:00
Jeremy Allison
15e66ba37a Added tdb_change_int_atomic() to allow atomic updates of a tdb int value.
Jeremy.
(This used to be commit cf5015f159)
2001-05-25 00:48:28 +00:00
Tim Potter
3dfb0d3bd9 Added structures for LOGON_CTRL rpc.
Make proto.
(This used to be commit 0650f87000)
2001-05-24 08:21:53 +00:00
Jeremy Allison
faa0bef196 Defensive brlock and locking database cleaning code.
Jeremy.
(This used to be commit d7aa42e459)
2001-05-22 20:35:48 +00:00
Gerald Carter
a8f8d81d54 make proto
(This used to be commit 97a88ca86b)
2001-05-18 04:12:19 +00:00
Jeremy Allison
c912d04389 Fix the W2KSP2 joining a Samba domain problem.
Jeremy.
(This used to be commit 6bbcab5e48)
2001-05-18 01:30:21 +00:00
Andrew Tridgell
8d9aadc2bc ran make proto
(This used to be commit 2e605e1275)
2001-05-17 11:29:54 +00:00
Richard Sharpe
43680ebeae Ran a make proto to fix the problems ...
(This used to be commit 7b275b4588)
2001-05-17 11:20:45 +00:00
Tim Potter
e522cebeb9 make proto
(This used to be commit 607db8d57d)
2001-05-14 04:11:31 +00:00
Jeremy Allison
495aa4c28a string_hash() should be static. hash_clear() should be void.
Jeremy.
(This used to be commit e8ab89fbc0)
2001-05-12 20:15:39 +00:00
Tim Potter
7a906cd02b make proto
(This used to be commit dd0c7a8a02)
2001-05-10 05:20:12 +00:00
Jeremy Allison
f5243954fa Made "security XXX" masks apply to ACL set. By default they have no effect.
Removed "restrict acl with mask" - redundent.
Jeremy.
(This used to be commit 0db8a61d71)
2001-05-10 01:03:44 +00:00
Tim Potter
b4944528d8 make proto
(This used to be commit 6d218c3e94)
2001-05-08 04:02:59 +00:00
Gerald Carter
495f6e6787 merge from 2.2 removing the 'domain XXX' parameters.
(This used to be commit 9aefc86e35)
2001-05-07 22:10:38 +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
Andrew Tridgell
c2887d57b5 rebuild proto.h
(This used to be commit 2e20734474)
2001-05-07 04:10:40 +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
Gerald Carter
e62b35ac69 make proto
(This used to be commit 09b287e178)
2001-05-04 14:01:54 +00:00
Tim Potter
6fb863c3f8 make proto
(This used to be commit a56badc206)
2001-05-04 07:36:51 +00:00
Jeremy Allison
aac630b382 Had to add a "pam password change" parameter (defaults to "off") and inlined
the pam password change code to ensure that existing and working password
chat scripts don't break with 2.2.1. PAM password changing has to be explicitly
requested.
Allowed wildcards in pam password change matching (matches password chat
script matching). Had to add const (sorry Tim :-) to ms_fnmatch() to
stop warnings. Don't worry - the const changes are isolated and don't
cause any other warnings :-).
Jeremy.
(This used to be commit 47b4d82536)
2001-05-02 23:32:09 +00:00
Jeremy Allison
dea501bc5f Fix noticed by John Trostel - we need to return our account SID for level 5.
Jeremy.
(This used to be commit acf32f277d)
2001-05-02 20:32:17 +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
Jeremy Allison
8bd2a11c86 Added code from "Nigel Williams" <nigel@veritas.com> (yes, the same famous
Nigel Williams who did NIS/GINA !) to implement add/modify/delete shares
for Win2k. Needs testing as I made a few mods to the original code.
Jeremy.
(This used to be commit 9b3dd80176)
2001-05-01 01:01:19 +00:00
Jeremy Allison
c3a999409d Based on an original PAM patch by Andrew Bartlett, re-written by me to
remove global static PAM variables, and to tidy up the PAM internals code.
Now looks like the rest of Samba.
Still needs testing.
Jeremy.
(This used to be commit 1648ac64a7)
2001-04-30 21:05:58 +00:00
Andrew Tridgell
63602d15af - fixed some compiler warnings
- fixed slprintf and vsprintf macros
(This used to be commit c986a3c51e)
2001-04-28 14:01:02 +00:00
Andrew Tridgell
d095b5249c - added test for vasprintf
- cleaned up GNUC printf attribute macros
- added enum handling in mkproto
- removed non-vararg code
- made slprintf and vslprintf just macros for snprintf and vsnprintf
- don't need slprintf code any more
(This used to be commit c7aeb2254d)
2001-04-28 13:49:34 +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
Gerald Carter
c3bf153c0c converted the passdb smbpasswd implementation to using talloc
for memory allocation.  This fixes a long standing seg fault
(i knew i would get around to it one day :) )

Tested with NT4 and Win2k.  Needs a little more testing with the
"create the machine account on the fly" code for NT4.

Simo, this is probably going to break the tdb passdb code.
Can you look at that when you get a chance and see what you think?
(This used to be commit 1c13110873)
2001-04-25 22:12:13 +00:00
Jeremy Allison
3e4c6d130c Fix "proc num out of range" error. Missing rpc call.
Jeremy.
(This used to be commit 6248fb2292)
2001-04-23 23:31:09 +00:00
Jeremy Allison
70b55a9abc Added "obey pam restrictions" parameter - default to "off".
Only set this to "on" if you know you have your PAM set up correctly.....
NB. Doesn't apply to plaintext password authentication, which must use
pam when compiled in.
Jeremy.
(This used to be commit 59aa99f390)
2001-04-23 20:43:20 +00:00
Jeremy Allison
ae8418d0c4 Added smb_ prefix to all Samba wrapper pam functions.
Fixed off by one bug using StrnCpy instead of strdup().
Jeremy.
(This used to be commit d4b1c0be2e)
2001-04-23 04:15:35 +00:00
Jeremy Allison
e277c08631 Commit of a modified version of Andrew Bartlett's patch that removes the
horrid utmp hostname parameter - now uses the client name instead.
Also tidies up some of the unencrypted password checking when PAM
is compiled in.
FIXME ! An pam_accountcheck() is being called even when smb encrypted
passwords are negotiated. Is this the correct thing to do when winbindd
is running ! This needs *SEVERE* testing....
Jeremy.
(This used to be commit 071c799f47)
2001-04-22 07:20:24 +00:00
Andrew Tridgell
ac9e221c3e merging from 2.2 to head
(This used to be commit bfcc6f8827)
2001-04-22 02:54:04 +00:00
Andrew Tridgell
9ce5a03ccb merge from 2.2
(This used to be commit f52a5014ee)
2001-04-18 16:41:04 +00:00
Jeremy Allison
6f78636a56 Removed mktemp from HEAD - same as done in 2.2.
Jeremy.
(This used to be commit 121b59669f)
2001-04-18 05:12:46 +00:00
Andrew Tridgell
4355098a75 hide unreadable patch from idra
(This used to be commit 7b6cfe2430)
2001-04-16 15:16:31 +00:00
Jeremy Allison
53850c51ca configure:
configure.in:
include/config.h.in:
include/profile.h:
smbd/vfs-wrap.c:
smbd/vfs.c:
Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway).
smbd/dosmode.c:
smbd/files.c:
printing/printfsp.c:
smbd/close.c:
smbd/open.c:
Fixed "dos filemode" correctly so there are no race conditions. Forces test
of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls
standard close function that preserves POSIX locks due to POSIX-me-harder
braindamage. :-). Andrew please review this code.
Also - in removing the tmpdir param in smbrun an extra NULL parameter
was missed in each print_run_command() call (which is a varargs fn.).
Now fixed.
Jeremy.
(This used to be commit 32397e5bc6)
2001-04-14 00:19:12 +00:00
Jeremy Allison
9444e9d9f3 Michael Davidson <md@sco.COM> pointed out that acl_get_qualifier can potentially
return a malloced area so added sys_acl_free_qualifier() calls to all supported
ACL interfaces to code with this (only Linux needs actual free call).
Jeremy.
(This used to be commit 5870e6019b)
2001-04-13 21:11:57 +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
50e78a9ac8 As Andrew suggested, make smbrun return a fd for a deleted file which can then
be read.
Jeremy.
(This used to be commit e7d59d6de8)
2001-04-13 00:37:00 +00:00
Jeremy Allison
09a5daf032 Changed lp_add/delete/enum scripts to use lockdir if spool dir doesn't
exist for printer. Rather than using pid for suffix, use a 16 byte random
string. Created generate_random_str() function in genrand.c. Still needs
more testing but this is the way to go.
Jeremy.
(This used to be commit 71a330987f)
2001-04-12 07:00:08 +00:00
Jeremy Allison
6578fd8742 To stop people complaining about the mktemp call, move it into lib/util.c. Thanks
to Andrew for all this code. Fixed extra line in lib/sysacls.c that broke
XFS ACL code.
Jeremy.
(This used to be commit 9b32b8a8cf)
2001-04-11 23:19:08 +00:00
Jeremy Allison
0ca9f5c023 Fix for core dump in security = share code with new share security db.
Jeremy.
(This used to be commit 20b13bafdf)
2001-04-11 21:19:25 +00:00
Jeremy Allison
3bfbc4aaec Fixed --with-automount compile error.
Jeremy.
(This used to be commit ab916199f5)
2001-04-10 21:43:37 +00:00
Jeremy Allison
2b9e23855e Set SD's for share. Added level 1501. Map GENERIC file bits to specific bits.
Jeremy.
(This used to be commit 04976c32f3)
2001-04-09 08:00:19 +00:00
Jeremy Allison
9d6dd97624 Added set/get SD's on shares. Check before tcon.
Jeremy.
(This used to be commit 036b1a8b09)
2001-04-09 06:36:38 +00:00
Jeremy Allison
607d5d508d Added per-share security tdb. Tidied up many slprintfs (need -1 on length).
Jeremy.
(This used to be commit d786191bc1)
2001-04-08 20:01:51 +00:00
Jeremy Allison
950f1d9605 Added 3 params to manipulate shares. "add share command/change share command/
delete share command". Implemented "delete" - more work to come on add and
change.
Jeremy.
(This used to be commit 2e6b1759e1)
2001-04-07 00:36:38 +00:00
Jeremy Allison
97cf9d3a3d Implemented stub function for NET_SHARE_DELETE. Now to implement the real
internals to support server manager.
Jeremy
(This used to be commit 3512ba1f65)
2001-04-06 18:25:17 +00:00
Jeremy Allison
3874261774 Added stub function for NET_SHARE_ADD. Once this is implemented to call a hook
function (same for NET_SHARE_DELETE and NET_SHARE_SET) we will be able to manage
the shares section in smb.conf via NT server manager........
This should enhance the friendliness of Samba in NT-only shops by an order of
magnitude.
Jeremy.
(This used to be commit a2cd5f2ba1)
2001-04-06 17:41:47 +00:00
Jeremy Allison
529f7c07f5 We can now use server manager to look at Samba shares. NT still expects a ":"
in the path though.... I'm looking into it.
Jeremy.
(This used to be commit a152c2c59a)
2001-04-06 01:39:12 +00:00
Jeremy Allison
852242a1b5 I know we're supposed to be feature frozen, but I couldn't resist this... :-).
I worked out and added the per-share get/set RPCs for security descriptors.
Currently this code returns Everyone, full access on get and permission denied
on set, but backending this with a tdb and checking it on tconX (to give full NT
semantics for security on shares) is now an excersise for the reader... :-).
Jeremy.
(This used to be commit 3bfd155ba7)
2001-04-04 23:42:17 +00:00
Jeremy Allison
da8731e271 Sync up with new NT forms code.
Jeremy.
(This used to be commit 63ce316d87)
2001-04-03 22:41:31 +00:00
Jeremy Allison
9f793948bd include/ntdomain.h:
rpc_server/srv_lsa_hnd.c: Remove back pointer from policy handle list as the pipe
						that opened the handle may have been closed. We were dereferencing
						into something that had been closed.
rpc_parse/parse_spoolss.c: Sync up with Gerald's changes in 2.2.
lib/replace.c: Don't do proto on setlinebuf as it differs between systems.
Jeremy.
(This used to be commit 887ef3e12d)
2001-04-02 22:27:40 +00:00
Jeremy Allison
92368833fa configure configure.in include/config.h.in lib/replace.c: Added test and replacement
for setlinebuf which apparantly doesn't exist on HPUX 11.
include/byteorder.h:
rpc_parse/parse_prs.c:
Ding Dong the witch is dead ! :-). Ok, I'm happy 'cos I've finally deleted
all the *HORRIBLE* DBG_RW_XXX and RW_XXX macros from include/byteorder.h.
They were macros that included macros that had conditional macros included.
No one understood them (they were the cause of most of the bigendian issue
bugs). Finally, I went into parse_prs.c and inlined all of that stuff with
regular function calls. They're understandable, they're easy to edit and
they don't include macros !
JF - please look at the one comment I added (JF PLEASE CHECK). I have
tested this partly with IRIX (a bigendian system) running with AS/U on
a Solaris box in SGI's lab, and I've also confirmed these new changes
work with W2K (vmware) but there may be the odd bug lurking. Herb, if
you could re-checkout and test again with this code that would help.

Extra.  Fixed bug spotted by the sharp eyes of JF - big endian unicode
packet would cause a early truncate of string parsing as we were checking for a char *
0, not a uint16 * 0.

Jeremy.
(This used to be commit 13765eca71)
2001-03-31 19:06:45 +00:00
Andrew Tridgell
578a9fabfb started converting some of the only-ascii code to use srvstr_*
added srvstr_push_ascii() and srvstr_pull_ascii() as convenience
routines to replace the current usage of strncpy() like fns
for packet pull/push. We need to do this in *lots* of places
in Samba in order to get our codepage handling right
(This used to be commit 8b0e3679a6)
2001-03-31 13:48:24 +00:00
Jeremy Allison
6e7f03f9b9 This is a big, rather ugly patch. Whilst investigating the files not truncated
when copying to a full disk problem, I discovered that we were not allowing
the delete on close flag to be set properly, this led to other things, and
after investigation of the proper delete on close semantics and their relationship
to the file_share_delete flag I discovered there were some cases where we
weren't doing the deny modes properly. And this after only 5 years working
on them..... :-) :-).
So here's the latest attempt. I realised the delete on close flag needs to
be set across all smbds with a dev/ino pair open - in addition, the delete
on close flag, allow share delete and delete access requested all need to
be stored in the share mode tdb.
The "delete_on_close" entry in the fsp struct is now redundant and should
really be removed. This may also mean we can get rid of the "iterate_fsp"
calls that I didn't like adding in the first place. Whilst doing this patch,
I also discovered we needed to do the se_map_generic() call for file opens
and POSIX ACL mapping, so I added that also.
This code, although ugly, now passes the deny mode torture tests plus the
delete on close tests I added. I do need to add one more multiple connection
delete on close test to make sure I got the semantics exactly right, plus we
should also (as Andrew suggested) move to random testing here.

The good news is that NT should now correctly delete the file on disk
full error when copying to a disk :-).

Jeremy.
(This used to be commit 51987684bd)
2001-03-30 08:57:24 +00:00
Jeremy Allison
34508053bf Added cli_nt_delete_on_close() call to allow flag to be set for torture tests.
Jeremy.
(This used to be commit 6f7d9e29e4)
2001-03-29 02:58:47 +00:00
Jeremy Allison
1b95784324 Added cli_nt_create_full() as a way to get at all the ntcreate parameters.
Used in smbtorture mods. Re-cast cli_nt_create() as a call to cli_nt_create_full().
Jeremy.
(This used to be commit f602fa1205)
2001-03-29 00:58:52 +00:00
Gerald Carter
738a83a14f rename of 16 new_smb_io functions to smb_io_* for consistency sake
(merge from 2.2)
(This used to be commit ea963a648b)
2001-03-28 16:08:00 +00:00
Gerald Carter
5909b892b6 make proto
(This used to be commit 0799b272a0)
2001-03-27 18:19:21 +00:00
Jeremy Allison
e53d7eb25e Patch from David Gibson <dgibson@linuxcare.com> to reduce "silent abort"
problems with smbd failing to create a log file. If we can't create a log
file keep using the old file.
Jeremy.
(This used to be commit c4e6aa1322)
2001-03-27 01:19:54 +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
370664344a Fix insure-found parameter size missmatch.
Jeremy.
(This used to be commit 2f658691e4)
2001-03-23 19:01:27 +00:00
Jeremy Allison
a447217509 Two OS/2 printer fixes from Jim McDonough @ IBM.
First one adds a new info level into the lanman printing and an ioctl to the trans2 code.
    Andrew - this uses ASCII only. It looks ok to me but please check !
Second one adds a parameter "os2 driver map" that allows OS/2 driver names to be mapped.
Jeremy.
(This used to be commit da79b519e0)
2001-03-23 03:12:58 +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
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
0f2b15707a added option "enhanced browsing"
this allows users to disable the cross-subnet browse extensions that I
added to Samba a couple of years ago. This may be useful for getting
rid of empty workgroups.
(This used to be commit 978980050e)
2001-03-21 04:12:36 +00:00
Jeremy Allison
beec1ea829 Fix for crash when doing name lookup with a quoted string. Part of
lookup_name was expecting to be able to write to the string. Changed
lookup_name to use const.
Jeremy.
(This used to be commit 80c18d8849)
2001-03-20 23:07:36 +00:00
Gerald Carter
344fb49fbf reverted the rename of new_spoolss_io_r_enumprinterdrivers()
(This used to be commit fd6bfe03f4)
2001-03-19 18:14:09 +00:00
Jeremy Allison
c7a953a318 Added sys_dlopen/sys_dlsym/sys_dlclose.
Jeremy.
(This used to be commit 49f0e7e714)
2001-03-19 07:08:02 +00:00
Andrew Tridgell
e17e7b6417 added basic command completion support
(This used to be commit 386fdff2df)
2001-03-19 00:22:52 +00:00
Andrew Tridgell
bc25293f96 much simpler readline code
should work with readline 2.x
(This used to be commit 7940b6b0cf)
2001-03-18 23:41:53 +00:00
Andrew Tridgell
9c4927d362 much better readline support from Simo Sorce, with some mods from me
to make it a bit simpler
(This used to be commit e1487eb2c4)
2001-03-18 13:24:57 +00:00
Andrew Tridgell
c9b8da47a6 enable unicode on the wire by default in smbd
the unicode support isn't complete, but it is good enough to be usable
for a test server.
(This used to be commit e787fc1daf)
2001-03-16 02:31:24 +00:00
Gerald Carter
095cb8032e make proto
(This used to be commit 8b2e21c333)
2001-03-15 22:07:17 +00:00
Gerald Carter
a23909d764 make proto
(This used to be commit 86c56a6921)
2001-03-15 16:43:43 +00:00
Gerald Carter
f758474f32 make proto
(This used to be commit 7a84bc93ed)
2001-03-15 07:14:33 +00:00
Gerald Carter
4eecea3edf make proto
(This used to be commit 161842a3e0)
2001-03-15 02:16:18 +00:00
Jeremy Allison
4ab6182a0f AS/U on a sparc now joins and authenticates against a Samba PDC !
Jeremy.
(This used to be commit 28a0bc5f57)
2001-03-15 00:49:13 +00:00
Gerald Carter
2335c1d178 last make proto got messed up it seems
(This used to be commit b28d51c8e8)
2001-03-14 20:46:04 +00:00
Gerald Carter
bab69dcdf2 make proto
(This used to be commit 04d74c20bc)
2001-03-14 20:28:42 +00:00
Andrew Tridgell
fbab616c14 don't need srvstr_push_size or srvstr_pull_size
(This used to be commit d5b39a1d43)
2001-03-14 12:45:46 +00:00
Andrew Tridgell
9ea70bd003 simpler clistr interface which handles individual packets having
unicode bit set differently to capabilities
(This used to be commit 34a0821e08)
2001-03-14 12:42:43 +00:00
Andrew Tridgell
ff0462cde8 simpler and more correct srvstr_push()
it now uses outbuf not inbuf for the unicode flag, which
allows for some server fns to be ascii and means one less
parameter in push calls
(This used to be commit a6dd666226)
2001-03-13 22:00:46 +00:00
Jeremy Allison
e532d96a26 Move to a handle database per pipe name, not per pipe.
Jeremy.
(This used to be commit a24b248a77)
2001-03-13 20:18:45 +00:00
Jeremy Allison
0ef2179d23 Fixed reading of strings from big-endian RPC clients.
Jeremy.
(This used to be commit e7ecb9410f)
2001-03-13 01:44:05 +00:00
Jeremy Allison
b840dce676 Moved cruft out of smb.h into ntdomain.h where it belongs. dc struct
now in pipe struct (where used) rather than user_struct.
Secured machine account password changing in srv_netlog_nt.c - ensure
that only the given machine can change its own password. May need to
free this up later for NT admin tools, but this is a fail-safe secure
position for now.
Jeremy.
(This used to be commit 46b12f2275)
2001-03-11 22:26:28 +00:00
Jeremy Allison
a2e5dbb112 Remove "BYTE" - we already have uint8 - don't need more conflicts with
system header files...
Jeremy.
(This used to be commit 31e0ce310e)
2001-03-11 00:51:54 +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
Andrew Tridgell
45c2ee3ff2 to use the same macros in the client and server rename the CLISTR_
macros to STR_
(This used to be commit 95c9e4e0ba)
2001-03-10 11:35:25 +00:00
Jeremy Allison
00ab9021b0 Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
(This used to be commit 0cd37c831d)
2001-03-09 23:48:58 +00:00
Gerald Carter
0bfc10011b merge of 'lanman auth' and 'min protocol' from 2.2
(This used to be commit 1d84da779a)
2001-03-09 18:59:16 +00:00
Jeremy Allison
393bede7db Sync up handle creation with 2.2 branch. We can now join AS/U domains and
authenticate against them. Big/little endian issues fixed.
Jeremy.
(This used to be commit 0e6a34510e)
2001-03-07 23:59:13 +00:00
Jeremy Allison
93169a1f34 Roll back to using malloc/realloc on some of spoolss in head.
I'm having problems with talloc_realloc in the 2.2 branch and I
want a stable reference.

The only problem is this breaks the clean auto-generated code
in *one* call in srv_spoolss.c (the rfnpcnex call).

Jeremy.
(This used to be commit 57a9340cba)
2001-03-03 05:27:26 +00:00
Jeremy Allison
74294f5a96 Move to talloc controlled NT forms.
Jeremy.
(This used to be commit 3e190e6933)
2001-03-02 00:20:43 +00:00
Jeremy Allison
c014d3b709 Remove unused code.
Jeremy.
(This used to be commit 3495d5cc3b)
2001-03-01 00:40:25 +00:00
Jeremy Allison
30d74f54e6 Finished converion of spoolss code to canonical format. Now to work on the
PRINT_XX struct alloc/free issues.
Jeremy.
(This used to be commit db98d4b020)
2001-02-28 21:19:31 +00:00
Jeremy Allison
acc06fc7a8 More converted to canonical format. Home now - do the rest tomorrow...
Jeremy.
(This used to be commit 9d5979f51e)
2001-02-28 02:38:09 +00:00
Jeremy Allison
2a258f7a64 Converted more to canonical format... save as I go.,
Jeremy.
(This used to be commit 1d4ff7a81b)
2001-02-28 02:03:02 +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
Jeremy Allison
403562cb94 Partial conversion of SPOOLSS code to canonical format. More to follow.
Once complete then the PRINTER_XX functions and structures will be converted
to talloc control.
Jeremy.
(This used to be commit 8171cc5642)
2001-02-28 01:24:55 +00:00
Jeremy Allison
0f2799aaf1 Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree.
Jeremy.
(This used to be commit 14d5997dc8)
2001-02-28 00:51:02 +00:00
Jeremy Allison
5265ce7837 Added total memory allocated counter to talloc, so we can tell if a talloc
pool is getting bloated. Also added a talloc_zero function to return zeroed memory.
Added debug in rpc_server/srv_pipe_hnd.c so we know when a talloc pool is being
freed. Syncup with srv_pipe_hnd.c from 2.2 so we are freeing memory at the same time.
Jeremy.
(This used to be commit d3a56c6042)
2001-02-27 19:22:02 +00:00
Jeremy Allison
ef2de912f2 Separated dfs pipe into implementation and interface modules.
rpc_parse/parse_dfs.c: Had to add buffer overrun checking ! HOW DID THIS GET IN HERE !
rpc_parse/parse_prs.c: Ensure prs_alloc_mem does a memset of zero before returning.
Jeremy.
(This used to be commit c9a6a17025)
2001-02-27 02:09:50 +00:00
Jeremy Allison
de187df10c Split srvsvc pipe into interface and implementation modules.
Jeremy.
(This used to be commit e14c88ddf4)
2001-02-26 22:05:41 +00:00
Jeremy Allison
95731132dc Split wks pipe into interface and implementation modules.
Jeremy.
(This used to be commit 6a16b3850f)
2001-02-26 20:06:25 +00:00
Jeremy Allison
d757d61abf Separated lsa code into interface and implementation.
Jeremy.
(This used to be commit 1cc96e0340)
2001-02-26 19:45:00 +00:00
Jeremy Allison
683ccef0bd Started conversion of lsa server code to canonical format (as srv_reg and
srv_samr have been).
Jeremy.
(This used to be commit f434cda977)
2001-02-26 08:10:51 +00:00
Andrew Tridgell
8cfc745339 updated prototypes
(This used to be commit 2a94e8e02d)
2001-02-26 05:14:57 +00:00
Jeremy Allison
1c8eb37534 Separated reg code into interface & implementation.
libsmb/namequery.c: Removed ununsed variables.
Jeremy.
(This used to be commit b857113f40)
2001-02-25 02:14:49 +00:00
Jeremy Allison
f93bb0801c rpc_client/cli_netlogon.c: Fixed incorrect printf.
Added Solaris ACL support.
Jeremy.
(This used to be commit f0d11b6997)
2001-02-25 00:24:54 +00:00
Andrew Tridgell
d689f00026 converted the last couple of functions in libsmb to be unicode
the whole of libsmb should now do unicode where appropriate
(This used to be commit ac7529d2b6)
2001-02-21 04:14:28 +00:00
Andrew Tridgell
a8ab984078 the unicode conversion of our client code is complete enough to be
enabled by default

you can disable it by setting the environment variable CLI_FORCE_ASCII
(This used to be commit 4d59c08c5e)
2001-02-21 03:40:20 +00:00
Andrew Tridgell
8acf5e0448 - neater setting of bcc
- converted cli_rename and cli_unlink
(This used to be commit 0a8992e224)
2001-02-20 12:45:50 +00:00
Andrew Tridgell
c565c98723 pipe opening now works with unicode
(This used to be commit ba3ce3404e)
2001-02-20 10:11:40 +00:00
Andrew Tridgell
6492d6b2f6 initial client side unicode support (needed for netapp filer)
I've currently got this code disabled by default as it is
incomplete. You enable it by setting a USE_UNICODE environment
variable. Once the support is complete this check will be removed and
the CAP_UNICODE capability bit will be the sole determination of
whether the client library code uses unicode

right now I have converted session_setup and tconx. I will do more fns
over the next few days.

see clistr.c for the new client side string interface. Luckily it
tends to make the code smaller and neater while adding unicode
support.
(This used to be commit e1a04e621f)
2001-02-20 08:09:06 +00:00
Richard Sharpe
8a3d6ee07e Change code around and add retry to deal with the occassional loss of NetBIOS datagrams responses, either via TDB or direct receive ...
(This used to be commit 54b0fbe98b)
2001-02-19 02:17:27 +00:00
Jeremy Allison
fd46817f0b Excise snprintf -> slprintf.
srv_samr.c: duplicate gid fix.
srv_spoolss_nt.c: Merge of JF's work.
uid.c: Fix for returning names when a PDC.
Jeremy.
(This used to be commit d938ad6963)
2001-02-16 19:21:18 +00:00
Tim Potter
64172d82fc Merge of i18n fixes from appliance branch. Samba can now talk to a network
with a PDC that has international netbios name and domain name.  There's
still quite a bit of i18n stuff to fix though...
(This used to be commit 79045bd72a)
2001-02-14 05:34:50 +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
13577addd7 Updated proto.h
(This used to be commit 0102eea147)
2001-02-11 22:36:20 +00:00
David O'Neill
4a9fb6b6b7 Changes from SAMBA_2_2:
source/rpc_server/srv_spoolss_nt.c
    source/rpc_server/srv_spoolss.c
    source/include/proto.h
        - correct checking of access_required in openprinterex as talked
          with John R. and Jerry.
          You can only do server stuff (adding printers, changing forms,
          ..) if you're root or if user is in printer admin list.
          Printers options are grayed if you don't have the
          PRINTER_ADMINISTER flag in the secdesc.
(This used to be commit f449d871bf)
2001-01-31 18:34:49 +00:00
Jeremy Allison
4d6b6eb94a lib/system.c: Fix for pw caching.
srv_samr.c: Fix for pw caching.
smbd/nttrans.c: Fix to allow trans create to set ACL on open.
Jeremy.
(This used to be commit c4f810a758)
2001-01-31 05:14:31 +00:00
David O'Neill
2506c61ab3 Changes from APPLIANCE_HEAD:
source/include/proto.h
        - make proto

    source/printing/nt_printing.c
    source/rpc_server/srv_spoolss_nt.c
        - Fix for the overwriting of printerdata entries when WinNT and
          Win2k are modifying printer parameters on PCL printers. Turns out
          that Win2k creates a printer with a NULL devmode entry and then
          expects to set it on *OPEN* (yes this is insane). So we cannot
          return a "default" devmode for a printer - and we must allow an
          open to set it.

    source/tdb/tdb.c
        - Show freelist in an easier format. Show total free.
        - When storing a new record, allocate memory for the key + data
          before the tdb_allocate() as if the malloc fails a (sparse) hole
          is left in the tdb.

    source/tdb/tdbtool.c
        - Show freelist in an easier format. Show total free.

    source/tdb/Makefile
        - cleaned up Makefile dependancies

    source/smbd/lanman.c
        -  Fix for Win9x corrupting it's own parameter string.

    source/printing/printfsp.c
    source/printing/printing.c
    source/rpc_server/srv_spoolss_nt.c
    source/smbd/close.c
        - Added normal close parameter into print_fsp_end() which treats an
          abnormal close as error condition and deletes the spool file.
(This used to be commit 025f7a092a)
2001-01-29 21:34:08 +00:00
Jeremy Allison
cf90dbd158 Fixed "object picker can't determine if object in domain" bug seen from W2K
clients. Did this by importing Samba-TNG code that correctly handles LSA
lookups.
*MANY* thanks to Luke, Sander, Elrond and the rest of the TNG gang !
Jeremy
(This used to be commit f76dc952f7)
2001-01-25 02:35:50 +00:00
Jeremy Allison
24f8e973b2 smbd/process.c: & type with 0xff for paranioa sake...
smbd/reply.c smbd/service.c: cause all "add home service" calls to go through a
winbindd aware function.
Jeremy.
(This used to be commit a72d12e992)
2001-01-24 19:34:53 +00:00
David O'Neill
eee29958f5 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - add an access check to _spoolss_deleteprinter() to stop random
          users and passers by from deleting printers.

    source/lib/messages.c
        - converted global msg_all struct to a local in message_send_all()
          function.

    source/include/smb.h
        - added a success error code to the spoolss return codes.

    source/include/proto.h
    source/param/loadparm.c
    source/printing/printing.c
        - Added new parameter "total print jobs" to limit the total number
          of print jobs across all queues. Currently individual queues are
          limited by "max print jobs".
(This used to be commit 02f154e729)
2001-01-23 20:25:25 +00:00
Jeremy Allison
2f7c1db093 include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added fchmod_acl and chmod_acl.
lib/substitute.c:
smbd/lanman.c:
smbd/open.c:
smbd/process.c:
smbd/reply.c:
smbd/service.c: Removed sessetup_user variable. Added current_user_info struct
which conatins domain info etc. Added '%D' for client domain parameter.
Jeremy.
(This used to be commit 2844ec3d51)
2001-01-23 01:52:30 +00:00
David O'Neill
c4e0cb72bc Changes from APPLIANCE_HEAD:
source/include/proto.h
		- make proto

	source/rpc_server/srv_spoolss_nt.c
		- clean up incorrect debug statement
(This used to be commit f07f4e9c7b)
2001-01-19 16:58:23 +00:00
David O'Neill
22363b9d78 Changes from APPLIANCE_HEAD:
source/include/proto.h
    source/include/rpc_spoolss.h
    source/rpc_parse/parse_spoolss.c
    source/rpc_server/srv_spoolss.c
    source/rpc_server/srv_spoolss_nt.c
        - speedups in printer queue enumeration  - still room for
          improvement.  The construct_dev_mode() still creates and destroys
          a printer info_2 structure every time it is called.
        - fixed job->devmode memory leak
        - converted printer job notification routines to use tallocated
          memory rather than a fixed 2K buffer.   This reduces the memory
          requirements of a 4500 job queue enumeration from 90MB to about
          16MB.
(This used to be commit 7853b27bc1)
2001-01-17 22:55:02 +00:00
Tim Potter
31f42d9fab New proto and some small changes to rpc_samr.h
(This used to be commit 7f31d4ab1d)
2001-01-15 23:39:20 +00:00
Jeremy Allison
cffc311b8a Fixed typo with acl_set_fd() not needing an ACL_TYPE_T parameter.
Ensure HAVE_NO_ACLS is set in configure if ACL support not selected.
Jeremy
(This used to be commit 523c919356)
2001-01-11 23:41:33 +00:00
Tim Potter
bd72966aaa New makefile and proto for rpcclient.
(This used to be commit fdf044c351)
2001-01-11 23:11:16 +00:00
Tim Potter
7bf2d9864e make proto
(This used to be commit fc16106e94)
2001-01-11 23:00:07 +00:00
Jeremy Allison
d7c7283463 First compiling version of code that sets NT ACLs as POSIX ACLs.
Now the debugging starts.... :-).
Jeremy.
(This used to be commit 2300ac79f5)
2001-01-11 22:37:59 +00:00
Jeremy Allison
adb91565b5 rpc_server/srv_samr.c:
smbd/reply.c:
Added fix needed for appliances. When using winbindd - a new user may
exist (from winbind) but have no home directory. Extend add user script
so it is called with a %H substitution when a user exists but their home
directory does not. Thanks to Alex Win at VA Linux for finding this one
and testing the fix.
libsmb/clidgram.c: Fixed missing return statements.
smbd/uid.c: Fixed typo in debug.
Jeremy.
(This used to be commit 7ba0a2192b)
2001-01-11 18:38:55 +00:00
David O'Neill
17ab0c2acc Changes from APPLIANCE_HEAD:
source/include/proto.h
    source/param/loadparm.c
    source/passdb/passdb.c
    source/rpc_server/srv_samr.c
        - add support for "hide local users" option to HEAD.
(This used to be commit 44dc339fe7)
2001-01-10 16:05:41 +00:00
Jeremy Allison
615af12cf2 Fix from "B.V.Dean" <B.V.Dean@ukc.ac.uk> to add "dos filemode" parameter
to allow a chmod to be done if the user has write access to a file, just
like Windows allows. Off by default (compare with "dos filetimes" parameter).
Jeremy.
(This used to be commit 8abdf0e29f)
2001-01-09 20:34:37 +00:00
Richard Sharpe
de00f5e677 Fix proto.h ...
(This used to be commit 0219767c93)
2001-01-06 21:42:22 +00:00
Richard Sharpe
5d7a98bbce Arrgh, forgot to update proto.h with all the changes I have been making.
Here is an updated one.
(This used to be commit 12639e2b36)
2001-01-05 22:30:04 +00:00
David O'Neill
23807f2b30 Changes from APPLIANCE_HEAD:
source/Makefile.in
        - changes to ctags and etags rules that somehow got lost along the way.

    source/include/proto.h
        - make proto

    source/smbd/sec_ctx.c
    source/smbd/password.c
        - merge debugs for debugging user groups and NT token stuff.

    source/lib/util_str.c
        - capitalise domain name returned from parse_domain_user()

    source/nsswitch/wb_client.c
        - fix broken conditional in debug statement.

    source/include/rpc_secdes.h
    source/include/rpc_spoolss.h
    source/printing/nt_printing.c
    source/lib/util_seaccess.c
        - fix printer permission bugs related to ACE masks for printers.
          This adds mapping of generic access rights to object specific
          rights for NT printers.  Still need to work out whether or not to
          ignore ACEs with certain flags set, though. See comments in
          util_seaccess.c:check_ace() for details.

    source/printing/nt_printing.c
    source/printing/printing.c
        - use PRINTER_ACCESS_ADMINISTER instead of JOB_ACCESS_ADMINISTER
          until we sort out printer/printjob permission stuff.
(This used to be commit 1dba9c5cd1)
2001-01-04 19:27:08 +00:00
Tim Potter
7b82fa6f71 make proto
(This used to be commit a1ea59c9af)
2000-12-21 22:58:26 +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
7bf9d8ce4b Fixed bug found by Gerald. If a Samba server joins a domain and is set
to search for a DC to authenticate to using the "*" syntax than ensure
that for the first hour after the password change is searches for the
PDC using the 1B name not the 1C name as domain replication may not
have occured.
Jeremy.
(This used to be commit c25533de99)
2000-12-19 23:57:48 +00:00
Jeremy Allison
ed7ecca3aa Split the one sys_acl_free call into sys_acl_free_TYPE calls, to allow
easier wrapping of non-POSIX ACL interfaces.
Jeremy.
(This used to be commit 1a31b4eb08)
2000-12-19 18:41:51 +00:00
Jeremy Allison
99c2693c62 Added lock backouts on fail.
When chaining together long lines of bloody "if" statements, which should
logically be separated, and one of them allocates memory, remember to
*free* it *WHETHER OR NOT THE IF STATEMENTS SUCCEEDED* !!!!
Yes I do consider this a bug in the coding style of Tridge, Rusty, Tim et al. :-).
I'm just pissed 'cos this took 4 hours to track down even with an insure error report
stating me in the face and also Ben Woodward looking over the code with me :-).
Jeremy.
(This used to be commit 506b5e34c3)
2000-12-15 21:29:06 +00:00
Jean-François Micouleau
89af6fd745 lib/util_unistr.c:
rewrote unistr2_to_ascii() to correct a bug seen on SGI boxes.

rpc_parse/parse_misc.c:
rpc_parse/parse_prs.c:
        rewrote of BUFFER5 handling to NOT byteswap when it was already in
        network byte order.

rpc_parse/parse_samr.c:
        cleanup of samr_io_q_lookup_domain(), remove the over-parsing by 2
        bytes.

rpc_server/srv_lsa.c:
        UNISTR2 strings need to be NULL terminated to pleased W2K.

rpc_server/srv_spoolss_nt.c:
        use snprintf instead of safe_strcpy as we want the string
        truncated at 32 chars.


That should fix SUN and SGI box not able to act as printserver and the
problem with joining from a W2K wks.

        J.F.
(This used to be commit 69fe739303)
2000-12-15 09:31:56 +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
Jeremy Allison
5c67f8de46 Added proto definition for new RPC calls.
Added printing fix from appliance-head.
Jeremy.
(This used to be commit f4c7f9ddb9)
2000-12-13 19:55:48 +00:00
Tim Potter
ed6f6ca043 Server side changes for dynamic names in lsa_lookup_names
(This used to be commit 5c5c3a8a08)
2000-12-13 12:39:55 +00:00
Tim Potter
6de135b0b2 make proto
Updates for dynamic sized lookup names/sids
(This used to be commit 34743c1576)
2000-12-13 12:13:22 +00:00
Jeremy Allison
20ac3fc77e Merged in Tim's changes : Removed static limit of MAX_LOOKUP_SIDS in rpc server and client
lsa_lookup_names() and lsa_lookup_sids().
Jeremy.
(This used to be commit 9e9c71c8b3)
2000-12-12 02:45:11 +00:00
Jeremy Allison
276364e2a4 Removed the special casing of SIDs in se_access_check. This is now done (correctly)
when the NT_USER_TOKEN is *created*.
Jeremy.
(This used to be commit 27d72ed1cf)
2000-12-12 02:36:14 +00:00
Andrew Tridgell
0961ed2b56 new prototypes
(This used to be commit 2258a62365)
2000-12-11 00:10:06 +00:00
Tim Potter
3478427f2e Port of lsa_lookup_sids() and lsa_lookup_names() rpc client functions from
TNG branch.

Re-instated lsa_lookup_sids and lsa_lookup_names functions in rpcclient.

This requires most samba binaries to link in another handful of object
files due to uncessary coupling between modules.  )-:
(This used to be commit 817819d0cc)
2000-12-08 03:34:00 +00:00
Jeremy Allison
cf5b71994d file_lines_load/file_lines_pload can now optionally convert unix_to_dos()
on read.
Jeremy.
(This used to be commit 76b8dd376d)
2000-12-07 19:26:04 +00:00
Jeremy Allison
423227d7ca Working code to read POSIX ACLs on a Linux system using the bestbits
ACL patch from http://acl.bestbits.at/.
configure support needs more work (just assumes correct headers at
the moment). ACL writing needs adding.
Jeremy.
(This used to be commit 6ae63e502e)
2000-12-07 05:38:01 +00:00
Jeremy Allison
70922b9bbe Cause smbd to use the new posix_acls code, not the old unix_acls code.
Currently does exactly the same thing (returns ACLs the same way). This
code is written to try and get a POSIX ACL via the abstract sys_XX interface,
then fall back to providing a UNIX based ACL if the calls fail. Seems to
work. Next step is to add a --with-posix-acls to configure.in and then
check on a POSIX ACL system that a complex ACL is returned correctly
as an NT ACL. Note that the ACL set (a more complex problem) is not
addressed yet.
Jeremy.
(This used to be commit 4339e20202)
2000-12-06 23:24:31 +00:00
Tim Potter
bd54bcb397 make proto again
(This used to be commit 746e03dce8)
2000-12-06 02:55:08 +00:00
Tim Potter
a58ca91245 tdb_unlockchain() no longer returns a value
(This used to be commit aee52c7acf)
2000-12-06 02:51:13 +00:00
Jeremy Allison
7e4c4721b4 Changed to sourceforge tdb code. This includes spinlocks (so we now have
a --with-spinlocks option to configure, this does mean the on-disk tdb
format has changed, so 2.2alphaX sites will need to re-create their
tdb's. The upside is no more tdb fragmentation and a +5% on netbench.
Swings and roundabouts....
Jeremy.
(This used to be commit 9dea7b7c25)
2000-12-06 00:05:15 +00:00
Andrew Tridgell
d931013008 pass the desired access into cli_nt_create()
(This used to be commit a2d07994e0)
2000-12-04 07:26:56 +00:00
Andrew Tridgell
af4649bdf3 new proto
(This used to be commit 27c676cb3b)
2000-12-04 02:01:12 +00:00
Andrew Tridgell
efcb07a0dd new protos
(This used to be commit 0a990f02d0)
2000-12-03 11:05:30 +00:00
Andrew Tridgell
856816754d new proto
(This used to be commit 2f21a0b100)
2000-12-03 02:20:33 +00:00
Jeremy Allison
0f1c800f85 passdb/secrets.c passdb/smbpassfile.c smbd/server.c : Actually *use* the code
written to transition from an old DOMAIN.MACHINE.MAC file to secrets.tdb.
printing/nt_printing.c: Fix case insensitive name lookups for driver files.
John - this should fix the Win9x/WinME problem correctly.
Jeremy.
(This used to be commit 8f3332a9ac)
2000-11-27 23:59:42 +00:00
Gerald Carter
eb2f9f8c92 make proto
(This used to be commit e0a02249d3)
2000-11-21 06:01:53 +00:00
Jeremy Allison
475fb713a9 Fix for memory leak when adding driver.
Jeremy.
(This used to be commit eeab4e0290)
2000-11-17 02:22:35 +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
Jeremy Allison
4bce271e4f Merge from appliance head of JR's changes for driver versioning.
Jeremy.
(This used to be commit cdbd2e9977)
2000-11-14 21:56:32 +00:00
David O'Neill
47dc568a3b - fix "declaration of 'time' shadows global declaration" warning.
(This used to be commit 92ff07132b)
2000-11-14 15:50:30 +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
Tim Potter
29cb8c12ca make proto
(This used to be commit 88a2d224f1)
2000-11-08 00:19:30 +00:00
Tim Potter
e5225bfc6b make proto
(This used to be commit 6ced1bb8b9)
2000-11-07 17:48:54 +00:00
Tim Potter
80dcdd1cf4 proto.h was out of date.
(This used to be commit 63e4f62916)
2000-10-29 23:52:21 +00:00
Jeremy Allison
1cb444057a David Lee's utmp patch (finally). Thanks David !
Jeremy.
(This used to be commit b809a2d0c8)
2000-10-28 19:38:39 +00:00
Jeremy Allison
9a8749d33a Added John Reillys patch for error code returns from clean_up_printer_driver_strunct()
calls.
Jeremy.
(This used to be commit f81a2a03bf)
2000-10-26 22:09:22 +00:00
Jeremy Allison
b5ac72cc64 Sorry JF - no billable hours :-). I fixed the "stream of events" problem
with PCL drivers. The problem was we were updating the changeid on every
SETPRINTERDATA/DELETEPRINTERDATA call. We should not do this, we should
just update the 'setprinter' called count. We update the changeid on calls
to SETPRINTER/ADDPRINTER/ADDPRINTEREX etc. Also fixed the correct returning
of the create time on printers.
Jeremy.
(This used to be commit 521f09829f)
2000-10-26 21:43:13 +00:00
Gerald Carter
01e0d3879e TDB password backend support written by Simo Sorce <simo.sorce@polimi.it>
Marked as an experimental compile time option (defaults to off) for now.





jerry
(This used to be commit 0435af4417)
2000-10-26 03:31:41 +00:00
Jeremy Allison
abf055046f Ok - this is a big patch - and it may break smbd a bit (although
I hope not). If you encounter strange file-serving behavior after this
patch then back it out. I analysed our stat() usage and realised we
were doing approx. 3 stat calls per open, and 2 per getattr/setattr.
This patch should fix all that. It causes the stat struct returned
from unix_convert() (which now *must* be passed a valid SMB_STRUCT_STAT
pointer) to be passed through into the open code. This should prevent
the multiple stats that were being done so as not to violate layer
encapsulation in the API's.

Herb - if you could run a NetBench test with this code and do a
padc/par syscall test and also run with the current 2.2.0 code
and test the padc/par syscalls I'd appreciate it - you should
find the number of stat calls reduced - not sure by how much.

The patch depends on unix_convert() actually finding the file
and returning a stat struct, or returning a zero'd out stat
struct if the file didn't exist. I believe we can guarentee this
to be the case - I just wasn't confident enough to make this
an assertion before.

Ok ok - I did write this whilst at the Miami conference.....
sometimes you get a little free time at these things :-).

Jeremy.
(This used to be commit 66a5c05ec4)
2000-10-19 02:58:24 +00:00
Jean-François Micouleau
85643cd72c last part of W2K support.
the trust domain list reply on netlogon pipe was wrong, interim hack until
we have full trust relationships.

changed some unistr2 to parse the ending NULL char.

added a prs_align_needed() function. much like a prs_align but with a
condition. needed for the unistr2 parsing.

	J.F.
(This used to be commit d8bf81553c)
2000-10-13 14:02:01 +00:00
Jeremy Allison
330d678fba Fix to allow smbd to call winbindd if it is running for all group enumeration,
falling back to the UNIX calls on error. This should fix all problems with
smbd enumerating all users in all groups in all trusted domains via winbindd.
Also changed GETDC to query 1C name rather than 1b name as only the PDC
registers 1b.
Jeremy.
(This used to be commit 5b0038a2af)
2000-10-13 01:59:14 +00:00
Jeremy Allison
26a4a34d36 Fix for growing printing.tdb by adding check on job creation.
This also updates the printing.tdb db version to 2.
Jeremy.
(This used to be commit 13395514c6)
2000-10-11 02:26:27 +00:00
Jeremy Allison
e9270d61fc Remove lpq as root fix - do this in print_job_start instead
as part of print queue length processing.
Jeremy.
(This used to be commit e85a0fadd8)
2000-10-11 02:04:46 +00:00
Jeremy Allison
cdb71ca518 Fixes to periodically scan printing.tdb in idle time and occasionally
on exit. Needed to fix printing.tdb from groving to 300Mb+ if being
driven by smbclient clients that never ask for status... (effective
DOS attack :-).
Jeremy.
(This used to be commit 6581066b93)
2000-10-10 21:52:31 +00:00
Jean-François Micouleau
11d999f2bc a netlogon enum trust query doesn't have a function_code at end.
a sam_user_info_24 doesn't have a uint16 at end
samr_create_user also creates the unix account now
samr_set_userinfo changes the password.

        J.F.
(This used to be commit 94f4024481)
2000-10-10 13:08:55 +00:00
Andrew Tridgell
2d33e87424 got rid of tdb_writelock() and instead lock a chain. tdb_writelock()
is conceptually flawed
(This used to be commit 6e4a358552)
2000-10-10 06:45:09 +00:00
Jean-François Micouleau
75c346e70c added samr_set_user_info and info_2.
cleanup of create_user
cleanup of rid/sid mix in samr. now we only have sid.

some prs_align() missing in parse_samr.c

a small debug change in srv_pipe.c

You still can't change a user's password in this commit.
Will be availble in the next one.

	J.F.
(This used to be commit b655bc281f)
2000-10-07 15:56:36 +00:00
Jeremy Allison
077c41cc60 Fix for printf attribute from Mattias Gronlund <Mattias.Gronlund@sa.erisoft.se>
Added "codepage directory" patch from Peter.Polkinghorne@brunel.ac.uk
Jeremy.
(This used to be commit e49566c2e2)
2000-10-06 23:35:55 +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
1126775808 Proto update. Also fix from John Reilly @ HP for not showing APW with W2K.
Jeremy.
(This used to be commit 698288cb9d)
2000-10-06 20:03:17 +00:00
Jeremy Allison
ba00796e6d Herb's warning fixes. Also the POSIX locking fix.
We now use our own vfs layer to do get/set acl calls (hurrah!).
Jeremy.
(This used to be commit dfe77c7046)
2000-10-06 18:13:52 +00:00
Jeremy Allison
14a8906e8c Inlined many of the vfs_XXX calls as macros for speed.
Jeremy.
(This used to be commit 0811d080ab)
2000-10-06 03:41:48 +00:00
Jeremy Allison
636f146abf Restructuring of vfs layer to include a "this" pointer - can be an fsp or
a conn struct depending on the call.
We need this to have a clean NT ACL call interface.
This will break any existing VFS libraries (that's why this is pre-release
code).
Andrew gets credit for this one :-) :-).

In addition - added Herb's WITH_PROFILE changes - Herb - please examine
the changes I've made to the smbd/reply.c code you added. The original
code was very ugly and I have replaced it with a
START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor.
Please check this compiles ok with the --with-profile switch.
Jeremy.
(This used to be commit b07611f815)
2000-10-06 03:21:49 +00:00
Jeremy Allison
bbd7f7bf0f Herb's fixes for profiling & compiler warnings.
Jeremy.
(This used to be commit 7914e9351a)
2000-10-05 18:50:18 +00:00
Jean-François Micouleau
fde7328900 someone forgot to update proto.h :-)
J.F.
(This used to be commit 3664e80fcd)
2000-10-05 12:43:37 +00:00
Jeremy Allison
3ad2ee22bb utf-8 and EUC3 patch from Hiroshi Miura Samba User Group Japan staff.
mkdir high bits patch from Robert Dahlem" <Robert.Dahlem@gmx.net>.
jeremy.
(This used to be commit b40191d271)
2000-10-03 02:12:14 +00:00
Jeremy Allison
2679fa315d Memleak fix for cache code.
Jeremy.
(This used to be commit 1ebe54666b)
2000-10-02 21:03:46 +00:00
Andrew Tridgell
910e8a5c9c new prototypes
(This used to be commit 3e77bf2117)
2000-09-29 04:47:18 +00:00
Jeremy Allison
b43b2e4f8a Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector them
through the VFS. All file access/directory access code in smbd should now
go via the vfs. Added vfs_chown/vfs_chmod calls. Still looking at vfs_get_nt_acl()
vfs_set_nt_acl() call API design.
Jeremy.
(This used to be commit f96625ec12)
2000-09-27 19:09:59 +00:00
Jean-François Micouleau
8c93ddf3e0 samr unknown 0x32 is in fact samr create user.
so renamed and tidy up of the server function.

	J.F.
(This used to be commit 0f707ac1fb)
2000-09-27 13:02:57 +00:00
Jean-François Micouleau
56917236a0 broadcast printer notify message to all clients. We now have printer
notification as on NT.

Andrew, your message passing code is cool :-)

	J.F.
(This used to be commit 0374bc4b5f)
2000-09-26 10:15:12 +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
Jeremy Allison
5be845af6b Changes from John Reilly to add a parameter "show add printer wizard" that
allows Samba to turn off the display of APW (hmmm. This should probably
be a share specific parameter, I'll fix that in another commit).
Also a few small changes to JF's code to fix compiler warnings about
missing return statements and also change '//' comments (C++) to /* .. */
comments (C).
Jeremy.
(This used to be commit 0a9ccc99b3)
2000-09-26 00:54:18 +00:00
Jean-François Micouleau
233bc00020 printer notify code.
It only sends notifies to one client. The broadcasting notify code will
code soon.

	J.F.
(This used to be commit 4c63c91858)
2000-09-25 21:05:18 +00:00
Jeremy Allison
0fc271ea4a Some code moved back from TNG - updates to LSA stuff. Not yet used but
will be needed soon.
Jeremy.
(This used to be commit f0aa8f9314)
2000-09-20 22:07:56 +00:00
Jeremy Allison
ccddd111c6 Move towards getting W2k p&p to upload NT4.x drivers. Still doesn't work -
not sure why (JF - a glance at this would be appreciated). Removed code
that JF objected to with enumprinterdata. Added translations to/from
level 6 - but Win2k still not happy... hmmm...
Jeremy.
(This used to be commit e5d98ba9e9)
2000-09-15 00:15:10 +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
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
06eeb3c458 much nicer message interface. We now register dispatch functions,
allowing new bits of code or vfs modules to register functions without
impacting on the messaging code itself.

Also note that multiple registrations for the same message type are
possible allowing the same message to be delivered to multiple parts
of the code (possibly useful for reload messages).
(This used to be commit c3350c77f5)
2000-09-12 00:47:11 +00:00
Andrew Tridgell
3689e4ffc1 the first cut of the internal messaging system.
The motivation for this system is to replace the UDP message for
oplocks, but this commit only does the "set debug level" message.
(This used to be commit 2a34ee95f3)
2000-09-11 07:02:43 +00:00
Jeremy Allison
e0f9de0c49 Implemented DELETEPRINTERDATA (tested with Gerald's Win32 progs).
Jeremy.
(This used to be commit fb48efaf83)
2000-09-09 00:19:35 +00:00
Jeremy Allison
a1f66a820d Fix for the SID history problem when using a Win2k domain controller
with security=domain. Also fixed to dynamically allocate the SIDs and GIDs.
Jeremy.
(This used to be commit 2b1f66eb82)
2000-09-06 01:06:39 +00:00
Jeremy Allison
d644d4438c Implemented GETFORM tested and working using Gerald's Win32 test progs....
Jeremy.
(This used to be commit 55ed0a9b0c)
2000-09-05 20:56:09 +00:00
David O'Neill
a3a28675fa Changes from APPLIANCE_HEAD (per Tim Potter):
- make proto
	- addition of function to convert from errno values to NT status codes
	  (source/lib/error.c)
	- purge queue done without full access permission will purge only the
	  jobs owned by that user, rather than failing.
	- unlock job database tdb before sending job to printer
	- in print_job_start(), ensure that we don't pick a jobid with an existing
	  temporary file that may be owned by another user, as it causes silent
	  failures.
	- fixes for printer permission checking for NT5 clients
	  (source/include/rpc_spoolss.h, source/printing/nt_printing.c,
	   source/printing/printing.c, source/rpc_server/srv_spoolss_nt.c)
	- change from uint8 to 'enum SID_NAME_USE' (source/rpc_server/srv_lsa.c)
	- fixed memory leaks for win95 driver download process
	  (source/smbd/lanman.c)
	- properly free prs_structs and dacl in testsuite/printing/psec.c
(This used to be commit 74af3e2cae)
2000-09-01 18:49:26 +00:00
Jeremy Allison
fa810d4c80 Implemented DELETEFORM tested using Gerald's Win32 test code :-).
Jeremy.
(This used to be commit 596c21a2af)
2000-08-31 19:04:51 +00:00