<samba:parameter name="path"
context="S"
type="string"
+ substitution="1"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<synonym>directory</synonym>
<description>
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;
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,
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",
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;
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;
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);
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;
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)) {
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;
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)) {
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;
/* 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"));
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;
* 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] == '/')) {
}
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);
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;
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)) {
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;
pf->filename = talloc_asprintf(pf, "%s/%sXXXXXX",
lp_path(talloc_tos(),
+ lp_sub,
SNUM(fsp->conn)),
PRINT_SPOOL_PREFIX);
if (!pf->filename) {
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)) {
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);
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;
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);
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)) {
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;
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);
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);
}
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) {
/*
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);
}
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
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);
}
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;
*/
count_share_opens(ctr1->array, svrid_arr,
- lp_path(talloc_tos(), snum),
+ lp_path(talloc_tos(), lp_sub, snum),
num_entries, *total_entries);
}
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;
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;
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;
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);
/* 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) {
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;
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)) {
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;
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)) {
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;
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 */
}
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)) {
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;
}
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)) {
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);
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;
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;
int register_homes_share(const char *username)
{
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
int result;
struct passwd *pwd;
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;
}
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;
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;
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);