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

935 Commits

Author SHA1 Message Date
Jeremy Allison
aa0a7cf51a Add bool use_privs parameter to smbd_check_access_rights()
If this is set we should use it in preference to blindly assuming
root can do anything. Currently set to 'false' in (most) callers.
2012-09-14 22:54:29 +02:00
Andrew Bartlett
0f2d288f76 s3-smbd: ensure we give appropriate errors for EA requests on streams 2012-08-20 21:57:47 +10:00
Andrew Bartlett
6ce084f092 s3-smbd: Do not look for EA information on a stream
The estimated EA size needs to be of the main file.  However, the fsp
may point to the stream, so we need to ignore it if this is the case.

This may mean we estimate wrong if there has been a rename.

Andrew Bartlett
2012-08-20 21:57:46 +10:00
Andrew Bartlett
f9f8a8c3d8 s3-smbd: Push smb_fname into estimate_ea_size
This ensures that we return the ea size of the stream, not the overall file.

This is important as if there is an EA on the main file, the raw.streams
test was failing.

Andrew Bartlett
2012-08-20 21:57:46 +10:00
Stefan Metzmacher
9f1dfd8fac s3:smbd: don't disconnect the client when a share has "smb encrypt = required"
It's not the client fault, if he doesn't know that encryption is required.
We should just return ACCESS_DENIED and let the client work on other
shares and open files on the current SMB connection.

metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
e5d4e8df6b s3:smbd: lp_smb_encrypt() returns SMB_SIGNING_* values
metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
8b3da9a1f4 s3:smbd: make use of ENCRYPTION_REQUIRED()
metze
2012-08-17 14:51:57 +02:00
Andrew Bartlett
24b1143068 s3-sysacls: Remove sys_acl_free_qualifier() as it is a no-op
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Aug 15 05:23:18 CEST 2012 on sn-devel-104
2012-08-15 05:23:18 +02:00
Andrew Bartlett
6ccfd05e72 s3-sysacls: Remove sys_acl_free_acl() and replace with TALLOC_FREE() 2012-08-15 11:44:50 +10:00
Andrew Bartlett
8b3227eb45 s3-smbd: Call sys_acl_free_acl() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:47 +10:00
Andrew Bartlett
6a46fbb393 s3-smbd: Call sys_acl_free_qualifier() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:47 +10:00
Andrew Bartlett
e019b93f0e s3-smbd: Call sys_acl_get_entry() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:46 +10:00
Andrew Bartlett
6a2f142b49 s3-smbd: Call sys_acl_get_qualifier() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:45 +10:00
Andrew Bartlett
d83276c13f s3-smbd: Call sys_acl_get_tagtype() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:45 +10:00
Andrew Bartlett
3b409324d3 s3-smbd: Call sys_acl_get_permset() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:45 +10:00
Andrew Bartlett
7dff34f5d0 s3-smbd: Call sys_acl_get_perm() directly rather than via the VFS
This will allow us to remove the struct smb_acl_t manipuations from the VFS layer,
which will be reduced to handling the get/set functions.

Andrew Bartlett
2012-08-15 11:44:44 +10:00
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Jeremy Allison
818fd7e917 Remove unused code now we set the correct command codes. 2012-06-19 10:27:24 -07:00
Jeremy Allison
bbb7cbfb7c Same fix as bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does not send correct responses to NT Transact Secondary when no data and no params
for the Trans2 calls. See MS-CIFS 2.2.4.47.2 for details.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 16 07:59:19 CEST 2012 on sn-devel-104
2012-06-16 07:59:19 +02:00
Michael Adam
67108c8e7e s3:smbd: change trans2.c to use fsp_fnum_dbg() for fsp->fnum logging.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:15 +02:00
Michael Adam
5d2af68a25 s3:smbd: use FNUM_FIELD_INVALID instead of literal -1
This is in preparation of changing fnum to uint64_t

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:13 +02:00
Stefan Metzmacher
e91c223531 s3:smbd: use print_spool_rap_jobid() in call_trans2ioctl()
metze
2012-06-06 10:18:37 +02:00
Volker Lendecke
e2818d4a0b s3: Check for serverid_exists in smb_posix_unlink
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Stefan Metzmacher
a95b2ba043 s3:smbd/msdfs: pass allow_broken_path to resolve_dfspath_wcard()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu May 24 16:14:01 CEST 2012 on sn-devel-104
2012-05-24 16:14:01 +02:00
Volker Lendecke
f5ca3f11e4 s3: Revert the serverid changes, they need more work
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
2012-05-18 13:12:14 +02:00
Volker Lendecke
5017bbe70d s3: Check for serverid_exists in smb_posix_unlink
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
87542e1310 s3: Make SMB_QUERY_FILE_UNIX_BASIC's devno work for files
According to susv3, st_rdev is valid exactly for char and block devices. Normal
files have st_dev set.
2012-05-14 13:16:32 +02:00
Andrew Bartlett
221c0e479d s3-smbd: Use security_session_user_level() rather than nt_token_check_sid()
This allows the unix.whoami test to pass when configured as part of the AD DC.

