Browse Source

Access wildcard

Serj Kalichev 11 years ago
parent
commit
2941f06afa
1 changed files with 7 additions and 0 deletions
  1. 7 0
      clish/builtin/hook_access.c

+ 7 - 0
clish/builtin/hook_access.c

@@ -50,6 +50,11 @@ CLISH_HOOK_ACCESS(clish_hook_access)
 	/* The allowed groups are indicated by a colon-separated (:) list. */
 	/* The allowed groups are indicated by a colon-separated (:) list. */
 	for (tmp_access = strtok_r(full_access, ":", &saveptr);
 	for (tmp_access = strtok_r(full_access, ":", &saveptr);
 		tmp_access; tmp_access = strtok_r(NULL, ":", &saveptr)) {
 		tmp_access; tmp_access = strtok_r(NULL, ":", &saveptr)) {
+		/* Check for the "*" wildcard */
+		if (0 == strcmp("*", tmp_access)) {
+			allowed = BOOL_TRUE;
+			break;
+		}
 		/* The internal loop goes trough the system group list */
 		/* The internal loop goes trough the system group list */
 		for (i = 0; i < num_groups; i++) {
 		for (i = 0; i < num_groups; i++) {
 			struct group *ptr = lub_db_getgrgid(group_list[i]);
 			struct group *ptr = lub_db_getgrgid(group_list[i]);
@@ -63,6 +68,8 @@ CLISH_HOOK_ACCESS(clish_hook_access)
 			}
 			}
 			free(ptr);
 			free(ptr);
 		}
 		}
+		if (BOOL_TRUE == allowed)
+			break;
 	}
 	}
 
 
 	lub_string_free(full_access);
 	lub_string_free(full_access);