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

150 Commits

Author SHA1 Message Date
Stefan Metzmacher
70be41c772 s3:onefs: remove all onefs related code as it not maintained anymore
See https://lists.samba.org/archive/samba-technical/2012-May/083631.html
for the discussion.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed May 16 11:23:05 CEST 2012 on sn-devel-104
2012-05-16 11:23:04 +02:00
Volker Lendecke
843432d56f s3: New notify implementation
From notify_internal.c:

        /*
         * The notify database is split up into two databases: One
         * relatively static index db and the real notify db with the
         * volatile entries.
         */

This change is necessary to make notify scale better in a cluster
2012-04-17 10:21:02 +02:00
Jeremy Allison
d399af30c1 Remove cancel_aio_by_fsp(). It can never work and could lead to memory corruption
as outstanding IO's complete. Also we never have any aio's on a call to close_normal_file()
with close_type ERROR_CLOSE.
2012-04-12 15:06:59 -07:00
Christian Ambach
1d9a3d488d s3:smbd add seperate function to initialize kernel oplocks
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-11 11:11:39 -07:00
Volker Lendecke
eff36099c1 s3: Move the aio signal init to the vfs module
On platforms that don't have an RT signal space, signal initialization
fails. aio_fork and aio_pthread don't need the signal, so this would
block them from running as well.
2012-04-09 18:04:55 +02:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Jeremy Allison
f042de2f34 First part of fix for bug 8837 - smbd crashes when deleting directory and veto files are enabled.
Add some const to the sec_ctx code.
2012-04-04 14:58:42 -07:00
Volker Lendecke
fa6f61e835 s3: Pass filters explicitly through vfs notify watch
This removes a dependency on "struct notify_entry" and makes the nature of the
API more explicit. We depend upon the VFS module to mask out elements from
e->filter and e->subdir_filter that it took over to handle.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Mar 26 17:45:44 CEST 2012 on sn-devel-104
2012-03-26 17:45:43 +02:00
Volker Lendecke
1cc7abf8aa s3: Remove the sys_notify dependency from notify_internal
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar 23 12:12:51 CET 2012 on sn-devel-104
2012-03-23 12:12:51 +01:00
Christof Schmitt
4262eb401f s3:vfs_gpfs: Export disk_norm function
vfs modules implementing the disk_free callback need access
to the function disk_norm for normalizing the data if the parameter
small query is true.
2012-03-22 18:41:22 +01:00
Volker Lendecke
7dcc2bf7af s3: Remove "conn" param from notify_init() 2012-03-21 12:52:10 +01:00
Volker Lendecke
91f77253e7 s3: Remove "conn" param from sys_notify_context_create 2012-03-21 12:52:09 +01:00
Volker Lendecke
8e256a2734 s3: Pass "conn" to sys_notify_watch() 2012-03-21 12:52:09 +01:00
Volker Lendecke
8044db0a4d s3: Pass "conn" to notify_add() 2012-03-21 12:52:09 +01:00
Volker Lendecke
4319076cca s3: Pass "path" through vfs_notify_watch 2012-03-21 12:52:09 +01:00
Volker Lendecke
81ec0cc602 s3: Remove the separate server_id arg to notify_init
The server_id is tied to the messaging_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15 11:00:24 +01:00
Volker Lendecke
8f93068cf8 s3: Add smb_request_done
This is used to enable async chained command sequences. A synchronous
reply_xxx command does not need to take are anymore about and_x
chaining. The async commands (pipe r/w at this moment) must do so
however. When finished, they must inform the main chain engine that
they are finished with a smb_request_done call.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Mar 10 17:14:05 CET 2012 on sn-devel-104
2012-03-10 17:14:05 +01:00
Volker Lendecke
572bc64b59 s3: Remove "req_wct_ofs()"
This is fixed up in construct_reply_chain
2012-03-10 15:34:12 +01:00
Volker Lendecke
11d087aa04 s3: Remove chain_reply
<insert your favourite tombstone ascii art here>
2012-03-10 15:34:12 +01:00
Volker Lendecke
c9870a62f5 s3: Add a new set of andx chain handling routines
This is in preparation of getting rid of chain_reply.
2012-03-10 15:34:11 +01:00
Andrew Bartlett
008648a034 s3-smbd make change_to_user_by_session static 2012-03-07 12:46:13 +01:00
Andrew Bartlett
d7bb961859 s3-auth: Remove security=share (depricated since 3.6).
This patch removes security=share, which Samba implemented by matching
the per-share password provided by the client in the Tree Connect with
a selection of usernames supplied by the client, the smb.conf or
guessed from the environment.

