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

321 Commits

Author SHA1 Message Date
Jeremy Allison
1a2c1f7d1e r6316: Remove over-cautious asserts. Damn wish I'd made the release
with this....
Jeremy.
(This used to be commit 11c464268d)
2007-10-10 10:56:36 -05:00
Volker Lendecke
83e11ba86c r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
(This used to be commit 3493d9f383)
2007-10-10 10:56:33 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
9dba957880 r6060: It's not quite accurate to say not having write access causes a group
entry never to match - it matches but if doesn't grant access is recorded
so the "other" entry isn't subsequently checked.
Fix the algorithm.
Jeremy.
(This used to be commit e3c7d08bb6)
2007-10-10 10:56:19 -05:00
Jeremy Allison
83c61f2ace r6057: Don't put the assert in the wrong place :-).
Jeremy.
(This used to be commit 6609b209f5)
2007-10-10 10:56:19 -05:00
Jeremy Allison
1ca7ec3472 r6055: Fix algorithm. If any of the primary or supplementary group ids match
a "allow" entry of GROUP or GROUP_OBJ, then access is allowed. It doesn't
terminate on the first match. Added debug to show where the match occured
(or didn't).
Jeremy.
(This used to be commit 81fb337286)
2007-10-10 10:56:19 -05:00
Jeremy Allison
a5433c4bf7 r6053: Fixup dfs path with the new wildcard parser code split out.
Jeremy.
(This used to be commit e831cef618)
2007-10-10 10:56:19 -05:00
Jeremy Allison
fcfa75b2fc r6049: Ensure "dos filetime" checks file ACLs correctly. May fix Excel "read-only"
issue.
Jeremy.
(This used to be commit 80e788143a)
2007-10-10 10:56:18 -05:00
Jeremy Allison
8b6a50cf3e r6001: Oops. Checing the wrong tagtype - should have been SMB_ACL_GROUP, not SMB_ACL_MASK.
Fix bug #2521.
Jeremy.
(This used to be commit 21e3cf2f8f)
2007-10-10 10:56:15 -05:00
Jeremy Allison
e9d360aae9 r5616: Forgot about the sticky bit on directories (commonly set on /tmp). If this is set
then only the owner or root can delete a file. We now use
the same algorithm to check file delete.
Jeremy.
(This used to be commit eb18104d10)
2007-10-10 10:55:50 -05:00
Jeremy Allison
70be7d7192 r5355: Fill in the access check code for POSIX ACLs to *really* fix bug #2227.
Jeremy.
(This used to be commit ecc134a2e3)
2007-10-10 10:55:39 -05:00
Jeremy Allison
fbd9e40983 r5324: In order to process DELETE_ACCESS correctly and return access denied
to a WXPSP2 client we must do permission checking in userspace first
(this is a race condition but what can you do...). Needed for bugid #2227.
Jeremy.
(This used to be commit da23577f16)
2007-10-10 10:55:37 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
01533404b1 r4016: Fix for bug found by Steve French client code (cifsfs) on
POSIX ACL set. You need to *get* a permset_t pointer from the entry before
any of the permset code will accept it as a valid value
Jeremy.
(This used to be commit 7e78059948)
2007-10-10 10:53:27 -05:00
Jeremy Allison
46f546571b r4007: Fix bug #2088 - ensure inherit permissions is only applied on a new file,
not an existing one.
Jeremy.
(This used to be commit fbbdb72cf1)
2007-10-10 10:53:27 -05:00
Jeremy Allison
f3cb4f31a2 r3951: Fix for bugid #2081 reported by John Janosik <jpjanosi@us.ibm.com> - ensure
SE_DESC_DACL_PROTECTED is set if "map acl inherit = no".
Jeremy.
(This used to be commit 934c41b474)
2007-10-10 10:53:26 -05:00
Jeremy Allison
2f167e909e r3859: Ensure if num_acls is set to 0xFFFF this field is ignored.
Use def_acl everywhere instead of dir_acl.
Jeremy.
(This used to be commit d28611c960)
2007-10-10 10:53:21 -05:00
Jeremy Allison
7eaba1f528 r3816: Added fn to remove an ACL from a file. Now need client code to test this.
How do the share mask/modes fit into this code... Need to think about this.
Jeremy.
(This used to be commit 1aa1c2f489)
2007-10-10 10:53:19 -05:00
Jeremy Allison
6192b3121f r3794: Added set posix acl functionality into the UNIX extensions code.
One part missing - delete file acl (to be added asap). No client
code yet, also needs testing with valgrind.
Jeremy.
(This used to be commit 6101ec2247)
2007-10-10 10:53:17 -05:00
Jeremy Allison
ecd1b0fffd r3693: Correctly detect errno for no acl/ea support.
Jeremy
(This used to be commit 089a76f611)
2007-10-10 10:53:14 -05:00
Günther Deschner
193e82b056 r3496: Fix calling of get_acl_group_bits().
Guenther
(This used to be commit 3acc74eef5)
2007-10-10 10:53:08 -05:00
Jeremy Allison
e62d9c3b87 r3296: Fix to ensure entries are stored in correct order. Bug #1498. Patch from
SATOH Fumiyasu <fumiya@samba.gr.jp>.
Jeremy.
(This used to be commit 7e35900bc6)
2007-10-10 10:53:04 -05:00
Jeremy Allison
677c218f3f r3117: Fix from Tom Lackemann <cessnatomny@yahoo.com> for bug #1954.
Memory leak in posix acl code.
Jeremy.
(This used to be commit c97aab7ee6)
2007-10-10 10:53:01 -05:00
Jeremy Allison
532431d493 r1681: Ensure we return the same ACL revision on the wire that W2K3 does.
Jeremy.
(This used to be commit 31505acf03)
2007-10-10 10:52:18 -05:00
Volker Lendecke
aa9be75d8a r1314: Restore the 2.2 'force unknown acl user' parameter. When getting a security
descriptor for a file, if the owner sid is not known, the owner uid is set to
the current uid. Same for group sid.

This makes xcopy /o possible for files that are owned by local users/groups
(local administrators for example).

Thanks to Guenther for his persistence :-)

