shbin.c revision ce67301fa82625f5594913e8ab6abf9e0aa461d0
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * This is the loadable module wrapper. 2N/A/* Local prototypes */ 2N/A * Our list where we may find a copy of ksh93. The ordering is: 2N/A * 1. 64bit (may not be installed or not supported in hardware) 2N/A * isaexec overhead). * Module linkage information for the kernel. * Read the entire line and confirm that it starts with the magic * sequence for compiled ksh93 shell scripts. char devfd[
19];
/* 32-bit int fits in 10 digits + 8 for "/dev/fd/" */ if (
level) {
/* Can't recurse */ * Check whether the executable has the correct magic value. * Travel the list of shells and look for one which is available... /* No match found ? Then continue with the next item... */ * "--" is passed to mark the end-of-arguments before adding * the scripts file name, preventing problems when a * a script's name starts with a '-' character. /* don't free resolvepn until we are done with args */ * When we're executing a set-uid script resulting in uids * mismatching or when we execute with additional privileges, * we close the "replace script between exec and open by shell" * hole by passing the script as /dev/fd parameter.