return ADS_ERROR(LDAP_NO_MEMORY);
}
- os_sp = talloc_asprintf(mem_ctx, "Samba %s", samba_version_string());
- if (!os_sp) {
+ if (r->in.os_servicepack) {
+ /*
+ * if blank string then leave os_sp equal to NULL to force
+ * attribute delete (LDAP_MOD_DELETE)
+ */
+ if (!strequal(r->in.os_servicepack,"")) {
+ os_sp = talloc_strdup(mem_ctx, r->in.os_servicepack);
+ }
+ } else {
+ os_sp = talloc_asprintf(mem_ctx, "Samba %s",
+ samba_version_string());
+ }
+ if (!os_sp && !strequal(r->in.os_servicepack,"")) {
return ADS_ERROR(LDAP_NO_MEMORY);
}
[in] wkssvc_joinflags join_flags,
[in] string os_version,
[in] string os_name,
+ [in] string os_servicepack,
[in] boolean8 create_upn,
[in] string upn,
[in] boolean8 modify_config,
" Also, the operatingSystemService attribute is also set when along with\n"
" the two other attributes.\n"));
+ d_printf(_(" osServicePack=string Set the operatingSystemServicePack "
+ "attribute during the join. Note: if not specified then by "
+ "default the samba version string is used instead.\n"));
return -1;
}
int i;
const char *os_name = NULL;
const char *os_version = NULL;
+ const char *os_servicepack = NULL;
bool modify_config = lp_config_backend_is_registry();
if (c->display_usage)
goto fail;
}
}
+ else if ( !strncasecmp_m(argv[i], "osServicePack", strlen("osServicePack")) ) {
+ if ( (os_servicepack = get_string_param(argv[i])) == NULL ) {
+ d_fprintf(stderr, _("Please supply a valid servicepack identifier.\n"));
+ werr = WERR_INVALID_PARAM;
+ goto fail;
+ }
+ }
else if ( !strncasecmp_m(argv[i], "machinepass", strlen("machinepass")) ) {
if ( (machine_password = get_string_param(argv[i])) == NULL ) {
d_fprintf(stderr, _("Please supply a valid password to set as trust account password.\n"));
r->in.account_ou = create_in_ou;
r->in.os_name = os_name;
r->in.os_version = os_version;
+ r->in.os_servicepack = os_servicepack;
r->in.dc_name = c->opt_host;
r->in.admin_account = c->opt_user_name;
r->in.admin_password = net_prompt_pass(c, c->opt_user_name);