/*
* 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.
*
* autofs mount.c
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <fslib.h>
#include <errno.h>
#include <rpcsvc/daemon_utils.h>
#include "automount.h"
static void usage();
/*
* list of support services needed
*/
int
{
int error;
int c;
int mntflags = 0;
int nmflg = 0;
int roflg = 0;
switch (c) {
case '?':
usage();
exit(1);
/* NOTREACHED */
case 'o':
break;
case 'm':
nmflg++;
break;
case 'r': /* converted to -o ro always */
roflg++;
break;
/*
* The "quiet" flag can be ignored, since this
* program never complains about invalid -o options
* anyway.
*/
case 'q':
break;
default:
usage();
}
}
usage();
exit(1);
}
perror("uname");
exit(1);
}
else
if (*obuf != '\0')
/*
* enable services as needed.
*/
if (error < 0) {
perror("autofs mount");
exit(1);
}
return (0);
}
static void
usage()
{
"Usage: autofs mount [-r] [-o opts] map dir\n");
exit(1);
}
/*
* Remove pseudo-options "direct", "indirect", "nest", and "ignore" from
* option list. Set *directp to 1 if "direct" is found, and 0 otherwise
* (mounts are indirect by default). If both "direct" and "indirect" are
* found, the last one wins.
*/
static void
{
char *opt;
char *opts;
"autofs mount: memory allocation failed\n");
exit(1);
}
options[0] = '\0';
*directp = 0;
opt++;
}
*directp = 1;
*directp = 0;
if (options[0] != '\0') {
}
}
};
}
/*
* Concatenate two options strings, with a comma between them.
*/
static char *
{
"autofs mount: memory allocation failed\n");
exit(1);
}
}
}
/*
* check the options string for 'ro' options
* if present returns 1 otherwise return 0;
*/
static int
{
if (!*op)
return (0);
while (op != 0) {
return (1);
op++;
}
return (0);
}