From dfa9eef7b6892ceb0e67b0c4bfb56431ead1ac3d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 12 Jul 2005 09:18:50 +0000 Subject: [PATCH] r8366: Root-level files don't have a slash, but acls need to be settable on them. Thanks to Brent Trotter for reminding me to commit this :-) Volker --- source/modules/vfs_afsacl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/modules/vfs_afsacl.c b/source/modules/vfs_afsacl.c index 731ddfa5836..0e2e1295b9f 100644 --- a/source/modules/vfs_afsacl.c +++ b/source/modules/vfs_afsacl.c @@ -891,12 +891,14 @@ static BOOL afs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, pstr_sprintf(name, fsp->fsp_name); if (!fsp->is_directory) { + /* We need to get the name of the directory containing the + * file, this is where the AFS acls live */ char *p = strrchr(name, '/'); - if (p == NULL) { - DEBUG(3, ("No / in file string\n")); - return False; + if (p != NULL) { + *p = '\0'; + } else { + pstrcpy(name, "."); } - *p = '\0'; } if (!afs_get_afs_acl(name, &old_afs_acl)) { -- 2.34.1