# HG changeset patch # User devjani.ray@oracle.com # Date 1391810603 18000 # Node ID d04a7bb15a5b34a0620eb1fcd3c02490c0f077c0 # Parent 152cafe6cd9940ef46d319a6efbe73af86af3c34 PSARC/2014/018 Move RAD modules from Userland to ON 18125629 Move RAD modules out of Userland diff -r 152cafe6cd99 -r d04a7bb15a5b components/meta-packages/history/system-management-visual-panels-panel-examples.p5m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/meta-packages/history/system-management-visual-panels-panel-examples.p5m Fri Feb 07 17:03:23 2014 -0500 @@ -0,0 +1,29 @@ +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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 (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +# + +set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-examples@0.5.12-5.12.0.0.0.42.0 +set name=pkg.obsolete value=true +set name=org.opensolaris.consolidation value=$(CONSOLIDATION) + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/Makefile --- a/components/visual-panels/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/Makefile Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ # # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # include ../../make-rules/shared-macros.mk @@ -54,7 +54,6 @@ # dependencies apache: core smf coreadm: core -examples: core firewall: core smf: core sysmon: core diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/ant-rules/build-common.xml --- a/components/visual-panels/ant-rules/build-common.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/ant-rules/build-common.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -53,24 +53,6 @@ - - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/apache/src/java/vpanels/app/apache/build.xml --- a/components/visual-panels/apache/src/java/vpanels/app/apache/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/apache/src/java/vpanels/app/apache/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -40,6 +40,8 @@ + + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/Makefile --- a/components/visual-panels/core/src/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/Makefile Fri Feb 07 17:03:23 2014 -0500 @@ -20,13 +20,12 @@ # # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # include $(SRC)/make-rules/Makefile.env -cmd: java -doc: java cmd +doc: java qinstall: $(MAKE) install ANT='ant -Dquick=true' diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/apis/file.adr --- a/components/visual-panels/core/src/apis/file.adr Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/apis/network.adr --- a/components/visual-panels/core/src/apis/network.adr Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/apis/panel.adr --- a/components/visual-panels/core/src/apis/panel.adr Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/apis/smf_old.adr --- a/components/visual-panels/core/src/apis/smf_old.adr Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/apis/time.adr --- a/components/visual-panels/core/src/apis/time.adr Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/Makefile --- a/components/visual-panels/core/src/cmd/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/Makefile --- a/components/visual-panels/core/src/cmd/rad/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -build: - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/Makefile --- a/components/visual-panels/core/src/cmd/rad/mod/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -MODULE_SUBDIRS = \ - files \ - network \ - panels \ - smf_old - -MODULE_SUBDIRS_sparc = $(MODULE_SUBDIRS) -MODULE_SUBDIRS_i386 = $(MODULE_SUBDIRS) - -SUBDIRS = $(MODULE_SUBDIRS_$(ISA)) - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/files/Makefile --- a/components/visual-panels/core/src/cmd/rad/mod/files/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -VERS=.1 -MOD_APIS=file -MOD_OBJS=mod_files.o -MOD_LIBNAME=mod_files.so$(VERS) -MOD_INSTALLDIR=$(RADDIR_MODULE) -APISDIR=../../../../apis - -include $(SRC)/make-rules/Makefile.com - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/files/mod_files.c --- a/components/visual-panels/core/src/cmd/rad/mod/files/mod_files.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -/* - * Unfortunately, the behavior this module has inherited is not one - * of "get me information about file X or directory Y", but "tell me - * what calling 'new File(X)' would do in Java". This includes - * nonsense like manufacturing correct fake data for nonexistent - * files. - * - * This sorely needs to be ripped out and replaced with a sane - * api. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "api_file.h" - -static adr_data_t * -empty_file(adr_data_t *data, const char *apath, const char *cpath) -{ - adr_struct_set(data, "absolutePath", - adr_data_new_string(apath, LT_COPY)); - adr_struct_set(data, "canonicalPath", - adr_data_new_string(cpath, LT_COPY)); - adr_struct_set(data, "canonical", adr_data_new_boolean(B_TRUE)); - adr_struct_set(data, "baseName", adr_data_new_string("", LT_COPY)); - adr_struct_set(data, "exists", adr_data_new_boolean(B_FALSE)); - adr_struct_set(data, "readable", adr_data_new_boolean(B_FALSE)); - adr_struct_set(data, "writable", adr_data_new_boolean(B_FALSE)); - adr_struct_set(data, "hidden", adr_data_new_boolean(B_FALSE)); - adr_struct_set(data, "directory", adr_data_new_boolean(B_FALSE)); - adr_struct_set(data, "file", adr_data_new_boolean(B_FALSE)); - adr_struct_set(data, "lastModified", adr_data_new_time(0, 0)); - adr_struct_set(data, "length", adr_data_new_long(0)); - adr_struct_set(data, "freeSpace", adr_data_new_long(0)); - adr_struct_set(data, "totalSpace", adr_data_new_long(0)); - adr_struct_set(data, "usableSpace", adr_data_new_long(0)); - return (adr_data_purify(data)); -} - -static adr_data_t * -read_file(const char *path, const char *file) -{ - struct stat64 st; - char apath[PATH_MAX] = ""; - char cpath[PATH_MAX] = ""; - const char *name = file != NULL ? file : path; - - adr_data_t *data = adr_data_new_struct(&t__FileSnapshot); - adr_struct_set(data, "path", adr_data_new_string(name, LT_COPY)); - adr_struct_set(data, "absolute", adr_data_new_boolean(name[0] == '/')); - - if (path[0] != '/') { - if (getcwd(apath, PATH_MAX) == NULL) { - adr_data_free(data); - return (NULL); - } - if (apath[1] != '\0') - (void) strlcat(apath, "/", PATH_MAX); - (void) strlcat(apath, path, PATH_MAX); - } else { - (void) strlcpy(apath, path, PATH_MAX); - } - - if (resolvepath(apath, cpath, PATH_MAX) == -1 || - stat64(path, &st) == -1) - return (empty_file(data, apath, apath)); - - adr_struct_set(data, "absolutePath", - adr_data_new_string(apath, LT_COPY)); - adr_struct_set(data, "canonicalPath", - adr_data_new_string(cpath, LT_COPY)); - adr_struct_set(data, "canonical", - adr_data_new_boolean(strcmp(apath, cpath) == 0)); - adr_struct_set(data, "baseName", - adr_data_new_string(basename(apath), LT_COPY)); - adr_struct_set(data, "exists", adr_data_new_boolean(B_TRUE)); - adr_struct_set(data, "readable", - adr_data_new_boolean(access(path, R_OK) == 0)); - adr_struct_set(data, "writable", - adr_data_new_boolean(access(path, W_OK) == 0)); - adr_struct_set(data, "hidden", adr_data_new_boolean(B_FALSE)); - adr_struct_set(data, "directory", - adr_data_new_boolean(S_ISDIR(st.st_mode))); - adr_struct_set(data, "file", adr_data_new_boolean(S_ISREG(st.st_mode))); - adr_struct_set(data, "lastModified", adr_data_new_time_ts(&st.st_mtim)); - /* XXX: 64-bitify */ - adr_struct_set(data, "length", adr_data_new_long(st.st_size)); - adr_struct_set(data, "freeSpace", adr_data_new_long(0)); - adr_struct_set(data, "totalSpace", adr_data_new_long(0)); - adr_struct_set(data, "usableSpace", adr_data_new_long(0)); - return (adr_data_purify(data)); -} - -/* ARGSUSED */ -conerr_t -interface_FileBrowser_read_roots(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - adr_data_t *result = adr_data_new_array(&t_array__FileSnapshot, 1); - (void) adr_array_add(result, read_file("/", NULL)); - *data = adr_data_purify(result); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_FileBrowser_invoke_getFile(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - *ret = read_file(adr_data_to_string(args[0]), NULL); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_FileBrowser_invoke_getFiles(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - const char *path = adr_data_to_string(args[0]); - DIR *d = opendir(path); - struct dirent *ent; - adr_data_t *result; - - if (d == NULL) - return (CE_OBJECT); - - result = adr_data_new_array(&t_array__FileSnapshot, 1); - while ((ent = readdir(d)) != NULL) { - char buf[PATH_MAX]; - if (strcmp(ent->d_name, ".") == 0 || - strcmp(ent->d_name, "..") == 0) - continue; - int len = strlen(path); - while (len > 0 && path[len - 1] == '/') - len--; - (void) snprintf(buf, PATH_MAX, "%.*s/%s", len, path, - ent->d_name); - adr_data_t *file = read_file(buf, NULL); - if (file != NULL) - (void) adr_array_add(result, file); - } - (void) closedir(d); - *ret = adr_data_purify(result); - - return (CE_OK); -} - -int -_rad_init(void) -{ - adr_name_t *aname = adr_name_vcreate( - MOD_DOMAIN, 1, "type", "FileBrowser"); - conerr_t cerr = rad_cont_insert_singleton(rad_container, aname, - &modinfo, &interface_FileBrowser_svr); - adr_name_rele(aname); - if (cerr != CE_OK) { - rad_log(RL_ERROR, "(mod_files) failed to insert FileBrowser"); - return (-1); - } - - return (0); -} - -/* - * _rad_fini is called by the RAD daemon when the module is unloaded. Any - * module finalisation is completed here. - */ -/*ARGSUSED*/ -void -_rad_fini(void *unused) -{ -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/network/Makefile --- a/components/visual-panels/core/src/cmd/rad/mod/network/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -LDLIBS += -lsocket -lnsl - -VERS=.1 -MOD_APIS=network -MOD_OBJS=mod_network.o -MOD_LIBNAME=mod_network.so$(VERS) -MOD_INSTALLDIR=$(RADDIR_MODULE) -APISDIR=../../../../apis - -include $(SRC)/make-rules/Makefile.com - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/network/mod_network.c --- a/components/visual-panels/core/src/cmd/rad/mod/network/mod_network.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "api_network.h" - -#include -#include -#include -#include -#include - -static int -if_count(int fd, int *count) -{ - struct lifnum ifnum; - - ifnum.lifn_family = AF_INET; - ifnum.lifn_flags = 0; - if (ioctl(fd, SIOCGLIFNUM, &ifnum) == -1) { - (void) close(fd); - return (-1); - } - - *count = ifnum.lifn_count; - return (0); -} - -/* ARGSUSED */ -conerr_t -interface_Network_read_networkInterfaces(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - int fd; - int count, rcount; - int reqsize; - struct lifreq *reqs = NULL; - struct lifconf ifconf; - adr_data_t *result; - - if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) - return (CE_OBJECT); - - do { - if (reqs != NULL) - free(reqs); - - if (if_count(fd, &count) == -1) - return (CE_OBJECT); - - if (count == 0) { - (void) close(fd); - *data = adr_data_new_array(&adr_t_array_string, 0); - return (CE_OK); - } - - count += 5; - reqsize = count * sizeof (struct lifreq); - if ((reqs = malloc(reqsize)) == NULL) { - (void) close(fd); - return (CE_OBJECT); - } - - ifconf.lifc_family = AF_INET; - ifconf.lifc_len = reqsize; - ifconf.lifc_buf = (char *)reqs; - ifconf.lifc_flags = 0; - if (ioctl(fd, SIOCGLIFCONF, &ifconf) == -1) { - (void) close(fd); - free(reqs); - return (CE_OBJECT); - } - rcount = ifconf.lifc_len / sizeof (struct lifreq); - } while (rcount >= count); - - result = adr_data_new_array(&adr_t_array_string, rcount); - for (int i = 0; i < rcount; i++) { - struct lifreq *r = &ifconf.lifc_req[i]; - if (strchr(r->lifr_name, ':') != NULL) - continue; - if (ioctl(fd, SIOCGLIFFLAGS, r) == -1) - continue; - if ((r->lifr_flags & (IFF_LOOPBACK | IFF_VIRTUAL)) != 0) - continue; - (void) adr_array_add(result, adr_data_new_string(r->lifr_name, - LT_COPY)); - } - (void) close(fd); - free(reqs); - - *data = adr_data_purify_deep(result); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_Network_invoke_getHostNameForIP(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - int errnum; - struct hostent *he; - ipaddr_t addr; - - if (inet_pton(AF_INET, adr_data_to_string(args[0]), &addr) != 1) - return (CE_OBJECT); - - if ((he = getipnodebyaddr(&addr, sizeof (addr), AF_INET, &errnum)) - == NULL) { - /* Not found? Bounce it back. */ - (void) adr_data_ref(args[0]); - *ret = args[0]; - return (CE_OK); - } - - adr_data_t *result = adr_data_new_string(he->h_name, LT_COPY); - freehostent(he); - *ret = result; - - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_Network_invoke_hostGetIPs(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - int errnum; - struct hostent *he; - - if ((he = getipnodebyname(adr_data_to_string(args[0]), AF_INET, - AI_DEFAULT, &errnum)) == NULL) { - *ret = NULL; - return (CE_OBJECT); - } - - int n = 0; - for (char **aptr = he->h_addr_list; *aptr != NULL; aptr++) - n++; - adr_data_t *result = adr_data_new_array(&adr_t_array_string, n); - for (int i = 0; i < n; i++) { - char abuf[INET_ADDRSTRLEN]; - if (inet_ntop(AF_INET, he->h_addr_list[i], abuf, - sizeof (abuf)) != NULL) - (void) adr_array_add(result, adr_data_new_string(abuf, - LT_COPY)); - } - - *ret = adr_data_purify_deep(result); - freehostent(he); - - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_Network_invoke_isLocalAddress(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - struct ifaddrs *ifaddr; - struct ifaddrs *ifa; - struct sockaddr_in *sin; - struct sockaddr_in6 *sin6; - - char buf[1024]; - (void) memset(buf, 0, sizeof (buf)); - - /* Set default return value */ - *ret = adr_data_new_boolean(B_FALSE); - - // Get IP addresses of each network interface. - // - // ifa_name ifa_addr->sin_addr.s_addr - // - // lo0 0.0.0.0 - // lo0 ::1 (AF_INET6) - // lo0 127.0.0.1 (AF_INET) - // e1000g0 129.XXX.XXX.XXX (AF_INET) - // - // See: man -s3 socket getifaddrs - if (getifaddrs(&ifaddr) == -1) { - return (CE_OBJECT); - } - - /* Iterate over linked list of IP addresses */ - for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { - if (ifa->ifa_flags & IFF_IPV4) { - /* LINTED */ - sin = (struct sockaddr_in *)ifa->ifa_addr; - - /* Match given IP address */ - if (strcmp(adr_data_to_string(args[0]), - inet_ntop(AF_INET, - &sin->sin_addr.s_addr, buf, 1024)) == 0) { - *ret = adr_data_new_boolean(B_TRUE); - break; - } - } else { - /* LINTED */ - sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; - - /* Match given IP address */ - if (strcmp(adr_data_to_string(args[0]), - inet_ntop(AF_INET6, - &sin6->sin6_addr.s6_addr, buf, 1024)) == 0) { - *ret = adr_data_new_boolean(B_TRUE); - break; - } - } - } - freeifaddrs(ifaddr); - return (CE_OK); -} - -int -_rad_init(void) -{ - adr_name_t *aname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "Network"); - conerr_t cerr = rad_cont_insert_singleton(rad_container, aname, - &modinfo, &interface_Network_svr); - adr_name_rele(aname); - if (cerr != CE_OK) { - rad_log(RL_ERROR, "(mod_network) failed to insert Network"); - return (-1); - } - - return (0); -} - -/* - * _rad_fini is called by the RAD daemon when the module is unloaded. Any - * module finalisation is completed here. - */ -/*ARGSUSED*/ -void -_rad_fini(void *unused) -{ -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/panels/Makefile --- a/components/visual-panels/core/src/cmd/rad/mod/panels/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -CPPFLAGS += -I/usr/include/libxml2 -LDLIBS += -lxml2 -lcrypto - -# Compensate for libxml's lint library -LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 - -VERS=.1 -MOD_APIS=panel -MOD_OBJS=mod_panels.o -MOD_LIBNAME=mod_panels.so$(VERS) -MOD_INSTALLDIR=$(RADDIR_MODULE) - -DTDDIR=$(ROOT)/usr/share/lib/xml/dtd -APISDIR=../../../../apis - -include $(SRC)/make-rules/Makefile.com - -install: $(DTDDIR)/vpanel.dtd.1 - -FILEMODE=444 -$(DTDDIR)/%: % - $(INS.file); - $(RMCDDL) diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/panels/mod_panels.c --- a/components/visual-panels/core/src/cmd/rad/mod/panels/mod_panels.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,534 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "api_panel.h" - -#define PANELDESCDIR "/usr/share/vpanels/conf" - -#define HASH_BSIZE 65536 - -/* - * Function prototypes - */ - -static int md5_file(const char *fname, unsigned char *hash); -static adr_data_t *get_text(xmlDoc *doc, xmlNode *node); -static char *get_text_str(xmlDoc *doc, xmlNode *node); -static adr_data_t *get_prop(xmlNode *node, const char *name); -static adr_data_t *file_to_token(rad_locale_t *rlocale, const char *pname, - char *file); -static conerr_t token_to_file(adr_data_t *t, char **f); -static adr_data_t *create_resource(rad_locale_t *rlocale, const char *pname, - char *file); -static void add_localized(rad_locale_t *rlocale, const char *pname, - adr_data_t *farray, char *file); -static adr_data_t *read_panel_path(rad_locale_t *rlocale, const char *path); -static adr_data_t *read_panel(const char *locale, const char *pname); - -/* - * Static data - */ - -static xmlDtd *dtd; - -/* - * Static functions - */ - -static int -md5_file(const char *fname, unsigned char *hash) -{ - int fd, len = -1; - MD5_CTX ctx; - - char *buffer = malloc(HASH_BSIZE); - if (buffer == NULL) - return (-1); - - if ((fd = open(fname, O_RDONLY)) == -1) { - free(buffer); - return (-1); - } - - if (MD5_Init(&ctx) == 0) - goto out; - - while ((len = read(fd, buffer, HASH_BSIZE)) > 0) - if (MD5_Update(&ctx, buffer, len) == 0) { - len = -1; - break; - } - if (MD5_Final(hash, &ctx) == 0) - len = -1; - -out: - (void) close(fd); - free(buffer); - return (len); /* Should be 0 or -1 */ -} - -/* - * Seems like overkill, but it's better than mixing xml-allocated - * and other strings. - */ -static adr_data_t * -get_text(xmlDoc *doc, xmlNode *node) -{ - adr_data_t *result; - xmlChar *d = xmlNodeListGetString(doc, node, 1); - if (d == NULL) - return (NULL); - - result = adr_data_new_string((char *)d, LT_COPY); - xmlFree(d); - return (result); -} - -static char * -get_text_str(xmlDoc *doc, xmlNode *node) -{ - char *result; - xmlChar *d = xmlNodeListGetString(doc, node, 1); - if (d == NULL) - return (NULL); - - result = strdup((char *)d); - xmlFree(d); - return (result); -} - -static adr_data_t * -get_prop(xmlNode *node, const char *name) -{ - adr_data_t *result; - xmlChar *d = xmlGetProp(node, (xmlChar *)name); - if (d == NULL) - return (NULL); - - result = adr_data_new_string((char *)d, LT_COPY); - xmlFree(d); - return (result); -} - -static adr_data_t * -file_to_token(rad_locale_t *rlocale, const char *pname, char *file) -{ - int llen = strlen(rlocale->locale); - int plen = strlen(pname); - int flen = strlen(file); - int tokenlen = llen + 1 + plen + 1 + flen + 1; - - char *token = rad_zalloc(tokenlen); - if (token == NULL) { - return (NULL); - } - - char *p = token; - (void) strcpy(p, rlocale->locale); - p += llen + 1; - (void) strcpy(p, pname); - p += plen + 1; - (void) strcpy(p, file); - - return (adr_data_new_opaque(token, tokenlen, LT_FREE)); -} - -static conerr_t -token_to_file(adr_data_t *t, char **f) -{ - char *token = adr_data_to_opaque(t); - char tokenlen = adr_opaque_size(t); - - /* Cursory validation */ - int nullcnt = 0; - for (int i = 0; i < tokenlen; i++) { - if (token[i] == '\0') { - nullcnt++; - } - } - if (nullcnt != 3 || token[tokenlen - 1] != '\0') { - /* Bad token */ - return (CE_OBJECT); - } - - char *locale = token; - char *pname = locale + strlen(locale) + 1; - char *file = pname + strlen(pname) + 1; - - adr_data_t *panel = read_panel(locale, pname); - if (panel == NULL) { - /* Bad panel */ - return (CE_OBJECT); - } - - adr_data_t *resources = adr_struct_get(panel, "resourceDescriptors"); - static const char * const path[] = { "file", NULL }; - int index = adr_array_search(resources, file, path); - adr_data_free(panel); - if (index == -1) { - /* Bad file */ - return (CE_OBJECT); - } - - *f = strdup(file); - if (*f == NULL) { - return (CE_NOMEM); - } - - return (CE_OK); -} - -static adr_data_t * -create_resource(rad_locale_t *rlocale, const char *pname, char *file) -{ - unsigned char hbuf[MD5_DIGEST_LENGTH]; - if (md5_file(file, hbuf) != 0) { - return (NULL); - } - - adr_data_t *result = adr_data_new_struct(&t__ResourceDescriptor); - adr_struct_set(result, "token", file_to_token(rlocale, pname, file)); - adr_struct_set(result, "file", adr_data_new_string(file, LT_COPY)); - adr_struct_set(result, "hashAlgorithm", - adr_data_new_string("MD5", LT_CONST)); - adr_struct_set(result, "hash", - adr_data_new_opaque(hbuf, MD5_DIGEST_LENGTH, LT_COPY)); - - return (result); -} - -static void -add_localized(rad_locale_t *rlocale, const char *pname, adr_data_t *farray, - char *file) -{ - if (rlocale != NULL && rlocale->language != NULL && - strlen(rlocale->language)) { - char path[PATH_MAX + 1]; - (void) strlcpy(path, file, PATH_MAX); - - char *ext = strrchr(path, '.'); - if (ext != NULL && strcmp(ext, ".jar") == 0) { - *ext = '\0'; - char *base = strrchr(path, '/'); - if (base == NULL) { - return; - } - *base++ = '\0'; - - char *fmt[] = {NULL, NULL, NULL}; - - /* - * Use a ResourceBundle.getBundle-like algorithm - - * [_[@]] - and order - * from most- to least-specific. - */ - fmt[2] = "%s/locale/%s/%5$s_l10n.jar"; - if (rlocale->territory != NULL) { - fmt[1] = "%s/locale/%s_%s/%5$s_l10n.jar"; - if (rlocale->modifier != NULL) { - fmt[0] = "%s/locale/%s_%s@%s/" - "%5$s_l10n.jar"; - } - } - - char l10njar[PATH_MAX]; - for (int i = 0; i < RAD_COUNT(fmt); i++) { - if (fmt[i] == NULL) { - continue; - } - /* LINTED: E_SEC_PRINTF_VAR_FMT */ - (void) snprintf(l10njar, RAD_COUNT(l10njar), - fmt[i], path, rlocale->language, - rlocale->territory, rlocale->modifier, - base); - if (access(l10njar, F_OK) == 0) { - (void) adr_array_add(farray, - create_resource(rlocale, pname, - l10njar)); - } - } - } - } - (void) adr_array_add(farray, create_resource(rlocale, pname, file)); -} - -static adr_data_t * -read_panel_path(rad_locale_t *rlocale, const char *path) -{ - xmlParserCtxt *ctx; - xmlValidCtxt *vctx; - xmlDoc *doc; - adr_data_t *panel = NULL; - - ctx = xmlNewParserCtxt(); - vctx = xmlNewValidCtxt(); - if (vctx == NULL || ctx == NULL) - return (NULL); - - doc = xmlCtxtReadFile(ctx, path, NULL, 0); - if (doc == NULL) { - xmlFreeValidCtxt(vctx); - xmlFreeParserCtxt(ctx); - rad_log(RL_WARN, "Empty/no such document: %s\n", path); - return (NULL); - } - - /* - * Validate against *our* DTD. - */ - if (xmlValidateDtd(vctx, doc, dtd) == 0) { - rad_log(RL_WARN, "Invalid document: %s\n", path); - goto out; - } - - xmlNodePtr root = xmlDocGetRootElement(doc); - if (root == NULL || strcmp((const char *)root->name, "panel") != 0) { - rad_log(RL_WARN, "Not a panel definition: %s\n", path); - goto out; - } - - panel = adr_data_new_struct(&t__CustomPanel); - adr_struct_set(panel, "locale", - adr_data_new_string(rlocale->locale, LT_COPY)); - - adr_data_t *pname = get_prop(root, "name"); - adr_struct_set(panel, "name", pname); - - adr_data_t *farray = - adr_data_new_array(&t_array__ResourceDescriptor, 1); - adr_struct_set(panel, "resourceDescriptors", farray); - - char *aroot = NULL; - for (xmlNode *np = root->children; np != NULL; np = np->next) { - if (np->type != XML_ELEMENT_NODE) - continue; - if (strcmp((const char *)np->name, "mainclass") == 0) { - adr_data_t *mc = get_text(doc, np->children); - adr_struct_set(panel, "panelDescriptorClassName", mc); - } else if (strcmp((const char *)np->name, "approot") == 0) { - if (aroot != NULL) - continue; /* schema violation */ - aroot = get_text_str(doc, np->children); - } else if (strcmp((const char *)np->name, "file") == 0) { - char *file = get_text_str(doc, np->children); - if (file == NULL) { - rad_log(RL_WARN, - "Empty declaration within %s\n", - path); - continue; - } - - if (aroot == NULL) { - rad_log(RL_WARN, "App root not specified\n"); - continue; - } - - char full[PATH_MAX]; - (void) snprintf(full, RAD_COUNT(full), "%s/%s", aroot, - file); - free(file); - - add_localized(rlocale, adr_data_to_string(pname), - farray, full); - } - } - if (aroot != NULL) - free(aroot); -out: - xmlFreeValidCtxt(vctx); - xmlFreeDoc(doc); - xmlFreeParserCtxt(ctx); - - return (adr_data_purify_deep(panel)); -} - -static adr_data_t * -read_panel(const char *locale, const char *pname) -{ - rad_locale_t *rlocale; - if (rad_locale_parse(locale, &rlocale) != 0) { - return (NULL); - } - - char path[PATH_MAX]; - (void) snprintf(path, RAD_COUNT(path), "%s/%s.xml", PANELDESCDIR, - pname); - adr_data_t *panel = read_panel_path(rlocale, path); - - if (panel != NULL) { - /* Sanity check - ensure panel @name matches file name */ - adr_data_t *nameattr = adr_struct_get(panel, "name"); - if (strcmp(adr_data_to_string(nameattr), pname) != 0) { - adr_data_free(panel); - panel = NULL; - } - } - - rad_locale_free(rlocale); - - return (panel); -} - -/* - * Extern functions - */ - -int -_rad_init(void) -{ - dtd = xmlParseDTD(NULL, - (xmlChar *)"/usr/share/lib/xml/dtd/vpanel.dtd.1"); - - adr_name_t *aname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "Panel"); - conerr_t cerr = rad_cont_insert_singleton(rad_container, aname, - &modinfo, &interface_Panel_svr); - adr_name_rele(aname); - if (cerr != CE_OK) { - rad_log(RL_ERROR, "(mod_panels) failed to insert Panel"); - return (-1); - } - - return (0); -} - -/* - * _rad_fini is called by the RAD daemon when the module is unloaded. Any - * module finalisation is completed here. - */ -/*ARGSUSED*/ -void -_rad_fini(void *unused) -{ -} - -/* ARGSUSED */ -conerr_t -interface_Panel_invoke_getPanel(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - const char *pname = adr_data_to_string(args[0]); - const char *locale = args[1] == NULL ? NULL : - adr_data_to_string(args[1]); - - adr_data_t *panel = read_panel(locale, pname); - if (panel == NULL) { - /* - * Could be a memory or system error, but more likely an invalid - * name was specified. - */ - return (CE_OBJECT); - } - *ret = panel; - - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_Panel_read_panelNames(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - adr_data_t *array = adr_data_new_array(&adr_t_array_string, 0); - if (array == NULL) { - return (CE_NOMEM); - } - - DIR *d; - if ((d = opendir(PANELDESCDIR)) == NULL) { - if (errno == ENOENT) { - return (CE_OK); - } - return (CE_SYSTEM); - } - - struct dirent *ent; - while ((ent = readdir(d)) != NULL) { - char *ext = ".xml"; - size_t len = strlen(ent->d_name) - strlen(ext); - if (len < 1 || strcmp(ent->d_name + len, ext) != 0) { - continue; - } - (void) adr_array_add(array, - adr_data_new_nstring(ent->d_name, len)); - } - - (void) closedir(d); - *data = adr_data_purify(array); - - return (*data == NULL ? CE_NOMEM : CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_Panel_invoke_getResource(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - char *file; - conerr_t result = token_to_file(args[0], &file); - if (result != CE_OK) { - return (result); - } - - struct stat st; - if (stat(file, &st) != 0) { - free(file); - return (CE_OBJECT); - } - - char *buffer = malloc(st.st_size); - if (buffer == NULL) { - free(file); - return (CE_NOMEM); - } - - int fd = open(file, O_RDONLY); - free(file); - if (fd == -1) { - free(buffer); - return (CE_PRIV); - } - - if (read(fd, buffer, st.st_size) != st.st_size) { - (void) close(fd); - free(buffer); - return (CE_SYSTEM); - } - - (void) close(fd); - - *ret = adr_data_new_opaque(buffer, st.st_size, LT_FREE); - return (*ret == NULL ? CE_NOMEM : CE_OK); -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/panels/vpanel.dtd.1 --- a/components/visual-panels/core/src/cmd/rad/mod/panels/vpanel.dtd.1 Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/smf_old/Makefile --- a/components/visual-panels/core/src/cmd/rad/mod/smf_old/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -LDLIBS += -lscf - -VERS=.1 -MOD_APIS=smf_old -MOD_OBJS=mod_smf.o propvec.o /usr/lib/libcmdutils.so.1 -MOD_LIBNAME=mod_smf_old.so$(VERS) -MOD_INSTALLDIR=$(RADDIR_MODULE) -APISDIR=../../../../apis - -include $(SRC)/make-rules/Makefile.com - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/smf_old/mod_smf.c --- a/components/visual-panels/core/src/cmd/rad/mod/smf_old/mod_smf.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1957 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "api_smf_old.h" -#include "propvec.h" - -static pthread_mutex_t service_lock = PTHREAD_MUTEX_INITIALIZER; -static list_t service_list; -static list_t instance_list; -static rad_instance_t *agg_inst; -static int service_count = 0; -static int instance_count = 0; - -typedef struct servinst { - char *sname; /* Service name */ - char *iname; /* Instance name */ - char *fmri; /* FMRI */ - rad_instance_t *inst; /* rad object instance */ - boolean_t instance; - - int ninstances; - list_t instances; /* A service's instances */ - list_node_t node; /* Membership in the global list */ - list_node_t snode; /* An instance's membership in its service */ -} servinst_t; - -static const char *framework_pgtypes[] = { - SCF_GROUP_FRAMEWORK, - SCF_GROUP_DEPENDENCY, - SCF_GROUP_METHOD, - SCF_GROUP_TEMPLATE, - SCF_GROUP_TEMPLATE_PG_PATTERN, - SCF_GROUP_TEMPLATE_PROP_PATTERN, - NULL -}; - -static conerr_t -error_scf(adr_data_t **error, int code) -{ - if (error != NULL) { - adr_data_t *e = adr_data_new_struct(&t__SmfError); - adr_struct_set(e, "error", - adr_data_new_enum(&t__SmfErrorCode, code)); - adr_struct_set(e, "message", - adr_data_new_string(scf_strerror(code), LT_CONST)); - *error = adr_data_purify(e); - } - return (CE_OBJECT); -} - -static conerr_t -simple_scf(adr_data_t **error, int result) -{ - if (result == 0) - return (CE_OK); - return (error_scf(error, scf_error())); -} - -static boolean_t -strinset(const char **set, const char *str) -{ - for (; *set != NULL; set++) - if (strcmp(*set, str) == 0) - return (B_TRUE); - return (B_FALSE); -} - -static boolean_t -strnotinset(const char **set, const char *str) -{ - return (!strinset(set, str)); -} - -scf_handle_t * -handle_create(void) -{ - scf_handle_t *h = scf_handle_create(SCF_VERSION); - if (h == NULL) - return (NULL); - - if (scf_handle_bind(h) == -1) { - scf_handle_destroy(h); - return (NULL); - } - return (h); -} - -static int getpgs(servinst_t *si, adr_data_t **data, boolean_t namesonly, - boolean_t(*fp)(const char **, const char *), const char **set, - adr_data_t **error) -{ - conerr_t err = CE_OK; - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_snapshot_t *snap = scf_snapshot_create(scfhandle); - scf_iter_t *iter = scf_iter_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", si->fmri, - scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - if (si->instance) { - if (scf_instance_get_snapshot(instance, "running", snap) != 0 || - scf_iter_instance_pgs_composed(iter, instance, snap) - != SCF_SUCCESS) { - err = error_scf(error, scf_error()); - goto out; - } - } else { - if (scf_iter_service_pgs(iter, service) != SCF_SUCCESS) { - rad_log(RL_WARN, "failed to initialize iterator: %s\n", - scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - } - - adr_data_t *result = namesonly ? - adr_data_new_array(&adr_t_array_string, 5) : - adr_data_new_array(&t_array__PropertyGroup, 5); - while (scf_iter_next_pg(iter, pg) > 0) { - char nbuf[1000]; - char tbuf[1000]; - (void) scf_pg_get_name(pg, nbuf, 1000); - (void) scf_pg_get_type(pg, tbuf, 1000); - - if (fp(set, tbuf)) { - if (namesonly) { - (void) adr_array_add(result, - adr_data_new_string(nbuf, LT_COPY)); - } else { - adr_data_t *pgdata = - adr_data_new_struct(&t__PropertyGroup); - adr_struct_set(pgdata, "name", - adr_data_new_string(nbuf, LT_COPY)); - adr_struct_set(pgdata, "type", - adr_data_new_string(tbuf, LT_COPY)); - (void) adr_array_add(result, pgdata); - } - } - } - - *data = result; - -out: - scf_pg_destroy(pg); - scf_snapshot_destroy(snap); - scf_iter_destroy(iter); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_fmri(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - *data = adr_data_new_string(si->fmri, LT_COPY); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_methodNames(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - const char *pgtypes[] = { SCF_GROUP_METHOD, NULL }; - return (getpgs(rad_instance_getdata(inst), data, B_TRUE, - strinset, pgtypes, error)); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_dependencyNames(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - const char *pgtypes[] = { SCF_GROUP_DEPENDENCY, NULL }; - return (getpgs(rad_instance_getdata(inst), data, B_TRUE, - strinset, pgtypes, error)); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_propertyGroups(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - return (getpgs(rad_instance_getdata(inst), data, B_FALSE, - strnotinset, framework_pgtypes, error)); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_manpages(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - char *title, *section, *path; - rad_propvec_t *badprop; - rad_propvec_t evec[] = { - { SCF_PROPERTY_TM_MANPATH, NULL, SCF_TYPE_USTRING, &path, 0 }, - { SCF_PROPERTY_TM_TITLE, NULL, SCF_TYPE_USTRING, &title, 0 }, - { SCF_PROPERTY_TM_SECTION, NULL, SCF_TYPE_USTRING, §ion, - 0 }, - { NULL } - }; - - const char *pgtypes[] = { - SCF_GROUP_TEMPLATE, - NULL - }; - - adr_data_t *pgs; - conerr_t err = getpgs(si, &pgs, B_TRUE, strinset, pgtypes, error); - if (err != CE_OK) - return (err); - adr_data_t *result = adr_data_new_array(&t_array__Manpage, 5); - for (int i = 0; i < adr_array_size(pgs); i++) { - const char *str = adr_data_to_string(adr_array_get(pgs, i)); - if (strncmp(str, SCF_PG_TM_MAN_PREFIX, - strlen(SCF_PG_TM_MAN_PREFIX)) != 0) { - continue; - } - - if (rad_read_propvec(si->fmri, str, B_FALSE, evec, - &badprop) != 0) - continue; - - adr_data_t *mp = adr_data_new_struct(&t__Manpage); - adr_struct_set(mp, "title", - adr_data_new_string(title, LT_COPY)); - adr_struct_set(mp, "section", - adr_data_new_string(section, LT_COPY)); - adr_struct_set(mp, "path", adr_data_new_string(path, LT_COPY)); - (void) adr_array_add(result, mp); - rad_clean_propvec(evec); - } - adr_data_free(pgs); - *data = result; - - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_doclinks(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - char *uri; - rad_propvec_t *badprop; - rad_propvec_t evec[] = { - { SCF_PROPERTY_TM_URI, NULL, SCF_TYPE_USTRING, &uri, 0 }, - { NULL } - }; - - const char *pgtypes[] = { - SCF_GROUP_TEMPLATE, - NULL - }; - - adr_data_t *pgs; - conerr_t err = getpgs(si, &pgs, B_TRUE, strinset, pgtypes, error); - if (err != CE_OK) - return (err); - adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5); - for (int i = 0; i < adr_array_size(pgs); i++) { - const char *str = adr_data_to_string(adr_array_get(pgs, i)); - if (strncmp(str, SCF_PG_TM_DOC_PREFIX, - strlen(SCF_PG_TM_DOC_PREFIX)) != 0) { - continue; - } - - if (rad_read_propvec(si->fmri, str, B_FALSE, evec, - &badprop) == 0) { - (void) adr_array_add(result, - adr_data_new_string(uri, LT_COPY)); - rad_clean_propvec(evec); - } - } - adr_data_free(pgs); - *data = result; - - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_persistentlyEnabled(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - boolean_t enabled; - rad_propvec_t evec[] = { - { SCF_PROPERTY_ENABLED, NULL, SCF_TYPE_BOOLEAN, &enabled, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - int scferr = rad_read_propvec(si->fmri, SCF_PG_GENERAL, B_FALSE, - evec, &badprop); - if (scferr != 0) - return (error_scf(error, scferr)); - rad_clean_propvec(evec); - - *data = adr_data_new_boolean(enabled); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_temporarilyEnabled(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - boolean_t enabled; - rad_propvec_t evec[] = { - { SCF_PROPERTY_ENABLED, NULL, SCF_TYPE_BOOLEAN, &enabled, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - if (rad_read_propvec(si->fmri, SCF_PG_GENERAL_OVR, B_FALSE, evec, - &badprop) != 0) - return (interface_ServiceInfo_read_persistentlyEnabled( - inst, attr, data, error)); - rad_clean_propvec(evec); - - *data = adr_data_new_boolean(enabled); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_enabled(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - /* - * XXX: The java version always had the same implementation for both. - */ - return (interface_ServiceInfo_read_persistentlyEnabled(inst, attr, data, - error)); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_instance(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - *data = adr_data_new_boolean(si->instance); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_restarter(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - char *fmri = NULL; - rad_propvec_t evec[] = { - { SCF_PROPERTY_RESTARTER, NULL, SCF_TYPE_USTRING, &fmri, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - if (rad_read_propvec(si->fmri, SCF_PG_GENERAL, B_FALSE, evec, - &badprop) == 0) { - *data = adr_data_new_string(fmri, LT_COPY); - rad_clean_propvec(evec); - } else { - *data = adr_data_new_fstring("svc:/%s:%s", - "system/svc/restarter", "default"); - } - - return (*data != NULL ? CE_OK : CE_SYSTEM); -} - -static adr_data_t * -state2enum(const char *state) -{ - if (strcmp(state, SCF_STATE_STRING_UNINIT) == 0) { - return (&e__SmfState_UNINIT); - } else if (strcmp(state, SCF_STATE_STRING_MAINT) == 0) { - return (&e__SmfState_MAINT); - } else if (strcmp(state, SCF_STATE_STRING_LEGACY) == 0) { - return (&e__SmfState_LEGACY); - } else { - return (adr_data_new_enum_byname(&t__SmfState, state)); - } -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_state(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - char *state = smf_get_state(si->fmri); - if (state == NULL) - return (error_scf(error, scf_error())); - - *data = state2enum(state); - free(state); - return (*data != NULL ? CE_OK : CE_SYSTEM); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_nextState(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - char *state = NULL; - rad_propvec_t evec[] = { - { SCF_PROPERTY_NEXT_STATE, NULL, SCF_TYPE_ASTRING, &state, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - int scferr = rad_read_propvec(si->fmri, SCF_PG_RESTARTER, B_FALSE, evec, - &badprop); - if (scferr != 0) - return (error_scf(error, scferr)); - - *data = state2enum(state); - rad_clean_propvec(evec); - return (*data != NULL ? CE_OK : CE_SYSTEM); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_auxiliaryState(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - char *aux; - rad_propvec_t evec[] = { - { SCF_PROPERTY_AUX_STATE, NULL, SCF_TYPE_ASTRING, &aux, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - int scferr = rad_read_propvec(si->fmri, SCF_PG_RESTARTER, B_FALSE, evec, - &badprop); - if (scferr != 0) { - if (scferr == SCF_ERROR_NOT_FOUND) { - *data = NULL; - return (CE_OK); - } - return (error_scf(error, scferr)); - } - - *data = adr_data_new_string(aux, LT_COPY); - rad_clean_propvec(evec); - - return (*data != NULL ? CE_OK : CE_SYSTEM); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_stime(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - scf_time_t time; - rad_propvec_t evec[] = { - { SCF_PROPERTY_STATE_TIMESTAMP, NULL, SCF_TYPE_TIME, &time, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - int scferr = rad_read_propvec(si->fmri, SCF_PG_RESTARTER, B_FALSE, evec, - &badprop); - if (scferr != 0) - return (error_scf(error, scferr)); - - rad_clean_propvec(evec); - - *data = adr_data_new_time(time.t_seconds, time.t_ns); - - return (*data != NULL ? CE_OK : CE_SYSTEM); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_contractID(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - uint64_t count; - rad_propvec_t evec[] = { - { SCF_PROPERTY_CONTRACT, NULL, SCF_TYPE_COUNT, &count, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - int scferr = rad_read_propvec(si->fmri, SCF_PG_RESTARTER, B_FALSE, evec, - &badprop); - if (scferr != 0) - return (error_scf(error, scferr)); - rad_clean_propvec(evec); - - *data = adr_data_new_long(count); - - return (*data != NULL ? CE_OK : CE_SYSTEM); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_read_reason(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - *data = NULL; - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_write_persistentlyEnabled(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t *data, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - boolean_t enable = adr_data_to_boolean(data); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - return (simple_scf(error, enable ? smf_enable_instance(si->fmri, 0) : - smf_disable_instance(si->fmri, 0))); -} - -static conerr_t -get_pg(scf_handle_t *scfhandle, scf_propertygroup_t *pg, servinst_t *si, - const char *snapname, const char *pgname, adr_data_t **error) -{ - conerr_t err = CE_OK; - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_snapshot_t *snap = scf_snapshot_create(scfhandle); - - if (service == NULL || instance == NULL || snap == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - if (si->instance) { - scf_snapshot_t *usesnap = NULL; - if (snapname != NULL) { - usesnap = snap; - if (scf_instance_get_snapshot(instance, snapname, snap) - != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } - if (scf_instance_get_pg_composed(instance, usesnap, pgname, pg) - != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } else { - if (scf_service_get_pg(service, pgname, pg) != SCF_SUCCESS) { - err = error_scf(error, scf_error()); - goto out; - } - } -out: - scf_snapshot_destroy(snap); - scf_instance_destroy(instance); - scf_service_destroy(service); - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getDependency(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - servinst_t *si = rad_instance_getdata(inst); - char type[1000]; - char grouping[1000]; - char restarton[1000]; - - scf_handle_t *scfhandle = handle_create(); - scf_iter_t *iter = scf_iter_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_value_t *val = scf_value_create(scfhandle); - - if (scfhandle == NULL || iter == NULL || pg == NULL || prop == NULL || - val == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - if ((err = get_pg(scfhandle, pg, si, "running", pgname, error)) - != CE_OK) - goto out; - - if (scf_pg_get_type(pg, type, sizeof (type)) == 0) { - err = error_scf(error, scf_error()); - goto out; - } - if (strcmp(type, SCF_GROUP_DEPENDENCY) != 0) { - err = error_scf(error, SCF_ERROR_INVALID_ARGUMENT); - goto out; - } - - if (scf_pg_get_property(pg, SCF_PROPERTY_GROUPING, prop) != 0 || - scf_property_get_value(prop, val) != 0 || - scf_value_get_as_string(val, grouping, sizeof (grouping)) == -1 || - scf_pg_get_property(pg, SCF_PROPERTY_RESTART_ON, prop) != 0 || - scf_property_get_value(prop, val) != 0 || - scf_value_get_as_string(val, restarton, sizeof (restarton)) == -1 || - scf_pg_get_property(pg, SCF_PROPERTY_ENTITIES, prop) != 0 || - scf_iter_property_values(iter, prop) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - - adr_data_t *result = adr_data_new_struct(&t__Dependency); - adr_data_t *array = adr_data_new_array(&adr_t_array_string, 5); - adr_struct_set(result, "name", adr_data_ref(args[0])); - adr_struct_set(result, "grouping", - adr_data_new_string(grouping, LT_COPY)); - adr_struct_set(result, "restartOn", - adr_data_new_string(restarton, LT_COPY)); - adr_struct_set(result, "target", array); - while (scf_iter_next_value(iter, val) > 0) { - if (scf_value_get_as_string(val, type, sizeof (type)) == -1) { - err = error_scf(error, scf_error()); - adr_data_free(result); - goto out; - } - (void) adr_array_add(array, adr_data_new_string(type, LT_COPY)); - } - if (!adr_data_verify(result, NULL, B_TRUE)) { - adr_data_free(result); - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - *ret = result; -out: - scf_value_destroy(val); - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_iter_destroy(iter); - scf_handle_destroy(scfhandle); - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getPropertyNames(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_iter_t *iter = scf_iter_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - - if (scfhandle == NULL || iter == NULL || pg == NULL || prop == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if ((err = get_pg(scfhandle, pg, si, "running", pgname, error)) - != CE_OK) - goto out; - - adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5); - (void) scf_iter_pg_properties(iter, pg); - while (scf_iter_next_property(iter, prop) > 0) { - char pbuf[1000]; - (void) scf_property_get_name(prop, pbuf, 1000); - (void) adr_array_add(result, - adr_data_new_string(pbuf, LT_COPY)); - } - *ret = result; - -out: - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_iter_destroy(iter); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getPropertyType(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - const char *pgname = adr_data_to_string(args[0]); - const char *propname = adr_data_to_string(args[1]); - conerr_t err = CE_OK; - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_type_t type; - - if (scfhandle == NULL || pg == NULL || prop == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - if ((err = get_pg(scfhandle, pg, si, "running", pgname, error)) - != CE_OK) - goto out; - - if (scf_pg_get_property(pg, propname, prop) != 0 || - scf_property_type(prop, &type) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - - adr_data_t *result = adr_data_new_enum(&t__PropertyType, type); - if (result != NULL) - *ret = result; - else - err = error_scf(error, SCF_ERROR_NO_MEMORY); - -out: - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_handle_destroy(scfhandle); - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getPropertyValues(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - const char *propname = adr_data_to_string(args[1]); - - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_snapshot_t *snap = scf_snapshot_create(scfhandle); - scf_iter_t *iter = scf_iter_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_value_t *val = scf_value_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL || - snap == NULL || iter == NULL || pg == NULL || prop == NULL || - prop == NULL || val == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - if ((si->instance ? scf_instance_get_pg(instance, pgname, pg) : - scf_service_get_pg(service, pgname, pg)) != 0 || - scf_pg_get_property(pg, propname, prop) != 0 || - scf_iter_property_values(iter, prop) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - - adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5); - while (scf_iter_next_value(iter, val) > 0) { - char pbuf[1000]; - (void) scf_value_get_as_string(val, pbuf, 1000); - (void) adr_array_add(result, - adr_data_new_string(pbuf, LT_COPY)); - } - *ret = result; -out: - scf_value_destroy(val); - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_iter_destroy(iter); - scf_snapshot_destroy(snap); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getSnapshotPropertyValues(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *snapname = adr_data_to_string(args[0]); - const char *pgname = adr_data_to_string(args[1]); - const char *propname = adr_data_to_string(args[2]); - - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - rad_log(RL_DEBUG, "Reading from snapshot: %s\n", snapname); - - scf_handle_t *scfhandle = handle_create(); - scf_iter_t *iter = scf_iter_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_value_t *val = scf_value_create(scfhandle); - - if (scfhandle == NULL || iter == NULL || pg == NULL || prop == NULL || - val == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if ((err = get_pg(scfhandle, pg, si, "running", pgname, error)) - != CE_OK) - goto out; - if (scf_pg_get_property(pg, propname, prop) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - - adr_data_t *result = adr_data_new_array(&adr_t_array_string, 5); - (void) scf_iter_property_values(iter, prop); - while (scf_iter_next_value(iter, val) > 0) { - char pbuf[1000]; - (void) scf_value_get_as_string(val, pbuf, 1000); - (void) adr_array_add(result, - adr_data_new_string(pbuf, LT_COPY)); - } - *ret = result; -out: - scf_value_destroy(val); - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_iter_destroy(iter); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_setPropertyValues(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - const char *propname = adr_data_to_string(args[1]); - adr_data_t *values = args[2]; - - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_transaction_t *tx = scf_transaction_create(scfhandle); - scf_transaction_entry_t *ent = scf_entry_create(scfhandle); - scf_value_t **val = - rad_zalloc(adr_array_size(values) * sizeof (scf_value_t *)); - scf_type_t type; - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL || prop == NULL || tx == NULL || ent == NULL || - val == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - for (int i = 0; i < adr_array_size(values); i++) { - if ((val[i] = scf_value_create(scfhandle)) == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - if (si->instance) { - /* XXX: silly logic from original java */ - if (scf_instance_get_pg(instance, pgname, pg) != 0 && - scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } else { - if (scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } - - if (scf_pg_get_property(pg, propname, prop) != 0 || - scf_property_type(prop, &type) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - -top: - if (scf_transaction_start(tx, pg) == -1) { - err = error_scf(error, scf_error()); - goto out; - } - if (scf_transaction_property_change(tx, ent, propname, type) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - - for (int i = 0; i < adr_array_size(values); i++) { - if (scf_value_set_from_string(val[i], type, - adr_data_to_string(adr_array_get(values, i))) != 0 || - scf_entry_add_value(ent, val[i]) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } - - int txret = scf_transaction_commit(tx); - if (txret == 1) - goto out; - if (txret == 0 && scf_pg_update(pg) != -1) { - scf_transaction_reset(tx); - goto top; - } - err = error_scf(error, scf_error()); - -out: - if (val != NULL) { - for (int i = 0; i < adr_array_size(values); i++) { - if (val[i] == NULL) - break; - scf_value_destroy(val[i]); - } - free(val); - } - - scf_entry_destroy(ent); - scf_transaction_destroy(tx); - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_createPropertyGroup(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - const char *pgtype = adr_data_to_string(args[1]); - - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - if (si->instance) { - if (scf_instance_add_pg(instance, pgname, pgtype, 0, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } else { - if (scf_service_add_pg(service, pgname, pgtype, 0, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } - -out: - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_deletePropertyGroup(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - if (si->instance) { - /* XXX: silly logic from original java */ - if (scf_instance_get_pg(instance, pgname, pg) != 0 && - scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } else { - if (scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } - - if (scf_pg_delete(pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } -out: - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_createProperty(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - const char *propname = adr_data_to_string(args[1]); - scf_type_t type = adr_enum_tovalue(args[2]); - int sret; - - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_transaction_t *tx = scf_transaction_create(scfhandle); - scf_transaction_entry_t *ent = scf_entry_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL || tx == NULL || ent == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - if (si->instance) { - /* XXX: silly logic from original java */ - if (scf_instance_get_pg(instance, pgname, pg) != 0 && - scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } else { - if (scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } - -top: - if (scf_transaction_start(tx, pg) == -1) { - err = error_scf(error, scf_error()); - goto out; - } - sret = scf_transaction_property_change(tx, ent, propname, type); - if (sret == -1 && scf_error() == SCF_ERROR_NOT_FOUND) - sret = scf_transaction_property_new(tx, ent, propname, type); - if (sret == -1) { - err = error_scf(error, scf_error()); - goto out; - } - - sret = scf_transaction_commit(tx); - if (sret == 1) - goto out; - if (sret == 0 && scf_pg_update(pg) != -1) { - scf_transaction_reset(tx); - goto top; - } - err = error_scf(error, scf_error()); - -out: - scf_entry_destroy(ent); - scf_transaction_destroy(tx); - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_deleteProperty(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - const char *propname = adr_data_to_string(args[1]); - int sret; - - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_transaction_t *tx = scf_transaction_create(scfhandle); - scf_transaction_entry_t *ent = scf_entry_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL || tx == NULL || ent == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - if (si->instance) { - /* XXX: really, really silly logic from original java */ - if (scf_instance_get_pg(instance, pgname, pg) != 0 && - scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } else { - if (scf_service_get_pg(service, pgname, pg) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - } - -top: - if (scf_transaction_start(tx, pg) == -1) { - err = error_scf(error, scf_error()); - goto out; - } - if (scf_transaction_property_delete(tx, ent, propname) != 0) { - err = error_scf(error, scf_error()); - goto out; - } - - sret = scf_transaction_commit(tx); - if (sret == 1) - goto out; - if (sret == 0 && scf_pg_update(pg) != -1) { - scf_transaction_reset(tx); - goto top; - } - err = error_scf(error, scf_error()); - -out: - scf_entry_destroy(ent); - scf_transaction_destroy(tx); - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getPropertyTemplate(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - conerr_t err = CE_OK; - const char *pgname = adr_data_to_string(args[0]); - const char *propname = adr_data_to_string(args[1]); - const char *locale = adr_data_to_string(args[2]); - - servinst_t *si = rad_instance_getdata(inst); - scf_handle_t *scfhandle = handle_create(); - scf_pg_tmpl_t *pgtmpl = scf_tmpl_pg_create(scfhandle); - scf_prop_tmpl_t *proptmpl = scf_tmpl_prop_create(scfhandle); - - if (scfhandle == NULL || pgtmpl == NULL || proptmpl == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_tmpl_get_by_pg_name(si->fmri, NULL, pgname, NULL, pgtmpl, - 0) == -1 || - scf_tmpl_get_by_prop(pgtmpl, propname, proptmpl, 0) == -1) { - err = error_scf(error, scf_error()); - goto out; - } - - adr_data_t *result = adr_data_new_struct(&t__Template); - - char *name; - if (scf_tmpl_prop_common_name(proptmpl, locale, &name) >= 0) - adr_struct_set(result, "name", - adr_data_new_string(name, LT_FREE)); - - if (scf_tmpl_prop_description(proptmpl, locale, &name) >= 0) - adr_struct_set(result, "description", - adr_data_new_string(name, LT_FREE)); - - if (scf_tmpl_prop_units(proptmpl, locale, &name) >= 0) - adr_struct_set(result, "units", - adr_data_new_string(name, LT_FREE)); - - uint8_t vis; - if (scf_tmpl_prop_visibility(proptmpl, &vis) == -1) { - adr_data_free(result); - goto out; - } - adr_data_t *visvalue = NULL; - switch (vis) { - case SCF_TMPL_VISIBILITY_HIDDEN: - visvalue = &e__PropertyVisibility_HIDDEN; - break; - case SCF_TMPL_VISIBILITY_READONLY: - visvalue = &e__PropertyVisibility_READONLY; - break; - case SCF_TMPL_VISIBILITY_READWRITE: - visvalue = &e__PropertyVisibility_READWRITE; - break; - } - adr_struct_set(result, "visibility", visvalue); - - scf_values_t values; - if (scf_tmpl_prop_internal_seps(proptmpl, &values) == 0) { - adr_data_t *array = - adr_data_new_array(&adr_t_array_string, values.value_count); - for (int i = 0; i < values.value_count; i++) - (void) adr_array_add(array, adr_data_new_string( - values.values_as_strings[i], LT_COPY)); - adr_struct_set(result, "separators", array); - scf_values_destroy(&values); - } - - if (scf_tmpl_value_name_choices(proptmpl, &values) == 0) { - adr_data_t *array = - adr_data_new_array(&adr_t_array_string, values.value_count); - for (int i = 0; i < values.value_count; i++) - (void) adr_array_add(array, adr_data_new_string( - values.values_as_strings[i], LT_COPY)); - adr_struct_set(result, "allowed", array); - scf_values_destroy(&values); - } - - if ((*ret = adr_data_purify_deep(result)) == NULL) - err = error_scf(error, SCF_ERROR_NO_MEMORY); -out: - scf_tmpl_prop_destroy(proptmpl); - scf_tmpl_pg_destroy(pgtmpl); - scf_handle_destroy(scfhandle); - - return (err); -} - -static int -get_localedprop(servinst_t *si, const char *locale, const char *name, - adr_data_t **ret, adr_data_t **error) -{ - char *str; - rad_propvec_t *badprop; - rad_propvec_t evec[] = { - { locale, NULL, SCF_TYPE_ASTRING, &str, 0 }, - { NULL } - }; - - int scferr = rad_read_propvec(si->fmri, name, si->instance, evec, - &badprop); - if (scferr != 0) { - if (error != NULL && scferr == SCF_ERROR_NOT_FOUND) { - *ret = NULL; - return (CE_OK); - } - return (error_scf(error, scferr)); - } - - *ret = adr_data_new_string(str, LT_COPY); - rad_clean_propvec(evec); - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getCommonName(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - const char *locale = adr_data_to_string(args[0]); - servinst_t *si = rad_instance_getdata(inst); - - if (get_localedprop(si, locale, SCF_PG_TM_COMMON_NAME, ret, NULL) - == CE_OK) - return (CE_OK); - return (get_localedprop(si, "C", SCF_PG_TM_COMMON_NAME, ret, error)); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getDescription(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - const char *locale = adr_data_to_string(args[0]); - servinst_t *si = rad_instance_getdata(inst); - - if (get_localedprop(si, locale, SCF_PG_TM_DESCRIPTION, ret, NULL) - == CE_OK) - return (CE_OK); - return (get_localedprop(si, "C", SCF_PG_TM_DESCRIPTION, ret, error)); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_getLogInfo(rad_instance_t *inst, - adr_method_t *meth, adr_data_t **ret, adr_data_t **args, int count, - adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (CE_OBJECT); - - char *logname = NULL; - rad_propvec_t evec[] = { - { SCF_PROPERTY_LOGFILE, NULL, SCF_TYPE_USTRING, &logname, 0 }, - { NULL } - }; - - rad_propvec_t *badprop; - int errval = rad_read_propvec(si->fmri, SCF_PG_RESTARTER, B_FALSE, - evec, &badprop); - if (errval != 0) - return (CE_OBJECT); - - struct stat st; - if (stat(logname, &st) != 0) { - free(logname); - return (CE_OBJECT); - } - - int max_size = adr_data_to_integer(args[0]); - - int bsize = max_size >= 0 && max_size < st.st_size ? - max_size : st.st_size; - char *buffer = malloc(bsize); - if (buffer == NULL) { - free(logname); - return (CE_NOMEM); - } - - int fd; - if ((fd = open(logname, O_RDONLY)) == -1) { - free(buffer); - free(logname); - return (CE_PRIV); - } - - if (pread(fd, buffer, bsize, st.st_size - bsize) != bsize) { - (void) close(fd); - free(buffer); - free(logname); - return (CE_SYSTEM); - } - - (void) close(fd); - - adr_data_t *result = adr_data_new_struct(&t__LogInfo); - adr_struct_set(result, "name", adr_data_new_string(logname, LT_FREE)); - adr_struct_set(result, "size", adr_data_new_integer(st.st_size)); - adr_struct_set(result, "MTime", adr_data_new_time_ts(&st.st_mtim)); - adr_struct_set(result, "contents", - adr_data_new_opaque(buffer, bsize, LT_FREE)); - - if ((*ret = adr_data_purify(result)) == NULL) - return (CE_OBJECT); - - return (CE_OK); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_delete(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - conerr_t err = CE_OK; - servinst_t *si = rad_instance_getdata(inst); - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, si->instance ? - SCF_DECODE_FMRI_REQUIRE_INSTANCE : - SCF_DECODE_FMRI_REQUIRE_NO_INSTANCE) != SCF_SUCCESS) { - rad_log(RL_WARN, "Couldn't decode '%s': %s\n", - si->fmri, scf_strerror(scf_error())); - err = error_scf(error, scf_error()); - goto out; - } - - err = simple_scf(error, si->instance ? - scf_instance_delete(instance) : scf_service_delete(service)); -out: - scf_service_destroy(service); - scf_instance_destroy(instance); - scf_handle_destroy(scfhandle); - return (err); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_clear(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - return (simple_scf(error, smf_restore_instance(si->fmri))); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_degrade(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - return (simple_scf(error, smf_degrade_instance(si->fmri, - adr_data_to_boolean(args[0]) ? SMF_IMMEDIATE : 0))); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_maintain(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - return (simple_scf(error, smf_maintain_instance(si->fmri, - adr_data_to_boolean(args[0]) ? SMF_IMMEDIATE : 0))); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_restart(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - return (simple_scf(error, smf_restart_instance(si->fmri))); -} - -/* ARGSUSED */ -conerr_t -interface_ServiceInfo_invoke_refresh(rad_instance_t *inst, adr_method_t *meth, - adr_data_t **ret, adr_data_t **args, int count, adr_data_t **error) -{ - servinst_t *si = rad_instance_getdata(inst); - if (!si->instance) - return (error_scf(error, SCF_ERROR_INVALID_ARGUMENT)); - - return (simple_scf(error, smf_refresh_instance(si->fmri))); -} - -/* ARGSUSED */ -conerr_t -interface_Aggregator_read_services(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - rad_mutex_enter(&service_lock); - adr_data_t *result = - adr_data_new_array(&t_array__Service, service_count); - - for (servinst_t *si = list_head(&service_list); si != NULL; - si = list_next(&service_list, si)) { - adr_data_t *insts = adr_data_new_array(&adr_t_array_string, - si->ninstances); - for (servinst_t *i = list_head(&si->instances); i != NULL; - i = list_next(&si->instances, i)) - (void) adr_array_add(insts, - adr_data_new_string(i->iname, - LT_COPY)); - - adr_data_t *service = adr_data_new_struct(&t__Service); - adr_struct_set(service, "fmri", - adr_data_new_string(si->fmri, LT_COPY)); - adr_struct_set(service, "objectName", - rad_instance_getname(si->inst)); - adr_struct_set(service, "instances", insts); - (void) adr_array_add(result, service); - } - - if (adr_data_verify(result, NULL, B_TRUE)) - *data = result; - else - adr_data_free(result); - - rad_mutex_exit(&service_lock); - return (*data != NULL ? CE_OK : CE_OBJECT); -} - -/* ARGSUSED */ -conerr_t -interface_Aggregator_read_instances(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - conerr_t err = CE_OK; - - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_value_t *val = scf_value_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL || prop == NULL || prop == NULL || - val == NULL) { - err = error_scf(error, SCF_ERROR_NO_MEMORY); - goto out; - } - - rad_mutex_enter(&service_lock); - adr_data_t *result = adr_data_new_array(&t_array__Instance, - instance_count); - - /* - * It would be easy to iterate over all instances -- not just the - * ones we know about -- but until we dynamically add and remove - * their MBeans we'll stick to our list to avoid confusion. - */ - for (servinst_t *si = list_head(&instance_list); si != NULL; - si = list_next(&instance_list, si)) { - - char statestr[MAX_SCF_STATE_STRING_SZ]; - ssize_t len; - int64_t seconds; - int32_t ns; - - if (scf_handle_decode_fmri(scfhandle, si->fmri, NULL, service, - instance, NULL, NULL, 0) != SCF_SUCCESS) - continue; - if (scf_instance_get_pg(instance, SCF_PG_RESTARTER, pg) != 0) - continue; - - if (scf_pg_get_property(pg, SCF_PROPERTY_STATE, prop) != 0 || - scf_property_get_value(prop, val) != 0 || - (len = scf_value_get_as_string(val, statestr, - MAX_SCF_STATE_STRING_SZ)) == -1 || - len > MAX_SCF_STATE_STRING_SZ - 1) - continue; - - if (scf_pg_get_property(pg, SCF_PROPERTY_STATE_TIMESTAMP, - prop) != 0 || scf_property_get_value(prop, val) != 0 || - scf_value_get_time(val, &seconds, &ns) != 0) - continue; - - adr_data_t *inst = adr_data_new_struct(&t__Instance); - adr_struct_set(inst, "fmri", - adr_data_new_string(si->fmri, LT_COPY)); - adr_struct_set(inst, "objectName", - rad_instance_getname(si->inst)); - adr_struct_set(inst, "STime", adr_data_new_time(seconds, ns)); - adr_struct_set(inst, "state", state2enum(statestr)); - if (!adr_data_verify(inst, NULL, B_TRUE)) - adr_data_free(inst); - else - (void) adr_array_add(result, inst); - } - - if ((*data = adr_data_purify(result)) == NULL) - err = CE_OBJECT; - rad_mutex_exit(&service_lock); -out: - scf_value_destroy(val); - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -static rad_moderr_t -notify_thread(rad_thread_t *arg) -{ - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - char fmri[5]; - char sname[1000], iname[1000]; - servinst_t *si; - int ret; - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL || - _scf_notify_add_pgtype(scfhandle, SCF_GROUP_FRAMEWORK) != 0) - goto out; - - rad_thread_ack(arg, RM_OK); - while ((ret = _scf_notify_wait(pg, fmri, 5)) >= 0) { - rad_log(RL_DEBUG, "received SMF event"); - - if (ret > 0) - continue; /* We should care */ - - if (scf_pg_get_parent_instance(pg, instance) != 0 || - scf_instance_get_parent(instance, service) != 0 || - scf_instance_get_name(instance, iname, 1000) == -1 || - scf_service_get_name(service, sname, 1000) == -1) - continue; - - rad_mutex_enter(&service_lock); - - for (si = list_head(&instance_list); si != NULL; - si = list_next(&instance_list, si)) - if (strcmp(si->iname, iname) == 0 && - strcmp(si->sname, sname) == 0) - break; - - if (si == NULL) { - rad_mutex_exit(&service_lock); - continue; - } - - rad_log(RL_DEBUG, "identified SMF event: %s/%s", sname, iname); - - adr_data_t *stime = NULL, *state = NULL, *nstate = NULL; - adr_data_t *astate = NULL, *reason = NULL; - - /* Inefficient, but expedient */ - (void) interface_ServiceInfo_read_stime(si->inst, NULL, &stime, - NULL); - (void) interface_ServiceInfo_read_state(si->inst, NULL, &state, - NULL); - (void) interface_ServiceInfo_read_nextState(si->inst, NULL, - &nstate, NULL); - (void) interface_ServiceInfo_read_auxiliaryState(si->inst, NULL, - &astate, NULL); - (void) interface_ServiceInfo_read_reason(si->inst, NULL, - &reason, NULL); - - adr_data_t *event = adr_data_new_struct(&t__StateChange); - adr_struct_set(event, "source", - rad_instance_getname(si->inst)); - adr_struct_set(event, "state", state); - adr_struct_set(event, "nextState", nstate); - adr_struct_set(event, "stateTime", stime); - adr_struct_set(event, "auxState", astate); - adr_struct_set(event, "reason", reason); - adr_struct_set(event, "anomaly", adr_data_new_boolean(B_FALSE)); - if (adr_data_verify(event, NULL, B_FALSE)) { - rad_log(RL_DEBUG, "sending SMF event"); - if (agg_inst != NULL) - rad_instance_notify(agg_inst, "statechange", - 0, adr_data_ref(event)); - rad_instance_notify(si->inst, "statechange", 0, event); - } else { - rad_log(RL_DEBUG, "failed to send SMF event"); - adr_data_free(event); - } - - rad_mutex_exit(&service_lock); - } - rad_log(RL_ERROR, "_scf_notify_wait failed: %s", - scf_strerror(scf_error())); - - /* XXX: reestablish on configd death */ -out: - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - rad_log(RL_ERROR, "exiting SMF event loop"); - - return (RM_SYSTEM); -} - -static servinst_t * -make_service(char *sname, char *iname) -{ - adr_name_t *objname; - boolean_t inst = iname != NULL; - servinst_t *si = rad_zalloc(sizeof (servinst_t)); - si->sname = strdup(sname); - si->iname = inst ? strdup(iname) : NULL; - /* LINTED */ - if (si->instance = inst) { - (void) asprintf(&si->fmri, "svc:/%s:%s", sname, iname); - objname = adr_name_vcreate(MOD_DOMAIN, 3, - "type", "ServiceInfo", "service", sname, "instance", iname); - } else { - list_create(&si->instances, sizeof (servinst_t), - offsetof(servinst_t, snode)); - (void) asprintf(&si->fmri, "svc:/%s", sname); - objname = adr_name_vcreate(MOD_DOMAIN, 2, - "type", "ServiceInfo", "service", sname); - } - - si->inst = rad_instance_create(objname, &modinfo, - &interface_ServiceInfo_svr, si, NULL); - (void) rad_cont_insert(rad_container, si->inst, INST_ID_PICK); - - if (inst) { - list_insert_tail(&instance_list, si); - instance_count++; - } else { - list_insert_tail(&service_list, si); - service_count++; - } - - - return (si); -} - -int -_rad_init(void) -{ - adr_name_t *aname; - conerr_t cerr; - - list_create(&service_list, sizeof (servinst_t), - offsetof(servinst_t, node)); - list_create(&instance_list, sizeof (servinst_t), - offsetof(servinst_t, node)); - - scf_handle_t *scfhandle = handle_create(); - scf_scope_t *scope = scf_scope_create(scfhandle); - scf_iter_t *siter = scf_iter_create(scfhandle); - scf_iter_t *iiter = scf_iter_create(scfhandle); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - - (void) scf_handle_get_scope(scfhandle, SCF_SCOPE_LOCAL, scope); - (void) scf_iter_scope_services(siter, scope); - while (scf_iter_next_service(siter, service) > 0) { - char svcname[1000]; - (void) scf_service_get_name(service, svcname, 1000); - servinst_t *svc = make_service(svcname, NULL); - (void) scf_iter_service_instances(iiter, service); - while (scf_iter_next_instance(iiter, instance) > 0) { - char instname[1000]; - (void) scf_instance_get_name(instance, instname, 1000); - list_insert_tail(&svc->instances, - make_service(svcname, instname)); - svc->ninstances++; - } - } - - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_iter_destroy(iiter); - scf_iter_destroy(siter); - scf_scope_destroy(scope); - scf_handle_destroy(scfhandle); - - aname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "Aggregator"); - cerr = rad_cont_insert_singleton(rad_container, aname, - &modinfo, &interface_Aggregator_svr); - adr_name_rele(aname); - if (cerr != CE_OK) { - rad_log(RL_ERROR, "(mod_smf) failed to insert Aggregator"); - return (-1); - } - - if (rad_thread_create(notify_thread, NULL) != RM_OK) - rad_log(RL_ERROR, "failed to start SMF listener"); - return (0); -} - -/* - * _rad_fini is called by the RAD daemon when the module is unloaded. Any - * module finalisation is completed here. - */ -/*ARGSUSED*/ -void -_rad_fini(void *unused) -{ -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/smf_old/propvec.c --- a/components/visual-panels/core/src/cmd/rad/mod/smf_old/propvec.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,254 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "propvec.h" - -extern scf_handle_t *handle_create(void); - -static scf_type_t -scf_true_base_type(scf_type_t type) -{ - scf_type_t base = type; - - do { - type = base; - (void) scf_type_base_type(type, &base); - } while (base != type); - - return (base); -} - -/* - * Convenience routine which frees all strings and opaque data - * allocated by scf_read_propvec. - * - * Like free(3C), this function preserves the value of errno. - */ -void -rad_clean_propvec(rad_propvec_t *propvec) -{ - int saved_errno = errno; - rad_propvec_t *prop; - - for (prop = propvec; prop->pv_prop != NULL; prop++) { - assert(prop->pv_type != SCF_TYPE_INVALID); - if (prop->pv_type == SCF_TYPE_OPAQUE) { - rad_opaque_t *o = prop->pv_ptr; - - if (o->so_addr != NULL) - free(o->so_addr); - } else if (scf_true_base_type(prop->pv_type) == - SCF_TYPE_ASTRING) { - if (*(char **)prop->pv_ptr != NULL) - free(*(char **)prop->pv_ptr); - } - } - - errno = saved_errno; -} - -/* - * Reads a vector of properties from the specified fmri/property group. - * If 'running' is true, reads from the running snapshot instead of the - * editing snapshot. - * - * For string types, a buffer is allocated using malloc(3C) to hold the - * zero-terminated string, a pointer to which is stored in the - * caller-provided char **. It is the caller's responsbility to free - * this string. To simplify error handling, unread strings are - * initialized to NULL. - * - * For opaque types, a buffer is allocated using malloc(3C) to hold the - * opaque data. A pointer to this buffer and its size are stored in - * the caller-provided rad_opaque_t. It is the caller's responsibility - * to free this buffer. To simplify error handling, the address fields - * for unread opaque data are initialized to NULL. - * - * All other data is stored directly in caller-provided variables or - * structures. - * - * If this function fails to read a specific property, *badprop is set - * to point at that property's entry in the properties array. - * - * On all failures, all memory allocated by this function is freed. - */ -int -rad_read_propvec(const char *fmri, const char *pgname, boolean_t running, - rad_propvec_t *properties, rad_propvec_t **badprop) -{ - scf_handle_t *h = handle_create(); - scf_service_t *s = scf_service_create(h); - scf_instance_t *i = scf_instance_create(h); - scf_snapshot_t *snap = running ? scf_snapshot_create(h) : NULL; - scf_propertygroup_t *pg = scf_pg_create(h); - scf_property_t *p = scf_property_create(h); - scf_value_t *v = scf_value_create(h); - boolean_t instance = B_TRUE; - rad_propvec_t *prop; - int error = 0; - - for (prop = properties; prop->pv_prop != NULL; prop++) { - if (prop->pv_type == SCF_TYPE_OPAQUE) - ((rad_opaque_t *)prop->pv_ptr)->so_addr = NULL; - else if (scf_true_base_type(prop->pv_type) == SCF_TYPE_ASTRING) - *((char **)prop->pv_ptr) = NULL; - } - - if (h == NULL || s == NULL || i == NULL || (running && snap == NULL) || - pg == NULL || p == NULL || v == NULL) - goto scferror; - - if (scf_handle_decode_fmri(h, fmri, NULL, s, i, NULL, NULL, 0) == -1) - goto scferror; - - if (scf_instance_to_fmri(i, NULL, 0) == -1) { - if (scf_error() != SCF_ERROR_NOT_SET) - goto scferror; - instance = B_FALSE; - } - - if (running) { - if (!instance) { - error = SCF_ERROR_TYPE_MISMATCH; - goto out; - } - - if (scf_instance_get_snapshot(i, "running", snap) != - SCF_SUCCESS) - goto scferror; - } - - if ((instance ? scf_instance_get_pg_composed(i, snap, pgname, pg) : - scf_service_get_pg(s, pgname, pg)) == -1) - goto scferror; - - for (prop = properties; prop->pv_prop != NULL; prop++) { - int ret = 0; - - if (scf_pg_get_property(pg, prop->pv_prop, p) == -1 || - scf_property_get_value(p, v) == -1) { - *badprop = prop; - goto scferror; - } - switch (prop->pv_type) { - case SCF_TYPE_BOOLEAN: { - uint8_t b; - - ret = scf_value_get_boolean(v, &b); - if (ret == -1) - break; - if (prop->pv_aux != 0) { - uint64_t *bits = prop->pv_ptr; - *bits = b ? (*bits | prop->pv_aux) : - (*bits & ~prop->pv_aux); - } else { - boolean_t *bool = prop->pv_ptr; - *bool = b ? B_TRUE : B_FALSE; - } - break; - } - case SCF_TYPE_COUNT: - ret = scf_value_get_count(v, prop->pv_ptr); - break; - case SCF_TYPE_INTEGER: - ret = scf_value_get_integer(v, prop->pv_ptr); - break; - case SCF_TYPE_TIME: { - scf_time_t *time = prop->pv_ptr; - - ret = scf_value_get_time(v, &time->t_seconds, - &time->t_ns); - break; - } - case SCF_TYPE_OPAQUE: { - rad_opaque_t *opaque = prop->pv_ptr; - ssize_t size = scf_value_get_opaque(v, NULL, 0); - - if (size == -1) { - *badprop = prop; - goto scferror; - } - if ((opaque->so_addr = malloc(size)) == NULL) { - error = SCF_ERROR_NO_MEMORY; - rad_clean_propvec(properties); - goto out; - } - opaque->so_size = size; - ret = scf_value_get_opaque(v, opaque->so_addr, size); - break; - } - default: { - char *s; - ssize_t size; - - assert(scf_true_base_type(prop->pv_type) == - SCF_TYPE_ASTRING); - - size = scf_value_get_astring(v, NULL, 0); - if (size == -1) { - *badprop = prop; - goto scferror; - } - if ((s = malloc(++size)) == NULL) { - error = SCF_ERROR_NO_MEMORY; - rad_clean_propvec(properties); - goto out; - } - ret = scf_value_get_astring(v, s, size); - *(char **)prop->pv_ptr = s; - } - - if (ret == -1) { - *badprop = prop; - goto scferror; - } - - } - } - - goto out; - -scferror: - error = scf_error(); - rad_clean_propvec(properties); -out: - scf_value_destroy(v); - scf_property_destroy(p); - scf_pg_destroy(pg); - scf_snapshot_destroy(snap); - scf_instance_destroy(i); - scf_service_destroy(s); - scf_handle_destroy(h); - - return (error); -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/cmd/rad/mod/smf_old/propvec.h --- a/components/visual-panels/core/src/cmd/rad/mod/smf_old/propvec.h Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - */ - -#ifndef _PROPVEC_H -#define _PROPVEC_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - void *so_addr; - size_t so_size; -} rad_opaque_t; - -typedef struct { - const char *pv_prop; - const char *pv_desc; - scf_type_t pv_type; - void *pv_ptr; - uint64_t pv_aux; -} rad_propvec_t; - -void rad_clean_propvec(rad_propvec_t *); -int rad_read_propvec(const char *, const char *, boolean_t, - rad_propvec_t *, rad_propvec_t **); - -#ifdef __cplusplus -} -#endif - -#endif /* _PROPVEC_H */ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/smf-old/build.xml --- a/components/visual-panels/core/src/java/smf-old/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/smf-old/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -28,15 +28,12 @@ - - - - + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/app/browser/build.xml --- a/components/visual-panels/core/src/java/vpanels/app/browser/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/app/browser/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -34,6 +34,7 @@ + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/BrowserPanelDescriptor.java --- a/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/BrowserPanelDescriptor.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/BrowserPanelDescriptor.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panels.browser.client.swing; @@ -31,6 +31,8 @@ import com.oracle.solaris.rad.client.RadObjectException; import com.oracle.solaris.vp.panel.common.*; import com.oracle.solaris.vp.panel.common.api.panel.*; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; +import com.oracle.solaris.vp.panel.common.api.panels.Panel; import com.oracle.solaris.vp.panel.common.control.*; import com.oracle.solaris.vp.panel.common.model.*; import com.oracle.solaris.vp.panel.swing.control.PanelFrameControl; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/PanelManagedObject.java --- a/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/PanelManagedObject.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/PanelManagedObject.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,12 +20,12 @@ */ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panels.browser.client.swing; -import com.oracle.solaris.vp.panel.common.api.panel.CustomPanel; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; import com.oracle.solaris.vp.panel.common.model.*; import com.oracle.solaris.vp.util.misc.ObjectUtil; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/PanelPanel.java --- a/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/PanelPanel.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/app/browser/com/oracle/solaris/vp/panels/browser/client/swing/PanelPanel.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,13 +20,13 @@ */ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panels.browser.client.swing; import javax.swing.DefaultListModel; -import com.oracle.solaris.vp.panel.common.api.panel.*; +import com.oracle.solaris.vp.panel.common.api.panels.*; @SuppressWarnings({"serial"}) public class PanelPanel extends PanelDialog diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/client/build.xml --- a/components/visual-panels/core/src/java/vpanels/client/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/client/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -44,10 +44,6 @@ This target can only be used within NetBeans. - - - - @@ -61,13 +57,12 @@ + + + + - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/ErrorPanelDescriptor.java --- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/ErrorPanelDescriptor.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/ErrorPanelDescriptor.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,12 +20,12 @@ */ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.client.common; -import com.oracle.solaris.vp.panel.common.api.panel.CustomPanel; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; import com.oracle.solaris.vp.panel.common.model.*; /** diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelDescriptorFactory.java --- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelDescriptorFactory.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelDescriptorFactory.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.client.common; @@ -31,7 +31,7 @@ import java.util.logging.*; import com.oracle.solaris.vp.panel.common.*; import com.oracle.solaris.vp.panel.common.action.ActionAbortedException; -import com.oracle.solaris.vp.panel.common.api.panel.CustomPanel; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; import com.oracle.solaris.vp.panel.common.model.PanelDescriptor; import com.oracle.solaris.vp.util.misc.finder.Finder; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelResourceManager.java --- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelResourceManager.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/common/PanelResourceManager.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.client.common; @@ -32,6 +32,9 @@ import com.oracle.solaris.vp.panel.common.*; import com.oracle.solaris.vp.panel.common.action.ActionAbortedException; import com.oracle.solaris.vp.panel.common.api.panel.*; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; +import com.oracle.solaris.vp.panel.common.api.panels.Panel; +import com.oracle.solaris.vp.panel.common.api.panels.ResourceDescriptor; import com.oracle.solaris.vp.util.misc.*; import com.oracle.solaris.vp.util.misc.finder.Finder; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppPanelResourceManager.java --- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppPanelResourceManager.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppPanelResourceManager.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.client.swing; @@ -30,7 +30,7 @@ import com.oracle.solaris.vp.client.common.*; import com.oracle.solaris.vp.panel.common.*; import com.oracle.solaris.vp.panel.common.action.ActionAbortedException; -import com.oracle.solaris.vp.panel.common.api.panel.CustomPanel; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; import com.oracle.solaris.vp.panel.common.view.BusyIndicator; public class AppPanelResourceManager extends PanelResourceManager { diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppRootControl.java --- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppRootControl.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/AppRootControl.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.client.swing; @@ -35,6 +35,7 @@ import com.oracle.solaris.vp.panel.common.*; import com.oracle.solaris.vp.panel.common.action.ActionAbortedException; import com.oracle.solaris.vp.panel.common.api.panel.*; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; import com.oracle.solaris.vp.panel.common.control.*; import com.oracle.solaris.vp.panel.common.model.PanelDescriptor; import com.oracle.solaris.vp.panel.swing.control.SwingNavigator; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/SwingErrorPanelDescriptor.java --- a/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/SwingErrorPanelDescriptor.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/client/com/oracle/solaris/vp/client/swing/SwingErrorPanelDescriptor.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.client.swing; @@ -31,7 +31,7 @@ import javax.swing.*; import com.oracle.solaris.vp.client.common.ErrorPanelDescriptor; import com.oracle.solaris.vp.panel.common.ClientContext; -import com.oracle.solaris.vp.panel.common.api.panel.CustomPanel; +import com.oracle.solaris.vp.panel.common.api.panels.CustomPanel; import com.oracle.solaris.vp.panel.common.control.*; import com.oracle.solaris.vp.panel.common.model.*; import com.oracle.solaris.vp.panel.swing.control.*; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/panel/build.xml --- a/components/visual-panels/core/src/java/vpanels/panel/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/panel/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -28,14 +28,6 @@ - - - - - - - - @@ -45,6 +37,11 @@ + + + + + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFile.java --- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFile.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFile.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panel.common.api.file; @@ -28,6 +28,7 @@ import java.io.*; import java.util.List; import com.oracle.solaris.rad.client.RadObjectException; +import com.oracle.solaris.vp.panel.common.api.files.*; @SuppressWarnings({"serial"}) public class RemoteFile extends File { diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFileSystemView.java --- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFileSystemView.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFileSystemView.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panel.common.api.file; @@ -32,6 +32,7 @@ import javax.swing.filechooser.FileSystemView; import com.oracle.solaris.rad.client.RadObjectException; import com.oracle.solaris.vp.panel.common.*; +import com.oracle.solaris.vp.panel.common.api.files.*; import com.oracle.solaris.vp.util.misc.IOUtil; public class RemoteFileSystemView extends FileSystemView { diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/panel/PanelBeanTracker.java --- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/panel/PanelBeanTracker.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/api/panel/PanelBeanTracker.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,13 +20,14 @@ */ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panel.common.api.panel; import com.oracle.solaris.rad.client.ADRName; import com.oracle.solaris.vp.panel.common.*; +import com.oracle.solaris.vp.panel.common.api.panels.*; public class PanelBeanTracker extends BeanTracker { // diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/RepoManagedObject.java --- a/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/RepoManagedObject.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/panel/com/oracle/solaris/vp/panel/common/smf/RepoManagedObject.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panel.common.smf; @@ -32,7 +32,7 @@ import com.oracle.solaris.rad.client.ADRName; import com.oracle.solaris.rad.client.RadObjectException; import com.oracle.solaris.vp.panel.common.*; -import com.oracle.solaris.vp.panel.common.api.file.*; +import com.oracle.solaris.vp.panel.common.api.files.*; import com.oracle.solaris.vp.panel.common.api.smf_old.*; import com.oracle.solaris.vp.panel.common.model.*; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/src/java/vpanels/vp.in --- a/components/visual-panels/core/src/java/vpanels/vp.in Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/src/java/vpanels/vp.in Fri Feb 07 17:03:23 2014 -0500 @@ -21,7 +21,7 @@ # # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. # { @@ -31,8 +31,13 @@ echo /container.jar echo /control.jar echo /errors.jar + echo /files.jar echo /kstat.jar echo /modules.jar + echo /network.jar + echo /panels.jar + echo /smf_old.jar + echo /time.jar echo /usermgr.jar echo /zonemgr.jar echo /zonesbridge.jar diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/system-management-visual-panels-core.p5m --- a/components/visual-panels/core/system-management-visual-panels-core.p5m Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/system-management-visual-panels-core.p5m Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ # # -# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # default mangler.man.stability committed> @@ -66,15 +66,6 @@ file path=usr/bin/sleeklock file path=usr/bin/vp -link path=usr/lib/rad/module/mod_files.so target=mod_files.so.1 -file path=usr/lib/rad/module/mod_files.so.1 -link path=usr/lib/rad/module/mod_network.so target=mod_network.so.1 -file path=usr/lib/rad/module/mod_network.so.1 -link path=usr/lib/rad/module/mod_panels.so target=mod_panels.so.1 -file path=usr/lib/rad/module/mod_panels.so.1 -link path=usr/lib/rad/module/mod_smf_old.so target=mod_smf_old.so.1 -file path=usr/lib/rad/module/mod_smf_old.so.1 -file path=usr/share/lib/xml/dtd/vpanel.dtd.1 file path=usr/share/man/man1/vp.1 file path=usr/share/vpanels/app/vpanels-panels-browser.jar file path=usr/share/vpanels/conf/browser.xml diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/core/system-management-visual-panels-doc.p5m --- a/components/visual-panels/core/system-management-visual-panels-doc.p5m Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/core/system-management-visual-panels-doc.p5m Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ # # -# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # set name=info.classification value="org.opensolaris.category.2008:Applications/Configuration and Preferences" @@ -43,31 +43,11 @@ file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common/package-tree.html file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common/ScfConstants.html file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/scf/common/ScfException.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Aggregator.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Dependency.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Instance.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/LogInfo.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Manpage.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/package-frame.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/package-summary.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/package-tree.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/PropertyGroup.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/PropertyType.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/PropertyVisibility.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Service.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/ServiceInfo.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/SmfError.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/SmfErrorCode.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/SmfState.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/StateChange.html -file path=usr/share/lib/java/javadoc/smf-old/com/oracle/solaris/vp/panel/common/api/smf_old/Template.html file path=usr/share/lib/java/javadoc/smf-old/constant-values.html file path=usr/share/lib/java/javadoc/smf-old/deprecated-list.html file path=usr/share/lib/java/javadoc/smf-old/help-doc.html file path=usr/share/lib/java/javadoc/smf-old/index-all.html file path=usr/share/lib/java/javadoc/smf-old/index.html -file path=usr/share/lib/java/javadoc/smf-old/overview-frame.html -file path=usr/share/lib/java/javadoc/smf-old/overview-summary.html file path=usr/share/lib/java/javadoc/smf-old/overview-tree.html file path=usr/share/lib/java/javadoc/smf-old/package-list file path=usr/share/lib/java/javadoc/smf-old/resources/background.gif @@ -98,24 +78,15 @@ file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/auth/RoleHint.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/auth/UnauthorizedException.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/auth/UserHint.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/FileBrowser.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/FileSnapshot.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/package-frame.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/package-summary.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/package-tree.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFile.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/file/RemoteFileSystemView.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/Network.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/package-frame.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/package-summary.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/network/package-tree.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/CustomPanel.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/package-frame.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/package-summary.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/package-tree.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/Panel.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/PanelBeanTracker.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/panel/ResourceDescriptor.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/HasTimeBean.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/package-frame.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/common/api/time/package-summary.html @@ -384,20 +355,6 @@ file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/view/TreeTableObjectsView.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/view/WizardPanel.html file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panel/swing/view/WizardStepPanel.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Continent.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Continent.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Coordinates.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Coordinates.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Country.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Country.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/package-frame.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/package-summary.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/package-tree.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/ServerInfo.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/ServerInfo.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/Time.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/TimeZoneInfo.html -file path=usr/share/lib/java/javadoc/vpanels-panel/com/oracle/solaris/vp/panels/time/TimeZoneInfo.html file path=usr/share/lib/java/javadoc/vpanels-panel/constant-values.html file path=usr/share/lib/java/javadoc/vpanels-panel/deprecated-list.html file path=usr/share/lib/java/javadoc/vpanels-panel/help-doc.html diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/coreadm/src/java/vpanels/app/coreadm/build.xml --- a/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -30,6 +30,7 @@ + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreAdmPanelDescriptor.java --- a/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreAdmPanelDescriptor.java Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/coreadm/src/java/vpanels/app/coreadm/com/oracle/solaris/vp/panels/coreadm/client/swing/CoreAdmPanelDescriptor.java Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. */ package com.oracle.solaris.vp.panels.coreadm.client.swing; @@ -35,7 +35,7 @@ import com.oracle.solaris.rad.connect.Connection; import com.oracle.solaris.scf.common.ScfException; import com.oracle.solaris.vp.panel.common.*; -import com.oracle.solaris.vp.panel.common.api.file.*; +import com.oracle.solaris.vp.panel.common.api.files.*; import com.oracle.solaris.vp.panel.common.control.*; import com.oracle.solaris.vp.panel.common.model.*; import com.oracle.solaris.vp.panel.common.smf.*; diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/Makefile --- a/components/visual-panels/examples/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. -# - -include ../../../make-rules/shared-macros.mk - -GMAKE = /usr/bin/make - -COMPONENT_NAME = visual-panels-example -COMPONENT_VERSION = 0.5.11 -COMPONENT_SRC = src -COMPONENT_BUGDB= utility/vpanels - -include $(WS_MAKE_RULES)/justmake.mk -include $(WS_MAKE_RULES)/ips.mk - -COMPONENT_BUILD_TARGETS = build -COMPONENT_BUILD_ENV += ROOT=$(BUILD_DIR)/prototype/$(MACH) -COMPONENT_BUILD_ENV += SRC=$(WS_COMPONENTS)/visual-panels -COMPONENT_BUILD_ENV += WS_JAVA=$(BUILD_DIR_32)/java -COMPONENT_BUILD_ENV += JAVA_HOME=$(JAVA_HOME) -COMPONENT_BUILD_ENV += PATH=$(dir $(CC)):/usr/bin -COMPONENT_BUILD_ENV += MACH32=$(MACH32) - -COMPONENT_INSTALL_TARGETS = install -COMPONENT_INSTALL_ENV = $(COMPONENT_BUILD_ENV) - -COMPONENT_TEST_TARGETS = test -COMPONENT_TEST_ENV = $(COMPONENT_BUILD_ENV) - -# Do not apply the standard licence transforms for this component. -LICENSE_TRANSFORMS = - -ASLR_MODE = $(ASLR_NOT_APPLICABLE) - -# common targets -$(SOURCE_DIR)/.prep: - $(TOUCH) $@ - -prep: $(SOURCE_DIR)/.prep - -build: $(BUILD_32) - -install: $(INSTALL_32) - -download:: - @echo 'No downloads for this component' - -clobber:: clean - -clean:: - rm -f $(SOURCE_DIR)/.prep - -BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) - -include $(WS_MAKE_RULES)/depend.mk diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/depend.mk --- a/components/visual-panels/examples/depend.mk Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -visual-panels/examples: visual-panels/core diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/resolve.deps --- a/components/visual-panels/examples/resolve.deps Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -system/library -system/management/rad diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/Makefile --- a/components/visual-panels/examples/src/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -cmd: java - -qinstall: - $(MAKE) install ANT='ant -Dquick=true' - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/apis/example_time2.adr --- a/components/visual-panels/examples/src/apis/example_time2.adr Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/cmd/Makefile --- a/components/visual-panels/examples/src/cmd/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/cmd/rad/Makefile --- a/components/visual-panels/examples/src/cmd/rad/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -build: - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/cmd/rad/mod/Makefile --- a/components/visual-panels/examples/src/cmd/rad/mod/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -MODULE_SUBDIRS = example-time2 - -MODULE_SUBDIRS_sparc = $(MODULE_SUBDIRS) -MODULE_SUBDIRS_i386 = $(MODULE_SUBDIRS) - -SUBDIRS = $(MODULE_SUBDIRS_$(ISA)) - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/cmd/rad/mod/example-time2/Makefile --- a/components/visual-panels/examples/src/cmd/rad/mod/example-time2/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -VERS=.1 -MOD_APIS=example_time2 -MOD_OBJS=example-time2.o -MOD_LIBNAME=example-time2.so$(VERS) -MOD_INSTALLDIR=$(RADDIR_MODULE) -APISDIR=../../../../apis - -include $(SRC)/make-rules/Makefile.com - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/cmd/rad/mod/example-time2/example-time2.c --- a/components/visual-panels/examples/src/cmd/rad/mod/example-time2/example-time2.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "api_example_time2.h" - -/*ARGSUSED*/ -conerr_t -interface_Time_read_time(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - *data = adr_data_new_long((long long)time(NULL) * 1000); - return (CE_OK); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_write_time(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t *data, adr_data_t **error) -{ - long long rawtime = adr_data_to_longint(data) / 1000; - time_t newtime = (time_t)rawtime; - - if (rawtime > LONG_MAX) - return (CE_OBJECT); - - if (stime(&newtime) == -1) { - if (errno == EPERM) - return (CE_PRIV); - return (CE_OBJECT); - } - - return (CE_OK); -} - - -int -_rad_init(void) -{ - adr_name_t *name = adr_name_vcreate( - MOD_DOMAIN, 1, "type", "Time"); - (void) rad_cont_insert_singleton(rad_container, name, &modinfo, - &interface_Time_svr); - - return (0); -} - -/* - * _rad_fini is called by the RAD daemon when the module is unloaded. Any - * module finalisation is completed here. - */ -/*ARGSUSED*/ -void -_rad_fini(void *unused) -{ -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/Makefile --- a/components/visual-panels/examples/src/java/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/Makefile --- a/components/visual-panels/examples/src/java/vpanels/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/app/Makefile --- a/components/visual-panels/examples/src/java/vpanels/app/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -ASUBDIRS_CMD = $(LS) -1 */build.xml 2>/dev/null | $(SED) 's@/build.xml$$@@' -ASUBDIRS = $(ASUBDIRS_CMD:sh) - -.PARALLEL: $(ASUBDIRS) - -include $(SRC)/make-rules/Makefile.ant -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/app/examples/build-example.xml --- a/components/visual-panels/examples/src/java/vpanels/app/examples/build-example.xml Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/app/examples/build.xml --- a/components/visual-panels/examples/src/java/vpanels/app/examples/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimeControl.java --- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimeControl.java Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -package com.oracle.solaris.vp.panels.example.time2.client.swing; - -import java.util.Date; -import com.oracle.solaris.rad.client.RadObjectException; -import com.oracle.solaris.rad.client.RadPrivilegeException; -import com.oracle.solaris.vp.panel.common.action.*; -import com.oracle.solaris.vp.panel.swing.control.SettingsControl; - -public class TimeControl - extends SettingsControl { - - // - // Instance data - // - - private Date date; - - // - // Constructors - // - - public TimeControl(TimePanelDescriptor descriptor) { - super(descriptor.getId(), descriptor.getName(), descriptor); - } - - // - // Control methods - // - - @Override - protected void save() throws ActionAbortedException, ActionFailedException, - ActionUnauthorizedException { - - Date newDate = (Date)getComponent().getSpinnerDateModel().getValue(); - - if (!newDate.equals(date)) { - long time = date.getTime(); - try { - getPanelDescriptor().getTimeBean().settime(time); - } catch (RadObjectException e) { - throw new ActionFailedException(e); - } catch (RadPrivilegeException e) { - throw new ActionUnauthorizedException(e); - } - } - } - - // - // SwingControl methods - // - - @Override - protected void configComponent(TimePanel panel) { - super.configComponent(panel); - addDefaultApplyAction(); - addDefaultCancelAction(true); - addDefaultOkayAction(true); - } - - @Override - protected TimePanel createComponent() { - return new TimePanel(); - } - - @Override - protected void initComponent() { - try { - long time = getPanelDescriptor().getTimeBean().gettime(); - date = new Date(time); - } catch (RadObjectException e) { - /* Shouldn't happen */ - date = new Date(); - } - getComponent().getSpinnerDateModel().setValue(date); - } -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimePanel.java --- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimePanel.java Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. - */ - -package com.oracle.solaris.vp.panels.example.time2.client.swing; - -import java.awt.BorderLayout; -import javax.swing.*; -import com.oracle.solaris.vp.util.misc.finder.Finder; -import com.oracle.solaris.vp.util.swing.SettingsPanel; - -@SuppressWarnings({"serial"}) -public class TimePanel extends SettingsPanel { - // - // Instance data - // - - private SpinnerDateModel model; - - // - // Constructors - // - - public TimePanel() { - JLabel label = new JLabel(Finder.getString("time.label")); - model = new SpinnerDateModel(); - JSpinner spinner = new JSpinner(model); - - JPanel panel = new JPanel(new BorderLayout(5, 0)); - panel.add(label, BorderLayout.WEST); - panel.add(spinner, BorderLayout.EAST); - - setContent(panel); - } - - // - // TimePanel methods - // - - public SpinnerDateModel getSpinnerDateModel() { - return model; - } -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimePanelDescriptor.java --- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/TimePanelDescriptor.java Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -package com.oracle.solaris.vp.panels.example.time2.client.swing; - -import java.io.IOException; -import java.util.logging.Level; -import com.oracle.solaris.rad.connect.Connection; -import com.oracle.solaris.vp.panel.common.*; -import com.oracle.solaris.vp.panel.common.control.*; -import com.oracle.solaris.vp.panel.common.model.*; -import com.oracle.solaris.vp.panel.swing.control.PanelFrameControl; -import com.oracle.solaris.vp.panel.swing.model.SwingPanelDescriptor; -import com.oracle.solaris.vp.panels.example.example_time2.*; -import com.oracle.solaris.vp.util.misc.finder.Finder; - -public class TimePanelDescriptor - extends AbstractPanelDescriptor - implements SwingPanelDescriptor { - - // - // Instance data - // - - private DefaultControl control; - private Time bean; - - // - // Constructors - // - - /** - * Constructs a {@code TimePanelDescriptor}. - * - * @param id - * a unique identifier for this Panel, taken from the panel - * registration - * - * @param context - * a handle to interact with the Visual Panels client - */ - public TimePanelDescriptor(String id, ClientContext context) - throws IOException { - - super(id, context); - - control = new PanelFrameControl(this); - control.addChildren(new TimeControl(this)); - - try { - Connection conn = context.getConnectionInfo().getConnection(); - bean = conn.getObject(new Time()); - } catch (IOException e) { - String msg = "Error contacting server while creating " + - "proxy for: " + Time.class.getSimpleName(); - getLog().log(Level.SEVERE, msg, e); - throw e; - } - } - - // - // ManagedObject methods - // - - /** - * Stops monitoring the connection to the remote host. - */ - @Override - public void dispose() { - super.dispose(); - } - - @Override - public String getName() { - return Finder.getString("panel.time.name"); - } - - // - // PanelDescriptor methods - // - - @Override - public Control getControl() { - return control; - } - - // - // TimePanelDescriptor methods - // - - public Time getTimeBean() { - return bean; - } -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/resources/Resources.properties --- a/components/visual-panels/examples/src/java/vpanels/app/examples/com/oracle/solaris/vp/panels/example/time2/client/swing/resources/Resources.properties Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. -# - -panel.time.name = Time Settings -time.label = Date and Time: diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/examples/system-management-visual-panels-panel-examples.p5m --- a/components/visual-panels/examples/system-management-visual-panels-panel-examples.p5m Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. -# - -set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-examples@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) -set name=pkg.summary value="Visual Panels - Example Panels" -set name=info.classification value="org.opensolaris.category.2008:Applications/Configuration and Preferences" -set name=org.opensolaris.consolidation value=$(CONSOLIDATION) -set name=org.opensolaris.arc-caseid value=LSARC/2007/392 - -license ../vpanels.copyright license=Oracle - -depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require - -link path=usr/lib/rad/module/example-time2.so target=example-time2.so.1 -file path=usr/lib/rad/module/example-time2.so.1 -file path=usr/share/vpanels/app/vpanels-panels-examples.jar -file path=usr/share/vpanels/conf/example-time2.xml diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/firewall/src/java/vpanels/app/firewall/build.xml --- a/components/visual-panels/firewall/src/java/vpanels/app/firewall/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/firewall/src/java/vpanels/app/firewall/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -31,6 +31,8 @@ + + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/smf/src/java/vpanels/app/svcs/build.xml --- a/components/visual-panels/smf/src/java/vpanels/app/svcs/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/smf/src/java/vpanels/app/svcs/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -40,6 +40,7 @@ + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/src/cmd/rad/Makefile --- a/components/visual-panels/time/src/cmd/rad/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -build: - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/src/cmd/rad/mod/Makefile --- a/components/visual-panels/time/src/cmd/rad/mod/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -MODULE_SUBDIRS = time - -MODULE_SUBDIRS_sparc = $(MODULE_SUBDIRS) -MODULE_SUBDIRS_i386 = $(MODULE_SUBDIRS) - -SUBDIRS = $(MODULE_SUBDIRS_$(ISA)) - -.PARALLEL: $(SUBDIRS) - -include $(SRC)/make-rules/Makefile.targ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/src/cmd/rad/mod/time/Makefile --- a/components/visual-panels/time/src/cmd/rad/mod/time/Makefile Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -# -# 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 -# or http://www.opensolaris.org/os/licensing. -# 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 (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. -# - -include $(SRC)/make-rules/Makefile.env - -LDLIBS += -lscf - -VERS=.1 -MOD_APIS=time -MOD_OBJS=mod_time.o smfutil.o -MOD_LIBNAME=mod_time.so$(VERS) -MOD_INSTALLDIR=$(RADDIR_MODULE) -APISDIR=$(PROJ_CORE)/apis - -include $(SRC)/make-rules/Makefile.com - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/src/cmd/rad/mod/time/mod_time.c --- a/components/visual-panels/time/src/cmd/rad/mod/time/mod_time.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,542 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "smfutil.h" -#include "api_time.h" - -#define NTP_CONF "/etc/inet/ntp.conf" -#define NTP_CONF_BAK "/etc/inet/ntp.bak" -#define NTP_CONF_TMP "/etc/inet/ntp.tmp" -#define SMF_TZ_PGNAME "environment" -#define SMF_TZ_PROPNAME "TZ" -#define ZONEINFO_DIR "/usr/share/lib/zoneinfo/" /* trailing / essential */ - -/*ARGSUSED*/ -conerr_t -interface_Time_read_time(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - *data = adr_data_new_time_now(); - return (CE_OK); -} - -#define NSPERUS (NANOSEC / MICROSEC) - -/*ARGSUSED*/ -conerr_t -interface_Time_write_time(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t *data, adr_data_t **error) -{ - long long seconds = adr_data_to_time_secs(data); - int nanos = adr_data_to_time_nsecs(data); - int micros = nanos / NSPERUS; - time_t newtime; - struct timeval adj; - - if (nanos - (micros * NSPERUS) >= NSPERUS / 2) { - micros++; - if (micros >= MICROSEC) { - seconds++; - micros = 0; - } - } - - if (seconds > LONG_MAX) - return (CE_OBJECT); - - newtime = (time_t)seconds; - adj.tv_sec = 0; - adj.tv_usec = micros; - - if (stime(&newtime) == -1 || adjtime(&adj, NULL) == -1) { - if (errno == EPERM) - return (CE_PRIV); - return (CE_OBJECT); - } - - return (CE_OK); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_read_defaultTimeZone(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - char zonefile[PATH_MAX]; - int n = snprintf(zonefile, PATH_MAX, "%s", ZONEINFO_DIR); - char *tz = zonefile + n; - conerr_t err = smfu_get_property((char *)SCF_INSTANCE_ENV, - SMF_TZ_PGNAME, SMF_TZ_PROPNAME, tz, PATH_MAX - n); - - if (err == CE_OK) { - /* - * The stored time zone may be the name of a symlink - * (i.e. "localtime"), under ZONEINFO_DIR. Resolve that symlink - * and pass the actual time zone to the client. - */ - char resolved[PATH_MAX]; - if (realpath(zonefile, resolved) != NULL && - strncmp(resolved, ZONEINFO_DIR, n) == 0) { - tz = resolved + n; - } - *data = adr_data_new_string(tz, LT_COPY); - } - - return (err); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_write_defaultTimeZone(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t *data, adr_data_t **error) -{ - conerr_t err = smfu_set_property((char *)SCF_INSTANCE_ENV, - SMF_TZ_PGNAME, SMF_TZ_PROPNAME, (char *)adr_data_to_string(data)); - return (err); -} - -static void -removenl(char *str) -{ - char *nl = strchr(str, '\n'); - if (nl != NULL) - *nl = '\0'; -} - -/* We only recognize the disabled entries we write */ -static const char *disabled = "# server "; -static const char *enabled = "server "; -static const char *ntpservers[] = { - "time.nist.gov", - "time-a.nist.gov", - "time-b.nist.gov", - "time-nw.nist.gov" -}; - -static const char * const si_server_path[] = { "server", NULL }; - -static void -disable(adr_data_t *array, const char *srv, int len) -{ - if (adr_array_nsearch(array, srv, len, si_server_path) >= 0) - return; - adr_data_t *entry = adr_data_new_struct(&t__ServerInfo); - adr_struct_set(entry, "server", adr_data_new_nstring(srv, len)); - adr_struct_set(entry, "enabled", adr_data_new_boolean(B_FALSE)); - (void) adr_array_add(array, entry); -} - -static void -enable(adr_data_t *array, const char *srv, int len) -{ - int index = adr_array_nsearch(array, srv, len, si_server_path); - if (index >= 0) { - adr_struct_set(adr_array_get(array, index), "enabled", - adr_data_new_boolean(B_TRUE)); - return; - } - adr_data_t *entry = adr_data_new_struct(&t__ServerInfo); - adr_struct_set(entry, "server", adr_data_new_nstring(srv, len)); - adr_struct_set(entry, "enabled", adr_data_new_boolean(B_TRUE)); - (void) adr_array_add(array, entry); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_read_ntpServers(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - adr_data_t *result = adr_data_new_array(&t_array__ServerInfo, 4); - for (int i = 0; i < RAD_COUNT(ntpservers); i++) { - adr_data_t *si = adr_data_new_struct(&t__ServerInfo); - adr_struct_set(si, "server", - adr_data_new_string(ntpservers[i], LT_COPY)); - adr_struct_set(si, "enabled", adr_data_new_boolean(B_FALSE)); - (void) adr_array_add(result, si); - } - - FILE *file = fopen(NTP_CONF, "r"); - if (file != NULL) { - char buf[1024]; - while (fgets(buf, sizeof (buf), file) != NULL) { - boolean_t isenabled; - char *str = buf; - - removenl(buf); - if (rad_strccmp(disabled, str, strlen(disabled)) == 0) { - isenabled = B_FALSE; - str += strlen(disabled); - } else if (rad_strccmp(enabled, str, strlen(enabled)) - == 0) { - isenabled = B_TRUE; - str += strlen(enabled); - } else { - continue; - } - - int len = strcspn(str, " \t"); - if (len == 0) - continue; - if (isenabled) - enable(result, str, len); - else - disable(result, str, len); - } - (void) fclose(file); - } - - *data = result; - return (CE_OK); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_read_sufficientlyPrivileged(rad_instance_t *inst, - adr_attribute_t *attr, adr_data_t **data, adr_data_t **error) -{ - /* XXX: Crude */ - *data = adr_data_new_boolean(getuid() == 0); - return (CE_OK); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_read_continents(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - FILE *file = fopen("/usr/share/lib/zoneinfo/tab/continent.tab", "r"); - char str[1024]; - adr_data_t *result = adr_data_new_array(&t_array__Continent, 5); - while (fgets(str, sizeof (str), file) != NULL) { - if (str[0] == '#') - continue; - removenl(str); - - char *eq = strchr(str, '\t'); - if (eq == NULL) - continue; - adr_data_t *name = adr_data_new_nstring(str, eq - str); - adr_data_t *desc = adr_data_new_string(eq + 1, LT_COPY); - adr_data_t *cont = adr_data_new_struct(&t__Continent); - adr_struct_set(cont, "name", name); - adr_struct_set(cont, "description", desc); - (void) adr_array_add(result, cont); - } - (void) fclose(file); - *data = result; - - return (CE_OK); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_read_countries(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - FILE *file = fopen("/usr/share/lib/zoneinfo/tab/country.tab", "r"); - char str[1024]; - adr_data_t *result = adr_data_new_array(&t_array__Country, 5); - while (fgets(str, sizeof (str), file) != NULL) { - if (str[0] == '#') - continue; - removenl(str); - - char *eq = strchr(str, '\t'); - if (eq == NULL) - continue; - if (rad_strccmp("ee", str, eq - str) == 0 || - rad_strccmp("we", str, eq - str) == 0 || - rad_strccmp("me", str, eq - str) == 0) - continue; - adr_data_t *code = adr_data_new_nstring(str, eq - str); - adr_data_t *desc = adr_data_new_string(eq + 1, LT_COPY); - adr_data_t *country = adr_data_new_struct(&t__Country); - adr_struct_set(country, "code", code); - adr_struct_set(country, "description", desc); - (void) adr_array_add(result, country); - } - (void) fclose(file); - *data = result; - - return (CE_OK); -} - -/* - * Parse ISO 6709 -formatted coordinates - */ -struct coord { - int deg; - int min; - int sec; -}; - -static boolean_t -parse_coord(const char *str, int len, struct coord *c) -{ - char *dot = strchr(str, '.'); - if (dot != NULL && dot < str + len) - len = dot - str; - - if (len < 2 || len > 7) - return (B_FALSE); - - if (len > 5) { - const char *fmt = (len & 1) ? "%3u%2u%2u" : "%2u%2u%2u"; - return (sscanf(str, fmt, &c->deg, &c->min, &c->sec) == 3); - } else { - const char *fmt = (len & 1) ? "%3u%2u" : "%2u%2u"; - return (sscanf(str, fmt, &c->deg, &c->min) == 2); - } -} - -static adr_data_t * -parse_coords(const char *str, int len) -{ - int isnorth, iseast; - - if (len > 0 && str[0] == '+') - isnorth = 1; - else if (len > 0 && str[0] == '-') - isnorth = -1; - else - return (NULL); - - str++; - len--; - char *eq = strchr(str, '+'); - if (eq == NULL || eq >= str + len) - eq = strchr(str, '-'); - if (eq == NULL || eq >= str + len) - return (NULL); - iseast = (*eq == '+') ? 1 : -1; - - struct coord north = { 0 }; - struct coord east = { 0 }; - - if (!parse_coord(str, eq - str, &north) || - !parse_coord(eq + 1, len - (eq - str + 1), &east)) - return (NULL); - - adr_data_t *result = adr_data_new_struct(&t__Coordinates); - adr_struct_set(result, "degreesE", - adr_data_new_integer(east.deg * iseast)); - adr_struct_set(result, "minutesE", adr_data_new_integer(east.min)); - adr_struct_set(result, "secondsE", adr_data_new_integer(east.sec)); - adr_struct_set(result, "degreesN", - adr_data_new_integer(north.deg * isnorth)); - adr_struct_set(result, "minutesN", adr_data_new_integer(north.min)); - adr_struct_set(result, "secondsN", adr_data_new_integer(north.sec)); - return (result); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_read_timeZones(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t **data, adr_data_t **error) -{ - FILE *file = fopen("/usr/share/lib/zoneinfo/tab/zone_sun.tab", "r"); - char buf[1024]; - adr_data_t *result = adr_data_new_array(&t_array__TimeZoneInfo, 5); - while (fgets(buf, sizeof (buf), file) != NULL) { - char *str = buf; - if (str[0] == '#') - continue; - removenl(str); - - char *eq = strchr(str, '\t'); - if (eq == NULL) - continue; - if (rad_strccmp("ee", str, eq - str) == 0 || - rad_strccmp("we", str, eq - str) == 0 || - rad_strccmp("me", str, eq - str) == 0) - continue; - adr_data_t *timezone = adr_data_new_struct(&t__TimeZoneInfo); - adr_struct_set(timezone, "countryCode", - adr_data_new_nstring(str, eq - str)); - - str = eq + 1; - eq = strchr(str, '\t'); - adr_data_t *coords; - if (eq == NULL || - (coords = parse_coords(str, eq - str)) == NULL) { - adr_data_free(timezone); - continue; - } - adr_struct_set(timezone, "coordinates", coords); - - str = eq + 1; - eq = strchr(str, '\t'); - adr_data_t *tz = eq != NULL ? - adr_data_new_nstring(str, eq - str) : - adr_data_new_string(str, LT_COPY); - adr_struct_set(timezone, "name", tz); - if (eq == NULL) - goto done; - - str = eq + 1; - eq = strchr(str, '\t'); - if (eq != NULL) { - if (rad_strccmp("-", str, eq - str) != 0) - adr_struct_set(timezone, "altName", - adr_data_new_nstring(str, eq - str)); - } else { - if (strcmp("-", str) != 0) - adr_struct_set(timezone, "altName", - adr_data_new_string(str, LT_COPY)); - goto done; - } - - str = eq + 1; - if (*str != '\0' && strcmp(str, "-") != 0) - adr_struct_set(timezone, "comments", - adr_data_new_string(str, LT_COPY)); - -done: - (void) adr_array_add(result, timezone); - } - (void) fclose(file); - *data = result; - - return (CE_OK); -} - -/*ARGSUSED*/ -conerr_t -interface_Time_write_ntpServers(rad_instance_t *inst, adr_attribute_t *attr, - adr_data_t *data, adr_data_t **error) -{ - FILE *from, *to, *tmp; /* Read, write, & temp files */ - int err = 0; /* Indicates an error */ - int size = 256; /* Buffer size */ - char buffer[size]; /* Read buffer */ - size_t ch; /* Number chars read */ - - /* Copy file to preserve ntp.conf upon error */ - from = fopen(NTP_CONF, "r"); - if (from == NULL) { - if (errno == ENOENT) { - goto nobackup; - } - err = errno; - goto errorout; - } - - to = fopen(NTP_CONF_BAK, "w"); - if (to == NULL) { - err = errno; - (void) fclose(from); - goto errorout; - } - - while ((ch = fread(buffer, 1, size, from)) > 0) { - if (fwrite(buffer, 1, ch, to) != ch) { - break; - } - } - - if (ferror(from) || ferror(to)) { - // errno might be overwritten by fclose - err = errno; - } - - (void) fclose(from); - (void) fclose(to); - - if (err != 0) - goto errorout; - -nobackup: - /* Create temp file */ - tmp = fopen(NTP_CONF_TMP, "w"); - if (tmp == NULL) { - err = errno; - (void) fclose(tmp); - goto errorout; - } - - for (int i = 0; i < adr_array_size(data); i++) { - adr_data_t *entry = adr_array_get(data, i); - adr_data_t *enabled = adr_struct_get(entry, "enabled"); - adr_data_t *server = adr_struct_get(entry, "server"); - if (fprintf(tmp, - adr_data_to_boolean(enabled) ? "server %s\n" : - "# server %s\n", adr_data_to_string(server)) < 0) - goto writefailed; - } - if (fclose(tmp) == EOF) - goto writefailed; - - /* Rename temp file */ - if (chmod(NTP_CONF_TMP, 0644) == 0 && - rename(NTP_CONF_TMP, NTP_CONF) == 0) - return (CE_OK); - -writefailed: - err = errno; - (void) unlink(NTP_CONF_TMP); - -errorout: - return (err == EACCES ? CE_PRIV : CE_OBJECT); -} - -int -_rad_init(void) -{ - adr_name_t *aname = adr_name_vcreate(MOD_DOMAIN, 1, "type", "Time"); - conerr_t cerr = rad_cont_insert_singleton(rad_container, aname, - &modinfo, &interface_Time_svr); - adr_name_rele(aname); - if (cerr != CE_OK) { - rad_log(RL_ERROR, "(mod_time) failed to insert Time"); - return (-1); - } - - return (0); -} - -/* - * _rad_fini is called by the RAD daemon when the module is unloaded. Any - * module finalisation is completed here. - */ -/*ARGSUSED*/ -void -_rad_fini(void *unused) -{ -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/src/cmd/rad/mod/time/smfutil.c --- a/components/visual-panels/time/src/cmd/rad/mod/time/smfutil.c Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. - */ - -#include -#include - -#include "smfutil.h" - -static scf_handle_t * -handle_create(void) -{ - scf_handle_t *h = scf_handle_create(SCF_VERSION); - if (h == NULL) - return (NULL); - - if (scf_handle_bind(h) == -1) { - scf_handle_destroy(h); - return (NULL); - } - return (h); -} - -static conerr_t -maperr(scf_error_t e) -{ - switch (e) { - case SCF_ERROR_NONE: - return (CE_OK); - case SCF_ERROR_PERMISSION_DENIED: - return (CE_PRIV); - default: - return (CE_SYSTEM); - } -} - -conerr_t -smfu_get_property(char *fmri, char *pgname, char *propname, char *value, - size_t n) -{ - conerr_t err = CE_OK; - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_iter_t *iter = scf_iter_create(scfhandle); - scf_value_t *val = scf_value_create(scfhandle); - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL || prop == NULL || iter == NULL || val == NULL) { - err = CE_NOMEM; - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, fmri, NULL, service, instance, - NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_ERROR, "couldn't decode '%s': %s\n", fmri, - scf_strerror(scf_error())); - err = maperr(scf_error()); - goto out; - } - - if (scf_instance_get_pg(instance, pgname, pg) != 0 || - scf_pg_get_property(pg, propname, prop) != 0 || - scf_iter_property_values(iter, prop) != 0) { - rad_log(RL_ERROR, "couldn't get property: '%s/%s/%s': %s\n", - fmri, pgname, propname, scf_strerror(scf_error())); - err = maperr(scf_error()); - goto out; - } - - if (scf_iter_next_value(iter, val) > 0 && - scf_value_get_as_string(val, value, n) == -1) { - rad_log(RL_ERROR, - "couldn't get property value: '%s/%s/%s': %s\n", fmri, - pgname, propname, scf_strerror(scf_error())); - err = maperr(scf_error()); - goto out; - } -out: - scf_value_destroy(val); - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_iter_destroy(iter); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} - -conerr_t -smfu_set_property(char *fmri, char *pgname, char *propname, char *value) -{ - conerr_t err = CE_OK; - scf_handle_t *scfhandle = handle_create(); - scf_service_t *service = scf_service_create(scfhandle); - scf_instance_t *instance = scf_instance_create(scfhandle); - scf_propertygroup_t *pg = scf_pg_create(scfhandle); - scf_property_t *prop = scf_property_create(scfhandle); - scf_value_t *val = scf_value_create(scfhandle); - scf_transaction_t *tx = scf_transaction_create(scfhandle); - scf_transaction_entry_t *ent = scf_entry_create(scfhandle); - scf_type_t type; - - if (scfhandle == NULL || service == NULL || instance == NULL || - pg == NULL || prop == NULL || tx == NULL || ent == NULL || - val == NULL) { - err = CE_NOMEM; - goto out; - } - - if (scf_handle_decode_fmri(scfhandle, fmri, NULL, service, instance, - NULL, NULL, 0) != SCF_SUCCESS) { - rad_log(RL_ERROR, "couldn't decode '%s': %s\n", fmri, - scf_strerror(scf_error())); - err = maperr(scf_error()); - goto out; - } - - if (scf_instance_get_pg(instance, pgname, pg) != 0 || - scf_pg_get_property(pg, propname, prop) != 0 || - scf_property_type(prop, &type) != 0) { - rad_log(RL_ERROR, "couldn't get property: '%s/%s/%s': %s\n", - fmri, pgname, propname, scf_strerror(scf_error())); - err = maperr(scf_error()); - goto out; - } - -top: - if (scf_transaction_start(tx, pg) == -1 || - scf_transaction_property_change(tx, ent, propname, type) != 0 || - scf_value_set_from_string(val, type, value) != 0 || - scf_entry_add_value(ent, val) != 0) { - rad_log(RL_ERROR, "couldn't set property: '%s/%s/%s': %s\n", - fmri, pgname, propname, scf_strerror(scf_error())); - err = maperr(scf_error()); - goto out; - } - - switch (scf_transaction_commit(tx)) { - /* success */ - case 1: - if (smf_refresh_instance(fmri) != 0) { - err = maperr(scf_error()); - goto out; - } - break; - /* retry */ - case 0: - if (scf_pg_update(pg) != 0) { - err = maperr(scf_error()); - goto out; - } - scf_transaction_reset(tx); - goto top; - default: - err = maperr(scf_error()); - goto out; - } -out: - scf_entry_destroy(ent); - scf_transaction_destroy(tx); - scf_value_destroy(val); - scf_property_destroy(prop); - scf_pg_destroy(pg); - scf_instance_destroy(instance); - scf_service_destroy(service); - scf_handle_destroy(scfhandle); - - return (err); -} diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/src/cmd/rad/mod/time/smfutil.h --- a/components/visual-panels/time/src/cmd/rad/mod/time/smfutil.h Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - */ - -#ifndef _SMFUTIL_H -#define _SMFUTIL_H - -#ifdef __cplusplus -extern "C" { -#endif - -conerr_t smfu_get_property(char *fmri, char *pgname, char *propname, - char *value, size_t n); - -conerr_t smfu_set_property(char *fmri, char *pgname, char *propname, - char *value); - -#ifdef __cplusplus -} -#endif - -#endif /* _SMFUTIL_H */ diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/src/java/vpanels/app/time/build.xml --- a/components/visual-panels/time/src/java/vpanels/app/time/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/time/src/java/vpanels/app/time/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -31,6 +31,8 @@ + + diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/time/system-management-visual-panels-panel-time.p5m --- a/components/visual-panels/time/system-management-visual-panels-panel-time.p5m Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/time/system-management-visual-panels-panel-time.p5m Fri Feb 07 17:03:23 2014 -0500 @@ -20,7 +20,7 @@ # # -# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. # set name=pkg.fmri value=pkg:/system/management/visual-panels/panel-time@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) @@ -35,8 +35,6 @@ depend fmri=pkg:/system/management/visual-panels-core@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION) type=require depend fmri=pkg:/system/management/visual-panels/panel-time/locale type=require -link path=usr/lib/rad/module/mod_time.so target=mod_time.so.1 -file path=usr/lib/rad/module/mod_time.so.1 file path=usr/share/applications/vp-time.desktop file path=usr/share/vpanels/app/vpanels-panels-time.jar file path=usr/share/vpanels/conf/time.xml diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/usermgr/src/apis/usermgr.adr --- a/components/visual-panels/usermgr/src/apis/usermgr.adr Fri Feb 07 08:34:39 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,741 +0,0 @@ - - - - - - - - - describes a Solaris group - - - Fully describes a Solaris group, contains - group name, group id, group members. - - - Specifies the group name. - - - Specifies the Gid of the group. - - - Specifies the members of the group. - - - - - - - describes a Solaris user - - - Fully describes a Solaris user, contains - account, home directory and security attributes - associated with a user. See man passwd(4), - shadow(4), userattr(4) for more info on fields. - - - username for the account. - - - UID for the account. - - - GID for the account. - - - gecos info for the account. - - - homedirectory location for the account. - - - default shell for the account. - - - Number of inactivity days allowed for the account. - - - - Minimum number of days between password changes - for the account. - - - - Maximum cemunber of days the password is valid for - the account. - - - - Number of days before password expires the user - is warned. - - - - The date after which login will not be allowed for - the account. The date format is %y-%m-%d %H:%M:%S. - - - - Specifies whether the account is locked - after failed logins execeeds the allowable - limit. - - - - Specifies per-user always audit pre-selection - flags. - - - - Specifies per-user never-audit - pre-selection flags. - - - - specifies whether account is role or user. - - - specifies the default project for the account. - - - Specifies the max label at which the user can - operate. - - - - Specifies the min labelthat the user can login . - - - Specifies whether the account user role or user - password for role authentication. - - - - Specifies when the desktop session for the user gets - locked. - - - - Specifies the idle time before the idlecmd is - executed. - - - - Specifies the status of the account. - - - Specifies the roles that have been assigned to the - account. - - - - - Specifies the profiles that have been assigned to the - account. - - - - - Specifies the authenticated profiles that have been - assigned to the account. - - - - - Specifies the authorizations that have been assigned - to the account. - - - - - Specifies the default set of privileges assigned to - user at login. - - - - - Specifies the maximum set of privileges the user or - process started by the user can obtain. - - - - - Specifies the supplemental groups that have been - assigned to the account. - - - - - - - - Keeps track of all the fields that have been - changed in the user object. - - - Keeps track of all the fields that have been - changed in the user object. For every field - that has been changed in the User object the - respective changeField will be set to true. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - User Manager api error types - - - - - - - - - - - Name service scope types - - - - - - - - - - - - - - - - Set of operations that can be performed on - users and roles. - - - - - Lists users. - - - Lists the users present in the selected - scope based on the filter options. - - - - - - - READERROR - when unable to read user after - - - - - - - - - Lists groups. - - - Lists the groups present in the selected - scope. - - - - - - - READERROR - when unable to read the groups database. - - - - - - - - - Lists shells. - - - Lists the set of available shells - that can be set as default shell for users. - - - - - - - READERROR - when unable to read the default shells. - - - - - - - - - Lists user defaults. - - - Lists the default values for groups, basedir, - project, shell, skel, inactive, expire, - auths, profiles, roles, limitPriv, - defaultPriv, lockAfterRetries used for - creation of users and roles. - - - - - - READERROR - when unable to read default user properties. - - - - - - - - - Lists scopes. - - - Lists the set of name service repositories - that can be administered. - - - - - - - READERROR - when unable to read the name services that can be managed. - - - - - - - - - - Lists assigned roles. - - - Lists the roles assigned to a user. - - - - - - - READERROR - when unable to read user roles - - - - - - - - - Lists assigned profiles. - - - Lists the profiles assigned to a user. - - - - - - - READERROR - when unable to read user profiles. - - - - - - - - - Lists assigned authorizations. - - - Lists the authorizations assigned to a user. - - - - - - - READERROR - when unable to read user authorizations. - - - - - - - - - Lists default privileges. - - - Lists the default privileges assigned to a user. - - - - - - - READERROR - when unable to read user's default privileges. - - - - - - - - - Lists limit privileges. - - - Lists the limit privileges assigned to a user. - - - - - - - READERROR - when unable to read user's limit privileges. - - - - - - - - - Lists supplemental groups. - - - Lists the supplemental groups that the user - is a member of. - - - - - - - READERROR - when unable to read user's supplemental groups. - - - - - - - - - Lists Assigned Audit Classes. - - - Lists the audit classes that are assigned to - the user. - - - - - - - READERROR - when unable to read user's assigned audit classes. - - - - - - - - - Lists users PAM configuration files. - - - Lists the per-user PAM configuration files. - - - - - - - READERROR - when unable to read user specific PAM configuration files. - - - - - - - - - gets User information for a given username. - - - Gets the user information for a given username from - the name service repository based on the filter - options. - - - - - - - READERROR - when unable to read user - - - - - - Specifies the username for which the - account information is to be retrieved. - - - - - - - Add user or role. - - - Adds a user or role to the selected name - service repository based on the filter - options. Applies the properties set in - the user object as the account, password, - security attributes. - Sets INVALIDDATA error when arguments are not valid. - Sets PASSERROR error when password update fails. - Sets READERROR error when unable to read user after - successful addition of new user. - Sets USEREXISTS error user already exists with same - username. - - - - - - - INVALIDDATA - when arguments are not valid. - - - INVALIDDATA - when arguments are not valid. - - - READERROR - when unable to read user after adding new user. - - - - - - user object which contains attributes of new - user account to be created. - - - - password to be set for the new user account. - - - - - - - Modify user or role. - - - Modifies users or roles present in the selected - scope based on the filter options. - Applies the changed fields in the user object - to the user or role attributes. - Sets INVALIDDATA error when arguments are not valid. - Sets PASSERROR error when password update fails. - Sets READERROR error when unable to read user after - successful modification of user. - - - - - - - INVALIDDATA - when arguments are not valid. - - - INVALIDDATA - when arguments are not valid. - - - READERROR - when unable to read user after adding new user. - - - - - - user object which contains user attributes - to be modified. - - - - Indicates which fields have been modified - in the user object by the client. - - - - password to be set for the new user account. - - - - - - - Delete user. - - - Deletes user or role based on username - present in the selected scope based on the - filter options. - Sets READERROR error on failure. - - - - - - READERROR - when unable to read user - - - - - - username of account that needs to be deleted. - - - - - - sets the name-service repository scope. - - - Sets the name-service repository scope. - All subsequent operations will use the specified scope. - - - Specifies the name-service scope to - be used for managing users. - - - - - - - Sets the filter options. - - - Sets the filter options which are used for - all the subsequent operations. The options - are user or role and search string. The - default search string is empty string (""). - - - Specifies if users or roles - will be managed. - - - - Specifies the string to match - against user or role names to be managed. - - - - - - Checks if System is Labeled. - - - Checks if the Trusted Extensions feature is - enabled on the system. - Returns true if successful and sets - Sets READERROR error on failure. - - - - - - - READERROR - when checking if Trusted Extensions is enabled fails. - - - - - - - - Gets the user type. - - - Checks if the user is role or normal user. - Returns UserType set to role or normal user. - Sets READERROR error on failure. - - - - - - - READERROR - when checking if Trusted Extensions is enabled fails. - - - - - - Specifies user name to check for user or role. - - - - - diff -r 152cafe6cd99 -r d04a7bb15a5b components/visual-panels/usermgr/src/java/vpanels/app/usermgr/build.xml --- a/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/build.xml Fri Feb 07 08:34:39 2014 -0800 +++ b/components/visual-panels/usermgr/src/java/vpanels/app/usermgr/build.xml Fri Feb 07 17:03:23 2014 -0500 @@ -19,7 +19,7 @@ CDDL HEADER END - Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. --> @@ -31,6 +31,7 @@ + @@ -41,9 +42,4 @@ - - - - -