keylogin.c revision a0368f78728e5fb66c5c72ecc0b76905897ca79d
2035N/A * The contents of this file are subject to the terms of the 2035N/A * Common Development and Distribution License (the "License"). 2035N/A * You may not use this file except in compliance with the License. 2035N/A * See the License for the specific language governing permissions 2035N/A * and limitations under the License. 2035N/A * When distributing Covered Code, include this CDDL HEADER in each 2035N/A * If applicable, add the following below this CDDL HEADER, with the 2035N/A * fields enclosed by brackets "[]" replaced with your own identifying 2035N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2790N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 3817N/A * Use is subject to license terms. 2035N/A/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 2035N/A * University Copyright- Copyright (c) 1982, 1986, 1988 2035N/A * The Regents of the University of California 2035N/A * University Acknowledgment- Portions of this document are derived from 2035N/A * software developed by the University of California, Berkeley, and its 2820N/A#
pragma ident "%Z%%M% %I% %E% SMI" 3817N/A * Set secret key on local machine 2790N/A/* Should last until 16384-bit DH keys */ * fgets is broken in that if it reads a NUL character it will always return * EOF. This replacement can deal with NULs /* write unencrypted secret key into root key file */ perror(
"Could not create /etc/.rootkey.bak");
perror(
"Could not open /etc/.rootkey for writing");
"Attempting to restore original /etc/.rootkey\n");
perror(
"Could not open /etc/.rootkey for writing");
"Attempting to restore original /etc/.rootkey\n");
perror(
"Could not open /etc/.rootkey.bak for reading");
"Attempting to restore original /etc/.rootkey\n");
* No encryption algorithm found in the file * (atent) so default to DES. * 192-bit keys always go on the first line * Silently remove lines with the same /* Append key to rootkey file */ fprintf(
stderr,
"WARNING: Could not write %s key to /etc/.rootkey\n",
/* Perform AUTH_DES keylogin */ "The system default domain '%s' is different from the Secure RPC\n\ domain %s where the key is stored. The Secure RPC domainname is\n\ If you need to change this Secure RPC domainname, please use the nisinit(1M)\n\ "Make sure the secret key is stored in domain %s\n",
/* revoke any existing (lingering) credentials... */ /* do actual key login */ /* write unencrypted secret key into root key file */ * Revokes the existing credentials for Secure-RPC and Secure-NFS. * This should only be called if the user entered the correct password; * sorta like the way "su" doesn't force a login if you enter the wrong * one exists. this will effectively mark "stale" any * it looks like a credential already existed, so try and * revoke any lingering Secure-NFS privledges. 8) *
2) +
1,
pass) == 0) {
"WARNING: Could not find %s's %s secret key\n",
"Password incorrect for %s's %s key.\n",
"Could not set %s's %s secret key\n",
"May be the keyserv is down?\n");