summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc_sh_acct.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-05-09 23:22:12 +0200
committerKai Blin <kai@samba.org>2008-05-10 09:22:27 +0200
commitf5769109447d8da0f09b102d444a816ad97a00dc (patch)
treefe7b470486ace083b3f48a54334a3db0bb9633d2 /source3/utils/net_rpc_sh_acct.c
parent378527215e663c0c9d36c565a16723e0a1979ea0 (diff)
downloadsamba-f5769109447d8da0f09b102d444a816ad97a00dc.tar.gz
samba-f5769109447d8da0f09b102d444a816ad97a00dc.tar.bz2
samba-f5769109447d8da0f09b102d444a816ad97a00dc.zip
net: Remove globals
(This used to be commit 1e9319cf88b65a2a8d4f5099a1fe5297e405ed2e)
Diffstat (limited to 'source3/utils/net_rpc_sh_acct.c')
-rw-r--r--source3/utils/net_rpc_sh_acct.c78
1 files changed, 48 insertions, 30 deletions
diff --git a/source3/utils/net_rpc_sh_acct.c b/source3/utils/net_rpc_sh_acct.c
index 00a7967f07..15a20891f2 100644
--- a/source3/utils/net_rpc_sh_acct.c
+++ b/source3/utils/net_rpc_sh_acct.c
@@ -14,8 +14,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
#include "includes.h"
#include "utils/net.h"
@@ -25,11 +25,13 @@
* it has modified, it can return 0 for no change.
*/
-static NTSTATUS rpc_sh_acct_do(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_do(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv,
- int (*fn)(TALLOC_CTX *mem_ctx,
+ int (*fn)(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
@@ -100,7 +102,7 @@ static NTSTATUS rpc_sh_acct_do(TALLOC_CTX *mem_ctx,
goto done;
}
- store = fn(mem_ctx, ctx, &info1->info1, &info3->info3,
+ store = fn(c, mem_ctx, ctx, &info1->info1, &info3->info3,
&info12->info12, argc, argv);
if (store <= 0) {
@@ -144,7 +146,8 @@ static NTSTATUS rpc_sh_acct_do(TALLOC_CTX *mem_ctx,
return result;
}
-static int account_show(TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
+static int account_show(struct net_context *c,
+ TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
struct samr_DomInfo12 *i12,
@@ -204,15 +207,17 @@ static int account_show(TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
return 0; /* Don't save */
}
-static NTSTATUS rpc_sh_acct_pol_show(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_pol_show(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv) {
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_show);
}
-static int account_set_badpw(TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
+static int account_set_badpw(struct net_context *c,
+ TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
struct samr_DomInfo12 *i12,
@@ -230,16 +235,18 @@ static int account_set_badpw(TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx,
return 12;
}
-static NTSTATUS rpc_sh_acct_set_badpw(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_set_badpw(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv)
{
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_set_badpw);
}
-static int account_set_lockduration(TALLOC_CTX *mem_ctx,
+static int account_set_lockduration(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
@@ -258,16 +265,18 @@ static int account_set_lockduration(TALLOC_CTX *mem_ctx,
return 12;
}
-static NTSTATUS rpc_sh_acct_set_lockduration(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_set_lockduration(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv)
{
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_set_lockduration);
}
-static int account_set_resetduration(TALLOC_CTX *mem_ctx,
+static int account_set_resetduration(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
@@ -286,16 +295,18 @@ static int account_set_resetduration(TALLOC_CTX *mem_ctx,
return 12;
}
-static NTSTATUS rpc_sh_acct_set_resetduration(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_set_resetduration(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv)
{
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_set_resetduration);
}
-static int account_set_minpwage(TALLOC_CTX *mem_ctx,
+static int account_set_minpwage(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
@@ -314,16 +325,18 @@ static int account_set_minpwage(TALLOC_CTX *mem_ctx,
return 1;
}
-static NTSTATUS rpc_sh_acct_set_minpwage(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_set_minpwage(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv)
{
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_set_minpwage);
}
-static int account_set_maxpwage(TALLOC_CTX *mem_ctx,
+static int account_set_maxpwage(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
@@ -342,16 +355,18 @@ static int account_set_maxpwage(TALLOC_CTX *mem_ctx,
return 1;
}
-static NTSTATUS rpc_sh_acct_set_maxpwage(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_set_maxpwage(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv)
{
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_set_maxpwage);
}
-static int account_set_minpwlen(TALLOC_CTX *mem_ctx,
+static int account_set_minpwlen(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
@@ -370,16 +385,18 @@ static int account_set_minpwlen(TALLOC_CTX *mem_ctx,
return 1;
}
-static NTSTATUS rpc_sh_acct_set_minpwlen(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_set_minpwlen(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv)
{
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_set_minpwlen);
}
-static int account_set_pwhistlen(TALLOC_CTX *mem_ctx,
+static int account_set_pwhistlen(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct samr_DomInfo1 *i1,
struct samr_DomInfo3 *i3,
@@ -398,16 +415,17 @@ static int account_set_pwhistlen(TALLOC_CTX *mem_ctx,
return 1;
}
-static NTSTATUS rpc_sh_acct_set_pwhistlen(TALLOC_CTX *mem_ctx,
+static NTSTATUS rpc_sh_acct_set_pwhistlen(struct net_context *c,
+ TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx,
struct rpc_pipe_client *pipe_hnd,
int argc, const char **argv)
{
- return rpc_sh_acct_do(mem_ctx, ctx, pipe_hnd, argc, argv,
+ return rpc_sh_acct_do(c, mem_ctx, ctx, pipe_hnd, argc, argv,
account_set_pwhistlen);
}
-struct rpc_sh_cmd *net_rpc_acct_cmds(TALLOC_CTX *mem_ctx,
+struct rpc_sh_cmd *net_rpc_acct_cmds(struct net_context *c, TALLOC_CTX *mem_ctx,
struct rpc_sh_ctx *ctx)
{
static struct rpc_sh_cmd cmds[9] = {