2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2N/A * Copyright (c) 2004-2005, Novell, Inc. 2N/A * All rights reserved. 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions are met: 2N/A * * Redistributions of source code must retain the above copyright notice, 2N/A * this list of conditions and the following disclaimer. 2N/A * * Redistributions in binary form must reproduce the above copyright 2N/A * notice, this list of conditions and the following disclaimer in the 2N/A * documentation and/or other materials provided with the distribution. 2N/A * * The copyright holder's name is not used to endorse or promote products 2N/A * derived from this software without specific prior written permission. 2N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2N/A * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2N/A * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2N/A * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2N/A * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2N/A * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2N/A * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2N/A * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2N/A * POSSIBILITY OF SUCH DAMAGE. 2N/A * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A /* Solaris Kerberos: safer macro, added more (), use strlcpy() */ 2N/A /* Solaris Kerberos: access()'s are unsafe and useless */ 2N/A#
if 0
/************** Begin IFDEF'ed OUT *******************************/ 2N/A /* check whether file exists */ 2N/A /* check read access */ 2N/A#
endif /**************** END IFDEF'ed OUT *******************************/ 2N/A /* Solaris Kerberos: using F to deal with 256 open file limit */ 2N/A /* get the record from the file */ 2N/A /* Handle leading white-spaces */ 2N/A /* Handle comment lines */ 2N/A /* replace the \n with \0 */ 2N/A /* password field missing */ 2N/A /* Extract the plain password / certificate file information */ 2N/A /* Check if the entry has the path of a certificate */ 2N/A /* Set *password = {FILE}<path to cert>\0<cert password> */ 2N/A/* Encodes a sequence of bytes in hexadecimal */ 2N/A/* The entry in the password file will have the following format 2N/A * <FQDN of service> = <secret> 2N/A * <secret> := {HEX}<password in hexadecimal> 2N/A * <password> is the actual eDirectory password of the service 2N/A * ERR_NO_MEM - No Memory 2N/A * ERR_PWD_ZERO - Password has zero length 2N/A * ERR_PWD_BAD - Passowrd corrupted 2N/A * ERR_PWD_NOT_HEX - Not a hexadecimal password 2N/A /* Check if it is a hexadecimal encoded password */ 2N/A /* A hexadecimal encoded password should have even length */ 2N/A /* Check if it is a hexadecimal number */