merging from SMARTUPDATE_BRANCH

This commit is contained in:
dveditz 1998-06-07 09:23:42 +00:00
Родитель 00d6097177
Коммит c1d50e3ffb
10 изменённых файлов: 136 добавлений и 20 удалений

Просмотреть файл

@ -8697,6 +8697,32 @@ JAR container files")
ResDef(CAPS_TARGET_URL_JAR_PACKAGER, (CAPS_MSG_BASE + 192), "\
#JARPackager")
ResDef(CAPS_TARGET_DESC_UNINSTALL, (CAPS_MSG_BASE + 193), "\
Uninstall software")
ResDef(CAPS_TARGET_DETAIL_DESC_UNINSTALL, (CAPS_MSG_BASE + 194), "\
Access required for automatic removal of previously installed software.")
ResDef(CAPS_TARGET_URL_UNINSTALL, (CAPS_MSG_BASE + 195), "\
#Uninstall")
ResDef(CAPS_TARGET_DESC_SOFTWAREINSTALL, (CAPS_MSG_BASE + 196), "\
Installing and running software on your computer")
ResDef(CAPS_TARGET_DETAIL_DESC_SOFTWAREINSTALL, (CAPS_MSG_BASE + 197), "\
Installing software on your computer's main hard disk, potentially deleting other files on the hard disk. Each time a program that has this form of access attempts to install software, it must display a dialog box that lets you choose whether to go ahead with the installation. If you go ahead, the installation program can execute any software on your computer. This potentially dangerous form of access is typically requested by an installation program after you have downloaded new software or a new version of software that you have previously installed. You should not grant this form of access unless you are installing or updating software from a reliable source.")
ResDef(CAPS_TARGET_URL_SOFTWAREINSTALL, (CAPS_MSG_BASE + 198), "\
#SoftwareInstall")
ResDef(CAPS_TARGET_DESC_SILENTINSTALL, (CAPS_MSG_BASE + 199), "\
Installing and running software without warning you")
ResDef(CAPS_TARGET_DETAIL_DESC_SILENTINSTALL, (CAPS_MSG_BASE + 200), "\
Installing software on your computer's main hard disk without giving you any warning, potentially deleting other files on the hard disk. Any software on the hard disk may be executed in the process. This is an extremely dangerous form of access. It should be granted by system administrators only.")
ResDef(CAPS_TARGET_URL_SILENTINSTALL, (CAPS_MSG_BASE + 201), "\
#SilentInstall")
END_STR(mcom_include_xp_msg_i_strings)

Просмотреть файл

@ -8697,6 +8697,32 @@ JAR container files")
ResDef(CAPS_TARGET_URL_JAR_PACKAGER, (CAPS_MSG_BASE + 192), "\
#JARPackager")
ResDef(CAPS_TARGET_DESC_UNINSTALL, (CAPS_MSG_BASE + 193), "\
Uninstall software")
ResDef(CAPS_TARGET_DETAIL_DESC_UNINSTALL, (CAPS_MSG_BASE + 194), "\
Access required for automatic removal of previously installed software.")
ResDef(CAPS_TARGET_URL_UNINSTALL, (CAPS_MSG_BASE + 195), "\
#Uninstall")
ResDef(CAPS_TARGET_DESC_SOFTWAREINSTALL, (CAPS_MSG_BASE + 196), "\
Installing and running software on your computer")
ResDef(CAPS_TARGET_DETAIL_DESC_SOFTWAREINSTALL, (CAPS_MSG_BASE + 197), "\
Installing software on your computer's main hard disk, potentially deleting other files on the hard disk. Each time a program that has this form of access attempts to install software, it must display a dialog box that lets you choose whether to go ahead with the installation. If you go ahead, the installation program can execute any software on your computer. This potentially dangerous form of access is typically requested by an installation program after you have downloaded new software or a new version of software that you have previously installed. You should not grant this form of access unless you are installing or updating software from a reliable source.")
ResDef(CAPS_TARGET_URL_SOFTWAREINSTALL, (CAPS_MSG_BASE + 198), "\
#SoftwareInstall")
ResDef(CAPS_TARGET_DESC_SILENTINSTALL, (CAPS_MSG_BASE + 199), "\
Installing and running software without warning you")
ResDef(CAPS_TARGET_DETAIL_DESC_SILENTINSTALL, (CAPS_MSG_BASE + 200), "\
Installing software on your computer's main hard disk without giving you any warning, potentially deleting other files on the hard disk. Any software on the hard disk may be executed in the process. This is an extremely dangerous form of access. It should be granted by system administrators only.")
ResDef(CAPS_TARGET_URL_SILENTINSTALL, (CAPS_MSG_BASE + 201), "\
#SilentInstall")
END_STR(mcom_include_xp_msg_i_strings)