Volker
(This used to be commit 80e57d2790)
2007-10-10 10:52:05 -05:00
Jeremy Allison
8c0db1bbc4 r786: Memory leak fixes in (mostly) error code paths from
kawasa_r@itg.hitachi.co.jp. A couple of mem leak fixes in
mainline code paths though :-).
Jeremy.
(This used to be commit 4695cc95fe)
2007-10-10 10:51:38 -05:00
Herb Lewis
fc52c330ae r428: add acls debug class
(This used to be commit b7703799f8)
2007-10-10 10:51:23 -05:00
Jeremy Allison
bca29e5377 r50: Fix bug 1139 as per fix suggested by jdev@panix.com,
swap lookups for user and group - group will do an
algorithmic lookup if it fails, user won't.
Jeremy.
(This used to be commit a205c56a75)
2007-10-10 10:51:06 -05:00
Jeremy Allison
722aa118c6 Added per-share parameter "store dos attributes". When set, will store
dos attributes in an EA. Based on an original patch from tridge, but
modified somewhat to cover all cases.
Jeremy.
(This used to be commit ed653cd468)
2004-04-02 18:46:19 +00:00
Jeremy Allison
d113219e78 Added support for OS/2 EA's in smbd server. Test with smbtorture eatest.
New protocol option "ea support" to turn them on (off by default). Conrad
at Apple may like this as it allows MacOS resource forks to be stored on
a file. Passes valgrind. Documentation to follow.
Jeremy.
(This used to be commit 8cc10a6c05)
2004-03-31 02:20:16 +00:00
Jeremy Allison
09a7088156 Patch from Jim McDonough for bug #802. Retrieve the correct ACL group bits
if the file has an ACL.
Jeremy.
(This used to be commit 7bf5ed30ce)
2003-11-25 23:25:42 +00:00
Tim Potter
fbb8f131c2 Fix more 64-bit printf warnings.
(This used to be commit 23443e3aa0)
2003-11-03 14:34:25 +00:00
Jeremy Allison
8d4a397d85 Fixed the latest complaint from jcmd :-). We were storing -1 for the
CREATOR_OWNER/CREATOR_GROUP uid/gid entries in the SAMBA_PAI attribute.
Creator Owner and Creator group now show up as inherited correctly (I
think :-). Jim please test.
Jeremy.
(This used to be commit dbbd8dd155)
2003-07-01 00:35:11 +00:00
Jeremy Allison
9fda812d01 Finally ! Fixed the ACL ordering bug reported by jcmd. I realised we were
not sorting returned ACE's correctly w.r.t. W2K - implemented the correct
algorithm.
Jeremy.
(This used to be commit fa23a4158e)
2003-06-30 18:53:48 +00:00
Jeremy Allison
951710b60d Fixed the merge_default_aces() code to work correctly with inheritance.
Hopefully will fix jcmd bugs :-).
Jeremy.
(This used to be commit 482e6c79ed)
2003-06-23 20:24:08 +00:00
Simo Sorce
f5974dfaae Found out a good number of NT_STATUS_IS_ERR used the wrong way.
As abartlet rememberd me NT_STATUS_IS_ERR != !NT_STATUS_IS_OK

