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

225 Commits

Author SHA1 Message Date
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
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02: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
872fb6a3e0 Move dptr code over to TALLOC.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 25 03:50:24 CET 2012 on sn-devel-104
2012-02-25 03:50:24 +01:00
Jeremy Allison
e54cf15387 Make dptr_path() and dptr_wcard() const. 2012-02-24 17:12:52 -08:00
Volker Lendecke
75d3b9ce08 s3: Fix some False/NULL hickups
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
2011-12-20 13:13:17 +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
Stefan Metzmacher
22ddbb5053 s3:smbd: don't limit the number of open dptrs for smb2 (bug #8592)
This fixes a crash bug that is triggered, when a client has more than
256 directory handles with searches.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Nov 10 14:08:14 CET 2011 on sn-devel-104
2011-11-10 14:08:13 +01:00
Stefan Metzmacher
39bb5a6297 s3:smbd: fully construct the dptr before allocating a dnum in the bitmap
metze
2011-11-10 12:31:01 +01:00
Stefan Metzmacher
7644547a55 s3:smbd: avoid string_set() in dir.c
And do some more error checks.

metze
2011-11-10 12:30:52 +01:00
Jeremy Allison
60b7dae3fa Add the SEC_DIR_LIST check to dptr_create().
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Nov  7 21:11:03 CET 2011 on sn-devel-104
2011-11-07 21:11:03 +01:00
Jeremy Allison
2898485848 Move the SEC_DIR_LIST check into dptr_create for SMB2 and now for SMB1.
The pathname check still needs fixing.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Nov  5 01:38:00 CET 2011 on sn-devel-104
2011-11-05 01:38:00 +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
d433af92b9 Revert "Call check_parent_access() on readdir."
This reverts commit a763edaf9c.

Checking the wrong thing..
2011-11-04 14:15:43 -07:00
Jeremy Allison
a763edaf9c Call check_parent_access() on readdir. 2011-11-01 16:38:14 -07:00
Michael Adam
316834cf42 s3:smbd: remove an unused variable in dptr_create() 2011-08-25 23:55:06 +02:00
Jeremy Allison
785c65e875 We don't need check_name() here. All possible paths to dptr_create()
have already called check_name.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Aug  3 03:00:55 CEST 2011 on sn-devel-104
2011-08-03 03:00:55 +02:00
Andrew Bartlett
6e6aaacedb lib/util Move bitmap.c to lib/util 2011-07-08 11:23:23 +02: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
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
0520da2bbe s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
0eca33bbf6 s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
0a3c84b554 s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
317e19aeb3 s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:12 +10:00
Andrew Bartlett
7f66ebde2e s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:12 +10:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Jeremy Allison
066fecd315 The searches struct is still being used and idled in SMB2 - move it to the global
section until we decide if we want to idle SMB2 directory handles.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar 18 01:13:53 CET 2011 on sn-devel-104
2011-03-18 01:13:53 +01:00
Jeremy Allison
4c77d620e6 Fix crash bug on smbd shutdown when using FOPENDIR() found by Volker.
The key was allowing the dptr_idle code to be triggered. We were
closing the dirp->dir handle without updating the underlying fd
in the open fsp.

Jeremy.
2011-03-17 15:55:15 -07:00
Jeremy Allison
c8a242d9fc dirfd doesn't exist in some platforms.
Hack that should get the buildfarm back to green.
Ensure dirfd() needs to be defined before we properly return fdopendir.
This will do until we get a proper dirfd() defined in libreplace.

From http://www.gnu.org/software/hello/manual/gnulib/dirfd.html

This function is missing on some platforms: AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 10, mingw.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 26 04:19:55 CET 2011 on sn-devel-104
2011-02-26 04:19:55 +01:00
Jeremy Allison
0122a4f417 Put OpenDir() back the way it was - don't overload with an fsp arg. Create OpenDir_fsp for new usage.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Feb 10 02:43:31 CET 2011 on sn-devel-104
2011-02-10 02:43:31 +01:00
Jeremy Allison
1607ebfe86 Allow SMB2_FIND to actually use the open fd handle if we support fdopendir. Fallback to pathname opendir if not. 2011-02-09 15:13:40 -08:00
Jeremy Allison
224fc03cb5 Pass fsp to dptr_CloseDir(). Cope with setting the fd if we're closing an fd that opendir knows about. 2011-02-08 15:06:00 -08:00
Jeremy Allison
a65bce4e38 Add uint32_t name_hash argument (currently unused) to get_file_infos().
Will be used when we store more than one delete on close token.
2011-01-25 14:02:18 -08:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Volker Lendecke
678a3c4e6d s3: Simplify (bool != True) to !bool 2010-04-24 10:50:12 +02:00
Ira Cooper
dd20259471 Fix bug #7384 - dptr_Close has a bitmap leak.
s3: Fix to dptr_Close

This fixes a bitmap "leak" in dptr_Close by making it use the same internal
routines the rest of the code does.
2010-04-23 10:55:46 -07:00
Volker Lendecke
c67e498ae8 s3: Use bitmap_talloc in init_dptrs 2010-03-28 15:25:17 +02:00
Jeremy Allison
33bd9b4bb9 Remove reference to conn->admin_user in preparation for removal.
We use (uid_t)0 here not sec_initial_uid() as make test uses a single user context.
I will revisit this when all the uid check changes are complete.

Jeremy.
2010-03-15 14:49:26 -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
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 Tridgell
13ac4ad521 s3-smbd: update to use new DLIST macros
(cherry picked from commit 365b408c458c848a818637d9b36a0423aeb1ba54)
2010-02-10 15:43:49 -08:00
Volker Lendecke
801edeccc6 s3: Remove some code that has become unnecessary
The code I just removed was checked in with e5466fffc2 as a bug fix for
https://bugzilla.samba.org/show_bug.cgi?id=3319. With the changes to
is_visible_file made with 9e8b8f8c16 these lines have become unnecessary,
even with "hide unreadable = yes" dead msdfs symlinks show. This is because we
can not stat(2) them and default to showing them.

Why this change? I have a user who wants to use "hide unreadable" on msdfs
links. Because you can't edit acls on symlinks themselves, the user created the
targets as bogus, empty files that just exist as acl placeholders. With the
code in place that this patch removes, we never allow this to work.

Jeremy, please check! :-)

Thanks,

Volker
2010-01-07 14:58:55 +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
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
Volker Lendecke
c85a4c9ba4 s3: Move the global variable Protocol to struct smbd_server_connection 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
d1c34d4054 s3: Replace some create_synthetic_smb_fname() calls
In very hot codepaths like the statcache copy_smb_filename and the subsequent
recursive talloc_free is noticable in the CPU load.
2009-11-18 23:16:13 +01:00