Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fvbe.git;a=commitdiff;h=48dadc44c2513702dcdc28ead8b6340981550b17
commit 48dadc44c2513702dcdc28ead8b6340981550b17 Author: James Buren <[email protected]> Date: Fri Apr 5 10:19:57 2013 -0500 update hostname validation and text about valid contents diff --git a/src/text.h b/src/text.h index bb48d9a..0a907ac 100644 --- a/src/text.h +++ b/src/text.h @@ -84,7 +84,7 @@ #define HOSTNAME_ENTRY_TEXT _("Hostname") #define PRETTY_HOSTNAME_ENTRY_TEXT _("Pretty Hostname") #define HOST_ERROR_TITLE _("Invalid Machine Name Entry") -#define HOST_ERROR_TEXT _("You have entered invalid data for machine names.\nBoth names must not be empty strings.\nThe hostname may only have contain lowercase letters and hyphens.\n") +#define HOST_ERROR_TEXT _("You have entered invalid data for machine names.\nBoth names must not be empty strings.\nThe hostname may only contain ASCII letters, hyphens, and digits.\nIt cannot start or end with a hyphen.\nIt cannot contain all digits.\nIt cannot be greater than 64 characters long.\n") #define ROOT_TITLE _("Root Password Setup") #define ROOT_TEXT _("Enter a password for the root user.\nIt must be at least 6 characters long.\n") #define NAME_ENTRY_TEXT _("Real Name") diff --git a/src/ui_newt.c b/src/ui_newt.c index b810252..c8ebf26 100644 --- a/src/ui_newt.c +++ b/src/ui_newt.c @@ -2084,7 +2084,7 @@ extern bool ui_window_host(char **hostname,char **prettyhostname) if(es.reason == NEWT_EXIT_COMPONENT && es.u.co == next) { - if(strlen(name1) == 0 || strlen(name2) == 0 || *(name1+strspn(name1,LOWER_CHARS "-")) != 0) + if(strlen(name1) == 0 || strlen(name2) == 0 || !ishostname(name1)) { ui_dialog_text(HOST_ERROR_TITLE,HOST_ERROR_TEXT); continue; _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