The struct auth_session_info is slightly different in the AD DC configuration
when using auth_samba4.  In particular, there is a distinction between Guest
and Anonymous logins.

Andrew Bartlett
2012-05-02 01:00:12 +02:00
Jeremy Allison
124be4cf88 Ensure we have 12 bytes of data for a SMB_SET_CIFS_UNIX_INFO call. Add debug. 2012-04-18 12:38:52 -07: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
Andrew Bartlett
96108eed10 build: #ifdef LARGE_SMB_OFF_T as off_t is now always 64 bits 2012-04-05 02:39:08 +02:00
Jeremy Allison
c10ed730d4 Second part of bugfix for bug #8837 - smbd crashes when deleting directory and veto files are enabled.
Store the 'struct security_token' as well as the 'struct security_unix_token'
inside the locking db when setting a delete on close.
2012-04-04 14:58:42 -07: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
bca3fb3ecc Implement FLAG_TRANS2_FIND_BACKUP_INTENT for trans2 with privileges. 2012-02-29 17:04:46 -08:00
Jeremy Allison
e54cf15387 Make dptr_path() and dptr_wcard() const. 2012-02-24 17:12:52 -08:00
Volker Lendecke
e5c8484073 s3: get_share_mode_lock->get_existing_share_mode_lock 2012-02-19 17:44:26 +01:00
Jeremy Allison
21528da9cd Fix a bunch of "unused variable" warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104
2012-02-18 06:22:40 +01:00
Jeremy Allison
869fd8eeba Another fix for bug #8556 - ACL permissions ignored when SMBsetatr is requested.
Remove erroneous check on FILE_WRITE_ATTRIBUTES when changing POSIX
permissions - this isn't an attribute set call (unless you're storing
attributes in POSIX permissions, which is not recommended).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jan 24 00:44:24 CET 2012 on sn-devel-104
2012-01-24 00:44:22 +01:00
Volker Lendecke
cfebba96bd s3: Put an indirection layer into share_mode_lock
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12 23:59:22 +01:00
Volker Lendecke
9cf6d735d4 s3: Introduce get_share_mode_lock_fresh()
This slightly simplifies the code path for all callers which assume
that a share mode exists already. Only the callers in open_file_ntcreate
and open_directory will ever create new share modes.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12 23:59:22 +01:00
Jeremy Allison
7dcef878cd Restrict UCF_UNIX_NAME_LOOKUP (symlink allowed) to restricted set of calls. 2011-12-16 21:54:23 +01:00
Jeremy Allison
f448c0e6db Second part of fix for bug #8663 - deleting a symlink fails if the symlink target is outside of the share.
Ensure we use UCF_UNIX_NAME_LOOKUP flags on filename_convert()
when doing a UNIX infolevel in trans2setfilepathinfo().
2011-12-15 16:33:37 -08:00
Volker Lendecke
1c46fb5c3e s3: Use autogenerated open_files.idl 2011-12-02 22:43:05 +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
Jeremy Allison
865bc0c0ac Remove the check for FILE_WRITE_ATTRIBUTES from smb_set_file_time(). It
is called from places like fileio.c that need to update the write time
on a file handle only open for write, without neccessarily having
FILE_WRITE_ATTRIBUTES permission. Move all checks to before the
smb_set_file_time() callers.
2011-11-15 17:41:48 -08:00
Jeremy Allison
edaa7479ed Move handle-based access check into handle codepath. 2011-11-15 17:01:58 -08:00
Jeremy Allison
c6a62f60a2 We've already checked fsp must be non-null here. 2011-11-15 17:01:58 -08:00
Jeremy Allison
93000c98ad Remove unneeded access check. This is done inside smb_set_file_time(). 2011-11-15 17:01:58 -08:00
Jeremy Allison
f5cda7160c Remove unneeded access check. This is done inside smb_set_file_size(). 2011-11-15 17:01:58 -08:00
Jeremy Allison
c27551b163 Move handle based access check into handle code path. 2011-11-15 17:01:58 -08:00