Просмотреть файл

@ -370,6 +370,12 @@ ET_SetDecoderStream(MWContext * context, NET_StreamClass *stream,
extern void
ET_SetNestingUrl(MWContext * context, char * szUrl);
/*
** Set up the principals for an upcoming softupdate script.
*/
extern void
ET_StartSoftUpdate(MWContext * pContext, char *codebase);
/*
** Remember the current language version in the MochaDecoder
*/

Просмотреть файл

@ -213,6 +213,7 @@ NET_LoadNetHelpTopic(MWContext *pContext, const char *topic);
#define HELP_PREFS_ADVANCED_CACHE "navigatr:PREFERENCES_ADVANCED_CACHE"
#define HELP_PREFS_ADVANCED_PROXIES "navigatr:PREFERENCES_ADVANCED_PROXIES"
#define HELP_PREFS_ADVANCED_DISK_SPACE "navigatr:PREFERENCES_ADVANCED_DISK_SPACE"
#define HELP_PREFS_ADVANCED_SMARTUPDATE "navigatr:PREFERENCES_ADVANCED_SMARTUPDATE"
/* Main Preferences: Conference */

Просмотреть файл

@ -1293,6 +1293,61 @@ ET_SetDecoderStream(MWContext * pContext, NET_StreamClass *stream,
/**********************************************************************/
typedef struct {
ETEvent ce;
char *codebase;
} StartSoftUpdateStruct;
PR_STATIC_CALLBACK(void)
et_startsoftupdate_handler(StartSoftUpdateStruct *e)
{
ET_BEGIN_EVENT_HANDLER(e);
/* This decoder should have just been created to do the softupdate,
* so it shouldn't have any principals yet. */
XP_ASSERT(decoder->principals == NULL);
decoder->principals = LM_NewJSPrincipals(NULL, NULL, e->codebase);
if (decoder->principals == NULL)
return;
JSPRINCIPALS_HOLD(decoder->js_context, decoder->principals);
ET_END_EVENT_HANDLER(e);
}
PR_STATIC_CALLBACK(void)
et_startsoftupdate_destructor(StartSoftUpdateStruct *e)
{
XP_FREE(e->codebase);
XP_FREE(e);
}
/*
*/
void
ET_StartSoftUpdate(MWContext *pContext, char *codebase)
{
/* create our event object */
StartSoftUpdateStruct *pEvent = XP_NEW_ZAP(StartSoftUpdateStruct);
if (pEvent == NULL)
return;
/* do a PR_InitEvent on the event structure */
PR_InitEvent(&pEvent->ce.event, pContext,
(PRHandleEventProc)et_startsoftupdate_handler,
(PRDestroyEventProc)et_startsoftupdate_destructor);
/* fill in the non-PR fields we care about */
pEvent->ce.context = pContext;
pEvent->codebase = codebase;
/* add the event to the event queue */
et_event_to_mocha(&pEvent->ce);
}
/**********************************************************************/
PR_STATIC_CALLBACK(void)
et_clearstream_handler(DecoderStreamStruct * e)
{

Просмотреть файл

@ -971,7 +971,8 @@ canExtendTrust(JSContext *cx, void *from, void *to)
if (from == NULL || to == NULL) {
return JS_FALSE;
}
return (JSBool)netscape_security_PrivilegeManager_canExtendTrust(
return (from == to) ||
(JSBool)netscape_security_PrivilegeManager_canExtendTrust(
env,
getPrivilegeManager(env),
from,
@ -2003,6 +2004,10 @@ LM_RegisterPrincipals(MochaDecoder *decoder, JSPrincipals *principals,
return principals;
}
if (inner == container) {
if (containerData->signedness == HAS_NO_SCRIPTS) {
lm_SetContainerPrincipals(cx, container, principals);
return principals;
}
/*
* Intersect principals and container principals,
* modifying the container principals.

Просмотреть файл

@ -27,7 +27,7 @@
#include "lm.h"
#include "prefapi.h"
#include "VerReg.h"
#ifdef JAVA
#ifdef MOZ_SMARTUPDATE
#include "softupdt.h"
#endif
#include "gui.h" /* XP_AppPlatform */
@ -203,22 +203,19 @@ JSBool PR_CALLBACK asd_get_version
JSBool PR_CALLBACK asd_start_update
(JSContext *cx, JSObject *obj, uint argc, jsval *argv, jsval *rval)
{
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
#ifdef MOZ_SMARTUPDATE
if (argc >= 2 && JSVAL_IS_STRING(argv[0]) &&
JSVAL_IS_INT(argv[1])) {
char* url = JS_GetStringBytes(JSVAL_TO_STRING(argv[0]));
/* Bookmarks is a hack, you should really get some SmartUpdate context */
MWContext* cx = XP_FindContextOfType(NULL, MWContextBookmarks);
#ifdef JAVA
MWContext* cx = FE_GetInitContext();
XP_Bool result = SU_StartSoftwareUpdate( cx, url,
NULL, NULL, NULL, JSVAL_TO_INT(argv[1]) );
#else
XP_Bool result = FALSE;
#endif
*rval = BOOLEAN_TO_JSVAL(result);
return JS_TRUE;
}
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
#endif
return JS_TRUE;
}
@ -233,7 +230,11 @@ JSBool PR_CALLBACK asd_conditional_update
(JSContext *cx, JSObject *obj, uint argc, jsval *argv, jsval *rval)
{
REGERR status = 0;
if (argc >= 4 && JSVAL_IS_STRING(argv[0]) &&
*rval = BOOLEAN_TO_JSVAL(JS_FALSE); /*INT_TO_JSVAL(status);*/
#ifdef MOZ_SMARTUPDATE
if (argc >= 4 && JSVAL_IS_STRING(argv[0]) &&
JSVAL_IS_STRING(argv[1]) &&
JSVAL_IS_OBJECT(argv[2]) &&
JSVAL_IS_INT(argv[3]))
@ -248,20 +249,15 @@ JSBool PR_CALLBACK asd_conditional_update
asd_objToVers(cx, versObj, &req_vers);
if ( asd_compareVersion(&req_vers, &curr_vers) > 0 ) {
char* url = JS_GetStringBytes(JSVAL_TO_STRING(argv[0]));
MWContext* cx = XP_FindContextOfType(NULL, MWContextBookmarks);
#ifdef JAVA
MWContext* cx = FE_GetInitContext();
XP_Bool result = SU_StartSoftwareUpdate( cx, url,
NULL, NULL, NULL, JSVAL_TO_INT(argv[3]) );
#else
XP_Bool result = FALSE;
#endif
*rval = BOOLEAN_TO_JSVAL(result);
return JS_TRUE;
}
}
}
*rval = BOOLEAN_TO_JSVAL(JS_FALSE); /*INT_TO_JSVAL(status);*/
#endif
return JS_TRUE;
}
@ -270,7 +266,7 @@ JSBool PR_CALLBACK asd_alert
{
if (argc >= 1 && JSVAL_IS_STRING(argv[0])) {
char* msg = JS_GetStringBytes(JSVAL_TO_STRING(argv[0]));
MWContext* ctx = XP_FindSomeContext();
MWContext* ctx = FE_GetInitContext();
if (ctx)
FE_Alert(ctx, msg);

0
lib/plugin/nsjvm.cpp Normal file
Просмотреть файл

Просмотреть файл

@ -222,6 +222,7 @@ localDefPref("news.directory", "");
localDefPref("security.directory", "");
pref("autoupdate.enabled", true);
pref("autoupdate.confirm_install", false);
pref("imap.io.mac.logging", false);

Просмотреть файл

@ -42,7 +42,7 @@ XP_BEGIN_PROTOS
typedef void * pw_ptr;
typedef enum {
typedef enum _PW_WindowType {
pwApplicationModal,
pwStandard
} PW_WindowType;