[yast-commit] r67469 - in /trunk/nfs-client: VERSION package/yast2-nfs-client.changes src/routines.ycp testsuite/tests/r-check.out testsuite/tests/r-check.ycp testsuite/tests/r-spec.out testsuite/tests/r-spec.ycp
Author: mfilka Date: Fri Feb 17 14:18:54 2012 New Revision: 67469 URL: http://svn.opensuse.org/viewcvs/yast?rev=67469&view=rev Log: IPv6 addresses supported - bnc#719538 Modified: trunk/nfs-client/VERSION trunk/nfs-client/package/yast2-nfs-client.changes trunk/nfs-client/src/routines.ycp trunk/nfs-client/testsuite/tests/r-check.out trunk/nfs-client/testsuite/tests/r-check.ycp trunk/nfs-client/testsuite/tests/r-spec.out trunk/nfs-client/testsuite/tests/r-spec.ycp Modified: trunk/nfs-client/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/VERSION?rev=67469&r1=67468&r2=67469&view=diff ============================================================================== --- trunk/nfs-client/VERSION (original) +++ trunk/nfs-client/VERSION Fri Feb 17 14:18:54 2012 @@ -1 +1 @@ -2.21.4 +2.21.5 Modified: trunk/nfs-client/package/yast2-nfs-client.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/package/yast2-nfs-client.changes?rev=67469&r1=67468&r2=67469&view=diff ============================================================================== --- trunk/nfs-client/package/yast2-nfs-client.changes (original) +++ trunk/nfs-client/package/yast2-nfs-client.changes Fri Feb 17 14:18:54 2012 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Feb 17 13:14:44 UTC 2012 - mfilka@suse.com + +- IPv6 addresses supported - bnc#719538 +- updated testsuite +- 2.21.5 + +------------------------------------------------------------------- Thu Feb 16 13:16:18 UTC 2012 - mfilka@suse.com - removed some dead code, whitespaces Modified: trunk/nfs-client/src/routines.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/src/routines.ycp?rev=67469&r1=67468&r2=67469&view=diff ============================================================================== --- trunk/nfs-client/src/routines.ycp (original) +++ trunk/nfs-client/src/routines.ycp Fri Feb 17 14:18:54 2012 @@ -23,17 +23,29 @@ import "Package"; import "Report"; + import "IP"; + import "String"; /** * @param spec "server:/path/specification" * @return `couple("server", "/path/specification") */ define term SpecToServPath(string spec) ``{ - integer colonpos = findfirstof(spec, ":"); + // split using ":/" (because of IPv6) + integer path_begin = search( spec, ":/"); string serv = ""; - if (colonpos != nil) { - serv = substring(spec, 0, colonpos); - spec = substring(spec, colonpos+1); + + // no :/ inside => <server>: or [/]<path> + if( path_begin == nil ) + { + if(spec == filterchars(spec, "-_." + String::CAlnum() ) + ":") + // matches [a-zA-Z0-1.-_] and ends with colon? => <server>: + path_begin = size( spec) -1; + } + + if (path_begin != nil) { + serv = substring(spec, 0, path_begin); + spec = substring(spec, path_begin+1); } return `couple(serv, spec); } @@ -68,16 +80,22 @@ * @return whether valid */ define boolean CheckHostName(string name) ``{ + string dirname_forbidden = ":"; + if (size(name) > 0 && size(name) < 50 && - name == filterchars(name, - "-_.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")) { + name == filterchars(name, "-_.:" + String::CAlnum() )) { + if( IP::Check( name)) + return true; + if( "" != filterchars( name, dirname_forbidden)) + return false; + return true; } else // error popup message Report::Error (sformat(_("The hostname entered is invalid. It must be shorter than 50 characters and only use -0-9, A-Z, a-z, dots, -, and _."))); +0-9, A-Z, a-z, dots, -, and _.:"))); return false; }; Modified: trunk/nfs-client/testsuite/tests/r-check.out URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/testsuite/tests/r-check.out?rev=67469&r1=67468&r2=67469&view=diff ============================================================================== --- trunk/nfs-client/testsuite/tests/r-check.out (original) +++ trunk/nfs-client/testsuite/tests/r-check.out Fri Feb 17 14:18:54 2012 @@ -14,3 +14,6 @@ Return false Return false Return false +Return true +Return false +Return true Modified: trunk/nfs-client/testsuite/tests/r-check.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/testsuite/tests/r-check.ycp?rev=67469&r1=67468&r2=67469&view=diff ============================================================================== --- trunk/nfs-client/testsuite/tests/r-check.ycp (original) +++ trunk/nfs-client/testsuite/tests/r-check.ycp Fri Feb 17 14:18:54 2012 @@ -19,6 +19,9 @@ string OK_Name = "foo.bar.com.tw"; string TooLongName = "123456789012345678901234567890123456789012345678901234567890"; string IllegalName = "Something:wrong"; + string IPv4 = "192.168.10.1"; + string IPv4_invalid= "192.168.10:1"; + string IPv6 = "fe80::219:d1ff:feac:fd10"; DUMP ("check_options"); TEST (``(check_options ("")), [], nil); @@ -37,5 +40,9 @@ TEST (``(CheckHostName (TooLongName)), [], nil); TEST (``(CheckHostName (IllegalName)), [], nil); // Too long & illegal char - TEST (``(CheckHostName (TooLongName + ":")), [], nil); + TEST (``(CheckHostName (TooLongName + "!")), [], nil); + // check IPv? adresses + TEST (``(CheckHostName (IPv4)), [], nil); + TEST (``(CheckHostName (IPv4_invalid)), [], nil); + TEST (``(CheckHostName (IPv6)), [], nil); } Modified: trunk/nfs-client/testsuite/tests/r-spec.out URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/testsuite/tests/r-spec.out?rev=67469&r1=67468&r2=67469&view=diff ============================================================================== --- trunk/nfs-client/testsuite/tests/r-spec.out (original) +++ trunk/nfs-client/testsuite/tests/r-spec.out Fri Feb 17 14:18:54 2012 @@ -4,5 +4,5 @@ Return `couple ("", "nocolon.only.server.com") Return `couple ("", "/only/path") Return `couple ("", "/nocolon/only/path") -Return `couple ("two", "colons:used") +Return `couple ("fe80::219:d1ff:feac:fd10", "/path") Return `couple ("", "") Modified: trunk/nfs-client/testsuite/tests/r-spec.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/testsuite/tests/r-spec.ycp?rev=67469&r1=67468&r2=67469&view=diff ============================================================================== --- trunk/nfs-client/testsuite/tests/r-spec.ycp (original) +++ trunk/nfs-client/testsuite/tests/r-spec.ycp Fri Feb 17 14:18:54 2012 @@ -22,6 +22,6 @@ TEST (``(SpecToServPath ("nocolon.only.server.com")), [], nil); TEST (``(SpecToServPath (":/only/path")), [], nil); TEST (``(SpecToServPath ("/nocolon/only/path")), [], nil); - TEST (``(SpecToServPath ("two:colons:used")), [], nil); + TEST (``(SpecToServPath ("fe80::219:d1ff:feac:fd10:/path")), [], nil); TEST (``(SpecToServPath ("")), [], nil); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mfilka@svn2.opensuse.org