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

668 Commits

Author SHA1 Message Date
Gerald Carter
a86ae846ad added -P (for no prompt) and -A <authfile> options
jerry
(This used to be commit 2d95c38f7e)
2000-08-29 14:43:42 +00:00
Gerald Carter
4326894f6a needed to use strwicmp() in smbclient code, so I moved it to util_str.c
and made it non-static



--jerry
(This used to be commit dfdca21bd9)
2000-08-29 14:33:39 +00:00
Andrew Tridgell
4ff15c319e made reopen_logs() always re-open logs, not try and be smart about not
re-opening in some circumstances. This fixes a problem where a HUP
does not re-open logs and leaves the log open on a unlinked file.
(This used to be commit f99f028c77)
2000-08-28 03:17:22 +00:00
Andrew Tridgell
e1b9b33e2b - fixed the %U macro so that the old (and documented) semantics work
again. This got broken with one of the substitute.c updates a couple
of months ago.

- also fixed %u to return the username from the current_user structure
  when called via a method that does not have direct access to the
  username. I cache the uidtoname() result to prevent thrashing nss.
(This used to be commit 2520a0eff9)
2000-08-25 03:58:02 +00:00
Jeremy Allison
641d9e85ea Added code to do SID to uid/gid conversion. Needed for ACL support.
Jeremy.
(This used to be commit 81c5380f91)
2000-08-23 00:45:40 +00:00
Luke Leighton
7e5fd8fc2c oops. must return "" string and length zero when strlen(filebuf) == 0
(This used to be commit d3bc7cca99)
2000-08-18 06:27:24 +00:00
Luke Leighton
40cc8e0df2 getfileline() - line with length of zero -> filebuf[strlen(filebuf)-1]
is NOT ok.
(This used to be commit 24e0c8ef70)
2000-08-18 05:56:19 +00:00
Jeremy Allison
d8464d49c6 Reverted the change Luke made. Removed IS_BITS_SET_XX macros.
Do not re-add them. These macros are unsafe as they are not understood.
Change all TNG code using them to correct '&' and '|' please.
IS_BITS_SET_ALL was being used in cmd_interp.c when IS_BITS_SET_SOME
should have been used.
Jeremy.
(This used to be commit be4e5eeb4f)
2000-08-14 23:48:07 +00:00
Luke Leighton
d2d074580d hey, jerry: turns out you _have_ converted to get_safe_nt_errmsg!!!
[got confused with which way dirdiff was going :)].

... but you forgot to update TNG's lib/cmd_interp.c...
(This used to be commit 8fe195df0b)
2000-08-14 07:37:12 +00:00
Luke Leighton
becf055e78 jeremy,
please do not remove IS_BITS_SET_XXX macros just because you happen
"not to like them".  whilst still working on merging, you are not
responsible for this code, therefore do not hinder its development
whilst people are attempting to do merges.  after the merge from
TNG to cvs main is completed, you can do what the hell you like.

thank you.


jerry,

please could you consider adding underlying routines (in this case
get_safe_smb_errstr()) instead of reverting to a [less secure]
previous coding method.  thanks.
(This used to be commit b2e044f89d)
2000-08-14 07:33:34 +00:00
Gerald Carter
cf023a7ce0 fixed unistr_to_ascii to deal with NULL src strings
jerry
(This used to be commit 8e95aae170)
2000-08-12 14:20:40 +00:00
Gerald Carter
95496b974a reworked talloc() to in order to help track down invalid
memory access.

Tridge, I don't think using 0xdeadbeef for size allocations
of 0 is going to work.  I ended up having to use NULL
as much code that works on UNISTR checks to see if the buffer ptr
is NULL.  So valid code ends up with a seg fault.

Rather than rewriting it all, I added a DEBUG_TALLOC
#ifdef in talloc.h that sets a macro BAD_PTR.
This is the value assigned to ptr for an allocation of 0 bytes.



