/* useful function to allow entering a name instead of a SID and
* looking it up automatically */
-static NTSTATUS name_to_sid(struct rpc_pipe_client *cli,
+static NTSTATUS name_to_sid(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
- struct dom_sid *sid, const char *name)
+ struct dom_sid *sid,
+ const char *name)
{
struct policy_handle pol;
enum lsa_SidType *sid_types;
}
}
-static NTSTATUS cmd_lsa_query_info_policy(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_query_info_policy(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
/* Resolve a list of names to a list of sids */
-static NTSTATUS cmd_lsa_lookup_names(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_lookup_names(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
/* Resolve a list of names to a list of sids */
-static NTSTATUS cmd_lsa_lookup_names_level(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
+static NTSTATUS cmd_lsa_lookup_names_level(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
const char **argv)
{
struct policy_handle pol;
goto done;
}
- for (i = 0; i < argc - 1; i++)
+ for (i = 0; i < argc - 1; i++)
if (!string_to_sid(&sids[i], argv[i + 1])) {
status = NT_STATUS_INVALID_SID;
goto done;
/* Enumerate list of trusted domains */
-static NTSTATUS cmd_lsa_enum_trust_dom(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_enum_trust_dom(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
if (argc == 2 && argv[1]) {
enum_ctx = atoi(argv[2]);
- }
+ }
status = rpccli_lsa_open_policy(cli, mem_ctx, True,
LSA_POLICY_VIEW_LOCAL_INFORMATION,
}
/* Print results: list of names and sids returned in this
- * response. */
+ * response. */
for (i = 0; i < domain_list.count; i++) {
struct dom_sid_buf sid_str;
/* Enumerates privileges */
-static NTSTATUS cmd_lsa_enum_privilege(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_enum_privilege(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
/* Get privilege name */
-static NTSTATUS cmd_lsa_get_dispname(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_get_dispname(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
/* Enumerate the LSA SIDS */
-static NTSTATUS cmd_lsa_enum_sids(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_enum_sids(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
/* Create a new account */
-static NTSTATUS cmd_lsa_create_account(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_create_account(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle dom_pol;
struct policy_handle user_pol;
status = name_to_sid(cli, mem_ctx, &sid, argv[1]);
if (!NT_STATUS_IS_OK(status))
- goto done;
+ goto done;
status = rpccli_lsa_open_policy2(cli, mem_ctx, True,
SEC_FLAG_MAXIMUM_ALLOWED,
/* Enumerate the privileges of an SID */
-static NTSTATUS cmd_lsa_enum_privsaccounts(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_enum_privsaccounts(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle dom_pol;
struct policy_handle user_pol;
status = name_to_sid(cli, mem_ctx, &sid, argv[1]);
if (!NT_STATUS_IS_OK(status))
- goto done;
+ goto done;
status = rpccli_lsa_open_policy2(cli, mem_ctx, True,
SEC_FLAG_MAXIMUM_ALLOWED,
/* Enumerate the privileges of an SID via LsaEnumerateAccountRights */
-static NTSTATUS cmd_lsa_enum_acct_rights(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_enum_acct_rights(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle dom_pol;
NTSTATUS status, result;
status = name_to_sid(cli, mem_ctx, &sid, argv[1]);
if (!NT_STATUS_IS_OK(status))
- goto done;
+ goto done;
status = rpccli_lsa_open_policy2(cli, mem_ctx, True,
SEC_FLAG_MAXIMUM_ALLOWED,
/* add some privileges to a SID via LsaAddAccountRights */
-static NTSTATUS cmd_lsa_add_acct_rights(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_add_acct_rights(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle dom_pol;
NTSTATUS status, result;
status = name_to_sid(cli, mem_ctx, &sid, argv[1]);
if (!NT_STATUS_IS_OK(status))
- goto done;
+ goto done;
status = rpccli_lsa_open_policy2(cli, mem_ctx, True,
SEC_FLAG_MAXIMUM_ALLOWED,
/* remove some privileges to a SID via LsaRemoveAccountRights */
-static NTSTATUS cmd_lsa_remove_acct_rights(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_remove_acct_rights(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle dom_pol;
NTSTATUS status, result;
status = name_to_sid(cli, mem_ctx, &sid, argv[1]);
if (!NT_STATUS_IS_OK(status))
- goto done;
+ goto done;
status = rpccli_lsa_open_policy2(cli, mem_ctx, True,
SEC_FLAG_MAXIMUM_ALLOWED,
/* Get a privilege value given its name */
-static NTSTATUS cmd_lsa_lookup_priv_value(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_lookup_priv_value(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
/* Query LSA security object */
-static NTSTATUS cmd_lsa_query_secobj(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+static NTSTATUS cmd_lsa_query_secobj(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
SEC_FLAG_MAXIMUM_ALLOWED,
&pol);
- if (argc == 2)
+ if (argc == 2)
sscanf(argv[1], "%x", &sec_info);
if (!NT_STATUS_IS_OK(status))
}
static NTSTATUS cmd_lsa_query_trustdominfobysid(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
}
static NTSTATUS cmd_lsa_query_trustdominfobyname(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol;
NTSTATUS status, result;
}
static NTSTATUS cmd_lsa_query_trustdominfo(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx, int argc,
- const char **argv)
+ TALLOC_CTX *mem_ctx,
+ int argc,
+ const char **argv)
{
struct policy_handle pol, trustdom_pol;
NTSTATUS status, result;