This patch will cure the problem.
Working on this one I found 16 functions where I think NT_STATUS_IS_ERR() is
used correctly, but I'm not 100% sure, coders should check the use of
NT_STATUS_IS_ERR() in samba is ok now.

Simo.
(This used to be commit c501e84d41)
2003-06-22 10:09:52 +00:00
Jeremy Allison
deef8647c7 Fixed sorting algorithm to prevent problems with W2K clients.
Jeremy.
(This used to be commit fa8ca20ed4)
2003-06-20 20:07:13 +00:00
Jeremy Allison
9251afe35b Mapping of Windows ACL inheritance and protected bits onto extended attributes
if available. Adds new parameter "map acl inheritance" (docs coming soon)
off by default. Allows W2K acl inheritance dialogs to work correctly on
POSIX acls.
Jeremy.
(This used to be commit a83595e80a)
2003-06-20 01:12:20 +00:00
Jeremy Allison
974d402d6d Ensure 'blank' entries show up in both default and normal entries to
allow them to be changed. Works well with W2K and above.
Jeremy.
(This used to be commit 685e4e5182)
2003-05-30 23:07:33 +00:00
Jeremy Allison
545e8d4999 Change get_nt_acl() to include security_info wanted. Only return this.
This gets us closer to W2k+ in what we return for file ACLs. Fix horribly
broken make_sec_desc() that screwed up the size when given a SD with no
owner or group (how did it get this bad... ?).
Jeremy.
(This used to be commit 183c9ed405)
2003-05-29 23:49:31 +00:00
Jeremy Allison
24497516cb Fix bug brought up by Ken Cross that empty ACE's cause existing ACE's to
be applied to new ACE set calls. This is incorrect. Don't think this
has a bugzilla id.
Jeremy.
(This used to be commit cb70d8c9e8)
2003-05-28 20:25:31 +00:00
Tim Potter
b68e0b3aae Fix shadow parameter warning in free_empty_sys_acl()
(This used to be commit 1b2b7766c8)
2003-05-27 06:55:06 +00:00
Jeremy Allison
1854e7b8e5 Cope with cumulative permissions sets. This code is #ifdef'ed out at the
moment as I don't think cumulative permission sets make sense in POSIX even
though that's the way Windows works....
Jeremy.
(This used to be commit 6ddd5b6ca7)
2003-05-17 00:46:28 +00:00
Alexander Bokovoy
bc2a3748e9 Prefix VFS API macros with SMB_ for consistency and to avoid problems with VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out
(This used to be commit c2689ed118)
2003-05-14 10:59:01 +00:00
Simo Sorce
c823b191ab And finally IDMAP in 3_0
We really need idmap_ldap to have a good solution with ldapsam, porting
it from the prvious code is beeing made, the code is really simple to do
so I am confident it is not a problem to commit this code in.

Not committing it would have been worst.
I really would have been able to finish also the group code, maybe we can
put it into a followin release after 3.0.0 even if it may be an upgrade
problem.

