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

118 Commits

Author SHA1 Message Date
Volker Lendecke
e8ce1c6483 smbd: Remove some unused includes
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-04-11 23:35:15 +00:00
Ralph Boehme
14b6e6842b s3:smbd: add twrp args to filename_convert()
All existing callers pass NULL, no change in behaviour.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-27 07:13:13 +01:00
Christof Schmitt
cc76aaeb62 s3: Rename server_messaging_context() to global_messaging_context()
This reflects that the messaging context is also used outside of the
server processes.

The command used for the rename:
find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_messaging_context/global_messaging_context/'

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2018-09-07 17:26:17 +02:00
Volker Lendecke
3bff0494e1 smbd: Pass "share_mode_data" to share_entry_forall callback
Quite a bit of the contents have been passed explicitly anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-07-26 22:44:25 +02:00
Stefan Metzmacher
498830ccd2 s3:rpc_server/srvsvc: _srvsvc_NetSetFileSecurity form_junctions() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-06-14 20:52:22 +02:00
Stefan Metzmacher
f9860b67be s3:rpc_server/srvsvc: _srvsvc_NetGetFileSecurity() to use create_conn_struct_tos_cwd()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-06-14 20:52:22 +02:00
Stefan Metzmacher
185d47159a s3:rpc_server/srvsvc: add an explicit talloc_stackframe() to _srvsvc_NetSetFileSecurity()
This makes further changes simpler.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-06-14 20:52:22 +02:00
Stefan Metzmacher
44e3c03bc1 s3:rpc_server/srvsvc: add an explicit talloc_stackframe() to _srvsvc_NetGetFileSecurity()
This makes further changes simpler.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-06-14 20:52:22 +02:00
Stefan Metzmacher
ebae5e055c printing: remove unused arguments from delete_and_reload_printers()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-06-14 20:52:20 +02:00
Andreas Schneider
c2e9fb63c0 s3:rpc_server: Fix size types in srvsvc
This fixes compilation with -Wstrict-overflow=2

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-03-20 23:16:16 +01:00
Volker Lendecke
9d7701c923 srvsvc: Avoid a dependency on share_mode_entry->id
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-02-13 00:26:43 +01:00
Volker Lendecke
fc424b28cd smbd: Pass "file_id" explicitly into share_mode_entry_to_message()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-02-13 00:26:43 +01:00
Volker Lendecke
c1079e3d2a srvsvc: Use the passed-in file_id
The one in share_mode_entry will go

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-02-13 00:26:43 +01:00
Volker Lendecke
9487510e9e smbd: Pass in "file_id" into share_mode_str()
This used to directly access share_entry->id, which will go

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-02-13 00:26:43 +01:00
Volker Lendecke
786e307fd4 srvsvc: Use the passed-in file id, not the one from share_mode_entry
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-02-13 00:26:43 +01:00
Volker Lendecke
f519162657 smbd: Pass "file_id" through share_entry_forall
It's also in the share_entry, but that is redundant and will go

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-02-13 00:26:43 +01:00
Volker Lendecke
6423ca4bf2 lib: Use messaging_send_all instead of message_send_all
Just a global search&replace

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-12-05 00:56:13 +01:00
Volker Lendecke
fc2f0023a0 messaging: Remove the "n_sent" arg from message_send_all
The only user of this is an informative message in smbcontrol. I don't think
that's worth the effort.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-12-05 00:56:12 +01:00
Marc Muehlfeld
36cbb4ad49 Updated error message text and reduced its debug level
Previously, "net rpc share add|remove" commands failed if no
"add|delete share command" parameter was set in smb.conf. However,
the error was only logged at level 10 and not very clear.
This patch updates the error message text and sets the log level of this
error to 1 to make it more obvious what is missing.

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-12 21:14:13 +02:00
Jeremy Allison
6acb0d6ca0 s3: VFS: Change SMB_VFS_CHDIR to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2017-07-01 03:07:11 +02:00
Jeremy Allison
f2f936a961 s3: smbd: We can now remove the 'bool dfs_path' parameter from filename_convert().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
2017-05-22 18:41:16 +02:00
Volker Lendecke
9af73f62ce lib: Add lib/util/server_id.h
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-22 18:30:11 +01:00
Trever L. Adams
7accec7f78 Update smbrun to allow for settings environment variables.
Signed-off-by: Trever L. Adams <trever.adams@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 13 04:26:26 CEST 2016 on sn-devel-144
2016-10-13 04:26:26 +02:00
Günther Deschner
5b2ce01b77 werror: replace WERR_UNKNOWN_LEVEL with WERR_INVALID_LEVEL in source3/rpc_server/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:34 +02:00
Günther Deschner
9711b740c3 werror: replace WERR_NET_NAME_NOT_FOUND with WERR_NERR_NETNAMENOTFOUND in source3/rpc_server/srvsvc/srv_srvsvc_nt.c
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:27 +02:00
Günther Deschner
7d54fde08f werror: replace WERR_OBJECT_PATH_INVALID with WERR_BAD_PATHNAME in source3/rpc_server/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:24 +02:00
Günther Deschner
402bafcbca werror: replace WERR_INVALID_PARAM with WERR_INVALID_PARAMETER in source3/rpc_server/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:22 +02:00
Günther Deschner
d5808eb3cf werror: replace WERR_NO_SUCH_SHARE with WERR_BAD_NET_NAME in source3/rpc_server/srvsvc/srv_srvsvc_nt.c
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:22 +02:00
Günther Deschner
74d3bf1488 werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source3/rpc_server/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:19 +02:00
Günther Deschner
3af16e4abd werror: replace WERR_BADFILE with WERR_FILE_NOT_FOUND in source3/rpc_client/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:17 +02:00
Volker Lendecke
f396449e7a lib: Move "message_send_all" to serverid.c
Trying to trim down messages.c a bit: Sending to all processes that are
registered in serverid.tdb and filtering to me is not really logic of general
messaging but more of the serverid code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-07-28 05:00:19 +02:00
Aurelien Aptel
85e414aefc s3/rpc_server/srvsvc/srv_srvsvc_nt.c: change snum to signed int
snum is used to store the result of the find_service() call which
returns a signed int, with -1 being an error.