The rationale for the removal is that for the bulk of security=share
users, we just we need a very simple way to run a 'trust the network'
Samba server, where users mark shares as guest ok.  This is still
supported, and the smb.conf options are documented at
https://wiki.samba.org/index.php/Public_Samba_Server

At the same time, this closes the door on one of the most arcane areas
of Samba authentication.

Naturally, full user-name/password authentication remain available in
security=user and above.

This includes documentation updates for username and only user, which
now only do a small amount of what they used to do.

Andrew Bartlett

                       --------------
                      /              \
                     /      REST      \
                    /        IN        \
                   /       PEACE        \
                  /                      \
                  |      SEC_SHARE       |
                  |    security=share    |
                  |                      |
                  |                      |
                  |       5 March        |
                  |                      |
                  |        2012          |
                 *|     *  *  *          | *
        _________)/\\_//(\/(/\)/\//\/\///|_)_______
2012-03-04 23:33:05 +01:00
Jeremy Allison
1c2aacd6da Add open_dir_with_privilege() to ensure we're opening the correct directory when doing backup requests.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar  1 03:50:40 CET 2012 on sn-devel-104
2012-03-01 03:50:40 +01:00
Jeremy Allison
3ddd9916f5 Add accessor functions to set a bool "priv" on a directory handle. Not yet used, but will be part of FLAG_TRANS2_FIND_BACKUP_INTENT code. 2012-02-29 17:04:39 -08:00
Jeremy Allison
89c55485c3 Add the implementation of check_reduced_name_with_privilege(). Now to plumb into
SMB1 requests.
2012-02-29 17:04:08 -08:00
Jeremy Allison
442e79efbd Add check_reduced_name_with_privilege(), filename_convert_with_privilege() (currently unimplemented) in order to prepare for adding SeBackup/SeRestore code to the main fileserver.
Not yet plumbed into the main SMB1/SMB2 code.
2012-02-29 15:57:49 -08:00
Jeremy Allison
e54cf15387 Make dptr_path() and dptr_wcard() const. 2012-02-24 17:12:52 -08:00
Stefan Metzmacher
ee15790d7a s3:smbd: remove unused code from sesssetup.c
metze
2012-01-31 20:17:10 +01:00
Stefan Metzmacher
a7275e57fd s3:smbd/proto.h: remove unused do_map_to_guest() prototype
metze
2012-01-20 23:55:52 +01:00
Jeremy Allison
39c627b607 Fix bug 8710 - connections.tdb - major leak with SMB2.
Ensure the cnum used to claim the connection for SMB2 is the
id that will be used for the SMB2 tcon. Based on code from
Ira Cooper <ira@wakeful.net>.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jan 18 23:14:32 CET 2012 on sn-devel-104
2012-01-18 23:14:32 +01:00
Stefan Metzmacher
03455519e7 s3:smbd: pass smbd_server_connection and a snumused function pointer to reload_services()
metze
2011-12-15 11:11:24 +01:00
Stefan Metzmacher
715933a3d3 s3:smbd: split ID_CACHE_* message handling into parent and child parts
metze
2011-12-15 08:16:31 +01:00
Stefan Metzmacher
324e66fd45 s3:smbd/oplock: make process_oplock_async_level2_break_message() static
metze
2011-12-14 12:00:07 +01:00
Stefan Metzmacher
1515f7db00 s3:smbd: remove unused smbd_messaging_context()
metze
2011-12-14 08:15:30 +01:00
Stefan Metzmacher
290ce331b6 s3:smbd: pass smbd_server_connection to smbd_setup_sig_hup_handler()
metze
2011-12-13 20:31:09 +01:00
Stefan Metzmacher
8a83464216 s3:smbd: pass smbd_server_connection to smbd_setup_sig_term_handler()
metze
2011-12-13 20:31:09 +01:00
Stefan Metzmacher
6fc8dc98ab s3:smbd/oplock: pass smbd_server_connection to onefs_init_kernel_oplocks()
metze
2011-12-13 20:31:09 +01:00
Stefan Metzmacher
641a2dea81 s3:smbd/oplock: pass smbd_server_connection to linux_init_kernel_oplocks()
metze
2011-12-13 20:31:09 +01:00
Stefan Metzmacher
47e21bcc43 s3:smbd/oplock: pass smbd_server_connection to irix_init_kernel_oplocks()
metze
2011-12-13 20:31:09 +01:00
Stefan Metzmacher
21de673575 s3:smbd/oplock: pass smbd_server_connection to init_oplocks()
metze
2011-12-13 20:31:09 +01:00
Volker Lendecke
5efd7e16c2 s3: Move can_delete_directory to smbd/, remove shim
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 13 19:00:37 CET 2011 on sn-devel-104
2011-12-13 19:00:37 +01:00
Volker Lendecke
34d58c9d92 s3: Move can_set_delete_on_close to smbd/ 2011-12-13 17:27:26 +01:00
Stefan Metzmacher
3cf275cd75 s3:smbd/msdfs: enum_msdfs_links() doesn't need a smbd_server_connection anymore
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Dec 13 17:26:20 CET 2011 on sn-devel-104
2011-12-13 17:26:20 +01:00
Stefan Metzmacher
cefb797434 s3:smbd: add connections_snum_used()
This works similar to conn_snum_used(), but instead of
looking at the current connection only, it looks at
all active connections in "connections.tdb".

