1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

smbdotconf: mark "usershare path" with substitution="1"

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Ralph Boehme 2019-11-05 12:14:37 +01:00 committed by Stefan Metzmacher
parent b635c445ad
commit 2dae6473fa
3 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,7 @@
<samba:parameter name="usershare path"
context="G"
type="string"
substitution="1"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
<para>This parameter specifies the absolute path of the directory on the

View File

@ -191,7 +191,7 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out)
}
/* Is it a usershare service ? */
if (iService < 0 && *lp_usershare_path(talloc_tos())) {
if (iService < 0 && *lp_usershare_path(talloc_tos(), lp_sub)) {
/* Ensure the name is canonicalized. */
if (!strlower_m(*p_service_out)) {
goto fail;

View File

@ -135,7 +135,9 @@ int net_usershare_usage(struct net_context *c, int argc, const char **argv)
static char *get_basepath(TALLOC_CTX *ctx)
{
char *basepath = lp_usershare_path(ctx);
const struct loadparm_substitution *lp_sub =
loadparm_s3_global_substitution();
char *basepath = lp_usershare_path(ctx, lp_sub);
if (!basepath) {
return NULL;
@ -152,6 +154,8 @@ static char *get_basepath(TALLOC_CTX *ctx)
static int net_usershare_delete(struct net_context *c, int argc, const char **argv)
{
const struct loadparm_substitution *lp_sub =
loadparm_s3_global_substitution();
char *us_path;
char *sharename;
@ -174,7 +178,7 @@ static int net_usershare_delete(struct net_context *c, int argc, const char **ar
us_path = talloc_asprintf(talloc_tos(),
"%s/%s",
lp_usershare_path(talloc_tos()),
lp_usershare_path(talloc_tos(), lp_sub),
sharename);
if (!us_path) {
TALLOC_FREE(sharename);
@ -1075,6 +1079,8 @@ static int net_usershare_list(struct net_context *c, int argc,
int net_usershare(struct net_context *c, int argc, const char **argv)
{
const struct loadparm_substitution *lp_sub =
loadparm_s3_global_substitution();
DIR *dp;
struct functable func[] = {
@ -1120,13 +1126,13 @@ int net_usershare(struct net_context *c, int argc, const char **argv)
return -1;
}
dp = opendir(lp_usershare_path(talloc_tos()));
dp = opendir(lp_usershare_path(talloc_tos(), lp_sub));
if (!dp) {
int err = errno;
d_fprintf(stderr,
_("net usershare: cannot open usershare directory %s. "
"Error %s\n"),
lp_usershare_path(talloc_tos()), strerror(err) );
lp_usershare_path(talloc_tos(), lp_sub), strerror(err) );
if (err == EACCES) {
d_fprintf(stderr,
_("You do not have permission to create a "