1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-16 09:57:47 +03:00

51 Commits

Author SHA1 Message Date
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Jeremy Allison
70eec7b8ae r21953: One format fix, clarify a condition that the IBM
checker was worried about.
Jeremy.
2007-10-10 12:18:52 -05:00
Volker Lendecke
8e087b7e46 r18016: OpenBSD apparently does not have ENOTSUP 2007-10-10 11:39:49 -05:00
Volker Lendecke
3a1cf62376 r17804: Fix a enum/int mixup found by the IRIX compiler.
Volker
2007-10-10 11:38:49 -05:00
Volker Lendecke
8ae7ed1f3c r17334: Some C++ warnings 2007-10-10 11:38:26 -05:00
Jim McDonough
ca0c73f281 r17179: Merge the vl-posixacls tmp branch into mainline. It
modularizes our interface into the special posix API used on
the system. Without this patch the specific API flavor is
determined at compile time, something which severely limits
usability on systems with more than one file system. Our
first targets are AIX with its JFS and JFS2 APIs, at a later
stage also GPFS. But it's certainly not limited to IBM
stuff, this abstraction is also necessary for anything that
copes with NFSv4 ACLs. For this we will check in handling
very soon.

Major contributions can be found in the copyright notices as
well as the checkin log of the vl-posixacls branch. The
final merge to 3_0 post-3.0.23 was done by Peter Somogyi
<psomogyi@gamax.hu>
2007-10-10 11:38:17 -05:00
Gerald Carter
e439660f91 r15525: fix compile error on HP-UX reported by Ryan Novosielski 2007-10-10 11:16:56 -05:00
Jeremy Allison
1d710d06a2 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
2007-10-10 11:10:59 -05:00
Jeremy Allison
c9b5e32650 r5789: Patch from William Jojo <jojowil@hvcc.edu> - AIX has no default ACLs.
Bug #2445.
Jeremy.
2007-10-10 10:56:00 -05:00
Jeremy Allison
da7ef25171 r4305: Fix from Albert Chin (china@thewrittenword.com) to fix the
earlier malloc changes.
Jeremy.
2007-10-10 10:53:43 -05:00
Jeremy Allison
efc1b688cf r4291: More *alloc fixes inspired by Albert Chin (china@thewrittenword.com).
Jeremy
2007-10-10 10:53:42 -05:00
Jeremy Allison
089a76f611 r3693: Correctly detect errno for no acl/ea support.
Jeremy
2007-10-10 10:53:14 -05:00
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 -
Jeremy Allison
d2af6382b4 dos2unix not used in HEAD anymore.
Jeremy.
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Jeremy Allison
6d03184f8c Added HPUX ACL code.
Jeremy.
-
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Simo Sorce
60e907b7e8 move to SAFE_FREE() -
Jeremy Allison
8c5e5f8c84 Added Mike Davidsons Tru64 ACL patch.
Jeremy.
-
Simo Sorce
7f33c01688 Change all realloc() statements to Realloc() (ecxept for tdb.c)
changed some code to exploit the fact that Realloc(NULL, size) == malloc(size)
fixed some possible mem leaks, or seg faults.

thanks to andreas moroder (mallocs not checked in client/client.c, client/smbumount.c)
-
Jeremy Allison
324ba0512e Fix from Michael Davidson <md@caldera.com> for DEC OSF/1 ACLs (ie.
Digital UNIX).
Jeremy.
-
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.
-
Jeremy Allison
db5b82e53a 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.
-
Jeremy Allison
bd750def13 Fixed typo in Solaris and UnixWare ACLs.
Jeremy.
-
Jeremy Allison
81b5a628d1 Herb's IRIX fix for deleting default ACLs.
Jeremy.
-
Jeremy Allison
5853f1dc42 AIX has no default acls.
Jeremy.
-
Jeremy Allison
5668512ffa Added sys_acl_delete_def_file for UnixWare and Solaris from
Michael Davidson <michael_davidson@pacbell.net>.
Jeremy.
-
Jeremy Allison
a8532b193d 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.
-
Jeremy Allison
1d4438f077 AIX ACLs donated by IBM.
Merge Andrew's fnmatch fix for WfW.
Jeremy.
-
Jeremy Allison
c236287463 Added POSIX_ACL support for *BSD. Patch from jedgar@fxp.org. Changed
a bit to use AC_TRY_LINK to ensure functions are available for link
instead of AC_TRY_COMPILE.
Jeremy.
-
Jeremy Allison
5870e6019b 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.
-
Jeremy Allison
add847778b Merged John's changes.
Jeremy.
-
Jeremy Allison
9b32b8a8cf 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.
-
Jeremy Allison
144a290681 Changed the order of -kPIC and -kpic.
Added patch from Michael Davidson <md@sco.COM> for Solaris/Unixware ACLS.
Jeremy.
-
Jeremy Allison
ffa800e980 Fix from Michael Davidson <md@sco.COM> to merge Solaris and UnixWare ACLs.
Jeremy.
-
Jeremy Allison
0865366f6b Added XFS ACLs on Linux. Code from John Trostel <jtrostel@connex.com>.
Jeremy.
-
Jeremy Allison
2f2365e938 IRIX ACLs from Herb.
Jeremy.
-
Jeremy Allison
852b9e15ac New POSIX ACL mapping code. Works with UNIX permissions, now for testing
with real ACLs...
Jeremy.
-
Jeremy Allison
a648935ae9 Fixed a couple of getpwXX calls that were not going through the sys_getpwXX
cache.
Jeremy.
-
Jeremy Allison
f0d11b6997 rpc_client/cli_netlogon.c: Fixed incorrect printf.
Added Solaris ACL support.
Jeremy.
-
Jeremy Allison
d938ad6963 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.
-
Jeremy Allison
f8db87b097 Patch to add UnixWare ACLs from Michael Davidson <md@sco.COM>. With some
small modifications, this code may also work on Solaris, as they are derived
from the same SVR4 codebase.
When the Samba Solaris box is up and running again I will test this.
Jeremy.
-
Jeremy Allison
523c919356 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
-
Jeremy Allison
2300ac79f5 First compiling version of code that sets NT ACLs as POSIX ACLs.
Now the debugging starts.... :-).
Jeremy.
-
Jeremy Allison
1a31b4eb08 Split the one sys_acl_free call into sys_acl_free_TYPE calls, to allow
easier wrapping of non-POSIX ACL interfaces.
Jeremy.
-
Tim Potter
5e547ddcb5 Renamed parameters and variables called acl to the_acl as it conflicts
with a Solaris system call.
-
Jeremy Allison
da6ae57501 Added better configure test for POSIX ACLs. Fixed stupid typo in sysacls.c
Jeremy.
-
Jeremy Allison
6ae63e502e 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.
-
Jeremy Allison
4339e20202 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.
-