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

64 Commits

Author SHA1 Message Date
Andrew Bartlett
5dfba2cf53 Back out some of the less well thought out ideas from last weeks work on
winbind default domains, particulary now I understand whats going on a lot
better.  This ensures that the RPC client code does as little 'magic' as
possible - this is up to the application/user.  (Where - for to name->sid code
- it was all along).  This leaves the change that allows the sid->name code to
return domains and usernames in seperate paramaters.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e870f0e727 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
7b8fb8d85c Fixup JF's weird SID return :-).
Jeremy
0001-01-01 00:00:00 +00:00
Tim Potter
9712d3f15a Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e2ba2383c9 fix a bunch of places where we can double-free a cli structure 0001-01-01 00:00:00 +00:00
Tim Potter
778f5f77a6 Got medieval on another pointless extern. Removed extern struct ipzero
and replaced with two functions:

	void zero_ip(struct in_adder *ip);
	BOOL is_zero_ip(struct in_addr ip);
0001-01-01 00:00:00 +00:00
Tim Potter
8fc772c9e5 Removed TimeInit() call from every client program (except for one place
in smbd/process.c where the timezone is reinitialised.  Was replaced with
check for a static is_initialised boolean.
0001-01-01 00:00:00 +00:00
Martin Pool
79ec88f0da Store some path names in global variables initialized to configure
default, rather than in preprocessor macros.
0001-01-01 00:00:00 +00:00
Simo Sorce
67db8f03c5 move to SAFE_FREE() 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f41c3bb80f declare dbf in one spot 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1af8bf34f1 replaced stdio in many parts of samba with a XFILE. XFILE is a cut-down
replacemnt of stdio that doesn't suffer from the 8-bit filedescriptor
limit that we hit with nasty consequences on some systems

I would eventually prefer us to have a configure test to see if we need
to replace stdio, but for now this code needs to be tested widely so
I'm enabling it by default.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5bb7e4f0f6 it now all compiles - so try enabling it by default and see what explodes on the build farm 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1d36250e33 converted another bunch of stuff to NTSTATUS 0001-01-01 00:00:00 +00:00
Andrew Tridgell
22b372f8a7 fixed handling of 139/445 in clients 0001-01-01 00:00:00 +00:00
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
debb471267 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.
0001-01-01 00:00:00 +00:00
Tim Potter
69d90a8af1 Removed bogus server_n local variable in connect_one() function. 0001-01-01 00:00:00 +00:00
Tim Potter
9874df0c22 Added some missing entries to usage().
Added -d option to set debug level.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
674ee2f1d1 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
87f647715d Warning fix from Andrew Bartlett.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
66f959e0ff rpc_server/srv_srvsvc_nt.c: Don't test an uint32 for < 0.
utils/smbcacls.c: Set enum correctly.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0ae0d024f5 Fixup smbcacls. Don't return memory already freed, don't free memory allocated
with talloc.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5d899e51a4 fixed some uninitialised variables 0001-01-01 00:00:00 +00:00
Gerald Carter
0a6ceed279 rpcclient merge from 2.2 (including Jeremy's non-void return fix) 0001-01-01 00:00:00 +00:00
Jeremy Allison
fc76681812 Merge of Andrew's changes in 2.2.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
493d2c316a Added SMB_ prefix to enums that clash with Solaris ACL definitions.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
70beabf73b Ooops - forgot to check the rpcclient and smbcacls compile with the new
code :-(.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b0b49a4b28 make sure denied aces are first 0001-01-01 00:00:00 +00:00
Andrew Tridgell
703d9f5cb3 cast the qsort 0001-01-01 00:00:00 +00:00
Andrew Tridgell
61293979ce - fixed the sort_acl bug, sorting now works right
- don't allow setting of duplicate ACEs
- fixed a ACE delete bug
0001-01-01 00:00:00 +00:00
Andrew Tridgell
5934137741 don't crash on null acl sort 0001-01-01 00:00:00 +00:00
Andrew Tridgell
48ab6297a1 - workaround filer lsa lookup bug for unknown sids
- add \ at start of name if not needed (another filer workaround)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
c0f57c3fe6 cope with filer/NT/samba all in one binary. yeah.
we now don't open rw for acls
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f191271986 don't need _uni hack now 0001-01-01 00:00:00 +00:00
Tim Potter
394e17645b 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.
0001-01-01 00:00:00 +00:00
Tim Potter
b4773618ac Return appropriate exit codes for various situations:
0 for success
    1 if operation failed
    2 command line parse error
0001-01-01 00:00:00 +00:00
Tim Potter
01a89978ff 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().
0001-01-01 00:00:00 +00:00
Tim Potter
935b77573e 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.
0001-01-01 00:00:00 +00:00
Tim Potter
e21f2ef4fb Cleaned up SidToString() and StringToSid() exit paths.
Can now use user%password format in $USER environment variable.  -U option
is now optional.
0001-01-01 00:00:00 +00:00
Jeremy Allison
12f88c9ba7 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0a40bc83e1 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.
0001-01-01 00:00:00 +00:00
Tim Potter
5e547ddcb5 Renamed parameters and variables called acl to the_acl as it conflicts
with a Solaris system call.
0001-01-01 00:00:00 +00:00
Tim Potter
09d2d972fd Cache lsa connection and policy handle for resolving names and sids. 0001-01-01 00:00:00 +00:00
Tim Potter
5001bbc64b Convert names to sids when modifying ACLs. Convert sids to names when
displaying ACLs.
0001-01-01 00:00:00 +00:00
Tim Potter
6fd5dc8145 Don't print out the security descriptor type as it is automatically
calculated by the new make_sec_desc() function.
0001-01-01 00:00:00 +00:00
Tim Potter
d119782d0d Better error checking for ACL parsing.
Print an error when attempting to delete a non-existent ACL.
0001-01-01 00:00:00 +00:00
Tim Potter
ed5bda119a 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.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
032442802f added a comment 0001-01-01 00:00:00 +00:00
Andrew Tridgell
374d08be64 fixed the parsing again and got setting acls working with w2k 0001-01-01 00:00:00 +00:00
Tim Potter
faaa71a032 Added some cli_errstr() calls. 0001-01-01 00:00:00 +00:00