/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <string.h>
#include <rpcsvc/nlm_prot.h>
#include "nfs_subr.h"
#include <errno.h>
#include <deflt.h>
/*
* This function is added to detect compatibility problem with SunOS4.x.
* The compatibility problem exists when fshost cannot decode the request
* arguments for NLM_GRANTED procedure.
* Only in this case we use local locking.
* In any other case we use fshost's lockd for remote file locking.
* Return value: 1 if we should use local locking, 0 if not.
*/
int
{
/*
* Assign the hostname and the file handle for the
* NLM_GRANTED request below. If for some reason the uname call fails,
* list the server as the caller so that caller_name has some
* reasonable value.
*/
} else {
}
return (0);
return (rpc_stat == RPC_CANTDECODEARGS);
}
((c >= 'A' && c <= 'F') ? (c - 'A' + 10) :\
((c >= 'a' && c <= 'f') ? (c - 'a' + 10) : 0)))
/*
* The implementation of URLparse guarantees that the final string will
* fit in the original one. Replaces '%' occurrences followed by 2 characters
* with its corresponding hexadecimal character.
*/
void
{
char *p, *q;
p = q = str;
while (*p) {
*q = *p;
if (*p++ == '%') {
if (*p) {
*q = fromhex(*p) * 16;
p++;
if (*p) {
*q += fromhex(*p);
p++;
}
}
}
q++;
}
*q = '\0';
}
/*
* Convert from URL syntax to host:path syntax.
*/
int
char *cur_special)
{
char *url;
char *newspec;
char *p;
/*
* Rebuild the URL. This is necessary because parse replica
* assumes that nfs: is the host name.
*/
return (-1);
/*
* If we haven't done any conversion yet, allocate a buffer for it.
*/
return (-1);
}
} else {
}
/*
* Now find the first occurence of the URL in the special string.
*/
if (p == NULL) {
return (-1);
}
p1 = p;
/*
* Overwrite the URL in the special.
*
* Begin with the host name.
*/
for (;;) {
/*
* Sine URL's take more room than host:path, there is
* no way we should hit a null byte in the original special.
*/
if (*p1 == '\0') {
return (-1);
}
if (*p2 == '\0') {
break;
}
p1++;
p2++;
}
/*
* Add the : separator.
*/
*p1 = ':';
p1++;
/*
* Now over write into special the path portion of host:path in
*/
for (;;) {
if (*p1 == '\0') {
return (-1);
}
if (*p2 == '\0') {
break;
}
p1++;
p2++;
}
/*
* Now shift the rest of original special into the gap created
* by replacing nfs://host[:port]/path with host:path.
*/
for (;;) {
if (*p1 == '\0') {
return (-1);
}
if (*p2 == '\0') {
break;
}
p1++;
p2++;
}
*p1 = '\0';
return (0);
}
/*
* Solaris autofs configuration file location
*/
void
{
char *defval;
/*
*/
if ((defopen(AUTOFSADMIN)) == 0) {
errno = 0;
if (errno != 0)
}
/* close defaults file */
}
}