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

144 Commits

Author SHA1 Message Date
Volker Lendecke
d1dccfbda6 s3: Fix Coverity ID 710818 Resource leak
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-07-31 11:40:23 +02: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
Michael Adam
ba1699463b s3:smb: introduce a name TID_FIELD_INVALID for the invalid value for a cnum/tid
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-06-06 19:37:14 +02: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
Stefan Metzmacher
758d61201f s3:smbd/msdfs: pass 'allow_broken_path' to get_referred_path()
Note the DCERPC code should not be smb2 specific!

I wonder why this is at all smb2 specific...

metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
a92f7176bd s3:smbd/msdfs: let create_conn_struct() also fake the 'smbd_server_connection'
metze
2012-05-24 14:12:32 +02:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Stefan Metzmacher
f6b6e963f6 s3:smbd: keep 'num_connections' and 'connections' directly under smbd_server_connection
The plan is to have connection_struct as some kind of low level
abstraction for a smb1/smb2 tree connects, that can be used by SMB_VFS modules.

metze
2012-03-06 21:26:05 +01:00
Stefan Metzmacher
d95dbb86c5 s3:msdfs: set the 'cnum' field to invalid for faked connection_structs
metze
2012-03-06 21:26:05 +01:00
Stefan Metzmacher
3cf275cd75 s3:smbd/msdfs: enum_msdfs_links() doesn't need a smbd_server_connection anymore
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Dec 13 17:26:20 CET 2011 on sn-devel-104
2011-12-13 17:26:20 +01:00
Stefan Metzmacher
ae7d877841 s3:smbd: use connections_snum_used() instead of conn_snum_used() for load_usershare_shares()
Before removing the share security descriptor, we should make sure there're
really no active users anymore.

metze
2011-12-13 15:45:36 +01:00
Stefan Metzmacher
1399e6bdf5 s3:param: don't reference conn_snum_used directly in load_usershare_shares()
This uses the same logic as lp_killunused().

metze
2011-12-13 15:45:36 +01:00
Stefan Metzmacher
09731c7687 s3:msdfs: removed unused variables
metze
2011-10-08 01:43:38 +02:00
Stefan Metzmacher
f6eb85c952 s3:msdfs: implement setup_dfs_referral() on top of SMB_VFS_GET_DFS_REFERRALS()
metze
2011-10-08 01:43:38 +02:00
Jeremy Allison
c704d9216d Fix bug #8493 - DFS breaks zip file extracting unless "follow symlinks = no" set
If a client sends a mangled name as part of a DFS path, use the
post-mangled name for the pathname walk, not the mangled name.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Oct  1 00:45:59 CEST 2011 on sn-devel-104
2011-10-01 00:45:59 +02:00
Volker Lendecke
b35d80aa38 s3: Remove the smbd_server_conn ref from create_junction
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Sep 26 16:33:30 CEST 2011 on sn-devel-104
2011-09-26 16:33:29 +02:00
Volker Lendecke
d2958fd064 s3: Remove the smbd_server_conn ref from setup_dfs_referral 2011-09-26 14:59:12 +02:00
Volker Lendecke
fba833d055 s3: Remove the smbd_server_conn ref from get_referred_path 2011-09-26 14:59:12 +02:00
Volker Lendecke
cb2b5c521b s3: Remove the smbd_server_conn ref from dfs_redirect 2011-09-26 14:59:12 +02:00
Volker Lendecke
425b93ef69 s3: Remove the smbd_server_conn ref from create_conn_struct 2011-09-26 14:59:12 +02:00
Volker Lendecke
649437af3d s3: Remove the smbd_server_conn ref from parse_dfs_path 2011-09-26 14:59:12 +02:00
Andrew Bartlett
9fcc617ff5 s3-auth Use the common auth_session_info
This patch finally has the same structure being used to describe the
authorization data of a user across the whole codebase.

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

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
9289537993 s3-auth Use struct auth_user_info_unix for unix_name and sanitized_username
This is closer to the layout of struct auth_session_info in auth.idl

