summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/password.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 9ee721089c..e4516be32b 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -381,9 +381,14 @@ BOOL user_ok(const char *user,int snum, gid_t *groups, size_t n_groups)
if (lp_invalid_users(snum)) {
str_list_copy(&invalid, lp_invalid_users(snum));
- if (invalid && str_list_substitute(invalid, "%S", lp_servicename(snum))) {
- if ( invalid && str_list_sub_basic(invalid, current_user_info.smb_name) ) {
- ret = !user_in_list(user, (const char **)invalid, groups, n_groups);
+ if (invalid &&
+ str_list_substitute(invalid, "%S", lp_servicename(snum))) {
+ if ( invalid &&
+ str_list_sub_basic(invalid,
+ current_user_info.smb_name) ) {
+ ret = !user_in_list(user,
+ (const char **)invalid,
+ groups, n_groups);
}
}
}
@@ -392,9 +397,13 @@ BOOL user_ok(const char *user,int snum, gid_t *groups, size_t n_groups)
if (ret && lp_valid_users(snum)) {
str_list_copy(&valid, lp_valid_users(snum));
- if ( valid && str_list_substitute(valid, "%S", lp_servicename(snum)) ) {
- if ( valid && str_list_sub_basic(valid, current_user_info.smb_name) ) {
- ret = user_in_list(user, (const char **)valid, groups, n_groups);
+ if ( valid &&
+ str_list_substitute(valid, "%S", lp_servicename(snum)) ) {
+ if ( valid &&
+ str_list_sub_basic(valid,
+ current_user_info.smb_name) ) {
+ ret = user_in_list(user, (const char **)valid,
+ groups, n_groups);
}
}
}
@@ -403,8 +412,11 @@ BOOL user_ok(const char *user,int snum, gid_t *groups, size_t n_groups)
if (ret && lp_onlyuser(snum)) {
char **user_list = str_list_make (lp_username(snum), NULL);
- if (user_list && str_list_substitute(user_list, "%S", lp_servicename(snum))) {
- ret = user_in_list(user, (const char **)user_list, groups, n_groups);
+ if (user_list &&
+ str_list_substitute(user_list, "%S",
+ lp_servicename(snum))) {
+ ret = user_in_list(user, (const char **)user_list,
+ groups, n_groups);
}
if (user_list) str_list_free (&user_list);
}