1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Ensure %S gets expanded in read/write lists.

Jeremy.
(This used to be commit 7d7096fc3a)
This commit is contained in:
Jeremy Allison 2003-09-26 21:03:32 +00:00
parent 26e4e6208a
commit 05b178ab82

View File

@ -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 */