The code has been tested and seem to work right, more testing is needed for
corner cases.

Currently winbind pdc (working only for users and not for groups) is
disabled as I was not able to make a complete group code replacement that
works somewhat in a week (I have a complete patch, but there are bugs)

Simo.
(This used to be commit 0e58085978)
2003-05-12 18:12:31 +00:00
Alexander Bokovoy
e7c8c15888 Fix VFS layer:
1. Finally work with cascaded modules with private data storage per module
2. Convert VFS API to macro calls to simplify cascading
3. Add quota support to VFS layer (prepare to NT quota support)

Patch by Stefan (metze) Metzemacher, with review of Jelmer and me
Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
(This used to be commit 91984ef5ca)
2003-05-11 23:34:18 +00:00
Simo Sorce
7706e98d9d use gid_t for gids not uid_t
(This used to be commit a369c2ff26)
2003-04-19 15:31:40 +00:00
Jeremy Allison
d8c1c54d3e Doing janitor work for tridge.
"changed the order of checking whether a SID is a UID or a GID in posix
acls. This is needed because sid_to_uid always claims that the sid is
a user, due ot a change I made some months back.

This change was suggested by Chere Zhou, but is really an interim
measure. Chere is looking at a longer term solution."

REMEMBER - 3.0 is the one we will SHIP !

Jeremy.
(This used to be commit a4d7496994)
2003-04-01 18:12:06 +00:00
Jeremy Allison
0f30afc912 Missed parentheses around complex logic.
Jeremy.
(This used to be commit 7f8d3a49b2)
2003-03-07 19:46:00 +00:00
Jeremy Allison
e9f51a6e38 Patch from Michael Steffens. In his own words :
-------------------------------------------------------------------------
I think there are basically two problem:

  1. Windows clients do not always send ACEs for SMB_ACL_USER_OBJ, SMB_ACL_GROUP_OBJ,
     and SMB_ACL_OTHER.
     The function ensure_canon_entry_valid() is prepared for that, but tries
     to "guess" values from group or other permissions, respectively, otherwise
     falling back to minimum r-- for the owner. Even if the owner had full
     permissions before setting ACL. This is the problem with W2k clients.

  2. Function set_nt_acl() always chowns *before* attempting to set POSIX ACLs.
     This is ok in a take-ownership situation, but must fail if the file is
     to be given away. This is the problem with XP clients, trying to transfer
     ownership of the original file to the temp file.

The problem with NT4 clients (no ACEs are transferred to the temp file, thus
are lost after moving the temp file to the original name) is a client problem.
It simply doesn't attempt to.

I have played around with that using posic_acls.c from 3.0 merged into 2.2.
As a result I can now present two patches, one for each branch. They
basically modify:

  1. Interpret missing SMB_ACL_USER_OBJ, SMB_ACL_GROUP_OBJ, or SMB_ACL_OTHER
     as "preserve current value" instead of attempting to build one ourself.
     The original code is still in, but only as fallback in case current values
     can't be retrieved.

  2. Rearrange set_nt_acl() such that chown is only done before setting
     ACLs if there is either no change of owning user, or change of owning
     user is towards the current user. Otherwise chown is done after setting
     ACLs.

It now seems to produce reasonable results. (Well, as far as it can. If
NT4 doesn't even try to transfer ACEs, only deliberate use of named default
ACEs and/or "force group" or the crystal ball can help :)
-------------------------------------------------------------------------
Jeremy.
(This used to be commit 1d3b8c528b)
2003-03-07 19:37:31 +00:00
Andrew Bartlett
e72ecdc862 Merge of server-side authentication changes to 3.0:
- user_ok() and user_in_group() now take a list of groups, instead of
   looking for the user in the members of all groups.

 - The 'server_info' returned from the authentication is now kept around
  - in future we won't copy the sesion key, username etc, we will just
    referece them directly.

 - rhosts upgraded to use the SAM if possible, otherwise fake up based on
   getpwnam().

 - auth_util code to deal with groups upgraded to deal with non-winbind domain
   members again.

