[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Mon Sep 26 08:34:02 MDT 2011
The branch, master has been updated
via b35d80a s3: Remove the smbd_server_conn ref from create_junction
via d2958fd s3: Remove the smbd_server_conn ref from setup_dfs_referral
via fba833d s3: Remove the smbd_server_conn ref from get_referred_path
via cb2b5c5 s3: Remove the smbd_server_conn ref from dfs_redirect
via 425b93e s3: Remove the smbd_server_conn ref from create_conn_struct
via 649437a s3: Remove the smbd_server_conn ref from parse_dfs_path
from c74de09 libcliraw: Make smb_raw_write_recv public and include it in a public header.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b35d80aa38dcfc28ea067d924152ebd9b72d895c
Author: Volker Lendecke <vl at samba.org>
Date: Sat Sep 24 05:53:28 2011 +0200
s3: Remove the smbd_server_conn ref from create_junction
Autobuild-User: Volker Lendecke <vlendec at samba.org>
Autobuild-Date: Mon Sep 26 16:33:30 CEST 2011 on sn-devel-104
commit d2958fd064ed58af6f4744f0e91480f8b2131e21
Author: Volker Lendecke <vl at samba.org>
Date: Sat Sep 24 05:49:08 2011 +0200
s3: Remove the smbd_server_conn ref from setup_dfs_referral
commit fba833d0557969fe0c1c943465c1b1f833fe1bdb
Author: Volker Lendecke <vl at samba.org>
Date: Sat Sep 24 05:42:48 2011 +0200
s3: Remove the smbd_server_conn ref from get_referred_path
commit cb2b5c521b2c13b6b453e0f4d7db8845da1fa1cf
Author: Volker Lendecke <vl at samba.org>
Date: Sat Sep 24 05:35:20 2011 +0200
s3: Remove the smbd_server_conn ref from dfs_redirect
commit 425b93ef6920367494ac773592b473802e59a471
Author: Volker Lendecke <vl at samba.org>
Date: Sat Sep 24 05:33:11 2011 +0200
s3: Remove the smbd_server_conn ref from create_conn_struct
commit 649437af3db39d4c5fd9807066619ee9d7f05985
Author: Volker Lendecke <vl at samba.org>
Date: Sat Sep 24 05:28:08 2011 +0200
s3: Remove the smbd_server_conn ref from parse_dfs_path
-----------------------------------------------------------------------
Summary of changes:
source3/printing/nt_printing.c | 10 +++++--
source3/rpc_server/dfs/srv_dfs_nt.c | 19 +++++++++-----
source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 12 ++++----
source3/smbd/msdfs.c | 38 +++++++++++++++++-----------
source3/smbd/proto.h | 3 ++
5 files changed, 51 insertions(+), 31 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 2ceb540..fc00f6a 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -29,6 +29,7 @@
#include "../libcli/security/security.h"
#include "passdb/machine_sid.h"
#include "smbd/smbd.h"
+#include "smbd/globals.h"
#include "auth.h"
#include "messages.h"
#include "rpc_server/spoolss/srv_spoolss_nt.h"
@@ -615,7 +616,8 @@ static uint32 get_correct_cversion(struct auth_session_info *session_info,
return -1;
}
- nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum,
+ nt_status = create_conn_struct(talloc_tos(), smbd_server_conn, &conn,
+ printdollar_snum,
lp_pathname(printdollar_snum),
session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -998,7 +1000,8 @@ WERROR move_driver_to_download_area(struct auth_session_info *session_info,
return WERR_NO_SUCH_SHARE;
}
- nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum,
+ nt_status = create_conn_struct(talloc_tos(), smbd_server_conn, &conn,
+ printdollar_snum,
lp_pathname(printdollar_snum),
session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
@@ -1522,7 +1525,8 @@ bool delete_driver_files(const struct auth_session_info *session_info,
return false;
}
- nt_status = create_conn_struct(talloc_tos(), &conn, printdollar_snum,
+ nt_status = create_conn_struct(talloc_tos(), smbd_server_conn, &conn,
+ printdollar_snum,
lp_pathname(printdollar_snum),
session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
diff --git a/source3/rpc_server/dfs/srv_dfs_nt.c b/source3/rpc_server/dfs/srv_dfs_nt.c
index d77989d..efb0a1e 100644
--- a/source3/rpc_server/dfs/srv_dfs_nt.c
+++ b/source3/rpc_server/dfs/srv_dfs_nt.c
@@ -75,8 +75,8 @@ WERROR _dfs_Add(struct pipes_struct *p, struct dfs_Add *r)
}
/* The following call can change the cwd. */
- status = get_referred_path(ctx, r->in.path, jn,
- &consumedcnt, &self_ref);
+ status = get_referred_path(ctx, r->in.path, smbd_server_conn, jn,
+ &consumedcnt, &self_ref);
if(!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
}
@@ -118,6 +118,7 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
bool found = False;
TALLOC_CTX *ctx = talloc_tos();
char *altpath = NULL;
+ NTSTATUS status;
if (p->session_info->unix_token->uid != sec_initial_uid()) {
DEBUG(10,("_dfs_remove: uid != 0. Access denied.\n"));
@@ -141,8 +142,9 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
r->in.dfs_entry_path, r->in.servername, r->in.sharename));
}
- if(!NT_STATUS_IS_OK(get_referred_path(ctx, r->in.dfs_entry_path, jn,
- &consumedcnt, &self_ref))) {
+ status = get_referred_path(ctx, r->in.dfs_entry_path, smbd_server_conn,
+ jn, &consumedcnt, &self_ref);
+ if(!NT_STATUS_IS_OK(status)) {
return WERR_DFS_NO_SUCH_VOL;
}
@@ -353,19 +355,22 @@ WERROR _dfs_GetInfo(struct pipes_struct *p, struct dfs_GetInfo *r)
bool self_ref = False;
TALLOC_CTX *ctx = talloc_tos();
bool ret;
+ NTSTATUS status;
jn = talloc_zero(ctx, struct junction_map);
if (!jn) {
return WERR_NOMEM;
}
- if(!create_junction(ctx, r->in.dfs_entry_path, jn)) {
+ if(!create_junction(ctx, r->in.dfs_entry_path,
+ !smbd_server_conn->using_smb2, jn)) {
return WERR_DFS_NO_SUCH_SERVER;
}
/* The following call can change the cwd. */
- if(!NT_STATUS_IS_OK(get_referred_path(ctx, r->in.dfs_entry_path,
- jn, &consumedcnt, &self_ref)) ||
+ status = get_referred_path(ctx, r->in.dfs_entry_path, smbd_server_conn,
+ jn, &consumedcnt, &self_ref);
+ if(!NT_STATUS_IS_OK(status) ||
consumedcnt < strlen(r->in.dfs_entry_path)) {
return WERR_DFS_NO_SUCH_VOL;
}
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index b155d29..d7bec03 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -2129,9 +2129,9 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
goto error_exit;
}
- nt_status = create_conn_struct(talloc_tos(), &conn, snum,
- lp_pathname(snum), p->session_info,
- &oldcwd);
+ nt_status = create_conn_struct(talloc_tos(), smbd_server_conn, &conn,
+ snum, lp_pathname(snum),
+ p->session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(10, ("create_conn_struct failed: %s\n",
nt_errstr(nt_status)));
@@ -2270,9 +2270,9 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
goto error_exit;
}
- nt_status = create_conn_struct(talloc_tos(), &conn, snum,
- lp_pathname(snum), p->session_info,
- &oldcwd);
+ nt_status = create_conn_struct(talloc_tos(), smbd_server_conn, &conn,
+ snum, lp_pathname(snum),
+ p->session_info, &oldcwd);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(10, ("create_conn_struct failed: %s\n",
nt_errstr(nt_status)));
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 702dd1d..64a6b40 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -53,10 +53,10 @@
static NTSTATUS parse_dfs_path(connection_struct *conn,
const char *pathname,
bool allow_wcards,
+ bool allow_broken_path,
struct dfs_path *pdp, /* MUST BE TALLOCED */
bool *ppath_contains_wcard)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
char *pathname_local;
char *p,*temp;
char *servicename;
@@ -84,7 +84,7 @@ static NTSTATUS parse_dfs_path(connection_struct *conn,
sepchar = pdp->posix_path ? '/' : '\\';
- if (!sconn->using_smb2 && (*pathname != sepchar)) {
+ if (allow_broken_path && (*pathname != sepchar)) {
DEBUG(10,("parse_dfs_path: path %s doesn't start with %c\n",
pathname, sepchar ));
/*
@@ -222,6 +222,7 @@ static NTSTATUS parse_dfs_path(connection_struct *conn,
*********************************************************/
NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
+ struct smbd_server_connection *sconn,
connection_struct **pconn,
int snum,
const char *path,
@@ -262,7 +263,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
conn->params->service = snum;
- conn->sconn = smbd_server_conn;
+ conn->sconn = sconn;
conn->sconn->num_tcons_open++;
if (session_info != NULL) {
@@ -719,6 +720,7 @@ static NTSTATUS dfs_redirect(TALLOC_CTX *ctx,
connection_struct *conn,
const char *path_in,
bool search_wcard_flag,
+ bool allow_broken_path,
char **pp_path_out,
bool *ppath_contains_wcard)
{
@@ -729,7 +731,8 @@ static NTSTATUS dfs_redirect(TALLOC_CTX *ctx,
return NT_STATUS_NO_MEMORY;
}
- status = parse_dfs_path(conn, path_in, search_wcard_flag, pdp,
+ status = parse_dfs_path(conn, path_in, search_wcard_flag,
+ allow_broken_path, pdp,
ppath_contains_wcard);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(pdp);
@@ -847,6 +850,7 @@ static NTSTATUS self_ref(TALLOC_CTX *ctx,
NTSTATUS get_referred_path(TALLOC_CTX *ctx,
const char *dfs_path,
+ struct smbd_server_connection *sconn,
struct junction_map *jucn,
int *consumedcntp,
bool *self_referralp)
@@ -865,7 +869,8 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
*self_referralp = False;
- status = parse_dfs_path(NULL, dfs_path, False, pdp, &dummy);
+ status = parse_dfs_path(NULL, dfs_path, False, !sconn->using_smb2,
+ pdp, &dummy);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -968,8 +973,8 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
return NT_STATUS_OK;
}
- status = create_conn_struct(ctx, &conn, snum, lp_pathname(snum),
- NULL, &oldpath);
+ status = create_conn_struct(ctx, sconn, &conn, snum,
+ lp_pathname(snum), NULL, &oldpath);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(pdp);
return status;
@@ -1272,8 +1277,8 @@ int setup_dfs_referral(connection_struct *orig_conn,
}
/* The following call can change cwd. */
- *pstatus = get_referred_path(ctx, pathnamep, junction,
- &consumedcnt, &self_referral);
+ *pstatus = get_referred_path(ctx, pathnamep, orig_conn->sconn,
+ junction, &consumedcnt, &self_referral);
if (!NT_STATUS_IS_OK(*pstatus)) {
vfs_ChDir(orig_conn,orig_conn->connectpath);
talloc_destroy(ctx);
@@ -1345,6 +1350,7 @@ int setup_dfs_referral(connection_struct *orig_conn,
bool create_junction(TALLOC_CTX *ctx,
const char *dfs_path,
+ bool allow_broken_path,
struct junction_map *jucn)
{
int snum;
@@ -1355,7 +1361,8 @@ bool create_junction(TALLOC_CTX *ctx,
if (!pdp) {
return False;
}
- status = parse_dfs_path(NULL, dfs_path, False, pdp, &dummy);
+ status = parse_dfs_path(NULL, dfs_path, False, allow_broken_path,
+ pdp, &dummy);
if (!NT_STATUS_IS_OK(status)) {
return False;
}
@@ -1406,8 +1413,8 @@ static bool junction_to_local_path(const struct junction_map *jucn,
if(snum < 0) {
return False;
}
- status = create_conn_struct(talloc_tos(), conn_out, snum,
- lp_pathname(snum), NULL, oldpath);
+ status = create_conn_struct(talloc_tos(), smbd_server_conn, conn_out,
+ snum, lp_pathname(snum), NULL, oldpath);
if (!NT_STATUS_IS_OK(status)) {
return False;
}
@@ -1568,8 +1575,8 @@ static int count_dfs_links(TALLOC_CTX *ctx, int snum)
* Fake up a connection struct for the VFS layer.
*/
- status = create_conn_struct(talloc_tos(), &conn, snum, connect_path,
- NULL, &cwd);
+ status = create_conn_struct(talloc_tos(), smbd_server_conn, &conn,
+ snum, connect_path, NULL, &cwd);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("create_conn_struct failed: %s\n",
nt_errstr(status)));
@@ -1641,7 +1648,7 @@ static int form_junctions(TALLOC_CTX *ctx,
* Fake up a connection struct for the VFS layer.
*/
- status = create_conn_struct(ctx, &conn, snum, connect_path, NULL,
+ status = create_conn_struct(ctx, smbd_server_conn, &conn, snum, connect_path, NULL,
&cwd);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("create_conn_struct failed: %s\n",
@@ -1806,6 +1813,7 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
conn,
name_in,
allow_wcards,
+ !smbd_server_conn->using_smb2,
pp_name_out,
&path_contains_wcard);
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 3d0665d..cf7c904 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -448,6 +448,7 @@ bool is_msdfs_link(connection_struct *conn,
struct junction_map;
NTSTATUS get_referred_path(TALLOC_CTX *ctx,
const char *dfs_path,
+ struct smbd_server_connection *sconn,
struct junction_map *jucn,
int *consumedcntp,
bool *self_referralp);
@@ -457,6 +458,7 @@ int setup_dfs_referral(connection_struct *orig_conn,
char **ppdata, NTSTATUS *pstatus);
bool create_junction(TALLOC_CTX *ctx,
const char *dfs_path,
+ bool allow_broken_path,
struct junction_map *jucn);
bool create_msdfs_link(const struct junction_map *jucn);
bool remove_msdfs_link(const struct junction_map *jucn);
@@ -475,6 +477,7 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
char **pp_name_out,
bool *ppath_contains_wcard);
NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
+ struct smbd_server_connection *sconn,
connection_struct **pconn,
int snum,
const char *path,
--
Samba Shared Repository
More information about the samba-cvs
mailing list