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

2547 Commits

Author SHA1 Message Date
Simo Sorce
a1fe2ed68a s3-spoolss: Use winreg_delete_printer_key to delete printers.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Simo Sorce
fdf669d377 s3-spoolss: Get rid of get_server_name.
This function was useless the structure is public and used everywhere.

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Simo Sorce
44bc6714b0 s3-printing: Converted printer publishing functions.
Use spoolss_PrintInfo2 and winreg calls.

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Simo Sorce
017a305fed s3-printing: Convert print_time_access_check.
use spoolss_PrintInfo2 and winreg calls

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Simo Sorce
375bdfc7f8 s3-spoolss: Removed construct_dev_mode() function.
Replace it with spoolss_create_default_devmode() or
copy_devicemode() where needed.

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:09 -04:00
Simo Sorce
52b8f1f471 s3-spoolss: Migrated driver functions to winreg.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:09 -04:00
Andreas Schneider
e2c9ad93cb s3-spoolss: Migrated spoolss_AddPrinter and spoolss_SetPrinter.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:08 -04:00
Simo Sorce
5604a78f09 s3-spoolss: Migrated NT_DEVICEMODE to spoolss_DeviceMode.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:06 -04:00
Volker Lendecke
2ad4b4f63e s3: Convert cli_qpathinfo_streams to cli_qpathinfo_send 2010-07-26 23:01:38 +02:00
Volker Lendecke
7c242cab95 s3: Convert cli_qpathinfo_basic to cli_qpathinfo_send 2010-07-26 23:01:37 +02:00
Volker Lendecke
f62bde93ce s3: Convert cli_qpathinfo2 to cli_qpathinfo_send 2010-07-26 23:01:37 +02:00
Volker Lendecke
0ba4404f21 s3: Convert cli_qpathinfo1 to cli_qpathinfo 2010-07-26 09:51:37 +02:00
Volker Lendecke
334d5bfe30 s3: Convert cli_get_ea_list_path to cli_qpathinfo_send 2010-07-25 22:29:44 +02:00
Volker Lendecke
535774d880 s3: Add async cli_qpathinfo 2010-07-25 22:29:43 +02:00
Volker Lendecke
ce3dfd777f s3: cli_qpathinfo->cli_qpathinfo1 2010-07-25 22:29:42 +02:00
Jeremy Allison
5002b3a90d Add approriate TALLOC_CTX's thoughout the spnego code. No more implicit NULL contexts.
Jeremy.
2010-07-20 16:17:58 -07:00
Jeremy Allison
cce19c5162 Fix one more data_blob -> data_blob_talloc. Move away from implicit NULL context tallocs.
Jeremy.
2010-07-20 14:59:31 -07:00
Jeremy Allison
4ed9437b7e Add TALLOC_CTX argument to spnego_parse_negTokenInit, reduce
use of malloc, and data_blob().

Jeremy.
2010-07-20 13:35:43 -07:00
Jeremy Allison
7d17bfcf51 Rename spnego_gen_negTokenTarg() -> spnego_gen_krb5_negTokenInit()
as this correctly describes what this function does.

Jeremy.
2010-07-20 11:14:49 -07:00
Simo Sorce
b20e5eb3aa dcerpc: Clarify what the arguments of dcerpc_pull_auth_trailer() actually represent. 2010-07-20 08:28:19 -04:00
Simo Sorce
4581902553 s3-dcerpc: Unifiy cli_pipe_auth_data and pipe_auth_data
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:37 +10:00
Simo Sorce
e958b39042 s3-auth: Move auth_ntlmssp wrappers in their own file
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:31 +10:00
Simo Sorce
a04bbd281c s3-auth: Refactor and rename auth_ntlmssp_server_info()
Rename it to auth_ntlmssp_steal_server_info() to make it clear that
the server_info struct is stolen from the auth_ntlmssp_state structure.
Use talloc_move instead of manual steal&clear
Add comments to explain what is going on.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:24 +10:00
Jeremy Allison
0bb8d133c9 Remove gen_negTokenInit() - change all callers to spnego_gen_negTokenInit().
We now have one function to do this in all calling code. More rationalization
to follow.

