commands.c revision 4db300d53bba385c36dddab8a9eabbfd4fc0b795
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"
return (result);
struct list *
return (listp);
return (new);
return (listp);
ret = 0;
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) {
return (ret);
int notfirst = 0;
int ret;
char *optname;
if (!security)
if (security)
if (notfirst == 0)
switch (ret) {
case OPT_ADD_SYNTAX:
case OPT_ADD_SECURITY:
case OPT_ADD_PROPERTY:
notfirst++;
if (notfirst) {
return (ret);
return (ret);
int result = 0;
return (result);
char *groupname;
int verbose = 0;
int dryrun = 0;
int err = 0;
int auth;
verbose++;
dryrun++;
protocol);
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);
char **protolist;
int numprotos, i;
for (i = 0; i < numprotos; i++) {
return (ret);
char *state;
int enabled = 0;
char *groupname;
int verbose = 0;
int dryrun = 0;
int force = 0;
int auth;
verbose++;
dryrun++;
protocol);
return (SA_INVALID_PROTOCOL);
force++;
return (SA_SYNTAX_ERR);
return (SA_SYNTAX_ERR);
return (SA_SYNTAX_ERR);
if (!dryrun) {
char *secprot;
if (!dryrun)
return (ret);
int limit;
return (NULL);
return (buff);
char *proto;
int buffsize = 0;
int addspace = 0;
if (addspace++)
return (buff);
int verbose = 0;
#ifdef lint
verbose++;
protocol);
return (SA_INVALID_PROTOCOL);
char *name;
char *proto;
if (verbose) {
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)
if (properties)
return (doc);
int verbose = 0;
int properties = 0;
int xml = 0;
#ifdef lint
verbose++;
properties++;
protocol);
return (SA_INVALID_PROTOCOL);
xml++;
if (xml) {
if (xml)
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++;
char *groupname;
if (dryrun)
resource);
switch (ret) {
case SA_DUPLICATE_NAME:
resource);
case SA_OK:
return (ret);
int verbose = 0;
int dryrun = 0;
dryrun++;
verbose++;
return (SA_BAD_PATH);
char *zfsold;
char *zfsnew;
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);
if (!dryrun) {
char *pname;
return (ret);
int dryrun = 0;
int auth;
int verbose = 0;
dryrun++;
verbose++;
return (SA_BAD_PATH);
return (SA_OK);
char *groupname;
int delgroupname = 0;
if (delgroupname) {
if (!dryrun) {
resource);
resource);
switch (ret) {
case SA_DUPLICATE_NAME:
resource);
case SA_OK:
return (ret);
int result = 0;
if (result)
return (result);
int change = 0;
&ret);
&ret);
return (ret);
int change = 0;
sectype);
return (SA_INVALID_SECURITY);
&ret);
&ret);
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:
optarg);
return (SA_SYNTAX_ERR);
case OPT_ADD_MEMORY:
optarg);
return (SA_NO_MEMORY);
return (SA_OK);
return (ret);
int change = 0;
return (change);
return (ret);
char *sectype)
char *sec;
sectype);
return (ret);
int change = 0;
return (change);
int change = 0;
&ret);
protocol);
&ret);
return (ret);
int change = 0;
&ret);
protocol);
&ret);
char *sec;
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:
optarg);
return (SA_SYNTAX_ERR);
case OPT_ADD_PROPERTY:
optarg);
return (SA_SYNTAX_ERR);
return (SA_OK);
sep);
return (ret);
int verbose = 0;
int dryrun = 0;
int all = 0;
char *state;
dryrun++;
protocol);
return (SA_INVALID_PROTOCOL);
verbose++;
if (!all) {
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++;
if (!all) {
if (verbose)
if (verbose)
optind++;
return (ret);
int verbose = 0;
int all = 0;
char *state;
#ifdef lint
protocol);
return (SA_INVALID_PROTOCOL);
verbose++;
return (SA_OK);
if (!all) {
if (verbose)
optind++;
return (ret);
int verbose = 0;
int all = 0;
char *state;
#ifdef lint
protocol);
return (SA_INVALID_PROTOCOL);
verbose++;
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) {
path,
char *options;
char *zfs;
int argsused = 0;
int zfs = 0;
int true_legacy = 0;
#ifdef lint
argsused++;
true_legacy++;
protocol);
return (SA_INVALID_PROTOCOL);
argsused++;
argsused++;
return (SA_OK);
return (SA_LEGACY_ERR);
if (true_legacy) {
return (ret);
char *type;
protocol);
if (!zfs) {
resource);
return (ret);
int argsused = 0;
int true_legacy = 0;
#ifdef lint
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);
#ifdef lint
return (&commands[i]);
return (NULL);
#ifdef lint