summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-03-18 23:49:03 +0000
committerJeremy Allison <jra@samba.org>2003-03-18 23:49:03 +0000
commit4e8d7b3e8ed045f6a110889c5e31f2c5170b68a7 (patch)
treeb92f9bcdcefe7059abb52c73300fe0238c278c72
parent72b0c07eae391c796c09161416baa34cd852dc03 (diff)
downloadsamba-4e8d7b3e8ed045f6a110889c5e31f2c5170b68a7.tar.gz
samba-4e8d7b3e8ed045f6a110889c5e31f2c5170b68a7.tar.bz2
samba-4e8d7b3e8ed045f6a110889c5e31f2c5170b68a7.zip
Ensure dev in make_connection is const.
Jeremy. (This used to be commit 1c6ea31b8f48b93606f4c5b6a0472571dc8a471e)
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c2
-rw-r--r--source3/smbd/service.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 6d2320d67d..1a7b64858b 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1867,7 +1867,7 @@ WERROR _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC
r_u->status = WERR_ACCESS_DENIED;
goto error_exit;
}
- became_user = True;
+ became_user = True;
unistr2_to_ascii(filename, &q_u->uni_file_name, sizeof(filename));
unix_convert(filename, conn, NULL, &bad_path, &st);
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 1c7e4017b0..0f178b8ffc 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -218,7 +218,7 @@ int find_service(fstring service)
do some basic sainity checks on the share.
This function modifies dev, ecode.
****************************************************************************/
-static NTSTATUS share_sanity_checks(int snum, pstring dev)
+static NTSTATUS share_sanity_checks(int snum, fstring dev)
{
if (!lp_snum_ok(snum) ||
@@ -326,14 +326,17 @@ static void set_admin_user(connection_struct *conn, gid_t *groups, size_t n_grou
static connection_struct *make_connection_snum(int snum, user_struct *vuser,
DATA_BLOB password,
- char *dev, NTSTATUS *status)
+ const char *pdev, NTSTATUS *status)
{
struct passwd *pass = NULL;
BOOL guest = False;
connection_struct *conn;
struct stat st;
fstring user;
+ fstring dev;
+
*user = 0;
+ fstrcpy(dev, pdev);
if (NT_STATUS_IS_ERR(*status = share_sanity_checks(snum, dev))) {
return NULL;
@@ -717,7 +720,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
**************************************************************************************/
connection_struct *make_connection_with_chdir(const char *service_in, DATA_BLOB password,
- char *dev, uint16 vuid, NTSTATUS *status)
+ const char *dev, uint16 vuid, NTSTATUS *status)
{
connection_struct *conn = NULL;
@@ -747,12 +750,15 @@ connection_struct *make_connection_with_chdir(const char *service_in, DATA_BLOB
****************************************************************************/
connection_struct *make_connection(const char *service_in, DATA_BLOB password,
- char *dev, uint16 vuid, NTSTATUS *status)
+ const char *pdev, uint16 vuid, NTSTATUS *status)
{
uid_t euid;
user_struct *vuser = NULL;
fstring service;
+ fstring dev;
int snum = -1;
+
+ fstrcpy(dev, pdev);
/* This must ONLY BE CALLED AS ROOT. As it exits this function as root. */
if (!non_root_mode() && (euid = geteuid()) != 0) {