Jeremy.
2010-07-19 17:14:26 -07:00
Jeremy Allison
8cba4a0c96 Move the addition of the 16 byte guid out of spnego_gen_negTokenInit() and
into negprot_spnego() where it belongs (it's not an SPNEGO operation).
Add a TALLOC_CTX for callers of negprot_spnego(). Closer to unifying all
the gen_negTokenXXX calls.

Jeremy.
2010-07-19 16:45:16 -07:00
Jeremy Allison
625a511389 Remove parse_negTokenTarg(), as it's actually incorrect. We're processing
negTokenInit's here. Use common code in spnego_parse_negTokenInit().

Jeremy.
2010-07-19 15:41:45 -07:00
Andreas Schneider
5cefbfef26 s3-rpc_server: Added callbacks for init and shutdown of a rpc service.
This adds two callback function for each rpc service. One is for
initialisation and the other for shutdown. rpc_<service>_unregister()
needs to be called to execute the shutdown function.
2010-07-19 12:59:18 +02:00
Simo Sorce
c09dcb903c s3-auth: Use talloc hierarchies to properly free auth_ntlmssp_state contexts
Turn auth_ntlmssp_end into a destructor and attach it to auth_ntlmssp_state.
Remote auth_ntlmssp_end and use TALLOC_FREE in the callers.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:20:04 +10:00
Simo Sorce
cdcdaaa6dd s3-ntlmssp: Remove ntlmssp_end and let the talloc hierarchy handle it.
All the members are children of ntlmssp_state anyway.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:19:47 +10:00
Simo Sorce
65116adceb s3-dcerpc: Fix ability to receive Big Endian PDUs 2010-07-16 16:02:39 -04:00
Jeremy Allison
e058de31e8 Make the "map to guest" parameter work correctly with NTLMSSP (spnego
and raw) under SMB2. Still need to investigate fixing this with krb5
auth (does this make sense ?).

Jeremy.
2010-07-16 11:05:34 -07:00
Simo Sorce
f4c6c7e7b8 Move the remnants of rpc_parse code under registry/
The registry code is the only last user of this code.
Move everything under registry/ and hope someone will get rid od
it completely from there in the future.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:18 +02:00
Simo Sorce
7520d8e926 s3-parse_prs: Remove unuesd functions
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:18 +02:00
Simo Sorce
67b6fe3dc3 s3-misc: Move smb_io_time() to regfio.c
This is the last file using this function and we do not want anyone
else to keep using hand marshalled stuff anyway.
So make it also private to that file.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:18 +02:00
Simo Sorce
8f2bfa88b5 s3-dcerpc: Use DATA_BLOB instead of prs_struct for req_data
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:18 +02:00
Simo Sorce
ff121c89d3 s3-dcerpc: Use DATA_BLOB instead of prs_struct for reply_pdu
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:17 +02:00
Simo Sorce
bd19c964d5 s3-dcerpc: Move common helpers into a common file
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:17 +02:00
Simo Sorce
cb3725a931 dcerpc: remove ncacn_packet_header and related functions
ncacn_packet_header was an artifact and it is not necessary anymore

Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:17 +02:00
Simo Sorce
2452a7a4c1 s3-dcerpc: consolidate respones packet creation code
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:16 +02:00
Simo Sorce
31b59bbf99 s3-dcerpc: Convert rdata from prs_struct to a simple DATA_BLOB
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:16 +02:00
Simo Sorce
8246214e7e s3-dcerpc: Remove unused functions and headers
parse_rpc.c is dead, long live parse_rpc.c !

Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:16 +02:00
Andrew Bartlett
0d95cee58f s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS
This fixes a bug where register_existing_vuid() could be called with a
NULL server_info if the alloction failed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-07-14 16:22:49 +10:00
Simo Sorce
0c93b7dff7 s3-dcerpc: Remove unused functions and headers
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:12 +02:00
Simo Sorce
87605e2030 s3-dcerpc: fix dcerpc_push_ncacn_packet, pass arg by address
There is no need to copy the whole structure twice by passing it in by value.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:11 +02:00
Simo Sorce
29a3142be8 s3-dcerpc: Remove unused functions
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:11 +02:00
Simo Sorce
8e235df2de s3-dcerpc: Use dcerpc_pull_ncacn_packet() to unmarshall dceprc requests
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:11 +02:00
Simo Sorce
e340aa40d1 dcerpc: move dcerpc_pull_auth_trailer into a the common dcerpc_util.c file
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:10 +02:00
Simo Sorce
77699c777e sr-dcerpc: add dcerpc_push_ncacn_packet_header()
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:10 +02:00
Simo Sorce
cf664b73a4 s3-dcerpc: Use dcerpc_set_frag_length()
Automatically calculate the fragment length where possible.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:09 +02:00
Günther Deschner
ea66d8e4a5 s3-dcerpc: link against ../librpc/rpc/dcerpc_util.c
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:09 +02:00
Simo Sorce
2297913829 s3-dcerpc: Remove unused prototype
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-13 14:44:09 +02:00
Volker Lendecke
c186f92437 s3: [ug]id_to_unix_... can not fail
Remove some silly failure checks
2010-07-11 17:33:34 +02:00
Simo Sorce
1796767a36 s3-dcerpc: make dcerpc_pull_dcerpc_auth() public 2010-07-08 18:38:56 -04:00
Simo Sorce
a054832f4f s3-dcerpc: make dceprc_push_dcerpc_auth public 2010-07-08 18:38:56 -04:00
Günther Deschner
690ed0c5e2 s3-rpc: when using rpc_pipe_open_internal, make sure to go through NDR.
Otherwise a lot of information that is usually generated in the ndr_push remains
in an uninitialized state.

Guenther
2010-07-08 16:35:26 +02:00
Simo Sorce
7571c15af9 s3:dcerpc Remove unused structure and functions 2010-07-08 01:48:05 -04:00
Simo Sorce
0d9b63663f s3:dcerpc Add prs_parse_dcerpc_bind 2010-07-08 01:41:24 -04:00
Simo Sorce
ae526514a9 s3:rpc user idl define dcerpc_ctx_list instead of custom RPC_CONTEXT 2010-07-08 01:08:05 -04:00
Günther Deschner
77e3fffd09 s3-dcerpc: add dcerpc_pull_ncacn_packet_header().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-08 00:29:33 -04:00
Günther Deschner
257f5145b5 s3-dcerpc: remove unused init_rpc_hdr_rb and init_rpc_context.
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:51 -04:00
Günther Deschner
dc6e0cedfc s3-dcerpc: remove unused smb_io_rpc_hdr_fault.
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:50 -04:00
Günther Deschner
cb9eddb312 s3-dcerpc: add dcerpc_pull_ncacn_packet().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:50 -04:00
Günther Deschner
3d9a12dca7 s3-dcerpc: add dcerpc_push_ncacn_packet().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:50 -04:00
Günther Deschner
7e1fa8d067 s3-rpc_parse: remove finally unused prs_unistr().
Guenther
2010-07-07 15:29:25 +02:00
Volker Lendecke
3278554b3e s3: Make talloc_attrs() static 2010-07-05 12:37:13 +02:00
Volker Lendecke
e168b85f00 s3: Remove procid_self() from fill_deferred_open_entry() 2010-07-05 11:06:31 +02:00
Volker Lendecke
13441a9e18 s3: Remove procid_self() from session_claim() 2010-07-05 11:06:25 +02:00
Volker Lendecke
23a31becac s3: Remove unused msg_flags from connections.tdb
This breaks rolling code upgrade!
2010-07-04 21:49:03 +02:00
Volker Lendecke
b0c83d50f9 s3: Replace register_message_flags() with serverid_register_msg_flags()
message_send_all is now done by walking the serverid.tdb, not the
connections.tdb anymore.

Günther, Simo, please check!
2010-07-04 21:49:03 +02:00
Volker Lendecke
7f0e6df883 s3: Pass the new server_id through reinit_after_fork 2010-07-04 17:29:23 +02:00
Günther Deschner
04641abb33 s3-libads: move ldap posix schema defines to their own header file.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
56538be6af s3-libads: move ads_dns out of main includes.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
e64df82146 s3-libads: move ads_status to a separate header file.
Guenther
2010-07-01 23:20:39 +02:00
Günther Deschner
6625aada81 s3-libsmb: move change_trust_account_password out of smbd into libsmb.
Guenther
2010-06-30 21:46:08 +02:00
Volker Lendecke
ba0ba4e85b s3: Make some routines static in smbldap 2010-06-28 16:57:04 +02:00
Jeremy Allison
5a77d648d9 Remove two unused functions (prs_force_dynamic, prs_set_session_key).
Jeremy.
2010-06-16 10:26:47 -07:00
Andreas Schneider
47ae4a518c s3-spoolss: Provide a memory context for clean_up_driver_struct().
If we use a stack variable to setup spoolss_AddDriverInfoCtr this would
segfault with a talloc bad magic value.
2010-06-16 12:03:46 +02:00
Jeremy Allison
81f70834ca Remove unused function. 2010-06-15 15:33:44 -07:00
Volker Lendecke
c7f44801e3 s3: Remove fsp_belongs_conn
check_open_fsp does exactly the same
2010-06-13 15:20:58 +02:00
Volker Lendecke
330a64c72b s3: Explicitly pass sconn to process_blocking_lock_queue 2010-06-12 15:42:56 +02:00
Volker Lendecke
ec2079f5d0 s3: Explicitly pass sconn to blocking_lock_was_deferred_smb1 2010-06-12 15:42:56 +02:00
Volker Lendecke
f856fb0b35 s3: Explicitly pass sconn to remove_pending_lock_requests_by_mid_smb1 2010-06-12 15:42:56 +02:00
Volker Lendecke
5d43180a55 s3: Explicitly pass sconn to the remove_pending_change_notify_request_by_mid 2010-06-12 15:42:55 +02:00
Volker Lendecke
f589909eb1 s3: change_notify_reply() does not need its "conn" argument 2010-06-12 15:42:55 +02:00
Volker Lendecke
dd192bb649 s3: Explicitly pass sconn to is_valid_writeX_buffer 2010-06-12 15:42:52 +02:00
Volker Lendecke
d5f20aea73 s3: Pass sconn explicitly to reply_special 2010-06-12 15:42:52 +02:00
Simo Sorce
a53ca94416 s3:rpc improve handles memory hierarchy and use better name.
While there also cleanup the code a bit.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-06-11 00:43:23 +02:00
Simo Sorce
5e576a53ab s3:lib make server contexts generic
Pair-programmed-with: Andreas Schneider <asn@samba.org>
2010-06-10 17:30:45 -04:00
Jeremy Allison
321d7a6303 Implement AIO in SMB2. Doesn't allow cancel calls yet (to be added).
Jeremy.
2010-06-10 13:20:37 -07:00
Volker Lendecke
34b29b1198 Revert "s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS"
This reverts commit edba46ce94.

Conflicts:

	source3/auth/auth_ntlmssp.c
2010-06-08 11:38:08 +02:00
Simo Sorce
5da783f4a7 s3:smbd add utility function to check if there are open pipes 2010-06-07 17:25:48 -04:00
Simo Sorce
f9fc4df0c0 s3:rpc make num_pipe_handles get an actual pipe as argument
Let the function abstract out how handles are counted
2010-06-07 17:25:48 -04:00
Andrew Bartlett
9a747d500f s3:auth add hooks to indicate if signing or sealing is desired with NTLMSSP
This allows the right hooks to be called in GENSEC when s3compat
implements the auth_ntlmssp interface.  Otherwise, we can't do the
signing or sealing as we have not negoitated it's use.

Andrew Bartlett
2010-06-07 23:34:29 +10:00
Andrew Bartlett
edba46ce94 s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS
It's nicer to have an NTSTATUS return, and in s3compat there may be a
reason other than 'no memory' why this can fail.

Andrew Bartlett
2010-06-07 23:34:29 +10:00
Simo Sorce
0a7ff14617 s3:passdb Export function to calculate the proper primary group sid
Don't keep it buried in passdb, this function need to be available
for use in places where we do not want to construct an artificial
samu struct just to play tricks.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:08 +10:00
Simo Sorce
aa1a3cbad2 s3:auth create nt token from info3 directly
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:07 +10:00
Simo Sorce
e6456df148 s3:auth handle unix domain sids in samu
When we generate a user out of thin air we may end up adding sids
that are not part of the sam domain (unix domain sids).
Handle the case and preserve these sids as extra sids.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:07 +10:00
Günther Deschner
4591fdbc18 s3-privileges: use LUID defines from lsa IDL.
Guenther
2010-06-07 10:33:36 +02:00
Jeremy Allison
e0acee4919 Change smbd_aio_complete_mid() -> smbd_aio_complete_aio_ex(). Simplifies
the code and eliminates find_aio_ex().

Jeremy.
2010-06-04 11:30:46 -07:00
Andreas Schneider
15f64af8e3 s3-rpc: Create a file with all functions for a internal named pipe.
This makes it possible to use the samr rpc server in winbind without
linking in smbd.

Reviewed-by: Simo Sorce <idra@samba.org>
2010-06-04 12:12:50 -04:00
Günther Deschner
84a8f0451d s3-build: only include generated spoolss headers (not ndr headers).
Guenther
2010-06-03 11:00:27 +02:00
Günther Deschner
bcd4077be6 s3: remove unused librpc/ndr/sid.c.
Guenther
2010-06-03 01:07:17 +02:00
Matthieu Patou
57ab910b6f s3: Allow previous password to be stored and use it to check tickets
This patch is to fix bug 7099. It stores the current password in the
 previous password key when the password is changed. It also check the
 user ticket against previous password.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-06-02 14:32:23 +02:00
Michael Adam
f702578f76 s3: remove unused prototype for lp_idmap_domains(). 2010-06-01 15:31:48 +02:00
Andrew Bartlett
a6e07c22a3 s3:auth Rename wksta_name -> workstation_name in auth_usersupplied_info 2010-06-01 17:11:25 +10:00
Andrew Bartlett
dfb206f47e s3:param Put 'server_role' functions in another file.
Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-06-01 17:11:24 +10:00
Andrew Bartlett
6d2e796f35 s3:param Add helper function to get at Gobals.iDomainMaster
This is needed for a future split out of the server_role code.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-06-01 17:11:24 +10:00
Simo Sorce
471ed70c49 s3:smbd map_username() doesn't need sconn anymore
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-05-31 18:21:29 +02:00
Simo Sorce
94bf9ce48a s3:smbd user_in_list() doesn't need sconn anymore
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-05-31 18:21:29 +02:00
Simo Sorce
7747dd82f7 s3:smbd user_in_network() doesn't need sconn anymore
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-05-31 18:21:29 +02:00
Andrew Bartlett
62708fbd1b s3:ntlmssp Move ntlmssp_sign.c from source3 to common code.
This needs a small re-arrangement of the supporting code.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:11:36 +02:00
Andrew Bartlett
d6fa371b92 s3:ntlmssp Use a TALLOC_CTX for ntlmssp_sign_packet() and ntlmssp_seal_packet()
This ensures the results can't be easily left to leak.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:11:27 +02:00
Andrew Bartlett
723ea68d3b s3:auth Remove AUTH_NTLMSSP_STATE typedef.
typedefs are no longer preferred Samba style.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:44 +02:00
Andrew Bartlett
3b706865f6 s3:auth Make AUTH_NTLMSSP_STATE a private structure.
This makes it a little easier for it to writen in terms of GENSEC in future.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:33 +02:00
Volker Lendecke
2e4c41431e s3: Don't announce readraw and writeraw with the async echo responder 2010-05-31 12:04:28 +02:00
Günther Deschner
fbb7814f91 s3: only use netlogon/nbt header when needed.
Guenther
2010-05-31 11:32:37 +02:00
Michael Adam
7426cf4306 s3: remove prototype of non-existsing function idmap_tdb_tdb_close(). 2010-05-31 10:30:15 +02:00
Andrew Bartlett
d266f8fdf1 s3:lib s3:lib move get_global_sam_name to util_names.c
This doesn't really belong in util_sid.c, and has much more in common
with the other functions in util_names.c

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-05-28 18:08:28 +02:00
Andrew Bartlett
539ef13bfe s3:lib split out global workgroup and netbios name functions.
Having these in their own file allows easier selective inclusion.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-05-28 18:08:27 +02:00
Andreas Schneider
93ac516e15 s3-auth: Added a function to get the server_info from the system user.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 14:31:39 +02:00
Günther Deschner
38d69ca547 s3-build: remove duplicate ndr_krb5pac.h inclusion.
Guenther
2010-05-28 02:49:37 +02:00
Günther Deschner
30eeb1e3d9 s3-rpc_client: move protos to init_netlogon.h
Guenther
2010-05-28 02:49:36 +02:00
Simo Sorce
2a6a696e32 s3:auth add function to convert wbcAuthUserInfo to netr_SamInfo3
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 01:20:09 +02:00
Simo Sorce
6713f3d945 s3:auth add function to copy a netr_SamInfo3 structure
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:27 +02:00
Simo Sorce
605cfef56c s3:auth: add function to convert samu to netr_SamInfo3
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:17 +02:00
Stefan Metzmacher
9a6636a56e s3:rpc_server: pass down local and remote tsocket_address to np_open()
metze
2010-05-27 07:13:56 +02:00
Stefan Metzmacher
9a77cb247d s3:rpc_server: add np_read_in_progress() function
metze
2010-05-27 07:13:53 +02:00
Günther Deschner
2807ab358e s3-samr: move chgpasswd.c out of smbd and into the samr server.
Guenther
2010-05-26 22:17:02 +02:00
Günther Deschner
14b03d132b s3-smbd: remove unused change/check_lanman_password.
Guenther
2010-05-26 22:16:43 +02:00
Simo Sorce
8aa96566a9 s3-rpc_server: Created a per connection spoolss pipe.
This way all code can reuse the same connection to spoolss
and not have to deal with the creation of a new pipe all over the
code every time we need to ask a service off spoolss.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-26 15:07:57 +02:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Andrew Bartlett
a92b653af9 s3:passdb Remove use of uint8 uint16 and uint32 in favour of C99 types
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:24:55 +02:00
Jeremy Allison
a8a4fe0605 Fix bug #7410 - samba sends "raw" inode number as uniqueid with unix extensions.
Move to a consistent get_FileIndex() function for all inode returns,
that checks if st_dev on the file is identical to the top directory
dev_t of the exported share, and if so uses the raw 64-bit inode
number. If it isn't (we've traversed a mount point) - return what
we used to do for Windows which is the concatination of the bottom
32-bits of the inode with the 32-bit device number. We can get more
creative with this over time (hashing?) if we want as now all inode returns go
through this single function.

