char **args, *info[MAX_ARGS_SIZE], *name = argv[1];
int stat;
- if (!ValidName(name))
- return DM_NORMAL;
+ /* Can't use ValidName() because spaces are allowed in container names */
+ if (IS_EMPTY(name))
+ {
+ Put_message("Please use a non-empty name.");
+ return DM_NORMAL;
+ }
+
+ if (strchr(name, '*') || strchr(name, '?'))
+ {
+ Put_message("Wildcards not accepted here.");
+ return DM_NORMAL;
+ }
/* Check if this cluster already exists. */
if ((stat = do_mr_query("get_container", 1, &name, NULL, NULL))
int group_security_flag, char *MoiraId);
int sid_update(LDAP *ldap_handle, char *dn_path);
int check_string(char *s);
+int check_container_name(char* s);
void convert_b_to_a(char *string, UCHAR *binary, int length);
int mr_connect_cl(char *server, char *client, int version, int auth);
return 1;
}
+int check_container_name(char *s)
+{
+ char character;
+
+ for (; *s; s++)
+ {
+ character = *s;
+ if (isupper(character))
+ character = tolower(character);
+
+ if (character == ' ')
+ continue;
+ if (illegalchars[(unsigned) character])
+ return 0;
+ }
+ return 1;
+}
+
int mr_connect_cl(char *server, char *client, int version, int auth)
{
int status;
memset(cName, '\0', sizeof(cName));
container_get_name(after[CONTAINER_NAME], cName);
- if (!check_string(cName))
+ if (!check_container_name(cName))
{
com_err(whoami, 0, "invalid LDAP container name %s", cName);
return(AD_INVALID_NAME);
return(AD_INVALID_NAME);
}
- if (!check_string(cName))
+ if (!check_container_name(cName))
{
com_err(whoami, 0, "invalid LDAP container name %s", cName);
return(AD_INVALID_NAME);
return(AD_INVALID_NAME);
}
- if (!check_string(cName))
+ if (!check_container_name(cName))
{
com_err(whoami, 0, "invalid LDAP container name %s", cName);
return(AD_INVALID_NAME);