smbdotconf: mark "path" with substitution="1"
authorRalph Boehme <slow@samba.org>
Thu, 31 Oct 2019 18:14:02 +0000 (19:14 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:33 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
13 files changed:
docs-xml/smbdotconf/base/path.xml
source3/param/loadparm.c
source3/printing/nt_printing.c
source3/printing/printing.c
source3/printing/printspoolss.c
source3/rpc_server/fss/srv_fss_agent.c
source3/rpc_server/mdssvc/srv_mdssvc_nt.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/lanman.c
source3/smbd/msdfs.c
source3/smbd/password.c
source3/smbd/service.c
source3/utils/net_vfs.c

index c84e039875a074cb721590dc0d96a4fe7a05bad6..669c20d2a8bbb47408f49a6ed40528f517395260 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="path"
                  context="S"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <synonym>directory</synonym>
 <description>
index b08589b22fb007bfc25163197aab216322ecb723..1d47d74c5f4d19a17d08c7bea6dd3c6ed0fe3ef6 100644 (file)
@@ -1557,6 +1557,8 @@ static bool hash_a_service(const char *name, int idx)
 bool lp_add_home(const char *pszHomename, int iDefaultService,
                 const char *user, const char *pszHomedir)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        int i;
        char *global_path;
 
@@ -1570,7 +1572,7 @@ bool lp_add_home(const char *pszHomename, int iDefaultService,
        if (i < 0)
                return false;
 
-       global_path = lp_path(talloc_tos(), GLOBAL_SECTION_SNUM);
+       global_path = lp_path(talloc_tos(), lp_sub, GLOBAL_SECTION_SNUM);
        if (!(*(ServicePtrs[iDefaultService]->path))
            || strequal(ServicePtrs[iDefaultService]->path, global_path)) {
                lpcfg_string_set(ServicePtrs[i], &ServicePtrs[i]->path,
index 89405f1c8eed77ad3abb82e88b54e11598129d44..46d2cea9e48c14b19f39250dca49e653e6a22fad 100644 (file)
@@ -80,6 +80,9 @@ static bool print_driver_directories_init(void)
        char *driver_path;
        bool ok;
        TALLOC_CTX *mem_ctx = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
+
        const char *dir_list[] = {
                "W32X86/PCC",
                "x64/PCC",
@@ -94,7 +97,7 @@ static bool print_driver_directories_init(void)
                return true;
        }
 
-       driver_path = lp_path(mem_ctx, service);
+       driver_path = lp_path(mem_ctx, lp_sub, service);
        if (driver_path == NULL) {
                talloc_free(mem_ctx);
                return false;
@@ -987,6 +990,8 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
                                   WERROR *perr)
 {
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        int cversion = -1;
        NTSTATUS          nt_status;
        struct smb_filename *smb_fname = NULL;
@@ -1028,7 +1033,7 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
                return -1;
        }
 
-       printdollar_path = lp_path(frame, printdollar_snum);
+       printdollar_path = lp_path(frame, lp_sub, printdollar_snum);
        if (printdollar_path == NULL) {
                *perr = WERR_NOT_ENOUGH_MEMORY;
                TALLOC_FREE(frame);
@@ -1477,6 +1482,8 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info
                                    const char *driver_directory)
 {
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct spoolss_AddDriverInfo3 *driver;
        struct spoolss_AddDriverInfo3 converted_driver;
        const char *short_architecture;
@@ -1527,7 +1534,7 @@ WERROR move_driver_to_download_area(const struct auth_session_info *session_info
 
        nt_status = create_conn_struct_tos_cwd(global_messaging_context(),
                                               printdollar_snum,
-                                              lp_path(frame, printdollar_snum),
+                                              lp_path(frame, lp_sub, printdollar_snum),
                                               session_info,
                                               &c);
        if (!NT_STATUS_IS_OK(nt_status)) {
@@ -2041,6 +2048,8 @@ bool delete_driver_files(const struct auth_session_info *session_info,
                         const struct spoolss_DriverInfo8 *r)
 {
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        const char *short_arch;
        struct conn_struct_tos *c = NULL;
        connection_struct *conn = NULL;
@@ -2069,7 +2078,7 @@ bool delete_driver_files(const struct auth_session_info *session_info,
 
        nt_status = create_conn_struct_tos_cwd(global_messaging_context(),
                                               printdollar_snum,
-                                              lp_path(frame, printdollar_snum),
+                                              lp_path(frame, lp_sub, printdollar_snum),
                                               session_info,
                                               &c);
        if (!NT_STATUS_IS_OK(nt_status)) {
index 0f4db52e0110795f63dba8e2a19a83113ffee3cd..18c7ca0616c04ccf38bee1af1bda8c41673ffb72 100644 (file)
@@ -2688,6 +2688,8 @@ static WERROR print_job_checks(const struct auth_session_info *server_info,
                               int snum, int *njobs)
 {
        const char *sharename = lp_const_servicename(snum);
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        uint64_t dspace, dsize;
        uint64_t minspace;
        int ret;
@@ -2708,7 +2710,7 @@ static WERROR print_job_checks(const struct auth_session_info *server_info,
        /* see if we have sufficient disk space */
        if (lp_min_print_space(snum)) {
                minspace = lp_min_print_space(snum);
-               ret = sys_fsusage(lp_path(talloc_tos(), snum), &dspace, &dsize);
+               ret = sys_fsusage(lp_path(talloc_tos(), lp_sub, snum), &dspace, &dsize);
                if (ret == 0 && dspace < 2*minspace) {
                        DEBUG(3, ("print_job_checks: "
                                  "disk space check failed.\n"));
@@ -2743,6 +2745,8 @@ static WERROR print_job_spool_file(int snum, uint32_t jobid,
                                   const char *output_file,
                                   struct printjob *pjob)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        WERROR werr;
        SMB_STRUCT_STAT st;
        const char *path;
@@ -2754,7 +2758,7 @@ static WERROR print_job_spool_file(int snum, uint32_t jobid,
         * Verify that the file name is ok, within path, and it is
         * already already there */
        if (output_file) {
-               path = lp_path(talloc_tos(), snum);
+               path = lp_path(talloc_tos(), lp_sub, snum);
                len = strlen(path);
                if (strncmp(output_file, path, len) == 0 &&
                    (output_file[len - 1] == '/' || output_file[len] == '/')) {
@@ -2783,7 +2787,7 @@ static WERROR print_job_spool_file(int snum, uint32_t jobid,
        }
 
        slprintf(pjob->filename, sizeof(pjob->filename)-1,
-                "%s/%sXXXXXX", lp_path(talloc_tos(), snum),
+                "%s/%sXXXXXX", lp_path(talloc_tos(), lp_sub, snum),
                 PRINT_SPOOL_PREFIX);
        mask = umask(S_IRWXO | S_IRWXG);
        pjob->fd = mkstemp(pjob->filename);
@@ -2823,6 +2827,8 @@ WERROR print_job_start(const struct auth_session_info *server_info,
        struct printjob pjob;
        const char *sharename = lp_const_servicename(snum);
        struct tdb_print_db *pdb = get_print_db_byname(sharename);
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        int njobs;
        WERROR werr;
 
@@ -2830,7 +2836,7 @@ WERROR print_job_start(const struct auth_session_info *server_info,
                return WERR_INTERNAL_DB_CORRUPTION;
        }
 
-       path = lp_path(talloc_tos(), snum);
+       path = lp_path(talloc_tos(), lp_sub, snum);
 
        werr = print_job_checks(server_info, msg_ctx, snum, &njobs);
        if (!W_ERROR_IS_OK(werr)) {
index 9d565de120ad44ecdc37f0051017da6a1b928d07..68e94fd163528e47c6cbbb5aa3badfc05e59eaa4 100644 (file)
@@ -57,6 +57,8 @@ NTSTATUS print_spool_open(files_struct *fsp,
                          const char *fname,
                          uint64_t current_vuid)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        NTSTATUS status;
        TALLOC_CTX *tmp_ctx;
        struct print_file_data *pf;
@@ -119,6 +121,7 @@ NTSTATUS print_spool_open(files_struct *fsp,
 
        pf->filename = talloc_asprintf(pf, "%s/%sXXXXXX",
                                        lp_path(talloc_tos(),
+                                               lp_sub,
                                                SNUM(fsp->conn)),
                                        PRINT_SPOOL_PREFIX);
        if (!pf->filename) {
index 925b68e9fa2cb3d23ac5ef410b4bb90dc12841b7..aebd9c0c753d20103ba4e655f015901ea9575985 100644 (file)
@@ -286,12 +286,14 @@ static NTSTATUS fss_conn_create_tos(struct messaging_context *msg_ctx,
                                    int snum,
                                    struct connection_struct **conn_out)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct conn_struct_tos *c = NULL;
        NTSTATUS status;
 
        status = create_conn_struct_tos(msg_ctx,
                                        snum,
-                                       lp_path(talloc_tos(), snum),
+                                       lp_path(talloc_tos(), lp_sub, snum),
                                        session_info,
                                        &c);
        if (!NT_STATUS_IS_OK(status)) {
@@ -730,6 +732,8 @@ uint32_t _fss_AddToShadowCopySet(struct pipes_struct *p,
        struct connection_struct *conn;
        NTSTATUS status;
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
 
        if (!fss_permitted(p)) {
                ret = HRES_ERROR_V(HRES_E_ACCESSDENIED);
@@ -755,7 +759,7 @@ uint32_t _fss_AddToShadowCopySet(struct pipes_struct *p,
                goto err_tmp_free;
        }
 
-       path_name = lp_path(frame, snum);
+       path_name = lp_path(frame, lp_sub, snum);
        if (path_name == NULL) {
                ret = HRES_ERROR_V(HRES_E_OUTOFMEMORY);
                goto err_tmp_free;
@@ -1325,6 +1329,8 @@ uint32_t _fss_IsPathSupported(struct pipes_struct *p,
        struct connection_struct *conn;
        char *share;
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
 
        if (!fss_permitted(p)) {
                TALLOC_FREE(frame);
@@ -1355,7 +1361,7 @@ uint32_t _fss_IsPathSupported(struct pipes_struct *p,
                return HRES_ERROR_V(HRES_E_ACCESSDENIED);
        }
        status = SMB_VFS_SNAP_CHECK_PATH(conn, frame,
-                                        lp_path(frame, snum),
+                                        lp_path(frame, lp_sub, snum),
                                         &base_vol);
        unbecome_user_without_service();
        if (!NT_STATUS_IS_OK(status)) {
index 81114ce6513fe342ef22e2833bd22152bd92b977..04287008a5cb4242bb1d2485ce97eaa977f20e8c 100644 (file)
@@ -151,6 +151,8 @@ static NTSTATUS create_mdssvc_policy_handle(TALLOC_CTX *mem_ctx,
 
 void _mdssvc_open(struct pipes_struct *p, struct mdssvc_open *r)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        int snum;
        char *outpath = discard_const_p(char, r->out.share_path);
        char *path;
@@ -168,7 +170,7 @@ void _mdssvc_open(struct pipes_struct *p, struct mdssvc_open *r)
                return;
        }
 
-       path = lp_path(talloc_tos(), snum);
+       path = lp_path(talloc_tos(), lp_sub, snum);
        if (path == NULL) {
                DBG_ERR("Couldn't create policy handle for %s\n",
                        r->in.share_name);
index 1280cc90f69f96a7179d824e0039a7cbf633a89c..65f0f1ffa4762d132d4e2f3bfbe2f8a02456e54e 100644 (file)
@@ -229,7 +229,7 @@ static void init_srv_share_info_1(struct pipes_struct *p,
        if (remark) {
                remark = talloc_sub_full(
                        p->mem_ctx, lp_servicename(talloc_tos(), snum),
-                       get_current_username(), lp_path(talloc_tos(), snum),
+                       get_current_username(), lp_path(talloc_tos(), lp_sub, snum),
                        p->session_info->unix_token->uid, get_current_username(),
                        "", remark);
        }
@@ -259,12 +259,12 @@ static void init_srv_share_info_2(struct pipes_struct *p,
        if (remark) {
                remark = talloc_sub_full(
                        p->mem_ctx, lp_servicename(talloc_tos(), snum),
-                       get_current_username(), lp_path(talloc_tos(), snum),
+                       get_current_username(), lp_path(talloc_tos(), lp_sub, snum),
                        p->session_info->unix_token->uid, get_current_username(),
                        "", remark);
        }
        path = talloc_asprintf(p->mem_ctx,
-                       "C:%s", lp_path(talloc_tos(), snum));
+                       "C:%s", lp_path(talloc_tos(), lp_sub, snum));
 
        if (path) {
                /*
@@ -326,7 +326,7 @@ static void init_srv_share_info_501(struct pipes_struct *p,
        if (remark) {
                remark = talloc_sub_full(
                        p->mem_ctx, lp_servicename(talloc_tos(), snum),
-                       get_current_username(), lp_path(talloc_tos(), snum),
+                       get_current_username(), lp_path(talloc_tos(), lp_sub, snum),
                        p->session_info->unix_token->uid, get_current_username(),
                        "", remark);
        }
@@ -362,11 +362,11 @@ static void init_srv_share_info_502(struct pipes_struct *p,
        if (remark) {
                remark = talloc_sub_full(
                        p->mem_ctx, lp_servicename(talloc_tos(), snum),
-                       get_current_username(), lp_path(talloc_tos(), snum),
+                       get_current_username(), lp_path(talloc_tos(), lp_sub, snum),
                        p->session_info->unix_token->uid, get_current_username(),
                        "", remark);
        }
-       path = talloc_asprintf(ctx, "C:%s", lp_path(talloc_tos(), snum));
+       path = talloc_asprintf(ctx, "C:%s", lp_path(talloc_tos(), lp_sub, snum));
        if (path) {
                /*
                 * Change / to \\ so that win2k will see it as a valid path.  This was added to
@@ -405,7 +405,7 @@ static void init_srv_share_info_1004(struct pipes_struct *p,
        if (remark) {
                remark = talloc_sub_full(
                        p->mem_ctx, lp_servicename(talloc_tos(), snum),
-                       get_current_username(), lp_path(talloc_tos(), snum),
+                       get_current_username(), lp_path(talloc_tos(), lp_sub, snum),
                        p->session_info->unix_token->uid, get_current_username(),
                        "", remark);
        }
@@ -1140,6 +1140,8 @@ static WERROR init_srv_conn_info_1(const char *name,
                                   uint32_t *resume_handle_p,
                                   uint32_t *total_entries)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        uint32_t num_entries = 0;
        int snum = 0;
        uint32_t resume_handle = resume_handle_p ? *resume_handle_p : 0;
@@ -1248,7 +1250,7 @@ static WERROR init_srv_conn_info_1(const char *name,
                 */
 
                count_share_opens(ctr1->array, svrid_arr,
-                                 lp_path(talloc_tos(), snum),
+                                 lp_path(talloc_tos(), lp_sub, snum),
                                  num_entries, *total_entries);
 
        }
@@ -1793,7 +1795,7 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p,
 
        switch (r->in.level) {
        case 1:
-               pathname = lp_path(ctx, snum);
+               pathname = lp_path(ctx, lp_sub, snum);
                comment = talloc_strdup(ctx, info->info1->comment);
                type = info->info1->type;
                psd = NULL;
@@ -1822,7 +1824,7 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p,
                map_generic_share_sd_bits(psd);
                break;
        case 1004:
-               pathname = lp_path(ctx, snum);
+               pathname = lp_path(ctx, lp_sub, snum);
                comment = talloc_strdup(ctx, info->info1004->comment);
                type = STYPE_DISKTREE;
                break;
@@ -1842,7 +1844,7 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p,
                        csc_policy_changed = true;
                }
 
-               pathname = lp_path(ctx, snum);
+               pathname = lp_path(ctx, lp_sub, snum);
                comment = lp_comment(ctx, lp_sub, snum);
                type = STYPE_DISKTREE;
                break;
@@ -1850,7 +1852,7 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p,
        case 1007:
                return WERR_ACCESS_DENIED;
        case 1501:
-               pathname = lp_path(ctx, snum);
+               pathname = lp_path(ctx, lp_sub, snum);
                comment = lp_comment(ctx, lp_sub, snum);
                psd = info->info1501->sd;
                map_generic_share_sd_bits(psd);
@@ -1891,7 +1893,7 @@ WERROR _srvsvc_NetShareSetInfo(struct pipes_struct *p,
 
        /* Only call modify function if something changed. */
 
-       if (strcmp(path, lp_path(talloc_tos(), snum))
+       if (strcmp(path, lp_path(talloc_tos(), lp_sub, snum))
                        || strcmp(comment, lp_comment(talloc_tos(), lp_sub, snum))
                        || (lp_max_connections(snum) != max_connections)
                        || csc_policy_changed) {
@@ -2333,6 +2335,8 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
                                  struct srvsvc_NetGetFileSecurity *r)
 {
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct smb_filename *smb_fname = NULL;
        size_t sd_size;
        char *servicename = NULL;
@@ -2365,7 +2369,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
 
        nt_status = create_conn_struct_tos_cwd(global_messaging_context(),
                                               snum,
-                                              lp_path(frame, snum),
+                                              lp_path(frame, lp_sub, snum),
                                               p->session_info,
                                               &c);
        if (!NT_STATUS_IS_OK(nt_status)) {
@@ -2465,6 +2469,8 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
                                  struct srvsvc_NetSetFileSecurity *r)
 {
        TALLOC_CTX *frame = talloc_stackframe();
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct smb_filename *smb_fname = NULL;
        char *servicename = NULL;
        files_struct *fsp = NULL;
@@ -2499,7 +2505,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
 
        nt_status = create_conn_struct_tos_cwd(global_messaging_context(),
                                               snum,
-                                              lp_path(frame, snum),
+                                              lp_path(frame, lp_sub, snum),
                                               p->session_info,
                                               &c);
        if (!NT_STATUS_IS_OK(nt_status)) {
index 0a3e1073eb6cdca71c07669600b0815b954277db..679f46364313e049ceb5dd261386435d21e2a23f 100644 (file)
@@ -1920,7 +1920,7 @@ static int fill_share_info(connection_struct *conn, int snum, int uLevel,
                        len += StrlenExpanded(conn,snum,lp_comment(talloc_tos(), lp_sub, snum));
                }
                if (uLevel > 1) {
-                       len += strlen(lp_path(talloc_tos(), snum)) + 1;
+                       len += strlen(lp_path(talloc_tos(), lp_sub, snum)) + 1;
                }
                if (buflen) {
                        *buflen = struct_len;
@@ -1972,7 +1972,7 @@ static int fill_share_info(connection_struct *conn, int snum, int uLevel,
                SSVALS(p,22,-1);                /* max uses */
                SSVAL(p,24,1); /* current uses */
                SIVAL(p,26,PTR_DIFF(p2,baseaddr)); /* local pathname */
-               len += CopyAndAdvance(&p2,lp_path(talloc_tos(),snum),&l2);
+               len += CopyAndAdvance(&p2,lp_path(talloc_tos(),lp_sub, snum),&l2);
                memset(p+30,0,SHPWLEN+2); /* passwd (reserved), pad field */
        }
 
index 45015cae140a05e9eed3b6eca8967e0d61ee68fd..0e865829751a56329b2c16edfab539900c5f97e2 100644 (file)
@@ -1115,7 +1115,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
 
        status = create_conn_struct_tos_cwd(global_messaging_context(),
                                            snum,
-                                           lp_path(frame, snum),
+                                           lp_path(frame, lp_sub, snum),
                                            NULL,
                                            &c);
        if (!NT_STATUS_IS_OK(status)) {
@@ -1320,6 +1320,8 @@ static bool junction_to_local_path_tos(const struct junction_map *jucn,
                                       char **pp_path_out,
                                       connection_struct **conn_out)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct conn_struct_tos *c = NULL;
        int snum;
        char *path_out = NULL;
@@ -1331,7 +1333,7 @@ static bool junction_to_local_path_tos(const struct junction_map *jucn,
        }
        status = create_conn_struct_tos_cwd(global_messaging_context(),
                                            snum,
-                                           lp_path(talloc_tos(), snum),
+                                           lp_path(talloc_tos(), lp_sub, snum),
                                            NULL,
                                            &c);
        if (!NT_STATUS_IS_OK(status)) {
@@ -1340,7 +1342,7 @@ static bool junction_to_local_path_tos(const struct junction_map *jucn,
 
        path_out = talloc_asprintf(c,
                        "%s/%s",
-                       lp_path(talloc_tos(), snum),
+                       lp_path(talloc_tos(), lp_sub, snum),
                        jucn->volume_name);
        if (path_out == NULL) {
                TALLOC_FREE(c);
@@ -1503,7 +1505,7 @@ static int count_dfs_links(TALLOC_CTX *ctx, int snum)
        DIR *dirp = NULL;
        const char *dname = NULL;
        char *talloced = NULL;
-       const char *connect_path = lp_path(frame, snum);
+       const char *connect_path = lp_path(frame, lp_sub, snum);
        const char *msdfs_proxy = lp_msdfs_proxy(frame, lp_sub, snum);
        struct conn_struct_tos *c = NULL;
        connection_struct *conn = NULL;
@@ -1595,7 +1597,7 @@ static int form_junctions(TALLOC_CTX *ctx,
        DIR *dirp = NULL;
        const char *dname = NULL;
        char *talloced = NULL;
-       const char *connect_path = lp_path(frame, snum);
+       const char *connect_path = lp_path(frame, lp_sub, snum);
        char *service_name = lp_servicename(frame, snum);
        const char *msdfs_proxy = lp_msdfs_proxy(frame, lp_sub, snum);
        struct conn_struct_tos *c = NULL;
index 0576d2563ebaf3199acce8d5b2178f950f10156e..284a4aba778522912be1d5ce1bb972b72b3dc1ed 100644 (file)
@@ -109,6 +109,8 @@ void invalidate_vuid(struct smbd_server_connection *sconn, uint64_t vuid)
 
 int register_homes_share(const char *username)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        int result;
        struct passwd *pwd;
 
@@ -116,7 +118,7 @@ int register_homes_share(const char *username)
        if (result != -1) {
                DEBUG(3, ("Using static (or previously created) service for "
                          "user '%s'; path = '%s'\n", username,
-                         lp_path(talloc_tos(), result)));
+                         lp_path(talloc_tos(), lp_sub, result)));
                return result;
        }
 
index e1a718b6d91813e908ec3bfbb83b829ee26b48c3..0d220903decd1c4eec0a958edcb45b07c4164857 100644 (file)
@@ -624,7 +624,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
                                        conn->session_info->unix_token->gid,
                                        conn->session_info->unix_info->sanitized_username,
                                        conn->session_info->info->domain_name,
-                                       lp_path(talloc_tos(), snum));
+                                       lp_path(talloc_tos(), lp_sub, snum));
                if (!s) {
                        status = NT_STATUS_NO_MEMORY;
                        goto err_root_exit;
index c9e115292b3cacdde0fa85c5ac1404e8863735e3..d5f6beddb88c59790441c477bf4823905a190dc8 100644 (file)
@@ -114,6 +114,8 @@ static bool net_vfs_make_session_info(struct auth_session_info **session_info)
 
 static int net_vfs_init(struct net_context *c, int argc, const char **argv)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        const char *service = NULL;
        char *share_root = NULL;
        int snum;
@@ -166,7 +168,7 @@ static int net_vfs_init(struct net_context *c, int argc, const char **argv)
                goto done;
        }
 
-       share_root = lp_path(state.mem_ctx, snum);
+       share_root = lp_path(state.mem_ctx, lp_sub, snum);
        if (share_root == NULL) {
                fprintf(stderr, "Failed to find share root for service: %s\n",
                        service);