Jeremy.
2010-05-20 11:36:47 -07:00
Günther Deschner
e4bdb7e00e s3-libads: add ads_set_sasl_wrap_flags().
Guenther
2010-05-20 18:45:59 +02:00
Günther Deschner
764cde5190 s3-build: add missing prototype for regtype_by_string().
Guenther
2010-05-20 13:54:08 +02:00
Jeremy Allison
572e5dec1b Implement missing info level SMB_FILE_LINK_INFORMATION.
Fix bug #7435 - SMB2 hardlink fails (invalid level).
Found at the Microsoft plugsharing plugfest.

Jeremy.
2010-05-18 18:34:54 -07:00
Günther Deschner
f6f3bb1813 s3-passdb: move get_logon_hours_from_pdb() into samr server.
Guenther
2010-05-18 21:43:05 +02:00
Günther Deschner
8478770c35 s3-rpc_client: move protos to init_samr.h
Guenther
2010-05-18 21:42:57 +02:00
Günther Deschner
5a6f3a0666 s3-rpc_client: move protos to init_spoolss.h
Guenther
2010-05-18 21:42:48 +02:00
Günther Deschner
cc06133b0a s3-rpc_client: move protos to cli_spoolss.h
Guenther
2010-05-18 21:42:45 +02:00
Günther Deschner
230b880d14 s3-rpc_client: move protos to cli_lsarpc.h
Guenther
2010-05-18 21:42:41 +02:00
Günther Deschner
5ed3654112 s3-rpc_client: move protos to cli_netlogon.h
Guenther
2010-05-18 21:42:37 +02:00
Günther Deschner
3f2719c202 s3-rpc_client: move protos to cli_samr.h
Guenther
2010-05-18 21:42:32 +02:00
Andrew Bartlett
7a8e34fe86 s3:split secrets.c to put machine account secrets in a new file
This helps the s3compat effort by allowing these functions to be
replaced by functions that query the cli_credentials and secrets.ldb
APIs.