metze
2011-12-13 15:45:36 +01:00
Jeremy Allison
05e841c82c Final part of patchset to fix bug #8556 - ACL permissions ignored when SMBsetatr is requested.
This now plumbs access checks through all setattr calls.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Nov 16 04:20:04 CET 2011 on sn-devel-104
2011-11-16 04:20:04 +01:00
Stefan Metzmacher
2802be75e3 s3:smbd/aio: add cancel_smb2_aio()
metze
2011-11-15 17:14:13 +01:00
Jeremy Allison
b988a3233f Remove can_access_file_acl(). We no longer need this duplicate code (hurrah!). 2011-11-04 15:55:11 -07:00
Jeremy Allison
4851219333 Add const to the smb_filename argument of smbd_check_access_rights(). 2011-11-04 15:39:55 -07:00
Jeremy Allison
a30f84a21c Expose smbd_check_access_rights() to other modules. 2011-11-04 14:37:26 -07:00
Jeremy Allison
07edf6c65e smb1_file_se_access_check() is now static to smbd/open.c 2011-11-04 14:16:37 -07:00
Jeremy Allison
1fab17de94 Revert "Change function signature of check_parent_access() to take char * instead of struct smb_filename."
This reverts commit a11c0a41a3.

Not needed.
2011-11-04 14:15:47 -07:00
Jeremy Allison
a11c0a41a3 Change function signature of check_parent_access() to take char * instead of struct smb_filename.
Expose it so it can be called from directory code.
2011-11-01 16:38:14 -07:00
Jeremy Allison
d1a4ee604f Second part of fix for bug #8541 - readlink() on Linux clients fails if the symlink target is outside of the share.
The statcache has to do lstat instead of stat when returning cached
posix pathnames.
2011-10-22 04:57:10 +02:00
Jeremy Allison
662e9c04fb Fix bug #8541 - readlink() on Linux clients fails if the symlink target is outside of the share.
The key is to only allow the lookup to succeed if it's a UNIX level lookup or readlink,
but disallow all other operations.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Oct 22 01:37:41 CEST 2011 on sn-devel-104
2011-10-22 01:37:41 +02:00
Frank Lahm
c3bdcab516 First part of fix for bug #8419 - Make VFS op "streaminfo" stackable.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Oct 17 21:39:32 CEST 2011 on sn-devel-104
2011-10-17 21:39:32 +02:00
Günther Deschner
46e7ab37bf s3: remove some dead prototypes.
Guenther
2011-10-14 12:07:23 +02:00
Gregor Beck
6648d90652 s3:smbcontrol: let smbd pass the idmap msg to its children for convenience
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-12 22:45:53 +02:00
Gregor Beck
da85f5a43e s3: factor out messaging_send_to_children()
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-12 22:45:53 +02:00
Volker Lendecke
b35d80aa38 s3: Remove the smbd_server_conn ref from create_junction
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Sep 26 16:33:30 CEST 2011 on sn-devel-104
2011-09-26 16:33:29 +02:00
Volker Lendecke
fba833d055 s3: Remove the smbd_server_conn ref from get_referred_path 2011-09-26 14:59:12 +02:00
Volker Lendecke
425b93ef69 s3: Remove the smbd_server_conn ref from create_conn_struct 2011-09-26 14:59:12 +02:00
Stefan Metzmacher
abb24bf8e8 s3:smbd: make use of better SMB signing negotiation
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Sep 14 09:41:02 CEST 2011 on sn-devel-104
2011-09-14 09:41:02 +02:00
Andreas Schneider
3e8c665465 s3-smbd: Rename reload_printers() and add documentation.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Sep  5 17:59:47 CEST 2011 on sn-devel-104
2011-09-05 17:59:47 +02:00
Volker Lendecke
f533b50105 s3: Pass smbd_server_connection to (unused) server_encryption_shutdown 2011-08-25 21:36:19 +02:00
Volker Lendecke
7e70f85350 s3: Pass smbd_server_connection to srv_encrypt_buffer 2011-08-25 21:36:19 +02:00
Volker Lendecke
d4c4705e55 s3: Pass smbd_server_connection to srv_decrypt_buffer 2011-08-25 21:36:19 +02:00
Volker Lendecke
08262fe964 s3: Pass smbd_server_connection to srv_free_enc_buffer 2011-08-25 21:36:19 +02:00
Volker Lendecke
f9ef138ec7 s3: Pass smbd_server_connection to is_encrypted_packet 2011-08-25 21:36:19 +02:00
Andreas Schneider
61ada700a6 s3-id_cache: Use better names for id cache management ops
The IDMAP term is normally associated with Winbind's idmap stuff.
These functions deal with id caching not id mapping.

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andreas Schneider
177db0a880 s3-id_cache: Move id caches mgmt out of smbd
We must leave the MSG_IDMAP_KILL operation in SMBD as it uses smbd
specific internal globals and makes sense only in the context of a smbd
daemon.
The rest is moved under lib/ as we need to deal with id cache cleanups
in other daemons too (like lsasd).

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andreas Schneider
dd3a927959 s3-smbd: Pass tevent context to smbd_server_connection_loop_once().
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-09 10:41:47 +02:00
Volker Lendecke
dfa8a5fca5 s3: Make srv_enc_ctx static
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Aug  5 18:29:24 CEST 2011 on sn-devel-104
2011-08-05 18:29:24 +02:00
Andrew Bartlett
9a45bf3952 s3-auth set session_info->sanitized_username in create_local_token()
Rather than passing this value around the callers, and eventually
setting it in register_existing_vuid(), we simply pass it to
create_local_token().  This also removes the need for
auth_ntlmssp_get_username().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Volker Lendecke
f9d183f931 s3: Pass sconn explicitly to open_was_deferred 2011-08-02 19:18:08 +02:00
Volker Lendecke
502fdae7f1 s3: Pass sconn explicitly to schedule_deferred_open_message_smb 2011-08-02 19:18:08 +02:00
Volker Lendecke
04253dfd9f s3: Explicitly pass sconn to remove_deferred_open_message_smb 2011-08-02 19:18:08 +02:00
Simo Sorce
2e8a85ec72 s3:smbd - Move printing queue stuff
This way we can properly deal with pcap updates in the background queue process
if it is enabled (on by default) and not perform these actions in the main
smbd process.