jerry
(This used to be commit 233b9cffa2)
2000-08-12 14:14:40 +00:00
Jeremy Allison
1e823bc781 Tidied up security rights definitions.
Jeremy.
(This used to be commit e466c863f5)
2000-08-10 19:51:45 +00:00
Jeremy Allison
1e46bde597 Removed requirement that sid have an owner before being interpreted.
Thanks to Elrond for pointing this out.
Jeremy.
(This used to be commit 1d9a5494f8)
2000-08-10 17:48:15 +00:00
Gerald Carter
f488740112 Deal will NULL UNISTR in unistr_to_ascii
jerry
(This used to be commit cfa4c878a2)
2000-08-10 14:00:05 +00:00
Gerald Carter
0a86b83a86 talloc returns 0xdeadbeef when asked to allocate 0 bytes
jerry
(This used to be commit df51dc32f6)
2000-08-10 13:58:15 +00:00
Jeremy Allison
e3048cfc0b Fixed memory leak with NT tokens.
Added debug messages to se_access_check().
Added FULL_ACCESS acl to default acl on printers.
Jeremy.
(This used to be commit 7507f6f408)
2000-08-09 18:40:48 +00:00
Jeremy Allison
b4d1e192cd Added SID "Everyone" S-1-1-0 as always matching if present in an ACE.
Jeremy.
(This used to be commit b3a1038ac1)
2000-08-08 21:51:22 +00:00
Jeremy Allison
0cabe327ef Changed the sec desc access checks to match the spec. Needs testing.
Jeremy.
(This used to be commit 5a4a7cd472)
2000-08-08 19:34:34 +00:00
Gerald Carter
f296a8d087 All changes related to rpcclient...
- cleaned up some code
- Fixed a few memory leaks of my own making
- Add AddPrinterDriver(); I'm missing some of the semantics
  here as the call is done correctly, but I'm not getting all
  the information right in the DRIVER_INFO_3 struct I think.
  Will work on it tomorrow some more...



--jerry
(This used to be commit 3bf9a29f34)
2000-08-08 06:57:48 +00:00
Jeremy Allison
b3b512264d Fixed up se_access_check() to use the token list from the user struct
as the SID list. Now to go through and tidy up the algorithm.
Jeremy.
(This used to be commit 1f7300df67)
2000-08-04 19:56:58 +00:00
Jeremy Allison
f87399915b Added an NT_USER_TOKEN structure that is copied/passed around associated
with the current user. This will allow se_access_check() to quickly do
a SD check without having to translate uid/gid's to SIDs.
Still needs work on pipe calls.
Jeremy.
(This used to be commit e28d01b744)
2000-08-03 22:38:43 +00:00
Jeremy Allison
17dcd9a834 Started to canonicalize our handling of uid -> sid code in order to
get ready and fix se_access_check().
Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid()
functions that look via winbind first the fall back on local lookup.

All Samba should use these rather than trying to call winbindd code
directly.

Added NT_USER_TOKEN struct in user_struct, contains list of NT sids
associated with this user.

se_access_check() should use this (cached) value rather than attempting
to do the same thing itself when given a uid/gid pair.

More work needs to be done to preserve these things accross security
context changes (especially with the tricky pipe problem) but I'm
beginning to see how this will be done..... probably by registering
a new vuid for an authenticated RPC pipe and not treating the
pipe calls specially.

More thoughts needed - but we're almost there...

Jeremy.
(This used to be commit 5e5cc6efe2)
2000-08-02 02:11:55 +00:00
Jeremy Allison
7f36df301e Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
(This used to be commit c55bcec817)
2000-08-01 18:32:34 +00:00
Gerald Carter
a6ef985df4 More work on rpcclient...
* Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx




--jerry
(This used to be commit 45fbf31b69)
2000-07-31 14:50:53 +00:00
Jeremy Allison
5ec1642809 Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
(This used to be commit 0ff2ce543e)
2000-07-27 00:47:19 +00:00
Andrew Tridgell
5a98f9cb35 if the sids are not the same pointer and either of the sids are NULL
then the two sids are not equal
(This used to be commit 9ccf3b1dc5)
2000-07-25 20:26:50 +00:00
Gerald Carter
fe245e2a92 Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.


jerry
(This used to be commit a0e8a55c27)
2000-07-21 20:01:20 +00:00
Christopher R. Hertel
3c9e410c34 Instead of handing back a string (which might be a DNS name or an IP
string), the wins_srv module now hands back a struct in_addr when it's
called.  It caches the IP address once it has been looked up.  The IP
is cleared (and must be looked up again) if the 'wins server' parameter
is reread, or if the node is marked 'dead'.  A dead node will not be
re-tried for 10 minutes (per a #define in wins_srv.c).

As it was, the code was reading the WINS server name or IP directly from
lp_wins_server.  That's okay, except that if the value was expressed as
a name, then a DNS lookup would be done every time the client wanted to
talk to the server.

I still need to work out the implications of failover regarding the
'unicast subnet' list.

Chris -)-----
(This used to be commit 73aa188320)
2000-07-19 05:32:43 +00:00
Christopher R. Hertel
b35f21fb3a First cut toward adding WINS server failover.
*Note: failover doesn't actually work yet!*  It's just that the code I'm
adding provides all of the pieces necessary.

I do have one big question.  Something that I'll have to ask Jeremy, I'm
thinkin'.  In nmbd/nmbd_subnetdb.c the IP of the WINS server is used to
set up the Unicast subnet.

...so what happens if the WINS server changes?

My guess is either:
  a) nothing.
  b) I'd have to change the unicast subnet entry whenever the WINS server
     changes.

Urq.

BTW, the lp_wins_server() function no longer returns the WINS server name
or IP.  It returns the list of WINS servers entered in smb.conf.  To get
the currently 'live' WINS server, use the wins_srv() function.

Fun, eh?

Chris -)-----
(This used to be commit cc08bdc74f)
2000-07-19 01:21:30 +00:00
Gerald Carter
695e596446 I really didn't like the way generic arrays (lists) were
implemented in util_array.c so I wrote a smaller (and simplier
package).

I would like to replace the use of util_array.c functions
in the rest of the source tree if no one objects.
This will be an interface change, but not really a difference
in the functionality provided.


--jerry
(This used to be commit 0863ce3a31)
2000-07-18 05:12:49 +00:00
Tim Potter
c9dc68746b Added some debugs.
Changed interface to se_access_check to take a user struct instead of each
bit as a separate parameter.
(This used to be commit ff7938310d)
2000-07-17 02:36:19 +00:00
Gerald Carter
02fd5b08b5 Fixed a bug in cmd_interp.c where if user%pass was entered on
the command line, the password would still be cached in memory
in plain text for the lifetime of the rpcclient command line session.

removed loopback connection functions from msrpc-client.c since
we don't support that in the server code now anyways.  simplify,
simplify, ...


--jerry
(This used to be commit 8599e1bc39)
2000-07-14 16:54:07 +00:00
Tim Potter
9e2b1074aa Uninitialised variables.
(This used to be commit a895868912)
2000-07-13 01:21:21 +00:00
Gerald Carter
997e113a56 Fixed a bug in parsing the command line.
jerry
(This used to be commit ebcb7473c6)
2000-07-10 19:56:15 +00:00
Tim Potter
b561c18597 Fixes for various compile warnings on Solaris 8.
(This used to be commit 898a483cda)
2000-07-10 06:41:04 +00:00
Tim Potter
64299375b5 Moved winbind client functions from various odd locations to
nsswitch/wb_client.c