Also, this changes a couple of DOM_SID to struct dom_sid along the
way.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 21:39:42 +02:00
Simo Sorce
d6a73ad85b s3-spoolss: Removed the Phantom DeviceMode.
This was a hack that required a special client from HP.
The client code has never been released and was discontinued,
so this code was just dead weight.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 15:52:28 +02:00
Andreas Schneider
7d363b8922 s3-spoolss: Create a spoolss_map_to_os2_driver function.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 15:17:23 +02:00
Günther Deschner
7f6bb48bdf s3-secdesc: remove "typedef struct security_descriptor SEC_DESC".
Guenther
2010-05-18 12:30:12 +02:00
Günther Deschner
8951c8301a s3-secdesc: remove "typedef struct security_acl SEC_ACL".
Guenther
2010-05-18 12:30:12 +02:00
Günther Deschner
a8b01d1f3b s3-secdesc: remove "typedef struct security_ace SEC_ACE".
Guenther
2010-05-18 12:30:11 +02:00
Günther Deschner
8bc9c343c4 s3-secdesc: remove "typedef struct sec_desc_buf SEC_DESC_BUF".
Guenther
2010-05-18 12:30:11 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Jeremy Allison
285b628327 Plumb in krb5 to the SMB2 sessionsetup code. First cut of this code.
Jeremy.
2010-05-17 18:22:19 -07:00
Günther Deschner
fe31b67d5e s3-registry: only include registry headers when really needed.
Guenther
2010-05-18 01:15:38 +02:00
Günther Deschner
26c844902c s3-samr: move samr helper prototypes outside of proto.h
Guenther
2010-05-18 00:44:27 +02:00
Günther Deschner
3d5972c43f s3-libgpo: move group policy protos to where they belong.
Guenther
2010-05-17 21:07:17 +02:00
Günther Deschner
e3bdff3d67 s3-kerberos: pass down kdc_name to create_local_private_krb5_conf_for_domain().
Guenther
2010-05-17 12:47:50 +02:00
Simo Sorce
348b4b9bab Make pcap headers private
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-14 14:15:08 +02:00
Simo Sorce
f36396f90f Move standard printcap parsing to print_standard.c
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-14 14:14:55 +02:00
Andrew Bartlett
454b0b3f20 s3:kerberos Return PAC_LOGON_INFO rather than the full PAC_DATA
All the callers just want the PAC_LOGON_INFO, so search for that in
ads_verify_ticket(), and don't bother the callers with the rest of the
PAC.

This change makes sense on it's own (removing boilerplate wrappers
that just confuse the code), but it also makes it much easier to
implement a matching ads_verify_ticket() function in Samba4 for the
s3compat proposal.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-11 22:52:37 +02:00
Günther Deschner
8a2a8217f8 s3-proto: add missing protoype for dcerpc_fault_to_nt_status().
Guenther
2010-05-09 23:47:56 +02:00
Simo Sorce
3c1e9a8c33 s3-spoolss: Make spoolss_Time_to_time_t public.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-09 23:33:40 +02:00
Günther Deschner
b83ab96b16 s3-passdb: moving account_pol.c into passdb.
Guenther
2010-05-08 01:45:27 +02:00
Jeremy Allison
adf4833792 This patch looks bigger than it is. It does 2 things. 1). Renames smbpid -> smblctx in our locking code. 2). Widens smblctx to 64-bits internally. Preparing to use the SMB2 handle as the locking context.
Jeremy.
2010-05-07 06:20:50 -07:00
Jeremy Allison
4ad1943d29 Make us pass all SMB2 lock tests except MULTIPLE-UNLOCK and CONTEXT. Them next :-).
Jeremy.
2010-05-07 01:20:26 -07:00
Günther Deschner
049416c285 s3-spoolss: make several notify functions static.
Guenther
2010-05-06 13:41:51 +02:00
Günther Deschner
d2d7174394 s3-eventlog: move all eventlog headers to lib/eventlog and only include where required.
Guenther
2010-05-06 13:41:51 +02:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Andreas Schneider
66f7699511 s3-spoolss: Added a generic spoolss_create_default_secdesc function.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-05 18:16:23 +02:00
Andreas Schneider
b2ea8fbcce s3-spoolss: Added a function to create a default spoolss_DeviceMode.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-05 18:08:56 +02:00
Andreas Schneider
6683b0d4b6 s3-lib: Create a sec_desc_merge and sec_desc_merge_buf function.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-04 19:37:39 +02:00
Jeremy Allison
f4092ecec7 Plumb the SMB2 front end into the blocking lock backend.
Metze, you'll probably be happier with this work as it
doesn't abuse tevent in the way you dislike. This is a
first cut at the code, which will need lots of testing
but I'm hoping this will give people an idea of where I'm
going with this.