Andrew Bartlett

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

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

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Stefan Metzmacher
18f967a248 s3:smbd/msdfs: let create_conn_struct() check the share security descriptor
metze
2011-07-11 21:23:08 +02:00
Andrew Bartlett
489f528857 param: Merge param headers into lib/param/loadparm.h
This defines a common table format, so we can in future define a
common table.

Andrew Bartlett
2011-06-29 15:44:09 +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
d5e6a47f06 s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
8524924a46 s3-smbd provide struct smbd_server_connection * to conn_snum_used
This provides the 'sconn' parameter to this key functions, that
is currently duplicated in dummysmbd.c, which causes duplicate symbol
issues in the waf build.

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

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

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Jeremy Allison
02af307585 More simple const fixes. 2011-05-05 23:56:07 +02:00
Günther Deschner
af300a9fcb s3-auth: smbd needs auth.h
Guenther
2011-03-30 01:13:09 +02: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
Günther Deschner
1ce4d2d83a s3-msdfs: avoid global inclusion of msdfs.h.
Guenther
2011-03-16 16:56:46 +01:00
David Disseldorp
016a8d214a s3-printing: vfs_connect prior to driver/dfs IO
samba3.posix_s3.rpc.spoolss.driver fails with the xattr_tdb vfs module
loaded as a part of make test. The (now checked) create_directory() call
in move_driver_to_download_area() fails, uncovering another bug in the
printer driver upload code path.

move_driver_to_download_area() creates a new conn_struct for
manipulating files in [print$]. The VFS layer is plumbed through with
the call to create_conn_struct(), however SMB_VFS_CONNECT() is never
called. Many vfs modules expect state stored at connect time with
SMB_VFS_HANDLE_SET_DATA() to be available on any IO operation and fail
if this is not the case.

This fix adds a call to SMB_VFS_CONNECT() in create_conn_struct() prior
to IO.

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

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Mar  2 01:16:30 CET 2011 on sn-devel-104
2011-03-02 01:16:30 +01:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11:00
Jeremy Allison
f0dcc90f72 Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when adding new share via MMC
Change the find_service() interface to not depend on fstring, and
create a useable talloc-based interface.

Jeremy.
2010-11-10 01:14:17 +00:00
Jeremy Allison
edefaf5bed Move tcons.num_open from smb1 to sconn->num_tcons_open as this is needed for SMB2 also. 2010-10-19 15:13:17 -07:00
Andreas Schneider
021539570b s3-msdfs: Make auth_serversupplied_info const. 2010-09-09 16:00:08 +02:00
Volker Lendecke
ff93d58b60 s3: Fix crashes in the printing code
create_conn_struct did not create the conn->sconn!=NULL assumption we now
depend on. Thanks to Andreas Schneider for testing!
2010-07-15 10:38:37 +02:00
Jeremy Allison
d28fa8faab Rename "allow_smb2" -> "using_smb2" and make the usage clearer. 2010-06-09 19:12:02 -07:00
Jeremy Allison
b2a7ad8c95 Make DFS work over SMB2.
Jeremy.
2010-05-21 16:56:10 -07: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
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
Volker Lendecke
f6650f5d19 s3: Do not talloc in readdir
This is a hot codepath (called from the stat cache)
2009-11-18 23:16:13 +01:00
Aravind Srinivasan
e046b382f2 s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAME
This vop is designed to work in tandem with SMB_VFS_READDIR to allow
vfs modules to make modifications to arbitrary filenames before
they're consumed by callers.  Subsequently the core directory
enumeration code in smbd is now changed to free the memory that may be
allocated in a module.  This vop enables the new version of catia in
the following patch.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-08-28 16:38:57 -07:00
Jeremy Allison
c69f92d16d Second attempt at fix for bug 6529 - Offline files conflict with Vista and Office 2003.
Confirmation from reporter that this fixes the issue in master on ext3/ext4.
Back-ports to follow.
Jeremy.
2009-08-24 20:57:37 -07:00
Stefan Metzmacher
70afd419a6 s3:smbd: conn_free_internal() can be static now
metze
2009-08-07 14:18:15 +02:00