The Samba-Bugzilla – Attachment 4165 Details for
Bug 6371
unsuccessful net conf setparm leaves empty share
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix for bug 6371, adapted to 3-3-test
bug-6371-v3-3-test.patch (text/plain), 1.77 KB, created by
Michael Adam
on 2009-05-17 16:13:16 UTC
(
hide
)
Description:
fix for bug 6371, adapted to 3-3-test
Filename:
MIME Type:
Creator:
Michael Adam
Created:
2009-05-17 16:13:16 UTC
Size:
1.77 KB
patch
obsolete
>From 7078d5ef22dc2b9a16005af2080a02ced8a69945 Mon Sep 17 00:00:00 2001 >From: Michael Adam <obnox@samba.org> >Date: Sun, 17 May 2009 22:15:02 +0200 >Subject: [PATCH] s3:fix bug #6371, unsuccessful net conf setparm leaves empty share > >Wrap creation of share and setting of parameter into a transaction. > >Michael >--- > source/utils/net_conf.c | 28 +++++++++++++++++++++++++--- > 1 files changed, 25 insertions(+), 3 deletions(-) > >diff --git a/source/utils/net_conf.c b/source/utils/net_conf.c >index f6e3712..6e223de 100644 >--- a/source/utils/net_conf.c >+++ b/source/utils/net_conf.c >@@ -781,12 +781,19 @@ static int net_conf_setparm(struct net_context *c, struct smbconf_ctx *conf_ctx, > } > value_str = argv[2]; > >+ werr = smbconf_transaction_start(conf_ctx); >+ if (!W_ERROR_IS_OK(werr)) { >+ d_printf("error starting transaction: %s\n", >+ dos_errstr(werr)); >+ goto done; >+ } >+ > if (!smbconf_share_exists(conf_ctx, service)) { > werr = smbconf_create_share(conf_ctx, service); > if (!W_ERROR_IS_OK(werr)) { > d_fprintf(stderr, "Error creating share '%s': %s\n", > service, dos_errstr(werr)); >- goto done; >+ goto cancel; > } > } > >@@ -795,10 +802,25 @@ static int net_conf_setparm(struct net_context *c, struct smbconf_ctx *conf_ctx, > if (!W_ERROR_IS_OK(werr)) { > d_fprintf(stderr, "Error setting value '%s': %s\n", > param, dos_errstr(werr)); >- goto done; >+ goto cancel; > } > >- ret = 0; >+ werr = smbconf_transaction_commit(conf_ctx); >+ if (!W_ERROR_IS_OK(werr)) { >+ d_printf("error committing transaction: %s\n", >+ dos_errstr(werr)); >+ } else { >+ ret = 0; >+ } >+ >+ goto done; >+ >+cancel: >+ werr = smbconf_transaction_cancel(conf_ctx); >+ if (!W_ERROR_IS_OK(werr)) { >+ d_printf("error cancelling transaction: %s\n", >+ dos_errstr(werr)); >+ } > > done: > TALLOC_FREE(mem_ctx); >-- >1.6.0.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6371
: 4165