summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_xattr.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-03-20 16:40:09 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-03-20 16:40:09 +0100
commitca202cf464aec82e63be4b2160f394f56b8c195e (patch)
tree58b432b7d67c5cf3b35a16c7df9b028d39e3b3a5 /source3/libsmb/libsmb_xattr.c
parent44787565715f0622cc1d049854427d735ca1c14b (diff)
parent2de464a7658f91d2d01087080b984d52c3483426 (diff)
downloadsamba-ca202cf464aec82e63be4b2160f394f56b8c195e.tar.gz
samba-ca202cf464aec82e63be4b2160f394f56b8c195e.tar.bz2
samba-ca202cf464aec82e63be4b2160f394f56b8c195e.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into displaysec
Diffstat (limited to 'source3/libsmb/libsmb_xattr.c')
-rw-r--r--source3/libsmb/libsmb_xattr.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c
index 70fbc27883..e4a0a05586 100644
--- a/source3/libsmb/libsmb_xattr.c
+++ b/source3/libsmb/libsmb_xattr.c
@@ -166,7 +166,7 @@ sort_acl(SEC_ACL *the_acl)
/* convert a SID to a string, either numeric or username/group */
static void
convert_sid_to_string(struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
fstring str,
bool numeric,
DOM_SID *sid)
@@ -211,7 +211,7 @@ convert_sid_to_string(struct cli_state *ipc_cli,
/* convert a string to a SID, either numeric or username/group */
static bool
convert_string_to_sid(struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
bool numeric,
DOM_SID *sid,
const char *str)
@@ -255,7 +255,7 @@ done:
/* parse an ACE in the same format as print_ace() */
static bool
parse_ace(struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
SEC_ACE *ace,
bool numeric,
char *str)
@@ -422,7 +422,7 @@ add_ace(SEC_ACL **the_acl,
static SEC_DESC *
sec_desc_parse(TALLOC_CTX *ctx,
struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
bool numeric,
const char *str)
{
@@ -702,7 +702,7 @@ cacl_get(SMBCCTX *context,
TALLOC_CTX *ctx,
SMBCSRV *srv,
struct cli_state *ipc_cli,
- POLICY_HND *pol,
+ struct policy_handle *pol,
char *filename,
char *attr_name,
char *buf,
@@ -891,7 +891,8 @@ cacl_get(SMBCCTX *context,
/* Point to the portion after "system.nt_sec_desc." */
name += 19; /* if (all) this will be invalid but unused */
- if (!cli_resolve_path(ctx, "", cli, filename,
+ if (!cli_resolve_path(ctx, "", context->internal->auth_info,
+ cli, filename,
&targetcli, &targetpath)) {
DEBUG(5, ("cacl_get Could not resolve %s\n",
filename));
@@ -1496,14 +1497,15 @@ cacl_get(SMBCCTX *context,
set the ACLs on a file given an ascii description
*******************************************************/
static int
-cacl_set(TALLOC_CTX *ctx,
- struct cli_state *cli,
- struct cli_state *ipc_cli,
- POLICY_HND *pol,
- const char *filename,
- char *the_acl,
- int mode,
- int flags)
+cacl_set(SMBCCTX *context,
+ TALLOC_CTX *ctx,
+ struct cli_state *cli,
+ struct cli_state *ipc_cli,
+ struct policy_handle *pol,
+ const char *filename,
+ char *the_acl,
+ int mode,
+ int flags)
{
int fnum;
int err = 0;
@@ -1547,8 +1549,9 @@ cacl_set(TALLOC_CTX *ctx,
return -1;
}
- if (!cli_resolve_path(ctx, "", cli, filename,
- &targetcli, &targetpath)) {
+ if (!cli_resolve_path(ctx, "", context->internal->auth_info,
+ cli, filename,
+ &targetcli, &targetpath)) {
DEBUG(5,("cacl_set: Could not resolve %s\n", filename));
errno = ENOENT;
return -1;
@@ -1793,7 +1796,7 @@ SMBC_setxattr_ctx(SMBCCTX *context,
}
if (ipc_srv) {
- ret = cacl_set(talloc_tos(), srv->cli,
+ ret = cacl_set(context, talloc_tos(), srv->cli,
ipc_srv->cli, &ipc_srv->pol, path,
namevalue,
(*namevalue == '*'
@@ -1857,7 +1860,7 @@ SMBC_setxattr_ctx(SMBCCTX *context,
errno = ENOMEM;
ret = -1;
} else {
- ret = cacl_set(talloc_tos(), srv->cli,
+ ret = cacl_set(context, talloc_tos(), srv->cli,
ipc_srv->cli, &ipc_srv->pol, path,
namevalue,
(*namevalue == '*'
@@ -1887,7 +1890,7 @@ SMBC_setxattr_ctx(SMBCCTX *context,
errno = ENOMEM;
ret = -1;
} else {
- ret = cacl_set(talloc_tos(), srv->cli,
+ ret = cacl_set(context, talloc_tos(), srv->cli,
ipc_srv->cli, &ipc_srv->pol, path,
namevalue, SMBC_XATTR_MODE_CHOWN, 0);
}
@@ -1914,7 +1917,7 @@ SMBC_setxattr_ctx(SMBCCTX *context,
errno = ENOMEM;
ret = -1;
} else {
- ret = cacl_set(talloc_tos(), srv->cli,
+ ret = cacl_set(context, talloc_tos(), srv->cli,
ipc_srv->cli, &ipc_srv->pol, path,
namevalue, SMBC_XATTR_MODE_CHGRP, 0);
}
@@ -2216,7 +2219,7 @@ SMBC_removexattr_ctx(SMBCCTX *context,
StrCaseCmp(name, "system.nt_sec_desc.*+") == 0) {
/* Yup. */
- ret = cacl_set(talloc_tos(), srv->cli,
+ ret = cacl_set(context, talloc_tos(), srv->cli,
ipc_srv->cli, &ipc_srv->pol, path,
NULL, SMBC_XATTR_MODE_REMOVE_ALL, 0);
TALLOC_FREE(frame);
@@ -2236,7 +2239,7 @@ SMBC_removexattr_ctx(SMBCCTX *context,
StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0) {
/* Yup. */
- ret = cacl_set(talloc_tos(), srv->cli,
+ ret = cacl_set(context, talloc_tos(), srv->cli,
ipc_srv->cli, &ipc_srv->pol, path,
CONST_DISCARD(char *, name) + 19,
SMBC_XATTR_MODE_REMOVE, 0);