Signed-off-by: Günther Deschner <gd@samba.org>
2011-08-02 15:28:03 +02:00
Volker Lendecke
190b5432f0 s3: Make map_open_params_to_ntcreate() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
0102c6e2bc s3: Make is_executable() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
6d67d41444 s3: We only need base_name in map_open_params_to_ntcreate 2011-07-29 16:43:17 +02:00
Andrew Bartlett
9fcc617ff5 s3-auth Use the common auth_session_info
This patch finally has the same structure being used to describe the
authorization data of a user across the whole codebase.

This will allow of our session handling to be accomplished with common code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
f16d8f4eb8 s3-auth Use struct auth3_session_info outside the auth subsystem
This seperation between the structure used inside the auth modules and
in the wider codebase allows for a gradual migration from struct
auth_serversupplied_info -> struct auth_session_info (from auth.idl)

The idea here is that we keep a clear seperation between the structure
before and after the local groups, local user lookup and the session
key modifications have been processed, as the lack of this seperation
has caused issues in the past.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
c599d075cb s3-lib Move event_add_idle() to source3/lib/events.c
This allows libauth not to depend on smbd_base.

Andrew Bartlett
2011-07-04 18:53:59 +10:00
Andrew Bartlett
b373d0e777 s3-build: Provide a run-time shim to work around duplicate symbols
The become_root() and similar 'smbd' functions that are used widely in
Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c.

