summaryrefslogtreecommitdiff
path: root/source3/utils/net_usershare.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
commitfe72740e8221575921c22030d6d4fcb19201b03b (patch)
tree0b1bb254e23d6541eede8f2ff4494af477fd5566 /source3/utils/net_usershare.c
parentc809eec53fb1d2a36909e4934dff349f91e3359e (diff)
downloadsamba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.gz
samba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.bz2
samba-fe72740e8221575921c22030d6d4fcb19201b03b.zip
loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/utils/net_usershare.c')
-rw-r--r--source3/utils/net_usershare.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c
index b11757a611..153b45e7f8 100644
--- a/source3/utils/net_usershare.c
+++ b/source3/utils/net_usershare.c
@@ -135,7 +135,7 @@ int net_usershare_usage(struct net_context *c, int argc, const char **argv)
static char *get_basepath(TALLOC_CTX *ctx)
{
- char *basepath = talloc_strdup(ctx, lp_usershare_path());
+ char *basepath = lp_usershare_path(ctx);
if (!basepath) {
return NULL;
@@ -174,7 +174,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(),
+ lp_usershare_path(talloc_tos()),
sharename);
if (!us_path) {
TALLOC_FREE(sharename);
@@ -1104,13 +1104,13 @@ int net_usershare(struct net_context *c, int argc, const char **argv)
return -1;
}
- dp = opendir(lp_usershare_path());
+ dp = opendir(lp_usershare_path(talloc_tos()));
if (!dp) {
int err = errno;
d_fprintf(stderr,
_("net usershare: cannot open usershare directory %s. "
"Error %s\n"),
- lp_usershare_path(), strerror(err) );
+ lp_usershare_path(talloc_tos()), strerror(err) );
if (err == EACCES) {
d_fprintf(stderr,
_("You do not have permission to create a "