Merge of nsswitch/common.c rename to nsswitch/wb_common.c from TNG.
(This used to be commit f866c18f6b)
2000-07-10 05:40:43 +00:00
Tim Potter
8c0bb0c241 Added some useful debugging stuff.
Fixes for se_access_check() when you are the owner of the object.
(This used to be commit 1478198b70)
2000-07-10 04:54:09 +00:00
Gerald Carter
d2b40a7de2 More rpcclient merge issues:
* fixes some readline bugs from the merge
        * first attempt at commands (spoolenum almost works)
        * no changes to existing functions in HEAD; only additions
          of new functions.  I'll weed out what I can as I go.




--jerry
(This used to be commit 61d2aad5dc)
2000-07-07 06:20:46 +00:00
Tim Potter
cfc7266a7b Rewrite of se_access_check() function. Added comments and fixed a bunch of
bugs.  I think there is a problem though with the permissions granted when
SEC_RIGHTS_MAXIMUM_ALLOWED is passed as the permissions requested.
(This used to be commit 27d821913c)
2000-07-06 06:57:22 +00:00
Tim Potter
084af3c5be Added global_sid_NULL S-1-0-0 to list of global sids.
(This used to be commit f49905e74c)
2000-07-06 06:48:54 +00:00
Tim Potter
8a72991abb Bracked unbracketed macro arguments while looking for another bug.
(This used to be commit 873774e36d)
2000-07-06 01:30:41 +00:00
Gerald Carter
33f6a1d9bb first pass at merging rpcclient from TNG to HEAD. You can get a
semi-connection and a rpcclient prompt, but no functionality there yet.
Will be a few more days on that.

--jerry
(This used to be commit 269051aa0c)
2000-07-03 04:28:29 +00:00
Andrew Tridgell
bdb98d93f2 fixed size alignment in talloc
(This used to be commit 064cdb7ee6)
2000-06-26 08:18:42 +00:00
Jeremy Allison
ec1c58fcc0 lib/util_sid.c: Uninitialized memory read.
rpc_parse/parse_spoolss.c: Added note about prs_align when marshalling a SEC_DESC...
rpc_server/srv_lsa.c: Tim - your changes broke the display of the 'everyone' group
						when doing file access with no winbindd running. This is a partial
						fix - more when I have analysed this more.
rpc_server/srv_spoolss_nt.c: Fix for the 'change driver' problem ! Hurrah !

Jeremy.
(This used to be commit 151b131ee0)
2000-06-24 00:15:08 +00:00
Jeremy Allison
5dd2bd5076 lib/util_unistr.c: Off-by-one fix for dos_PutUniStr from John Reilly jreilly@hp.com.
Memory leak fix for new sec_ctx code (sorry Tim :-).
Jeremy.
(This used to be commit edaf49c66d)
2000-06-23 17:31:38 +00:00
Jeremy Allison
f9e9f98a4a lib/util_unistr.c: Removed ascii_to_unistr() as it does no codepage.
Removed unistr_to_ascii() as it was never used.
printing/nt_printing.c: Removed "DUMMY.XX" files.
rpc_server/srv_spoolss_nt.c: Use dos_PutUniCode() instead of ascii_to_unistr().
							Attempted to fix the "return value" size code based on J.F's
							comments. This needs looking at.
Jeremy.
(This used to be commit de99011bf3)
2000-06-22 01:39:17 +00:00
Andrew Tridgell
a7b5b10a0a fixed two minor bugs in new sys_select()
(This used to be commit 5afc5f5031)
2000-06-21 12:14:51 +00:00
Jeremy Allison
5e06151e4d Paranoia changes to ensure that anything touched by a signal handler
and the main code is declared as VOLATILE SIG_ATOMIC_T.
Jeremy.
(This used to be commit b737c784e3)
2000-06-19 21:30:27 +00:00
Tim Potter
3bf8d26f7c Merged parse_domain_user() from TNG.
(This used to be commit f64ac9d906)
2000-06-14 09:57:51 +00:00