admin_iis.c revision ed65af9b7bfa692d3592e4f89b6be668d13adeec
/**
* 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 legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 - 2015 ForgeRock AS.
*/
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define COBJMACROS
#include "platform.h"
#include "am.h"
#include "utility.h"
#include <objbase.h>
#include <oleauto.h>
#include <ahadmin.h>
typedef enum {
} app_mode_t;
#define IIS_SCHEMA_CONF_FILE "\\System32\\inetsrv\\config\\schema\\mod_iis_openam_schema.xml"
#define AM_IIS_APPHOST L"MACHINE/WEBROOT/APPHOST"
#define AM_IIS_SITES L"system.applicationHost/sites"
#define AM_IIS_GLOBAL L"system.webServer/globalModules"
#define AM_IIS_MODULES L"system.webServer/modules"
#define AM_IIS_MODULE_CONF L"system.webServer/OpenAmModule"
#define AM_IIS_ENAME L"name"
#define AM_IIS_EADD L"add"
#define AM_IIS_EID L"id"
if (out_len > 0) {
return tmp;
}
return NULL;
}
if (out_len > 0) {
return tmp;
}
return NULL;
}
static app_mode_t get_app_mode() {
return MODE_X86;
return MODE_X64;
}
return MODE_UNKNOWN;
}
static char *get_property_value_byname(IAppHostElement* ahe, VARIANT* value, BSTR* name, VARTYPE type) {
return NULL;
}
return NULL;
}
fwprintf(stderr, L"get_property_value_byname(%s) failed. Property type %d differs from type expected %d.",
return NULL;
}
char dec[256];
} else {
if (l > 0) {
if (tmp) {
tmp[l] = 0;
}
}
}
return ret;
}
UINT i;
do {
break;
}
break;
}
hresult = IAppHostWritableAdminManager_GetAdminSection(admin_manager, bstr_sites, bstr_config_path, &he);
break;
}
break;
}
break;
}
for (i = 0; i < num; i++) {
char *p;
for (p = name; *p != '\0'; ++p) {
*p = toupper(*p);
}
}
}
}
} while (FALSE);
}
do {
break;
}
break;
}
} while (FALSE);
}
do {
break;
}
break;
}
} while (FALSE);
}
USHORT i;
*index = -1;
do {
break;
}
break;
}
break;
}
*index = i;
break;
}
}
} while (FALSE);
}
IAppHostElement** element) {
short idx;
}
if (idx != -1) {
return FALSE;
} else {
return TRUE;
}
} else {
return TRUE;
}
}
do {
break;
}
break;
}
break;
}
break;
}
break;
}
} else {
}
} else {
}
}
}
} while (FALSE);
return result;
}
do {
hresult = IAppHostWritableAdminManager_GetAdminSection(manager, AM_IIS_GLOBAL, AM_IIS_APPHOST, &parent);
break;
}
break;
}
/* create a global modules child element, like:
* <add name="ModuleName", image="module.dll" />
**/
break;
}
break;
}
break;
}
if (get_app_mode() == MODE_X64) {
break;
}
} else {
break;
}
}
break;
}
}
break;
}
} while (FALSE);
return result;
}
do {
break;
}
break;
}
break;
}
break;
}
break;
}
if (get_app_mode() == MODE_X64) {
break;
}
} else {
break;
}
}
break;
}
}
} while (FALSE);
return result;
}
static BOOL update_module_site_config(IAppHostWritableAdminManager* manager, BSTR config_path, BSTR mod_config_path, BOOL enabled) {
a.bstrVal = L"enabled";
b.bstrVal = L"configFile";
do {
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
} while (FALSE);
return result;
}
static BOOL remove_from_modules(IAppHostWritableAdminManager* manager, BSTR config_path, BSTR section, BOOL test_only) {
short sitemap_index;
do {
break;
}
break;
}
break;
}
break;
}
if (test_only) {
} else {
if (sitemap_index != -1) {
}
} else {
}
}
} while (FALSE);
return result;
}
int rv = 0;
char schema_sys_file[MAX_PATH];
do {
break;
}
break;
}
break;
}
break;
} else {
rv = 1;
} else {
}
} else {
}
}
break;
}
} while (FALSE);
return rv;
}
int remove_module() {
int rv = 0;
do {
break;
}
break;
}
break;
}
break;
} else {
rv = 1;
}
break;
}
} while (FALSE);
return rv;
}
static char *get_site_name(const char *sid) {
UINT i;
do {
break;
}
break;
}
hresult = IAppHostWritableAdminManager_GetAdminSection(admin_manager, bstr_sites, bstr_config_path, &he);
break;
}
break;
}
break;
}
for (i = 0; i < num; i++) {
char cpath[2048];
char *p;
for (p = name; *p != '\0'; ++p) {
*p = toupper(*p);
}
i = num;
}
}
}
}
} while (FALSE);
return ret;
}
int rv = 0;
char *config_path;
return rv;
}
if (config_path != NULL) {
}
do {
break;
}
break;
}
break;
}
break;
}
break;
} else {
} else {
rv = 1;
}
}
}
} while (FALSE);
return rv;
}
int rv = 0;
char *config_path;
return rv;
}
if (config_path != NULL) {
}
do {
break;
}
break;
}
break;
}
break;
}
break;
} else {
} else {
rv = 1;
}
}
break;
}
} while (FALSE);
return rv;
}
int test_module(const char *siteid) {
int rv = ADMIN_IIS_MOD_ERROR;
char *config_path;
return rv;
}
if (config_path != NULL) {
}
do {
if (config_path_w == NULL) {
break;
}
break;
}
break;
}
break;
}
} else {
}
}
}
break;
}
} while (FALSE);
return rv;
}
#else
/*no-ops on this platform*/
}
return 0;
}
return 0;
}
int test_module(const char *siteid) {
return 0;
}
return 0;
}
int remove_module() {
return 0;
}
#endif