Example #1
0
static void
newuser_getname(char *name)
{

    for (;;) {
	cprintf("\1f\1gUsername: \1w");
	strcpy(name, get_name(2));

	if (strlen(name) < 1)
	    continue;

	if (mono_sql_u_check_user(name) == TRUE) {
	    cprintf("\1rSorry, that name is already taken; try another one.\n");
	    continue;
	}
	if (strlen(name) > 16) {
	    cprintf("\1rSorry, but that name is too long.\n");
	    continue;
	}
	if ((taboo(name)) || EQ(name, "new")) {
	    cprintf("\1rSorry, but we do not accept \1w\"\1y%s\1w\"\1r as name.\n", name);
	    continue;
	}
	cprintf("\1gThe username you entered is \1w'\1r%s\1w'\1g.\n", name);
	cprintf("Are you sure want to use this name?? ");

	if (yesno() == NO) {
	    cprintf("\1yOk, do you want to quit?");
	    if (yesno() == YES) {
		logoff(ULOG_OFF);
	    } else
		continue;
	}
	cprintf("\n");
	break;
    }
    return;
}
Example #2
0
void enforce_taboos(file const& f)
{
    if
        (   f.phyloanalyze("test_coding_rules")
        ||  f.phyloanalyze("^md5sums$")
        )
        {
        return;
        }

    // ASCII copyright symbol requires upper-case 'C'.
    taboo(f, "\\(c\\) *[0-9]");
    // Former addresses of the Free Software Foundation.
    taboo(f, "Cambridge");
    taboo(f, "Temple");
    // Patented.
    taboo(f, "\\.gif", boost::regex::icase);
    // Obsolete email address.
    taboo(f, "*****@*****.**");
    // Obscured email address.
    taboo(f, "address@hidden");
    // Certain proprietary libraries.
    taboo(f, "\\bowl\\b", boost::regex::icase);
    taboo(f, "vtss", boost::regex::icase);
    // Suspiciously specific to msw.
    taboo(f, "Microsoft");
    taboo(f, "Visual [A-Z]");
    taboo(f, "\\bWIN\\b");
    taboo(f, "\\bExcel\\b");
    // Insinuated by certain msw tools.
    taboo(f, "Microsoft Word");
    taboo(f, "Stylus Studio");
    taboo(f, "Sonic Software");
    // This IANA-approved charset is still useful for html.
    if(!f.is_of_phylum(e_html))
        {
        taboo(f, "windows-1252");
        }
    taboo(f, "Arial");

    if
        (   !f.is_of_phylum(e_log)
        &&  !f.is_of_phylum(e_make)
        &&  !f.is_of_phylum(e_synopsis)
        )
        {
        taboo(f, "\\bexe\\b", boost::regex::icase);
        }

    if
        (   !f.is_of_phylum(e_make)
        &&  !f.is_of_phylum(e_patch)
        &&  !f.phyloanalyze("config.hpp")
        &&  !f.phyloanalyze("configure.ac") // GNU libtool uses 'win32-dll'.
        )
        {
        taboo(f, "WIN32", boost::regex::icase);
        }

    if
        (  !boost::regex_search(f.data(), boost::regex(my_taboo_indulgence()))
        && !contains(f.data(), "Automatically generated from custom input.")
        )
        {
        // Unspeakable private taboos.
        std::map<std::string, bool> const z = my_taboos();
        typedef std::map<std::string, bool>::const_iterator mci;
        for(mci i = z.begin(); i != z.end(); ++i)
            {
            boost::regex::flag_type syntax =
                i->second
                ? boost::regex::ECMAScript | boost::regex::icase
                : boost::regex::ECMAScript
                ;
            taboo(f, i->first, syntax);
            }
        }
}