2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2N/A * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved 2N/A * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 2N/A * Openvision retains the copyright to derivative works of 2N/A * this source code. Do *NOT* create a derivative of this 2N/A * source code before consulting with your legal department. 2N/A * Do *NOT* integrate *ANY* of this source code into another 2N/A * product before consulting with your legal department. 2N/A * For further information, read the top-level Openvision 2N/A * copyright which is contained in the top-level MIT Kerberos 2N/A * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 2N/A/* XXX Duplicated in kdb5_util! */ 2N/A * Function: glob_to_regexp 2N/A * glob (r) the shell-style glob (?*[]) to convert 2N/A * realm (r) the default realm to append, or NULL 2N/A * regexp (w) the ed-style regexp created from glob 2N/A * regexp is filled in with allocated memory contained a regular 2N/A * shell-style glob would match. If glob does not contain an "@" 2N/A * character and realm is not NULL, "@*" is appended to the regexp. 2N/A * Conversion algorithm: 2N/A * quoted characters are copied quoted 2N/A * ? is converted to . 2N/A * * is converted to .* 2N/A * active characters are quoted: ^, $, . 2N/A * [ and ] are active but supported and have the same meaning, so 2N/A * other characters are copied 2N/A * regexp is anchored with ^ and $ 2N/A /* validate the glob */ 2N/A /* A character of glob can turn into two in regexp, plus ^ and $ */ 2N/A /* and trailing null. If glob has no @, also allocate space for */ 2N/A /* XXX syslog msg or regerr(regerrno) */