1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-18 06:04:06 +03:00

967 Commits

Author SHA1 Message Date
Tim Potter
47f8f8e522 Run main server loop with sys_select() instead of sys_select_intr(). The
main daemon was not catching sighup and reloading the service file.
(This used to be commit f026a897e9296a71fb5c4d5f6e1b4d3287689bde)
2000-07-24 06:20:13 +00:00
Jeremy Allison
9f040cc17e Modified the patch to look in the tdb *first* - thus allowing legacy text
filed to be ignored when an upload is done.
Modified to code to goto err on problems, simplifies it.
Jeremy.
(This used to be commit 9157a6ab2646c035a731d53aa3be010488ccf51a)
2000-07-19 23:47:10 +00:00
Jeremy Allison
5c162bbe5b Code from John Reilly <jreilly@hp.com> to add tdb lookups into the Win95
printer driver download if looking for the default driver files fail.
Jeremy.
(This used to be commit 1192d867c4e863471f9bc12afceb68a23ba2142e)
2000-07-19 20:11:11 +00:00
Tim Potter
b561c18597 Fixes for various compile warnings on Solaris 8.
(This used to be commit 898a483cdab1ed7d8ff902c0dc0e0620440ae4cd)
2000-07-10 06:41:04 +00:00
Tim Potter
78a4848e8d Re-instated lanman printing security checks (oops).
A user can now pause, resume or delete their own job even if they don't
have the Manage Documents privilege.

Added call to se_access_check() for changing printer properties.  The Full
Access privilege is required for the user to perform this.

Several uninitialised variables and memory leaks plugged.

Modified default ACL created on new printers to be Everyone / Print instead
of Everyone / Full Access.  This required some random stuffing around with
the value of the revision field to correspond with the ACL that NT produces
when setting the same permission on the printer.

Fixed dodgy function call in printing/printfsp.c
(This used to be commit 2abce4dcfa351051df6e5f789b34fa99c9b81c22)
2000-07-10 05:08:21 +00:00
Tim Potter
5af35320a9 Spelling fixes.
(This used to be commit c1d242f1dd5b6addbe5d2df22e4759f6682fd9ef)
2000-07-10 04:57:09 +00:00
Tim Potter
75dd5b5051 Don't check NT permissions when printing from lanman.
(This used to be commit e84607eedf3be454f8f709c70cafc5ded4ea951d)
2000-07-06 07:10:32 +00:00
Tim Potter
96446651af Moved authenticated pipe user details into a current_user struct.
(This used to be commit 3c4a5f624bfa69eb81d998530d9227e158edd109)
2000-07-06 07:01:37 +00:00
Tim Potter
f048209484 Some more sec_ctx changes. Modified some fields in the pipe_struct
structure so authenticated pipe users can have their unix groups set when
become_authenticated_pipe_user() is called.
(This used to be commit 55c9bf124dc661df43bfe582ef14b1297aeaf0fa)
2000-07-03 06:52:31 +00:00
Jeremy Allison
a8c21a8e6b Fix a malloc of zero problem.
Jeremy.
(This used to be commit 2aa21db960666736331b18956422b7c13aad0f0f)
2000-06-23 19:57:42 +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 edaf49c66d5a5ccf6689b358c301e208599a468f)
2000-06-23 17:31:38 +00:00
Tim Potter
0e4a583374 Added return for become_authenticated_pipe_user() function.
(This used to be commit d0f55e04c9400481e4a981431715e167a8246e45)
2000-06-23 06:27:05 +00:00
Tim Potter
2a1dbb0acd Delete OriginalDir stuff.
(This used to be commit 3d0f1845c8cefccfabcfd35694264c1e5f52c3af)
2000-06-23 05:57:48 +00:00
Tim Potter
dd4c0901b6 Moved some static functions to sec_ctx.c
Implemented become_root() and friends in terms of push/pop/set security
contexts.
(This used to be commit 0bcdcd0606fc2b6aba35b03255aad5bb2bd8e848)
2000-06-23 05:57:20 +00:00
Tim Potter
dbc0b86d16 Call init_sec_ctx() instead of init_uid().
Delete OriginalDir stuff.
(This used to be commit db5e6ad3a69a6fd744d8a22066587908470e3815)
2000-06-23 05:54:49 +00:00
Tim Potter
8005c837f5 I've been working on refactoring some of the mess that is the become_user()
code.  This code is now implemented as a stack of security contexts, where
a security context is defined as a set of effective user, group and
supplementary group ids.

The following functions are implemented:

BOOL push_sec_ctx(void);

     Create a new security context on the stack which is the same as the
     current security context.

void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups);

     Set the current security context to a given set of user and group
     ids.

void set_root_sec_ctx(void);

     Set to uid = gid = 0.  No supplementary groups are set.

BOOL pop_sec_ctx(void);

     Pop a security context from the stack and restore the user and group
     permissions of the previous context.

void init_sec_ctx(void);

     Initialise the security context stack.  This must be called before any
     of the other operations are used or weird things may happen.

