Jim Ramsay wrote:

Okay... so we want to find the left-most directory name
which contains a dot... will that do it?

This RE will do it:


"^/(?:[^\./]+/)+([^\./]+\.[^/]+)/(?:[^/]+/)+/?$"

Translation:

  ^/
- To match, a $HOME directory must start with a /

  (?:[^\./]+/)+
- Then there must be at least one directory level without a dot in it

  ([^\./]+\.[^/]+)/
- After one or more of those, there must be a directory level with a dot
  in it.  This is what will be returned as the Domain.

  (?:[^/]+/)+
- Then there must be at least one directory level after that, which may
  or may not contain a dot.

  /?$
- Finally, the string may or may not end with /

That's my final answer. If that won't do, I may make it a ./configure-time option for all virtual user admins to set, with the above as default.

This will break any system with non-virtual users where a normal user's home directory path has a '.' in it somewhere. I don't know if that happens anywhere.

--
Jim Ramsay
"Me fail English?  That's unpossible!"

_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to