autod_lookup.c revision 1160694128cd3980cc06abe31af529a887efd310
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <syslog.h>
#include <errno.h>
#include <locale.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include "automount.h"
int
char *mapname;
char *key;
char *subdir;
char *mapopts;
char *path;
enum autofs_action *action;
struct authunix_parms *cred;
{
int err;
struct rddir_cache *rdcp;
int found = 0;
#ifdef lint
#endif /* lint */
/*
* Default action is for no work to be done by kernel AUTOFS.
*/
*action = AUTOFS_NONE;
/*
* Is there a cache for this map?
*/
/*
* Try to lock readdir cache entry for reading, if
* the entry can not be locked, then avoid blocking
* and go to the name service. I'm assuming it is
* faster to go to the name service than to wait for
* the cache to be populated.
*/
}
} else
if (!err) {
/*
* release reference on cache entry
*/
}
if (found)
return (0);
/*
* entry not found in cache, try the name service now
*/
err = 0;
/* initialize the stack of open files for this thread */
if (err == 0) /* call parser w default mount_access = TRUE */
/*
* Now we indulge in a bit of hanky-panky.
* If the entry isn't found in the map and the
* name begins with an "=" then we assume that
* the name is an undocumented control message
* for the daemon. This is accessible only
* to superusers.
*/
/*
* If next character is a digit
* then set the trace level.
*/
trace);
/*
* If it's a "v" then
* toggle verbose mode.
*/
}
}
goto done;
}
/*
* Each mapent in the list describes a mount to be done.
* Since I'm only doing a lookup, I only care whether a mapentry
* was found or not. The mount will be done on a later RPC to
* do_mount1.
*/
}
if (trace > 1) {
}
return (err);
}