The idea is that there is a base security context which is either root or
some authenticated unix user.  Other security contexts can be pushed and
popped as needed for things like changing passwords, or rpc pipe operations
where the rpc pipe user is different from the smb user.
(This used to be commit 87c78d6d5a6bf8d0907d6f8ef5ee0d642946cad3)
2000-06-23 05:49:11 +00:00
Jeremy Allison
a69d47640c Fixes for IRIX kernel oplocks and systems that don't have nss.h
Jeremy.
(This used to be commit 711f15ac230092bac000e63f99e8dfaa4a644847)
2000-06-20 00:32:32 +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 b737c784e34b0e1af014cb828ef37d5b6d73c3e2)
2000-06-19 21:30:27 +00:00
Tim Potter
5824ae2734 Pass the vuid from the connection_struct to the printing back end functions.
(This used to be commit 6120d03200ed6d89640332aedc75172bdf77e2a0)
2000-06-16 08:18:57 +00:00
Andrew Tridgell
c5285699d9 open files with O_NONBLOCK when available. This is necessary to
prevent possible deadlocks with kernel leases and harmless when kernel
leases are not used.

basically we don't ever want smbd to block
(This used to be commit 9fd67b94a7e43c9dcbe098940b88879ae8743c00)
2000-06-15 14:15:48 +00:00
Andrew Tridgell
f94f053b76 added support for kernel level share modes. These are a (small) hack,
I suspect we will either get rid of them or do them properly at some
stage.
(This used to be commit fabe1f350e1fc58db33d22cebd38652950697ced)
2000-06-15 09:35:37 +00:00
Andrew Tridgell
cc5502a4d0 allow the notify implementation to choose the select timeout change
(This used to be commit b1441d9622609af5ef598c5e1e1f5af438dc0731)
2000-06-14 07:11:27 +00:00
Tim Potter
31e83abd3d ZERO_STRUCT() of info3 structure before using it.
(This used to be commit efe7f818c927a925f2dee1ef4f6040c137e0c84e)
2000-06-14 01:48:08 +00:00
Christopher R. Hertel
898c5ddf07 Removed a patch that Andrew had added because 'insure' was incorrectly
reporting a memory leak in the cache module.  I've modified the cache
code to prevent insure getting confused, so the patch can now be removed.
(This used to be commit 50599b0fa2b78109e3bd2cf50007dc69c4059955)
2000-06-13 19:29:32 +00:00
Andrew Tridgell
bf575bf283 use DN_ATTRIB kernel change notify attribute
(This used to be commit 9f542484d11b7b908d3170b702b3bad82ba71525)
2000-06-13 09:31:43 +00:00
Andrew Tridgell
b7930178c3 always use the DN_CREATE mask (NT expects file creation always to
cause a notify)
(This used to be commit 20a06b7fb7c855e874b79b86251d597e7797b3c0)
2000-06-13 06:33:15 +00:00
Andrew Tridgell
c8de9b8fe1 enable the Linux change notify code and change some notify debug code
(This used to be commit c6be511fcc1be79619a0184f03d4c33dbfe12f04)
2000-06-12 17:06:00 +00:00
Andrew Tridgell
b2d01bd2db 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!
(This used to be commit 44766c39e0027c762bee8b33b12c621c109a3267)
2000-06-12 15:53:31 +00:00
Andrew Tridgell
2b37fd8435 fixed comments at top of module
(This used to be commit 02577ab7d275dfb49e104f3358cb3caa66b3b09e)
2000-06-12 05:34:14 +00:00
Andrew Tridgell
6db12f7180 split all the change notify code out into a separate module
smbd/notify.c. All the data structures are now private to that
module.

this is in preparation for Linux kernel support for change notify
(coming soon to a CVS tree near you)
(This used to be commit 1bb0aad4f66dbfa2d0f767ea90f926affff20b17)
2000-06-12 05:32:28 +00:00
Andrew Tridgell
a4ba9bb939 a better test for oplocks being enabled in this kernel
(This used to be commit cc0e919fdcb116c8f9688a4f5d7803fc8d7f9588)
2000-06-11 06:46:05 +00:00
Andrew Tridgell
0fb1dbe7fa fixed Linux capabilities handling
I used a trick where CAP_LEASE isn't claimed until it is needed. This
means we avoid a system call per setreuid(), and never call capset()
unless a user tries to get a oplock on a file that they don't own
(This used to be commit afa98d511f70f455d599c3a36dd25e49fe74ac09)
2000-06-11 06:24:54 +00:00
Andrew Tridgell
8843a6379d 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.
(This used to be commit b28cc4163bc2faaa80c5782fc02c8f03c410cdeb)
2000-06-11 05:57:58 +00:00
Andrew Tridgell
26848a3478 a first pass at Linux kernel oplocks support
(This used to be commit 3253085d9883a181c04b9c9ecf7d0ccdfbcee88d)
2000-06-10 14:29:31 +00:00
Andrew Tridgell
52cb05678a 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.
(This used to be commit b5ceab810292602ea9a81696c20a781c16b706c2)
2000-06-10 13:38:07 +00:00
Jeremy Allison
891bdd0d3e (Correct) fix for desired_access being zero in map_share_mode().
Jeremy.
(This used to be commit cc447fbe3cd77d57e18c3d1dff94a95d6032c311)
2000-06-09 19:41:48 +00:00
Jeremy Allison
03e0164270 Luke, I am moving the code back into passdb/passdb.c, this the correct
place to do this, not in smbd/passwd.c

