Hi Alban, On Sat, Apr 02, 2005 at 08:14:01PM +0200, [EMAIL PROTECTED] wrote: > Well i hav not make a patch as the script are not on the disk at > this stage (well the ral reason is i being lazy :)
Telling the right regex is always as good... > # Make sure the domain name is valid > # The regexp doesn't work for UTF-8 domain names, but for that to > # work, we would also need to Base64 encode it in the LDIF; since > # we're not doing it at the moment, this should be fine for now > db_get slapd/domain > if [ -z "$RET" ] || ! echo "$RET" | grep -q '^[a-zA-Z0-9-.]*$'; then > db_fset slapd/domain seen false > invalid=true > fi That code was there since 2.1.30-1 and worked all the time. Not to mention that I am not seeing this problem. Maybe my grep is too old? > the regex domain regex is broken because there is a "-" at the end: > '^[a-zA-Z0-9-.]*$' > echo "test.server" | grep -q '^[a-zA-Z0-9-.]*$' > grep: Invalid range end Interestingly this works here: [EMAIL PROTECTED]:~$ echo "test.server"|grep -q '^[a-zA-Z0-9-.]*$' && echo ok ok What version of grep are you using? And what are you locale settings? > I don't know how to fix since i don't understand the "." at the end of the > range > pattern too. I did not write that code but I suppose it is meant to allow letters, numbers and the characters "-" and ".". Could you perhaps check if [a-zA-Z0-9.-] would work? AFAIK the - at the end of the block is okay. > I would say: > '^\([a-zA-Z0-9]*\.\)\{1,2\}[a-zA-Z0-9]*$' That's really much more complicated and hard to understand. And it really narrows the range of allowed domain names. I am using pclab.ifg.uni-kiel.de at work... Greetings Torsten
signature.asc
Description: Digital signature