Andrew Bartlett
(This used to be commit 74b5436c75)
2003-02-24 02:35:54 +00:00
Jeremy Allison
486fa37dc6 Added comments to make it clearer when we're assigning a pointer that it
must not be freed afterwards.
Jeremy.
(This used to be commit 4015e39d36)
2003-02-21 06:25:58 +00:00
Jeremy Allison
96cafdd7c7 Fix from Corny.Bondad@hp.com for missing if (setting_acls) on default
perms.
Jeremy.
(This used to be commit 793609cbc2)
2003-02-19 02:34:44 +00:00
Andrew Bartlett
1fb6f689e7 Merge from HEAD: avoid braindead #define on Tru64.
(This used to be commit 299233fbf2)
2003-02-04 08:27:02 +00:00
Jeremy Allison
f735551b9e First cut of new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
This is not 100% the same as what SuSE shipped in their Samba, there is
a crash bug fix, a race condition fix, and a few logic changes I'd like to
discuss with Andreas. Added Andreas to (C) notices for posix_acls.c
Jeremy.
(This used to be commit 40eafb9dde)
2002-10-23 01:22:32 +00:00
Jeremy Allison
06b5917af4 Fix based on Jim McDonough's code for ACL inheritance problem.
Jeremy.
(This used to be commit 3343efaaa8)
2002-10-08 00:20:17 +00:00
Jeremy Allison
2d5d51e9f3 Fix from Andreas Gruenbacher <agruen@suse.de> to prevent ACL set on read-only
share.
Jeremy.
(This used to be commit 9b8f362abc)
2002-10-07 18:09:29 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
127e77e6e3 Sync 3.0 branch with head
(This used to be commit 42615b945e)
2002-08-17 15:27:10 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Jeremy Allison
3bb219161a Added POSIX ACL layer into the vfs.
Jeremy.
(This used to be commit 7d59445b69)
2002-03-12 00:08:08 +00:00
Jeremy Allison
db4c62d7ed Implemented default ACL patch (set inherit acls = true on a per share basis).
Based on code donated by Olaf Frczyk <olaf@cbk.poznan.pl>. Further commit
will change to sending via vfs interface.
Jeremy.
(This used to be commit d85133e269)
2002-03-11 21:57:12 +00:00
Andrew Tridgell
e69f020d3d a more informitive debug message when a SID can't be validated
(This used to be commit c55737fb25)
2002-03-09 19:38:47 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Gerald Carter
107b12ec11 merge from 2.2
(This used to be commit 7dc1c34145)
2002-01-25 15:47:12 +00:00
Andrew Tridgell
a78fd04681 fixed a crash in merge_aces()
when we free curr_ace_outer we need to not try to use it again :)
(This used to be commit 1c5e19a418)
2002-01-11 11:26:31 +00:00
Jeremy Allison
a784fce109 Allow ACL set to fail gracefully on HP HFS filesystems.
Jeremy.
(This used to be commit 2d7b81e692)
2001-12-19 17:47:19 +00:00
Jeremy Allison
3667377851 Stop using getgrgid() - a very expensive call with winbindd, to look up
a group name.
Jeremy.
(This used to be commit b926660e73)
2001-12-04 03:59:18 +00:00
Tim Potter
6d9adfe73c Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
(This used to be commit 9712d3f15a)
2001-11-30 01:04:15 +00:00
Jeremy Allison
be6023b2fb Log sys_acl_set_XX at level 2 not zero.
Jeremy.
(This used to be commit 4a54a633c5)
2001-09-25 00:05:26 +00:00
Jeremy Allison
0492effcf3 Ignore unmappable (NT Authority, BUILTIN etc.) SIDs in an ACL set.
Jeremy.
(This used to be commit bc7963bd64)
2001-09-22 06:45:24 +00:00
Simo Sorce
61b2794968 move to SAFE_FREE()
(This used to be commit a95943fde0)
2001-09-17 11:25:41 +00:00
Jeremy Allison
84cca75739 Don't fail if no owner/group owner set. Use existing owners.
Jeremy.
(This used to be commit 9961c4c1a3)
2001-09-07 20:08:16 +00:00
Herb Lewis
e555b969b2 if no ACL elements then use chmod - fixes ability to set read-only bit
on files that do not have an ACL
(This used to be commit 65ea13420c)
2001-08-30 18:56:35 +00:00
Jeremy Allison
08138a3244 Fix from Michael Davidson <md@caldera.com> for DEC OSF/1 ACLs (ie.
Digital UNIX).
Jeremy.
(This used to be commit 324ba0512e)
2001-07-26 21:16:39 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
2f99c0e602 lib/util_getent.c: removed debug code.
smbd/posix_acls.c: Attempt to fix the "lose default acl" problem in Solaris.
Needs testing.
lib/sysacls.c: Typo fix.
Jeremy.
(This used to be commit d989f8bd3e)
2001-06-12 01:49:30 +00:00
Jeremy Allison
f63ee18c68 *Wonderful* patch from Andrew Bartlett that will help ensure tdb's are
cleaned on clients abending connections. Thanks Andrew !
Jeremy.
(This used to be commit 1b3977c536)
2001-06-09 01:38:54 +00:00
Jeremy Allison
6e41b74e6d Fixed nasty little bug found by Gerald where we were corrupting the mode
bits before checking if we should change them on non-acl systems.
Jeremy.
(This used to be commit aba243ca08)
2001-05-10 19:27:00 +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
Jeremy Allison
1cebd0fe98 Fix for bad profile perms. Ensure r on files and rwx on directories.
Jeremy.
(This used to be commit f100e091ab)
2001-05-07 21:17:42 +00:00
Jeremy Allison
548d16869a Fixed SHM_R/SHM_W warnings by moving sys/ipc.h and sys/shm.h into includes.h
and using autoconf tests.
Added "restrict acl with mask" parameter.
Jeremy.
(This used to be commit 7792e32ba7)
2001-05-03 19:47:30 +00:00
Jeremy Allison
38959a2105 Tidy up args to DEBUG Statements - found by gcc on Solaris.
Jeremy.
(This used to be commit a60ecb4e53)
2001-04-27 21:14:18 +00:00
Jeremy Allison
95559fe994 Sync with default perm changes in 2.2.
Jeremy.
(This used to be commit f02e67a096)
2001-04-25 23:25:58 +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
94f0c652fe Fixed extern ref typo for file generic perms. 2am coding strikes again :-).
Jeremy.
(This used to be commit fe38692643)
2001-03-30 18:07:43 +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
a6d350881c Fixed the problem Gerald reported. Unfortunately we need to go back to
reporting imaginary "default" inheritable ACLs on directories, otherwise,
when you add an entry and click on apply without noticing there's no
default entry associated with it, it applies a null acl on the files
within the directory (hey, that's what you told NT you wanted, right ! :-).
Also ensure that minimum permissions for a directory are r-x for owner,
not just r--.
Jeremy.
(This used to be commit 4fa8cf68c3)
2001-03-28 01:33:57 +00:00
Jeremy Allison
e670b3564c smbd/posix_acls.c: Saving and restoring errno here is the wrong place. Moved it
to the places where [f]chmod_acl is called instead.
Jeremy.
(This used to be commit 641ada44ae)
2001-03-26 19:18:06 +00:00
Jeremy Allison
162218259f smbd/posix_acls.c: Sync up with 2.2 changes - don't return deny ACE's.
smbd/vfs.c: Don't call [f]chmod_acl if no acl support.
Jeremy.
(This used to be commit 83f52394e6)
2001-03-26 05:43:04 +00:00
Jeremy Allison
cd4fea0098 More unused variables.
Jeremy.
(This used to be commit 38b19fad28)
2001-03-23 20:41:22 +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
Jeremy Allison
81afba28c3 Sync up with 2.2 ACL code.
Jeremy.
(This used to be commit 5b9a88c2d0)
2001-03-23 00:54:55 +00:00
Jeremy Allison
8adfb4757c New POSIX ACL mapping code. Works with UNIX permissions, now for testing
with real ACLs...
Jeremy.
(This used to be commit 852b9e15ac)
2001-03-22 01:26:37 +00:00
Jeremy Allison
0dfc30cf87 lib/system.c (Finally) fixed all insure errors in password caching code. We can't
stop libc routines from calling getpwXXX functions, so caching a pointer to them
is impossible. This new code now makes two copies of the returned struct passwd
struct - one used as a cache, one returned to allow the caller to modify. When
doing a lookup we compare against the cached copy. Code is now easier to understand
also.
smbd/posix_acls.c: If we move the head of the linked list, remember to pass a
reference to that pointer.....
Jeremy.
(This used to be commit af364b93d9)
2001-03-17 03:36:38 +00:00
Jeremy Allison
70c812e6ae I'm happy with the mapping for NT getACL, now for NT setACL.
Jeremy.
(This used to be commit 7b97ac289e)
2001-03-17 02:06:16 +00:00
Jeremy Allison
a8d396f25e Tidyup return of zero-permissions (map to ACE_DENIED, GENERIC_ALL, Everyone).
Jeremy.
(This used to be commit 0d6c7dedd2)
2001-03-15 04:34:53 +00:00
Jeremy Allison
ae728ea761 Last tweak (I promise :-). Fallback to returning our SID if we're a domain
member but can't get the domain sid.
Jeremy.
(This used to be commit 45e96777d0)
2001-03-15 03:19:01 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
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
62dc55a432 configure configure.in smbd/posix_acls.c smbd/dosmode.c: Fix for zero permission W2K profiles.
libsmb/cliconnect.c rpc_client/cli_login.c smbd/reply.c: codepage fixes from Tim.
Jeremy.
(This used to be commit 3ded1e6bd5)
2001-02-16 00:24:43 +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
Jeremy Allison
b15e9adea1 Sync up with POSIX ACL code from 2.2.
Jeremy.
(This used to be commit e0431672cc)
2001-01-24 21:54:44 +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
Jeremy Allison
7786e07735 Fixes for POSIX ACLS. ACL merge code.
Jeremy.
(This used to be commit 180e4a9cd0)
2001-01-15 22:46:22 +00:00
Jeremy Allison
e870dd2988 Updated from 2.2.
Jeremy.
(This used to be commit 6fb5eb8b1e)
2001-01-15 19:02:57 +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
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
0f95385d28 Split set_nt_acls into owner set (which uses chown) and permission set
(which currently uses chmod) in preparation for ACL creation.
Jeremy.
(This used to be commit 0f39895ab0)
2000-12-19 20:00:28 +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
667b4113a8 Fix typos in new group sid check.
Jeremy.
(This used to be commit c48e95297e)
2000-12-18 07:22:10 +00:00
Jeremy Allison
8372087800 Fixed chown/chgrp setting from smbcacls.
Jeremy.
(This used to be commit 43ca0d991c)
2000-12-16 00:34:58 +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
Jeremy Allison
0293259eaa Make smbd/posix_acls.c use abstract interface.
include/smb_acls.h lib/sysacls.c: Added as interface definitions.
Jeremy.
(This used to be commit 8359375bba)
2000-12-06 02:32:48 +00:00
Jeremy Allison
b881a55dfd Moving to abstract API interface (sys_get_acl() etc.) to allow system
specific ACL calls to be dealt with elsewhere. This file will eventually
be able to replace the old UNIX acl interface.
Jeremy.
(This used to be commit b27cac7762)
2000-12-06 01:34:16 +00:00
Jeremy Allison
36390f7293 Code to read & return POSIX ACLs as NT ACLs. Close to test on Linux.
Jeremy.
(This used to be commit 52e9311bc2)
2000-12-01 00:32:25 +00:00
Jeremy Allison
8c0a28802a Keep syncing up POSIX ACL work...
Jeremy.
(This used to be commit 8f0062b873)
2000-11-30 19:31:04 +00:00
Jeremy Allison
94558441aa Work in progress, doesn't compile. Adding the POSIX ACL mapping....
Jeremy.
(This used to be commit bcac4ede76)
2000-11-30 01:00:36 +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
9e3098587b This doesn't compile but is a placeholder for moving the UNIX
acl code over to POSIX acls.
Jeremy.
(This used to be commit a2829febe1)
2000-08-29 00:29:15 +00:00