summaryrefslogtreecommitdiff
path: root/usr/src/lib/libshare
diff options
context:
space:
mode:
authoras200622 <none@none>2007-11-26 18:29:15 -0800
committeras200622 <none@none>2007-11-26 18:29:15 -0800
commit55bf511df53aad0fdb7eb3fa349f0308cc05234c (patch)
treea153d7bae39c0480da0107072553ce0b07b02f23 /usr/src/lib/libshare
parentb3d911cb99b7e5dd9df4c81fd7b58a97c82d07db (diff)
downloadillumos-joyent-55bf511df53aad0fdb7eb3fa349f0308cc05234c.tar.gz
6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
6582182 64-bit libraries 6588720 Unable to create new folder in autohome share from Solaris10u3 with UFS & ZFS. 6611820 Unable to map a SMB share on SPARC system. 6612193 Rework ADS client, DynDNS client and Auth IPC to use host principal 6614664 CIFS server should not request ctime changes 6614864 Security tab not available after a share is mapped on SPARC system 6614953 An error occurred while creating a notepad file on X86 32-bit system. 6616349 Sparc-Get error "input not UTF-8" and (Abort)(core dumped) in sharemgr with Korean resource name 6622828 Resolve unreferenced makefiles 6626833 SUNWsmbsu package issues with snv_77. 6627415 SmbCreateTemporary fails on SPARC 6627469 Unable to map SIDs to names for Windows Vista clients 6627471 Remove winpipe door server from name space 6628747 smbd crash and in maintenance state 6629402 The adjoin operation triggered by smbadm join CLI shouldn't overwrite the Kerberos keytab file. 6629410 SMB daemon should remove its ccache on refresh or restart 6629428 smb daemon crashes at smb_nic_clear_niclist+0x45(815ff10, 2) 6629797 sharemgr: Deleting an SMB resource that has an option leads to core dump 6630470 Get core in sharemgr:libshare_smb.so.1`smb_enable_service+0x78(2ec90, fe87c49c, 0, ff396000,17e54,6) --HG-- rename : usr/src/uts/common/smbsrv/smb_secdesc.h => deleted_files/usr/src/uts/common/smbsrv/smb_secdesc.h
Diffstat (limited to 'usr/src/lib/libshare')
-rw-r--r--usr/src/lib/libshare/common/libshare.c19
-rw-r--r--usr/src/lib/libshare/common/libshare.h2
-rw-r--r--usr/src/lib/libshare/common/scfutil.c3
-rw-r--r--usr/src/lib/libshare/smb/libshare_smb.c62
4 files changed, 77 insertions, 9 deletions
diff --git a/usr/src/lib/libshare/common/libshare.c b/usr/src/lib/libshare/common/libshare.c
index 49104b2abe..5716ef931c 100644
--- a/usr/src/lib/libshare/common/libshare.c
+++ b/usr/src/lib/libshare/common/libshare.c
@@ -217,6 +217,15 @@ sa_errorstr(int err)
case SA_PATH_IS_PARENTDIR:
ret = dgettext(TEXT_DOMAIN, "path is parent of a share");
break;
+ case SA_KRB_KEYTAB_ERR:
+ ret = dgettext(TEXT_DOMAIN, "unable to remove the old keys"
+ " from the Kerberos keytab. Please manually remove"
+ " the old keys for your host principal prior to setting"
+ " the ads_domain property");
+ break;
+ case SA_NO_SERVICE:
+ ret = dgettext(TEXT_DOMAIN, "service is not running");
+ break;
default:
(void) snprintf(errstr, sizeof (errstr),
dgettext(TEXT_DOMAIN, "unknown %d"), err);
@@ -3603,6 +3612,7 @@ sa_remove_resource(sa_resource_t resource)
char *type;
int ret = SA_OK;
int transient = 0;
+ sa_optionset_t opt;
share = sa_get_resource_parent(resource);
type = sa_get_share_attr(share, "type");
@@ -3615,6 +3625,15 @@ sa_remove_resource(sa_resource_t resource)
sa_free_attr_string(type);
}
+ /* Disable the resource for all protocols. */
+ (void) sa_disable_resource(resource, NULL);
+
+ /* Remove any optionsets from the resource. */
+ for (opt = sa_get_optionset(resource, NULL);
+ opt != NULL;
+ opt = sa_get_next_optionset(opt))
+ (void) sa_destroy_optionset(opt);
+
/* Remove from the share */
xmlUnlinkNode((xmlNode *)resource);
xmlFreeNode((xmlNode *)resource);
diff --git a/usr/src/lib/libshare/common/libshare.h b/usr/src/lib/libshare/common/libshare.h
index bdac6a6d64..af6e2db2f8 100644
--- a/usr/src/lib/libshare/common/libshare.h
+++ b/usr/src/lib/libshare/common/libshare.h
@@ -85,6 +85,8 @@ typedef void *sa_handle_t; /* opaque handle to access core functions */
#define SA_MULTIPLE_ERROR 26 /* multiple protocols reported error */
#define SA_PATH_IS_SUBDIR 27 /* check_path found path is subdir */
#define SA_PATH_IS_PARENTDIR 28 /* check_path found path is parent */
+#define SA_KRB_KEYTAB_ERR 29 /* fail to delete old keytab entries */
+#define SA_NO_SERVICE 30 /* service isn't running */
/* API Initialization */
#define SA_INIT_SHARE_API 0x0001 /* init share specific interface */
diff --git a/usr/src/lib/libshare/common/scfutil.c b/usr/src/lib/libshare/common/scfutil.c
index 344d3729bb..1c35d7d151 100644
--- a/usr/src/lib/libshare/common/scfutil.c
+++ b/usr/src/lib/libshare/common/scfutil.c
@@ -790,8 +790,9 @@ sa_share_props_from_pgroup(xmlNodePtr root, scfutilhandle_t *handle,
node = xmlNewChild(resource, NULL,
(xmlChar *)"optionset", NULL);
} else {
- /* this shouldn't happen */
+ /* This shouldn't happen. */
ret = SA_SYSTEM_ERR;
+ goto out;
}
} else {
/*
diff --git a/usr/src/lib/libshare/smb/libshare_smb.c b/usr/src/lib/libshare/smb/libshare_smb.c
index aa30b46352..9aa98e9a37 100644
--- a/usr/src/lib/libshare/smb/libshare_smb.c
+++ b/usr/src/lib/libshare/smb/libshare_smb.c
@@ -84,6 +84,7 @@ static int smb_enable_resource(sa_resource_t);
static int smb_disable_resource(sa_resource_t);
static uint64_t smb_share_features(void);
static int smb_list_transient(sa_handle_t);
+static int smb_domain_change_event(char *new_domain);
/* size of basic format allocation */
#define OPT_CHUNK 1024
@@ -1037,6 +1038,7 @@ smb_enable_service(void)
(void) fprintf(stderr,
dgettext(TEXT_DOMAIN,
"%s failed to restart: %s\n"),
+ SMBD_DEFAULT_INSTANCE_FMRI,
scf_strerror(scf_error()));
return (SA_CONFIG_ERR);
}
@@ -1077,6 +1079,45 @@ smb_validate_proto_prop(int index, char *name, char *value)
}
/*
+ * smb_domain_change_event
+ *
+ * This function is called whenever ads_domain is changed via sharectl.
+ * It will make a door call to trigger the ADS domain change event.
+ */
+static int
+smb_domain_change_event(char *new_domain)
+{
+ char *orig_domain;
+ int rc = SA_OK;
+
+ orig_domain = smb_config_getenv(SMB_CI_ADS_DOMAIN);
+ if (orig_domain == NULL)
+ return (rc);
+
+ if (strcasecmp(orig_domain, new_domain) == 0) {
+ free(orig_domain);
+ return (rc);
+ }
+
+ if (!smb_isonline()) {
+ free(orig_domain);
+ return (SA_NO_SERVICE);
+ }
+
+ /*
+ * Clear the ADS_HOST_INFO cache
+ * and remove old keys from the
+ * Kerberos keytab.
+ */
+ if (smb_ads_domain_change_notify(orig_domain) != 0)
+ rc = SA_KRB_KEYTAB_ERR;
+
+ free(orig_domain);
+ return (rc);
+}
+
+
+/*
* smb_set_proto_prop(prop)
*
* check that prop is valid.
@@ -1089,6 +1130,7 @@ smb_set_proto_prop(sa_property_t prop)
char *name;
char *value;
int index = -1;
+ struct smb_proto_option_defs *opt;
name = sa_get_property_attr(prop, "type");
value = sa_get_property_attr(prop, "value");
@@ -1098,25 +1140,29 @@ smb_set_proto_prop(sa_property_t prop)
/* should test for valid value */
ret = smb_validate_proto_prop(index, name, value);
if (ret == SA_OK) {
+ opt = &smb_proto_options[index];
+ if ((opt->smb_index == SMB_CI_ADS_DOMAIN) &&
+ (ret = smb_domain_change_event(value))
+ != SA_OK)
+ goto cleanup;
+
/* Save to SMF */
- smb_config_setenv(
- smb_proto_options[index].smb_index, value);
+ smb_config_setenv(opt->smb_index, value);
/*
* Specialized refresh mechanisms can
* be flagged in the proto_options and
* processed here.
*/
- if (smb_proto_options[index].refresh &
- SMB_REFRESH_REFRESH)
- (void) smf_refresh_instance(
- SMBD_DEFAULT_INSTANCE_FMRI);
- else if (smb_proto_options[index].refresh &
- SMB_REFRESH_RESTART)
+ if (opt->refresh & SMB_REFRESH_REFRESH)
+ (void) smb_config_refresh();
+ else if (opt->refresh & SMB_REFRESH_RESTART)
(void) smf_restart_instance(
SMBD_DEFAULT_INSTANCE_FMRI);
}
}
}
+
+cleanup:
if (name != NULL)
sa_free_attr_string(name);
if (value != NULL)