These have been replaced by a runtime plugin mechanim, which ensures
that standlone binaries still do nothing, while in smbd the correct
function is used.

This avoids having these as duplicate symbols in the smbd binary,
which can cause unpredictable behaviour.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:51 +10:00
Rusty Russell
a4993f647c ldb: replace 'struct TDB_DATA' with 'TDB_DATA'
The typedef is TDB2 compatible, the struct isn't.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Michael Adam
2e6f8f7bda s3:smbd/proto.h: add _SMBD_PROTO_H_ guard 2011-05-31 01:44:27 +02:00
Michael Adam
e1bad49f3e s3:smbd/proto.h: add GPL/Copyright header 2011-05-31 01:44:27 +02:00
Andrew Bartlett
ade01f083c s3-smbd Split conn.c into 3 files
The idea with this split is to make it easier to handle dependencies,
avoiding having the loadparm code depend on the global server
variables, without resorting to dummy functions and linker tricks.

conn_clear_vuid_cache() is brought in from uid.c to make it static

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
8524924a46 s3-smbd provide struct smbd_server_connection * to conn_snum_used
This provides the 'sconn' parameter to this key functions, that
is currently duplicated in dummysmbd.c, which causes duplicate symbol
issues in the waf build.

This has natrually caused a number of consequential changes across the
codebase, includning not passing a messaging context into initial
reload_services():

This causes problems because the global smbd_server_connection isn't
yet set up, as there isn't a connection here, just the initial
process.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Volker Lendecke
8a2eff871f s3: Fork the echo handler only after SMB1 negprot is done
This enables activating the echo responder also if SMB2 is enabled, albeit it
will only be used for SMB1 at this moment.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri May 20 15:06:03 CEST 2011 on sn-devel-104
2011-05-20 15:06:03 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Jeremy Allison
4f41be356a Fix many const compiler warnings. 2011-05-05 10:41:59 -07:00
Günther Deschner
61cd1067ef s3-smbd: avoid using pipes_struct when only session_info is needed.
Guenther
2011-05-02 15:03:43 +02:00
Jeremy Allison
525ccd589e Ensure vfs_chown_fsp() is safe against races. 2011-04-15 12:21:39 -07:00
Volker Lendecke
015511d12a s3: Make send_nt_replies() static
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Apr 13 16:25:29 CEST 2011 on sn-devel-104
2011-04-13 16:25:29 +02:00
Andreas Schneider
b137156acb s3-smbd: Added a become_user_by_session() function.
This uses the provided session_info instead of searching the user via
the vuid. This is useful to work with fake connnection you need to
create if someone connects directly to a rpc service.

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-04-11 22:10:22 +02:00
Andreas Schneider
27cb378283 s3-smbd: Added a change_to_user_by_session() function.
Signed-off-by: Jeremy Allison <jra@samba.org>
2011-04-11 22:10:21 +02:00
Jeremy Allison
f9a2f4f47c Fix bug #7996 - sgid bit lost on folder rename.
Refuse to set dos attributes into unix mode bits on such a
folder.
2011-03-30 18:01:19 -07:00
Günther Deschner
4bd5f51c43 s3-prototyes: user_in_netgroup and user_in_list moved to auth, out of smbd.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
ef990a1701 s3-smbd: add smbd.h and move smbd prototypes to smbd/proto.h.
Guenther
2011-03-30 01:13:08 +02:00