Jeremy.
2010-04-30 21:03:20 -07:00
Jeremy Allison
e90444319c Carefully label SMB1-specific locking calls.
Jeremy.
2010-04-29 17:08:12 -07:00
Jeremy Allison
ac09506d36 Connect set security descriptor into SMB2 code.
Jeremy.
2010-04-28 14:13:22 -07:00
Günther Deschner
1691eb73da s3-spoolss: add support for SetJobInfo level 1 (for jobfile rename).
Guenther
2010-04-28 00:10:40 +02:00
Günther Deschner
2b7002f385 s3-lanman: remove unsupported print_job_set_place().
Guenther
2010-04-28 00:10:40 +02:00
Günther Deschner
6864828d9d s3: use shared registry functions.
Guenther
2010-04-27 16:42:15 +02:00
Jeremy Allison
a94a4b788c Plumb in get_nt_acl into SMB2.
Jeremy.
2010-04-26 20:11:59 -07:00
Günther Deschner
7259762909 s3: use generated rap header.
Guenther
2010-04-26 22:52:59 +02:00
Jeremy Allison
2bbb8c917e Allow smb2 create requests to be cancelled.
Jeremy.
2010-04-23 13:10:15 -07:00
Simo Sorce
8f56cdfaee s3-spoolss: Move info_ctr conversion to a public helper.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-23 16:23:49 +02:00
Andreas Schneider
d65485b3c5 s3-spoolss: Use const values for notify functions.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-23 16:06:51 +02:00
Andreas Schneider
3f1cc29814 s3-time: Added a function to get the startup time of the server.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-23 16:06:42 +02:00
Jeremy Allison
8f67f873ac Make deferred opens (NT_STATUS_SHARING_VIOLATION) work over SMB2.
Makes SMB2Create call re-entrant internally.
Now this infrastructure is in place, oplocks will follow shortly.
Tested with Win7 client and with W2K8R2.

Jeremy.
2010-04-22 23:52:19 -07:00
Volker Lendecke
5fc2801c09 s3: Cache the username map in gencache
This is for uses with a heavy-weight username map script
2010-04-13 09:30:06 +02:00
Jeremy Allison
7984243768 Move to using 64-bit mid values in our internal open file database.
This will allow us to share logic much easier between SMB1 and SMB2
servers.

Jeremy
2010-04-12 21:40:28 -07:00
Volker Lendecke
b1a27e81d7 s3: Apply some const 2010-04-12 21:42:54 +02:00
Volker Lendecke
b8829e74fd s3: Move [make|free]_user_info to auth/user_info.c 2010-04-11 22:59:47 +02:00
Volker Lendecke
2b1a50c2e5 s3: Move sanitize_username to lib/util_str.c 2010-04-11 22:59:47 +02:00
Volker Lendecke
80708b75f8 s3: Move make_server_info to auth/server_info.c 2010-04-11 22:59:46 +02:00
Volker Lendecke
04f9e33de1 s3: Make check_sam_security public 2010-04-11 22:59:46 +02:00
Jeremy Allison
e15939b456 Plumb SMB2 stubs into all the places we defer SMB1 operations.
Rename functions to be internally consistent. Next step is
to cope queueing single (non-compounded) SMB2 requests to
put some code inside the stubs.

Jeremy.
2010-04-09 19:26:34 -07:00
Günther Deschner
63b111bd32 s3: add iconv_convenience handle to pull/push sz helpers.
Guenther
2010-04-09 18:33:45 +02:00
Jeremy Allison
3587815595 Fix bug #7339 - MSDFS is non-functional in 3.5.x
In the refactoring around filename_convert, the split between the functions
resolve_dfspath() and resolve_dfspath_wcard() was lost, leaving us only with
resolve_dfspath_wcard().

Internally resolve_dfspath_wcard() calls dfs_redirect() only with a
"allow_wcards" flag of true, wheras the old resolve_dfspath() would call with a
value of false. The loss of this case causes dfs_redirect to always masquerade
DFS links as directories, even when they are being queried directly by a trans2
QPATHINFO call. We should only masquerade DFS links as directories when called
from a SMBsearch or trans2 findfirst/findnext - which was the intent of the
"allow_wcards" flag.

This patch adds back an allow_wcards bool parameter to
resolve_dfspath_wcard(). This bool is set from the state of the ucf_flags when
filename_convert() is called.

I will follow this up with a new smbclient-based torture test that will prevent
us from ever regressing our DFS support again.

Jeremy.
2010-04-08 20:32:36 -07:00
Jeremy Allison
9c410118cb Parameterize "smb2 max read", "smb2 max write", "smb2 max trans".
Set to 64k by default.

Jeremy.
2010-04-06 15:43:35 -07:00
Jeremy Allison
c75184b8a1 Fix issue with aio where r/w lock wasn't kept across aio read operations.
Change schedule_aio_read_and_X/schedule_aio_write_and_X to
return NTSTATUS. Move the grant and release of the lock into
the aio code.

Jeremy
2010-04-05 14:16:21 -07:00
Jeremy Allison
bf90969892 Move initialize_async_io_handler() inside of smbd/aio.c.
Call from actual aio read or write. No reason to call this globally on startup.

Jeremy.
2010-04-01 16:47:59 -07:00
Jeremy Allison
32c8feab5d Fix for bug #7233 - print fails with jobs >4GB from Win7 clients.
Contains for by Sebastian Kloska <oncaphillis@snafu.de>. Submitter
confirms this fixes the problem.

Jeremy.
2010-03-30 15:27:26 -07:00
Stefan Metzmacher
cac9981b1a s3:rpc_client: remove more unused code
metze
2010-03-29 18:11:20 +02:00
Stefan Metzmacher
4f41b53487 s3:rpc_client: add rpccli_is_connected()
metze
2010-03-29 18:11:16 +02:00
Stefan Metzmacher
d7bf30ef92 s3:libsmb: add cli_state_is_connected() function
metze
2010-03-29 18:11:15 +02:00
Volker Lendecke
cae4105c92 s3: Remove unused bitmap_[allocate|free] 2010-03-28 15:25:17 +02:00
Jeremy Allison
fac8ca52ad Fix bug #7240 - Net usershare is not case sensitive.
Updates usershare files in a backwards compatible way.
I don't intend to back port this fix to 3.5.x as it
depends on a version upgrade in the share_info.tdb share security database.

Jeremy.
2010-03-26 17:09:58 -07:00
Günther Deschner
3da91b786e s3-printing: avoid mixing cups backend code with nt_printing code in cups_pull_comment_location.
Guenther
2010-03-26 14:36:46 +01:00
Jeremy Allison
c79ca41baf Fix bug #7288 - SMB job IDs in CUPS job names wrong.
Based on a patch from Michael Karcher <samba@mkarcher.dialup.fu-berlin.de>.

