summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-07-04 01:43:40 +0000
committerGerald Carter <jerry@samba.org>2006-07-04 01:43:40 +0000
commitfdedd593757368a5133057f4e1ce0822b8ed02d0 (patch)
treef68b69c1dadf5cad0fd8ee86243e8920a48899a8
parent8714a9a83605ce716a3a568fa24dcba74553c248 (diff)
downloadsamba-fdedd593757368a5133057f4e1ce0822b8ed02d0.tar.gz
r16792: minor (but critical fixes) from Jeremy, Volker, & Guenther
-rw-r--r--WHATSNEW.txt16
-rw-r--r--source/nsswitch/winbindd_cache.c1
-rw-r--r--source/nsswitch/winbindd_cred_cache.c4
-rw-r--r--source/smbd/dosmode.c51
-rw-r--r--source/smbd/trans2.c11
5 files changed, 73 insertions, 10 deletions
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 5f8a8c402c7..77cf3af46df 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -8,15 +8,18 @@ that production Samba servers should be running for all current
bug-fixes. Please read the changes in this section for details on
new features and difference in behavior from previous releases.
-We would like to thank the developers of Klocwork for their
-analysis of the Samba source tree. This release includes fixes
-for over 200 defects reported by the Klocwork code analyzer.
+There has been a substantial amount of cleanup work done during
+this development cycle. We would like to thank both Coverity
+(http://www.coverity.com/) and Klocwork (http://www.klocwork.com/)
+for anaylzing the Sambs source code. As a result, this release
+includes fixes for over 400 defects. The coverage was approximately
+even with over 200 defects reported by each tool.
Thanks very much to those people who spent time testing the
release candidates and reported their findings. We would like to
especially thank Thomas Bork <tombork@web.de> for his numerous
-reports. We believe that the final release is in much better
-shape in a large part due to his efforts.
+reports. We believe that the final release is in much better shape
+in a large part due to his efforts.
New features in 3.0.23 include:
@@ -164,6 +167,7 @@ o Jeremy Allison <jra@samba.org>
* Fix nmbd WINS serving bug causing duplicate IPs in the *<1b>
query reply ("enhanced browsing = yes").
* Fix SMB signing failures in client tools.
+ * BUG 3909: Avoid EA lookups on MS-DFS links.
o Nicholas Brealey <nick@brealey.org>
@@ -185,11 +189,13 @@ o Gerald (Jerry) Carter <jerry@samba.org>
o Guenther Deschner <gd@samba.org>
* Fix different extended_dn handling in adssearch.pl
(Thanks to Frederic Brin at Novell).
+ * Fix a memleak in winbindd's credentials cache.
o Volker Lendecke <vl@samba.org>
* Fix a memleak in the server registry code for enumeration
shares.
+ * Fix an niavlid munlock call in winbindd's credentials cache.
o Jason Mader <jason@ncac.gwu.edu>
diff --git a/source/nsswitch/winbindd_cache.c b/source/nsswitch/winbindd_cache.c
index e078c295e17..5cbaa778052 100644
--- a/source/nsswitch/winbindd_cache.c
+++ b/source/nsswitch/winbindd_cache.c
@@ -827,6 +827,7 @@ NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
+ SAFE_FREE(data.dptr);
return NT_STATUS_OK;
}
diff --git a/source/nsswitch/winbindd_cred_cache.c b/source/nsswitch/winbindd_cred_cache.c
index 5fdb79c107a..f5003ac8c63 100644
--- a/source/nsswitch/winbindd_cred_cache.c
+++ b/source/nsswitch/winbindd_cred_cache.c
@@ -80,8 +80,8 @@ NTSTATUS remove_ccache_by_ccname(const char *ccname)
#ifdef DEBUG_PASSWORD
DEBUG(10,("unlocking memory: %p\n", entry->pass));
#endif
- memset(&(entry->pass), 0, len);
- if ((munlock(&entry->pass, len)) == -1) {
+ memset(entry->pass, 0, len);
+ if ((munlock(entry->pass, len)) == -1) {
DEBUG(0,("failed to munlock memory: %s (%d)\n",
strerror(errno), errno));
return map_nt_error_from_unix(errno);
diff --git a/source/smbd/dosmode.c b/source/smbd/dosmode.c
index 583b3f19e76..61145fde2f0 100644
--- a/source/smbd/dosmode.c
+++ b/source/smbd/dosmode.c
@@ -316,6 +316,57 @@ static BOOL set_ea_dos_attribute(connection_struct *conn, const char *path, SMB_
}
/****************************************************************************
+ Change a unix mode to a dos mode for an ms dfs link.
+****************************************************************************/
+
+uint32 dos_mode_msdfs(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf)
+{
+ uint32 result = 0;
+
+ DEBUG(8,("dos_mode_msdfs: %s\n", path));
+
+ if (!VALID_STAT(*sbuf)) {
+ return 0;
+ }
+
+ /* First do any modifications that depend on the path name. */
+ /* hide files with a name starting with a . */
+ if (lp_hide_dot_files(SNUM(conn))) {
+ const char *p = strrchr_m(path,'/');
+ if (p) {
+ p++;
+ } else {
+ p = path;
+ }
+
+ if (p[0] == '.' && p[1] != '.' && p[1] != 0) {
+ result |= aHIDDEN;
+ }
+ }
+
+ result |= dos_mode_from_sbuf(conn, path, sbuf);
+
+ /* Optimization : Only call is_hidden_path if it's not already
+ hidden. */
+ if (!(result & aHIDDEN) && IS_HIDDEN_PATH(conn,path)) {
+ result |= aHIDDEN;
+ }
+
+ DEBUG(8,("dos_mode_msdfs returning "));
+
+ if (result & aHIDDEN) DEBUG(8, ("h"));
+ if (result & aRONLY ) DEBUG(8, ("r"));
+ if (result & aSYSTEM) DEBUG(8, ("s"));
+ if (result & aDIR ) DEBUG(8, ("d"));
+ if (result & aARCH ) DEBUG(8, ("a"));
+ if (result & FILE_ATTRIBUTE_SPARSE ) DEBUG(8, ("[sparse]"));
+
+ DEBUG(8,("\n"));
+
+ return(result);
+}
+
+/****************************************************************************
Change a unix mode to a dos mode.
****************************************************************************/
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index 27fd62be7fd..9030737b1b4 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -1091,6 +1091,8 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
while (!found) {
BOOL got_match;
+ BOOL ms_dfs_link = False;
+
/* Needed if we run out of space */
long curr_dirpos = prev_dirpos = dptr_TellDir(conn->dirptr);
dname = dptr_ReadDirName(conn->dirptr,&curr_dirpos,&sbuf);
@@ -1154,8 +1156,7 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
if(lp_host_msdfs() &&
lp_msdfs_root(SNUM(conn)) &&
- is_msdfs_link(NULL,conn, pathreal, NULL, NULL,
- &sbuf)) {
+ ((ms_dfs_link = is_msdfs_link(NULL,conn, pathreal, NULL, NULL, &sbuf)) == True)) {
DEBUG(5,("get_lanman2_dir_entry: Masquerading msdfs link %s as a directory\n", pathreal));
sbuf.st_mode = (sbuf.st_mode & 0xFFF) | S_IFDIR;
@@ -1168,7 +1169,11 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
}
}
- mode = dos_mode(conn,pathreal,&sbuf);
+ if (ms_dfs_link) {
+ mode = dos_mode_msdfs(conn,pathreal,&sbuf);
+ } else {
+ mode = dos_mode(conn,pathreal,&sbuf);
+ }
if (!dir_check_ftype(conn,mode,dirtype)) {
DEBUG(5,("[%s] attribs didn't match %x\n",fname,dirtype));