-/** @brief Return true if @p user is trusted
- * @param user User to look up
- * @return Nonzero if they are in the 'trusted' list
- *
- * Now used only in upgrade from old versions.
- */
-static int trusted(const char *user) {
- int n;
-
- for(n = 0; (n < config->trust.n
- && strcmp(config->trust.s[n], user)); ++n)
- ;
- return n < config->trust.n;
-}
-
-/** @brief Return non-zero for a valid username
- * @param user Candidate username
- * @return Nonzero if it's valid
- *
- * Currently we only allow the letters and digits in ASCII. We could be more
- * liberal than this but it is a nice simple test. It is critical that
- * semicolons are never allowed.
- *
- * NB also used by playlist_parse_name() to validate playlist names!
- */
-int valid_username(const char *user) {
- if(!*user)
- return 0;
- while(*user) {
- const uint8_t c = *user++;
- /* For now we are very strict */
- if((c >= 'a' && c <= 'z')
- || (c >= 'A' && c <= 'Z')
- || (c >= '0' && c <= '9'))
- /* ok */;
- else
- return 0;
- }
- return 1;
-}
-