I think this is the correct fix. It causes cups_job_submit to use
print_parse_jobid(), which I've moved into printing/lpq_parse.c (to allow the
link to work).

It turns out the old print_parse_jobid() was *broken*, in that the pjob
filename was set as an absolute path - not relative to the sharename (due to it
not going through the VFS calls).

This meant that the original code doing a strncmp on the first part of the
filename would always fail - it starts with a "/", not the relative pathname of
PRINT_SPOOL_PREFIX ("smbprn.").

This fix could fix some other mysterious printing bugs - probably the ones
Guenther noticed where job control fails on non-cups backends.

Guenther PLEASE CHECK !

Jeremy.
2010-03-25 17:36:47 -07:00
Volker Lendecke
ed189459b9 s3: Make sure our CLEAR_IF_FIRST optimization works for the notify tdbs
The notify tdb files are opened at tconX time, which leads to one fcntl lock
for CLEAR_IF_FIRST detection per smbd. This opens the tdbs in the parent and
holds it, so that tdb_reopen_all correctly catches the CLEAR_IF_FIRST bit.
2010-03-25 16:40:44 +01:00
Stefan Metzmacher
3b33fa72d6 s3:ntlmssp: use c99 types
metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:57 +01:00
Stefan Metzmacher
2dfc78a41a s3:ntlmssp: remove unused ntlmssp_set_workstation()
metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:56 +01:00
Stefan Metzmacher
8804dc1328 s3:ntlmssp: add const for *sig in ntlmssp_unseal_packet()
metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:56 +01:00
Stefan Metzmacher
9172b4a0b1 s3:ntlmssp: make whole_pdu const for ntlmssp_[un]seal_packet()
Only data needs to be non-const.

metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:56 +01:00
Stefan Metzmacher
7d977da925 s3:ntlmssp: pass names and use_ntlmv2 to ntlmssp_client_start() and store them
Inspired by the NTLMSSP merge work by Andrew Bartlett.

metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:55 +01:00
Stefan Metzmacher
eb17809812 s3:ntlmssp: pass names to ntlmssp_server_start() and store them in ntlmssp_state
Inspired by the NTLMSSP merge work by Andrew Bartlett.

metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:54 +01:00
Stefan Metzmacher
533830543f s3:ntlmssp: make use of C99 types in ntlmssp_sign.c
metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:54 +01:00
Stefan Metzmacher
845f9c01ed s3:librpc/rpc: move prototypes to dcerpc.h
metze
2010-03-23 18:44:31 +01:00
Jeremy Allison
7509b56b5f share_info.tdb could use non-canonicalized sharenames.
Fix this by moving canonicalization into lib/sharesec.c. Update the
db version to 3. Ensures we always find share names with security
descriptors attached.

Jeremy.
2010-03-22 15:57:31 -07:00
Volker Lendecke
70f9338bf2 s3: Add the "ctdb locktime warn threshold" parameter
This is mainly a debugging aid for post-mortem analysis in case a cluster file
system is slow.
2010-03-22 17:32:18 +01:00
Stefan Metzmacher
752240ccdc s3:param: add "async smb echo handler" option
This will enable an extra forked process that will reply
to SMBecho requests, while the main process is blocked by another
request.

metze
2010-03-22 17:15:12 +01:00
Stefan Metzmacher
0b7da43da0 s3:smbd: add an option to skip signings checks srv_check_sign_mac for trusted channels
metze
2010-03-22 17:15:10 +01:00
Volker Lendecke
b2f45f20b0 s3: Add "log writeable files on exit" parameter
This boolean option controls whether at exit time the server dumps a list of
files with debug level 0 that were still open for write. This is an
administrative aid to find the files that were potentially corrupt if the
network connection died.
2010-03-22 12:03:44 +01:00
Volker Lendecke
8195832c6c s3: file_walk_table -> files_forall
This is more in line with the rest of the Samba code, like connections_forall
etc.
2010-03-22 09:30:51 +01:00
Stefan Metzmacher
b82f168c3c s3:librpc: remove unused stuff
metze
2010-03-19 17:05:46 +01:00
Volker Lendecke
2b4ce9a73f s3: Make login_cache_write take a pointer 2010-03-16 22:35:41 +01:00
Volker Lendecke
276b1aa189 s3: Make login_cache_read take a pointer, avoid a malloc 2010-03-16 22:35:41 +01:00
Volker Lendecke
13a278c1b9 s3: Remove a typedef 2010-03-16 22:35:41 +01:00
Jeremy Allison
6b2358e15e Pass "connection_struct *conn" into functions that currently use "current_user.XXX"
Will allow me to replace them with accessor functions.

Jeremy.
2010-03-15 14:49:11 -07:00
Jeremy Allison
5d6610a215 Add accessor functions for current uid, gid, unix token, NT token and vuid.
Jeremy.
2010-03-15 14:49:06 -07:00
Jeremy Allison
4b85a0ea7f Rever e80ceb1d73 "Remove more uses of "extern struct current_user current_user;"."
As requested by Volker, split this into smaller commits.

Jeremy.
2010-03-15 14:48:54 -07:00
Jeremy Allison
a2be29dfa3 Missed a couple more uses of conn->server_info->ptok that need to be get_current_nttok(conn)
Centralize the root check into smb1_file_se_access_check()
so this is used by modules/vfs_acl_common.c also.

Jeremy.
2010-03-12 14:31:47 -08:00
Jeremy Allison
e80ceb1d73 Remove more uses of "extern struct current_user current_user;".
Use accessor functions to get to this value. Tidies up much of
the user context code. Volker, please look at the changes in smbd/uid.c
to familiarize yourself with these changes as I think they make the
logic in there cleaner.

Cause smbd/posix_acls.c code to look at current user context, not
stored context on the conn struct - allows correct use of these
function calls under a become_root()/unbecome_root() pair.

Jeremy.
2010-03-12 13:56:51 -08:00
Andrew Bartlett
4ab3e220c4 Move prototype to header of common code for set_sockaddr_port 2010-03-11 11:27:47 +11:00
Volker Lendecke
89c785c47a s3: Fix a long-standing problem with recycled PIDs
When a samba server process dies hard, it has no chance to clean up its entries
in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb.

For locking.tdb and brlock.tdb Samba is robust by checking every time we read
an entry from the database if the corresponding process still exists. If it
does not exist anymore, the entry is deleted. This is not 100% failsafe though:
On systems with a limited PID space there is a non-zero chance that between the
smbd's death and the fresh access, the PID is recycled by another long-running
process. This renders all files that had been locked by the killed smbd
potentially unusable until the new process also dies.

This patch is supposed to fix the problem the following way: Every process ID
in every database is augmented by a random 64-bit number that is stored in a
serverid.tdb. Whenever we need to check if a process still exists we know its
PID and the 64-bit number. We look up the PID in serverid.tdb and compare the
64-bit number. If it's the same, the process still is a valid smbd holding the
lock. If it is different, a new smbd has taken over.

