summaryrefslogtreecommitdiff
path: root/source3/smbd/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r--source3/smbd/service.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 44d73b2ab2..e4c3890f86 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -259,23 +259,27 @@ static NTSTATUS share_sanity_checks(int snum, fstring dev)
return NT_STATUS_OK;
}
-
/****************************************************************************
readonly share?
****************************************************************************/
+
static void set_read_only(connection_struct *conn, gid_t *groups, size_t n_groups)
{
char **list;
- char *service = lp_servicename(conn->service);
+ const char *service = lp_servicename(conn->service);
conn->read_only = lp_readonly(conn->service);
- if (!service) return;
+ if (!service)
+ return;
str_list_copy(&list, lp_readlist(conn->service));
if (list) {
- if ( !str_list_sub_basic(list, current_user_info.smb_name) ) {
+ if (!str_list_sub_basic(list, current_user_info.smb_name) ) {
DEBUG(0, ("ERROR: read list substitution failed\n"));
}
+ if (!str_list_substitute(list, "%S", service)) {
+ DEBUG(0, ("ERROR: read list service substitution failed\n"));
+ }
if (user_in_list(conn->user, (const char **)list, groups, n_groups))
conn->read_only = True;
str_list_free(&list);
@@ -283,19 +287,22 @@ static void set_read_only(connection_struct *conn, gid_t *groups, size_t n_group
str_list_copy(&list, lp_writelist(conn->service));
if (list) {
- if ( !str_list_sub_basic(list, current_user_info.smb_name) ) {
+ if (!str_list_sub_basic(list, current_user_info.smb_name) ) {
DEBUG(0, ("ERROR: write list substitution failed\n"));
}
+ if (!str_list_substitute(list, "%S", service)) {
+ DEBUG(0, ("ERROR: write list service substitution failed\n"));
+ }
if (user_in_list(conn->user, (const char **)list, groups, n_groups))
conn->read_only = False;
str_list_free(&list);
}
}
-
/****************************************************************************
admin user check
****************************************************************************/
+
static void set_admin_user(connection_struct *conn, gid_t *groups, size_t n_groups)
{
/* admin user check */