summaryrefslogtreecommitdiff
path: root/source3/smbd/msdfs.c
AgeCommit message (Collapse)AuthorFilesLines
2011-05-31s3-smbd provide struct smbd_server_connection * to conn_snum_usedAndrew Bartlett1-2/+3
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-05More simple const fixes.Jeremy Allison1-1/+1
2011-03-30s3-auth: smbd needs auth.hGünther Deschner1-0/+1
Guenther
2011-03-30s3: include smbd/smbd.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-includes: only include system/filesys.h when needed.Günther Deschner1-0/+1
Guenther
2011-03-16s3-msdfs: avoid global inclusion of msdfs.h.Günther Deschner1-0/+1
Guenther
2011-03-02s3-printing: vfs_connect prior to driver/dfs IODavid Disseldorp1-10/+24
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-02-22s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_infoAndrew Bartlett1-5/+5
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>
2010-11-10Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when ↵Jeremy Allison1-3/+5
adding new share via MMC Change the find_service() interface to not depend on fstring, and create a useable talloc-based interface. Jeremy.
2010-10-19Move tcons.num_open from smb1 to sconn->num_tcons_open as this is needed for ↵Jeremy Allison1-1/+1
SMB2 also.
2010-09-09s3-msdfs: Make auth_serversupplied_info const.Andreas Schneider1-1/+1
2010-07-15s3: Fix crashes in the printing codeVolker Lendecke1-0/+3
create_conn_struct did not create the conn->sconn!=NULL assumption we now depend on. Thanks to Andreas Schneider for testing!
2010-06-09Rename "allow_smb2" -> "using_smb2" and make the usage clearer.Jeremy Allison1-1/+1
2010-05-21Make DFS work over SMB2.Jeremy Allison1-1/+2
Jeremy.
2010-04-08Fix bug #7339 - MSDFS is non-functional in 3.5.xJeremy Allison1-1/+2
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.
2009-11-18s3: Replace some create_synthetic_smb_fname() callsVolker Lendecke1-13/+6
In very hot codepaths like the statcache copy_smb_filename and the subsequent recursive talloc_free is noticable in the CPU load.
2009-11-18s3: Do not talloc in readdirVolker Lendecke1-8/+12
This is a hot codepath (called from the stat cache)
2009-08-28s3: Add a new VFS op called SMB_VFS_TRANSLATE_NAMEAravind Srinivasan1-0/+4
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-24Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison1-1/+1
Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
2009-08-07s3:smbd: conn_free_internal() can be static nowStefan Metzmacher1-11/+11
metze
2009-07-24s3: Convert a few callers of unix_convert() over to filename_convert()Tim Prouty1-1/+1
This patch also changes the unix convert flags to make sure the correct semantics are preservered for allowing/disallowing wildcards in the last component of the path.
2009-07-24s3: Remove a few callers of get_full_smb_filename()Tim Prouty1-21/+31
2009-07-24s3: Allow filename_convert() to pass through unix_convert_flags and let the ↵Tim Prouty1-35/+10
caller know if the path has a wildcard This also eliminates the need for resolve_dfspath().
2009-07-22s3: Convert some callers of vfs_lstat_smb_fname to SMB_VFS_LSTAT()Tim Prouty1-6/+14
2009-07-06s3: Plumb smb_filename through SMB_VFS_UNLINKTim Prouty1-2/+26
2009-06-24s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty1-1/+1
This patch introduces two new temporary helper functions vfs_stat_smb_fname and vfs_lstat_smb_fname. They basically allowed me to call the new smb_filename version of stat, while avoiding plumbing it through callers that are still too inconvenient. As the conversion moves along, I will be able to remove callers of this, with the goal being to remove all callers. There was also a bug in create_synthetic_smb_fname_split (also a temporary utility function) that caused it to incorrectly handle filenames with ':'s in them when in posix mode. This is now fixed.
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-1/+1
This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
2009-05-20s3: Change unix_convert (and its callers) to use struct smb_filenameTim Prouty1-3/+12
This is the first of a series of patches that change path based operations to operate on a struct smb_filename instead of a char *. This same concept already exists in source4. My goals for this series of patches are to eventually: 1) Solve the stream vs. posix filename that contains a colon ambiguity that currently exists. 2) Make unix_convert the only function that parses the stream name. 3) Clean up the unix_convert API. 4) Change all path based vfs operation to take a struct smb_filename. 5) Make is_ntfs_stream_name() a constant operation that can simply check the state of struct smb_filename rather than re-parse the filename. 6) Eliminate the need for split_ntfs_stream_name() to exist. My strategy is to start from the inside at unix_convert() and work my way out through the vfs layer, call by call. This first patch does just that, by changing unix_convert and all of its callers to operate on struct smb_filename. Since this is such a large change, I plan on pushing the patches in phases, where each phase keeps full compatibility and passes make test. The API of unix_convert has been simplified from: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, bool allow_wcard_last_component, char **pp_conv_path, char **pp_saved_last_component, SMB_STRUCT_STAT *pst) to: NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, struct smb_filename *smb_fname, uint32_t ucf_flags) Currently the smb_filename struct looks like: struct smb_filename { char *base_name; char *stream_name; char *original_lcomp; SMB_STRUCT_STAT st; }; One key point here is the decision to break up the base_name and stream_name. I have introduced a helper function called get_full_smb_filename() that takes an smb_filename struct and allocates the full_name. I changed the callers of unix_convert() to subsequently call get_full_smb_filename() for the time being, but I plan to eventually eliminate get_full_smb_filename().
2009-05-08Fix bug #6330 - DFS doesn't work on AIX. Jeremy.Jeremy Allison1-0/+4
2009-05-04s3-printing: Fix driver upload for Xerox 4110 PS printer driver.Günther Deschner1-0/+2
We need to allow to set filesystem capabilities from the default vfs in create_conn_struct() in order to find mixed-case filenames. Thanks Volker! This one was hard to find, so a little longer explanation: When a Windows client tries to upload e.g. the Xerox 4110 PS driver, the client first uploads the driver files to the [print$] share. Some of them (in this case the Windows Postscript drivers) are with uppercase filenames while some of them (like the PPD file) are in lowercase. After the driver upload the client issues the spoolss_AddPrinterDriverEx() call with level 6. There the client tries to add the PPD file with an uppercase filename (while having stored it in lowercase on the server). The internal spoolss add driver functions then could not find the appropriate filename while trying to move them to the version subdirectory (in this case W32X86/3) and fails then entire spoolss_AddPrinterDriverEx() call. With this fix, the convert_unix_name() name finds the correct file and the spoolss_AddPrinterDriverEx() succeeds. Guenther
2009-02-09Pass stat buffer down through all levels of VFS_READDIR wrappersSteven Danneman1-2/+2
* VFS_OP_READDIR can now provide stat information, take advantage of it if it's available * is_visible_file(): optimistically expect the provided stat buffer is already valid * dptr_ReadDirName(): refactor code for easier readability, functionality is the same
2009-01-08s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher1-2/+1
The goal is to move all this variables into a big context structure. metze
2008-11-23Add auth_serversupplied_info to create_conn_structVolker Lendecke1-4/+15
srvsvc needs it, as will printing
2008-11-20Fix bug #5909 - MS-DFS does not work on Vista, if link name includes ↵Yasuma Takeda1-6/+6
multibyte character.
2008-07-27Make create_conn_struct() publicVolker Lendecke1-1/+1
(This used to be commit e115e2582256c34e6905afc8c2929efd6ea61088)
2008-06-24Move the responsibility to keep the cwd from srv_dfs_nt to msdfs.cVolker Lendecke1-17/+53
(This used to be commit 7db382588ac90fe250b72cf4cd07afb39fcae7c0)
2008-06-22Remove the "exists" parameter from create_msdfs_linkVolker Lendecke1-11/+11
Jeremy, setting "exists" to True in _dfs_Add prevented the initial creation of a new symlink for me, because the SMB_VFS_UNLINK failed. This also exists in 3.2. I only check it into 3.3 as I would like you to look at it first. Thanks, Volker (This used to be commit f58b098a4172949018e84c4d0c722d6eb9bba514)
2008-06-22Reduce memory usage in form_junctions() a little bitVolker Lendecke1-0/+1
(This used to be commit d031e6d8cabe2dd0b29e90d173d45843e145176a)
2008-06-22Fix an abort in junction_to_local_pathVolker Lendecke1-1/+1
(This used to be commit 587bd636cb70d09600111ced040adaa55af35d0f)
2008-06-22Fix a crash in _dfs_EnumVolker Lendecke1-0/+2
(cherry picked from commit 4a996476297963d4cb300b4d45c23e83a493c339) (This used to be commit 86cae83a7db87063ecd6e58eaa15f11441c45040)
2008-06-22Fix an uninitialized variable access in callers of parse_msdfs_symlinkVolker Lendecke1-1/+2
At least form_junctions() does not initialize refcount, and I don't see it in get_referred_path(). For the latters, the callers might initialize it. But even if they did, I think parse_msdfs_symlink() should unconditionally return the number of referrals it found. I don't think it makes sense to count them up from somewhere else. (This used to be commit 73172113484a2c6c9af014f59e84707716c61a7d)
2008-06-21Fix a double-closedir() in form_junctions()Volker Lendecke1-1/+0
(This used to be commit 1d7ad0dea7ebf7a46af6e695797e5132264307d6)
2008-05-25Remove some references to get_current_username() and current_user_infoVolker Lendecke1-0/+11
(This used to be commit 344d69f95e217d16213eaa6b53141af6ab459708)
2008-05-19Restructuring of code to fix #5460. Remove searchJeremy Allison1-16/+12
by name code from conn, we were already doing the same check in the dfs_redirect() function, so move it into parse_dfs_path() instead. Jeremy. (This used to be commit 8a7c6df122c5e4a1d0f74ab0f1bc9376a0a8bcb1)
2008-05-13Fix debug message.Jeremy Allison1-2/+2
Jeremy. (This used to be commit 08d168f0e5b8fb07e95a5118a839e0da53e9d363)
2008-05-13Second part of patch for bug #5460. Cope with pathnamesJeremy Allison1-15/+39
that don't look like \xxx\yyy, cope with arbitrary length. Jeremy. (This used to be commit 635035d999fcd8e06b70c8cb1137127c289dc9e6)
2008-05-13Fix bug #5460. The problem is RHEL5.0 shipped a CIFS clientJeremy Allison1-0/+10
that sets the DFS bit on pathnames but doesn't send DFS paths. This causes lookups to fail as the smbd/msdfs.c code now just eats the first two parts of the pathname and uses the rest as the local path. The previous hostname check used to protect us from that as we knew that when the hostname was invalid it was a local path (and a broken client). I didn't want to put that check back in, but came up with another idea - even though the hostname can be a different one, the sharename must be valid on this machine. So we can check for a valid sharename instead. Jeremy. (This used to be commit e1cda82f6f7de3306a653af920756c1640057f2d)
2008-05-05Fix dfs_Enum: In form_junctions, correctly check for malloc failureVolker Lendecke1-1/+1
(This used to be commit 1b1614c3261e1e93a2cad1f1063e28cbbb13f434)
2008-05-05Remove connection_struct->mem_ctx, connection_struct is its own parentVolker Lendecke1-45/+36
(This used to be commit 559180f7d30606d1999399d954ceedc798c669a4)
2008-04-02Fix MSDFS bug noticed by Ofir Azoulay <Ofir.Azoulay@expand.com>.Jeremy Allison1-30/+0
There is no reason to ensure the target host is ourselves, and this breaks MS clients in some cases. Jeremy. (This used to be commit c19fdf43d16ce9fba3e8e12e6192bac31837715e)