I believe this is safe against an smbd that has died hard and the PID has been
taken over by a non-samba process. This process would not have registered
itself with a fresh 64-bit number in serverid.tdb, so the old one still exists
in serverid.tdb. We protect against this case by the parent smbd taking care of
deregistering PIDs from serverid.tdb and the fact that serverid.tdb is
CLEAR_IF_FIRST.

CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not
work when all smbds are restarted. For this, "net serverid wipe" has to be run
before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up
sessionid.tdb and connections.tdb.

While there, this also cleans up overloading connections.tdb with all the
process entries just for messaging_send_all().

Volker
2010-03-10 16:07:10 +01:00
Jeremy Allison
c61c9c3a4c Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.
Ensure we don't use any of the create_options for Samba private
use. Add a new parameter to the VFS_CREATE call (private_flags)
which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS
and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code).
Rev. the VFS interface to version 28.

Jeremy.
2010-03-05 15:13:37 -08:00
Günther Deschner
7643afa70e s3-rpcclient: fix rpcclient after spoolss_GetPrinterData{Ex} IDL change.
Guenther
2010-03-05 15:18:00 +01:00
Volker Lendecke
d6a6872506 s3: Abstract access to sessionid.tdb, similar to conn_tdb.c 2010-03-01 17:53:22 +01:00
Volker Lendecke
8bebb380e8 s3: Add connections_forall_read()
In a cluster, this makes a large difference: For r/w traverse, we have to do a
fetch_locked on every record which for most users of connections_forall is just
overkill.
2010-03-01 14:51:34 +01:00
Volker Lendecke
5c40aa59d7 s3: Remove unused count_all_current_connections() 2010-02-28 20:45:21 +01:00
Volker Lendecke
d980268680 s3: Make connections_fetch_record() static 2010-02-24 16:11:03 +01:00
Simo Sorce
3b12c38ac0 s3:schannel streamline interface
Make calling schannel much easier by removing the need to explicitly open the
database. Let the abstraction do it instead.
2010-02-23 12:46:50 -05:00
Simo Sorce
61b7a24f16 s3 move the sitename cache in its own file 2010-02-23 12:46:26 -05:00
Volker Lendecke
752bffc53f s3: Consolidate server_id_self into the equivalent procid_self() 2010-02-23 15:30:00 +01:00
Volker Lendecke
8930a9c520 s3: Convert cli_qpathinfo_basic to use cli_trans() 2010-02-20 18:59:30 +01:00
Volker Lendecke
89e6a5263e s3: Add cli_smb()
This is a sync wrapper around cli_smb_send/cli_smb_recv. This is a hack to
speed up converting libsmb/ away from cli_send_smb/cli_receive_smb. Some
routines in libsmb/ are only called in one place in smbtorture for example,
where making it async right now is not worth it. With cli_smb_send/cli_smb_recv
in place, pushing the asynchronosity out one level is "just" boilerplate code
that is easy to do should it become necessary.
2010-02-20 18:59:29 +01:00
Jeremy Allison
a6f402ad87 Remove lp_safe_widelinks() -> convert to just lp_widelinks. Suggestion from Volker.
Create widelinks_warning(int snum) to cover the message needed in make_connection.

Jeremy.
2010-02-11 15:16:23 -08:00
Simo Sorce
5d92d969dd Introduce lp_safe_widelinks()
This way we avoid any chance that a configuration reload may turn
back on wide links when unix extensions are enabled.
2010-02-11 16:27:17 -05:00
Stefan Metzmacher
0140bc389d s3:nmbd: change "nmbd:bind explicit broadcast" into "nmbd bind explicit broadcast"
metze
2010-02-08 18:35:11 +01:00
Volker Lendecke
6e510b49c0 s3: Make cli_get_fs_volume_info() use cli_trans() 2010-02-07 12:29:25 +01:00
Volker Lendecke
c73ffb7280 s3: Remove some unused code 2010-02-07 12:29:25 +01:00
Volker Lendecke
dcc850e3b3 s3: Make guest_user_info() static 2010-02-05 21:11:17 +01:00
Matt Kraai
a47b6ebb30 Change uint_t to unsigned int in source3
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:18 +01:00
Jeremy Allison
687e4eba3c Fix bug #7079 - cliconnect gets realm wrong with trusted domains.
Passing NULL as dest_realm for cli_session_setup_spnego() was
always using our own realm (as for a NetBIOS name). Change this
to look for the mapped realm using krb5_get_host_realm() if
the destination machine name is a DNS name (contains a '.').
Could get fancier with DNS name detection (length, etc.) but
this will do for now.

Jeremy.
2010-01-30 19:24:28 -08:00
Volker Lendecke
21ec6a6cbd s3: Add -C (--use-ccache) to popt_common_credentials 2010-01-24 20:32:17 +01:00
Volker Lendecke
dbf9017a80 s3: Remove string_sid_talloc
All but one call were pointless, so I think this API should go
2010-01-23 14:35:37 +01:00
Volker Lendecke
33e397f9fd s3: Make "init_smb_request" static to process.c 2010-01-21 14:08:27 +01:00
Volker Lendecke
24d4433bd7 s3: Move "yesno" to the only place where it is used: client.c 2010-01-21 12:58:11 +01:00
Volker Lendecke
50b7a3233f s3: Remove unused samr_make_sam_obj_sd 2010-01-10 20:56:16 +01:00
Volker Lendecke
081573091b s3: Remove the typedef for "auth_serversupplied_info" 2010-01-10 20:56:16 +01:00
Volker Lendecke
9bb4766bba s3: Remove the typedef for "auth_usersupplied_info" 2010-01-10 20:56:16 +01:00
Volker Lendecke
53a1ed9b6c s3: Factor password_in_history() out of check_passwd_history() 2010-01-07 11:07:55 +01:00
Björn Jacke
c5f24c3eac s3:lib/time: remoce null_mtime() - use null_time() 2010-01-07 00:49:57 +01:00
Björn Jacke
c1c7b6cecb s3:lib/time: remove unused nt_time_equals
we have nt_time_equal doing the same in lib/util/
2010-01-07 00:49:49 +01:00
Bo Yang
36493bf2f6 s3: Fix infinite loop in NCACN_IP_TCP asa there is no timeout. Assume lsa_pipe_tcp is ok but network is down, then send request is ok, but select() on writeable fds loops forever since there is no response.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-01-06 19:19:35 +08:00
Volker Lendecke
37ac16a88f s3: Convert cli_ulogoff to the async API 2010-01-03 21:14:57 +01:00
Volker Lendecke
99f292479f s3: Convert cli_tdis to the async API 2010-01-03 21:14:57 +01:00
Stefan Metzmacher
05f7a86a99 s3:ntlmssp: remove unused ntlmssp_stored_response()
metze
2009-12-29 08:46:12 +01:00
Volker Lendecke
96207912cb s3: Remove unused delete_negative_conn_cache() 2009-12-24 15:24:35 +01:00
Volker Lendecke
ffab1a2318 s3: Remove unused flush_negative_conn_cache() 2009-12-24 15:24:35 +01:00
Jeremy Allison
3d85b1ebe5 The posix acl version of set_nt_acl() could set the stat_ex
struct in the fsp->fsp_name pointer incorrectly for a directory.

Fix this. Make map_canon_ace_perms() public.