with an uint32_t the error check (< 0) is always false.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-04 21:24:14 +01:00
Alberto Maria Fiaschi
5036a0922b access based share enum: handle permission set in configuration files
change function is_enumeration_allowed to check  permissions set by
fields: valid users, invalid users, only user.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=8093

Signed-off-by: Alberto Maria Fiaschi <alberto.fiaschi@estar.toscana.it>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2016-03-02 20:39:24 +01:00
Jeremy Allison
52bae7927c s3: smbd: Remove lp_posix_pathnames() checks on paths sent in via old Win9X RPC calls.
No unix client makes these.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:17 +01:00
Jeremy Allison
4ce5de5fd9 s3: smbd: In srv_srvsvc_nt.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
5d03e7550b s3: smbd: In srv_srvsvc_nt.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Ralph Boehme
cd0c2a5eca s3:smbstatus: add stream name to share_entry_forall()
Add stream name argument to share_entry_forall machinery so smbstatus
can print the stream name of a file.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11550

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-12 22:13:19 +02:00
Richard Sharpe
0dde2106bb Covert all uint32/16/8 to _t in source3/rpc_server.
This can be committed regardless of the state of the PIDL changes.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-15 19:31:24 +02:00
Anoop C S
76ba7f93b4 rpc_server/srvsvc: Fix CID 241162 Logically dead code
Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2015-04-17 22:56:11 +02:00
Ralph Boehme
142db4048f s3:vfs: add create tags to SMB_VFS_CREATEFILE
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:07 +01:00
David Disseldorp
2d755a4e2a srv_srvsvc_nt: remove unneeded get_share_params() call
The snum and share name are already determined via the prior
find_service() call.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-26 19:05:37 +01:00
Volker Lendecke
9010bbeb00 s3:locking: allow early return for share_entry_forall()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-31 03:47:40 +01:00
Volker Lendecke
0d4f7bfdb9 s3:locking: Rename share_mode_forall->share_entry_forall
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-10-31 03:47:40 +01:00
Volker Lendecke
446de4f680 vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 21:11:16 +02:00
David Disseldorp
4f4501ac1f printing: only reload printer shares on client enum
Currently, automatic printer share updates are handled in the following
way:
- Background printer process (BPP) forked on startup
- Parent smbd and per-client children await MSG_PRINTER_PCAP messages
- BPP periodically polls the printing backend for printcap data
	- printcap data written to printer_list.tdb
	- MSG_PRINTER_PCAP sent to all smbd processes following update
- smbd processes all read the latest printer_list.tdb data, and update
  their share listings

This procedure is not scalable, as all smbd processes hit
printer_list.tdb in parallel, resulting in a large spike in CPU usage.

This change sees smbd processes only update their printer share lists
only when a client asks for this information, e.g. via NetShareEnum or
EnumPrinters.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652

Suggested-by: Volker Lendecke <vl@samba.org>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-08 14:10:38 +02:00
Jeremy Allison
6549716cc1 s3: srvsvc pipe - We should return WERR_BADFILE in _srvsvc_NetShareAdd if the path does not exist.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 22 22:19:18 CEST 2014 on sn-devel-104
2014-04-22 22:19:18 +02:00
Shekhar Amlekar
fc4845f481 s3: rpc_server/srvsvc: count open files in NetConnEnum
Signed-off-by: Shekhar Amlekar <samlekar@in.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr  3 21:19:43 CEST 2014 on sn-devel-104
2014-04-03 21:19:43 +02:00
Shekhar Amlekar
fe6ec8c111 s3: rpc_server/srvsvc: count share connections in NetConnEnum
Signed-off-by: Shekhar Amlekar <samlekar@in.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-04-03 19:01:12 +02:00
Shekhar Amlekar
e68547204f s3: rpc_server/srvsvc: added routines to compute opens on share connections.
Added routines count_share_opens() and share_file_fn() to count
opens on share connections.

Signed-off-by: Shekhar Amlekar <samlekar@in.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-04-03 19:01:12 +02:00
Shekhar Amlekar
992c86d715 s3: rpc_server/srvsvc: Added routines to count share connections.
Added routines count_share_conns() and share_conn_fn() to count
connections to a share.

Signed-off-by: Shekhar Amlekar <samlekar@in.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-04-03 19:01:12 +02:00