summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-12-17 09:05:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:40 -0500
commited0131feddefa322f6b0a1f82cc7ce0ba3b1b948 (patch)
tree78a4e2dc59fbec46564e43508ce3ed12edcd1910 /source3
parent45d397b673de2590eb33e72a5f1d2b1ccfd3c208 (diff)
downloadsamba-ed0131feddefa322f6b0a1f82cc7ce0ba3b1b948.tar.gz
samba-ed0131feddefa322f6b0a1f82cc7ce0ba3b1b948.tar.bz2
samba-ed0131feddefa322f6b0a1f82cc7ce0ba3b1b948.zip
r4251: AFS does not cope with spaces in file names. Implement a stupid mapping that
maps the space to another character choosable by afsacl:space. Volker P.S: Who is "OH"? ;-) (This used to be commit e717ff70c6ce15bad7a792a592b42ecd057acc01)
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_afsacl.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c
index f4b254a109..bb82801a00 100644
--- a/source3/modules/vfs_afsacl.c
+++ b/source3/modules/vfs_afsacl.c
@@ -37,6 +37,8 @@ extern DOM_SID global_sid_Builtin_Backup_Operators;
extern DOM_SID global_sid_Authenticated_Users;
extern DOM_SID global_sid_NULL;
+static char space_replacement = '%';
+
extern int afs_syscall(int, char *, int, char *, int);
struct afs_ace {
@@ -260,10 +262,12 @@ static BOOL parse_afs_acl(struct afs_acl *acl, const char *acl_str)
for (aces = nplus+nminus; aces > 0; aces--)
{
- const char *name;
+ const char *namep;
+ fstring name;
uint32 rights;
+ char *space;
- name = p;
+ namep = p;
if ((p = strchr(p, '\t')) == NULL)
return False;
@@ -277,6 +281,11 @@ static BOOL parse_afs_acl(struct afs_acl *acl, const char *acl_str)
return False;
p += 1;
+ fstrcpy(name, namep);
+
+ while ((space = strchr_m(name, space_replacement)) != NULL)
+ *space = ' ';
+
add_afs_ace(acl, nplus>0, name, rights);
nplus -= 1;
@@ -709,6 +718,7 @@ static BOOL nt_to_afs_acl(const char *filename,
fstring dom_name;
fstring name;
enum SID_NAME_USE name_type;
+ char *p;
if (ace->type != SEC_ACE_TYPE_ACCESS_ALLOWED) {
/* First cut: Only positive ACEs */
@@ -763,6 +773,9 @@ static BOOL nt_to_afs_acl(const char *filename,
}
}
+ while ((p = strchr_m(name, ' ')) != NULL)
+ *p = space_replacement;
+
add_afs_ace(afs_acl, True, name,
nt_to_afs_rights(filename, ace));
}
@@ -982,9 +995,26 @@ BOOL afsacl_set_nt_acl(vfs_handle_struct *handle,
return afs_set_nt_acl(handle, fsp, security_info_sent, psd);
}
+static int afsacl_connect(vfs_handle_struct *handle,
+ connection_struct *conn,
+ const char *service,
+ const char *user)
+{
+ char *spc;
+
+ spc = lp_parm_const_string(SNUM(handle->conn), "afsacl", "space", "%");
+
+ if (spc != NULL)
+ space_replacement = spc[0];
+
+ return SMB_VFS_NEXT_CONNECT(handle, conn, service, user);
+}
+
/* VFS operations structure */
static vfs_op_tuple afsacl_ops[] = {
+ {SMB_VFS_OP(afsacl_connect), SMB_VFS_OP_CONNECT,
+ SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(afsacl_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(afsacl_get_nt_acl), SMB_VFS_OP_GET_NT_ACL,