Jeremy.
2009-12-23 17:17:48 -08:00
Andrew Bartlett
5b37cd23bf s3:ntlmssp: remove the typedef NTLMSSP_STATE
Andrew Bartlett
2009-12-22 21:07:53 +01:00
Jeremy Allison
74deee3cc9 Rename reply_doserror() -> reply_force_doserror().
Rewrite all calls to reply_nterror(NT_STATUS_DOS()) to
reply_force_doserror() and update the comment in smbd/error.c

Jeremy.
2009-12-21 11:16:38 -08:00
Jeremy Allison
69d26d25f7 reply_force_nterror() is not used anywhere. Remove it.
Jeremy.
2009-12-18 14:25:07 -08:00
Björn Jacke
f3205d31d6 s3: add prototype to fix the build 2009-12-10 23:21:01 +01:00
Günther Deschner
35c50dcce3 s3-spoolss: use driver level info8 everywhere in spoolss server internally.
Guenther
2009-12-08 11:05:21 +01:00
Jeremy Allison
91e0bdd86c Refactor reply_rmdir to use handle based code. All
calls are now handle based. Put rmdir into close.c
and make it private.
Jeremy.
2009-12-03 13:01:10 -08:00
Jeremy Allison
dfcc4115dd Remove unneeded argument from can_set_delete_on_close(). Ensure
can_set_delete_on_close() is correctly called before any setting
of the disposition bit (clean up the do_unlink() call).
Jeremy.
2009-12-02 18:06:40 -08:00
Jeremy Allison
365c6b4ce0 Restructure the ACL code some more, get the internal semantics
right. The previous bugs were due to the fact that get_nt_acl_internal()
could return an NTSTATUS error if there was no stored ACL blob, but
otherwise would return the underlying ACL from the filysystem. Fix
this so it always returns a valid acl if it can, and if it does not
its an error to be reported back to the client. This then changes
the inherit acl code. Previously we were trying to match Windows
by setting a minimal ACL on a new file that didn't inherit anything
from a parent directory. This is silly - the returned ACL wouldn't
match the underlying UNIX permissions. The current code will correctly
inherit from a parent if a parent has any inheritable ACE entries
that apply to the new object, but will return a mapping from the
underlying UNIX permissions if the parent has no inheritable entries.
This makes much more sense for new files/directories.
Jeremy.
2009-12-02 15:02:28 -08:00
Björn Jacke
95c1862610 s3: prefer posix_fallocate for doing "strict allocate"
posix_fallocate is more efficient than manual zero'ing the file. When
preallocation in kernel space is supported it's extremely fast. Support for
preallocation at fs layer via posix_fallocate and fallocate at kernel site
can be found in Linux kernel 2.6.23/glibc 2.10 with ext4, XFS and OCFS2. Other
systems that I know of which support fast preallocation in kernel space are
AIX 6.1 with JFS2 and recent Solaris versions with ZFS maybe UFS2, too.

People who have a system with preallocation in kernel space might want to set
"strict allocate = yes". This reduces file fragentation and it's also safer for
setups with quota being turned on.

As of today most systems still don't have preallocation in kernel space, and
that's why "strict allocate = no" will stay the default for now.
2009-12-02 21:21:43 +01:00
Volker Lendecke
69a68208bd s3: Restore "fake directory create times" as a share parameter 2009-11-29 11:22:05 +01:00
Volker Lendecke
36e8d8ed45 s3: Move directory_exist_stat to testparm.c, it only looks at the mode 2009-11-29 11:22:04 +01:00
Volker Lendecke
33601b8632 s3: Pass fake_dir_create_times down to file_exist_stat, none of the callers look at the mtime 2009-11-29 11:22:04 +01:00
Volker Lendecke
44ce5603dd s3: Pass the "fake dir create times" parameter to sys_*stat
Step 0 to restore it as a per-share paramter
2009-11-29 11:22:01 +01:00
Günther Deschner
3d679a3b5f s3-rpc: Avoid including every pipe's client and server stubs everywhere in samba.
Guenther
2009-11-26 20:03:17 +01:00
Günther Deschner
d4e06596d5 s3-registry: remove reg_pull_multi_sz().
Guenther
2009-11-24 15:47:59 +01:00
Jeremy Allison
4b8859840b Remove unused code.
Jeremy.
2009-11-23 18:00:36 -08:00
Michael Adam
63a801e5c9 s3:torture: move the torture-specific headers to new torture/torture.h
Michael
2009-11-23 23:51:07 +01:00
Volker Lendecke
a1a81ef785 Revert "s3: Make the implicit reference to Protocol in mask_match() explicit"
This reverts commit e23d8a3d1f.
2009-11-23 16:35:00 +01:00
Volker Lendecke
d6e55d8ec0 Revert "s3: Make the implicit reference to Protocol in mask_match_list() explicit"
This reverts commit 1e22899d26.
2009-11-23 16:35:00 +01:00
Volker Lendecke
5c4885a26b Revert "s3: Make the implicit reference to Protocol in is_in_path() explicit"
This reverts commit f7b4151a64.
2009-11-23 16:35:00 +01:00
Volker Lendecke
7930206f5c Revert "s3: Make the implicit reference to get_Protocol in lp_use_sendfile() explicit"
This reverts commit 6a14902297.
2009-11-23 16:34:59 +01:00
Volker Lendecke
0f8e2a6ebb Revert "s3: Move the global variable Protocol to struct smbd_server_connection"
This reverts commit c85a4c9ba4.
2009-11-23 16:34:59 +01:00
Günther Deschner
ec56895bde s3-printing: use spoolss types and structs while getting and deleting drivers.
Guenther
2009-11-23 12:19:11 +01:00
Günther Deschner
68cc1166d9 s3-printing: use spoolss types and structs while adding drivers.
Guenther
2009-11-23 12:19:04 +01:00
Volker Lendecke
384f303c2c s3: Remove a struct typedef 2009-11-21 23:19:50 +01:00
Volker Lendecke
cf2febf3d1 s3: Make alloc_sub_basic() static 2009-11-21 20:54:10 +01:00
Volker Lendecke
c85a4c9ba4 s3: Move the global variable Protocol to struct smbd_server_connection 2009-11-21 20:49:17 +01:00
Volker Lendecke
6a14902297 s3: Make the implicit reference to get_Protocol in lp_use_sendfile() explicit 2009-11-21 20:49:17 +01:00
Volker Lendecke
f7b4151a64 s3: Make the implicit reference to Protocol in is_in_path() explicit 2009-11-21 20:49:17 +01:00
Volker Lendecke
1e22899d26 s3: Make the implicit reference to Protocol in mask_match_list() explicit 2009-11-21 20:49:17 +01:00
Volker Lendecke
e23d8a3d1f s3: Make the implicit reference to Protocol in mask_match() explicit 2009-11-21 20:49:16 +01:00
Volker Lendecke
37e4e387db s3: Convert cli_get_fs_attr_info to the async API 2009-11-21 14:01:56 +01:00
Volker Lendecke
f0a933d140 s3: Cache brlock.tdb entries for the fast read&write strict locking code path
For a netbench run this gains around 2% user-space CPU, fetching a 100MB file
takes around 4% less.
2009-11-21 11:40:13 +01:00
Volker Lendecke
d3d37acb99 s3: Factor timeval_string out of current_timestring() 2009-11-19 19:04:38 +01:00