1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-21 20:23:50 +03:00
Commit Graph

90 Commits

Author SHA1 Message Date
Gerald Carter
ccb02f7cfc fix a few segfaults -
Jelmer Vernooij
6e34651591 remove 'admin log' parameter (discussed with Jeremy)
remove 'alternate permissions' parameter (deprecated and not used since 2.0) (discussed with tridge)
-
Andrew Bartlett
b24b6307f6 Add a wrapper for dup2() to our system.c
Andrew Bartlett
-
Andrew Bartlett
41d4b94077 Add back sys_getpwnam() and freinds to the system.c interface, but don't
use the silly cache any more.  Also add group functions and fix a few callers.

Andrew Bartlett
-
Andrew Bartlett
9d8431b04f Add a bit more const, and kill of (finally!) sys_getpwnam and sys_getpwuid.
These might be reimplmented as simple pass-through functions, but all users
really should be doing 'getpwnam_alloc' or 'getpwuid_alloc' to ensure that
there are not shared static buffers.

I don't beleive we actually need a getpw*() cache inside samba - if we do
then I think we should look at our code design first.

(some of these changes are for platforms I don't have access to, but
they look sane)

Andrew Bartlett
-
Andrew Tridgell
38fd99e841 patch from Alexander Bokovoy needed for dlopen on bsd systems -
Jeremy Allison
1d66e53a64 We cannot set errno=0 in any of the wrapper calls as this breaks UNIX error
returns to the client.
Jeremy.
-
Jeremy Allison
65742067e0 Fix different args to sys_fcntl without going varargs....
Jeremy.
-
Jeremy Allison
c7ff521bab Added sys_fcntl (not to be used everywhere). Added sys_read/sys_write
for transfer_file.
Jeremy.
-
Jeremy Allison
64974fa334 Fixed sendto in oplock code.
Jeremy.
-
Jeremy Allison
8cbc24c3bd Fix send and recvfrom.
Jeremy.
-
Jeremy Allison
48475a7a69 First cut at fix for the EINTR problem... More needs to be done I think.
Jeremy.
-
Jeremy Allison
74eac41c68 Added sys_adminlog() system for info the appliance admins really
need to know about. Different from the DEBUG system.
Jeremy.
-
Jeremy Allison
ac1baba35d Removed HAVE_LIBDL from most places (except system.c). Added checks for
dlopen & friends into configure.in. This should help building on *BSD
where dl*** calls are in libc.
Jeremy
-
Jeremy Allison
ad1e858d8e Sync up vfs changes from 2.2.x.
Jeremy.
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Jeremy Allison
6210d4aa19 Getting ready to add UNIX extensions in HEAD also.
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
ed5a1f70c6 Wrapped dlerror() in the same way as the other dlxxx() calls.
Jeremy.
-
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. -
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
c24e6b41ea Ensured all the system calls in msdfs.c go through the vfs layer.
Added vfs calls to symlink() and readlink() with appropriate configure
checks.
Jeremy.
-
Jeremy Allison
dc31b47ded Fixed password entry caching bug pointed out by Elrond.
Jeremy.
-
Jeremy Allison
5b9a88c2d0 Sync up with 2.2 ACL code.
Jeremy.
-
Jeremy Allison
49f0e7e714 Added sys_dlopen/sys_dlsym/sys_dlclose.
Jeremy.
-
Andrew Tridgell
348ebe30d0 removed useless debug msg -
Jeremy Allison
af364b93d9 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.
-
Gerald Carter
a55a4fea97 change pstrcpy() in setup_pwret() to fstrcpy() since we are
using fstrings.  Spotted by Elrond.  Thanks :-)




jerry
-
Jeremy Allison
c4f810a758 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.
-
Jeremy Allison
2bd4f16389 Fix insure problems with passwd caching code.
Jeremy.
-
Jeremy Allison
3712e35c54 Added modification to Richard Bollinger getpw[nam|uid] cache patch. Only
uses cache max 100 times.
Jeremy.
-
Gerald Carter
158430ba6a getpw[nam|uid] caching patch from "Richard Bollinger"
<rabollinger@home.com>



jerry
-
Jeremy Allison
1f156b2420 sys_popen got damaged when converted from FILE * to int fd I think.
Patrick Powell kindly pointed out the bug.
Jeremy.
-
Andrew Tridgell
d8b9ec741c added a hack to get 64 bit locking working with the broken fcntl()
call in glibc 2.1.95. This hack only gets enabled if you define
GLIBC_HACK_FCNTL64
-
Andrew Tridgell
44766c39e0 totally rewrote the async signal, notification and oplock notification
handling in Samba. This was needed due to several limitations and
races in the previous code - as a side effect the new code is much
cleaner :)

in summary:

- changed sys_select() to avoid a signal/select race condition. It is a
  rare race but once we have signals doing notification and oplocks it
  is important.

- changed our main processing loop to take advantage of the new
  sys_select semantics

- split the notify code into implementaion dependent and general
  parts. Added the following structure that defines an implementation:

struct cnotify_fns {
	void * (*register_notify)(connection_struct *conn, char *path, uint32 flags);
	BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t);
	void (*remove_notify)(void *data);
};


then I wrote two implementations, one using hash/poll (like our old
code) and the other using the new Linux kernel change notify. It
should be easy to add other change notify implementations by creating
a sructure of the above type.

- fixed a bug in change notify where we were returning the wrong error
  code.

- rewrote the core change notify code to be much simpler

- moved to real-time signals for leases and change notify

Amazingly, it all seems to work. I was very surprised!
-
Andrew Tridgell
b28cc4163b Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
-
Andrew Tridgell
b5ceab8102 continued the split of the kernel level oplocks code into a more
modular form. In this pass I added oplock_irix.c and added a "struct
kernel_oplocks" that describes a kernel oplock implementation.
-
Andrew Tridgell
70dcc791b4 clean up oplock capability code ready for Linux code -
Jeremy Allison
148628b616 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
-
Andrew Tridgell
f137648504 got rid of some more old configure tests and includes -
Andrew Tridgell
a09470817c converted a bunch more functions to use a fd instead of a FILE*
to support some of this I added the following functions in util_file.c

file_lines_pload : load lines from a pipe
file_pload : load a pipe into memory
-
Jeremy Allison
3b8cbb10de Fixes to add "paranoid" option to popen. Checks some basic things.
Jeremy
-
Jeremy Allison
9f879ec396 lib/system.c: Fixed gcc warnings.
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0.
Others - preparing for multiple pdu write code.
Jeremy.
-
Jeremy Allison
b52e92b09d Added replacement functions sys_popen and sys_pclose. These are based
on the glibc source code and are safer than the traditional popen as
they don't use a shell to exec the requested command. Now we have
these functions they can be tightened up (environment etc.) as required
to make a safe popen. It should now be safe to add the environement
variable loading code to loadparm.c
Jeremy.
-
Jeremy Allison
ca64f4ab00 include/includes.h: Trimmed down unicode directory entry to be POSIX complient.
lib/system.c: Trimmed down unicode directory entry to be POSIX complient.
lib/util_unistr.c: Added wstrdup().
Jeremy.
-
Jeremy Allison
b5eb009cc3 First cut at unicode sys_xx functions. Now to start moving upwards.....
Jeremy.
-
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch -
Luke Leighton
e4d92ff9df sys_select added one more argument (read, write selectors). -
Luke Leighton
0d1f5e5a6d check to see if copy_passwd_struct() ever receives its own internal
buffer as an argument :-) :-)
-