Please don't change this without asking first, I have run this past
Andrew so talk to him (I'm on vacation next week).

I also removed the g_newXXX macros. There are essentially a private C extension,
not used anywhere else in the code, and add no functionality over malloc(XX)
and make the code harder to understand (everyone knows what malloc does).

Jeremy.
(This used to be commit e1b1b6fb6794ba02e1fea510a981fa0ce0d12b58)
2000-06-09 18:45:31 +00:00
Andrew Tridgell
15cf0e8470 clean up oplock capability code ready for Linux code
(This used to be commit 70dcc791b45ac64fc536ef449e4e6b53b2b68fd4)
2000-06-09 06:58:06 +00:00
Andrew Tridgell
09ea9eac69 split some of the irix kernel oplocks code into a function
(This used to be commit 6b888d600d95e2595c3f79494edcc55e88e2980d)
2000-06-09 04:22:02 +00:00
Luke Leighton
979f509e74 free NET_USER_INFO_3 gids when vuser invalidated.
(This used to be commit 2f056c2aadd2e16d89b66aabd1c166ab8d5abd76)
2000-06-09 03:30:54 +00:00
Luke Leighton
ad98207f54 dynamic allocation of NET_USER_INFO_3 gids.
jeremy, the intent is to call se_access_check() with usr-sid, grp-sid,
array-of-group-rids (but array-of-group-sids would do).

please do look at smbd/lanman.c's api_NetWkstaGetInfo, it will show you
that we really do need to store the entire NET_USER_INFO_3 structure.

then again, api_NetWkstaGetInfo is only used by win9x so who cares :)
(This used to be commit bd34f652390adc32c4959d164c628687f526d977)
2000-06-09 03:00:34 +00:00
Luke Leighton
c3487b00dd reverted jeremy's changes that removed NET_USER_INFO_3. will you please
not just undercut work in progress, thank you.
(This used to be commit 86d440a88c948727bfcfedc694c52c58f9687d8b)
2000-06-09 01:26:42 +00:00
Jeremy Allison
a62d17dc61 Change from "David S. Chappell" <David.Chappell@mail.cc.trincoll.edu>
to make "printer driver file" a share parameter. This fits better with
the new NT printing subsystem.
Jeremy.
(This used to be commit 7afb68461f3938a647a6c48689293af8ed36ccb7)
2000-06-08 22:24:13 +00:00
Jeremy Allison
f5a4d08d9e Fix for map_share_mode to allow desired access of zero map to stat open.
Jeremy.
(This used to be commit b0242080fe464e71815431559fe54d109e0b92f2)
2000-06-08 21:54:50 +00:00
Jeremy Allison
28555ec92e include/smb.h: Removed NET_USER_3 struct from user struct. It doesn't belong there (yet)
as there is no infrastructure for it. Replaced it with a dynamic array
				of group SIDs plus a user.
passdb/passdb.c: Added setup_user_sids() function. This is where the lookup should be done,
				eventually calling winbind.
smbd/password.c: Changed to call setup_user_sids(). Removed spurious DEBUG(0) statements.
smbd/reply.c: Removed extra parameter to register_vuid().

Jeremy.
(This used to be commit 425f4ad9a5e0e7d49620276100ade7a0cae47011)
2000-06-08 17:50:19 +00:00
Luke Leighton
84d40095e1 added a NET_USER_INFO_3 struct to user_struct.
register_vuid fills it with constructed info.
(This used to be commit b1889e4334012b1b2caa604b859da4271509fc87)
2000-06-08 13:56:07 +00:00
Andrew Tridgell
bda48b3824 - changed HAVE_KERNEL_OPLOCKS to HAVE_KERNEL_OPLOCKS_IRIX
- added autoconf test for HAVE_KERNEL_OPLOCKS_LINUX
(This used to be commit 0368f68529a9244663c199068e95d1a1d93152fa)
2000-06-08 07:40:55 +00:00
Jeremy Allison
b2eef912cf Cause printer SD's to be displayed correctly (full control).
Jeremy.
(This used to be commit 341d07c516865bdd9be99f98cd0754d12b25f9c0)
2000-06-08 00:17:05 +00:00
Jeremy Allison
0164047afb Fixing get/set of security descriptors.
Removed ugly hack for NT printing.
Fixed up tdb parse stuff memory leaks.
Jeremy.
(This used to be commit 8ef41f31c53e14ad057d883810a1cd2301fede2a)
2000-06-07 01:49:23 +00:00
Andrew Tridgell
da44845a09 moved secrets fns into secrets.c
(This used to be commit f890bcf06786e7c63bf76fad2fd46d287a99a270)
2000-06-03 06:22:19 +00:00