commands.c revision f8825440532850af4790bbc685223958d4042844
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A#include <auth_attr.h>
2N/A#include <libshare.h>
2N/A#include "sharemgr.h"
switch (which) {
case SVC_SET:
case SVC_ACTION:
endauthattr();
ret = 0;
return (ret);
int ret1 = 0;
int ret2 = 0;
int ret;
switch (flags) {
case SVC_ACTION:
case SVC_SET:
return (ret);
char *state;
return (ret);
int ret;
char *state;
char *name;
if (online) {
(void) smf_enable_instance(
instance, 0);
return (ret);
int notfirst = 0;
int ret;
char *optname;
if (!security)
if (security)
if (notfirst == 0)
(void) printf(
switch (ret) {
case OPT_ADD_SYNTAX:
case OPT_ADD_SECURITY:
case OPT_ADD_PROPERTY:
(void) printf(
notfirst++;
if (notfirst) {
return (ret);
(void) printf(
return (ret);
int result = 0;
goto out;
out:
return (result);
char *groupname;
int verbose = 0;
int dryrun = 0;
int err = 0;
int auth;
verbose++;
dryrun++;
return (SA_INVALID_PROTOCOL);
switch (ret) {
case OPT_ADD_SYNTAX:
optarg);
return (SA_SYNTAX_ERR);
case OPT_ADD_SECURITY:
optarg);
return (SA_SYNTAX_ERR);
return (SA_BAD_PATH);
return (SA_SYNTAX_ERR);
return (SA_INVALID_PROTOCOL);
return (SA_SYNTAX_ERR);
protocol);
&err);
&ret);
protocol);
char **protolist;
int numprotos, i;
for (i = 0; i < numprotos; i++) {
protolist[i]);
return (ret);
char *state;
int enabled = 0;
char *groupname;
int verbose = 0;
int dryrun = 0;
int force = 0;
int auth;
verbose++;
dryrun++;
return (SA_INVALID_PROTOCOL);
force++;
return (SA_SYNTAX_ERR);
return (SA_SYNTAX_ERR);
return (SA_SYNTAX_ERR);
goto done;
if (!dryrun) {
for (security =
char *secprot;
security);
if (!dryrun)
done:
return (ret);
int limit;
return (NULL);
return (buff);
char *proto;
int buffsize = 0;
int addspace = 0;
if (addspace++)
return (buff);
int verbose = 0;
verbose++;
protocol);
return (SA_INVALID_PROTOCOL);
char *name;
char *proto;
if (verbose) {
(char *)proto);
char *type;
char *value;
int spacer;
char *value;
char *secvalue;
char *subgroup)
char *groupname;
char *sharepath;
char *resource;
char *description;
char *type;
int iszfs = 0;
if (properties)
if (verbose) {
if (properties)
(void) printf(
if (properties)
return (doc);
int verbose = 0;
int properties = 0;
int xml = 0;
verbose++;
properties++;
protocol);
return (SA_INVALID_PROTOCOL);
xml++;
if (xml) {
if (xml)
NULL);
if (xml)
return (ret);
int update_legacy)
char *value;
int enabled;
int iszfs = 0;
if (update_legacy)
iszfs++;
if (enabled)
return (ret);
int verbose = 0;
int dryrun = 0;
int auth;
dryrun++;
verbose++;
return (SA_BAD_PATH);
return (SA_BAD_PATH);
return (SA_BAD_PATH);
return (SA_NO_SUCH_GROUP);
char *groupname;
return (SA_DUPLICATE_NAME);
if (dryrun)
switch (ret) {
case SA_DUPLICATE_NAME:
(void) printf(
case SA_OK:
verbose) {
return (ret);
int verbose = 0;
int dryrun = 0;
dryrun++;
verbose++;
return (SA_BAD_PATH);
char *zfsold;
char *zfsnew;
return (SA_BAD_PATH);
return (SA_NO_SUCH_GROUP);
return (SA_NO_SUCH_PATH);
char *pname;
char *oldstate;
verbose) {
return (ret);
int verbose = 0;
int dryrun = 0;
int force = 0;
int auth;
dryrun++;
verbose++;
force++;
return (SA_SYNTAX_ERR);
return (ret);
return (ret);
if (!dryrun) {
char *pname;
return (ret);
int dryrun = 0;
int auth;
int verbose = 0;
char *groupname;
dryrun++;
verbose++;
return (SA_BAD_PATH);
return (SA_OK);
return (ret);
return (SA_NO_SUCH_PATH);
int delgroupname = 0;
if (delgroupname) {
if (!dryrun) {
resource);
switch (ret) {
case SA_DUPLICATE_NAME:
case SA_OK:
return (ret);
int result = 0;
return (ret);
prop);
prop);
if (result)
return (result);
char *attr;
return (ret);
int change = 0;
share);
return (ret);
int change = 0;
return (SA_INVALID_SECURITY);
protocol);
return (ret);
char *groupname;
int verbose = 0;
int dryrun = 0;
int auth;
verbose++;
dryrun++;
protocol);
return (SA_INVALID_PROTOCOL);
switch (ret) {
case OPT_ADD_SYNTAX:
return (SA_SYNTAX_ERR);
case OPT_ADD_MEMORY:
return (SA_NO_MEMORY);
return (SA_OK);
sep);
sep);
return (SA_NOT_ALLOWED);
return (ret);
int change = 0;
return (change);
return (ret);
char *sectype)
char *sec;
return (ret);
int change = 0;
return (change);
int change = 0;
return (ret);
protocol);
(void) sa_destroy_optionset(
share);
protocol);
return (ret);
int change = 0;
return (SA_NO_SUCH_GROUP);
return (SA_NO_SUCH_PATH);
NULL);
char *sec;
protocol);
return (ret);
char *groupname;
int verbose = 0;
int dryrun = 0;
int auth;
verbose++;
dryrun++;
protocol);
return (SA_INVALID_PROTOCOL);
switch (ret) {
case OPT_ADD_SYNTAX:
return (SA_SYNTAX_ERR);
case OPT_ADD_PROPERTY:
return (SA_SYNTAX_ERR);
return (SA_OK);
sep);
sep);
return (ret);
int verbose = 0;
int dryrun = 0;
int all = 0;
char *state;
dryrun++;
protocol);
return (SA_INVALID_PROTOCOL);
verbose++;
return (SA_NO_SUCH_PATH);
if (!all) {
flags);
if (verbose)
if (verbose)
optind++;
return (ret);
return (ret);
if (setstate)
char *name;
return (ret);
int verbose = 0;
int dryrun = 0;
int all = 0;
char *protocol;
char *state;
dryrun++;
protocol);
return (SA_INVALID_PROTOCOL);
verbose++;
return (SA_NO_SUCH_PATH);
if (!all) {
flags);
if (verbose)
if (verbose)
optind++;
return (ret);
int verbose = 0;
int all = 0;
char *state;
protocol);
return (SA_INVALID_PROTOCOL);
verbose++;
return (SA_OK);
return (SMF_EXIT_ERR_FATAL);
if (!all) {
if (verbose)
optind++;
return (ret);
int verbose = 0;
int all = 0;
char *state;
protocol);
return (SA_INVALID_PROTOCOL);
verbose++;
return (SMF_EXIT_ERR_FATAL);
} else if (!all) {
if (verbose)
optind++;
return (ret);
char *type;
int err;
int ret = 0;
return (ret);
int ret;
if (ret < 0) {
switch (errno) {
case EACCES:
return (ret);
char *path;
char *type;
char *resource;
char *description;
char *groupname;
char *sharedstate;
char *soptions;
shared = 0;
if (shared) {
char *options;
char *zfs;
int argsused = 0;
int zfs = 0;
int true_legacy = 0;
argsused++;
true_legacy++;
return (SA_INVALID_PROTOCOL);
argsused++;
argsused++;
return (SA_OK);
return (ret);
return (SA_LEGACY_ERR);
if (true_legacy) {
return (ret);
sharepath)) {
char *type;
protocol);
if (!zfs) {
protocol);
return (ret);
int argsused = 0;
int true_legacy = 0;
true_legacy++;
return (SA_INVALID_PROTOCOL);
argsused++;
argsused++;
return (SA_OK);
if (true_legacy) {
return (ret);
switch (ret) {
case SA_SYNTAX_ERR:
case SA_OK:
return (ret);
switch (index) {
case USAGE_ADD_SHARE:
case USAGE_CREATE:
case USAGE_DELETE:
case USAGE_DISABLE:
case USAGE_ENABLE:
case USAGE_LIST:
case USAGE_MOVE_SHARE:
case USAGE_REMOVE_SHARE:
case USAGE_SET:
case USAGE_SET_SECURITY:
case USAGE_SET_SHARE:
case USAGE_SHOW:
case USAGE_SHARE:
case USAGE_START:
case USAGE_STOP:
case USAGE_UNSET:
case USAGE_UNSET_SECURITY:
case USAGE_UNSHARE:
return (ret);
return (&commands[i]);
return (NULL);